public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Dongpo Li <lidongpo@hisilicon•com>
To: <Woojung.Huh@microchip•com>, <davem@davemloft•net>,
	<f.fainelli@gmail•com>
Cc: <andrew@lunn•ch>, <netdev@vger•kernel.org>,
	<UNGLinuxDriver@microchip•com>
Subject: Re: [PATCH v2 net-next 1/2] phy: add phy fixup unregister functions
Date: Fri, 16 Dec 2016 10:05:36 +0800	[thread overview]
Message-ID: <58534BF0.7030905@hisilicon.com> (raw)
In-Reply-To: <9235D6609DB808459E95D78E17F2E43D40981BCB@CHN-SV-EXMX02.mchp-main.com>


On 2016/12/14 23:34, Woojung.Huh@microchip•com wrote:
>> I just want to commit the unregister patch and found this patch. Good job!
>> But I consider this patch may miss something.
>> If one SoC has 2 MAC ports and each port uses the different network driver,
>> the 2 drivers may register fixup for the same PHY chip with different
>> "run" function because the PHY chip works in different mode.
>> In such a case, this patch doesn't consider "run" function and may cause
>> problem.
>> When removing the driver which register fixup at last, it will remove another
>> driver's fixup.
>> Should this condition be considered and fixed?
> Good point.
> Current phy fixup is independent LIST from phydev structure,
> and, fixup runs in two places of phy_device_register() and phy_init_hw().
> It's not clear that it needs two separate fixup, but it may be good idea to
> pass phy fixup when calling phy_attach() or phy_attach_direct() and
> put it under phydev structure.
> So, fixup can be called at phy_init_hw() per phy device and remove
> When phy detached.
> Welcome any comments.

I rethink this problem and find that the "fixup->bus_id" may be a flag to
distinguish different PHY device.
In such condition, the driver should call "phy_register_fixup/phy_unregister_fixup" directly
instead of "*_for_uid" interface.


    Regards,
    Dongpo

.

      reply	other threads:[~2016-12-16  2:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-07 20:26 [PATCH v2 net-next 1/2] phy: add phy fixup unregister functions Woojung.Huh
2016-12-14  8:39 ` Dongpo Li
2016-12-14 15:34   ` Woojung.Huh
2016-12-16  2:05     ` Dongpo Li [this message]

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=58534BF0.7030905@hisilicon.com \
    --to=lidongpo@hisilicon$(echo .)com \
    --cc=UNGLinuxDriver@microchip$(echo .)com \
    --cc=Woojung.Huh@microchip$(echo .)com \
    --cc=andrew@lunn$(echo .)ch \
    --cc=davem@davemloft$(echo .)net \
    --cc=f.fainelli@gmail$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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