[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aM3fprNNMZWJysMw@Asurada-Nvidia>
Date: Fri, 19 Sep 2025 15:56:38 -0700
From: Nicolin Chen <nicolinc@...dia.com>
To: <joro@...tes.org>, <jgg@...dia.com>, <bhelgaas@...gle.com>
CC: <suravee.suthikulpanit@....com>, <will@...nel.org>,
<robin.murphy@....com>, <sven@...nel.org>, <j@...nau.net>,
<alyssa@...enzweig.io>, <neal@...pa.dev>, <robin.clark@....qualcomm.com>,
<m.szyprowski@...sung.com>, <krzk@...nel.org>, <alim.akhtar@...sung.com>,
<dwmw2@...radead.org>, <baolu.lu@...ux.intel.com>, <kevin.tian@...el.com>,
<yong.wu@...iatek.com>, <matthias.bgg@...il.com>,
<angelogioacchino.delregno@...labora.com>, <tjeznach@...osinc.com>,
<paul.walmsley@...ive.com>, <palmer@...belt.com>, <aou@...s.berkeley.edu>,
<alex@...ti.fr>, <heiko@...ech.de>, <schnelle@...ux.ibm.com>,
<mjrosato@...ux.ibm.com>, <gerald.schaefer@...ux.ibm.com>,
<orsonzhai@...il.com>, <baolin.wang@...ux.alibaba.com>,
<zhang.lyra@...il.com>, <wens@...e.org>, <jernej.skrabec@...il.com>,
<samuel@...lland.org>, <jean-philippe@...aro.org>, <rafael@...nel.org>,
<lenb@...nel.org>, <yi.l.liu@...el.com>, <cwabbott0@...il.com>,
<quic_pbrahma@...cinc.com>, <iommu@...ts.linux.dev>,
<linux-kernel@...r.kernel.org>, <asahi@...ts.linux.dev>,
<linux-arm-kernel@...ts.infradead.org>, <linux-arm-msm@...r.kernel.org>,
<linux-samsung-soc@...r.kernel.org>, <linux-mediatek@...ts.infradead.org>,
<linux-riscv@...ts.infradead.org>, <linux-rockchip@...ts.infradead.org>,
<linux-s390@...r.kernel.org>, <linux-sunxi@...ts.linux.dev>,
<linux-tegra@...r.kernel.org>, <virtualization@...ts.linux.dev>,
<linux-acpi@...r.kernel.org>, <linux-pci@...r.kernel.org>,
<patches@...ts.linux.dev>, <vsethi@...dia.com>, <helgaas@...nel.org>,
<etzhao1900@...il.com>
Subject: Re: [PATCH v4 4/7] iommu: Pass in old domain to attach_dev callback
functions
On Sun, Aug 31, 2025 at 04:31:56PM -0700, Nicolin Chen wrote:
> @@ -2347,7 +2352,8 @@ static int __iommu_group_set_domain_internal(struct iommu_group *group,
> */
> result = 0;
> for_each_group_device(group, gdev) {
> - ret = __iommu_device_set_domain(group, gdev, new_domain, flags);
> + ret = __iommu_device_set_domain(group, gdev, new_domain,
> + group->domain, flags);
> if (ret) {
> result = ret;
> /*
> @@ -2379,7 +2385,7 @@ static int __iommu_group_set_domain_internal(struct iommu_group *group,
> */
> if (group->domain)
> WARN_ON(__iommu_device_set_domain(
> - group, gdev, group->domain,
> + group, gdev, group->domain, new_domain,
> IOMMU_SET_DOMAIN_MUST_SUCCEED));
> if (gdev == last_gdev)
> break;
This last_gdev is the device failing __iommu_device_set_domain()
previously, so it should not be reverted from the new_domain to
the group->domain, as it has never left the group->domain.
This isn't a problem without this patch, because the revert will
be simply a re-attach (from group->domain to group->domain).
I'm adding a new patch to the top of the series in v5, though it
doesn't worth being a bug fix IMHO.
Thanks
Nicolin
Powered by blists - more mailing lists