diff mbox series

[2/3] genirq/msi: cache the last msi msg

Message ID 20240324-smmu-v3-v1-2-11bc96e156a5@nxp.com (mailing list archive)
State New, archived
Headers show
Series iommu/smmu-v3: support suspend/resume | expand

Commit Message

Peng Fan (OSS) March 24, 2024, 12:28 p.m. UTC
From: Peng Fan <peng.fan@nxp.com>

Cache the last msi msg which will be used for ARM SMMU V3 resume

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 kernel/irq/msi.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Thomas Gleixner March 25, 2024, 5:40 p.m. UTC | #1
On Sun, Mar 24 2024 at 20:28, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
>
> Cache the last msi msg which will be used for ARM SMMU V3 resume
>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  kernel/irq/msi.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c
> index f90952ebc494..9d7e0a675089 100644
> --- a/kernel/irq/msi.c
> +++ b/kernel/irq/msi.c
> @@ -617,6 +617,9 @@ static unsigned int msi_domain_get_hwsize(struct device *dev, unsigned int domid
>  static inline void irq_chip_write_msi_msg(struct irq_data *data,
>  					  struct msi_msg *msg)
>  {
> +	struct msi_desc *desc = irq_data_get_msi_desc(data);
> +
> +	desc->msg = *msg;
>  	data->chip->irq_write_msi_msg(data, msg);
>  }

This should remove the very same line in the PCI/MSI code, no?

Thanks,

        tglx
Peng Fan March 26, 2024, 1:02 a.m. UTC | #2
> Subject: Re: [PATCH 2/3] genirq/msi: cache the last msi msg
> 
> On Sun, Mar 24 2024 at 20:28, Peng Fan (OSS) wrote:
> > From: Peng Fan <peng.fan@nxp.com>
> >
> > Cache the last msi msg which will be used for ARM SMMU V3 resume
> >
> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > ---
> >  kernel/irq/msi.c | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c index
> > f90952ebc494..9d7e0a675089 100644
> > --- a/kernel/irq/msi.c
> > +++ b/kernel/irq/msi.c
> > @@ -617,6 +617,9 @@ static unsigned int msi_domain_get_hwsize(struct
> > device *dev, unsigned int domid  static inline void
> irq_chip_write_msi_msg(struct irq_data *data,
> >  					  struct msi_msg *msg)
> >  {
> > +	struct msi_desc *desc = irq_data_get_msi_desc(data);
> > +
> > +	desc->msg = *msg;
> >  	data->chip->irq_write_msi_msg(data, msg);  }
> 
> This should remove the very same line in the PCI/MSI code, no?

I think no, but you have more knowledge than me, please correct if I am
wrong.
To zpci_irq_chip.irq_set_affinity
  zpci_set_irq_affinity->pci_write_msi_msg->cache the msg
In kernel/irq/msi.c
msi_domain_update_chip_ops 
        |->        if (!chip->irq_set_affinity)                                                                
                                   chip->irq_set_affinity = msi_domain_set_affinity

From above code, the pci/msi code should keep the caching code.

Thanks,
Peng.
> 
> Thanks,
> 
>         tglx
diff mbox series

Patch

diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c
index f90952ebc494..9d7e0a675089 100644
--- a/kernel/irq/msi.c
+++ b/kernel/irq/msi.c
@@ -617,6 +617,9 @@  static unsigned int msi_domain_get_hwsize(struct device *dev, unsigned int domid
 static inline void irq_chip_write_msi_msg(struct irq_data *data,
 					  struct msi_msg *msg)
 {
+	struct msi_desc *desc = irq_data_get_msi_desc(data);
+
+	desc->msg = *msg;
 	data->chip->irq_write_msi_msg(data, msg);
 }