stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v16 1/4] tty: goldfish: introduce gf_ioread32()/gf_iowrite32()
       [not found] <20220406201523.243733-1-laurent@vivier.eu>
@ 2022-04-06 20:15 ` Laurent Vivier
  2022-04-07  4:48   ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Laurent Vivier @ 2022-04-06 20:15 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alexandre Belloni, linux-m68k, Jiaxun Yang, linux-rtc,
	Arnd Bergmann, Daniel Lezcano, John Stultz, Stephen Boyd,
	Thomas Gleixner, Geert Uytterhoeven, Alessandro Zummo,
	Laurent Vivier, stable

Revert
commit da31de35cd2f ("tty: goldfish: use __raw_writel()/__raw_readl()")

and define gf_ioread32()/gf_iowrite32() to be able to use accessors
defined by the architecture.

Cc: stable@vger.kernel.org # v5.11+
Fixes: da31de35cd2f ("tty: goldfish: use __raw_writel()/__raw_readl()")
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 drivers/tty/goldfish.c   | 20 ++++++++++----------
 include/linux/goldfish.h | 15 +++++++++++----
 2 files changed, 21 insertions(+), 14 deletions(-)

diff --git a/drivers/tty/goldfish.c b/drivers/tty/goldfish.c
index ad13532e92fe..9e8ccb8ed6d6 100644
--- a/drivers/tty/goldfish.c
+++ b/drivers/tty/goldfish.c
@@ -61,13 +61,13 @@ static void do_rw_io(struct goldfish_tty *qtty,
 	spin_lock_irqsave(&qtty->lock, irq_flags);
 	gf_write_ptr((void *)address, base + GOLDFISH_TTY_REG_DATA_PTR,
 		     base + GOLDFISH_TTY_REG_DATA_PTR_HIGH);
-	__raw_writel(count, base + GOLDFISH_TTY_REG_DATA_LEN);
+	gf_iowrite32(count, base + GOLDFISH_TTY_REG_DATA_LEN);
 
 	if (is_write)
-		__raw_writel(GOLDFISH_TTY_CMD_WRITE_BUFFER,
+		gf_iowrite32(GOLDFISH_TTY_CMD_WRITE_BUFFER,
 		       base + GOLDFISH_TTY_REG_CMD);
 	else
-		__raw_writel(GOLDFISH_TTY_CMD_READ_BUFFER,
+		gf_iowrite32(GOLDFISH_TTY_CMD_READ_BUFFER,
 		       base + GOLDFISH_TTY_REG_CMD);
 
 	spin_unlock_irqrestore(&qtty->lock, irq_flags);
@@ -142,7 +142,7 @@ static irqreturn_t goldfish_tty_interrupt(int irq, void *dev_id)
 	unsigned char *buf;
 	u32 count;
 
-	count = __raw_readl(base + GOLDFISH_TTY_REG_BYTES_READY);
+	count = gf_ioread32(base + GOLDFISH_TTY_REG_BYTES_READY);
 	if (count == 0)
 		return IRQ_NONE;
 
@@ -159,7 +159,7 @@ static int goldfish_tty_activate(struct tty_port *port, struct tty_struct *tty)
 {
 	struct goldfish_tty *qtty = container_of(port, struct goldfish_tty,
 									port);
-	__raw_writel(GOLDFISH_TTY_CMD_INT_ENABLE, qtty->base + GOLDFISH_TTY_REG_CMD);
+	gf_iowrite32(GOLDFISH_TTY_CMD_INT_ENABLE, qtty->base + GOLDFISH_TTY_REG_CMD);
 	return 0;
 }
 
@@ -167,7 +167,7 @@ static void goldfish_tty_shutdown(struct tty_port *port)
 {
 	struct goldfish_tty *qtty = container_of(port, struct goldfish_tty,
 									port);
-	__raw_writel(GOLDFISH_TTY_CMD_INT_DISABLE, qtty->base + GOLDFISH_TTY_REG_CMD);
+	gf_iowrite32(GOLDFISH_TTY_CMD_INT_DISABLE, qtty->base + GOLDFISH_TTY_REG_CMD);
 }
 
 static int goldfish_tty_open(struct tty_struct *tty, struct file *filp)
@@ -202,7 +202,7 @@ static unsigned int goldfish_tty_chars_in_buffer(struct tty_struct *tty)
 {
 	struct goldfish_tty *qtty = &goldfish_ttys[tty->index];
 	void __iomem *base = qtty->base;
-	return __raw_readl(base + GOLDFISH_TTY_REG_BYTES_READY);
+	return gf_ioread32(base + GOLDFISH_TTY_REG_BYTES_READY);
 }
 
 static void goldfish_tty_console_write(struct console *co, const char *b,
@@ -355,7 +355,7 @@ static int goldfish_tty_probe(struct platform_device *pdev)
 	 * on Ranchu emulator (qemu2) returns 1 here and
 	 * driver will use physical addresses.
 	 */
-	qtty->version = __raw_readl(base + GOLDFISH_TTY_REG_VERSION);
+	qtty->version = gf_ioread32(base + GOLDFISH_TTY_REG_VERSION);
 
 	/*
 	 * Goldfish TTY device on Ranchu emulator (qemu2)
@@ -374,7 +374,7 @@ static int goldfish_tty_probe(struct platform_device *pdev)
 		}
 	}
 
-	__raw_writel(GOLDFISH_TTY_CMD_INT_DISABLE, base + GOLDFISH_TTY_REG_CMD);
+	gf_iowrite32(GOLDFISH_TTY_CMD_INT_DISABLE, base + GOLDFISH_TTY_REG_CMD);
 
 	ret = request_irq(irq, goldfish_tty_interrupt, IRQF_SHARED,
 			  "goldfish_tty", qtty);
@@ -436,7 +436,7 @@ static int goldfish_tty_remove(struct platform_device *pdev)
 #ifdef CONFIG_GOLDFISH_TTY_EARLY_CONSOLE
 static void gf_early_console_putchar(struct uart_port *port, unsigned char ch)
 {
-	__raw_writel(ch, port->membase);
+	gf_iowrite32(ch, port->membase);
 }
 
 static void gf_early_write(struct console *con, const char *s, unsigned int n)
diff --git a/include/linux/goldfish.h b/include/linux/goldfish.h
index 12be1601fd84..bcc17f95b906 100644
--- a/include/linux/goldfish.h
+++ b/include/linux/goldfish.h
@@ -8,14 +8,21 @@
 
 /* Helpers for Goldfish virtual platform */
 
+#ifndef gf_ioread32
+#define gf_ioread32 ioread32
+#endif
+#ifndef gf_iowrite32
+#define gf_iowrite32 iowrite32
+#endif
+
 static inline void gf_write_ptr(const void *ptr, void __iomem *portl,
 				void __iomem *porth)
 {
 	const unsigned long addr = (unsigned long)ptr;
 
-	__raw_writel(lower_32_bits(addr), portl);
+	gf_iowrite32(lower_32_bits(addr), portl);
 #ifdef CONFIG_64BIT
-	__raw_writel(upper_32_bits(addr), porth);
+	gf_iowrite32(upper_32_bits(addr), porth);
 #endif
 }
 
@@ -23,9 +30,9 @@ static inline void gf_write_dma_addr(const dma_addr_t addr,
 				     void __iomem *portl,
 				     void __iomem *porth)
 {
-	__raw_writel(lower_32_bits(addr), portl);
+	gf_iowrite32(lower_32_bits(addr), portl);
 #ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
-	__raw_writel(upper_32_bits(addr), porth);
+	gf_iowrite32(upper_32_bits(addr), porth);
 #endif
 }
 
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v16 1/4] tty: goldfish: introduce gf_ioread32()/gf_iowrite32()
  2022-04-06 20:15 ` [PATCH v16 1/4] tty: goldfish: introduce gf_ioread32()/gf_iowrite32() Laurent Vivier
