linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Salter <msalter@redhat.com>
To: Suravee Suthikulanit <suravee.suthikulpanit@amd.com>
Cc: kashyap.desai@avagotech.com, sumit.saxena@avagotech.com,
	uday.lingala@avagotech.com, rjw@rjwysocki.net, lenb@kernel.org,
	catalin.marinas@arm.com, will.deacon@arm.com,
	thomas.lendacky@amd.com, herbert@gondor.apana.org.au,
	davem@davemloft.net, arnd@arndb.de, hanjun.guo@linaro.org,
	al.stone@linaro.org, grant.likely@linaro.org, leo.duran@amd.com,
	linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org,
	linux-kernel@vger.kernel.org, linaro-acpi@lists.linaro.org,
	netdev@vger.kernel.org, linux-crypto@vger.kernel.org,
	megaraidlinux.pdl@avagotech.com, linux-scsi@vger.kernel.org
Subject: Re: [V5 PATCH 2/5] arm64 : Introduce support for ACPI _CCA object
Date: Wed, 03 Jun 2015 11:03:09 -0400	[thread overview]
Message-ID: <1433343789.24429.9.camel@deneb.redhat.com> (raw)
In-Reply-To: <556F1115.3080302@amd.com>

On Wed, 2015-06-03 at 09:37 -0500, Suravee Suthikulanit wrote:
> On 5/28/2015 9:38 PM, Mark Salter wrote:
> > On Wed, 2015-05-20 at 17:09 -0500, Suravee Suthikulpanit wrote:
> >> >Fromhttp://www.uefi.org/sites/default/files/resources/ACPI_6.0.pdf,
> >> >section 6.2.17 _CCA states that ARM platforms require ACPI _CCA
> >> >object to be specified for DMA-cabpable devices. Therefore, this patch
> >> >specifies ACPI_CCA_REQUIRED in arm64 Kconfig.
> >> >
> >> >In addition, to handle the case when _CCA is missing, arm64 would assign
> >> >dummy_dma_ops to disable DMA capability of the device.
> >> >
> >> >Acked-by: Catalin Marinas<catalin.marinas@arm.com>
> >> >Signed-off-by: Mark Salter<msalter@redhat.com>
> >> >Signed-off-by: Suravee Suthikulpanit<Suravee.Suthikulpanit@amd.com>
> >> >---
> >> >  arch/arm64/Kconfig                   |  1 +
> >> >  arch/arm64/include/asm/dma-mapping.h | 18 ++++++-
> >> >  arch/arm64/mm/dma-mapping.c          | 92 ++++++++++++++++++++++++++++++++++++
> >> >  3 files changed, 109 insertions(+), 2 deletions(-)
> >> >
> >> >diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> >> >index 4269dba..95307b4 100644
> >> >--- a/arch/arm64/Kconfig
> >> >+++ b/arch/arm64/Kconfig
> >> >@@ -1,5 +1,6 @@
> >> >  config ARM64
> >> >  	def_bool y
> >> >+	select ACPI_CCA_REQUIRED if ACPI
> >> >  	select ACPI_GENERIC_GSI if ACPI
> >> >  	select ACPI_REDUCED_HARDWARE_ONLY if ACPI
> >> >  	select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
> >> >diff --git a/arch/arm64/include/asm/dma-mapping.h b/arch/arm64/include/asm/dma-mapping.h
> >> >index 9437e3d..f0d6d0b 100644
> >> >--- a/arch/arm64/include/asm/dma-mapping.h
> >> >+++ b/arch/arm64/include/asm/dma-mapping.h
> >> >@@ -18,6 +18,7 @@
> >> >
> >> >  #ifdef __KERNEL__
> >> >
> >> >+#include <linux/acpi.h>
> >> >  #include <linux/types.h>
> >> >  #include <linux/vmalloc.h>
> >> >
> > ^^^ This hunk causes build issues with a couple of drivers:
> >
> > drivers/scsi/megaraid/megaraid_sas_fp.c:69:0: warning: "FALSE" redefined [enabled by default]
> >   #define FALSE 0
> >   ^
> > In file included from include/acpi/acpi.h:58:0,
> >                   from include/linux/acpi.h:37,
> >                   from ./arch/arm64/include/asm/dma-mapping.h:21,
> >                   from include/linux/dma-mapping.h:86,
> >                   from ./arch/arm64/include/asm/pci.h:7,
> >                   from include/linux/pci.h:1460,
> >                   from drivers/scsi/megaraid/megaraid_sas_fp.c:37:
> > include/acpi/actypes.h:433:0: note: this is the location of the previous definition
> >   #define FALSE                           (1 == 0)
> >   ^
> >
> >
> > In file included from include/acpi/acpi.h:58:0,
> >                   from include/linux/acpi.h:37,
> >                   from ./arch/arm64/include/asm/dma-mapping.h:21,
> >                   from include/linux/dma-mapping.h:86,
> >                   from include/scsi/scsi_cmnd.h:4,
> >                   from drivers/scsi/ufs/ufshcd.h:60,
> >                   from drivers/scsi/ufs/ufshcd.c:43:
> > include/acpi/actypes.h:433:41: error: expected identifier before ‘(’ token
> >   #define FALSE                           (1 == 0)
> >                                           ^
> > drivers/scsi/ufs/unipro.h:203:2: note: in expansion of macro ‘FALSE’
> >    FALSE = 0,
> >    ^
> >
> > This happens because the ACPI definitions of TRUE and FALSE conflict
> > with local definitions in megaraid and enum declaration in ufs.
> >
> Mark,
> 
> Thanks for pointing this out. Although, I would think that the 
> megaraid_sas_fp.c should have had the #ifndef to check before defining 
> the TRUE and FALSE as following.
> 
> #ifndef TRUE
> #define TRUE 1
> #endif
> #ifndef FALSE
> #define FALSE 0
> #endif
> 
> This seems to be what other drivers are also doing. If this is okay, I 
> can send out a fix-up patch for the megaraid driver.
> 

Yeah, or #undef them if defined so megaraid defines them as desired.
And #undef if defined would work for unipro.h as well.

  reply	other threads:[~2015-06-03 15:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-20 22:09 [V5 PATCH 0/5] ACPI: Introduce support for _CCA object Suravee Suthikulpanit
2015-05-20 22:09 ` [V5 PATCH 1/5] ACPI / scan: Parse _CCA and setup device coherency Suravee Suthikulpanit
2015-05-22 21:56   ` Rafael J. Wysocki
2015-05-22 22:24     ` Suravee Suthikulanit
2015-05-22 23:05       ` Rafael J. Wysocki
2015-05-23  0:15         ` Suravee Suthikulanit
2015-05-23  1:25           ` Rafael J. Wysocki
2015-05-23  1:38             ` Suravee Suthikulanit
2015-05-20 22:09 ` [V5 PATCH 2/5] arm64 : Introduce support for ACPI _CCA object Suravee Suthikulpanit
2015-05-29  2:38   ` Mark Salter
2015-06-03 14:37     ` Suravee Suthikulanit
2015-06-03 15:03       ` Mark Salter [this message]
2015-05-20 22:09 ` [V5 PATCH 3/5] device property: Introduces device_dma_is_coherent() Suravee Suthikulpanit
2015-05-20 22:09 ` [V5 PATCH 4/5] crypto: ccp - Unify coherency checking logic with device_dma_is_coherent() Suravee Suthikulpanit
2015-05-20 22:09 ` [V5 PATCH 5/5] amd-xgbe: " Suravee Suthikulpanit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1433343789.24429.9.camel@deneb.redhat.com \
    --to=msalter@redhat.com \
    --cc=al.stone@linaro.org \
    --cc=arnd@arndb.de \
    --cc=catalin.marinas@arm.com \
    --cc=davem@davemloft.net \
    --cc=grant.likely@linaro.org \
    --cc=hanjun.guo@linaro.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=kashyap.desai@avagotech.com \
    --cc=lenb@kernel.org \
    --cc=leo.duran@amd.com \
    --cc=linaro-acpi@lists.linaro.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=megaraidlinux.pdl@avagotech.com \
    --cc=netdev@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=sumit.saxena@avagotech.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=thomas.lendacky@amd.com \
    --cc=uday.lingala@avagotech.com \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).