Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency

2015-05-11 Thread Robin Murphy
On 11/05/15 18:10, Catalin Marinas wrote: On Fri, May 08, 2015 at 04:08:53PM +0200, Arnd Bergmann wrote: On Friday 01 May 2015 12:06:44 Catalin Marinas wrote: If we just disallow DMA to devices that are marked with _CCA=0 in ACPI, we can avoid this case, or discuss it by the time someone has

Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency

2015-05-11 Thread Catalin Marinas
On Fri, May 08, 2015 at 04:08:53PM +0200, Arnd Bergmann wrote: > On Friday 01 May 2015 12:06:44 Catalin Marinas wrote: > > > If we just disallow DMA to devices that are marked with _CCA=0 > > > in ACPI, we can avoid this case, or discuss it by the time someone has > > > hardware > > > that wants

Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency

2015-05-11 Thread Robin Murphy
On 11/05/15 18:10, Catalin Marinas wrote: On Fri, May 08, 2015 at 04:08:53PM +0200, Arnd Bergmann wrote: On Friday 01 May 2015 12:06:44 Catalin Marinas wrote: If we just disallow DMA to devices that are marked with _CCA=0 in ACPI, we can avoid this case, or discuss it by the time someone has

Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency

2015-05-11 Thread Catalin Marinas
On Fri, May 08, 2015 at 04:08:53PM +0200, Arnd Bergmann wrote: On Friday 01 May 2015 12:06:44 Catalin Marinas wrote: If we just disallow DMA to devices that are marked with _CCA=0 in ACPI, we can avoid this case, or discuss it by the time someone has hardware that wants it, and then

Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency

2015-05-08 Thread Arnd Bergmann
On Friday 01 May 2015 12:06:44 Catalin Marinas wrote: > > > Note that there are lots of ways in which you could have noncoherent DMA: > > the default on ARM32 is that it requires uncached access or explicit > > cache flushes, but it's also possible to have an SMP system where a device > > is only

Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency

2015-05-08 Thread Arnd Bergmann
On Thursday 30 April 2015 16:55:14 Catalin Marinas wrote: > On Thu, Apr 30, 2015 at 03:52:17PM +0200, Arnd Bergmann wrote: > > On Thursday 30 April 2015 14:13:45 Will Deacon wrote: > > > On Thu, Apr 30, 2015 at 02:03:00PM +0100, Arnd Bergmann wrote: > > > > On Thursday 30 April 2015 12:46:15 Will

Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency

2015-05-08 Thread Arnd Bergmann
On Friday 01 May 2015 12:06:44 Catalin Marinas wrote: Note that there are lots of ways in which you could have noncoherent DMA: the default on ARM32 is that it requires uncached access or explicit cache flushes, but it's also possible to have an SMP system where a device is only coherent

Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency

2015-05-08 Thread Arnd Bergmann
On Thursday 30 April 2015 16:55:14 Catalin Marinas wrote: On Thu, Apr 30, 2015 at 03:52:17PM +0200, Arnd Bergmann wrote: On Thursday 30 April 2015 14:13:45 Will Deacon wrote: On Thu, Apr 30, 2015 at 02:03:00PM +0100, Arnd Bergmann wrote: On Thursday 30 April 2015 12:46:15 Will Deacon

Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency

2015-05-01 Thread Catalin Marinas
On Wed, Apr 29, 2015 at 05:54:02PM +0200, Arnd Bergmann wrote: > On Wednesday 29 April 2015 14:57:10 Suthikulpanit, Suravee wrote: > > Otherwise, it would seem inconsistent with what states in the ACPI spec: > > > > CCA objects are only relevant for devices that can access > > CPU-visible

Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency

2015-05-01 Thread Catalin Marinas
On Wed, Apr 29, 2015 at 05:54:02PM +0200, Arnd Bergmann wrote: On Wednesday 29 April 2015 14:57:10 Suthikulpanit, Suravee wrote: Otherwise, it would seem inconsistent with what states in the ACPI spec: CCA objects are only relevant for devices that can access CPU-visible memory,

Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency

2015-04-30 Thread Suravee Suthikulanit
On 4/30/2015 3:23 AM, Arnd Bergmann wrote: On Wednesday 29 April 2015 16:53:10 Suravee Suthikulpanit wrote: On 4/29/15 11:25, Arnd Bergmann wrote: On Wednesday 29 April 2015 08:44:09 Suravee Suthikulpanit wrote: [...] As for the case where _CCA=0, I think the ACPI driver should essentially

Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency

