* [PATCH] i3c: fix incorrect address slot lookup on 64-bit
@ 2021-09-22 16:56 Jamie Iles
2021-09-25 21:20 ` Alexandre Belloni
0 siblings, 1 reply; 2+ messages in thread
From: Jamie Iles @ 2021-09-22 16:56 UTC (permalink / raw)
To: linux-i3c; +Cc: Jamie Iles, Boris Brezillon, Alexandre Belloni
The address slot bitmap is an array of unsigned long's which are the
same size as an int on 32-bit platforms but not 64-bit. Loading the
bitmap into an int could result in the incorrect status being returned
for a slot and slots being reported as the wrong status.
Fixes: 3a379bbcea0a ("i3c: Add core I3C infrastructure")
Cc: Boris Brezillon <bbrezillon@kernel.org>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Jamie Iles <quic_jiles@quicinc.com>
---
drivers/i3c/master.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
index e2e12a5585e5..426027110a79 100644
--- a/drivers/i3c/master.c
+++ b/drivers/i3c/master.c
@@ -345,7 +345,8 @@ struct bus_type i3c_bus_type = {
static enum i3c_addr_slot_status
i3c_bus_get_addr_slot_status(struct i3c_bus *bus, u16 addr)
{
- int status, bitpos = addr * 2;
+ unsigned long status;
+ int bitpos = addr * 2;
if (addr > I2C_MAX_ADDR)
return I3C_ADDR_SLOT_RSVD;
--
2.30.2
--
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] i3c: fix incorrect address slot lookup on 64-bit
2021-09-22 16:56 [PATCH] i3c: fix incorrect address slot lookup on 64-bit Jamie Iles
@ 2021-09-25 21:20 ` Alexandre Belloni
0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Belloni @ 2021-09-25 21:20 UTC (permalink / raw)
To: linux-i3c, Jamie Iles; +Cc: Alexandre Belloni, Boris Brezillon
On Wed, 22 Sep 2021 17:56:00 +0100, Jamie Iles wrote:
> The address slot bitmap is an array of unsigned long's which are the
> same size as an int on 32-bit platforms but not 64-bit. Loading the
> bitmap into an int could result in the incorrect status being returned
> for a slot and slots being reported as the wrong status.
>
>
Applied, thanks!
[1/1] i3c: fix incorrect address slot lookup on 64-bit
commit: a3587e2c0578101900d4abbbd72ab3dad6d5568a
Best regards,
--
Alexandre Belloni <alexandre.belloni@bootlin.com>
--
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-09-25 21:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-22 16:56 [PATCH] i3c: fix incorrect address slot lookup on 64-bit Jamie Iles
2021-09-25 21:20 ` Alexandre Belloni
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.