Linux-USB Archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Rengarajan.S@microchip.com
Cc: linux-usb@vger.kernel.org, davem@davemloft.net,
	Woojung.Huh@microchip.com, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org, pabeni@redhat.com, edumazet@google.com,
	UNGLinuxDriver@microchip.com, kuba@kernel.org
Subject: Re: [PATCH net v1] lan78xx: Fix crash with multiple device attach
Date: Wed, 8 May 2024 03:23:55 +0200	[thread overview]
Message-ID: <11243bb6-616c-49c9-a0d9-05fd80a5d628@lunn.ch> (raw)
In-Reply-To: <26d7f478dfa81cadd246771fb41c6763a4b19772.camel@microchip.com>

> The issue was when dual setup of LAN7801 with an external PHY(LAN8841
> in this case) are connected to the same DUT PC, the PC got hanged. The
> issue in seen with external phys only and not observed in case of
> internal PHY being connected(LAN7800). When we looked into the code
> flow we found that in phy_scan_fixup allocates a dev for the first
> device. Before it is unregistered, the second device is attached and
> since we already have a phydev it ignores and does not allocate dev for
> second device. This is the reason why we unregister the first device
> before the second device attach.

This is not making any sense to me.

What this driver is doing odd is registers a fixup per device. So if
you plug in 42 USB dongles, you get the same fixup registered 42
times.

What normally happens is that the fixup is registered once,
globally. So you probably want to move the registration of the fixup
into the module init function, and the unregister into the module exit
function.

	Andrew

      reply	other threads:[~2024-05-08  1:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-02  4:57 [PATCH net v1] lan78xx: Fix crash with multiple device attach Rengarajan S
2024-05-02  5:16 ` Greg KH
2024-05-06  9:38 ` Paolo Abeni
2024-05-07  5:07   ` Rengarajan.S
2024-05-08  1:23     ` Andrew Lunn [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=11243bb6-616c-49c9-a0d9-05fd80a5d628@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=Rengarajan.S@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=Woojung.Huh@microchip.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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 read-only IMAP folder(s) and NNTP newsgroup(s).