linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i3c: master: Fix SETDASA process
@ 2023-08-22  5:19 Aniket
  2023-08-27 22:46 ` Alexandre Belloni
  0 siblings, 1 reply; 2+ messages in thread
From: Aniket @ 2023-08-22  5:19 UTC (permalink / raw)
  To: Alexandre Belloni; +Cc: linux-i3c, linux-kernel, joychakr, manugautam, Aniket

When a I3C DT node has a static_addr and an init_dyn_addr,the
init_dyn_addr is reserved in i3c_master_bus_init() and then
the static_addr is reserved in i3c_master_early_i3c_dev_add().
But if the dynamic address is same as static then above
procedure would fail.
Add a check to pass i3c_bus_get_addr_slot_status() when static
and dynamic address are equal.

Signed-off-by: Aniket <aniketmaurya@google.com>
---
 drivers/i3c/master.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
index 08aeb69a7800..87283e4a4607 100644
--- a/drivers/i3c/master.c
+++ b/drivers/i3c/master.c
@@ -1308,7 +1308,11 @@ static int i3c_master_get_i3c_addrs(struct i3c_dev_desc *dev)
 	if (dev->info.static_addr) {
 		status = i3c_bus_get_addr_slot_status(&master->bus,
 						      dev->info.static_addr);
-		if (status != I3C_ADDR_SLOT_FREE)
+		/* Since static address and assigned dynamic address can be
+		 * equal, allow this case to pass.
+		 */
+		if (status != I3C_ADDR_SLOT_FREE &&
+		    dev->info.static_addr != dev->boardinfo->init_dyn_addr)
 			return -EBUSY;
 
 		i3c_bus_set_addr_slot_status(&master->bus,
-- 
2.42.0.rc1.204.g551eb34607-goog


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

* Re: [PATCH] i3c: master: Fix SETDASA process
  2023-08-22  5:19 [PATCH] i3c: master: Fix SETDASA process Aniket
@ 2023-08-27 22:46 ` Alexandre Belloni
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Belloni @ 2023-08-27 22:46 UTC (permalink / raw)
  To: Aniket; +Cc: linux-i3c, linux-kernel, joychakr, manugautam


On Tue, 22 Aug 2023 05:19:38 +0000, Aniket wrote:
> When a I3C DT node has a static_addr and an init_dyn_addr,the
> init_dyn_addr is reserved in i3c_master_bus_init() and then
> the static_addr is reserved in i3c_master_early_i3c_dev_add().
> But if the dynamic address is same as static then above
> procedure would fail.
> Add a check to pass i3c_bus_get_addr_slot_status() when static
> and dynamic address are equal.
> 
> [...]

Applied, thanks!

[1/1] i3c: master: Fix SETDASA process
      commit: c6a7550458922181bb922863d5f5feaf3c453fe5

Best regards,

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

end of thread, other threads:[~2023-08-27 22:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-22  5:19 [PATCH] i3c: master: Fix SETDASA process Aniket
2023-08-27 22:46 ` Alexandre Belloni

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).