netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2] net: pse-pd: tps23881: Fix the device ID check
@ 2024-07-31 15:42 Kyle Swenson
  2024-07-31 19:26 ` Thomas Petazzoni
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Kyle Swenson @ 2024-07-31 15:42 UTC (permalink / raw)
  To: Kyle Swenson, o.rempel@pengutronix.de, kory.maincent@bootlin.com,
	kuba@kernel.org
  Cc: davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
	thomas.petazzoni@bootlin.com, netdev@vger.kernel.org

The DEVID register contains two pieces of information: the device ID in
the upper nibble, and the silicon revision number in the lower nibble.
The driver should work fine with any silicon revision, so let's mask
that out in the device ID check.

Fixes: 20e6d190ffe1 ("net: pse-pd: Add TI TPS23881 PSE controller driver")
Signed-off-by: Kyle Swenson <kyle.swenson@est.tech>
---
v2:
 - Use FIELD_GET and defines instead of raw numbers

v1: https://lore.kernel.org/netdev/20240730161032.3616000-1-kyle.swenson@est.tech/

 drivers/net/pse-pd/tps23881.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/pse-pd/tps23881.c b/drivers/net/pse-pd/tps23881.c
index 61f6ad9c1934..f90db758554b 100644
--- a/drivers/net/pse-pd/tps23881.c
+++ b/drivers/net/pse-pd/tps23881.c
@@ -27,10 +27,12 @@
 #define TPS23881_REG_PORT_POWER	0x29
 #define TPS23881_REG_POEPLUS	0x40
 #define TPS23881_REG_TPON	BIT(0)
 #define TPS23881_REG_FWREV	0x41
 #define TPS23881_REG_DEVID	0x43
+#define TPS23881_REG_DEVID_MASK	0xF0
+#define TPS23881_DEVICE_ID	0x02
 #define TPS23881_REG_SRAM_CTRL	0x60
 #define TPS23881_REG_SRAM_DATA	0x61
 
 struct tps23881_port_desc {
 	u8 chan[2];
@@ -748,11 +750,11 @@ static int tps23881_i2c_probe(struct i2c_client *client)
 
 	ret = i2c_smbus_read_byte_data(client, TPS23881_REG_DEVID);
 	if (ret < 0)
 		return ret;
 
-	if (ret != 0x22) {
+	if (FIELD_GET(TPS23881_REG_DEVID_MASK, ret) != TPS23881_DEVICE_ID) {
 		dev_err(dev, "Wrong device ID\n");
 		return -ENXIO;
 	}
 
 	ret = tps23881_flash_sram_fw(client);
-- 
2.43.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next v2] net: pse-pd: tps23881: Fix the device ID check
  2024-07-31 15:42 [PATCH net-next v2] net: pse-pd: tps23881: Fix the device ID check Kyle Swenson
@ 2024-07-31 19:26 ` Thomas Petazzoni
  2024-08-02  7:53 ` Oleksij Rempel
  2024-08-10 21:45 ` Kory Maincent
  2 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2024-07-31 19:26 UTC (permalink / raw)
  To: Kyle Swenson
  Cc: o.rempel@pengutronix.de, kory.maincent@bootlin.com,
	kuba@kernel.org, davem@davemloft.net, edumazet@google.com,
	pabeni@redhat.com, netdev@vger.kernel.org

On Wed, 31 Jul 2024 15:42:14 +0000
Kyle Swenson <kyle.swenson@est.tech> wrote:

> The DEVID register contains two pieces of information: the device ID in
> the upper nibble, and the silicon revision number in the lower nibble.
> The driver should work fine with any silicon revision, so let's mask
> that out in the device ID check.
> 
> Fixes: 20e6d190ffe1 ("net: pse-pd: Add TI TPS23881 PSE controller driver")
> Signed-off-by: Kyle Swenson <kyle.swenson@est.tech>

Thanks for the change!

