All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Grant Grundler <grundler@chromium.org>
Cc: Oleksij Rempel <linux@rempel-privat.de>,
	Pavel Skripkin <paskripkin@gmail.com>,
	Lukas Wunner <lukas@wunner.de>,
	Eizan Miyamoto <eizan@chromium.org>,
	Jakub Kicinski <kuba@kernel.org>, netdev <netdev@vger.kernel.org>,
	"David S . Miller" <davem@davemloft.net>,
	LKML <linux-kernel@vger.kernel.org>,
	Anton Lundin <glance@acc.umu.se>
Subject: Re: [PATCHv3 net 1/2] net: asix: fix modprobe "sysfs: cannot create duplicate filename"
Date: Thu, 9 Mar 2023 12:19:29 +0100	[thread overview]
Message-ID: <ZAnAwQ1LO81F6ssZ@nanopsycho> (raw)
In-Reply-To: <20230308202159.2419227-1-grundler@chromium.org>

Wed, Mar 08, 2023 at 09:21:58PM CET, grundler@chromium.org wrote:
>"modprobe asix ; rmmod asix ; modprobe asix" fails with:
>   sysfs: cannot create duplicate filename \
>   	'/devices/virtual/mdio_bus/usb-003:004'
>
>Issue was originally reported by Anton Lundin on 2022-06-22 14:16 UTC:
>
>Chrome OS team hit the same issue in Feb, 2023 when trying to find
>work arounds for other issues with AX88172 devices.
>
>The use of devm_mdiobus_register() with usbnet devices results in the
>MDIO data being associated with the USB device. When the asix driver
>is unloaded, the USB device continues to exist and the corresponding
>"mdiobus_unregister()" is NOT called until the USB device is unplugged
>or unauthorized. So the next "modprobe asix" will fail because the MDIO
>phy sysfs attributes still exist.
>
>The 'easy' (from a design PoV) fix is to use the non-devm variants of
>mdiobus_* functions and explicitly manage this use in the asix_bind
>and asix_unbind function calls. I've not explored trying to fix usbnet
>initialization so devm_* stuff will work.
>
>Fixes: e532a096be0e ("net: usb: asix: ax88772: add phylib support")
>Reported-by: Anton Lundin <glance@acc.umu.se>
>Link: https://lore.kernel.org/netdev/20220623063649.GD23685@pengutronix.de/T/
>Tested-by: Eizan Miyamoto <eizan@chromium.org>
>Signed-off-by: Grant Grundler <grundler@chromium.org>

Reviewed-by: Jiri Pirko <jiri@nvidia.com>

      parent reply	other threads:[~2023-03-09 11:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-08 20:21 [PATCHv3 net 1/2] net: asix: fix modprobe "sysfs: cannot create duplicate filename" Grant Grundler
2023-03-08 20:21 ` [PATCHv3 net 2/2] net: asix: init mdiobus from one function Grant Grundler
2023-03-09 11:20   ` Jiri Pirko
2023-03-09 19:05     ` Grant Grundler
2023-03-09 19:30       ` Andrew Lunn
2023-03-09 19:53         ` Grant Grundler
2023-03-10  6:16           ` Jakub Kicinski
2023-03-10  6:29             ` Jakub Kicinski
2023-03-09 11:19 ` Jiri Pirko [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=ZAnAwQ1LO81F6ssZ@nanopsycho \
    --to=jiri@resnulli.us \
    --cc=davem@davemloft.net \
    --cc=eizan@chromium.org \
    --cc=glance@acc.umu.se \
    --cc=grundler@chromium.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rempel-privat.de \
    --cc=lukas@wunner.de \
    --cc=netdev@vger.kernel.org \
    --cc=paskripkin@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.