Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5523591rdb; Wed, 13 Dec 2023 11:02:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IHZIk1rogKNhdjYSgzyBJI9faw+47pF8wTQn0S1IK0S0eueivu3AQaSOyjZ1V3nAavkOieJ X-Received: by 2002:a05:6a20:8e0e:b0:18d:1321:c28a with SMTP id y14-20020a056a208e0e00b0018d1321c28amr5038558pzj.10.1702494148536; Wed, 13 Dec 2023 11:02:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702494148; cv=none; d=google.com; s=arc-20160816; b=I+DlLK+Tpwkl4YjeVWs2KMfsJzKjT7ZKcYviXwIaF6oj7By3NMV5vNavweV2e8QfSk aZ/LHXHCbmXm4YjL8i91xrodryRW6F/9caRRBuQpz8LwpKRTkJrsP3NFUWp8KO+FCRfr sH9oMf3WoF4joOg6g4vFhEX6JGPn96moeQpx23r7gaeNroVTNfS0ROaASPoqehZPCinT vDsBaoROtanqTHdrpJhUBRecYmFP8P83GqFbqHo27uAegt6HdsnFP7XZv9Z2nGWGuLXK XJ2GuiGFGzS+mP/oAl1TIT7VwVwzfysiou+QHqbvfBT3xgkwKyjfRLlCYGvc5asl6XdY uqxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=zMmhaVSlr738M5HbJeY7GXLT583iQTYlMoB7bTHUeCw=; fh=CSQh35ywEon29ztmevmr5LXICpXkGU2+km8p/zsgiLw=; b=AoGQC1+y7Eb4pBsvh8+RKG19EMrjCJaQJWQvDt9QgmOcrvIRZhdKukHC4+5xPLm+n2 dDeYmhMtBvwX2hlyqER25cYG6pEEUmDv4NjP1QLzhbktIA1mdZWuhElvEJ8VVBbOsnoL PN7zjLjxlK9443IMvY9ExWiZPSMh9posr5iosSuJNCgDuhn5WBdgTC3vfSRVP0ZoY1zy 6SQ5xqbOszyPPydGLXWlU4/eJ8iFqzS3pBBUGnM16z9uRwqxsPaBbX2wv9YJdExirLB8 p6G9/3C0gQ76LWpLwxYEtbmkYnlf30c8dZbMB8hA37Z94ZQXfOSXhdpGHn5Ay99jOdK7 +I5A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id fj38-20020a056a003a2600b006be04b8c3basi10008850pfb.178.2023.12.13.11.02.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 11:02:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 1CFC080930DC; Wed, 13 Dec 2023 11:02:11 -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 S235384AbjLMTBy (ORCPT + 99 others); Wed, 13 Dec 2023 14:01:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235434AbjLMTBv (ORCPT ); Wed, 13 Dec 2023 14:01:51 -0500 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4ED13E8; Wed, 13 Dec 2023 11:01:55 -0800 (PST) Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96.2) (envelope-from ) id 1rDUUC-0004pP-1q; Wed, 13 Dec 2023 19:01:37 +0000 Date: Wed, 13 Dec 2023 19:01:29 +0000 From: Daniel Golle To: "Russell King (Oracle)" 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: X-Spam-Status: No, score=-0.8 required=5.0 tests=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]); Wed, 13 Dec 2023 11:02:11 -0800 (PST) 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)...