@ 2022-04-07  4:48   ` Greg KH
  2022-04-07  6:00     ` Laurent Vivier
  0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2022-04-07  4:48 UTC (permalink / raw)
  To: Laurent Vivier
  Cc: linux-kernel, Alexandre Belloni, linux-m68k, Jiaxun Yang,
	linux-rtc, Arnd Bergmann, Daniel Lezcano, John Stultz,
	Stephen Boyd, Thomas Gleixner, Geert Uytterhoeven,
	Alessandro Zummo, stable

On Wed, Apr 06, 2022 at 10:15:20PM +0200, Laurent Vivier wrote:
> Revert
> commit da31de35cd2f ("tty: goldfish: use __raw_writel()/__raw_readl()")
> 
> and define gf_ioread32()/gf_iowrite32() to be able to use accessors
> defined by the architecture.
> 
> Cc: stable@vger.kernel.org # v5.11+
> Fixes: da31de35cd2f ("tty: goldfish: use __raw_writel()/__raw_readl()")
> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
> Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
> ---
>  drivers/tty/goldfish.c   | 20 ++++++++++----------
>  include/linux/goldfish.h | 15 +++++++++++----
>  2 files changed, 21 insertions(+), 14 deletions(-)
> 

Why is this a commit for the stable trees?  What bug does it fix?  You
did not describe the problem in the changelog text at all, this looks
like a housekeeping change only.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v16 1/4] tty: goldfish: introduce gf_ioread32()/gf_iowrite32()
  2022-04-07  4:48   ` Greg KH
@ 2022-04-07  6:00     ` Laurent Vivier
  2022-04-07  6:18       ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Laurent Vivier @ 2022-04-07  6:00 UTC (permalink / raw)
  To: Greg KH
  Cc: linux-kernel, Alexandre Belloni, linux-m68k, Jiaxun Yang,
	linux-rtc, Arnd Bergmann, Daniel Lezcano, John Stultz,
	Stephen Boyd, Thomas Gleixner, Geert Uytterhoeven,
	Alessandro Zummo, stable