2015-04-30 Thread Catalin Marinas
On Thu, Apr 30, 2015 at 03:52:17PM +0200, Arnd Bergmann wrote: > On Thursday 30 April 2015 14:13:45 Will Deacon wrote: > > On Thu, Apr 30, 2015 at 02:03:00PM +0100, Arnd Bergmann wrote: > > > On Thursday 30 April 2015 12:46:15 Will Deacon wrote: > > > > Cache sync doesn't exist in the

Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency

2015-04-30 Thread Arnd Bergmann
On Thursday 30 April 2015 14:13:45 Will Deacon wrote: > On Thu, Apr 30, 2015 at 02:03:00PM +0100, Arnd Bergmann wrote: > > On Thursday 30 April 2015 12:46:15 Will Deacon wrote: > > > On Thu, Apr 30, 2015 at 12:24:12PM +0100, Arnd Bergmann wrote: > > > > In particular, there are two common models

Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency

2015-04-30 Thread Will Deacon
On Thu, Apr 30, 2015 at 02:03:00PM +0100, Arnd Bergmann wrote: > On Thursday 30 April 2015 12:46:15 Will Deacon wrote: > > On Thu, Apr 30, 2015 at 12:24:12PM +0100, Arnd Bergmann wrote: > > > In particular, there are two common models that we support in Linux: > > > > > > a) embedded ARM32 and

Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency

2015-04-30 Thread Arnd Bergmann
On Thursday 30 April 2015 12:46:15 Will Deacon wrote: > On Thu, Apr 30, 2015 at 12:24:12PM +0100, Arnd Bergmann wrote: > > On Thursday 30 April 2015 12:07:18 Will Deacon wrote: > > > So for the CPU caches we'd do the usual clean to push dirty lines to the > > > device > > > and (clean+)invalidate

Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency

2015-04-30 Thread Will Deacon
On Thu, Apr 30, 2015 at 12:24:12PM +0100, Arnd Bergmann wrote: > On Thursday 30 April 2015 12:07:18 Will Deacon wrote: > > So for the CPU caches we'd do the usual clean to push dirty lines to the > > device > > and (clean+)invalidate before reading data from the device. For the "other > > caches

Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency

2015-04-30 Thread Arnd Bergmann
On Thursday 30 April 2015 12:07:18 Will Deacon wrote: > On Thu, Apr 30, 2015 at 11:47:46AM +0100, Arnd Bergmann wrote: > > On Thursday 30 April 2015 11:41:02 Will Deacon wrote: > > >- 0x0: The device is not coherent. Therefore: > > > * Cache maintenance is required for memory shared with

Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency

2015-04-30 Thread Will Deacon
On Thu, Apr 30, 2015 at 11:47:46AM +0100, Arnd Bergmann wrote: > On Thursday 30 April 2015 11:41:02 Will Deacon wrote: > >- 0x0: The device is not coherent. Therefore: > > * Cache maintenance is required for memory shared with the > >device that is mapped on CPUs as IWB-OWB-ISH. >

Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency

2015-04-30 Thread Arnd Bergmann
On Thursday 30 April 2015 11:41:02 Will Deacon wrote: > Hi Arnd, > > On Thu, Apr 30, 2015 at 09:23:59AM +0100, Arnd Bergmann wrote: > > On Wednesday 29 April 2015 16:53:10 Suravee Suthikulpanit wrote: > > > As for the case where _CCA=0, I think the ACPI driver should essentially > > >

Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency

2015-04-30 Thread Will Deacon
Hi Arnd, On Thu, Apr 30, 2015 at 09:23:59AM +0100, Arnd Bergmann wrote: > On Wednesday 29 April 2015 16:53:10 Suravee Suthikulpanit wrote: > > As for the case where _CCA=0, I think the ACPI driver should essentially > > communicate the information as HW is non-coherent as described in the > >

Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency

2015-04-30 Thread Arnd Bergmann
On Wednesday 29 April 2015 16:53:10 Suravee Suthikulpanit wrote: > On 4/29/15 11:25, Arnd Bergmann wrote: > > On Wednesday 29 April 2015 08:44:09 Suravee Suthikulpanit wrote: > >> diff --git a/drivers/acpi/acpi_platform.c b/drivers/acpi/acpi_platform.c > >> index 4bf7559..a4db208 100644 > >> ---

Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency

