All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Frank Li <Frank.Li@nxp.com>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>,
	Conor Culhane <conor.culhane@silvaco.com>,
	Clark Wang <xiaoning.wang@nxp.com>,
	"moderated list:SILVACO I3C DUAL-ROLE MASTER"
	<linux-i3c@lists.infradead.org>,
	open list <linux-kernel@vger.kernel.org>,
	imx@lists.linux.dev
Subject: Re: [PATCH 1/1] i3c: master: svc: Modify enabled_events bit 7:0 to act as IBI enable counter
Date: Fri, 1 Nov 2024 00:05:10 +0100	[thread overview]
Message-ID: <202410312305108f8c61cf@mail.local> (raw)
In-Reply-To: <20241024203855.1584416-1-Frank.Li@nxp.com>

Hello,

On 24/10/2024 16:38:55-0400, Frank Li wrote:
> Fix issue where disabling IBI on one device disables the entire IBI
> interrupt. Modify bit 7:0 of enabled_events to serve as an IBI enable
> counter, ensuring that the system IBI interrupt is disabled only when all
> I3C devices have IBI disabled.
> 
> Cc: stable@kernel.org
> Fixes: 7ff730ca458e ("i3c: master: svc: enable the interrupt in the enable ibi function")
> Signed-off-by: Frank Li <Frank.Li@nxp.com>

This doesn't apply on i3c/next after applying your patches, can you
rebase?

