Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755550AbbGTTFr (ORCPT ); Mon, 20 Jul 2015 15:05:47 -0400 Received: from mail-qk0-f181.google.com ([209.85.220.181]:36704 "EHLO mail-qk0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751461AbbGTTFq (ORCPT ); Mon, 20 Jul 2015 15:05:46 -0400 Message-ID: <55AD4683.3090708@hurleysoftware.com> Date: Mon, 20 Jul 2015 15:05:39 -0400 From: Peter Hurley User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Alexandre Belloni , Nicolas Ferre , Greg Kroah-Hartman CC: Jiri Slaby , linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Cyrille Pitchen Subject: Re: [PATCH] tty/serial: atmel: use proper accessors References: <1437400572-16575-1-git-send-email-alexandre.belloni@free-electrons.com> In-Reply-To: <1437400572-16575-1-git-send-email-alexandre.belloni@free-electrons.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2598 Lines: 78 Hi Alexandre, On 07/20/2015 09:56 AM, Alexandre Belloni wrote: > On ARM, it is necessary to use the _relaxed versions of read[bl] and > write[bl] to ensure we do the correct endianness conversion when running in > big endian. > Keep using avr32 __raw version on avr32 to avoid breakage. > > Signed-off-by: Alexandre Belloni > --- > > This patch applies after [PATCH v4 0/5] tty/serial: at91: add support to FIFOs > http://lists.infradead.org/pipermail/linux-arm-kernel/2015-July/353704.html > > drivers/tty/serial/atmel_serial.c | 22 ++++++++++++++++++++++ > 1 file changed, 22 insertions(+) > > diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c > index e91b3b2f0590..451acf054281 100644 > --- a/drivers/tty/serial/atmel_serial.c > +++ b/drivers/tty/serial/atmel_serial.c > @@ -194,6 +194,7 @@ to_atmel_uart_port(struct uart_port *uart) > return container_of(uart, struct atmel_uart_port, uart); > } > > +#ifdef CONFIG_AVR32 The whole point of i/o accessors is to encapsulate arch-specific differences, so one of these arches isn't doing it right, or the wrong i/o accessors are being used. In any event, serial drivers can't start taking on per-arch conditional compilation. Regards, Peter Hurley PS - The $subject doesn't really match the patch; this is basically adding big-endian support on little-endian arches. > static inline u32 atmel_uart_readl(struct uart_port *port, u32 reg) > { > return __raw_readl(port->membase + reg); > @@ -213,6 +214,27 @@ static inline void atmel_uart_writeb(struct uart_port *port, u32 reg, u8 value) > { > __raw_writeb(value, port->membase + reg); > } > +#else > +static inline u32 atmel_uart_readl(struct uart_port *port, u32 reg) > +{ > + return readl_relaxed(port->membase + reg); > +} > + > +static inline void atmel_uart_writel(struct uart_port *port, u32 reg, u32 value) > +{ > + writel_relaxed(value, port->membase + reg); > +} > + > +static inline u8 atmel_uart_readb(struct uart_port *port, u32 reg) > +{ > + return readb_relaxed(port->membase + reg); > +} > + > +static inline void atmel_uart_writeb(struct uart_port *port, u32 reg, u8 value) > +{ > + writeb_relaxed(value, port->membase + reg); > +} > +#endif > > #ifdef CONFIG_SERIAL_ATMEL_PDC > static bool atmel_use_pdc_rx(struct uart_port *port) > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/