2015-04-30 Thread Arnd Bergmann
On Wednesday 29 April 2015 16:53:10 Suravee Suthikulpanit wrote: On 4/29/15 11:25, Arnd Bergmann wrote: On Wednesday 29 April 2015 08:44:09 Suravee Suthikulpanit wrote: diff --git a/drivers/acpi/acpi_platform.c b/drivers/acpi/acpi_platform.c index 4bf7559..a4db208 100644 ---

Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency

2015-04-30 Thread Will Deacon
Hi Arnd, On Thu, Apr 30, 2015 at 09:23:59AM +0100, Arnd Bergmann wrote: On Wednesday 29 April 2015 16:53:10 Suravee Suthikulpanit wrote: As for the case where _CCA=0, I think the ACPI driver should essentially communicate the information as HW is non-coherent as described in the spec,

Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency

2015-04-30 Thread Will Deacon
On Thu, Apr 30, 2015 at 11:47:46AM +0100, Arnd Bergmann wrote: On Thursday 30 April 2015 11:41:02 Will Deacon wrote: - 0x0: The device is not coherent. Therefore: * Cache maintenance is required for memory shared with the device that is mapped on CPUs as IWB-OWB-ISH. This

Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency

2015-04-30 Thread Arnd Bergmann
On Thursday 30 April 2015 12:07:18 Will Deacon wrote: On Thu, Apr 30, 2015 at 11:47:46AM +0100, Arnd Bergmann wrote: On Thursday 30 April 2015 11:41:02 Will Deacon wrote: - 0x0: The device is not coherent. Therefore: * Cache maintenance is required for memory shared with the

Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency

2015-04-30 Thread Arnd Bergmann
On Thursday 30 April 2015 11:41:02 Will Deacon wrote: Hi Arnd, On Thu, Apr 30, 2015 at 09:23:59AM +0100, Arnd Bergmann wrote: On Wednesday 29 April 2015 16:53:10 Suravee Suthikulpanit wrote: As for the case where _CCA=0, I think the ACPI driver should essentially communicate the

Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency

2015-04-30 Thread Will Deacon
On Thu, Apr 30, 2015 at 02:03:00PM +0100, Arnd Bergmann wrote: On Thursday 30 April 2015 12:46:15 Will Deacon wrote: On Thu, Apr 30, 2015 at 12:24:12PM +0100, Arnd Bergmann wrote: In particular, there are two common models that we support in Linux: a) embedded ARM32 and others

Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency

2015-04-30 Thread Arnd Bergmann
On Thursday 30 April 2015 12:46:15 Will Deacon wrote: On Thu, Apr 30, 2015 at 12:24:12PM +0100, Arnd Bergmann wrote: On Thursday 30 April 2015 12:07:18 Will Deacon wrote: So for the CPU caches we'd do the usual clean to push dirty lines to the device and (clean+)invalidate before

Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency

2015-04-30 Thread Will Deacon
On Thu, Apr 30, 2015 at 12:24:12PM +0100, Arnd Bergmann wrote: On Thursday 30 April 2015 12:07:18 Will Deacon wrote: So for the CPU caches we'd do the usual clean to push dirty lines to the device and (clean+)invalidate before reading data from the device. For the other caches in the

Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency

2015-04-30 Thread Arnd Bergmann
On Thursday 30 April 2015 14:13:45 Will Deacon wrote: On Thu, Apr 30, 2015 at 02:03:00PM +0100, Arnd Bergmann wrote: On Thursday 30 April 2015 12:46:15 Will Deacon wrote: On Thu, Apr 30, 2015 at 12:24:12PM +0100, Arnd Bergmann wrote: In particular, there are two common models that we

Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency

2015-04-30 Thread Suravee Suthikulanit
On 4/30/2015 3:23 AM, Arnd Bergmann wrote: On Wednesday 29 April 2015 16:53:10 Suravee Suthikulpanit wrote: On 4/29/15 11:25, Arnd Bergmann wrote: On Wednesday 29 April 2015 08:44:09 Suravee Suthikulpanit wrote: [...] As for the case where _CCA=0, I think the ACPI driver should essentially

Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency

