Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6122564rdb; Thu, 14 Dec 2023 08:53:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IGCA+INmq8b6tz+Rp7zMrecfYHWxnoZzy46O9dnHJHjJ0z44xGh62U4lBdbviBUsZ30Tk2Z X-Received: by 2002:a17:903:2347:b0:1d3:6b17:67ca with SMTP id c7-20020a170903234700b001d36b1767camr1359786plh.98.1702572801424; Thu, 14 Dec 2023 08:53:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702572801; cv=none; d=google.com; s=arc-20160816; b=f8GLzl3CUkgxe65d79x1DNjCB6pTq6V+yUlr21+78uRSUsbw6+oghNplxqFLZS4DMz nfoa2IMVP2BX4l9U6YAD+0PTHkHa0tCKGWXKlAtgxfciY89b6sEbTnVwGFA/oDcIGTan 4EREO5WDi8TKXVx+iOUvOZW58gJVyVpo0TgXQZbAcvnn7HBe141UtT91f7pRipQ8ft98 Sz0fYtzPXXE3+b+kSPTZz6azHtXv1ragCCirA87Yetlw9WZ6D+SX5O/ZfdfAgVHVoLlU a5joQr8wEAyuZQJfwjtH8k9teGxhSy2HTWbMlwQcOfyj0Cp2TBFDzCFC9cfPKsDrBdUO 9+2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=M7C3YssKmJsxGBEluHaWA69lXkTVL4pmL4B1VN2PfJM=; fh=fN/Qa+ZRWwCOhNmJmOmhPMLNX40YTjIbAcwwCaxWECY=; b=KTBjRPZlDDvY/72hD0vRdVGCRiCRDdaAU3Qt8M4qh4uHvd86IfDclXwaozokbxLgM7 tO0vLY/jE5ZLa+Tl21yJ3K0UwSH096gzQe31jH4pC5nhPGftIrlrS9lNzif9ZH4Rw6CW zcaN22eIGdSw5s/62dE5120walqsh4GYcjtRXGjfVf05Wz6CMfigpgLFY/dwrcodDA+7 LPKKuc6khumBfUS6sPOg6YyjsrbGUWP2hEhR7mrsIlX7tN14/O9pndwoLBsy5lCbFxWP OPpYbaIEsuEMWzfI4dRI2puAr+kt3Zps7RZBtME0h0HPPD4gUpir/oO6FqAbH/X4fcew IfAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=njbDHnBX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id i1-20020a17090332c100b001bc434b9d95si11732888plr.156.2023.12.14.08.53.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 08:53:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=njbDHnBX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 2C83085BF2D9; Thu, 14 Dec 2023 08:53:17 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443574AbjLNQwq (ORCPT + 99 others); Thu, 14 Dec 2023 11:52:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235578AbjLNQw1 (ORCPT ); Thu, 14 Dec 2023 11:52:27 -0500 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB70013A; Thu, 14 Dec 2023 08:52:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=M7C3YssKmJsxGBEluHaWA69lXkTVL4pmL4B1VN2PfJM=; b=njbDHnBXo/4CZ5TW/9QHjgP+op O1DvEWpirBBAprMPXTd3TcCJmpQnLPbdj15PY9aUhGLioRC4nQq48hNirJW/InQzbdarjXzlmkpCX rPpUa4pNqBQgKMIY5OdmE5Mymzvzt4YoaHV9lfINAS/fQQYZgdijYXqVCjm3Atpjz4FP24V5C1n2l FebFjYxAAqodAWtAZFIl1fvGuz+qu2H8+hDMFqrRa6EUUHZNRIazfxTEF+qLF2iV3PxjG+0gfIdHa 4UHlE7Igpmk9pvZeTKZgZ08MwBLsdeeT7yXDOCHASmq6O3wgL9flf2CZpt/ptkHmJ88GQTwqy5RGJ mnz7CgXA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:48364) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1rDowR-0001hc-16; Thu, 14 Dec 2023 16:52:07 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1rDowR-0002hF-MG; Thu, 14 Dec 2023 16:52:07 +0000 Date: Thu, 14 Dec 2023 16:52:07 +0000 From: "Russell King (Oracle)" To: Paolo Abeni Cc: Daniel Golle , Andrew Lunn , Maxime Chevallier , Heiner Kallweit , "David S. Miller" , Eric Dumazet , Jakub Kicinski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net] net: phy: skip LED triggers on PHYs on SFP modules Message-ID: References: <102a9dce38bdf00215735d04cd4704458273ad9c.1702339354.git.daniel@makrotopia.org> <20231212153512.67a7a35b@device.home> <6dd8d8b62d6db979d6c2197a4091ebc768e6610a.camel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6dd8d8b62d6db979d6c2197a4091ebc768e6610a.camel@redhat.com> Sender: Russell King (Oracle) X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 14 Dec 2023 08:53:17 -0800 (PST) On Thu, Dec 14, 2023 at 10:48:10AM +0100, Paolo Abeni wrote: > On Wed, 2023-12-13 at 19:01 +0000, Daniel Golle wrote: > > On Wed, Dec 13, 2023 at 03:27:28PM +0000, Russell King (Oracle) wrote: > > > On Wed, Dec 13, 2023 at 10:08:25AM +0100, Andrew Lunn wrote: > > > > On Tue, Dec 12, 2023 at 03:35:12PM +0100, Maxime Chevallier wrote: > > > > > Hi Daniel > > > > > > > > > > On Tue, 12 Dec 2023 00:05:35 +0000 > > > > > Daniel Golle wrote: > > > > > > > > > > > Calling led_trigger_register() when attaching a PHY located on an SFP > > > > > > module potentially (and practically) leads into a deadlock. > > > > > > Fix this by not calling led_trigger_register() for PHYs localted on SFP > > > > > > modules as such modules actually never got any LEDs. > > > > > > > > > > While I don't have a fix for this issue, I think your justification > > > > > isn't good. This isn't about having LEDs on the module or not, but > > > > > rather the PHY triggering LED events for LEDS that can be located > > > > > somewhere else on the system (like the front pannel of a switch). > > > > > > > > SFP LEDs are very unlikely to be on the front panel, since there is no > > > > such pins on the SFP cage. > > > > > > > > Russell, in your collection of SFPs do you have any with LEDs? > > > > > > No, and we should _not_ mess around with the "LED" configuration on > > > PHYs on SFPs. It's possible that the LED output is wired to the LOS > > > pin on the module, and messing around with the configuration of that > > > would be asking for trouble. > > > > > > In any case, I thought we didn't drive the LED configuration on PHYs > > > where the LED configuration isn't described by firmware - and as the > > > PHY on SFP modules would never be described by firmware, hooking > > > such a PHY up to the LED framework sounds like a waste of resources > > > to me. > > > > This was exactly my line of thought when posting the patch, however, > > Maxime correctly pointed out that the issue with locking and also > > what the patch prevents is registration of LED *triggers* rather than > > the PHY-controlled LEDs themselves. And having the triggers available > > is desirable even beyond the hardware offloaded case (which is probably > > the aspect we both were dealing with the most recently and hence had in > > mind). It is common to control another system SoC GPIO driven LED(s) > > representing the link status and rx/tx traffic, for example. > > > > So better we get to the core of it and fix the locking issue > > (for example by registering LED trigger asynchronously using > > delayed_work)... > > I understand you are looking for a different solution, so let me mark > this patch accordingly. > > -- > pw-bot: cr I disagree with that - analysing the locking and coming up with a fix is likely going to be a lengthy affair, meanwhile the mainline kernel will deadlock on this. This patch prevents that deadlock at the expense of removing the LED triggers for the PHY-on-SFP which I don't think is a big deal considering the age of the PHY-based LED triggers. So I personally would prefer this patch to be merged while a different solution (that we have little idea at this point what it would look like) is sought. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!