Reviewed-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next v2] net: pse-pd: tps23881: Fix the device ID check
  2024-07-31 15:42 [PATCH net-next v2] net: pse-pd: tps23881: Fix the device ID check Kyle Swenson
  2024-07-31 19:26 ` Thomas Petazzoni
@ 2024-08-02  7:53 ` Oleksij Rempel
  2024-08-10 21:45 ` Kory Maincent
  2 siblings, 0 replies; 6+ messages in thread
From: Oleksij Rempel @ 2024-08-02  7:53 UTC (permalink / raw)
  To: Kyle Swenson
  Cc: kory.maincent@bootlin.com, kuba@kernel.org, davem@davemloft.net,
	edumazet@google.com, pabeni@redhat.com,
	thomas.petazzoni@bootlin.com, netdev@vger.kernel.org

On Wed, Jul 31, 2024 at 03:42:14PM +0000, Kyle Swenson wrote:
> The DEVID register contains two pieces of information: the device ID in
> the upper nibble, and the silicon revision number in the lower nibble.
> The driver should work fine with any silicon revision, so let's mask
> that out in the device ID check.
> 
> Fixes: 20e6d190ffe1 ("net: pse-pd: Add TI TPS23881 PSE controller driver")
> Signed-off-by: Kyle Swenson <kyle.swenson@est.tech>

Acked-by: Oleksij Rempel <o.rempel@pengutronix.de>

Thank you!

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next v2] net: pse-pd: tps23881: Fix the device ID check
  2024-07-31 15:42 [PATCH net-next v2] net: pse-pd: tps23881: Fix the device ID check Kyle Swenson
  2024-07-31 19:26 ` Thomas Petazzoni
  2024-08-02  7:53 ` Oleksij Rempel
@ 2024-08-10 21:45 ` Kory Maincent
  2024-08-12 15:41   ` Jakub Kicinski
  2 siblings, 1 reply; 6+ messages in thread
From: Kory Maincent @ 2024-08-10 21:45 UTC (permalink / raw)
  To: Kyle Swenson
  Cc: o.rempel@pengutronix.de, kuba@kernel.org, davem@davemloft.net,
	edumazet@google.com, pabeni@redhat.com,
	thomas.petazzoni@bootlin.com, netdev@vger.kernel.org

On Wed, 31 Jul 2024 15:42:14 +0000
Kyle Swenson <kyle.swenson@est.tech> wrote:

> The DEVID register contains two pieces of information: the device ID in
> the upper nibble, and the silicon revision number in the lower nibble.
> The driver should work fine with any silicon revision, so let's mask
> that out in the device ID check.
> 
> Fixes: 20e6d190ffe1 ("net: pse-pd: Add TI TPS23881 PSE controller driver")
> Signed-off-by: Kyle Swenson <kyle.swenson@est.tech>

Hello Kyle,

In net subsystem when you send a fix you should use net prefix instead
of net-next. Jakub, does Kyle have to send a new patch or can you deal with
it?

Thanks for your fix!

Reviewed-by: Kory Maincent <kory.maincent@bootlin.com>

Regards,
-- 
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next v2] net: pse-pd: tps23881: Fix the device ID check
  2024-08-10 21:45 ` Kory Maincent
@ 2024-08-12 15:41   ` Jakub Kicinski
  2024-08-14  9:21     ` Kory Maincent
  0 siblings, 1 reply; 6+ messages in thread
From: Jakub Kicinski @ 2024-08-12 15:41 UTC (permalink / raw)
  To: Kory Maincent
  Cc: Kyle Swenson, o.rempel@pengutronix.de, davem@davemloft.net,
	edumazet@google.com, pabeni@redhat.com,
	thomas.petazzoni@bootlin.com, netdev@vger.kernel.org

On Sat, 10 Aug 2024 23:45:56 +0200 Kory Maincent wrote:
> > The DEVID register contains two pieces of information: the device ID in
> > the upper nibble, and the silicon revision number in the lower nibble.
> > The driver should work fine with any silicon revision, so let's mask
> > that out in the device ID check.
> > 
> > Fixes: 20e6d190ffe1 ("net: pse-pd: Add TI TPS23881 PSE controller driver")
> > Signed-off-by: Kyle Swenson <kyle.swenson@est.tech>  
> 
> Hello Kyle,
> 
> In net subsystem when you send a fix you should use net prefix instead
> of net-next. Jakub, does Kyle have to send a new patch or can you deal with
> it?
> 
> Thanks for your fix!
> 
> Reviewed-by: Kory Maincent <kory.maincent@bootlin.com>

Ah, I'm pretty sure I already applied this. kernel.org infra has been
quite unreliable lately. Commit 89108cb5c285 ("net: pse-pd: tps23881:
Fix the device ID check"), indeed in net.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next v2] net: pse-pd: tps23881: Fix the device ID check
  2024-08-12 15:41   ` Jakub Kicinski
@ 2024-08-14  9:21     ` Kory Maincent
  0 siblings, 0 replies; 6+ messages in thread
From: Kory Maincent @ 2024-08-14  9:21 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Kyle Swenson, o.rempel@pengutronix.de, davem@davemloft.net,
	edumazet@google.com, pabeni@redhat.com,
	thomas.petazzoni@bootlin.com, netdev@vger.kernel.org

On Mon, 12 Aug 2024 08:41:59 -0700
Jakub Kicinski <kuba@kernel.org> wrote:

> On Sat, 10 Aug 2024 23:45:56 +0200 Kory Maincent wrote:
> > > The DEVID register contains two pieces of information: the device ID in
> > > the upper nibble, and the silicon revision number in the lower nibble.
> > > The driver should work fine with any silicon revision, so let's mask
> > > that out in the device ID check.
> > > 
> > > Fixes: 20e6d190ffe1 ("net: pse-pd: Add TI TPS23881 PSE controller driver")
> > > Signed-off-by: Kyle Swenson <kyle.swenson@est.tech>    
> > 
> > Hello Kyle,
> > 
> > In net subsystem when you send a fix you should use net prefix instead
> > of net-next. Jakub, does Kyle have to send a new patch or can you deal with
> > it?
> > 
> > Thanks for your fix!
> > 
> > Reviewed-by: Kory Maincent <kory.maincent@bootlin.com>  
> 
> Ah, I'm pretty sure I already applied this. kernel.org infra has been
> quite unreliable lately. Commit 89108cb5c285 ("net: pse-pd: tps23881:
> Fix the device ID check"), indeed in net.

Ah right, thanks! I didn't received the merged notification email.
Sorry for the useless noise!

Regards,
-- 
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-08-14  9:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-31 15:42 [PATCH net-next v2] net: pse-pd: tps23881: Fix the device ID check Kyle Swenson
2024-07-31 19:26 ` Thomas Petazzoni
2024-08-02  7:53 ` Oleksij Rempel
2024-08-10 21:45 ` Kory Maincent
2024-08-12 15:41   ` Jakub Kicinski
2024-08-14  9:21     ` Kory Maincent

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).