Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5566543rdb; Wed, 13 Dec 2023 12:23:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IF1Myd5S9PyEKsZs4XrqTYC+WlS/VZoAxmbrRUC9EF6d9yF9hftocbe7iPOj0l9/mTWlv5b X-Received: by 2002:a05:6a21:78a8:b0:190:1258:3da3 with SMTP id bf40-20020a056a2178a800b0019012583da3mr12685091pzc.4.1702499002112; Wed, 13 Dec 2023 12:23:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702499002; cv=none; d=google.com; s=arc-20160816; b=DR8096tbmMsyaB0zI50/6EVEX81/0kbkKSNrDB+3C7j777kEDapfAX/pgtEETTvPlL sxkqquT5kN5uQVDkZBid/v7LX130NG5RRVSR6REWOe5Da+tjOfEv+zdKSA6EpSn4uNpp tZ4OwbkheFpSWd9voGGA6QavffTAvNJUic2CG6ZSMbem9TEvrAZJT7lRB+usPWju7J9T wpYNx62A8gSIAD1aIrDYmJKDO1/3ckvxnjBWIEPAGJ90JIemJ8mfDdD4WOJs7nE8Pqdt I29gYFpAURXy9IbK98JVg78nCaDhvj37EcoQ/9hgi3v9XZv42rwnJ7XWH9DmSVzvKqau /fXw== 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=dENc2lwzRLHtPKhKvuKHXjHSGuomugQdTgIHyUkfNP0=; fh=zhn7nAPGB77xqP4oCvjHyoI4PsN0sf10qVUbJJTJVg0=; b=KHt9MF8R14VBuF9hNc57zOjVC4Ic/422ICQuEwPoi/jHSZ1eQvH5JItk2I6JZVq8Lg 9vnw3l6zY3z0r8bzoFsYA2XrErziot9XY3Dm9/C4YmpbxYiKp/Hr7/5iBWAv8MkxJkYj vz/xV5eaEm2BjmQpGfAKIKirih9kzM0B1OuUqTJiokCurObFz0wyGX/RFMtKoU6qMLrs FMlLxPl3cq6FyfCnOvkWyetpQVI28um//1HNry0K/mg68CPQ1i88ANc7MWYX00M+JWjP 9RWrgsxzSHFMigUZvVuZajBEzeX0aAAPOsqXclujaj8EKLGYBKeNXltOzHNctcVlScl0 TIWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=fidtktW6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id m7-20020a635807000000b005c673949a8dsi10091712pgb.129.2023.12.13.12.23.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 12:23:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=fidtktW6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 8C3B980BC536; Wed, 13 Dec 2023 12:23:19 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233770AbjLMUXD (ORCPT + 99 others); Wed, 13 Dec 2023 15:23:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229811AbjLMUXC (ORCPT ); Wed, 13 Dec 2023 15:23:02 -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 4718A9C; Wed, 13 Dec 2023 12:23:09 -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=dENc2lwzRLHtPKhKvuKHXjHSGuomugQdTgIHyUkfNP0=; b=fidtktW6ZbPyKmdXpJNpVbMtIU SuBrlY8SgZjuCBH6zYr9ay3u0fefJagEFwhKZ9bOaHzDhAqAYE+o8Vj6wZNvWcYxWgpf3HesRBcQ3 HUPAOamNh9wfrrJh1GVpeN2CsNCbuS+eL4yy6MUluZkaidUQ31Vbzb3NeGDPIFC1CYsexhMIjPEEZ 1NcGS6J1W9UHN996xASg3HRJpctvkfTAbuH/1G2WdCNsWqqSCy+cETLG3u7sDzo3F9MxPl221Kxyb v6Lx/pKkL8e5f+KtGlrcFsrOoPjA52pbI6mou1AKqHhjxSnQK1pieGa9b94z0EtlWcqTtpThpLMrY QGmcIKlA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:47676) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1rDVkz-0000YT-1A; Wed, 13 Dec 2023 20:23:01 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1rDVkz-0001ow-GJ; Wed, 13 Dec 2023 20:23:01 +0000 Date: Wed, 13 Dec 2023 20:23:01 +0000 From: "Russell King (Oracle)" To: Daniel Golle Cc: Andrew Lunn , Maxime Chevallier , Heiner Kallweit , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 agentk.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 (agentk.vger.email [0.0.0.0]); Wed, 13 Dec 2023 12:23:19 -0800 (PST) On Wed, Dec 13, 2023 at 07:01:29PM +0000, Daniel Golle wrote: > On Wed, Dec 13, 2023 at 03:27:28PM +0000, Russell King (Oracle) wrote: > > 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 don't think a delayed work solves anything. Well, it solves the registration problem, but when the PHY is removed, you have to _synchronously_ cancel the delayed work, which could result in it waiting on the called work function to complete. If that called work function is waiting for the lock which we're holding on the remove path, then we're still in a deadlock-prone situation. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!