Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp144712pxf; Wed, 17 Mar 2021 01:19:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtU0D8Phv7fvwvI0XdccL14sJYgiRG9UDuoRlItE3wKJpXwXTWjn/6uah4Rsn+/XoCcAdH X-Received: by 2002:a17:906:1f42:: with SMTP id d2mr33995087ejk.297.1615969164766; Wed, 17 Mar 2021 01:19:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615969164; cv=none; d=google.com; s=arc-20160816; b=uXgqhqWrmfnpXkSRcYmnufe1bT4SlTFYUlXFs+wLYAiNxDlOnH4/UGlkgSF4WD4P1d jXDA6cw4mrj77UgUSe0GWjT3kygNzOjE2PCfK0pudBgUH2wflMuVXjkmbDr5CphZlSL7 hnJQIri6ji79UyBJYBylXdkmcbAMDx4jvB+K+7WmtUhDMGlvBxdepkEwyPlc5gFMXZFo wn9EzsJMMyZa12fYrtozq5OWzYmgEFiMZOeHlgfnJygBEUPiouu2PNFUXFGEcESixC56 Fsl6AHZVVfdBd2tsKXcZ0FnKbug2Fvp/W/XAWfx8aT+SJmo2qQeNA0krmGif3zoS0sXC y0Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=2C2nS2FuL5jIhqAY/uOCR718M7JpaJd6K5UxD7QBZ0c=; b=KuBfb6ydZe2i4uhuChCAuhb93FF6eZIz+gLbVyh4UfkPcyP/FRLkskuF9YN7BwtmD7 qKpgavvsALJHtfeXkDZdq+EnU2Glz8nX6fUJWavFw2gug6p4UzmNTJ672ThG/yi+zhz1 vr/yZ9hY0rcQFTt0VqPqAwzgDHOewvb3tNDs8s6Mgm8cIJCP8kDEL03idAVFFWwlzqSi V/EC/NwRUHpnlsxRDhigGnGCdoUy2L3brGwi9n2U8/tKDFZSrdLqfZUTlzy8iGgKqWsF 2Tklz4X4fWMzSC+gkkDOUlBPZHelK11di7XfNV6+zNcDjZztp7VPvTqhZZNgkx2P2JNE Mnaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gKEcCTAz; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e19si17540027edj.230.2021.03.17.01.19.02; Wed, 17 Mar 2021 01:19:24 -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=@gmail.com header.s=20161025 header.b=gKEcCTAz; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229526AbhCQIPh (ORCPT + 99 others); Wed, 17 Mar 2021 04:15:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229510AbhCQIPS (ORCPT ); Wed, 17 Mar 2021 04:15:18 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACDC1C06174A; Wed, 17 Mar 2021 01:15:17 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id 12so917050wmf.5; Wed, 17 Mar 2021 01:15:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=2C2nS2FuL5jIhqAY/uOCR718M7JpaJd6K5UxD7QBZ0c=; b=gKEcCTAzqvl6UcV0JWtxYfgS4mkNy0j7CKcuoZN0yc1FuCnS7UWDHaH9tUkIbPWw8S PpWTOg/bdzs8nexa2qdaE4CwxflXq8MOZ0fUIqJRjktExHNx5L+73lmykE64Bx2iU1pw jqSR6Hzcmd95d8FUroe/k5CvPz5IdtNDSgA/qi0Nqa+2AFSoE2eCC++keWgca+yhdKZF KD8KLfVtPkPGKPmqo+n7ksyh9WFH5pqf+nGP5mUzc3gymPo3yUvOQo/MFVrfCvBUgx3A GmH7VSxJx0RNhcec/1D8osxwGFnCzouAYDOTwKzmLvzTTbvX/7tuwGUFntIhTgZfj9NY 2fuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=2C2nS2FuL5jIhqAY/uOCR718M7JpaJd6K5UxD7QBZ0c=; b=IEApST4Z2fEgoSRxE0VBp236IUuOlqEG2qrCnq9Vlt+48O/nCWfP0g+u3//B2wNDRp 1nQnxA5ow/q3odR0flVbtK6oT5LiF3EM8ns1+BxXXk4OJpK5h7CsA/ojMTHC8hU0Oafo wX9GIhAOaOZYpXLXfova3sUfPuSYo5prTFUaTYZYl+MZ12TNp4c2YWbKuQ2/SCULC/sk fe5XbUyBi1OsMcoqXcU+RdWIujS7Toi90Y/XUPDLQYuHfcNSXo/k5PfjDrOYS1ir4Q5W 9Ri/7VWqFPmBxmgeTyDwFNdJOON5s6aBGEK7RpImF06aEAQdu0bNYcUr5X4D488r1p8o /J1g== X-Gm-Message-State: AOAM532p85Oq9/yTSnRV8Zptpy+wV8OoTgu7sp2xHPdA8kl/ZyplFxWO t3XZjP3OAi6xyXqdXxGYNiQ= X-Received: by 2002:a1c:a916:: with SMTP id s22mr2568037wme.82.1615968914088; Wed, 17 Mar 2021 01:15:14 -0700 (PDT) Received: from ?IPv6:2003:ea:8f1f:bb00:c04c:c4a7:d0c5:8ae7? (p200300ea8f1fbb00c04cc4a7d0c58ae7.dip0.t-ipconnect.de. [2003:ea:8f1f:bb00:c04c:c4a7:d0c5:8ae7]) by smtp.googlemail.com with ESMTPSA id s84sm1694787wme.11.2021.03.17.01.15.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 17 Mar 2021 01:15:13 -0700 (PDT) Subject: Re: [PATCH net-next 1/1] net: phy: fix invalid phy id when probe using C22 To: Wong Vee Khee , Andrew Lunn , Russell King , "David S . Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Voon Weifeng , Ong Boon Leong References: <20210316085748.3017-1-vee.khee.wong@intel.com> From: Heiner Kallweit Message-ID: Date: Wed, 17 Mar 2021 09:15:03 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210316085748.3017-1-vee.khee.wong@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16.03.2021 09:57, Wong Vee Khee wrote: > When using Clause-22 to probe for PHY devices such as the Marvell > 88E2110, PHY ID with value 0 is read from the MII PHYID registers > which caused the PHY framework failed to attach the Marvell PHY > driver. > The issue occurs with a MAC driver that sets MDIO bus capability flag MDIOBUS_C22_C45, like stmmac? Or what is the affected MAC driver? And if you state it's a fix, a Fixes tag would be needed. > Fixed this by adding a check of PHY ID equals to all zeroes. > > Cc: stable@vger.kernel.org > Reviewed-by: Voon Weifeng > Signed-off-by: Wong Vee Khee > --- > drivers/net/phy/phy_device.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c > index a009d1769b08..f1afc00fcba2 100644 > --- a/drivers/net/phy/phy_device.c > +++ b/drivers/net/phy/phy_device.c > @@ -820,8 +820,8 @@ static int get_phy_c22_id(struct mii_bus *bus, int addr, u32 *phy_id) > > *phy_id |= phy_reg; > > - /* If the phy_id is mostly Fs, there is no device there */ > - if ((*phy_id & 0x1fffffff) == 0x1fffffff) > + /* If the phy_id is mostly Fs or all zeroes, there is no device there */ > + if (((*phy_id & 0x1fffffff) == 0x1fffffff) || (*phy_id == 0)) > return -ENODEV; > > return 0; >