* [PATCH v2] nfc: don't be making arch specific unaligned decisions at driver level.
@ 2017-01-09 17:52 ` Paul Gortmaker
0 siblings, 0 replies; 19+ messages in thread
From: Paul Gortmaker @ 2017-01-09 17:52 UTC (permalink / raw)
To: linux-kernel
Cc: kbuild test robot, Paul Gortmaker, Lauro Ramos Venancio,
Aloisio Almeida Jr, Samuel Ortiz, Tony Luck, Fenghua Yu,
linux-ia64, linux-wireless
Currently ia64 fails building allmodconfig with variations of:
In file included from drivers/nfc/nxp-nci/i2c.c:39:0:
./include/linux/unaligned/access_ok.h:62:29: error: redefinition of ‘put_unaligned_be64’
static __always_inline void put_unaligned_be64(u64 val, void *p)
^~~~~~~~~~~~~~~~~~
In file included from ./arch/ia64/include/asm/unaligned.h:5:0,
from ./arch/ia64/include/asm/io.h:22,
from ./arch/ia64/include/asm/smp.h:20,
from ./include/linux/smp.h:59,
from ./include/linux/topology.h:33,
from ./include/linux/gfp.h:8,
from ./include/linux/slab.h:14,
from ./include/linux/resource_ext.h:19,
from ./include/linux/acpi.h:26,
from drivers/nfc/nxp-nci/i2c.c:28:
./include/linux/unaligned/be_byteshift.h:65:20: note: previous definition of ‘put_unaligned_be64’ was here
static inline void put_unaligned_be64(u64 val, void *p)
^~~~~~~~~~~~~~~~~~
scripts/Makefile.build:293: recipe for target 'drivers/nfc/nxp-nci/i2c.o' failed
The easiest explanation for this is to look at the non-arch users in
the following output:
linux$git grep include.*access_ok.h
arch/arm64/crypto/crc32-arm64.c:#include <linux/unaligned/access_ok.h>
arch/cris/include/asm/unaligned.h:#include <linux/unaligned/access_ok.h>
arch/m68k/include/asm/unaligned.h:#include <linux/unaligned/access_ok.h>
arch/mn10300/include/asm/unaligned.h:#include <linux/unaligned/access_ok.h>
arch/powerpc/include/asm/unaligned.h:#include <linux/unaligned/access_ok.h>
arch/s390/include/asm/unaligned.h:#include <linux/unaligned/access_ok.h>
arch/x86/include/asm/unaligned.h:#include <linux/unaligned/access_ok.h>
drivers/nfc/nfcmrvl/fw_dnld.c:#include <linux/unaligned/access_ok.h>
drivers/nfc/nxp-nci/firmware.c:#include <linux/unaligned/access_ok.h>
drivers/nfc/nxp-nci/i2c.c:#include <linux/unaligned/access_ok.h>
include/asm-generic/unaligned.h:# include <linux/unaligned/access_ok.h>
Note that nfc is essentially the only non-arch user in the above.
When it forces use of access_ok.h, it will break any arch that has
already selected be_byteshift.h (or other conflicting implementations)
at the arch level.
The decision of what variant for unaligned access to use needs to be
left to the arch level and not used at the driver level. Since not
all arch will have sourced asm/unaligned.h already, we need to call
it out and then the arch can give us just the one definition that
is needed.
See commit 064106a91be5 ("kernel: add common infrastructure for
unaligned access") as a reference.
Cc: Lauro Ramos Venancio <lauro.venancio@openbossa.org>
Cc: Aloisio Almeida Jr <aloisio.almeida@openbossa.org>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: linux-ia64@vger.kernel.org
Cc: linux-wireless@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
[v2: explicitly include asm/uaccess.h since some arch won't be
getting any variant of an unaligned access header without it.
Build test allmodconfig on x86-64, i386, arm64, ia64. ]
drivers/nfc/nfcmrvl/fw_dnld.c | 2 +-
drivers/nfc/nxp-nci/firmware.c | 2 +-
drivers/nfc/nxp-nci/i2c.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/nfc/nfcmrvl/fw_dnld.c b/drivers/nfc/nfcmrvl/fw_dnld.c
index f8dcdf4b24f6..f3f246ddae06 100644
--- a/drivers/nfc/nfcmrvl/fw_dnld.c
+++ b/drivers/nfc/nfcmrvl/fw_dnld.c
@@ -17,11 +17,11 @@
*/
#include <linux/module.h>
-#include <linux/unaligned/access_ok.h>
#include <linux/firmware.h>
#include <linux/nfc.h>
#include <net/nfc/nci.h>
#include <net/nfc/nci_core.h>
+#include <asm/unaligned.h>
#include "nfcmrvl.h"
#define FW_DNLD_TIMEOUT 15000
diff --git a/drivers/nfc/nxp-nci/firmware.c b/drivers/nfc/nxp-nci/firmware.c
index 5291797324ba..553011f58339 100644
--- a/drivers/nfc/nxp-nci/firmware.c
+++ b/drivers/nfc/nxp-nci/firmware.c
@@ -24,7 +24,7 @@
#include <linux/completion.h>
#include <linux/firmware.h>
#include <linux/nfc.h>
-#include <linux/unaligned/access_ok.h>
+#include <asm/unaligned.h>
#include "nxp-nci.h"
diff --git a/drivers/nfc/nxp-nci/i2c.c b/drivers/nfc/nxp-nci/i2c.c
index 36099e557730..20243dafea21 100644
--- a/drivers/nfc/nxp-nci/i2c.c
+++ b/drivers/nfc/nxp-nci/i2c.c
@@ -36,9 +36,9 @@
#include <linux/of_gpio.h>
#include <linux/of_irq.h>
#include <linux/platform_data/nxp-nci.h>
-#include <linux/unaligned/access_ok.h>
#include <net/nfc/nfc.h>
+#include <asm/unaligned.h>
#include "nxp-nci.h"
--
2.11.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PATCH v2] nfc: don't be making arch specific unaligned decisions at driver level.
2017-01-09 17:52 ` Paul Gortmaker
(?)
@ 2017-03-28 22:55 ` Paul Gortmaker
-1 siblings, 0 replies; 19+ messages in thread
From: Paul Gortmaker @ 2017-03-28 22:55 UTC (permalink / raw)
To: LKML, Samuel Ortiz
Cc: kbuild test robot, Paul Gortmaker, Lauro Ramos Venancio,
Aloisio Almeida Jr, Tony Luck, Fenghua Yu, linux-ia64,
linux-wireless
On Mon, Jan 9, 2017 at 12:52 PM, Paul Gortmaker
<paul.gortmaker@windriver.com> wrote:
> Currently ia64 fails building allmodconfig with variations of:
>
> In file included from drivers/nfc/nxp-nci/i2c.c:39:0:
> ./include/linux/unaligned/access_ok.h:62:29: error: redefinition of =
=E2=80=98put_unaligned_be64=E2=80=99
> static __always_inline void put_unaligned_be64(u64 val, void *p)
Hi Samuel,
Do you require changes on this commit, or are you happy to queue it as is?
Looking at the NFC git history it seems like you are the right person to as=
k.
Thanks,
Paul.
--
> In file included from ./arch/ia64/include/asm/unaligned.h:5:0,
> from ./arch/ia64/include/asm/io.h:22,
> from ./arch/ia64/include/asm/smp.h:20,
> from ./include/linux/smp.h:59,
> from ./include/linux/topology.h:33,
> from ./include/linux/gfp.h:8,
> from ./include/linux/slab.h:14,
> from ./include/linux/resource_ext.h:19,
> from ./include/linux/acpi.h:26,
> from drivers/nfc/nxp-nci/i2c.c:28:
> ./include/linux/unaligned/be_byteshift.h:65:20: note: previous definit=
ion of =E2=80=98put_unaligned_be64=E2=80=99 was here
> static inline void put_unaligned_be64(u64 val, void *p)
> ^~~~~~~~~~~~~~~~~~
> scripts/Makefile.build:293: recipe for target 'drivers/nfc/nxp-nci/i2c=
.o' failed
>
> The easiest explanation for this is to look at the non-arch users in
> the following output:
>
> linux$git grep include.*access_ok.h
> arch/arm64/crypto/crc32-arm64.c:#include <linux/unaligned/access_ok.h>
> arch/cris/include/asm/unaligned.h:#include <linux/unaligned/access_ok.=
h>
> arch/m68k/include/asm/unaligned.h:#include <linux/unaligned/access_ok.=
h>
> arch/mn10300/include/asm/unaligned.h:#include <linux/unaligned/access_=
ok.h>
> arch/powerpc/include/asm/unaligned.h:#include <linux/unaligned/access_=
ok.h>
> arch/s390/include/asm/unaligned.h:#include <linux/unaligned/access_ok.=
h>
> arch/x86/include/asm/unaligned.h:#include <linux/unaligned/access_ok.h=
>
> drivers/nfc/nfcmrvl/fw_dnld.c:#include <linux/unaligned/access_ok.h>
> drivers/nfc/nxp-nci/firmware.c:#include <linux/unaligned/access_ok.h>
> drivers/nfc/nxp-nci/i2c.c:#include <linux/unaligned/access_ok.h>
> include/asm-generic/unaligned.h:# include <linux/unaligned/access_ok.h=
>
>
> Note that nfc is essentially the only non-arch user in the above.
> When it forces use of access_ok.h, it will break any arch that has
> already selected be_byteshift.h (or other conflicting implementations)
> at the arch level.
>
> The decision of what variant for unaligned access to use needs to be
> left to the arch level and not used at the driver level. Since not
> all arch will have sourced asm/unaligned.h already, we need to call
> it out and then the arch can give us just the one definition that
> is needed.
>
> See commit 064106a91be5 ("kernel: add common infrastructure for
> unaligned access") as a reference.
>
> Cc: Lauro Ramos Venancio <lauro.venancio@openbossa.org>
> Cc: Aloisio Almeida Jr <aloisio.almeida@openbossa.org>
> Cc: Samuel Ortiz <sameo@linux.intel.com>
> Cc: Tony Luck <tony.luck@intel.com>
> Cc: Fenghua Yu <fenghua.yu@intel.com>
> Cc: linux-ia64@vger.kernel.org
> Cc: linux-wireless@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>
> [v2: explicitly include asm/uaccess.h since some arch won't be
> getting any variant of an unaligned access header without it.
> Build test allmodconfig on x86-64, i386, arm64, ia64. ]
>
> drivers/nfc/nfcmrvl/fw_dnld.c | 2 +-
> drivers/nfc/nxp-nci/firmware.c | 2 +-
> drivers/nfc/nxp-nci/i2c.c | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/nfc/nfcmrvl/fw_dnld.c b/drivers/nfc/nfcmrvl/fw_dnld.=
c
> index f8dcdf4b24f6..f3f246ddae06 100644
> --- a/drivers/nfc/nfcmrvl/fw_dnld.c
> +++ b/drivers/nfc/nfcmrvl/fw_dnld.c
> @@ -17,11 +17,11 @@
> */
>
> #include <linux/module.h>
> -#include <linux/unaligned/access_ok.h>
> #include <linux/firmware.h>
> #include <linux/nfc.h>
> #include <net/nfc/nci.h>
> #include <net/nfc/nci_core.h>
> +#include <asm/unaligned.h>
> #include "nfcmrvl.h"
>
> #define FW_DNLD_TIMEOUT 15000
> diff --git a/drivers/nfc/nxp-nci/firmware.c b/drivers/nfc/nxp-nci/firmwar=
e.c
> index 5291797324ba..553011f58339 100644
> --- a/drivers/nfc/nxp-nci/firmware.c
> +++ b/drivers/nfc/nxp-nci/firmware.c
> @@ -24,7 +24,7 @@
> #include <linux/completion.h>
> #include <linux/firmware.h>
> #include <linux/nfc.h>
> -#include <linux/unaligned/access_ok.h>
> +#include <asm/unaligned.h>
>
> #include "nxp-nci.h"
>
> diff --git a/drivers/nfc/nxp-nci/i2c.c b/drivers/nfc/nxp-nci/i2c.c
> index 36099e557730..20243dafea21 100644
> --- a/drivers/nfc/nxp-nci/i2c.c
> +++ b/drivers/nfc/nxp-nci/i2c.c
> @@ -36,9 +36,9 @@
> #include <linux/of_gpio.h>
> #include <linux/of_irq.h>
> #include <linux/platform_data/nxp-nci.h>
> -#include <linux/unaligned/access_ok.h>
>
> #include <net/nfc/nfc.h>
> +#include <asm/unaligned.h>
>
> #include "nxp-nci.h"
>
> --
> 2.11.0
>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2] nfc: don't be making arch specific unaligned decisions at driver level.
@ 2017-03-28 22:55 ` Paul Gortmaker
0 siblings, 0 replies; 19+ messages in thread
From: Paul Gortmaker @ 2017-03-28 22:55 UTC (permalink / raw)
To: LKML, Samuel Ortiz
Cc: kbuild test robot, Paul Gortmaker, Lauro Ramos Venancio,
Aloisio Almeida Jr, Tony Luck, Fenghua Yu, linux-ia64,
linux-wireless
On Mon, Jan 9, 2017 at 12:52 PM, Paul Gortmaker
<paul.gortmaker@windriver.com> wrote:
> Currently ia64 fails building allmodconfig with variations of:
>
> In file included from drivers/nfc/nxp-nci/i2c.c:39:0:
> ./include/linux/unaligned/access_ok.h:62:29: error: redefinition of ‘put_unaligned_be64’
> static __always_inline void put_unaligned_be64(u64 val, void *p)
Hi Samuel,
Do you require changes on this commit, or are you happy to queue it as is?
Looking at the NFC git history it seems like you are the right person to ask.
Thanks,
Paul.
--
> In file included from ./arch/ia64/include/asm/unaligned.h:5:0,
> from ./arch/ia64/include/asm/io.h:22,
> from ./arch/ia64/include/asm/smp.h:20,
> from ./include/linux/smp.h:59,
> from ./include/linux/topology.h:33,
> from ./include/linux/gfp.h:8,
> from ./include/linux/slab.h:14,
> from ./include/linux/resource_ext.h:19,
> from ./include/linux/acpi.h:26,
> from drivers/nfc/nxp-nci/i2c.c:28:
> ./include/linux/unaligned/be_byteshift.h:65:20: note: previous definition of ‘put_unaligned_be64’ was here
> static inline void put_unaligned_be64(u64 val, void *p)
> ^~~~~~~~~~~~~~~~~~
> scripts/Makefile.build:293: recipe for target 'drivers/nfc/nxp-nci/i2c.o' failed
>
> The easiest explanation for this is to look at the non-arch users in
> the following output:
>
> linux$git grep include.*access_ok.h
> arch/arm64/crypto/crc32-arm64.c:#include <linux/unaligned/access_ok.h>
> arch/cris/include/asm/unaligned.h:#include <linux/unaligned/access_ok.h>
> arch/m68k/include/asm/unaligned.h:#include <linux/unaligned/access_ok.h>
> arch/mn10300/include/asm/unaligned.h:#include <linux/unaligned/access_ok.h>
> arch/powerpc/include/asm/unaligned.h:#include <linux/unaligned/access_ok.h>
> arch/s390/include/asm/unaligned.h:#include <linux/unaligned/access_ok.h>
> arch/x86/include/asm/unaligned.h:#include <linux/unaligned/access_ok.h>
> drivers/nfc/nfcmrvl/fw_dnld.c:#include <linux/unaligned/access_ok.h>
> drivers/nfc/nxp-nci/firmware.c:#include <linux/unaligned/access_ok.h>
> drivers/nfc/nxp-nci/i2c.c:#include <linux/unaligned/access_ok.h>
> include/asm-generic/unaligned.h:# include <linux/unaligned/access_ok.h>
>
> Note that nfc is essentially the only non-arch user in the above.
> When it forces use of access_ok.h, it will break any arch that has
> already selected be_byteshift.h (or other conflicting implementations)
> at the arch level.
>
> The decision of what variant for unaligned access to use needs to be
> left to the arch level and not used at the driver level. Since not
> all arch will have sourced asm/unaligned.h already, we need to call
> it out and then the arch can give us just the one definition that
> is needed.
>
> See commit 064106a91be5 ("kernel: add common infrastructure for
> unaligned access") as a reference.
>
> Cc: Lauro Ramos Venancio <lauro.venancio@openbossa.org>
> Cc: Aloisio Almeida Jr <aloisio.almeida@openbossa.org>
> Cc: Samuel Ortiz <sameo@linux.intel.com>
> Cc: Tony Luck <tony.luck@intel.com>
> Cc: Fenghua Yu <fenghua.yu@intel.com>
> Cc: linux-ia64@vger.kernel.org
> Cc: linux-wireless@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>
> [v2: explicitly include asm/uaccess.h since some arch won't be
> getting any variant of an unaligned access header without it.
> Build test allmodconfig on x86-64, i386, arm64, ia64. ]
>
> drivers/nfc/nfcmrvl/fw_dnld.c | 2 +-
> drivers/nfc/nxp-nci/firmware.c | 2 +-
> drivers/nfc/nxp-nci/i2c.c | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/nfc/nfcmrvl/fw_dnld.c b/drivers/nfc/nfcmrvl/fw_dnld.c
> index f8dcdf4b24f6..f3f246ddae06 100644
> --- a/drivers/nfc/nfcmrvl/fw_dnld.c
> +++ b/drivers/nfc/nfcmrvl/fw_dnld.c
> @@ -17,11 +17,11 @@
> */
>
> #include <linux/module.h>
> -#include <linux/unaligned/access_ok.h>
> #include <linux/firmware.h>
> #include <linux/nfc.h>
> #include <net/nfc/nci.h>
> #include <net/nfc/nci_core.h>
> +#include <asm/unaligned.h>
> #include "nfcmrvl.h"
>
> #define FW_DNLD_TIMEOUT 15000
> diff --git a/drivers/nfc/nxp-nci/firmware.c b/drivers/nfc/nxp-nci/firmware.c
> index 5291797324ba..553011f58339 100644
> --- a/drivers/nfc/nxp-nci/firmware.c
> +++ b/drivers/nfc/nxp-nci/firmware.c
> @@ -24,7 +24,7 @@
> #include <linux/completion.h>
> #include <linux/firmware.h>
> #include <linux/nfc.h>
> -#include <linux/unaligned/access_ok.h>
> +#include <asm/unaligned.h>
>
> #include "nxp-nci.h"
>
> diff --git a/drivers/nfc/nxp-nci/i2c.c b/drivers/nfc/nxp-nci/i2c.c
> index 36099e557730..20243dafea21 100644
> --- a/drivers/nfc/nxp-nci/i2c.c
> +++ b/drivers/nfc/nxp-nci/i2c.c
> @@ -36,9 +36,9 @@
> #include <linux/of_gpio.h>
> #include <linux/of_irq.h>
> #include <linux/platform_data/nxp-nci.h>
> -#include <linux/unaligned/access_ok.h>
>
> #include <net/nfc/nfc.h>
> +#include <asm/unaligned.h>
>
> #include "nxp-nci.h"
>
> --
> 2.11.0
>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2] nfc: don't be making arch specific unaligned decisions at driver level.
@ 2017-03-28 22:55 ` Paul Gortmaker
0 siblings, 0 replies; 19+ messages in thread
From: Paul Gortmaker @ 2017-03-28 22:55 UTC (permalink / raw)
To: LKML, Samuel Ortiz
Cc: kbuild test robot, Paul Gortmaker, Lauro Ramos Venancio,
Aloisio Almeida Jr, Tony Luck, Fenghua Yu, linux-ia64,
linux-wireless
On Mon, Jan 9, 2017 at 12:52 PM, Paul Gortmaker
<paul.gortmaker@windriver.com> wrote:
> Currently ia64 fails building allmodconfig with variations of:
>
> In file included from drivers/nfc/nxp-nci/i2c.c:39:0:
> ./include/linux/unaligned/access_ok.h:62:29: error: redefinition of ‘put_unaligned_be64’
> static __always_inline void put_unaligned_be64(u64 val, void *p)
Hi Samuel,
Do you require changes on this commit, or are you happy to queue it as is?
Looking at the NFC git history it seems like you are the right person to ask.
Thanks,
Paul.
--
> In file included from ./arch/ia64/include/asm/unaligned.h:5:0,
> from ./arch/ia64/include/asm/io.h:22,
> from ./arch/ia64/include/asm/smp.h:20,
> from ./include/linux/smp.h:59,
> from ./include/linux/topology.h:33,
> from ./include/linux/gfp.h:8,
> from ./include/linux/slab.h:14,
> from ./include/linux/resource_ext.h:19,
> from ./include/linux/acpi.h:26,
> from drivers/nfc/nxp-nci/i2c.c:28:
> ./include/linux/unaligned/be_byteshift.h:65:20: note: previous definition of ‘put_unaligned_be64’ was here
> static inline void put_unaligned_be64(u64 val, void *p)
> ^~~~~~~~~~~~~~~~~~
> scripts/Makefile.build:293: recipe for target 'drivers/nfc/nxp-nci/i2c.o' failed
>
> The easiest explanation for this is to look at the non-arch users in
> the following output:
>
> linux$git grep include.*access_ok.h
> arch/arm64/crypto/crc32-arm64.c:#include <linux/unaligned/access_ok.h>
> arch/cris/include/asm/unaligned.h:#include <linux/unaligned/access_ok.h>
> arch/m68k/include/asm/unaligned.h:#include <linux/unaligned/access_ok.h>
> arch/mn10300/include/asm/unaligned.h:#include <linux/unaligned/access_ok.h>
> arch/powerpc/include/asm/unaligned.h:#include <linux/unaligned/access_ok.h>
> arch/s390/include/asm/unaligned.h:#include <linux/unaligned/access_ok.h>
> arch/x86/include/asm/unaligned.h:#include <linux/unaligned/access_ok.h>
> drivers/nfc/nfcmrvl/fw_dnld.c:#include <linux/unaligned/access_ok.h>
> drivers/nfc/nxp-nci/firmware.c:#include <linux/unaligned/access_ok.h>
> drivers/nfc/nxp-nci/i2c.c:#include <linux/unaligned/access_ok.h>
> include/asm-generic/unaligned.h:# include <linux/unaligned/access_ok.h>
>
> Note that nfc is essentially the only non-arch user in the above.
> When it forces use of access_ok.h, it will break any arch that has
> already selected be_byteshift.h (or other conflicting implementations)
> at the arch level.
>
> The decision of what variant for unaligned access to use needs to be
> left to the arch level and not used at the driver level. Since not
> all arch will have sourced asm/unaligned.h already, we need to call
> it out and then the arch can give us just the one definition that
> is needed.
>
> See commit 064106a91be5 ("kernel: add common infrastructure for
> unaligned access") as a reference.
>
> Cc: Lauro Ramos Venancio <lauro.venancio@openbossa.org>
> Cc: Aloisio Almeida Jr <aloisio.almeida@openbossa.org>
> Cc: Samuel Ortiz <sameo@linux.intel.com>
> Cc: Tony Luck <tony.luck@intel.com>
> Cc: Fenghua Yu <fenghua.yu@intel.com>
> Cc: linux-ia64@vger.kernel.org
> Cc: linux-wireless@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>
> [v2: explicitly include asm/uaccess.h since some arch won't be
> getting any variant of an unaligned access header without it.
> Build test allmodconfig on x86-64, i386, arm64, ia64. ]
>
> drivers/nfc/nfcmrvl/fw_dnld.c | 2 +-
> drivers/nfc/nxp-nci/firmware.c | 2 +-
> drivers/nfc/nxp-nci/i2c.c | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/nfc/nfcmrvl/fw_dnld.c b/drivers/nfc/nfcmrvl/fw_dnld.c
> index f8dcdf4b24f6..f3f246ddae06 100644
> --- a/drivers/nfc/nfcmrvl/fw_dnld.c
> +++ b/drivers/nfc/nfcmrvl/fw_dnld.c
> @@ -17,11 +17,11 @@
> */
>
> #include <linux/module.h>
> -#include <linux/unaligned/access_ok.h>
> #include <linux/firmware.h>
> #include <linux/nfc.h>
> #include <net/nfc/nci.h>
> #include <net/nfc/nci_core.h>
> +#include <asm/unaligned.h>
> #include "nfcmrvl.h"
>
> #define FW_DNLD_TIMEOUT 15000
> diff --git a/drivers/nfc/nxp-nci/firmware.c b/drivers/nfc/nxp-nci/firmware.c
> index 5291797324ba..553011f58339 100644
> --- a/drivers/nfc/nxp-nci/firmware.c
> +++ b/drivers/nfc/nxp-nci/firmware.c
> @@ -24,7 +24,7 @@
> #include <linux/completion.h>
> #include <linux/firmware.h>
> #include <linux/nfc.h>
> -#include <linux/unaligned/access_ok.h>
> +#include <asm/unaligned.h>
>
> #include "nxp-nci.h"
>
> diff --git a/drivers/nfc/nxp-nci/i2c.c b/drivers/nfc/nxp-nci/i2c.c
> index 36099e557730..20243dafea21 100644
> --- a/drivers/nfc/nxp-nci/i2c.c
> +++ b/drivers/nfc/nxp-nci/i2c.c
> @@ -36,9 +36,9 @@
> #include <linux/of_gpio.h>
> #include <linux/of_irq.h>
> #include <linux/platform_data/nxp-nci.h>
> -#include <linux/unaligned/access_ok.h>
>
> #include <net/nfc/nfc.h>
> +#include <asm/unaligned.h>
>
> #include "nxp-nci.h"
>
> --
> 2.11.0
>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2] nfc: don't be making arch specific unaligned decisions at driver level.
2017-03-28 22:55 ` Paul Gortmaker
@ 2017-03-29 6:51 ` Samuel Ortiz
-1 siblings, 0 replies; 19+ messages in thread
From: Samuel Ortiz @ 2017-03-29 6:51 UTC (permalink / raw)
To: Paul Gortmaker
Cc: LKML, kbuild test robot, Tony Luck, Fenghua Yu, linux-ia64,
linux-wireless
Hi Paul,
On Tue, Mar 28, 2017 at 06:55:26PM -0400, Paul Gortmaker wrote:
> On Mon, Jan 9, 2017 at 12:52 PM, Paul Gortmaker
> <paul.gortmaker@windriver.com> wrote:
> > Currently ia64 fails building allmodconfig with variations of:
> >
> > In file included from drivers/nfc/nxp-nci/i2c.c:39:0:
> > ./include/linux/unaligned/access_ok.h:62:29: error: redefinition of ‘put_unaligned_be64’
> > static __always_inline void put_unaligned_be64(u64 val, void *p)
>
> Hi Samuel,
>
> Do you require changes on this commit, or are you happy to queue it as is?
> Looking at the NFC git history it seems like you are the right person to ask.
I will queue it later this week, sorry for the lag.
Cheers,
Samuel.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2] nfc: don't be making arch specific unaligned decisions at driver level.
@ 2017-03-29 6:51 ` Samuel Ortiz
0 siblings, 0 replies; 19+ messages in thread
From: Samuel Ortiz @ 2017-03-29 6:51 UTC (permalink / raw)
To: Paul Gortmaker
Cc: LKML, kbuild test robot, Tony Luck, Fenghua Yu, linux-ia64,
linux-wireless
Hi Paul,
On Tue, Mar 28, 2017 at 06:55:26PM -0400, Paul Gortmaker wrote:
> On Mon, Jan 9, 2017 at 12:52 PM, Paul Gortmaker
> <paul.gortmaker@windriver.com> wrote:
> > Currently ia64 fails building allmodconfig with variations of:
> >
> > In file included from drivers/nfc/nxp-nci/i2c.c:39:0:
> > ./include/linux/unaligned/access_ok.h:62:29: error: redefinition of ‘put_unaligned_be64’
> > static __always_inline void put_unaligned_be64(u64 val, void *p)
>
> Hi Samuel,
>
> Do you require changes on this commit, or are you happy to queue it as is?
> Looking at the NFC git history it seems like you are the right person to ask.
I will queue it later this week, sorry for the lag.
Cheers,
Samuel.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2] nfc: don't be making arch specific unaligned decisions at driver level.
2017-01-09 17:52 ` Paul Gortmaker
@ 2017-04-01 22:22 ` Samuel Ortiz
-1 siblings, 0 replies; 19+ messages in thread
From: Samuel Ortiz @ 2017-04-01 22:22 UTC (permalink / raw)
To: Paul Gortmaker
Cc: linux-kernel, kbuild test robot, Tony Luck, Fenghua Yu,
linux-ia64, linux-wireless
Hi Paul,
On Mon, Jan 09, 2017 at 12:52:22PM -0500, Paul Gortmaker wrote:
> Currently ia64 fails building allmodconfig with variations of:
>
> In file included from drivers/nfc/nxp-nci/i2c.c:39:0:
> ./include/linux/unaligned/access_ok.h:62:29: error: redefinition of ‘put_unaligned_be64’
> static __always_inline void put_unaligned_be64(u64 val, void *p)
> ^~~~~~~~~~~~~~~~~~
> In file included from ./arch/ia64/include/asm/unaligned.h:5:0,
> from ./arch/ia64/include/asm/io.h:22,
> from ./arch/ia64/include/asm/smp.h:20,
> from ./include/linux/smp.h:59,
> from ./include/linux/topology.h:33,
> from ./include/linux/gfp.h:8,
> from ./include/linux/slab.h:14,
> from ./include/linux/resource_ext.h:19,
> from ./include/linux/acpi.h:26,
> from drivers/nfc/nxp-nci/i2c.c:28:
> ./include/linux/unaligned/be_byteshift.h:65:20: note: previous definition of ‘put_unaligned_be64’ was here
> static inline void put_unaligned_be64(u64 val, void *p)
> ^~~~~~~~~~~~~~~~~~
> scripts/Makefile.build:293: recipe for target 'drivers/nfc/nxp-nci/i2c.o' failed
>
> The easiest explanation for this is to look at the non-arch users in
> the following output:
>
> linux$git grep include.*access_ok.h
> arch/arm64/crypto/crc32-arm64.c:#include <linux/unaligned/access_ok.h>
> arch/cris/include/asm/unaligned.h:#include <linux/unaligned/access_ok.h>
> arch/m68k/include/asm/unaligned.h:#include <linux/unaligned/access_ok.h>
> arch/mn10300/include/asm/unaligned.h:#include <linux/unaligned/access_ok.h>
> arch/powerpc/include/asm/unaligned.h:#include <linux/unaligned/access_ok.h>
> arch/s390/include/asm/unaligned.h:#include <linux/unaligned/access_ok.h>
> arch/x86/include/asm/unaligned.h:#include <linux/unaligned/access_ok.h>
> drivers/nfc/nfcmrvl/fw_dnld.c:#include <linux/unaligned/access_ok.h>
> drivers/nfc/nxp-nci/firmware.c:#include <linux/unaligned/access_ok.h>
> drivers/nfc/nxp-nci/i2c.c:#include <linux/unaligned/access_ok.h>
> include/asm-generic/unaligned.h:# include <linux/unaligned/access_ok.h>
>
> Note that nfc is essentially the only non-arch user in the above.
> When it forces use of access_ok.h, it will break any arch that has
> already selected be_byteshift.h (or other conflicting implementations)
> at the arch level.
>
> The decision of what variant for unaligned access to use needs to be
> left to the arch level and not used at the driver level. Since not
> all arch will have sourced asm/unaligned.h already, we need to call
> it out and then the arch can give us just the one definition that
> is needed.
>
> See commit 064106a91be5 ("kernel: add common infrastructure for
> unaligned access") as a reference.
>
> Cc: Lauro Ramos Venancio <lauro.venancio@openbossa.org>
> Cc: Aloisio Almeida Jr <aloisio.almeida@openbossa.org>
> Cc: Samuel Ortiz <sameo@linux.intel.com>
> Cc: Tony Luck <tony.luck@intel.com>
> Cc: Fenghua Yu <fenghua.yu@intel.com>
> Cc: linux-ia64@vger.kernel.org
> Cc: linux-wireless@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>
> [v2: explicitly include asm/uaccess.h since some arch won't be
> getting any variant of an unaligned access header without it.
> Build test allmodconfig on x86-64, i386, arm64, ia64. ]
>
> drivers/nfc/nfcmrvl/fw_dnld.c | 2 +-
> drivers/nfc/nxp-nci/firmware.c | 2 +-
> drivers/nfc/nxp-nci/i2c.c | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
This build issue is now fixed in nfc-next with a couple of different
patches.
Cheers,
Samuel.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2] nfc: don't be making arch specific unaligned decisions at driver level.
@ 2017-04-01 22:22 ` Samuel Ortiz
0 siblings, 0 replies; 19+ messages in thread
From: Samuel Ortiz @ 2017-04-01 22:22 UTC (permalink / raw)
To: Paul Gortmaker
Cc: linux-kernel, kbuild test robot, Tony Luck, Fenghua Yu,
linux-ia64, linux-wireless
Hi Paul,
On Mon, Jan 09, 2017 at 12:52:22PM -0500, Paul Gortmaker wrote:
> Currently ia64 fails building allmodconfig with variations of:
>
> In file included from drivers/nfc/nxp-nci/i2c.c:39:0:
> ./include/linux/unaligned/access_ok.h:62:29: error: redefinition of ‘put_unaligned_be64’
> static __always_inline void put_unaligned_be64(u64 val, void *p)
> ^~~~~~~~~~~~~~~~~~
> In file included from ./arch/ia64/include/asm/unaligned.h:5:0,
> from ./arch/ia64/include/asm/io.h:22,
> from ./arch/ia64/include/asm/smp.h:20,
> from ./include/linux/smp.h:59,
> from ./include/linux/topology.h:33,
> from ./include/linux/gfp.h:8,
> from ./include/linux/slab.h:14,
> from ./include/linux/resource_ext.h:19,
> from ./include/linux/acpi.h:26,
> from drivers/nfc/nxp-nci/i2c.c:28:
> ./include/linux/unaligned/be_byteshift.h:65:20: note: previous definition of ‘put_unaligned_be64’ was here
> static inline void put_unaligned_be64(u64 val, void *p)
> ^~~~~~~~~~~~~~~~~~
> scripts/Makefile.build:293: recipe for target 'drivers/nfc/nxp-nci/i2c.o' failed
>
> The easiest explanation for this is to look at the non-arch users in
> the following output:
>
> linux$git grep include.*access_ok.h
> arch/arm64/crypto/crc32-arm64.c:#include <linux/unaligned/access_ok.h>
> arch/cris/include/asm/unaligned.h:#include <linux/unaligned/access_ok.h>
> arch/m68k/include/asm/unaligned.h:#include <linux/unaligned/access_ok.h>
> arch/mn10300/include/asm/unaligned.h:#include <linux/unaligned/access_ok.h>
> arch/powerpc/include/asm/unaligned.h:#include <linux/unaligned/access_ok.h>
> arch/s390/include/asm/unaligned.h:#include <linux/unaligned/access_ok.h>
> arch/x86/include/asm/unaligned.h:#include <linux/unaligned/access_ok.h>
> drivers/nfc/nfcmrvl/fw_dnld.c:#include <linux/unaligned/access_ok.h>
> drivers/nfc/nxp-nci/firmware.c:#include <linux/unaligned/access_ok.h>
> drivers/nfc/nxp-nci/i2c.c:#include <linux/unaligned/access_ok.h>
> include/asm-generic/unaligned.h:# include <linux/unaligned/access_ok.h>
>
> Note that nfc is essentially the only non-arch user in the above.
> When it forces use of access_ok.h, it will break any arch that has
> already selected be_byteshift.h (or other conflicting implementations)
> at the arch level.
>
> The decision of what variant for unaligned access to use needs to be
> left to the arch level and not used at the driver level. Since not
> all arch will have sourced asm/unaligned.h already, we need to call
> it out and then the arch can give us just the one definition that
> is needed.
>
> See commit 064106a91be5 ("kernel: add common infrastructure for
> unaligned access") as a reference.
>
> Cc: Lauro Ramos Venancio <lauro.venancio@openbossa.org>
> Cc: Aloisio Almeida Jr <aloisio.almeida@openbossa.org>
> Cc: Samuel Ortiz <sameo@linux.intel.com>
> Cc: Tony Luck <tony.luck@intel.com>
> Cc: Fenghua Yu <fenghua.yu@intel.com>
> Cc: linux-ia64@vger.kernel.org
> Cc: linux-wireless@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>
> [v2: explicitly include asm/uaccess.h since some arch won't be
> getting any variant of an unaligned access header without it.
> Build test allmodconfig on x86-64, i386, arm64, ia64. ]
>
> drivers/nfc/nfcmrvl/fw_dnld.c | 2 +-
> drivers/nfc/nxp-nci/firmware.c | 2 +-
> drivers/nfc/nxp-nci/i2c.c | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
This build issue is now fixed in nfc-next with a couple of different
patches.
Cheers,
Samuel.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2] nfc: don't be making arch specific unaligned decisions at driver level.
2017-04-01 22:22 ` Samuel Ortiz
@ 2017-04-03 17:27 ` Paul Gortmaker
-1 siblings, 0 replies; 19+ messages in thread
From: Paul Gortmaker @ 2017-04-03 17:27 UTC (permalink / raw)
To: Samuel Ortiz
Cc: linux-kernel, kbuild test robot, Tony Luck, Fenghua Yu,
linux-ia64, linux-wireless
[Re: [PATCH v2] nfc: don't be making arch specific unaligned decisions at driver level.] On 02/04/2017 (Sun 00:22) Samuel Ortiz wrote:
> Hi Paul,
>
> On Mon, Jan 09, 2017 at 12:52:22PM -0500, Paul Gortmaker wrote:
> > Currently ia64 fails building allmodconfig with variations of:
> >
[...]
> >
> > drivers/nfc/nfcmrvl/fw_dnld.c | 2 +-
> > drivers/nfc/nxp-nci/firmware.c | 2 +-
> > drivers/nfc/nxp-nci/i2c.c | 2 +-
> > 3 files changed, 3 insertions(+), 3 deletions(-)
> This build issue is now fixed in nfc-next with a couple of different
> patches.
OK, I'll remove it from my local queue and retest and let you know if I
see any issues still.
Thanks,
Paul.
--
>
> Cheers,
> Samuel.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2] nfc: don't be making arch specific unaligned decisions at driver level.
@ 2017-04-03 17:27 ` Paul Gortmaker
0 siblings, 0 replies; 19+ messages in thread
From: Paul Gortmaker @ 2017-04-03 17:27 UTC (permalink / raw)
To: Samuel Ortiz
Cc: linux-kernel, kbuild test robot, Tony Luck, Fenghua Yu,
linux-ia64, linux-wireless
[Re: [PATCH v2] nfc: don't be making arch specific unaligned decisions at driver level.] On 02/04/2017 (Sun 00:22) Samuel Ortiz wrote:
> Hi Paul,
>
> On Mon, Jan 09, 2017 at 12:52:22PM -0500, Paul Gortmaker wrote:
> > Currently ia64 fails building allmodconfig with variations of:
> >
[...]
> >
> > drivers/nfc/nfcmrvl/fw_dnld.c | 2 +-
> > drivers/nfc/nxp-nci/firmware.c | 2 +-
> > drivers/nfc/nxp-nci/i2c.c | 2 +-
> > 3 files changed, 3 insertions(+), 3 deletions(-)
> This build issue is now fixed in nfc-next with a couple of different
> patches.
OK, I'll remove it from my local queue and retest and let you know if I
see any issues still.
Thanks,
Paul.
--
>
> Cheers,
> Samuel.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2] nfc: don't be making arch specific unaligned decisions at driver level.
2017-04-01 22:22 ` Samuel Ortiz
@ 2017-04-04 1:55 ` Paul Gortmaker
-1 siblings, 0 replies; 19+ messages in thread
From: Paul Gortmaker @ 2017-04-04 1:55 UTC (permalink / raw)
To: Samuel Ortiz
Cc: linux-kernel, kbuild test robot, Tony Luck, Fenghua Yu,
linux-ia64, linux-wireless, Stephen Rothwell
[Re: [PATCH v2] nfc: don't be making arch specific unaligned decisions at driver level.] On 02/04/2017 (Sun 00:22) Samuel Ortiz wrote:
> Hi Paul,
>
> On Mon, Jan 09, 2017 at 12:52:22PM -0500, Paul Gortmaker wrote:
> > Currently ia64 fails building allmodconfig with variations of:
> >
> > In file included from drivers/nfc/nxp-nci/i2c.c:39:0:
> > ./include/linux/unaligned/access_ok.h:62:29: error: redefinition of ‘put_unaligned_be64’
[...]
> >
> > The decision of what variant for unaligned access to use needs to be
> > left to the arch level and not used at the driver level. Since not
> > all arch will have sourced asm/unaligned.h already, we need to call
> > it out and then the arch can give us just the one definition that
> > is needed.
> >
> > See commit 064106a91be5 ("kernel: add common infrastructure for
> > unaligned access") as a reference.
> >
[...]
> This build issue is now fixed in nfc-next with a couple of different
> patches.
I added nfc-next as a remote and saw you pulled similar commits out of
the NFC backlog just recently:
commit 2eee74b7e2a496dea49847c36fd09320505f45b7
Author: Guenter Roeck <linux@roeck-us.net>
AuthorDate: Sat Aug 1 06:59:29 2015 -0700
Commit: Samuel Ortiz <sameo@linux.intel.com>
CommitDate: Sat Apr 1 23:52:25 2017 +0200
NFC: nxp-nci: Include unaligned.h instead of access_ok.h
...and...
commit d916d923724d59cde99ee588f15eec59dd863bbd
Author: Tobias Klauser <tklauser@distanz.ch>
AuthorDate: Wed Oct 26 11:00:12 2016 +0200
Commit: Samuel Ortiz <sameo@linux.intel.com>
CommitDate: Sat Apr 1 23:45:31 2017 +0200
NFC: nfcmrvl: Include unaligned.h instead of access_ok.h
Thanks for finding those in the backlog and folding them in; presumably
the backlog was related to the MAINTAINERS change on the same branch.
Anyway, they appear to be the same as the change I proposed, and I build
tested nfc-next on ia64 and x86-64 without issue. So it looks good.
One thing I did notice, is that nfc-next doesn't appear to be merged
into the linux-next trees, which explains why I didn't see a conflict
with my patch against your two new commits. Given the recent maintainer
change you added, it seems your nfc-next is now the unconditional source
for NFC changes. So maybe you want to ask Stephen (Cc:'d) to add your
tree to the daily linux-next coverage?
All he needs is the repo and branch, which I assume are:
git://git.kernel.org/pub/scm/linux/kernel/git/sameo/nfc-next.git #master
Well, that and the request for it really should come from you... :)
Thanks,
Paul.
--
>
> Cheers,
> Samuel.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2] nfc: don't be making arch specific unaligned decisions at driver level.
@ 2017-04-04 1:55 ` Paul Gortmaker
0 siblings, 0 replies; 19+ messages in thread
From: Paul Gortmaker @ 2017-04-04 1:55 UTC (permalink / raw)
To: Samuel Ortiz
Cc: linux-kernel, kbuild test robot, Tony Luck, Fenghua Yu,
linux-ia64, linux-wireless, Stephen Rothwell
[Re: [PATCH v2] nfc: don't be making arch specific unaligned decisions at driver level.] On 02/04/2017 (Sun 00:22) Samuel Ortiz wrote:
> Hi Paul,
>
> On Mon, Jan 09, 2017 at 12:52:22PM -0500, Paul Gortmaker wrote:
> > Currently ia64 fails building allmodconfig with variations of:
> >
> > In file included from drivers/nfc/nxp-nci/i2c.c:39:0:
> > ./include/linux/unaligned/access_ok.h:62:29: error: redefinition of ‘put_unaligned_be64’
[...]
> >
> > The decision of what variant for unaligned access to use needs to be
> > left to the arch level and not used at the driver level. Since not
> > all arch will have sourced asm/unaligned.h already, we need to call
> > it out and then the arch can give us just the one definition that
> > is needed.
> >
> > See commit 064106a91be5 ("kernel: add common infrastructure for
> > unaligned access") as a reference.
> >
[...]
> This build issue is now fixed in nfc-next with a couple of different
> patches.
I added nfc-next as a remote and saw you pulled similar commits out of
the NFC backlog just recently:
commit 2eee74b7e2a496dea49847c36fd09320505f45b7
Author: Guenter Roeck <linux@roeck-us.net>
AuthorDate: Sat Aug 1 06:59:29 2015 -0700
Commit: Samuel Ortiz <sameo@linux.intel.com>
CommitDate: Sat Apr 1 23:52:25 2017 +0200
NFC: nxp-nci: Include unaligned.h instead of access_ok.h
...and...
commit d916d923724d59cde99ee588f15eec59dd863bbd
Author: Tobias Klauser <tklauser@distanz.ch>
AuthorDate: Wed Oct 26 11:00:12 2016 +0200
Commit: Samuel Ortiz <sameo@linux.intel.com>
CommitDate: Sat Apr 1 23:45:31 2017 +0200
NFC: nfcmrvl: Include unaligned.h instead of access_ok.h
Thanks for finding those in the backlog and folding them in; presumably
the backlog was related to the MAINTAINERS change on the same branch.
Anyway, they appear to be the same as the change I proposed, and I build
tested nfc-next on ia64 and x86-64 without issue. So it looks good.
One thing I did notice, is that nfc-next doesn't appear to be merged
into the linux-next trees, which explains why I didn't see a conflict
with my patch against your two new commits. Given the recent maintainer
change you added, it seems your nfc-next is now the unconditional source
for NFC changes. So maybe you want to ask Stephen (Cc:'d) to add your
tree to the daily linux-next coverage?
All he needs is the repo and branch, which I assume are:
git://git.kernel.org/pub/scm/linux/kernel/git/sameo/nfc-next.git #master
Well, that and the request for it really should come from you... :)
Thanks,
Paul.
--
>
> Cheers,
> Samuel.
^ permalink raw reply [flat|nested] 19+ messages in thread