From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="Z2ChnBnC" Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::225]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E123A0; Mon, 20 Nov 2023 02:40:32 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 077931C000C; Mon, 20 Nov 2023 10:40:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700476830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aFDoD/sf7hb9m2oDJulcbKCtm+j0do0V7EoRgM61mz8=; b=Z2ChnBnCRgpveBlmH6q0kxQZj4TWlnHNku1bMn3gvXiRdAdr4nw9jUBm3X9v8h59YiwTlT 1cXbxA4t0+FroaiA4ZCIEujF7pBP4RKzkGNcyEp3jDDn5J8HMvidEAAlWfHUDXYFRHpay9 2O2lvIEL55KN9K+13Rvj78ScZDtjBoJgS8+zJ4hMr5/nVl6trktyU3AE3RqZOgG7JAPbwI n2Gywn0BA9BZrGU+36aU78oFEb7tdCem/62vikQM4NsXOvN+eG5m9l+WTb3qecNBQbksTC fL3kYMp8auXKtDvN55Joc5QA6L9NuKiQvkDrQYE/3TnPqsSpriD1pW92QFSaWg== Date: Mon, 20 Nov 2023 11:40:27 +0100 From: =?UTF-8?B?S8O2cnk=?= Maincent To: Jakub Kicinski Cc: Florian Fainelli , Broadcom internal kernel review list , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Paolo Abeni , Richard Cochran , Radu Pirea , Jay Vosburgh , Andy Gospodarek , Nicolas Ferre , Claudiu Beznea , Willem de Bruijn , Jonathan Corbet , Horatiu Vultur , UNGLinuxDriver@microchip.com, Simon Horman , Vladimir Oltean , Thomas Petazzoni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Maxime Chevallier Subject: Re: [PATCH net-next v7 08/16] net: ethtool: Add a command to expose current time stamping layer Message-ID: <20231120114027.225442b5@kmaincent-XPS-13-7390> In-Reply-To: <20231120101757.7ecf40b2@kmaincent-XPS-13-7390> References: <20231114-feature_ptp_netnext-v7-0-472e77951e40@bootlin.com> <20231114-feature_ptp_netnext-v7-8-472e77951e40@bootlin.com> <20231118182424.2d569940@kernel.org> <20231120101757.7ecf40b2@kmaincent-XPS-13-7390> Organization: bootlin X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Sasl: kory.maincent@bootlin.com On Mon, 20 Nov 2023 10:17:57 +0100 K=C3=B6ry Maincent wrote: > On Sat, 18 Nov 2023 18:24:24 -0800 > Jakub Kicinski wrote: >=20 > > On Tue, 14 Nov 2023 12:28:36 +0100 Kory Maincent wrote: =20 > > > + ops->get_ts_info(dev, &ts_info); > > > + if (ts_info.so_timestamping & > > > + SOF_TIMESTAMPING_HARDWARE_MASK) > > > + data->ts_layer =3D MAC_TIMESTAMPING; > > > + > > > + if (ts_info.so_timestamping & > > > + SOF_TIMESTAMPING_SOFTWARE_MASK) > > > + data->ts_layer =3D SOFTWARE_TIMESTAMPING; =20 > >=20 > > How does this work? so_timestamping is capabilities, not what's > > enabled now. So if driver supports SW stamping we always return > > SOFTWARE? =20 >=20 > Yes, the software timestamping comes from the MAC capabilities. > I decided to separate software and MAC timestamping. If we select PHY > timestamping we can't use software timestamping and for an user, selectin= g the > MAC as timestamping seems not logical to use software timestamping. >=20 > Indeed there is a mistake here I should have used "else if" condition. > Mmh in fact, maybe not, because it would breaks the access to software > timestamping until patch 13. > I will remove the SOFTWARE/MAC timestamping distinction from this patch. After thinking again, the "else if" condition works and won't break anythin= g as we could still access software timestamping within the MAC_TIMESTAMPING lay= er. Regards, --=20 K=C3=B6ry Maincent, Bootlin Embedded Linux and kernel engineering https://bootlin.com