[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f6c05c83-4784-7017-187c-3262a3b45622@gmail.com>
Date: Sun, 1 Dec 2019 19:18:28 -0800
From: Florian Fainelli <f.fainelli@...il.com>
To: Andy Duan <fugang.duan@....com>, David Miller <davem@...emloft.net>
Cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [EXT] Re: [PATCH net,stable 1/1] net: fec: match the dev_id
between probe and remove
On 12/1/2019 7:04 PM, Andy Duan wrote:
> From: netdev-owner@...r.kernel.org <netdev-owner@...r.kernel.org> Sent: Sunday, December 1, 2019 4:28 AM
>> From: Andy Duan <fugang.duan@....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@...ansystech.com>
>>> Signed-off-by: Fugang Duan <fugang.duan@....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?
--
Florian
Powered by blists - more mailing lists