Message ID | 20230119131014.1228773-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 s9csp325834wrn; Thu, 19 Jan 2023 05:28:19 -0800 (PST) X-Google-Smtp-Source: AMrXdXux9eH2iAE9OwB/TxFCx882o/eova/do9TtE6logow6ckfs8yz+zL2nz/z/taBt9rrCsoXt X-Received: by 2002:a17:907:8b08:b0:838:9b81:1c98 with SMTP id sz8-20020a1709078b0800b008389b811c98mr11657701ejc.1.1674134899073; Thu, 19 Jan 2023 05:28:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674134899; cv=none; d=google.com; s=arc-20160816; b=XNAtP5afPQKEFKlHtI4P3QoEh74qybzDxYxEYVDrlil99NLlFLkhmwgjQxUecJeTZt zBq84qHp+A3xHPLAzj8v8UFet6NVMgXzrrUXEYo0fPAd9VAzxkt2HKzBRmZO4yL5dV69 0eK9GBwha9Jxm0AFvAErbQEcCoMZ3B9md+joDAugbM5VV7OQ8qA8v43Cb57i/9nM/poN pWAKunIEGzuZdB8PDvDeVw8GYNTyJ2gTH+kuMAvttIuYTc2T2mLHZEHJmiCqCat/jgTY laAKcFac7+QHbyUk5sqxSIk1BR6MCpW7Bzjrs0jtfH++sJ8pruvUMDpN/Cwa7Qe6+7ij kyfw== 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=jUxgVt/yQL+t6AuyPsRwp1MIfp7RMJMcFGNz8aWj0Mw=; b=hjbxatyXyIaU+jsW/8bacJ+2yPuRo5KSyQMGZwDjSMoOe6lsBvWq+ywZ6Isyj/d2id O112hlDVpop3tY+UcCaD0U9di7dF8Djv42BPmlhr/ZM4yTmBrNYkmEOqfA5gL5JmaXUx 5/OtzFS2O3/eBDUUm+MHc0uoNvMVi42HC3hCGYQeCQmmTTFP180OS9dCCG/tf8Nw70f7 n8FJ4ggx5trBqBx2amJfMMYm08Le0Hz04AzZZkxPTNrNFvFEAgeX/0fB2oFQj3PErIaD l6y6exqHn6eJj6y1dEcDv3nfeyyFGdrG4v+p1JeS4zSoLjlxfHzvO8ZnN+DKdzyC93uw QQuw== 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 nb12-20020a1709071c8c00b008706dceb60fsi14875686ejc.106.2023.01.19.05.27.54; Thu, 19 Jan 2023 05:28:19 -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 S229958AbjASNRG (ORCPT <rfc822;pfffrao@gmail.com> + 99 others); Thu, 19 Jan 2023 08:17:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230314AbjASNQ6 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 19 Jan 2023 08:16:58 -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 2F9ACE0 for <linux-kernel@vger.kernel.org>; Thu, 19 Jan 2023 05:16:55 -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 1pIUmN-0005TZ-Kf; Thu, 19 Jan 2023 14:16:31 +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 1pIUmL-0079ie-U0; Thu, 19 Jan 2023 14:16:29 +0100 Received: from afa by dude05.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from <afa@pengutronix.de>) id 1pIUmL-0059ix-7U; Thu, 19 Jan 2023 14:16:29 +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>, Arun Ramadoss <arun.ramadoss@microchip.com> Cc: kernel@pengutronix.de, Oleksij Rempel <ore@pengutronix.de>, 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] net: dsa: microchip: fix probe of I2C-connected KSZ8563 Date: Thu, 19 Jan 2023 14:10:15 +0100 Message-Id: <20230119131014.1228773-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?1755457675956733915?= X-GMAIL-MSGID: =?utf-8?q?1755457675956733915?= |
Series |
[net] net: dsa: microchip: fix probe of I2C-connected KSZ8563
|
|
Commit Message
Ahmad Fatoum
Jan. 19, 2023, 1:10 p.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:
ksz9477-switch 1-005f: Device tree specifies chip KSZ9893 but found
KSZ8563, please fix it!
Problem is that the "microchip,ksz8563" compatible is associated
with ksz_switch_chips[KSZ9893]. Same issue also affected the SPI driver
for the same switch chip and was fixed in commit b44908095612
("net: dsa: microchip: add separate struct ksz_chip_data for KSZ8563 chip").
Reuse ksz_switch_chips[KSZ8563] introduced in aforementioned commit
to get I2C-connected KSZ8563 probing again.
Fixes: eee16b147121 ("net: dsa: microchip: perform the compatibility check for dev probed")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
drivers/net/dsa/microchip/ksz9477_i2c.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Thu, Jan 19, 2023 at 02:10:15PM +0100, 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: > > ksz9477-switch 1-005f: Device tree specifies chip KSZ9893 but found > KSZ8563, please fix it! > > Problem is that the "microchip,ksz8563" compatible is associated > with ksz_switch_chips[KSZ9893]. Same issue also affected the SPI driver > for the same switch chip and was fixed in commit b44908095612 > ("net: dsa: microchip: add separate struct ksz_chip_data for KSZ8563 chip"). > > Reuse ksz_switch_chips[KSZ8563] introduced in aforementioned commit > to get I2C-connected KSZ8563 probing again. > > Fixes: eee16b147121 ("net: dsa: microchip: perform the compatibility check for dev probed") > Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Andrew
Hi Ahmad, On Thu, 2023-01-19 at 14:10 +0100, Ahmad Fatoum wrote: > [You 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: > > ksz9477-switch 1-005f: Device tree specifies chip KSZ9893 but found > KSZ8563, please fix it! > > Problem is that the "microchip,ksz8563" compatible is associated > with ksz_switch_chips[KSZ9893]. Same issue also affected the SPI > driver > for the same switch chip and was fixed in commit b44908095612 > ("net: dsa: microchip: add separate struct ksz_chip_data for KSZ8563 > chip"). > > Reuse ksz_switch_chips[KSZ8563] introduced in aforementioned commit > to get I2C-connected KSZ8563 probing again. > > Fixes: eee16b147121 ("net: dsa: microchip: perform the compatibility > check for dev probed") In this commit, there is no KSZ8563 member in struct ksz_switch_chips. Whether the fixes should be to this commit "net: dsa: microchip: add separate struct ksz_chip_data for KSZ8563" where the member is introduced. > chip > Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> > --- > 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 >
Hello Arun, On 20.01.23 08:01, Arun.Ramadoss@microchip.com wrote: > Hi Ahmad, > On Thu, 2023-01-19 at 14:10 +0100, Ahmad Fatoum wrote: >> [You 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: >> >> ksz9477-switch 1-005f: Device tree specifies chip KSZ9893 but found >> KSZ8563, please fix it! >> >> Problem is that the "microchip,ksz8563" compatible is associated >> with ksz_switch_chips[KSZ9893]. Same issue also affected the SPI >> driver >> for the same switch chip and was fixed in commit b44908095612 >> ("net: dsa: microchip: add separate struct ksz_chip_data for KSZ8563 >> chip"). >> >> Reuse ksz_switch_chips[KSZ8563] introduced in aforementioned commit >> to get I2C-connected KSZ8563 probing again. >> >> Fixes: eee16b147121 ("net: dsa: microchip: perform the compatibility >> check for dev probed") > > In this commit, there is no KSZ8563 member in struct ksz_switch_chips. > Whether the fixes should be to this commit "net: dsa: microchip: add > separate struct ksz_chip_data for KSZ8563" where the member is > introduced. I disagree. eee16b147121 introduced the check that made my device not probe anymore, so that's what's referenced in Fixes:. Commit b44908095612 should have had a Fixes: pointing at eee16b147121 as well, so users don't miss it. But if they miss it, they will notice this at build-time anyway. Cheers, Ahmad > >> chip >> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> >> --- >> 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 >>
Hi Ahmad, On Fri, 2023-01-20 at 08:57 +0100, Ahmad Fatoum wrote: > [You 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 > > Hello Arun, > > On 20.01.23 08:01, Arun.Ramadoss@microchip.com wrote: > > Hi Ahmad, > > On Thu, 2023-01-19 at 14:10 +0100, Ahmad Fatoum wrote: > > > [You 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: > > > > > > ksz9477-switch 1-005f: Device tree specifies chip KSZ9893 but > > > found > > > KSZ8563, please fix it! > > > > > > Problem is that the "microchip,ksz8563" compatible is associated > > > with ksz_switch_chips[KSZ9893]. Same issue also affected the SPI > > > driver > > > for the same switch chip and was fixed in commit b44908095612 > > > ("net: dsa: microchip: add separate struct ksz_chip_data for > > > KSZ8563 > > > chip"). > > > > > > Reuse ksz_switch_chips[KSZ8563] introduced in aforementioned > > > commit > > > to get I2C-connected KSZ8563 probing again. > > > > > > Fixes: eee16b147121 ("net: dsa: microchip: perform the > > > compatibility > > > check for dev probed") > > > > In this commit, there is no KSZ8563 member in struct > > ksz_switch_chips. > > Whether the fixes should be to this commit "net: dsa: microchip: > > add > > separate struct ksz_chip_data for KSZ8563" where the member is > > introduced. > > I disagree. eee16b147121 introduced the check that made my device > not probe anymore, so that's what's referenced in Fixes:. Commit > b44908095612 should have had a Fixes: pointing at eee16b147121 > as well, so users don't miss it. But if they miss it, they > will notice this at build-time anyway. The KSZ9893, KSZ9563 and KSZ8563 all has the same chip id 0x00989300. They belong to 3 port switch family. Differentiation is done based on 0x1F register. In the commit eee16b147121, there is no differentiation based on 0x1F, device is selected based on chip id, all the three chips will be identified as ksz9893 only. After the commit b44908095612, KSZ8563 chips is identified based on 0x1F register. > > Cheers, > Ahmad > > > > > > chip > > > Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> > > > --- > > > 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 > > > > > -- > Pengutronix > e.K. | | > Steuerwalder Str. 21 | > http://www.pengutronix.de/e/ | > 31137 Hildesheim, Germany | Phone: +49-5121-206917- > 0 | > Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917- > 5555 | >
On 20.01.23 11:38, Arun.Ramadoss@microchip.com wrote: > On Fri, 2023-01-20 at 08:57 +0100, Ahmad Fatoum wrote: >>> In this commit, there is no KSZ8563 member in struct >>> ksz_switch_chips. >>> Whether the fixes should be to this commit "net: dsa: microchip: >>> add >>> separate struct ksz_chip_data for KSZ8563" where the member is >>> introduced. >> >> I disagree. eee16b147121 introduced the check that made my device >> not probe anymore, so that's what's referenced in Fixes:. Commit >> b44908095612 should have had a Fixes: pointing at eee16b147121 >> as well, so users don't miss it. But if they miss it, they >> will notice this at build-time anyway. > > The KSZ9893, KSZ9563 and KSZ8563 all has the same chip id 0x00989300. > They belong to 3 port switch family. Differentiation is done based on > 0x1F register. In the commit eee16b147121, there is no differentiation > based on 0x1F, device is selected based on chip id, all the three chips > will be identified as ksz9893 only. After the commit b44908095612, > KSZ8563 chips is identified based on 0x1F register. Thanks for the elaboration. I see it now. I will send a v2 with revised commit messages and Fixes:. Should I include your Reviewed-by: with the commit message rewritten? Cheers, Ahmad > >> >> Cheers, >> Ahmad >> >>> >>>> chip >>>> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> >>>> --- >>>> 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 >>>> >> >> -- >> Pengutronix >> e.K. | | >> Steuerwalder Str. 21 | >> http://www.pengutronix.de/e/ | >> 31137 Hildesheim, Germany | Phone: +49-5121-206917- >> 0 | >> Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917- >> 5555 | >>
On Fri, 2023-01-20 at 11:42 +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 > > On 20.01.23 11:38, Arun.Ramadoss@microchip.com wrote: > > On Fri, 2023-01-20 at 08:57 +0100, Ahmad Fatoum wrote: > > > > In this commit, there is no KSZ8563 member in struct > > > > ksz_switch_chips. > > > > Whether the fixes should be to this commit "net: dsa: > > > > microchip: > > > > add > > > > separate struct ksz_chip_data for KSZ8563" where the member is > > > > introduced. > > > > > > I disagree. eee16b147121 introduced the check that made my device > > > not probe anymore, so that's what's referenced in Fixes:. Commit > > > b44908095612 should have had a Fixes: pointing at eee16b147121 > > > as well, so users don't miss it. But if they miss it, they > > > will notice this at build-time anyway. > > > > The KSZ9893, KSZ9563 and KSZ8563 all has the same chip id > > 0x00989300. > > They belong to 3 port switch family. Differentiation is done based > > on > > 0x1F register. In the commit eee16b147121, there is no > > differentiation > > based on 0x1F, device is selected based on chip id, all the three > > chips > > will be identified as ksz9893 only. After the commit b44908095612, > > KSZ8563 chips is identified based on 0x1F register. > > Thanks for the elaboration. I see it now. I will send a v2 > with revised commit messages and Fixes:. Should I include > your Reviewed-by: with the commit message rewritten? I think, I can add my Ack-by: after you post v2 version. > > Cheers, > Ahmad > > > > > > > > > Cheers, > > > Ahmad > > > > > > > > > > > > chip > > > > > Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> > > > > > --- > > > > > 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 > > > > > > > > > > > -- > > > Pengutronix > > > e.K. | | > > > Steuerwalder Str. 21 | > > > http://www.pengutronix.de/e/e/ | > > > 31137 Hildesheim, Germany | Phone: +49-5121- > > > 206917- > > > 0 | > > > Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121- > > > 206917- > > > 5555 | > > > > > -- > Pengutronix > e.K. | | > Steuerwalder Str. 21 | > http://www.pengutronix.de/e/ | > 31137 Hildesheim, Germany | Phone: +49-5121-206917- > 0 | > Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917- > 5555 | >
On Fri, Jan 20, 2023 at 08:57:03AM +0100, Ahmad Fatoum wrote: > Hello Arun, > > On 20.01.23 08:01, Arun.Ramadoss@microchip.com wrote: > > Hi Ahmad, > > On Thu, 2023-01-19 at 14:10 +0100, Ahmad Fatoum wrote: > >> [You 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: > >> > >> ksz9477-switch 1-005f: Device tree specifies chip KSZ9893 but found > >> KSZ8563, please fix it! > >> > >> Problem is that the "microchip,ksz8563" compatible is associated > >> with ksz_switch_chips[KSZ9893]. Same issue also affected the SPI > >> driver > >> for the same switch chip and was fixed in commit b44908095612 > >> ("net: dsa: microchip: add separate struct ksz_chip_data for KSZ8563 > >> chip"). > >> > >> Reuse ksz_switch_chips[KSZ8563] introduced in aforementioned commit > >> to get I2C-connected KSZ8563 probing again. > >> > >> Fixes: eee16b147121 ("net: dsa: microchip: perform the compatibility > >> check for dev probed") > > > > In this commit, there is no KSZ8563 member in struct ksz_switch_chips. > > Whether the fixes should be to this commit "net: dsa: microchip: add > > separate struct ksz_chip_data for KSZ8563" where the member is > > introduced. > > I disagree. eee16b147121 introduced the check that made my device > not probe anymore, so that's what's referenced in Fixes:. Commit > b44908095612 should have had a Fixes: pointing at eee16b147121 > as well, so users don't miss it. But if they miss it, they > will notice this at build-time anyway. So it sounds like two different fixes are needed? For recent kernels this fix alone is sufficient. But for older kernels additional changes are needed. Is it sufficient to backport existing patches, or are new patches needed? Please start fixing the current kernel. Once that is merged you can post a fix for older kernels, referencing the merged fix. Andrew
Hello Andrew, On 20.01.23 14:08, Andrew Lunn wrote: > On Fri, Jan 20, 2023 at 08:57:03AM +0100, Ahmad Fatoum wrote: >> Hello Arun, >> >> On 20.01.23 08:01, Arun.Ramadoss@microchip.com wrote: >>> Hi Ahmad, >>> On Thu, 2023-01-19 at 14:10 +0100, Ahmad Fatoum wrote: >>>> [You 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: >>>> >>>> ksz9477-switch 1-005f: Device tree specifies chip KSZ9893 but found >>>> KSZ8563, please fix it! >>>> >>>> Problem is that the "microchip,ksz8563" compatible is associated >>>> with ksz_switch_chips[KSZ9893]. Same issue also affected the SPI >>>> driver >>>> for the same switch chip and was fixed in commit b44908095612 >>>> ("net: dsa: microchip: add separate struct ksz_chip_data for KSZ8563 >>>> chip"). >>>> >>>> Reuse ksz_switch_chips[KSZ8563] introduced in aforementioned commit >>>> to get I2C-connected KSZ8563 probing again. >>>> >>>> Fixes: eee16b147121 ("net: dsa: microchip: perform the compatibility >>>> check for dev probed") >>> >>> In this commit, there is no KSZ8563 member in struct ksz_switch_chips. >>> Whether the fixes should be to this commit "net: dsa: microchip: add >>> separate struct ksz_chip_data for KSZ8563" where the member is >>> introduced. >> >> I disagree. eee16b147121 introduced the check that made my device >> not probe anymore, so that's what's referenced in Fixes:. Commit >> b44908095612 should have had a Fixes: pointing at eee16b147121 >> as well, so users don't miss it. But if they miss it, they >> will notice this at build-time anyway. > > So it sounds like two different fixes are needed? For recent kernels > this fix alone is sufficient. But for older kernels additional changes > are needed. Is it sufficient to backport existing patches, or are new > patches needed? > > Please start fixing the current kernel. Once that is merged you can > post a fix for older kernels, referencing the merged fix. I misunderstood the issue. It's indeed a single commit that broke it. I just sent a v2 with a revised commit message and the correct Fixes:. The fix can be cherry-picked on its own to any kernel that contains the offending commit without any prerequisite patches. Cheers, Ahmad > > Andrew >
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",