Message ID | 20230120110933.1151054-1-a.fatoum@pengutronix.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp136743wrn; Fri, 20 Jan 2023 03:13:31 -0800 (PST) X-Google-Smtp-Source: AMrXdXtyONtA17l9d2ZqjxBT4COg89h0nQGi5Gqcj1MdeH775WbCZxERFg4WVUu7b//pfwPjXEy1 X-Received: by 2002:a17:902:e84e:b0:193:2ed4:560d with SMTP id t14-20020a170902e84e00b001932ed4560dmr20738205plg.55.1674213211076; Fri, 20 Jan 2023 03:13:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674213211; cv=none; d=google.com; s=arc-20160816; b=fVbOzgypAQMvA/yquvouH9PgYR6bcWKoiTH4qugHzi55poeeQSB4h1xagfEIj5Uri0 HNF9C2R3KlW4tPfkVwzjbokWVGPtgfXP6UM3CcmLO28uDQPlLMN4jHbZaDYxDoTkL6nu jaWQUu4aV5+Nmhh8khNrcQ6B1661rON+8Fn7rdgKsAp2vT38KJ8ce0sfjQ9b3xz5igoP oaEHMVbKVMe+/Fu1NOHSDIWzo6bjW1UqKELKfROrtYCSEEFpN9VLK8ceBY95Bz9LtGC7 30ZI6Jv60zzmYxnjCSzgDD3MIMtcLliZIB3FfMy/6UO6ceVrz+5ZQRRq24pgiBMfu9zY H7og== 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; bh=YjVbxlXiIzzD2o6Q3Nb2feSOs6cmiXChe8Cpr0asU7Q=; b=02XElDfruxjeLy4V1Kg+tyNefStyQ2lEZ989eoe6TGP/KvMNDGD9vFewYxgoUkDbEP SfErtS3NQjLA7XXBoFJeCwVRqGoQzjlY05JRMeSPAmc8QDHo9vnoLTav54Z6hWVCDekp JqPOrfY16eO0v5Lbzjvhn5dOOwVzzDZcesunk2BtEA6PiPBiYGal4nO0ziidhu6AOhse mr2kh9Vy4ZJgH0ZFOFVUy2hZkrfsfpZYsaIzTk3vuWoib2WmViCu95NRA42WV72zmjHW iAQ0S2BJEBL5vF7FW+TsEqw5baRvdScDVhH27K3a8so48gbODHyttTUurq7i+9XiieD+ tJbA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c2-20020a170902aa4200b00189b048c9e4si38057720plr.500.2023.01.20.03.13.18; Fri, 20 Jan 2023 03:13:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229785AbjATLJ6 (ORCPT <rfc822;literming00@gmail.com> + 99 others); Fri, 20 Jan 2023 06:09:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229613AbjATLJ5 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 20 Jan 2023 06:09:57 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98748C160 for <linux-kernel@vger.kernel.org>; Fri, 20 Jan 2023 03:09:56 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <afa@pengutronix.de>) id 1pIpHA-0003LV-Nf; Fri, 20 Jan 2023 12:09:40 +0100 Received: from [2a0a:edc0:0:1101:1d::54] (helo=dude05.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from <afa@pengutronix.de>) id 1pIpH8-007MGq-Qe; Fri, 20 Jan 2023 12:09:38 +0100 Received: from afa by dude05.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from <afa@pengutronix.de>) id 1pIpH8-004peO-59; Fri, 20 Jan 2023 12:09:38 +0100 From: Ahmad Fatoum <a.fatoum@pengutronix.de> To: Jakub Kicinski <kuba@kernel.org>, Woojung Huh <woojung.huh@microchip.com>, UNGLinuxDriver@microchip.com, Andrew Lunn <andrew@lunn.ch>, Florian Fainelli <f.fainelli@gmail.com>, Vladimir Oltean <olteanv@gmail.com>, "David S. Miller" <davem@davemloft.net>, Oleksij Rempel <linux@rempel-privat.de> Cc: kernel@pengutronix.de, ore@pengutronix.de, Arun.Ramadoss@microchip.com, Ahmad Fatoum <a.fatoum@pengutronix.de>, Eric Dumazet <edumazet@google.com>, Paolo Abeni <pabeni@redhat.com>, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net v2] net: dsa: microchip: fix probe of I2C-connected KSZ8563 Date: Fri, 20 Jan 2023 12:09:32 +0100 Message-Id: <20230120110933.1151054-1-a.fatoum@pengutronix.de> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: afa@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755539791975989110?= X-GMAIL-MSGID: =?utf-8?q?1755539791975989110?= |
Series |
[net,v2] net: dsa: microchip: fix probe of I2C-connected KSZ8563
|
|
Commit Message
Ahmad Fatoum
Jan. 20, 2023, 11:09 a.m. UTC
Starting with commit eee16b147121 ("net: dsa: microchip: perform the compatibility check for dev probed"), the KSZ switch driver now bails out if it thinks the DT compatible doesn't match the actual chip ID read back from the hardware: ksz9477-switch 1-005f: Device tree specifies chip KSZ9893 but found KSZ8563, please fix it! For the KSZ8563, which used ksz_switch_chips[KSZ9893], this was fine at first, because it indeed shares the same chip id as the KSZ9893. Commit b44908095612 ("net: dsa: microchip: add separate struct ksz_chip_data for KSZ8563 chip") started differentiating KSZ9893 compatible chips by consulting the 0x1F register. The resulting breakage was fixed for the SPI driver in the same commit by introducing the appropriate ksz_switch_chips[KSZ8563], but not for the I2C driver. Fix this for I2C-connected KSZ8563 now to get it probing again. Fixes: b44908095612 ("net: dsa: microchip: add separate struct ksz_chip_data for KSZ8563 chip"). Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> --- v1 -> v2: - rewrote commit message and Fixes: to point at correct culprit commit introducing regression (Arun) - included Andrew's Reviewed-by --- drivers/net/dsa/microchip/ksz9477_i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Fri, 2023-01-20 at 12:09 +0100, Ahmad Fatoum wrote: > [Some people who received this message don't often get email from > a.fatoum@pengutronix.de. Learn why this is important at > https://aka.ms/LearnAboutSenderIdentification ] > > EXTERNAL EMAIL: Do not click links or open attachments unless you > know the content is safe > > Starting with commit eee16b147121 ("net: dsa: microchip: perform the > compatibility check for dev probed"), the KSZ switch driver now bails > out if it thinks the DT compatible doesn't match the actual chip ID > read back from the hardware: > > ksz9477-switch 1-005f: Device tree specifies chip KSZ9893 but found > KSZ8563, please fix it! > > For the KSZ8563, which used ksz_switch_chips[KSZ9893], this was fine > at first, because it indeed shares the same chip id as the KSZ9893. > > Commit b44908095612 ("net: dsa: microchip: add separate struct > ksz_chip_data for KSZ8563 chip") started differentiating KSZ9893 > compatible chips by consulting the 0x1F register. The resulting > breakage > was fixed for the SPI driver in the same commit by introducing the > appropriate ksz_switch_chips[KSZ8563], but not for the I2C driver. > > Fix this for I2C-connected KSZ8563 now to get it probing again. > > Fixes: b44908095612 ("net: dsa: microchip: add separate struct > ksz_chip_data for KSZ8563 chip"). > Reviewed-by: Andrew Lunn <andrew@lunn.ch> > Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Acked-by: Arun Ramadoss<arun.ramadoss@microchip.com> > --- > v1 -> v2: > - rewrote commit message and Fixes: to point at correct > culprit commit introducing regression (Arun) > - included Andrew's Reviewed-by > --- > drivers/net/dsa/microchip/ksz9477_i2c.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/dsa/microchip/ksz9477_i2c.c > b/drivers/net/dsa/microchip/ksz9477_i2c.c > index c1a633ca1e6d..e315f669ec06 100644 > --- a/drivers/net/dsa/microchip/ksz9477_i2c.c > +++ b/drivers/net/dsa/microchip/ksz9477_i2c.c > @@ -104,7 +104,7 @@ static const struct of_device_id ksz9477_dt_ids[] > = { > }, > { > .compatible = "microchip,ksz8563", > - .data = &ksz_switch_chips[KSZ9893] > + .data = &ksz_switch_chips[KSZ8563] > }, > { > .compatible = "microchip,ksz9567", > -- > 2.30.2 >
On 1/20/2023 3:09 AM, Ahmad Fatoum wrote: > Starting with commit eee16b147121 ("net: dsa: microchip: perform the > compatibility check for dev probed"), the KSZ switch driver now bails > out if it thinks the DT compatible doesn't match the actual chip ID > read back from the hardware: > > ksz9477-switch 1-005f: Device tree specifies chip KSZ9893 but found > KSZ8563, please fix it! > > For the KSZ8563, which used ksz_switch_chips[KSZ9893], this was fine > at first, because it indeed shares the same chip id as the KSZ9893. > > Commit b44908095612 ("net: dsa: microchip: add separate struct > ksz_chip_data for KSZ8563 chip") started differentiating KSZ9893 > compatible chips by consulting the 0x1F register. The resulting breakage > was fixed for the SPI driver in the same commit by introducing the > appropriate ksz_switch_chips[KSZ8563], but not for the I2C driver. > > Fix this for I2C-connected KSZ8563 now to get it probing again. > > Fixes: b44908095612 ("net: dsa: microchip: add separate struct ksz_chip_data for KSZ8563 chip"). > Reviewed-by: Andrew Lunn <andrew@lunn.ch> > Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Hello: This patch was applied to netdev/net.git (master) by Jakub Kicinski <kuba@kernel.org>: On Fri, 20 Jan 2023 12:09:32 +0100 you wrote: > Starting with commit eee16b147121 ("net: dsa: microchip: perform the > compatibility check for dev probed"), the KSZ switch driver now bails > out if it thinks the DT compatible doesn't match the actual chip ID > read back from the hardware: > > ksz9477-switch 1-005f: Device tree specifies chip KSZ9893 but found > KSZ8563, please fix it! > > [...] Here is the summary with links: - [net,v2] net: dsa: microchip: fix probe of I2C-connected KSZ8563 https://git.kernel.org/netdev/net/c/360fdc999d92 You are awesome, thank you!
diff --git a/drivers/net/dsa/microchip/ksz9477_i2c.c b/drivers/net/dsa/microchip/ksz9477_i2c.c index c1a633ca1e6d..e315f669ec06 100644 --- a/drivers/net/dsa/microchip/ksz9477_i2c.c +++ b/drivers/net/dsa/microchip/ksz9477_i2c.c @@ -104,7 +104,7 @@ static const struct of_device_id ksz9477_dt_ids[] = { }, { .compatible = "microchip,ksz8563", - .data = &ksz_switch_chips[KSZ9893] + .data = &ksz_switch_chips[KSZ8563] }, { .compatible = "microchip,ksz9567",