* [PATCH v2] net: can: Disable flexcan driver build for big endian CPU on ARM
@ 2014-01-06 13:21 Guenter Roeck
2014-01-06 13:23 ` Marc Kleine-Budde
0 siblings, 1 reply; 4+ messages in thread
From: Guenter Roeck @ 2014-01-06 13:21 UTC (permalink / raw)
To: Wolfgang Grandegger, Marc Kleine-Budde; +Cc: linux-can, netdev, Guenter Roeck
Building arm:allmodconfig fails with
flexcan.c: In function 'flexcan_read':
flexcan.c:243:2: error: implicit declaration of function 'in_be32'
flexcan.c: In function 'flexcan_write':
flexcan.c:248:2: error: implicit declaration of function 'out_be32'
in_be32 and out_be32 do not (or no longer) exist for ARM targets.
Disable the build for ARM on big endian CPUs.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
v2: Instead of marking the build as broken, disable it for big endian ARM CPUs.
Adjust headline accordingly.
drivers/net/can/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/can/Kconfig b/drivers/net/can/Kconfig
index 3c06947..fd0e5de 100644
--- a/drivers/net/can/Kconfig
+++ b/drivers/net/can/Kconfig
@@ -104,7 +104,7 @@ config CAN_JANZ_ICAN3
config CAN_FLEXCAN
tristate "Support for Freescale FLEXCAN based chips"
- depends on ARM || PPC
+ depends on (ARM && CPU_LITTLE_ENDIAN) || PPC
---help---
Say Y here if you want to support for Freescale FlexCAN.
--
1.7.9.7
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH v2] net: can: Disable flexcan driver build for big endian CPU on ARM
@ 2014-01-14 10:44 Arnd Bergmann
2014-01-16 16:49 ` Marc Kleine-Budde
0 siblings, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2014-01-14 10:44 UTC (permalink / raw)
To: Marc Kleine-Budde; +Cc: Wolfgang Grandegger, linux-can, netdev
> On 01/06/2014 02:21 PM, Guenter Roeck wrote:
> > Building arm:allmodconfig fails with
> >
> > flexcan.c: In function 'flexcan_read':
> > flexcan.c:243:2: error: implicit declaration of function 'in_be32'
> > flexcan.c: In function 'flexcan_write':
> > flexcan.c:248:2: error: implicit declaration of function 'out_be32'
> >
> > in_be32 and out_be32 do not (or no longer) exist for ARM targets.
> > Disable the build for ARM on big endian CPUs.
> >
> > Signed-off-by: Guenter Roeck <linux@xxxxxxxxxxxx>
>
> Applied to can-next.
Sorry, this patch was wrong.
There is no reason to disallow building the driver on big-endian
ARM kernels. Furthermore, the current behavior is actually broken
on little-endian PowerPC as well.
The choice of register accessor functions must purely depend
on the CPU architecture, not which endianess the CPU is running
on. Note that we nowadays allow both big-endian ARM and little-endian
PowerPC kernels.
With this patch applied, we will do the right thing in all four
combinations.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index aaed97b..320bef2 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -235,9 +235,12 @@ static const struct can_bittiming_const flexcan_bittiming_const = {
};
/*
- * Abstract off the read/write for arm versus ppc.
+ * Abstract off the read/write for arm versus ppc. This
+ * assumes that PPC uses big-endian registers and everything
+ * else uses little-endian registers, independent of CPU
+ * endianess.
*/
-#if defined(__BIG_ENDIAN)
+#if defined(CONFIG_PPC)
static inline u32 flexcan_read(void __iomem *addr)
{
return in_be32(addr);
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH v2] net: can: Disable flexcan driver build for big endian CPU on ARM
2014-01-14 10:44 Arnd Bergmann
@ 2014-01-16 16:49 ` Marc Kleine-Budde
0 siblings, 0 replies; 4+ messages in thread
From: Marc Kleine-Budde @ 2014-01-16 16:49 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: Wolfgang Grandegger, linux-can, netdev
[-- Attachment #1: Type: text/plain, Size: 1515 bytes --]
On 01/14/2014 11:44 AM, Arnd Bergmann wrote:
>> On 01/06/2014 02:21 PM, Guenter Roeck wrote:
>>> Building arm:allmodconfig fails with
>>>
>>> flexcan.c: In function 'flexcan_read':
>>> flexcan.c:243:2: error: implicit declaration of function 'in_be32'
>>> flexcan.c: In function 'flexcan_write':
>>> flexcan.c:248:2: error: implicit declaration of function 'out_be32'
>>>
>>> in_be32 and out_be32 do not (or no longer) exist for ARM targets.
>>> Disable the build for ARM on big endian CPUs.
>>>
>>> Signed-off-by: Guenter Roeck <linux@xxxxxxxxxxxx>
>>
>> Applied to can-next.
>
> Sorry, this patch was wrong.
>
> There is no reason to disallow building the driver on big-endian
> ARM kernels. Furthermore, the current behavior is actually broken
> on little-endian PowerPC as well.
> The choice of register accessor functions must purely depend
> on the CPU architecture, not which endianess the CPU is running
> on. Note that we nowadays allow both big-endian ARM and little-endian
> PowerPC kernels.
> With this patch applied, we will do the right thing in all four
> combinations.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Thanks Arnd, I've squashed in the revert of Guenter's patch.
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 242 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-01-16 16:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-06 13:21 [PATCH v2] net: can: Disable flexcan driver build for big endian CPU on ARM Guenter Roeck
2014-01-06 13:23 ` Marc Kleine-Budde
-- strict thread matches above, loose matches on Subject: below --
2014-01-14 10:44 Arnd Bergmann
2014-01-16 16:49 ` Marc Kleine-Budde
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).