From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03CD5C4338F for ; Fri, 30 Jul 2021 22:19:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DE0F96103B for ; Fri, 30 Jul 2021 22:19:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234437AbhG3WT7 (ORCPT ); Fri, 30 Jul 2021 18:19:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234382AbhG3WT2 (ORCPT ); Fri, 30 Jul 2021 18:19:28 -0400 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C664C06179C for ; Fri, 30 Jul 2021 15:19:22 -0700 (PDT) Received: by mail-pj1-x102e.google.com with SMTP id q17-20020a17090a2e11b02901757deaf2c8so16543243pjd.0 for ; Fri, 30 Jul 2021 15:19:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=workware-net-au.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=O24PNtKrKZ/R4LgVLMiIP6EoNyXsgw3ajELkWTG8RLo=; b=FZYQhFlDOs9Aq3bosQwrMNnX9gb4N5kUKVVl+0TWoiZ5E51sJZ46FwYyQwqp/ssPQI Dp39QLzC7K3xuoEsgd5hXAgimfYP7Ez9YaqCUhrRT42+hlKK/UfFBg2Zo518XMuVxJg8 Ge604OBVtfnFAQEuNUGhALeksQotBzQ8tjIHUFxrTqN/0r01fRtbYztl+3kMRXSLQlvH A+ZzO0Qm53ABkqZ6nF53EuHtLoexENzcKPOn0Cfqh5fwwclL8T9C2A06EVxoL9zbKFu9 g/+kd/29vrcrJP5JFZEzengql9pDFC5OzltBzJ8qCNuKsvE439nmqPonQGp6tVb4bQ7O ZzAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=O24PNtKrKZ/R4LgVLMiIP6EoNyXsgw3ajELkWTG8RLo=; b=Xn8B9r+Nz62ARkgJHZ2mHd2x8viwphUp/ZiKvhmKG2c1ygOftVhixtB9SneOhE42KH hJmiFsa9FnTE1+pe/JEWH8B3w62gIVmfwVoqQ40dbLUXzvGqr6Am1ymazmLQiroOd53D EtGoIUCl+K7l2TZj/OVcA/j44bo3HogqGWZF9BVpTk+kbQANWokB0Ypj1rBjPtZY5Qfh 7r41fZlDlac9DH0uyWLp9hz3QXb0/vPusztZFTExUR589plB3XD2O8ezi6qJ2r06V4Oj 408ZUcJKeft5gqqDn3xLOwV1008DDx6EBBlgFjb7QRF4IxYxgXfw5IM7hjByl2Wo95aU oi/Q== X-Gm-Message-State: AOAM530F6QEPztIHw2KBZJZfrA/tbZtDxeCqNmde2ORe0EyxiDx2XuFx VuZfOntRdg+3XATodHXoINptPQ== X-Google-Smtp-Source: ABdhPJyh4rFQzG8+Mb9p1u5b4EcqoZFKns1hLpbNhv2Pm3CdlC55gIOWgCMcLHWiCcTWWM8+0OwnUw== X-Received: by 2002:a63:5fd4:: with SMTP id t203mr1278866pgb.141.1627683561826; Fri, 30 Jul 2021 15:19:21 -0700 (PDT) Received: from smtpclient.apple (117-20-69-228.751445.bne.nbn.aussiebb.net. [117.20.69.228]) by smtp.gmail.com with ESMTPSA id n15sm3538687pff.149.2021.07.30.15.19.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Jul 2021 15:19:21 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.100.0.2.22\)) Subject: Re: [PATCH] net: phy: micrel: Fix detection of ksz87xx switch From: Steve Bennett In-Reply-To: <20210730095936.1420b930@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> Date: Sat, 31 Jul 2021 08:19:17 +1000 Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org X-Workware-Check: steveb@workware.net.au Content-Transfer-Encoding: quoted-printable Message-Id: <74BE3A85-61E2-45C9-BA77-242B1014A820@workware.net.au> References: <20210730105120.93743-1-steveb@workware.net.au> <20210730095936.1420b930@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> To: Jakub Kicinski X-Mailer: Apple Mail (2.3654.100.0.2.22) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On 31 Jul 2021, at 2:59 am, Jakub Kicinski wrote: >=20 > Please extend the CC list to the maintainers, and people who > worked on this driver in the past, especially Marek. Sure, I can do that in a v2 of the patch along with the more detailed explanation below. >=20 > On Fri, 30 Jul 2021 20:51:20 +1000 Steve Bennett wrote: >> The previous logic was wrong such that the ksz87xx >> switch was not identified correctly. >=20 > Any more details of what is happening? Which extact device do you see > this problem on? I have a ksz8795 switch. Without the patch: ksz8795-switch spi3.1 ade1 (uninitialized): PHY [dsa-0.1:03] driver = [Generic PHY] ksz8795-switch spi3.1 ade2 (uninitialized): PHY [dsa-0.1:04] driver = [Generic PHY] With the patch: ksz8795-switch spi3.1 ade1 (uninitialized): PHY [dsa-0.1:03] driver = [Micrel KSZ87XX Switch] ksz8795-switch spi3.1 ade2 (uninitialized): PHY [dsa-0.1:04] driver = [Micrel KSZ87XX Switch] >=20 > I presume ksz87xx devices used to work and gotten broken - would you > mind clarifying and adding a Fixes tag to help backporting to the > correct stable branches? I looked at the original commit = 8b95599c55ed24b36cf44a4720067cfe67edbcb4, but it couldn't ever have worked. ksz8051_ksz8795_match_phy_device() uses the parameter ksz_phy_id to = discriminate whether it was called from ksz8051_match_phy_device() or from = ksz8795_match_phy_device() but since PHY_ID_KSZ87XX is the same value as PHY_ID_KSZ8051, this = doesn't do anything. Need to pass a different value to discriminate. >=20 >> diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c >> index 4d53886f7d51..a4acec02c8cb 100644 >> --- a/drivers/net/phy/micrel.c >> +++ b/drivers/net/phy/micrel.c >> @@ -401,11 +401,11 @@ static int ksz8041_config_aneg(struct = phy_device *phydev) >> } >>=20 >> static int ksz8051_ksz8795_match_phy_device(struct phy_device = *phydev, >> - const u32 ksz_phy_id) >> + const u32 ksz_8051) >=20 > bool and use true/false in the callers? Sure.