Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp1340478pxv; Fri, 16 Jul 2021 07:13:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyNZGWsgeh6E/7v3ayyKzZzYYo5mS0db+65pyRl07YjDC8yIi0hkCkKSgud2zfW5uOVh9+ X-Received: by 2002:a17:907:11d0:: with SMTP id va16mr12374893ejb.87.1626444800315; Fri, 16 Jul 2021 07:13:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626444800; cv=none; d=google.com; s=arc-20160816; b=GN+QNPdx7dkSBQIq0k9Hd/nnvJAljNHStkqiFFNYQq0tmsp8JlASmZs61EEhZ7qhFO WDOhFLZjCuSvDhzjcUr4eU2JjD98sgVThCR2wCLN6g81dbSHqrYKAGWt5/n9q0J88tA+ 2fbd3lWmTx4+8pCzo1fFX9mrKr4epko2z46Xgsui7/wHs8t4y3wkWIxNltw8Lck33LTG +N87jxisKZd6Ph0T/s9L+uNqrhuUcgGfMnj/a2ic/+XsnXVSMmru+LuunsaP8/MTyOTY 17muWel9l6tTlo4uxabJXChBw0RVShq3olTCqR6GbV8TOold+zVjnZTj1dG/YmAbYI7o 3KkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature; bh=qZY0smo+O+Xk7iA7lzz8gDAiURl0BK1XyowcQM/UtiM=; b=YT9pRq5RE3YBPL9FN7/1copNtHzaPLPEZ7Ny1fDoUQiLqpF+KZD7Z7zon8wLtUI+U0 jOyhDjh54uLST9T644h347pwJrdhf5kruFK/Vy5o/q9q5BfrLT74yk0n0NnacGP6Wc8N T+r2vmgRxexRE9FOlEfJOZgNlzXNVLGLSbnwKJeTAI0+Vsh51WS9C9SfHA/sgukNMyL9 nQEtYQuQdTsuph0dsi+vGgomuKizyEtMqHNg4zlvpwzunb0P0GS6U+qHO196Gv0bcN/l U+JPsXICczfPI30HET5iHRkeILo22+G830N9dVwOgs2hGyZ//Q688LkvzOxvAEvm1EH0 XPDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=pQrhWDGD; dkim=neutral (no key) header.i=@suse.de header.b=+YIPDQXH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qb28si11405779ejc.651.2021.07.16.07.12.57; Fri, 16 Jul 2021 07:13:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=pQrhWDGD; dkim=neutral (no key) header.i=@suse.de header.b=+YIPDQXH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240194AbhGPOOj (ORCPT + 99 others); Fri, 16 Jul 2021 10:14:39 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:59598 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233040AbhGPOOj (ORCPT ); Fri, 16 Jul 2021 10:14:39 -0400 Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 823B322B46; Fri, 16 Jul 2021 14:11:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1626444703; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=qZY0smo+O+Xk7iA7lzz8gDAiURl0BK1XyowcQM/UtiM=; b=pQrhWDGDTiKDN16Qi3oehirpj9LgoFxfnXwRY7PRrj0cvkB0j4RZuTGc4B0nvWgxlmSycv Q4ebQ9v7hlyQ6ITOEoqZ03ykRsa8ObzGJCIPcq0ZUi74yp3u+GjQ3Qp7pR/LVjS/o0VBA9 5xGKgK4884qqjIXAjAkte0KWilAKr6c= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1626444703; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=qZY0smo+O+Xk7iA7lzz8gDAiURl0BK1XyowcQM/UtiM=; b=+YIPDQXHu0MZ2KzJWvt8YxlCNRVlfw1WDOkQCBvPoXKzwmVPiEWfR6n43SDzdloLBBSRI8 YFNTP/JJuwHgcXDA== Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap1.suse-dmz.suse.de (Postfix) with ESMTPS id 2558C13AF6; Fri, 16 Jul 2021 14:11:43 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id 5GVRBp+T8WCMTwAAGKfGzw (envelope-from ); Fri, 16 Jul 2021 14:11:43 +0000 From: "Ivan T. Ivanov" To: Andrew Lunn Cc: Heiner Kallweit , Russell King , "David S . Miller" , Jakub Kicinski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] net: phy: leds: Trigger leds only if PHY speed is known Date: Fri, 16 Jul 2021 17:11:42 +0300 Message-Id: <20210716141142.12710-1-iivanov@suse.de> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This prevents "No phy led trigger registered for speed(-1)" alert message which is coused by phy_led_trigger_chage_speed() being called during attaching phy to net_device where phy device speed could be still unknown. Signed-off-by: Ivan T. Ivanov --- drivers/net/phy/phy_led_triggers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/phy/phy_led_triggers.c b/drivers/net/phy/phy_led_triggers.c index f550576eb9da..4d6497c45ae4 100644 --- a/drivers/net/phy/phy_led_triggers.c +++ b/drivers/net/phy/phy_led_triggers.c @@ -33,7 +33,7 @@ void phy_led_trigger_change_speed(struct phy_device *phy) if (!phy->link) return phy_led_trigger_no_link(phy); - if (phy->speed == 0) + if (phy->speed == 0 || phy->speed == SPEED_UNKNOWN) return; plt = phy_speed_to_led_trigger(phy, phy->speed); -- 2.32.0