[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ea78c21b-db4a-4144-b1b5-b1a37e1ed51c@arm.com>
Date: Fri, 7 Mar 2025 20:20:15 +0000
From: Robin Murphy <robin.murphy@....com>
To: Lorenzo Pieralisi <lpieralisi@...nel.org>
Cc: Hanjun Guo <guohanjun@...wei.com>, Sudeep Holla <sudeep.holla@....com>,
"Rafael J. Wysocki" <rafael@...nel.org>, Len Brown <lenb@...nel.org>,
Russell King <linux@...linux.org.uk>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Danilo Krummrich <dakr@...nel.org>, Stuart Yoder <stuyoder@...il.com>,
Laurentiu Tudor <laurentiu.tudor@....com>, Nipun Gupta
<nipun.gupta@....com>, Nikhil Agarwal <nikhil.agarwal@....com>,
Joerg Roedel <joro@...tes.org>, Will Deacon <will@...nel.org>,
Rob Herring <robh@...nel.org>, Saravana Kannan <saravanak@...gle.com>,
Bjorn Helgaas <bhelgaas@...gle.com>, linux-acpi@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
iommu@...ts.linux.dev, devicetree@...r.kernel.org,
linux-pci@...r.kernel.org, Charan Teja Kalla <quic_charante@...cinc.com>
Subject: Re: [PATCH v2 4/4] iommu: Get DT/ACPI parsing into the proper probe
path
On 2025-03-07 2:24 pm, Lorenzo Pieralisi wrote:
[...]
>> diff --git a/drivers/acpi/arm64/dma.c b/drivers/acpi/arm64/dma.c
>> index 52b2abf88689..f30f138352b7 100644
>> --- a/drivers/acpi/arm64/dma.c
>> +++ b/drivers/acpi/arm64/dma.c
>> @@ -26,6 +26,11 @@ void acpi_arch_dma_setup(struct device *dev)
>> else
>> end = (1ULL << 32) - 1;
>>
>> + if (dev->dma_range_map) {
>> + dev_dbg(dev, "dma_range_map already set\n");
>> + return;
>> + }
>> +
>
> Why are we checking that dev->dma_range_map exists here rather than
> at function entry ? Is that because we want to run the previous code
> for some reasons even if dev->dma_range_map is already set ?
>
> Just noticed, the OF counterpart does not seem to take the same
> approach, so I am just flagging this up if it matters at all.
The intent is just to ensure it's safe to come through this path more
than once for the time being - it doesn't really matter whether or not
we repeat anything apart from allocating and assigning dma_range_map,
since that leaks the previous allocation. Thus this check is logically
guarding the acpi_dma_get_range() call in this path, and the
of_dma_get_range() call in the other.
> Other than that, for acpi/arm64:
>
> Reviewed-by: Lorenzo Pieralisi <lpieralisi@...nel.org>
Thanks!
Robin.
Powered by blists - more mailing lists