netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Duan <fugang.duan@nxp.com>
To: Florian Fainelli <f.fainelli@gmail.com>,
	David Miller <davem@davemloft.net>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: RE: [EXT] Re: [PATCH net,stable 1/1] net: fec: match the dev_id between probe and remove
Date: Mon, 2 Dec 2019 03:42:13 +0000	[thread overview]
Message-ID: <VI1PR0402MB3600C3F9F1DAA24EC6C81B79FF430@VI1PR0402MB3600.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <f6c05c83-4784-7017-187c-3262a3b45622@gmail.com>

From: Florian Fainelli <f.fainelli@gmail.com> Sent: Monday, December 2, 2019 11:18 AM
> On 12/1/2019 7:04 PM, Andy Duan wrote:
> > From: netdev-owner@vger.kernel.org <netdev-owner@vger.kernel.org>
> > Sent: Sunday, December 1, 2019 4:28 AM
> >> From: Andy Duan <fugang.duan@nxp.com>
> >> Date: Fri, 29 Nov 2019 06:40:28 +0000
> >>
> >>> Test device bind/unbind on i.MX8QM platform:
> >>> echo 5b040000.ethernet > /sys/bus/platform/drivers/fec/unbind
> >>> echo 5b040000.ethernet > /sys/bus/platform/drivers/fec/bind
> >>>
> >>> error log:
> >>> pps pps0: new PPS source ptp0 /sys/bus/platform/drivers/fec/bind
> >>> fec: probe of 5b040000.ethernet failed with error -2
> >>>
> >>> It should decrease the dev_id when device is unbinded. So let the
> >>> fec_dev_id as global variable and let the count match in
> >>> .probe() and .remvoe().
> >>>
> >>> Reported-by: shivani.patel <shivani.patel@volansystech.com>
> >>> Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
> >>
> >> This is not correct.
> >>
> >> Nothing says that there is a direct correlation between the devices
> >> added and the ones removed, nor the order in which these operations
> >> occur relative to eachother.
> >>
> >> This dev_id allocation is buggy because you aren't using a proper ID
> >> allocation scheme such as IDR.
> > David, you are correct. There still has issue to support bind/unbind
> > feature even if use IDR to allocate ID because enet instance#1 depend
> > on instance#0 internal MDIO bus for some platforms and we don't know
> who is the real instance#0 while binging the device.
> >
> > Do you have any suggestion to implement the bind/unbind feature with
> current dependence?
> > Thanks.
> 
> Can you use the device driver model to reflect the link between the MDIO bus
> device, its parent Ethernet controller and the second instance Ethernet
> controller? Be it through the use of device links, or an actual
> dev->parent relationship?

For device dependence, device links maybe the good solution.
Since there instance#1 only depends on instance#0 internal mdio bus,
maybe hive off mdio bus driver from instance@0 is a better solution.

@Florian Fainelli, Thanks for your suggestion.

Andy
> --
> Florian

      reply	other threads:[~2019-12-02  3:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-29  6:40 [PATCH net,stable 1/1] net: fec: match the dev_id between probe and remove Andy Duan
2019-11-30 20:27 ` David Miller
2019-12-02  3:04   ` [EXT] " Andy Duan
2019-12-02  3:18     ` Florian Fainelli
2019-12-02  3:42       ` Andy Duan [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=VI1PR0402MB3600C3F9F1DAA24EC6C81B79FF430@VI1PR0402MB3600.eurprd04.prod.outlook.com \
    --to=fugang.duan@nxp.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).