[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v8 09/13] arm/smmu-v3: add suspend/resume handlers


  • To: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • From: Mykola Kvach <xakep.amatop@xxxxxxxxx>
  • Date: Sat, 9 May 2026 00:44:28 +0300
  • Arc-authentication-results: i=1; mx.google.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=E2Tfv4RQ0b6OUOJg1H7aF6Cfn8Il7mcxiJlBmQdg7Kg=; fh=jXKZth/5dXfK4eyQ3th9VcbDCKu2IJKxdxWeypBGkUc=; b=T/HZfxtIkEQtgOuKjcGvERvmLySjehvh/WHmJKqzJJb0sPseBixZZjInNqa6CXRS6m z/B9dDc/V86G/En0VM7KiojLDZKBpXxoUNIpqmbB+geQJYt8jCduO5Oy8+F8XxB4JKQW MI2ogE3ivTsxJN5+iC9P1n2hobj/ftO1hF8D/00wB8vXSsYMzbAZm/Lg4QwHicPRKgeo +IhWUJVGgax9uI1BxyM9LBhLSXM8OmCVRXZiIkkCWiaYlBI/zjRe2tGfvVKHWI43f+89 Bh863r+rrxef2PkptaldurdZOhDcrSgh2B17vm34+JxSv8YicDtF9Zu95YklEXkkejts 7NZw==; darn=lists.xenproject.org
  • Arc-seal: i=1; a=rsa-sha256; t=1778276680; cv=none; d=google.com; s=arc-20240605; b=DMHgSQN04B7y4DlEF2bRqY4Ien/48xkX17+d9ZZwVWpcD6qIk6nr1+SGmxwvQEhaD9 9Y3QXHRCPHDobmF0NZpgHHTHfyz6znHWYqolKqElIbl0YFYHP9Iv/KziqOTpC/Bp44i4 SYdLbnB8uK7XYYCDWvbanoKPKZXJKt23hMD2ileB4YyNGR0FQ8BgEvH/+IAVN2thnXnv 4w0XSIir9gFflhOIxURRAB9E4RzymDXSXqCssIYUJGM7Mg0z7iUL48Snn9RI0MSm8ZCU CszL8LLLoSmS3zcJLqGCEWrx8uDRaI68tX5xfYrLqiq1G87eZXxkwZKpq7WtbbS9NtQn +poA==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Mykola Kvach <mykola_kvach@xxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Rahul Singh <Rahul.Singh@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Fri, 08 May 2026 21:44:52 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Fri, May 8, 2026 at 3:22 PM Luca Fancellu <Luca.Fancellu@xxxxxxx> wrote:
>
> HI Mykola,
>
> >>>
> >>> -static int __init arm_smmu_device_reset(struct arm_smmu_device *smmu)
> >>> +static int arm_smmu_device_reset(struct arm_smmu_device *smmu)
> >>> {
> >>> int ret;
> >>> u32 reg, enables;
> >>> @@ -2163,17 +2166,9 @@ static int __init arm_smmu_device_reset(struct 
> >>> arm_smmu_device *smmu)
> >>> }
> >>> }
> >>>
> >>> - ret = arm_smmu_setup_irqs(smmu);
> >>> - if (ret) {
> >>> - dev_err(smmu->dev, "failed to setup irqs\n");
> >>
> >> We are moving this one to the probe and ..
> >>
> >>> + ret = arm_smmu_enable_irqs(smmu);
> >>> + if ( ret )
> >>
> >> changing with this one, but arm_smmu_setup_irqs() also calls 
> >> arm_smmu_setup_unique_irqs() which
> >> calls arm_smmu_setup_msis(), are we sure that on resume we will get the 
> >> same state?
> >
> > This follows the split introduced in the Linux arm-smmu-v3 runtime/system 
> > sleep
> > series:
> >
> > https://lore.kernel.org/linux-iommu/20260414194702.1229094-1-praan@xxxxxxxxxx/
> >
> > The intent is to keep IRQ handler registration as one-time probe state, 
> > while
> > reset/resume only restores the SMMU hardware state and re-enables interrupt
> > generation.
> >
> > You are right that the MSI case needs extra care. In the Linux series this 
> > is
> > handled by arm_smmu_resume_msis(), which restores the SMMU-side MSI
> > configuration. I did not port that part in this patch because Xen SMMUv3 MSI
> > support is currently documented as unsupported and is not part of the
> > supported/tested path, so this patch only covers the wired IRQ path used by 
> > Xen
> > today.
> >
> > If Xen SMMUv3 MSI support becomes usable in the future, the resume path will
> > need an equivalent MSI restore step before IRQ_CTRL is re-enabled.
>
> In the mean time should we check maybe smmu->features doesn’t have
> ARM_SMMU_FEAT_MSI flag and document it in commit message?
>
> What do you think about it? I’m just worried someone uses CONFIG_MSI and your
> feature and ends up in some trouble, while we know that your feature breaks
> CONFIG_MSI.

Good point.

I don't think checking only ARM_SMMU_FEAT_MSI in this patch is the right
approach, since that reflects hardware capability rather than whether Xen is
actually using the SMMUv3 MSI IRQ path.

For v9, I plan to keep this SMMUv3 patch limited to documenting the current
limitation in the driver and in the commit message: the MSI IRQ path is not
host-suspend-safe yet because resume does not restore the SMMU *_IRQ_CFGn
registers.

The actual runtime block will be added in a later host suspend policy patch,
together with the other runtime blockers. That keeps the policy in one place
and ensures PSCI_FEATURES(SYSTEM_SUSPEND) stays consistent with the actual
SYSTEM_SUSPEND handling.

Best regards,
Mykola

>
> Maybe the maintainers can give their opinion here as well.
>
> Cheers,
> Luca



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.