[PATCH v10 07/15] platform-msi: Introduce platform_device_msi_rewrite()
Jason Gunthorpe
jgg at nvidia.com
Tue Sep 8 15:55:31 PDT 2026
On Tue, Sep 08, 2026 at 09:40:49PM +0200, Thomas Gleixner wrote:
> On Tue, Sep 08 2026 at 17:17, Pranjal Shrivastava wrote:
>
> ...
> > Suggested-by: Jason Gunthorpe <jgg at nvidia.com>
>
> Jason. You really should know better by now :(
I know better enough to have pointed out that an open coded version of
this in a driver should not be open coded in a driver and be made into
proper helper, so you can see it :)
> > + desc = irq_get_msi_desc(irq);
> > + if (!desc) {
> > + dev_err(dev, "Failed to get MSI descriptor for irq %u\n", irq);
> > + return;
> > + }
>
> Doing this without having the underlying interrupt descriptor locked is
> a recipe for an undebuggable disaster waiting to happen. It might be
> "safe" in the context you are calling it but it's absolutely not safe in
> general.
Which is why we are here, I was wondering if the open coded
implementation was even OK..
> @@ -1775,3 +1775,34 @@ bool msi_device_has_isolated_msi(struct
> return arch_is_isolated_msi();
> }
> EXPORT_SYMBOL_GPL(msi_device_has_isolated_msi);
> +
> +void msi_device_domain_restore_msi_msgs(struct device *dev, unsigned int domid)
> +{
Wonderful!
Thanks,
Jason
More information about the linux-arm-kernel
mailing list