* [PATCH] Input: sa1111ps2 - remove special sa1111 mmio accessors
@ 2017-09-26 14:16 Russell King
2017-09-26 16:48 ` Dmitry Torokhov
0 siblings, 1 reply; 4+ messages in thread
From: Russell King @ 2017-09-26 14:16 UTC (permalink / raw)
To: Dmitry Torokhov, linux-input
Remove the special SA1111 MMIO accessors from the SA1111 PS/2 driver
as their definition will be removed shortly. The SA1111 accessors are
barrierless, so use the _relaxed variants.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
---
drivers/input/serio/sa1111ps2.c | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/drivers/input/serio/sa1111ps2.c b/drivers/input/serio/sa1111ps2.c
index 3b54050b9fc7..f1c036260d25 100644
--- a/drivers/input/serio/sa1111ps2.c
+++ b/drivers/input/serio/sa1111ps2.c
@@ -66,22 +66,22 @@ static irqreturn_t ps2_rxint(int irq, void *dev_id)
struct ps2if *ps2if = dev_id;
unsigned int scancode, flag, status;
- status = sa1111_readl(ps2if->base + PS2STAT);
+ status = readl_relaxed(ps2if->base + PS2STAT);
while (status & PS2STAT_RXF) {
if (status & PS2STAT_STP)
- sa1111_writel(PS2STAT_STP, ps2if->base + PS2STAT);
+ writel_relaxed(PS2STAT_STP, ps2if->base + PS2STAT);
flag = (status & PS2STAT_STP ? SERIO_FRAME : 0) |
(status & PS2STAT_RXP ? 0 : SERIO_PARITY);
- scancode = sa1111_readl(ps2if->base + PS2DATA) & 0xff;
+ scancode = readl_relaxed(ps2if->base + PS2DATA) & 0xff;
if (hweight8(scancode) & 1)
flag ^= SERIO_PARITY;
serio_interrupt(ps2if->io, scancode, flag);
- status = sa1111_readl(ps2if->base + PS2STAT);
+ status = readl_relaxed(ps2if->base + PS2STAT);
}
return IRQ_HANDLED;
@@ -96,12 +96,12 @@ static irqreturn_t ps2_txint(int irq, void *dev_id)
unsigned int status;
spin_lock(&ps2if->lock);
- status = sa1111_readl(ps2if->base + PS2STAT);
+ status = readl_relaxed(ps2if->base + PS2STAT);
if (ps2if->head == ps2if->tail) {
disable_irq_nosync(irq);
/* done */
} else if (status & PS2STAT_TXE) {
- sa1111_writel(ps2if->buf[ps2if->tail], ps2if->base + PS2DATA);
+ writel_relaxed(ps2if->buf[ps2if->tail], ps2if->base + PS2DATA);
ps2if->tail = (ps2if->tail + 1) & (sizeof(ps2if->buf) - 1);
}
spin_unlock(&ps2if->lock);
@@ -124,8 +124,8 @@ static int ps2_write(struct serio *io, unsigned char val)
/*
* If the TX register is empty, we can go straight out.
*/
- if (sa1111_readl(ps2if->base + PS2STAT) & PS2STAT_TXE) {
- sa1111_writel(val, ps2if->base + PS2DATA);
+ if (readl_relaxed(ps2if->base + PS2STAT) & PS2STAT_TXE) {
+ writel_relaxed(val, ps2if->base + PS2DATA);
} else {
if (ps2if->head == ps2if->tail)
enable_irq(ps2if->tx_irq);
@@ -172,7 +172,7 @@ static int ps2_open(struct serio *io)
enable_irq_wake(ps2if->rx_irq);
- sa1111_writel(PS2CR_ENA, ps2if->base + PS2CR);
+ writel_relaxed(PS2CR_ENA, ps2if->base + PS2CR);
return 0;
}
@@ -180,7 +180,7 @@ static void ps2_close(struct serio *io)
{
struct ps2if *ps2if = io->port_data;
- sa1111_writel(0, ps2if->base + PS2CR);
+ writel_relaxed(0, ps2if->base + PS2CR);
disable_irq_wake(ps2if->rx_irq);
@@ -200,7 +200,7 @@ static void ps2_clear_input(struct ps2if *ps2if)
int maxread = 100;
while (maxread--) {
- if ((sa1111_readl(ps2if->base + PS2DATA) & 0xff) == 0xff)
+ if ((readl_relaxed(ps2if->base + PS2DATA) & 0xff) == 0xff)
break;
}
}
@@ -210,11 +210,11 @@ static unsigned int ps2_test_one(struct ps2if *ps2if,
{
unsigned int val;
- sa1111_writel(PS2CR_ENA | mask, ps2if->base + PS2CR);
+ writel_relaxed(PS2CR_ENA | mask, ps2if->base + PS2CR);
udelay(2);
- val = sa1111_readl(ps2if->base + PS2STAT);
+ val = readl_relaxed(ps2if->base + PS2STAT);
return val & (PS2STAT_KBC | PS2STAT_KBD);
}
@@ -245,7 +245,7 @@ static int ps2_test(struct ps2if *ps2if)
ret = -ENODEV;
}
- sa1111_writel(0, ps2if->base + PS2CR);
+ writel_relaxed(0, ps2if->base + PS2CR);
return ret;
}
@@ -310,8 +310,8 @@ static int ps2_probe(struct sa1111_dev *dev)
sa1111_enable_device(ps2if->dev);
/* Incoming clock is 8MHz */
- sa1111_writel(0, ps2if->base + PS2CLKDIV);
- sa1111_writel(127, ps2if->base + PS2PRECNT);
+ writel_relaxed(0, ps2if->base + PS2CLKDIV);
+ writel_relaxed(127, ps2if->base + PS2PRECNT);
/*
* Flush any pending input.
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Input: sa1111ps2 - remove special sa1111 mmio accessors
2017-09-26 14:16 [PATCH] Input: sa1111ps2 - remove special sa1111 mmio accessors Russell King
@ 2017-09-26 16:48 ` Dmitry Torokhov
2017-09-26 16:53 ` Russell King - ARM Linux
0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Torokhov @ 2017-09-26 16:48 UTC (permalink / raw)
To: Russell King; +Cc: linux-input
On Tue, Sep 26, 2017 at 03:16:15PM +0100, Russell King wrote:
> Remove the special SA1111 MMIO accessors from the SA1111 PS/2 driver
> as their definition will be removed shortly. The SA1111 accessors are
> barrierless, so use the _relaxed variants.
>
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Russell,
Do you want me to take this patch or would you rather take it through
your tree so removal of the accessors is not stalled by whole release
cycle? Or there are few more drivers that also need to go through the
pipeline so that is not a concern?
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Input: sa1111ps2 - remove special sa1111 mmio accessors
2017-09-26 16:48 ` Dmitry Torokhov
@ 2017-09-26 16:53 ` Russell King - ARM Linux
2017-09-26 16:55 ` Dmitry Torokhov
0 siblings, 1 reply; 4+ messages in thread
From: Russell King - ARM Linux @ 2017-09-26 16:53 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-input
On Tue, Sep 26, 2017 at 09:48:19AM -0700, Dmitry Torokhov wrote:
> On Tue, Sep 26, 2017 at 03:16:15PM +0100, Russell King wrote:
> > Remove the special SA1111 MMIO accessors from the SA1111 PS/2 driver
> > as their definition will be removed shortly. The SA1111 accessors are
> > barrierless, so use the _relaxed variants.
> >
> > Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
>
> Russell,
>
> Do you want me to take this patch or would you rather take it through
> your tree so removal of the accessors is not stalled by whole release
> cycle? Or there are few more drivers that also need to go through the
> pipeline so that is not a concern?
There's three subsystems of drivers involved: input, pcmcia and usb.
The usb ones have been acked by Alan Stern. I'm not expecting any
reaction to the pcmcia ones, so that just leaves the input ones.
You're right that there are follow on patches - the stack looks like
this at the moment:
ARM: sa1111: map interrupt numbers through irqdomain
ARM: sa1111: use an irqdomain for SA1111 interrupts
ARM: sa1111: remove some redundant definitions
ARM: sa1111: remove special sa1111 mmio accessors
ARM: sa1111: remove legacy suspend/resume methods
ARM: sa1111: remove legacy shutdown method
usb: ohci-sa1111: remove special sa1111 mmio accessors
usb: ohci-sa1111: convert shutdown method to native device_driver
usb: ohci-sa1111: use sa1111_get_irq() to obtain IRQ resources
pcmcia: sa1111: remove special sa1111 mmio accessors
pcmcia: sa1111: use sa1111_get_irq() to obtain IRQ resources
Input: sa1111ps2 - extend test delay
Input: sa1111ps2 - remove special sa1111 mmio accessors
Input: sa1111ps2 - use sa1111_get_irq() to obtain IRQ resources
There's no great rush for this stuff, it's already been quite some time
since the patches were originally created, so waiting another cycle for
the removal and the irqdomain conversion patches doesn't matter much.
--
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Input: sa1111ps2 - remove special sa1111 mmio accessors
2017-09-26 16:53 ` Russell King - ARM Linux
@ 2017-09-26 16:55 ` Dmitry Torokhov
0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Torokhov @ 2017-09-26 16:55 UTC (permalink / raw)
To: Russell King - ARM Linux; +Cc: linux-input
On Tue, Sep 26, 2017 at 05:53:06PM +0100, Russell King - ARM Linux wrote:
> On Tue, Sep 26, 2017 at 09:48:19AM -0700, Dmitry Torokhov wrote:
> > On Tue, Sep 26, 2017 at 03:16:15PM +0100, Russell King wrote:
> > > Remove the special SA1111 MMIO accessors from the SA1111 PS/2 driver
> > > as their definition will be removed shortly. The SA1111 accessors are
> > > barrierless, so use the _relaxed variants.
> > >
> > > Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
> >
> > Russell,
> >
> > Do you want me to take this patch or would you rather take it through
> > your tree so removal of the accessors is not stalled by whole release
> > cycle? Or there are few more drivers that also need to go through the
> > pipeline so that is not a concern?
>
> There's three subsystems of drivers involved: input, pcmcia and usb.
> The usb ones have been acked by Alan Stern. I'm not expecting any
> reaction to the pcmcia ones, so that just leaves the input ones.
>
> You're right that there are follow on patches - the stack looks like
> this at the moment:
>
> ARM: sa1111: map interrupt numbers through irqdomain
> ARM: sa1111: use an irqdomain for SA1111 interrupts
> ARM: sa1111: remove some redundant definitions
> ARM: sa1111: remove special sa1111 mmio accessors
> ARM: sa1111: remove legacy suspend/resume methods
> ARM: sa1111: remove legacy shutdown method
> usb: ohci-sa1111: remove special sa1111 mmio accessors
> usb: ohci-sa1111: convert shutdown method to native device_driver
> usb: ohci-sa1111: use sa1111_get_irq() to obtain IRQ resources
> pcmcia: sa1111: remove special sa1111 mmio accessors
> pcmcia: sa1111: use sa1111_get_irq() to obtain IRQ resources
> Input: sa1111ps2 - extend test delay
> Input: sa1111ps2 - remove special sa1111 mmio accessors
> Input: sa1111ps2 - use sa1111_get_irq() to obtain IRQ resources
>
> There's no great rush for this stuff, it's already been quite some time
> since the patches were originally created, so waiting another cycle for
> the removal and the irqdomain conversion patches doesn't matter much.
OK, I'm picking them up then.
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-09-26 16:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-26 14:16 [PATCH] Input: sa1111ps2 - remove special sa1111 mmio accessors Russell King
2017-09-26 16:48 ` Dmitry Torokhov
2017-09-26 16:53 ` Russell King - ARM Linux
2017-09-26 16:55 ` Dmitry Torokhov
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).