2015-04-30 Thread Catalin Marinas
On Thu, Apr 30, 2015 at 03:52:17PM +0200, Arnd Bergmann wrote: On Thursday 30 April 2015 14:13:45 Will Deacon wrote: On Thu, Apr 30, 2015 at 02:03:00PM +0100, Arnd Bergmann wrote: On Thursday 30 April 2015 12:46:15 Will Deacon wrote: Cache sync doesn't exist in the ARM/arm64architecture,

Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency

2015-04-29 Thread Arnd Bergmann
On Wednesday 29 April 2015 09:39:25 Al Stone wrote: > > When the spec was being changed for _CCA, it was determined by the ASWG > that there was no reasonable default -- either choice would break something. > Multiple OSs, SoC vendors, and platform vendors were asked. So, the spec > says for

Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency

2015-04-29 Thread Arnd Bergmann
On Wednesday 29 April 2015 14:57:10 Suthikulpanit, Suravee wrote: > Otherwise, it would seem inconsistent with what states in the ACPI spec: > > CCA objects are only relevant for devices that can access CPU-visible > memory, > such as devices that are DMA capable. On ARM based systems, the

Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency

2015-04-29 Thread Al Stone
On 04/29/2015 08:57 AM, Suthikulpanit, Suravee wrote: > > > On 4/29/15, 09:47, "Arnd Bergmann" wrote: > >> On Wednesday 29 April 2015 09:45:43 Suravee Suthikulpanit wrote: >>> On 04/29/2015 09:03 AM, Arnd Bergmann wrote: On Wednesday 29 April 2015 08:44:09 Suravee Suthikulpanit wrote:

Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency

2015-04-29 Thread Suthikulpanit, Suravee
On 4/29/15, 09:47, "Arnd Bergmann" wrote: >On Wednesday 29 April 2015 09:45:43 Suravee Suthikulpanit wrote: >> On 04/29/2015 09:03 AM, Arnd Bergmann wrote: >> > On Wednesday 29 April 2015 08:44:09 Suravee Suthikulpanit wrote: >> >> + device->flags.cca_seen = 1; >> >> +

Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency

2015-04-29 Thread Arnd Bergmann
On Wednesday 29 April 2015 09:45:43 Suravee Suthikulpanit wrote: > On 04/29/2015 09:03 AM, Arnd Bergmann wrote: > > On Wednesday 29 April 2015 08:44:09 Suravee Suthikulpanit wrote: > >> + device->flags.cca_seen = 1; > >> + } else if

Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency

2015-04-29 Thread Arnd Bergmann
On Wednesday 29 April 2015 09:39:25 Al Stone wrote: When the spec was being changed for _CCA, it was determined by the ASWG that there was no reasonable default -- either choice would break something. Multiple OSs, SoC vendors, and platform vendors were asked. So, the spec says for ARMv8,

Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency

2015-04-29 Thread Al Stone
On 04/29/2015 08:57 AM, Suthikulpanit, Suravee wrote: On 4/29/15, 09:47, Arnd Bergmann a...@arndb.de wrote: On Wednesday 29 April 2015 09:45:43 Suravee Suthikulpanit wrote: On 04/29/2015 09:03 AM, Arnd Bergmann wrote: On Wednesday 29 April 2015 08:44:09 Suravee Suthikulpanit wrote: +

Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency

2015-04-29 Thread Arnd Bergmann
On Wednesday 29 April 2015 14:57:10 Suthikulpanit, Suravee wrote: Otherwise, it would seem inconsistent with what states in the ACPI spec: CCA objects are only relevant for devices that can access CPU-visible memory, such as devices that are DMA capable. On ARM based systems, the _CCA

Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency

2015-04-29 Thread Arnd Bergmann
On Wednesday 29 April 2015 09:45:43 Suravee Suthikulpanit wrote: On 04/29/2015 09:03 AM, Arnd Bergmann wrote: On Wednesday 29 April 2015 08:44:09 Suravee Suthikulpanit wrote: + device-flags.cca_seen = 1; + } else if (IS_ENABLED(CONFIG_ACPI_MUST_HAVE_CCA))

Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency

2015-04-29 Thread Suthikulpanit, Suravee
On 4/29/15, 09:47, Arnd Bergmann a...@arndb.de wrote: On Wednesday 29 April 2015 09:45:43 Suravee Suthikulpanit wrote: On 04/29/2015 09:03 AM, Arnd Bergmann wrote: On Wednesday 29 April 2015 08:44:09 Suravee Suthikulpanit wrote: + device-flags.cca_seen = 1; +