Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp1394020pxv; Fri, 16 Jul 2021 08:24:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzU7j6Tc6MORdlBa+LoESfJv8tI9jqM4NMDJ7EQxhuASRxDheEKfV+QSq/Avj66AhsjGMXm X-Received: by 2002:a50:8d8b:: with SMTP id r11mr15018530edh.217.1626449043555; Fri, 16 Jul 2021 08:24:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626449043; cv=none; d=google.com; s=arc-20160816; b=lkTR9zBvn6LLFs+GkECRfJbKsdg6ogQxEE3I1H2zz8cZqWLQn85WtoJfpKKzwpjD/K 8QSdfIVBVN7nixG1VZGxu+sDxLDeSXfTcTjPEapgAc9Nlg8jO/bVe2iyshAkw3SMGdCU nrRb0wTJd4uSWE1n3EZuuWnPuSrGVnOlL+aRR/xMJPrNAgOVUStk9pjAIsGNYFc2QKZu MAvaqQ9Fiq5r24GH3LCq/TxHxm0worjxfrTuwUkcdA/09EXCF0oOLyeacBDjg48mCGP8 1sz9n3WIRkl8jAmR3SOQlTnsHsz/Nuw3ZQ001J6uupGYHSE3My3wpEe7t7pt6ZGhFl06 tQew== 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:dkim-signature; bh=+OysL5c8lmZRG64sZoX1J1K8zinYFiO2rvQrX1ZbCWs=; b=j1YKlu/AfUuaA3l4UCEhogPDZSj5Sy3cF5HeaA9KGJqhjXqavVc9dsHIibySy1Gp8L 3jMglBr8GNwQ1kaWjq/lfWCi5Q98e7/ShaO3aqC/NHR4HjpInVQMmViNNLv0Bi40jDG+ MegXBFeMFg5x5pcazuRlN2AwhCN3AogYfuYM2WCFI1+jz/6w9x2bmcmB4UgW5AcRqlYi bO6EfCvcImVX0kLaSkaluBwzLmGCfNkMKkhT+B1bTjtR9S7Q7DhrEUNXNriHKCiUfs+d NtQnPE3h2qT/f22JY2MwY1rdbsgvnwr+72xZ1cYllofPucQ2oshq1qoNZiSlWB+GzNu9 lB/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b="A/NZT2E7"; 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 r16si12125958eda.37.2021.07.16.08.23.40; Fri, 16 Jul 2021 08:24:03 -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=@lunn.ch header.s=20171124 header.b="A/NZT2E7"; 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 S240860AbhGPPXH (ORCPT + 99 others); Fri, 16 Jul 2021 11:23:07 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:58566 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240845AbhGPPXF (ORCPT ); Fri, 16 Jul 2021 11:23:05 -0400 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=+OysL5c8lmZRG64sZoX1J1K8zinYFiO2rvQrX1ZbCWs=; b=A/NZT2E769dhviv4kHLez1dynx +Pxl/K1I6GlidVUBIJOkobnassWbC/UfYlAs+ztAiUmTPkIdk9hS6l2qGxW9NUrYOGrhdB19qJ8q6 XI+629ipGG0ip+k+Ac33TKg1QG7ZLGEZeVp7hB1Q0/azAJJzWK0RZfrKF2h3VYnDbf64=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1m4Pd8-00Dd6L-Dg; Fri, 16 Jul 2021 17:19:58 +0200 Date: Fri, 16 Jul 2021 17:19:58 +0200 From: Andrew Lunn To: "Ivan T. Ivanov" Cc: Heiner Kallweit , Russell King , "David S . Miller" , Jakub Kicinski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: phy: leds: Trigger leds only if PHY speed is known Message-ID: References: <20210716141142.12710-1-iivanov@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210716141142.12710-1-iivanov@suse.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 16, 2021 at 05:11:42PM +0300, Ivan T. Ivanov wrote: > 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. Hi Ivan It seems odd that when attaching the PHY we have link, but not the speed. What PHY is this? > - if (phy->speed == 0) > + if (phy->speed == 0 || phy->speed == SPEED_UNKNOWN) > return; This change makes sense. But i'm wondering if the original logic is sound. We have link, but no speed information. So the LED trigger is left in an indeterminate state. Rather than a plain return, maybe phy_led_trigger_no_link(phy) should be called? Andrew