diff mbox series

[v1,1/3] i3c: master: svc: Fix missing the IBI rules

Message ID 20250317051951.3065011-2-yschu@nuvoton.com (mailing list archive)
State Superseded
Headers show
Series Some fixes for Silvaco I3C controller driver | expand

Commit Message

Stanley Chu March 17, 2025, 5:19 a.m. UTC
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(-)

Comments

Frank Li March 17, 2025, 1:36 p.m. UTC | #1
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
>
Alexandre Belloni March 17, 2025, 10:44 p.m. UTC | #2
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
> >
Frank Li March 18, 2025, 1:31 p.m. UTC | #3
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
Alexandre Belloni March 18, 2025, 4:03 p.m. UTC | #4
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.
diff mbox series

Patch

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