From: Sergey Organov <sorganov@gmail.com>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Fugang Duan <fugang.duan@nxp.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Richard Cochran <richardcochran@gmail.com>
Subject: Re: [PATCH v2 net] net: fec: fix hardware time stamping by external devices
Date: Tue, 14 Jul 2020 17:35:36 +0300 [thread overview]
Message-ID: <87k0z6dv0n.fsf@osv.gnss.ru> (raw)
In-Reply-To: <20200714142324.oq7od3ylwd63ohyj@skbuf> (Vladimir Oltean's message of "Tue, 14 Jul 2020 17:23:24 +0300")
Vladimir Oltean <olteanv@gmail.com> writes:
> On Tue, Jul 14, 2020 at 03:39:04PM +0300, Sergey Organov wrote:
>> Vladimir Oltean <olteanv@gmail.com> writes:
>>
>> > On Mon, Jul 13, 2020 at 01:32:09AM +0300, Sergey Organov wrote:
>>
>> [...]
>>
>> >> > From the perspective of the mainline kernel, that can never happen.
>> >>
>> >> Yet in happened to me, and in some way because of the UAPI
>> >> deficiencies
>> >> I've mentioned, as ethtool has entirely separate code path, that
>> >> happens
>> >> to be correct for a long time already.
>> >>
>> >
>> > Yup, you are right:
>> >
>>
>> [...]
>>
>> > Very bad design choice indeed...
>> > Given the fact that the PHY timestamping needs massaging from MAC
>> > driver
>> > for plenty of other reasons, now of all things, ethtool just decided
>> > it's not going to consult the MAC driver about the PHC it intends to
>> > expose to user space, and just say "here's the PHY, deal with it". This
>> > is a structural bug, I would say.
>> >
>> >> > From your perspective as a developer, in your private work
>> >> > tree, where
>> >> > _you_ added the necessary wiring for PHY timestamping, I fully
>> >> > understand that this is exactly what happened _to_you_.
>> >> > I am not saying that PHY timestamping doesn't need this issue
>> >> > fixed. It
>> >> > does, and if it weren't for DSA, it would have simply been a "new
>> >> > feature", and it would have been ok to have everything in the same
>> >> > patch.
>> >>
>> >> Except that it's not a "new feature", but a bug-fix of an
>> >> existing one,
>> >> as I see it.
>> >>
>> >
>> > See above. It's clear that the intention of the PHY timestamping
>> > support
>> > is for MAC drivers to opt-in, otherwise some mechanism would have been
>> > devised such that not every single one of them would need to check for
>> > phy_has_hwtstamp() in .ndo_do_ioctl(). That simply doesn't scale. Also,
>> > it seems that automatically calling phy_ts_info from
>> > __ethtool_get_ts_info is not coherent with that intention.
>> >
>> > I need to think more about this. Anyway, if your aim is to "reduce
>> > confusion" for others walking in your foot steps, I think this is much
>> > worthier of your time: avoiding the inconsistent situation where
>> > the MAC
>> > driver is obviously not ready for PHY timestamping, however not all
>> > parts of the kernel are in agreement with that, and tell the user
>> > something else.
>>
>> You see, I have a problem on kernel 4.9.146. After I apply this patch,
>> the problem goes away, at least for FEC/PHY combo that I care about, and
>> chances are high that for DSA as well, according to your own expertise.
>> Why should I care what is or is not ready for what to get a bug-fix
>> patch into the kernel? Why should I guess some vague "intentions" or
>> spend my time elsewhere?
>>
>> Also please notice that if, as you suggest, I will propose only half of
>> the patch that will fix DSA only, then I will create confusion for
>> FEC/PHY users that will have no way to figure they need another part of
>> the fix to get their setup to work.
>>
>> Could we please finally agree that, as what I suggest is indeed a simple
>> bug-fix, we could safely let it into the kernel?
>>
>> Thanks,
>> -- Sergey
>
> I cannot contradict you, you have all the arguments on your side. The
> person who added support for "ethtool -T" in commit c8f3a8c31069
> ("ethtool: Introduce a method for getting time stamping capabilities.")
> made a fundamental mistake in that they exposed broken functionality to
> the user, in case CONFIG_NETWORK_PHY_TIMESTAMPING is enabled and the MAC
> driver doesn't fulfill the requirements, be they skb_tx_timestamp(),
> phy_has_hwtstamp() and what not. So, therefore, any patch that is adding
> PHY timestamping compatibility in a MAC driver can rightfully claim that
> it is fixing a bug, a sloppy design. Fair enough.
OK, thanks!
>
> The only reason why I mentioned about spending your time on useful
> things is because in your previous series you seemed to be concerned
> about that. In retrospect, I believe you agree with me that your
> confusion would have been significantly lower if the output of "ethtool
> -T" was in harmony with the actual source of hardware timestamps.
> Now that we discussed it through and I did see your point, I just
> suggested what I believe to be the fundamental issue here, don't shoot
> the messenger. Of course you are free to spend your time however you
> want to.
I do care about these things indeed, it's only that right now what I
care most is to get the fixes into the kernel.
Then we can think without hurry about how all this could be improved.
> Acked-by: Vladimir Oltean <olteanv@gmail.com>
Thanks for reviewing, and again for helpful and beneficial discussion!
-- Sergey
next prev parent reply other threads:[~2020-07-14 14:35 UTC|newest]
Thread overview: 66+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-06 14:26 [PATCH 0/5] net: fec: fix external PTP PHY support Sergey Organov
2020-07-06 14:26 ` [PATCH 1/5] net: fec: properly support external PTP PHY for hardware time stamping Sergey Organov
2020-07-06 15:08 ` Vladimir Oltean
2020-07-06 15:21 ` Sergey Organov
2020-07-06 15:47 ` Vladimir Oltean
2020-07-06 18:33 ` Sergey Organov
2020-07-07 7:04 ` Vladimir Oltean
2020-07-07 15:29 ` Sergey Organov
2020-07-08 11:00 ` Richard Cochran
2020-07-08 10:55 ` Richard Cochran
2020-07-06 14:26 ` [PATCH 2/5] net: fec: enable to use PPS feature without " Sergey Organov
2020-07-07 4:05 ` [EXT] " Andy Duan
2020-07-07 14:29 ` Sergey Organov
2020-07-06 14:26 ` [PATCH 3/5] net: fec: initialize clock with 0 rather than current kernel time Sergey Organov
2020-07-06 15:27 ` Vladimir Oltean
2020-07-06 18:24 ` Sergey Organov
2020-07-07 6:36 ` Vladimir Oltean
2020-07-07 16:07 ` Sergey Organov
2020-07-07 16:43 ` Vladimir Oltean
2020-07-07 17:09 ` Sergey Organov
2020-07-07 17:12 ` Vladimir Oltean
2020-07-07 17:56 ` Sergey Organov
2020-07-08 11:15 ` Richard Cochran
2020-07-08 12:14 ` Sergey Organov
2020-07-08 11:11 ` Richard Cochran
2020-07-08 11:04 ` Richard Cochran
2020-07-08 12:24 ` Sergey Organov
2020-07-08 12:37 ` Sergey Organov
2020-07-08 14:48 ` Richard Cochran
2020-07-08 17:18 ` Sergey Organov
2020-07-06 14:26 ` [PATCH 4/5] net: fec: get rid of redundant code in fec_ptp_set() Sergey Organov
2020-07-07 4:08 ` [EXT] " Andy Duan
2020-07-07 14:43 ` Sergey Organov
2020-07-08 5:34 ` Andy Duan
2020-07-08 8:48 ` Sergey Organov
2020-07-08 8:57 ` Andy Duan
2020-07-08 12:26 ` Sergey Organov
2020-07-06 14:26 ` [PATCH 5/5] net: fec: replace snprintf() with strlcpy() in fec_ptp_init() Sergey Organov
2020-07-11 12:08 ` [PATCH v2 net] net: fec: fix hardware time stamping by external devices Sergey Organov
2020-07-11 23:19 ` Vladimir Oltean
2020-07-12 14:16 ` Sergey Organov
2020-07-12 14:47 ` Andrew Lunn
2020-07-12 15:01 ` Vladimir Oltean
2020-07-12 17:29 ` Sergey Organov
2020-07-12 19:33 ` Vladimir Oltean
2020-07-12 22:32 ` Sergey Organov
2020-07-12 23:15 ` Vladimir Oltean
2020-07-14 12:39 ` Sergey Organov
2020-07-14 14:23 ` Vladimir Oltean
2020-07-14 14:35 ` Sergey Organov [this message]
2020-07-14 14:44 ` Vladimir Oltean
2020-07-14 16:18 ` Sergey Organov
2020-07-14 14:01 ` Richard Cochran
2020-07-14 14:27 ` Sergey Organov
2020-07-14 16:28 ` [PATCH v3 " Sergey Organov
2020-07-16 18:24 ` Jakub Kicinski
2020-07-16 20:38 ` Sergey Organov
2020-07-16 21:06 ` Jakub Kicinski
2020-07-16 21:18 ` Sergey Organov
2020-07-15 15:42 ` [PATCH net-next v2 0/4] net: fec: a few improvements Sergey Organov
2020-07-15 15:42 ` [PATCH net-next v2 1/4] net: fec: enable to use PPS feature without time stamping Sergey Organov
2020-07-15 15:42 ` [PATCH net-next v2 2/4] net: fec: initialize clock with 0 rather than current kernel time Sergey Organov
2020-07-15 15:42 ` [PATCH net-next v2 3/4] net: fec: get rid of redundant code in fec_ptp_set() Sergey Organov
2020-07-15 15:43 ` [PATCH net-next v2 4/4] net: fec: replace snprintf() with strlcpy() in fec_ptp_init() Sergey Organov
2020-07-16 3:00 ` [EXT] [PATCH net-next v2 0/4] net: fec: a few improvements Andy Duan
2020-07-16 18:37 ` Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87k0z6dv0n.fsf@osv.gnss.ru \
--to=sorganov@gmail.com \
--cc=davem@davemloft.net \
--cc=fugang.duan@nxp.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=richardcochran@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox