mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Marco Felsch <m.felsch@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 3/7] net: phy: sync phy_{write,read,modify}_mmd_indirect with linux
Date: Mon, 10 Jul 2023 14:52:08 +0200	[thread overview]
Message-ID: <ec5edc94-c576-907f-85d2-13c49411b123@pengutronix.de> (raw)
In-Reply-To: <20230710124318.rfhfoxojpdijhj2g@pengutronix.de>

On 10.07.23 14:43, Marco Felsch wrote:
> On 23-07-10, Ahmad Fatoum wrote:
>> On 10.07.23 13:01, Marco Felsch wrote:
>>> On 23-07-10, Ahmad Fatoum wrote:
>>>> Hello Marco,
>>>>
>>>> On 10.07.23 12:49, Marco Felsch wrote:
>>>>> On 23-07-10, Ahmad Fatoum wrote:
>>>>>> On 10.07.23 08:36, Marco Felsch wrote:
>>>>>>> Sync the barebox phy_{write,read,modify}_mmd_indirect API with the Linux
>>>>>>> phy_{write,read,modify}_mmd API to make it easier and less error prone
>>>>>>> to port phy drivers. This also fixes the r8169 driver since this driver
>>>>>>> did not adapt the parameters while porting from Linux.
>>>>>>>
>>>>>>> The sync also aligns the function parameter `prtad` as well as the
>>>>>>> function documentation.
>>>>>>
>>>>>> This breaks out of tree board code in a subtle and annoying manner.
>>>>>
>>>>> Do we really need to care about out all-of-tree drivers/boards? If so,
>>>>> we need to ensure to not break any public function.
>>>>
>>>> Out-of-tree drivers not too much probably, but out-of-tree boards
>>>> are unfortunately the norm. Breaking the build can be justified,
>>>> but silent breaking by swapping arguments is not nice.
>>>
>>> And how do you ensure that a public API is only used by drivers? Don't
>>> get me wrong I got your point but if you update an out-of-tree board to
>>> a newer barebox version it may happen that something break. Therefore
>>> manufacturers should upstream there code to reduce the maintenance
>>> effort to a minimum :) I know we don't live in an ideal world :/
>>
>> Some breakage is ultimately unavoidable, but we can try to not needlessly
>> introduce silent breakage. Here we have a nice way out: We import the
>> Linux function with the Linux name and use that for upstream code. The old
>> function is marked deprecated and removed later on. Do you see an issue
>> with that?
> 
> The only problem I see is, that the Linux API does support C45 and C22
> and we don't. As said, we can implement it and make the C45 support a
> stub. From user perspective I would assume that the new API is working
> for both classes (like Linux). Therefore I kept the _indirect suffix
> since this makes it clear from API pov.

Error message on C45 sounds good to me. Swapping parameters without
function rename doesn't.

Cheers,
Ahmad

> 
> Regards,
>   Marco
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |




  reply	other threads:[~2023-07-10 12:53 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-10  6:36 [PATCH 1/7] ARM: boards: make use of MDIO_MMD register defines Marco Felsch
2023-07-10  6:36 ` [PATCH 2/7] net: phy: micrel: " Marco Felsch
2023-07-10  9:56   ` Ahmad Fatoum
2023-07-10 10:37     ` Marco Felsch
2023-07-10  6:36 ` [PATCH 3/7] net: phy: sync phy_{write,read,modify}_mmd_indirect with linux Marco Felsch
2023-07-10  9:59   ` Ahmad Fatoum
2023-07-10 10:49     ` Marco Felsch
2023-07-10 10:53       ` Ahmad Fatoum
2023-07-10 11:01         ` Marco Felsch
2023-07-10 11:03           ` Ahmad Fatoum
2023-07-10 12:43             ` Marco Felsch
2023-07-10 12:52               ` Ahmad Fatoum [this message]
2023-07-10  6:36 ` [PATCH 4/7] net: phy: add phydev_{err,err_probe,info,warn,dbg} macros Marco Felsch
2023-07-10 10:01   ` Ahmad Fatoum
2023-07-10  6:36 ` [PATCH 5/7] net: phy: at803x: add support for configuring SmartEEE Marco Felsch
2023-07-10 10:10   ` Ahmad Fatoum
2023-07-10 12:10     ` Oleksij Rempel
2023-07-10  6:36 ` [PATCH 6/7] net: phy: at803x: add disable hibernation mode support Marco Felsch
2023-07-10 10:07   ` Ahmad Fatoum
2023-07-10 10:53     ` Marco Felsch
2023-07-10 11:07       ` Ahmad Fatoum
2023-07-10  6:36 ` [PATCH 7/7] net: phy: at803x: disable extended next page bit Marco Felsch
2023-07-10 10:03   ` Ahmad Fatoum
2023-07-10  9:55 ` [PATCH 1/7] ARM: boards: make use of MDIO_MMD register defines Ahmad Fatoum

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=ec5edc94-c576-907f-85d2-13c49411b123@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=m.felsch@pengutronix.de \
    /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