From: "ashiduka@fujitsu.com" <ashiduka@fujitsu.com>
To: 'Sergei Shtylyov' <sergei.shtylyov@gmail.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 10:18:09 +0000 [thread overview]
Message-ID: <OSAPR01MB3844C77766155CAB10BE296CDF4E0@OSAPR01MB3844.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <ce81e95d-b3b0-7f1c-8f97-8bdcb23d5a8e@gmail.com>
Hi Sergei,
I understand that the commit log needs to be corrected.
(Shimoda-san's point is also correct)
If there is anything else that needs to be corrected, please point it out.
> That seems a common pattern, inlluding the Renesas sh_eth
> driver...
Yes.
If I can get an R-Car Gen2 board, I will also fix sh_eth driver.
> No, the driver's remove() method calls ravb_mdio_release() and
> that one calls
> free_mdio_bitbang() that calls module_put(); the actual reason lies
> somewehre deeper than this...
No.
Running rmmod calls delete_module() in kernel/module.c before ravb_mdio_release() is called.
delete_module()
-> try_stop_module()
-> try_release_module_ref()
In try_release_module_ref(), check refcnt and if it is counted up, ravb_mdio_release() is not
called and rmmod is terminated.
Thanks & Best Regards,
Yuusuke Ashizuka <ashiduka@fujitsu.com>
> -----Original Message-----
> From: Sergei Shtylyov <sergei.shtylyov@gmail.com>
> Sent: Friday, July 31, 2020 1:04 AM
> To: Ashizuka, Yuusuke/芦塚 雄介 <ashiduka@fujitsu.com>
> Cc: netdev@vger.kernel.org; linux-renesas-soc@vger.kernel.org
> Subject: Re: [PATCH v2] ravb: Fixed the problem that rmmod can not
> be done
>
> Hello!
>
> On 7/30/20 1:01 PM, Yuusuke Ashizuka wrote:
>
> > ravb is a module driver, but I cannot rmmod it after insmod it.
>
> Modular. And "insmod'ing it".
>
> > ravb does mdio_init() at the time of probe, and module->refcnt
> is incremented
> > by alloc_mdio_bitbang() called after that.
>
> That seems a common pattern, inlluding the Renesas sh_eth
> driver...
>
> > Therefore, even if ifup is not performed, the driver is in use
> and rmmod cannot
> > be performed.
>
> No, the driver's remove() method calls ravb_mdio_release() and
> that one calls
> free_mdio_bitbang() that calls module_put(); the actual reason lies
> somewehre deeper
> than this... Unfortunately I don't have the affected hardware
> anymore... :-(
>
> [...]
>
> MBR, Sergei
next prev parent reply other threads:[~2020-07-31 10:25 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
2020-07-30 16:04 ` Sergei Shtylyov
2020-07-31 10:18 ` ashiduka [this message]
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=OSAPR01MB3844C77766155CAB10BE296CDF4E0@OSAPR01MB3844.jpnprd01.prod.outlook.com \
--to=ashiduka@fujitsu.com \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sergei.shtylyov@gmail.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).