Skip to contentSkip to conversation

nfc: don't be making arch specific unaligned decisions at driver level.

PATCH Superseded Paul Gortmaker 3 participants 9 messages Jan 9, 2017 – Apr 4, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfc: don't be making arch specific unaligned decisions at driver level.

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. Delete the errant includes, as the right ones will be pulled in at the arch level, giving 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 <[email protected]>
Cc Aloisio Almeida Jr <[email protected]>
Cc Samuel Ortiz <[email protected]>
Cc Tony Luck <[email protected]>
Cc Fenghua Yu <[email protected]>
drivers/nfc/nfcmrvl/fw_dnld.c +0 -1
index f8dcdf4b24f6..32144d66ba88 100644
@@ -17,7 +17,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/unaligned/access_ok.h>
 #include <linux/firmware.h>
 #include <linux/nfc.h>
 #include <net/nfc/nci.h>
drivers/nfc/nxp-nci/firmware.c +0 -1
index 5291797324ba..f2bd651fc60d 100644
@@ -24,7 +24,6 @@
 #include <linux/completion.h>
 #include <linux/firmware.h>
 #include <linux/nfc.h>
-#include <linux/unaligned/access_ok.h>
 
 #include "nxp-nci.h"
 
drivers/nfc/nxp-nci/i2c.c +0 -1
index 36099e557730..d25f6257458e 100644
@@ -36,7 +36,6 @@
 #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>
 
Signature · 1 line
2.11.0
#1 lore raw
url: https://github.com/0day-ci/linux/commits/Paul-Gortmaker/nfc-don-t-be-making-arch-specific-unaligned-decisions-at-driver-level/20170109-082915 config: x86_64-randconfig-x008-201702 (attached as…

Hi Paul,

[auto build test ERROR on linus/master]
[also build test ERROR on v4.10-rc3 next-20170106]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Paul-Gortmaker/nfc-don-t-be-making-arch-specific-unaligned-decisions-at-driver-level/20170109-082915
config: x86_64-randconfig-x008-201702 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce:

        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

drivers/nfc/nfcmrvl/fw_dnld.c: In function 'process_state_fw_dnld':

>> drivers/nfc/nfcmrvl/fw_dnld.c:287:9: error: implicit declaration of function 'get_unaligned_le16' [-Werror=implicit-function-declaration]
      len = get_unaligned_le16(&len);
            ^~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors
--
   drivers/nfc/nxp-nci/firmware.c: In function 'nxp_nci_fw_send_chunk':
>> drivers/nfc/nxp-nci/firmware.c:124:2: error: implicit declaration of function 'put_unaligned_be16' [-Werror=implicit-function-declaration]
     put_unaligned_be16(header, skb_put(skb, NXP_NCI_FW_HDR_LEN));
     ^~~~~~~~~~~~~~~~~~
   drivers/nfc/nxp-nci/firmware.c: In function 'nxp_nci_fw_send':
>> drivers/nfc/nxp-nci/firmware.c:151:25: error: implicit declaration of function 'get_unaligned_be16' [-Werror=implicit-function-declaration]
      fw_info->frame_size = get_unaligned_be16(fw_info->data) &
                            ^~~~~~~~~~~~~~~~~~

cc1: some warnings being treated as errors

vim +/get_unaligned_le16 +287 drivers/nfc/nfcmrvl/fw_dnld.c