Le 07/04/2022 à 06:48, Greg KH a écrit :
> On Wed, Apr 06, 2022 at 10:15:20PM +0200, Laurent Vivier wrote:
>> Revert
>> commit da31de35cd2f ("tty: goldfish: use __raw_writel()/__raw_readl()")
>>
>> and define gf_ioread32()/gf_iowrite32() to be able to use accessors
>> defined by the architecture.
>>
>> Cc: stable@vger.kernel.org # v5.11+
>> Fixes: da31de35cd2f ("tty: goldfish: use __raw_writel()/__raw_readl()")
>> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
>> Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
>> ---
>>   drivers/tty/goldfish.c   | 20 ++++++++++----------
>>   include/linux/goldfish.h | 15 +++++++++++----
>>   2 files changed, 21 insertions(+), 14 deletions(-)
>>
> 
> Why is this a commit for the stable trees?  What bug does it fix?  You
> did not describe the problem in the changelog text at all, this looks
> like a housekeeping change only.

Arnd asked for that in:

   Re: [PATCH v11 2/5] tty: goldfish: introduce gf_ioread32()/gf_iowrite32()
   https://lore.kernel.org/lkml/CAK8P3a1oN8NrUjkh2X8jHQbyz42Xo6GSa=5n0gD6vQcXRjmq1Q@mail.gmail.com/

