Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp212228lqo; Tue, 7 May 2024 18:24:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVyZDulYU3mjt5xnHruO44MYhiRyXUWInup/JjllF9VdbpwY8f8bXLt+RKHkYe7/F+DgwETt36oX4VzaSKUMJeFZM68gWdHYQNcWNRxVA== X-Google-Smtp-Source: AGHT+IGvZsYY0f/1b6y6wLBv6qh9WVxjSBUnbmJecgqtScpnyFPDLA1ZHAa346qirduP2NcadVrs X-Received: by 2002:a25:5505:0:b0:de5:5cfa:a2f8 with SMTP id 3f1490d57ef6-debb9dc0d4emr1304871276.53.1715131453473; Tue, 07 May 2024 18:24:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715131453; cv=pass; d=google.com; s=arc-20160816; b=bn1KvSgYD405FRVXOhhBOy/oBKAl5FAHRECS54CEl9xLyNIlqoOxZVHilEVe+NYoYm YPeKaW11+eXhrV4cLzWKBx2bJC3JHdQgDNldLbAOc6gBq1+D4Bln9ZjNsx8vVUGud/7N m2MBpuGWFAx3BD33qHFmFl/OMtwHj77ymdm/H1FT+D40CSC6hkD8ZbCZt+HR+KIdm9xS cZqUYG3OPGa2Kykuhf37Q9qDF8bra/m5Gh9EFY/jIKBEFhY2HK++9jYXnj+YBBoHDdgB tis/6xtxyLWDQ/6bC3ePE2vq7Lhs2j8xlQmFNLbioNaIYe0/3JdotHaAuqbDo75iOwX3 K7IQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=jgAq83NBqzd1KulTfybNaWWoEA54VnjIVFptLf0iddk=; fh=/FWSHHOPBJMIB0XzOF3e7MkN3JZijv01SBujxVwJF3k=; b=B6Qzk2750SticTmREdjv9fKwkoZeNngV+Q1ErRYH93i5dZ0geu9F5QWyeHfBvmLuJ7 pthdgrlc4wvTurwsehWbpIsehp0qCvJpne2zajt4BYnQeRt0ztaieH/RTWjNZENPm9uG B8gDbnM/E5hJLDy8HfioNumgzOba51wYlKc82UHy+Vg6dHWMLyxYyBxukrE9SqEkdzoB Mo/AmvhaSxdzqGYUKZikwRAQxsfBgR4iTiDA7iMdNfls5N+ee21o5iOOA7dU430R/XNI 2BFD9UDpOa+upC54l2V5pZkhir9v8lysgMweTwZ+bULI+E3DK2MgDCRen4ut+8ihnGK2 9JJw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=o4sHlZlq; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-172589-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172589-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id ha13-20020a05622a2b0d00b0043a29fe91f7si11893272qtb.781.2024.05.07.18.24.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 18:24:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-172589-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=o4sHlZlq; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-172589-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172589-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 3561C1C21AD0 for ; Wed, 8 May 2024 01:24:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3CDFFB640; Wed, 8 May 2024 01:24:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="o4sHlZlq" Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0E64E8BE7; Wed, 8 May 2024 01:23:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=156.67.10.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715131441; cv=none; b=lJ9T1arbKy4mhhcy+eHvCQdUhE0QJaD5wAcOSdUZdHo+7WwD5uDavvigoi45S4P40oOoq531yexbZMXmoNcERmPT+UMa5OBS9HlKVt9Ukgo+0iti1G8HU2kO2nApCrSqgDvuQWVCbdhT3c/L8dpEhixJw6ej5L21N6p2qWd4uNE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715131441; c=relaxed/simple; bh=zqONLFMZ+RLV3aTxjTbrd/tY9/NPSf6XlJ1rkIP09Ss=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=EnCYAtY+KsqShijKd2T2tO3DZ7uUXyfrkobNn27l+yLdvFvfD5iLJdIjdOlxbhxI1jAiVRfe7jsK1+ESdMlpfqHNAlmOFhQwdEvFlh/pAJLDz0RHJnuyXC3BhyuWaf7NjF5Mklnons8Q1SnaSLLfk4+9gD5LregPjvzlE1Og7PA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b=o4sHlZlq; arc=none smtp.client-ip=156.67.10.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=jgAq83NBqzd1KulTfybNaWWoEA54VnjIVFptLf0iddk=; b=o4sHlZlqud6Rz3E/RmXQjl0TzI DR6VPg+oC5LHlE8LO9ZdJnwhFckAHZ+ru5mqwpUkyInVrysGl60c8xWS+7K2CShlukpQqlCJANJia OezspopvMeH2PdM1v4K7qxp1HGnl4n3/rjLoFu5mtQ37LzPNjqFyUAxKLpSeBWCauKXI=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1s4W2F-00Eu8q-Dj; Wed, 08 May 2024 03:23:55 +0200 Date: Wed, 8 May 2024 03:23:55 +0200 From: Andrew Lunn 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 Message-ID: <11243bb6-616c-49c9-a0d9-05fd80a5d628@lunn.ch> References: <20240502045748.37627-1-rengarajan.s@microchip.com> <1706dd2a3d24462780599f57e379fa2a1e8e15ac.camel@redhat.com> <26d7f478dfa81cadd246771fb41c6763a4b19772.camel@microchip.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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