* [PATCH v1 0/3] Some fixes for Silvaco I3C controller driver
@ 2025-03-17 5:19 Stanley Chu
2025-03-17 5:19 ` [PATCH v1 1/3] i3c: master: svc: Fix missing the IBI rules Stanley Chu
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Stanley Chu @ 2025-03-17 5:19 UTC (permalink / raw)
To: frank.li, miquel.raynal, alexandre.belloni, linux-i3c
Cc: linux-kernel, tomer.maimon, kwliu, yschu
This patchset adds some fixes for the Silvaco I3C controller driver.
Stanley Chu (3):
i3c: master: svc: Fix missing the IBI rules
i3c: master: svc: Use readsb helper for reading MDB
i3c: master: svc: Fix missing STOP for master request
drivers/i3c/master/svc-i3c-master.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--
2.34.1
--
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
^ permalink raw reply [flat|nested] 10+ messages in thread* [PATCH v1 1/3] i3c: master: svc: Fix missing the IBI rules 2025-03-17 5:19 [PATCH v1 0/3] Some fixes for Silvaco I3C controller driver Stanley Chu @ 2025-03-17 5:19 ` Stanley Chu 2025-03-17 13:36 ` Frank Li 2025-03-17 5:19 ` [PATCH v1 2/3] i3c: master: svc: Use readsb helper for reading MDB Stanley Chu 2025-03-17 5:19 ` [PATCH v1 3/3] i3c: master: svc: Fix missing STOP for master request Stanley Chu 2 siblings, 1 reply; 10+ messages in thread From: Stanley Chu @ 2025-03-17 5:19 UTC (permalink / raw) To: frank.li, miquel.raynal, alexandre.belloni, linux-i3c Cc: linux-kernel, tomer.maimon, kwliu, yschu From: Stanley Chu <yschu@nuvoton.com> The code does not add IBI rules for devices with controller capability. However, some target devices, such as secondary controller, also have the controller capability. Modify the code to add rules for devices capable of sending IBI requests. Fixes: dd3c52846d59 ("i3c: master: svc: Add Silvaco I3C master driver") Signed-off-by: Stanley Chu <yschu@nuvoton.com> --- drivers/i3c/master/svc-i3c-master.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c index 1d1f351b9a85..a72ba5a7edd4 100644 --- a/drivers/i3c/master/svc-i3c-master.c +++ b/drivers/i3c/master/svc-i3c-master.c @@ -1106,7 +1106,7 @@ static int svc_i3c_update_ibirules(struct svc_i3c_master *master) /* Create the IBIRULES register for both cases */ i3c_bus_for_each_i3cdev(&master->base.bus, dev) { - if (I3C_BCR_DEVICE_ROLE(dev->info.bcr) == I3C_BCR_I3C_MASTER) + if (!(dev->info.bcr & I3C_BCR_IBI_REQ_CAP)) continue; if (dev->info.bcr & I3C_BCR_IBI_PAYLOAD) { -- 2.34.1 -- linux-i3c mailing list linux-i3c@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-i3c ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH v1 1/3] i3c: master: svc: Fix missing the IBI rules 2025-03-17 5:19 ` [PATCH v1 1/3] i3c: master: svc: Fix missing the IBI rules Stanley Chu @ 2025-03-17 13:36 ` Frank Li 2025-03-17 22:44 ` Alexandre Belloni 0 siblings, 1 reply; 10+ messages in thread From: Frank Li @ 2025-03-17 13:36 UTC (permalink / raw) To: Stanley Chu Cc: miquel.raynal, alexandre.belloni, linux-i3c, linux-kernel, tomer.maimon, kwliu, yschu On Mon, Mar 17, 2025 at 01:19:49PM +0800, Stanley Chu wrote: > From: Stanley Chu <yschu@nuvoton.com> > > The code does not add IBI rules for devices with controller capability. > However, some target devices, such as secondary controller, also have ^^ dual rule devices OR However, the second controller have the controller capablity and work at target devices mode when the device probe. So add IBI rules for such devices. > the controller capability. > Modify the code to add rules for devices capable of sending IBI requests. > > Fixes: dd3c52846d59 ("i3c: master: svc: Add Silvaco I3C master driver") > Signed-off-by: Stanley Chu <yschu@nuvoton.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> > --- > drivers/i3c/master/svc-i3c-master.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c > index 1d1f351b9a85..a72ba5a7edd4 100644 > --- a/drivers/i3c/master/svc-i3c-master.c > +++ b/drivers/i3c/master/svc-i3c-master.c > @@ -1106,7 +1106,7 @@ static int svc_i3c_update_ibirules(struct svc_i3c_master *master) > > /* Create the IBIRULES register for both cases */ > i3c_bus_for_each_i3cdev(&master->base.bus, dev) { > - if (I3C_BCR_DEVICE_ROLE(dev->info.bcr) == I3C_BCR_I3C_MASTER) > + if (!(dev->info.bcr & I3C_BCR_IBI_REQ_CAP)) > continue; > > if (dev->info.bcr & I3C_BCR_IBI_PAYLOAD) { > -- > 2.34.1 > -- linux-i3c mailing list linux-i3c@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-i3c ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v1 1/3] i3c: master: svc: Fix missing the IBI rules 2025-03-17 13:36 ` Frank Li @ 2025-03-17 22:44 ` Alexandre Belloni 2025-03-18 13:31 ` Frank Li 0 siblings, 1 reply; 10+ messages in thread From: Alexandre Belloni @ 2025-03-17 22:44 UTC (permalink / raw) To: Frank Li Cc: Stanley Chu, miquel.raynal, linux-i3c, linux-kernel, tomer.maimon, kwliu, yschu Hello Frank, On 17/03/2025 09:36:20-0400, Frank Li wrote: > On Mon, Mar 17, 2025 at 01:19:49PM +0800, Stanley Chu wrote: > > From: Stanley Chu <yschu@nuvoton.com> > > > > The code does not add IBI rules for devices with controller capability. > > However, some target devices, such as secondary controller, also have > ^^ dual rule devices > > OR > > However, the second controller have the controller capablity and work at > target devices mode when the device probe. So add IBI rules for such > devices. > > > > the controller capability. > > Modify the code to add rules for devices capable of sending IBI requests. > > > > Fixes: dd3c52846d59 ("i3c: master: svc: Add Silvaco I3C master driver") > > Signed-off-by: Stanley Chu <yschu@nuvoton.com> > > > Reviewed-by: Frank Li <Frank.Li@nxp.com> Please avoid adding you reviewed-by tag when you request changes, else patch work will show the patch as being applicable. This is fine to do it occasionally but not for all the patches you review. You can simply wait for the next version to come. > > > > --- > > drivers/i3c/master/svc-i3c-master.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c > > index 1d1f351b9a85..a72ba5a7edd4 100644 > > --- a/drivers/i3c/master/svc-i3c-master.c > > +++ b/drivers/i3c/master/svc-i3c-master.c > > @@ -1106,7 +1106,7 @@ static int svc_i3c_update_ibirules(struct svc_i3c_master *master) > > > > /* Create the IBIRULES register for both cases */ > > i3c_bus_for_each_i3cdev(&master->base.bus, dev) { > > - if (I3C_BCR_DEVICE_ROLE(dev->info.bcr) == I3C_BCR_I3C_MASTER) > > + if (!(dev->info.bcr & I3C_BCR_IBI_REQ_CAP)) > > continue; > > > > if (dev->info.bcr & I3C_BCR_IBI_PAYLOAD) { > > -- > > 2.34.1 > > -- Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com -- linux-i3c mailing list linux-i3c@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-i3c ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v1 1/3] i3c: master: svc: Fix missing the IBI rules 2025-03-17 22:44 ` Alexandre Belloni @ 2025-03-18 13:31 ` Frank Li 2025-03-18 16:03 ` Alexandre Belloni 0 siblings, 1 reply; 10+ messages in thread From: Frank Li @ 2025-03-18 13:31 UTC (permalink / raw) To: Alexandre Belloni Cc: Stanley Chu, miquel.raynal, linux-i3c, linux-kernel, tomer.maimon, kwliu, yschu On Mon, Mar 17, 2025 at 11:44:40PM +0100, Alexandre Belloni wrote: > Hello Frank, > > On 17/03/2025 09:36:20-0400, Frank Li wrote: > > On Mon, Mar 17, 2025 at 01:19:49PM +0800, Stanley Chu wrote: > > > From: Stanley Chu <yschu@nuvoton.com> > > > > > > The code does not add IBI rules for devices with controller capability. > > > However, some target devices, such as secondary controller, also have > > ^^ dual rule devices > > > > OR > > > > However, the second controller have the controller capablity and work at > > target devices mode when the device probe. So add IBI rules for such > > devices. > > > > > > > the controller capability. > > > Modify the code to add rules for devices capable of sending IBI requests. > > > > > > Fixes: dd3c52846d59 ("i3c: master: svc: Add Silvaco I3C master driver") > > > Signed-off-by: Stanley Chu <yschu@nuvoton.com> > > > > > > Reviewed-by: Frank Li <Frank.Li@nxp.com> > > Please avoid adding you reviewed-by tag when you request changes, else > patch work will show the patch as being applicable. This is fine to do > it occasionally but not for all the patches you review. You can simply > wait for the next version to come. > Okay, I saw some device tree reviewer provide tag if only some minor changes. Frank > > > > > > > --- > > > drivers/i3c/master/svc-i3c-master.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c > > > index 1d1f351b9a85..a72ba5a7edd4 100644 > > > --- a/drivers/i3c/master/svc-i3c-master.c > > > +++ b/drivers/i3c/master/svc-i3c-master.c > > > @@ -1106,7 +1106,7 @@ static int svc_i3c_update_ibirules(struct svc_i3c_master *master) > > > > > > /* Create the IBIRULES register for both cases */ > > > i3c_bus_for_each_i3cdev(&master->base.bus, dev) { > > > - if (I3C_BCR_DEVICE_ROLE(dev->info.bcr) == I3C_BCR_I3C_MASTER) > > > + if (!(dev->info.bcr & I3C_BCR_IBI_REQ_CAP)) > > > continue; > > > > > > if (dev->info.bcr & I3C_BCR_IBI_PAYLOAD) { > > > -- > > > 2.34.1 > > > > > -- > Alexandre Belloni, co-owner and COO, Bootlin > Embedded Linux and Kernel engineering > https://bootlin.com -- linux-i3c mailing list linux-i3c@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-i3c ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v1 1/3] i3c: master: svc: Fix missing the IBI rules 2025-03-18 13:31 ` Frank Li @ 2025-03-18 16:03 ` Alexandre Belloni 0 siblings, 0 replies; 10+ messages in thread From: Alexandre Belloni @ 2025-03-18 16:03 UTC (permalink / raw) To: Frank Li Cc: Stanley Chu, miquel.raynal, linux-i3c, linux-kernel, tomer.maimon, kwliu, yschu On 18/03/2025 09:31:53-0400, Frank Li wrote: > On Mon, Mar 17, 2025 at 11:44:40PM +0100, Alexandre Belloni wrote: > > Hello Frank, > > > > On 17/03/2025 09:36:20-0400, Frank Li wrote: > > > On Mon, Mar 17, 2025 at 01:19:49PM +0800, Stanley Chu wrote: > > > > From: Stanley Chu <yschu@nuvoton.com> > > > > > > > > The code does not add IBI rules for devices with controller capability. > > > > However, some target devices, such as secondary controller, also have > > > ^^ dual rule devices > > > > > > OR > > > > > > However, the second controller have the controller capablity and work at > > > target devices mode when the device probe. So add IBI rules for such > > > devices. > > > > > > > > > > the controller capability. > > > > Modify the code to add rules for devices capable of sending IBI requests. > > > > > > > > Fixes: dd3c52846d59 ("i3c: master: svc: Add Silvaco I3C master driver") > > > > Signed-off-by: Stanley Chu <yschu@nuvoton.com> > > > > > > > > > Reviewed-by: Frank Li <Frank.Li@nxp.com> > > > > Please avoid adding you reviewed-by tag when you request changes, else > > patch work will show the patch as being applicable. This is fine to do > > it occasionally but not for all the patches you review. You can simply > > wait for the next version to come. > > > > Okay, I saw some device tree reviewer provide tag if only some minor > changes. > Yes, that can be done sometimes but then the submitter would have to collect the tags which didn't happen this time and there will always be an extra review for the subsystem that will gate the patches. -- Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com -- linux-i3c mailing list linux-i3c@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-i3c ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v1 2/3] i3c: master: svc: Use readsb helper for reading MDB 2025-03-17 5:19 [PATCH v1 0/3] Some fixes for Silvaco I3C controller driver Stanley Chu 2025-03-17 5:19 ` [PATCH v1 1/3] i3c: master: svc: Fix missing the IBI rules Stanley Chu @ 2025-03-17 5:19 ` Stanley Chu 2025-03-17 13:38 ` Frank Li 2025-03-17 5:19 ` [PATCH v1 3/3] i3c: master: svc: Fix missing STOP for master request Stanley Chu 2 siblings, 1 reply; 10+ messages in thread From: Stanley Chu @ 2025-03-17 5:19 UTC (permalink / raw) To: frank.li, miquel.raynal, alexandre.belloni, linux-i3c Cc: linux-kernel, tomer.maimon, kwliu, yschu From: Stanley Chu <yschu@nuvoton.com> The target can send the MDB byte followed by additional data bytes. The readl on MRDATAB reads one actual byte, but the readsl advances the destination pointer by 4 bytes. This causes the subsequent payload to be copied to wrong position in the destination buffer. Fixes: dd3c52846d59 ("i3c: master: svc: Add Silvaco I3C master driver") Signed-off-by: Stanley Chu <yschu@nuvoton.com> --- drivers/i3c/master/svc-i3c-master.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c index a72ba5a7edd4..57b9dec6b5a8 100644 --- a/drivers/i3c/master/svc-i3c-master.c +++ b/drivers/i3c/master/svc-i3c-master.c @@ -425,7 +425,7 @@ static int svc_i3c_master_handle_ibi(struct svc_i3c_master *master, slot->len < SVC_I3C_FIFO_SIZE) { mdatactrl = readl(master->regs + SVC_I3C_MDATACTRL); count = SVC_I3C_MDATACTRL_RXCOUNT(mdatactrl); - readsl(master->regs + SVC_I3C_MRDATAB, buf, count); + readsb(master->regs + SVC_I3C_MRDATAB, buf, count); slot->len += count; buf += count; } -- 2.34.1 -- linux-i3c mailing list linux-i3c@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-i3c ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH v1 2/3] i3c: master: svc: Use readsb helper for reading MDB 2025-03-17 5:19 ` [PATCH v1 2/3] i3c: master: svc: Use readsb helper for reading MDB Stanley Chu @ 2025-03-17 13:38 ` Frank Li 0 siblings, 0 replies; 10+ messages in thread From: Frank Li @ 2025-03-17 13:38 UTC (permalink / raw) To: Stanley Chu Cc: miquel.raynal, alexandre.belloni, linux-i3c, linux-kernel, tomer.maimon, kwliu, yschu On Mon, Mar 17, 2025 at 01:19:50PM +0800, Stanley Chu wrote: > From: Stanley Chu <yschu@nuvoton.com> > > The target can send the MDB byte followed by additional data bytes. > The readl on MRDATAB reads one actual byte, but the readsl advances > the destination pointer by 4 bytes. This causes the subsequent payload > to be copied to wrong position in the destination buffer. > > Fixes: dd3c52846d59 ("i3c: master: svc: Add Silvaco I3C master driver") Cc stable? > Signed-off-by: Stanley Chu <yschu@nuvoton.com> strange, why this issue exists for so long time. Maybe we just use first byte of IBI data. Reviewed-by: Frank Li <Frank.Li@nxp.com> > --- > drivers/i3c/master/svc-i3c-master.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c > index a72ba5a7edd4..57b9dec6b5a8 100644 > --- a/drivers/i3c/master/svc-i3c-master.c > +++ b/drivers/i3c/master/svc-i3c-master.c > @@ -425,7 +425,7 @@ static int svc_i3c_master_handle_ibi(struct svc_i3c_master *master, > slot->len < SVC_I3C_FIFO_SIZE) { > mdatactrl = readl(master->regs + SVC_I3C_MDATACTRL); > count = SVC_I3C_MDATACTRL_RXCOUNT(mdatactrl); > - readsl(master->regs + SVC_I3C_MRDATAB, buf, count); > + readsb(master->regs + SVC_I3C_MRDATAB, buf, count); > slot->len += count; > buf += count; > } > -- > 2.34.1 > -- linux-i3c mailing list linux-i3c@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-i3c ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v1 3/3] i3c: master: svc: Fix missing STOP for master request 2025-03-17 5:19 [PATCH v1 0/3] Some fixes for Silvaco I3C controller driver Stanley Chu 2025-03-17 5:19 ` [PATCH v1 1/3] i3c: master: svc: Fix missing the IBI rules Stanley Chu 2025-03-17 5:19 ` [PATCH v1 2/3] i3c: master: svc: Use readsb helper for reading MDB Stanley Chu @ 2025-03-17 5:19 ` Stanley Chu 2025-03-17 13:40 ` Frank Li 2 siblings, 1 reply; 10+ messages in thread From: Stanley Chu @ 2025-03-17 5:19 UTC (permalink / raw) To: frank.li, miquel.raynal, alexandre.belloni, linux-i3c Cc: linux-kernel, tomer.maimon, kwliu, yschu From: Stanley Chu <yschu@nuvoton.com> The controller driver nacked the master request but didn't emit a STOP to end the transaction. The driver shall refuse the unsupported requests and return the controller state to IDLE by emitting a STOP. Fixes: dd3c52846d59 ("i3c: master: svc: Add Silvaco I3C master driver") Signed-off-by: Stanley Chu <yschu@nuvoton.com> --- drivers/i3c/master/svc-i3c-master.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c index 57b9dec6b5a8..e0cd3ce28b7f 100644 --- a/drivers/i3c/master/svc-i3c-master.c +++ b/drivers/i3c/master/svc-i3c-master.c @@ -592,6 +592,7 @@ static void svc_i3c_master_ibi_work(struct work_struct *work) queue_work(master->base.wq, &master->hj_work); break; case SVC_I3C_MSTATUS_IBITYPE_MASTER_REQUEST: + svc_i3c_master_emit_stop(master); default: break; } -- 2.34.1 -- linux-i3c mailing list linux-i3c@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-i3c ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH v1 3/3] i3c: master: svc: Fix missing STOP for master request 2025-03-17 5:19 ` [PATCH v1 3/3] i3c: master: svc: Fix missing STOP for master request Stanley Chu @ 2025-03-17 13:40 ` Frank Li 0 siblings, 0 replies; 10+ messages in thread From: Frank Li @ 2025-03-17 13:40 UTC (permalink / raw) To: Stanley Chu Cc: miquel.raynal, alexandre.belloni, linux-i3c, linux-kernel, tomer.maimon, kwliu, yschu On Mon, Mar 17, 2025 at 01:19:51PM +0800, Stanley Chu wrote: > From: Stanley Chu <yschu@nuvoton.com> > > The controller driver nacked the master request but didn't emit a > STOP to end the transaction. The driver shall refuse the unsupported > requests and return the controller state to IDLE by emitting a STOP. > > Fixes: dd3c52846d59 ("i3c: master: svc: Add Silvaco I3C master driver") Current framework code don't support master request. So it is not fixes. needn't fixes tag. Reviewed-by: Frank Li <Frank.Li@nxp.com> > Signed-off-by: Stanley Chu <yschu@nuvoton.com> > --- > drivers/i3c/master/svc-i3c-master.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c > index 57b9dec6b5a8..e0cd3ce28b7f 100644 > --- a/drivers/i3c/master/svc-i3c-master.c > +++ b/drivers/i3c/master/svc-i3c-master.c > @@ -592,6 +592,7 @@ static void svc_i3c_master_ibi_work(struct work_struct *work) > queue_work(master->base.wq, &master->hj_work); > break; > case SVC_I3C_MSTATUS_IBITYPE_MASTER_REQUEST: > + svc_i3c_master_emit_stop(master); > default: > break; > } > -- > 2.34.1 > -- linux-i3c mailing list linux-i3c@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-i3c ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2025-03-18 16:04 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-03-17 5:19 [PATCH v1 0/3] Some fixes for Silvaco I3C controller driver Stanley Chu 2025-03-17 5:19 ` [PATCH v1 1/3] i3c: master: svc: Fix missing the IBI rules Stanley Chu 2025-03-17 13:36 ` Frank Li 2025-03-17 22:44 ` Alexandre Belloni 2025-03-18 13:31 ` Frank Li 2025-03-18 16:03 ` Alexandre Belloni 2025-03-17 5:19 ` [PATCH v1 2/3] i3c: master: svc: Use readsb helper for reading MDB Stanley Chu 2025-03-17 13:38 ` Frank Li 2025-03-17 5:19 ` [PATCH v1 3/3] i3c: master: svc: Fix missing STOP for master request Stanley Chu 2025-03-17 13:40 ` Frank Li
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).