Thanks,
Laurent

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v16 1/4] tty: goldfish: introduce gf_ioread32()/gf_iowrite32()
  2022-04-07  6:00     ` Laurent Vivier
@ 2022-04-07  6:18       ` Greg KH
  2022-04-11  8:53         ` Geert Uytterhoeven
  0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2022-04-07  6:18 UTC (permalink / raw)
  To: Laurent Vivier
  Cc: linux-kernel, Alexandre Belloni, linux-m68k, Jiaxun Yang,
	linux-rtc, Arnd Bergmann, Daniel Lezcano, John Stultz,
	Stephen Boyd, Thomas Gleixner, Geert Uytterhoeven,
	Alessandro Zummo, stable

On Thu, Apr 07, 2022 at 08:00:08AM +0200, Laurent Vivier wrote:
> Le 07/04/2022 à 06:48, Greg KH a écrit :
> > On Wed, Apr 06, 2022 at 10:15:20PM +0200, Laurent Vivier wrote:
> > > Revert
> > > commit da31de35cd2f ("tty: goldfish: use __raw_writel()/__raw_readl()")
> > > 
> > > and define gf_ioread32()/gf_iowrite32() to be able to use accessors
> > > defined by the architecture.
> > > 
> > > Cc: stable@vger.kernel.org # v5.11+
> > > Fixes: da31de35cd2f ("tty: goldfish: use __raw_writel()/__raw_readl()")
> > > Signed-off-by: Laurent Vivier <laurent@vivier.eu>
> > > Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
> > > ---
> > >   drivers/tty/goldfish.c   | 20 ++++++++++----------
> > >   include/linux/goldfish.h | 15 +++++++++++----
> > >   2 files changed, 21 insertions(+), 14 deletions(-)
> > > 
> > 
> > Why is this a commit for the stable trees?  What bug does it fix?  You
> > did not describe the problem in the changelog text at all, this looks
> > like a housekeeping change only.
> 
> Arnd asked for that in:
> 
>   Re: [PATCH v11 2/5] tty: goldfish: introduce gf_ioread32()/gf_iowrite32()
>   https://lore.kernel.org/lkml/CAK8P3a1oN8NrUjkh2X8jHQbyz42Xo6GSa=5n0gD6vQcXRjmq1Q@mail.gmail.com/

You did not provide a reason in this changelog to explain any of that :(

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v16 1/4] tty: goldfish: introduce gf_ioread32()/gf_iowrite32()
  2022-04-07  6:18       ` Greg KH
@ 2022-04-11  8:53         ` Geert Uytterhoeven
  2022-04-11  9:16           ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Geert Uytterhoeven @ 2022-04-11  8:53 UTC (permalink / raw)
  To: Greg KH
  Cc: Laurent Vivier, Linux Kernel Mailing List, Alexandre Belloni,
	linux-m68k, Jiaxun Yang, linux-rtc, Arnd Bergmann, Daniel Lezcano,
	John Stultz, Stephen Boyd, Thomas Gleixner, Alessandro Zummo,
	stable

Hi Greg,

On Thu, Apr 7, 2022 at 8:18 AM Greg KH <gregkh@linuxfoundation.org> wrote:
> On Thu, Apr 07, 2022 at 08:00:08AM +0200, Laurent Vivier wrote:
> > Le 07/04/2022 à 06:48, Greg KH a écrit :
> > > On Wed, Apr 06, 2022 at 10:15:20PM +0200, Laurent Vivier wrote:
> > > > Revert
> > > > commit da31de35cd2f ("tty: goldfish: use __raw_writel()/__raw_readl()")
> > > >
> > > > and define gf_ioread32()/gf_iowrite32() to be able to use accessors
> > > > defined by the architecture.
> > > >
> > > > Cc: stable@vger.kernel.org # v5.11+
> > > > Fixes: da31de35cd2f ("tty: goldfish: use __raw_writel()/__raw_readl()")
> > > > Signed-off-by: Laurent Vivier <laurent@vivier.eu>
> > > > Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
> > > > ---
> > > >   drivers/tty/goldfish.c   | 20 ++++++++++----------
> > > >   include/linux/goldfish.h | 15 +++++++++++----
> > > >   2 files changed, 21 insertions(+), 14 deletions(-)
> > > >
> > >
> > > Why is this a commit for the stable trees?  What bug does it fix?  You
> > > did not describe the problem in the changelog text at all, this looks
> > > like a housekeeping change only.
> >
> > Arnd asked for that in:
> >
> >   Re: [PATCH v11 2/5] tty: goldfish: introduce gf_ioread32()/gf_iowrite32()
> >   https://lore.kernel.org/lkml/CAK8P3a1oN8NrUjkh2X8jHQbyz42Xo6GSa=5n0gD6vQcXRjmq1Q@mail.gmail.com/
>
> You did not provide a reason in this changelog to explain any of that :(

OK if I queue that patch with the rationale from Arnd's email added
to the patch description?

This series has been dragging out for way too long...

Thanks!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v16 1/4] tty: goldfish: introduce gf_ioread32()/gf_iowrite32()
  2022-04-11  8:53         ` Geert Uytterhoeven
