From: Sergei Shtylyov <sergei.shtylyov@gmail.com>
To: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
Yuusuke Ashizuka <ashiduka@fujitsu.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-renesas-soc@vger.kernel.org"
<linux-renesas-soc@vger.kernel.org>
Subject: Re: [PATCH v2] ravb: Fixed the problem that rmmod can not be done
Date: Fri, 31 Jul 2020 20:45:02 +0300 [thread overview]
Message-ID: <97569264-fcf8-58cb-3ce7-9d569ad176e5@gmail.com> (raw)
In-Reply-To: <TY2PR01MB3692A94CD6479F2976458B0FD84E0@TY2PR01MB3692.jpnprd01.prod.outlook.com>
Hello!
On 7/31/20 9:43 AM, Yoshihiro Shimoda wrote:
>>>> From: Yuusuke Ashizuka, Sent: Thursday, July 30, 2020 7:02 PM
>>>> Subject: [PATCH v2] ravb: Fixed the problem that rmmod can not be done
>>>
>>> Thank you for the patch! I found a similar patch for another driver [1].
>>
>> It's not the same case -- that driver hadn't had the MDIO release code at all
>> before that patch.
>
> You're correct. I didn't realized it...
The patch description was somewhat incomplete there...
>>> So, we should apply this patch to the ravb driver.
>>
>> I believe the driver is innocent. :-)
>
> I hope so :)
Looks like I was wrong in this case. It's very fortunate that the MDIO bitbang
is not as popular as I thought.
> <snip>
>>>> $ lsmod
>>>> Module Size Used by
>>>> ravb 40960 1
>>>> $ rmmod ravb
>>>> rmmod: ERROR: Module ravb is in use
>>
>> Shouldn't the driver core call the remove() method for the affected devices
>> first, before checking the refcount?
>
> In this case, an mii bus of "mdiobb_ops bb_ops" is affected "device" by the ravb driver.
> And the ravb driver sets the owner of mii bus as THIS_MODULE like below:
>
> static struct mdiobb_ops bb_ops = {
> .owner = THIS_MODULE,
> .set_mdc = ravb_set_mdc,
> .set_mdio_dir = ravb_set_mdio_dir,
> .set_mdio_data = ravb_set_mdio_data,
> .get_mdio_data = ravb_get_mdio_data,
> };
>
> So, I don't think the driver core can call the remove() method for the mii bus
> because it's a part of the ravb driver...
And because the MDIO module just doesn't have the usual method! :-)
(I meant the EtherAVB driver's remove() method, and that one would be called after
a successful reference count check...)
> By the way, about the mdio-gpio driver, I'm wondering if the mdio-gpio
> driver cannot be removed by rmmod too. (perhaps, we need "rmmod -f" to remove it.)
You're on your own here. It's fortunate for this patch that I'm not currently loaded
at work! :-)
>>> By the way, I think you have to send this patch to the following maintainers too:
>>> # We can get it by using scripts/get_maintainers.pl.
>>> David S. Miller <davem@davemloft.net> (maintainer:NETWORKING DRIVERS,commit_signer:8/8=100%)
>>> Jakub Kicinski <kuba@kernel.org> (maintainer:NETWORKING DRIVERS)
Not critical, as DaveM uses the patchwork anyway. He started to be CC'ed on netdev patches
only recently. :-)
[...]
> Best regards,
> Yoshihiro Shimoda
MBR, Sergei
next prev parent reply other threads:[~2020-07-31 17:45 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-30 3:56 [PATCH] ravb: Fixed the problem that rmmod can not be done Yuusuke Ashizuka
2020-07-30 7:55 ` kernel test robot
2020-07-30 10:01 ` [PATCH v2] " Yuusuke Ashizuka
2020-07-30 11:37 ` Yoshihiro Shimoda
2020-07-30 16:24 ` Sergei Shtylyov
2020-07-31 6:43 ` Yoshihiro Shimoda
2020-07-31 17:45 ` Sergei Shtylyov [this message]
2020-07-30 16:04 ` Sergei Shtylyov
2020-07-31 10:18 ` ashiduka
2020-07-31 16:28 ` Sergei Shtylyov
2020-08-06 2:26 ` ashiduka
2020-07-31 18:32 ` Sergei Shtylyov
2020-08-06 2:28 ` ashiduka
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=97569264-fcf8-58cb-3ce7-9d569ad176e5@gmail.com \
--to=sergei.shtylyov@gmail.com \
--cc=ashiduka@fujitsu.com \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=yoshihiro.shimoda.uh@renesas.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;
as well as URLs for NNTP newsgroup(s).