[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201030180055.GD23196@gaia>
Date: Fri, 30 Oct 2020 18:00:55 +0000
From: Catalin Marinas <catalin.marinas@....com>
To: Nicolas Saenz Julienne <nsaenzjulienne@...e.de>
Cc: robh+dt@...nel.org, hch@....de, ardb@...nel.org,
linux-kernel@...r.kernel.org,
Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
Hanjun Guo <guohanjun@...wei.com>,
Sudeep Holla <sudeep.holla@....com>, robin.murphy@....com,
linux-arm-kernel@...ts.infradead.org,
linux-rpi-kernel@...ts.infradead.org, jeremy.linton@....com,
iommu@...ts.linux-foundation.org, devicetree@...r.kernel.org,
will@...nel.org, Anshuman Khandual <anshuman.khandual@....com>,
"Rafael J. Wysocki" <rjw@...ysocki.net>,
Len Brown <lenb@...nel.org>, linux-acpi@...r.kernel.org
Subject: Re: [PATCH v5 6/7] arm64: mm: Set ZONE_DMA size based on early IORT
scan
On Thu, Oct 29, 2020 at 06:25:49PM +0100, Nicolas Saenz Julienne wrote:
> diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c
> index 9929ff50c0c0..05fe4a076bab 100644
> --- a/drivers/acpi/arm64/iort.c
> +++ b/drivers/acpi/arm64/iort.c
> @@ -1718,3 +1718,55 @@ void __init acpi_iort_init(void)
>
> iort_init_platform_devices();
> }
> +
> +#ifdef CONFIG_ZONE_DMA
> +/*
> + * Check the IORT whether any devices exist whose DMA mask is < 32 bits.
> + * If so, return the smallest value encountered, or 32 otherwise.
> + */
> +unsigned int __init acpi_iort_get_zone_dma_size(void)
> +{
> + struct acpi_table_iort *iort;
> + struct acpi_iort_node *node, *end;
> + acpi_status status;
> + u8 limit = 32;
Nitpick: can we not return PHYS_ADDR_MAX here, for consistency with
of_dma_get_max_cpu_address()? There wouldn't be any functional change.
--
Catalin
Powered by blists - more mailing lists