@ 2022-04-11  9:16           ` Greg KH
  0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2022-04-11  9:16 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Laurent Vivier, Linux Kernel Mailing List, Alexandre Belloni,
	linux-m68k, Jiaxun Yang, linux-rtc, Arnd Bergmann, Daniel Lezcano,
	John Stultz, Stephen Boyd, Thomas Gleixner, Alessandro Zummo,
	stable

On Mon, Apr 11, 2022 at 10:53:39AM +0200, Geert Uytterhoeven wrote:
> Hi Greg,
> 
> On Thu, Apr 7, 2022 at 8:18 AM Greg KH <gregkh@linuxfoundation.org> wrote:
> > On Thu, Apr 07, 2022 at 08:00:08AM +0200, Laurent Vivier wrote:
> > > Le 07/04/2022 à 06:48, Greg KH a écrit :
> > > > On Wed, Apr 06, 2022 at 10:15:20PM +0200, Laurent Vivier wrote:
> > > > > Revert
> > > > > commit da31de35cd2f ("tty: goldfish: use __raw_writel()/__raw_readl()")
> > > > >
> > > > > and define gf_ioread32()/gf_iowrite32() to be able to use accessors
> > > > > defined by the architecture.
> > > > >
> > > > > Cc: stable@vger.kernel.org # v5.11+
> > > > > Fixes: da31de35cd2f ("tty: goldfish: use __raw_writel()/__raw_readl()")
> > > > > Signed-off-by: Laurent Vivier <laurent@vivier.eu>
> > > > > Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
> > > > > ---
> > > > >   drivers/tty/goldfish.c   | 20 ++++++++++----------
> > > > >   include/linux/goldfish.h | 15 +++++++++++----
> > > > >   2 files changed, 21 insertions(+), 14 deletions(-)
> > > > >
> > > >
> > > > Why is this a commit for the stable trees?  What bug does it fix?  You
> > > > did not describe the problem in the changelog text at all, this looks
> > > > like a housekeeping change only.
> > >
> > > Arnd asked for that in:
> > >
> > >   Re: [PATCH v11 2/5] tty: goldfish: introduce gf_ioread32()/gf_iowrite32()
> > >   https://lore.kernel.org/lkml/CAK8P3a1oN8NrUjkh2X8jHQbyz42Xo6GSa=5n0gD6vQcXRjmq1Q@mail.gmail.com/
> >
> > You did not provide a reason in this changelog to explain any of that :(
> 
> OK if I queue that patch with the rationale from Arnd's email added
> to the patch description?

Fine with me, merge away!

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-04-11  9:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20220406201523.243733-1-laurent@vivier.eu>
2022-04-06 20:15 ` [PATCH v16 1/4] tty: goldfish: introduce gf_ioread32()/gf_iowrite32() Laurent Vivier
2022-04-07  4:48   ` Greg KH
2022-04-07  6:00     ` Laurent Vivier
2022-04-07  6:18       ` Greg KH
2022-04-11  8:53         ` Geert Uytterhoeven
2022-04-11  9:16           ` Greg KH

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