3194c687 Vincent Cuissard 2015-10-26  281  		}
3194c687 Vincent Cuissard 2015-10-26  282  		skb_pull(skb, 1);
3194c687 Vincent Cuissard 2015-10-26  283  		memcpy(&len, skb->data, 2);
3194c687 Vincent Cuissard 2015-10-26  284  		skb_pull(skb, 2);
3194c687 Vincent Cuissard 2015-10-26  285  		memcpy(&comp_len, skb->data, 2);
3194c687 Vincent Cuissard 2015-10-26  286  		skb_pull(skb, 2);
3194c687 Vincent Cuissard 2015-10-26 @287  		len = get_unaligned_le16(&len);
3194c687 Vincent Cuissard 2015-10-26  288  		comp_len = get_unaligned_le16(&comp_len);
3194c687 Vincent Cuissard 2015-10-26  289  		if (((~len) & 0xFFFF) != comp_len) {
3194c687 Vincent Cuissard 2015-10-26  290  			nfc_err(priv->dev, "bad len complement: %x %x %x",

:::::: The code at line 287 was first introduced by commit
:::::: 3194c6870158e305dac2af52f83681e9cb67280f NFC: nfcmrvl: add firmware download support

:::::: TO: Vincent Cuissard <[email protected]> :::::: CC: Samuel Ortiz <[email protected]>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

#2 lore raw
In reply to Paul Gortmaker
url: https://github.com/0day-ci/linux/commits/Paul-Gortmaker/nfc-don-t-be-making-arch-specific-unaligned-decisions-at-driver-level/20170109-082915 config: x86_64-randconfig-x014-201702 (attached as…

Hi Paul,

[auto build test ERROR on linus/master]
[also build test ERROR on v4.10-rc3 next-20170106]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Paul-Gortmaker/nfc-don-t-be-making-arch-specific-unaligned-decisions-at-driver-level/20170109-082915
config: x86_64-randconfig-x014-201702 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce:

        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

drivers/nfc/nxp-nci/i2c.c: In function 'nxp_nci_i2c_fw_read':

>> drivers/nfc/nxp-nci/i2c.c:129:15: error: implicit declaration of function 'get_unaligned_be16' [-Werror=implicit-function-declaration]
     frame_len = (get_unaligned_be16(&header) & NXP_NCI_FW_FRAME_LEN_MASK) +
                  ^~~~~~~~~~~~~~~~~~

cc1: some warnings being treated as errors

vim +/get_unaligned_be16 +129 drivers/nfc/nxp-nci/i2c.c

6be88670 Clément Perrochaud 2015-03-09  123  	} else if (r != NXP_NCI_FW_HDR_LEN) {
6be88670 Clément Perrochaud 2015-03-09  124  		nfc_err(&client->dev, "Incorrect header length: %u\n", r);
6be88670 Clément Perrochaud 2015-03-09  125  		r = -EBADMSG;
6be88670 Clément Perrochaud 2015-03-09  126  		goto fw_read_exit;
6be88670 Clément Perrochaud 2015-03-09  127  	}
6be88670 Clément Perrochaud 2015-03-09  128  
6be88670 Clément Perrochaud 2015-03-09 @129  	frame_len = (get_unaligned_be16(&header) & NXP_NCI_FW_FRAME_LEN_MASK) +
6be88670 Clément Perrochaud 2015-03-09  130  		    NXP_NCI_FW_CRC_LEN;
6be88670 Clément Perrochaud 2015-03-09  131  
6be88670 Clément Perrochaud 2015-03-09  132  	*skb = alloc_skb(NXP_NCI_FW_HDR_LEN + frame_len, GFP_KERNEL);

:::::: The code at line 129 was first introduced by commit
:::::: 6be88670fc59d50426f90f734a36b90e1de7d148 NFC: nxp-nci_i2c: Add I2C support to NXP NCI driver

:::::: TO: Clément Perrochaud <[email protected]> :::::: CC: Samuel Ortiz <[email protected]>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

#3 lore raw

PATCH v2 1/1 nfc: don't be making arch specific unaligned decisions at driver level.

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 <[email protected]>
Cc Aloisio Almeida Jr <[email protected]>
Cc Samuel Ortiz <[email protected]>
Cc Tony Luck <[email protected]>
Cc Fenghua Yu <[email protected]>

---

[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(-)
drivers/nfc/nfcmrvl/fw_dnld.c +1 -1
index f8dcdf4b24f6..f3f246ddae06 100644
@@ -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
drivers/nfc/nxp-nci/firmware.c +1 -1
index 5291797324ba..553011f58339 100644
@@ -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"
 
drivers/nfc/nxp-nci/i2c.c +1 -1
index 36099e557730..20243dafea21 100644
@@ -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"
 
Signature · 1 line
2.11.0
#4 lore raw
Quoted 5 lines · Paul Gortmaker

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.
--

Quoted 112 lines
   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 <[email protected]>
Cc Aloisio Almeida Jr <[email protected]>
Cc Samuel Ortiz <[email protected]>
Cc Tony Luck <[email protected]>
Cc Fenghua Yu <[email protected]>

---

[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(-)
drivers/nfc/nfcmrvl/fw_dnld.c +1 -1
index f8dcdf4b24f6..f3f246ddae06 100644
@@ -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
drivers/nfc/nxp-nci/firmware.c +1 -1
index 5291797324ba..553011f58339 100644
@@ -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"
 
drivers/nfc/nxp-nci/i2c.c +1 -2
index 36099e557730..20243dafea21 100644
@@ -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

#5 lore raw

Hi Paul,

Quoted 4 lines · Paul Gortmaker
Quoted 2 lines · Paul Gortmaker

Currently ia64 fails building allmodconfig with variations of:

Quoted 8 lines
Quoted 3 lines

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.

#6 lore raw
In reply to Paul Gortmaker

Hi Paul,

Quoted 61 lines · Paul Gortmaker

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 <[email protected]>
Cc Aloisio Almeida Jr <[email protected]>
Cc Samuel Ortiz <[email protected]>
Cc Tony Luck <[email protected]>
Cc Fenghua Yu <[email protected]>

---

Quoted 8 lines

[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.

#7 lore raw
Quoted 5 lines · [Re: [PATCH v2] nfc: don't be making arch specific unaligned decisions at…

Hi Paul,

Quoted 2 lines · Paul Gortmaker

Currently ia64 fails building allmodconfig with variations of:

[...]

Quoted 7 lines
Quoted 5 lines
 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.
--

Quoted 3 lines

Cheers,
Samuel.

#8 lore raw
In reply to Samuel Ortiz
Quoted 7 lines · [Re: [PATCH v2] nfc: don't be making arch specific unaligned decisions at…

Hi Paul,

Quoted 4 lines · Paul Gortmaker

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’

[...]

Quoted 10 lines
Quoted 10 lines

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.

[...]

Quoted 2 lines

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 <[email protected]>
AuthorDate: Sat Aug 1 06:59:29 2015 -0700
Commit:     Samuel Ortiz <[email protected]>
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 <[email protected]>
AuthorDate: Wed Oct 26 11:00:12 2016 +0200
Commit:     Samuel Ortiz <[email protected]>
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.
--

Quoted 3 lines

Cheers,
Samuel.