> ---
>  drivers/i3c/master/svc-i3c-master.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c
> index d1ebfba3739c1..66fe0fc12c897 100644
> --- a/drivers/i3c/master/svc-i3c-master.c
> +++ b/drivers/i3c/master/svc-i3c-master.c
> @@ -130,8 +130,8 @@
>  /* This parameter depends on the implementation and may be tuned */
>  #define SVC_I3C_FIFO_SIZE 16
>  
> -#define SVC_I3C_EVENT_IBI	BIT(0)
> -#define SVC_I3C_EVENT_HOTJOIN	BIT(1)
> +#define SVC_I3C_EVENT_IBI	GENMASK(7, 0)
> +#define SVC_I3C_EVENT_HOTJOIN	BIT(31)
>  
>  struct svc_i3c_cmd {
>  	u8 addr;
> @@ -214,7 +214,7 @@ struct svc_i3c_master {
>  		spinlock_t lock;
>  	} ibi;
>  	struct mutex lock;
> -	int enabled_events;
> +	u32 enabled_events;
>  };
>  
>  /**
> @@ -1532,7 +1532,7 @@ static int svc_i3c_master_enable_ibi(struct i3c_dev_desc *dev)
>  		return ret;
>  	}
>  
> -	master->enabled_events |= SVC_I3C_EVENT_IBI;
> +	master->enabled_events++;
>  	svc_i3c_master_enable_interrupts(master, SVC_I3C_MINT_SLVSTART);
>  
>  	return i3c_master_enec_locked(m, dev->info.dyn_addr, I3C_CCC_EVENT_SIR);
> @@ -1544,7 +1544,7 @@ static int svc_i3c_master_disable_ibi(struct i3c_dev_desc *dev)
>  	struct svc_i3c_master *master = to_svc_i3c_master(m);
>  	int ret;
>  
> -	master->enabled_events &= ~SVC_I3C_EVENT_IBI;
> +	master->enabled_events--;
>  	if (!master->enabled_events)
>  		svc_i3c_master_disable_interrupts(master);
>  
> -- 
> 2.34.1
> 

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

WARNING: multiple messages have this Message-ID (diff)
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Frank Li <Frank.Li@nxp.com>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>,
	Conor Culhane <conor.culhane@silvaco.com>,
	Clark Wang <xiaoning.wang@nxp.com>,
	"moderated list:SILVACO I3C DUAL-ROLE MASTER"
	<linux-i3c@lists.infradead.org>,
	open list <linux-kernel@vger.kernel.org>,
	imx@lists.linux.dev
Subject: Re: [PATCH 1/1] i3c: master: svc: Modify enabled_events bit 7:0 to act as IBI enable counter
Date: Fri, 1 Nov 2024 00:05:10 +0100	[thread overview]
Message-ID: <202410312305108f8c61cf@mail.local> (raw)
In-Reply-To: <20241024203855.1584416-1-Frank.Li@nxp.com>

Hello,

On 24/10/2024 16:38:55-0400, Frank Li wrote:
> Fix issue where disabling IBI on one device disables the entire IBI
> interrupt. Modify bit 7:0 of enabled_events to serve as an IBI enable
> counter, ensuring that the system IBI interrupt is disabled only when all
> I3C devices have IBI disabled.
> 
> Cc: stable@kernel.org
> Fixes: 7ff730ca458e ("i3c: master: svc: enable the interrupt in the enable ibi function")
> Signed-off-by: Frank Li <Frank.Li@nxp.com>

This doesn't apply on i3c/next after applying your patches, can you
rebase?

> ---
>  drivers/i3c/master/svc-i3c-master.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c
> index d1ebfba3739c1..66fe0fc12c897 100644
> --- a/drivers/i3c/master/svc-i3c-master.c
> +++ b/drivers/i3c/master/svc-i3c-master.c
> @@ -130,8 +130,8 @@
>  /* This parameter depends on the implementation and may be tuned */
>  #define SVC_I3C_FIFO_SIZE 16
>  
> -#define SVC_I3C_EVENT_IBI	BIT(0)
> -#define SVC_I3C_EVENT_HOTJOIN	BIT(1)
> +#define SVC_I3C_EVENT_IBI	GENMASK(7, 0)
> +#define SVC_I3C_EVENT_HOTJOIN	BIT(31)
>  
>  struct svc_i3c_cmd {
>  	u8 addr;
> @@ -214,7 +214,7 @@ struct svc_i3c_master {
>  		spinlock_t lock;
>  	} ibi;
>  	struct mutex lock;
> -	int enabled_events;
> +	u32 enabled_events;
>  };
>  
>  /**
> @@ -1532,7 +1532,7 @@ static int svc_i3c_master_enable_ibi(struct i3c_dev_desc *dev)
>  		return ret;
>  	}
>  
> -	master->enabled_events |= SVC_I3C_EVENT_IBI;
> +	master->enabled_events++;
>  	svc_i3c_master_enable_interrupts(master, SVC_I3C_MINT_SLVSTART);
>  
>  	return i3c_master_enec_locked(m, dev->info.dyn_addr, I3C_CCC_EVENT_SIR);
> @@ -1544,7 +1544,7 @@ static int svc_i3c_master_disable_ibi(struct i3c_dev_desc *dev)
>  	struct svc_i3c_master *master = to_svc_i3c_master(m);
>  	int ret;
>  
> -	master->enabled_events &= ~SVC_I3C_EVENT_IBI;
> +	master->enabled_events--;
>  	if (!master->enabled_events)
>  		svc_i3c_master_disable_interrupts(master);
>  
> -- 
> 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

  parent reply	other threads:[~2024-10-31 23:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-24 20:38 [PATCH 1/1] i3c: master: svc: Modify enabled_events bit 7:0 to act as IBI enable counter Frank Li
2024-10-24 20:38 ` Frank Li
2024-10-25  7:53 ` Miquel Raynal
2024-10-25  7:53   ` Miquel Raynal
2024-10-25 14:00   ` Frank Li
2024-10-25 14:00     ` Frank Li
2024-10-25 14:10     ` Miquel Raynal
2024-10-25 14:10       ` Miquel Raynal
2024-10-31 23:05 ` Alexandre Belloni [this message]
2024-10-31 23:05   ` Alexandre Belloni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202410312305108f8c61cf@mail.local \
    --to=alexandre.belloni@bootlin.com \
    --cc=Frank.Li@nxp.com \
    --cc=conor.culhane@silvaco.com \
    --cc=imx@lists.linux.dev \
    --cc=linux-i3c@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=xiaoning.wang@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.