All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PL011: fix reverse logic for interrupt mask register
@ 2013-08-13 15:12 Andre Przywara
  2013-08-20 16:51 ` Andre Przywara
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Andre Przywara @ 2013-08-13 15:12 UTC (permalink / raw)
  To: stefano.stabellini, Ian.Campbell, julien.grall
  Cc: patches, Andre Przywara, xen-devel

The PL011 IMSC register description is somehow fuzzy in the
documentation; by comparing it with the Linux implementation one can
see that the logic is actually reversed to Xen's implementation:
A "0" in field means interrupt disabled, a "1" enables it.
Therefore we enabled all interrupts instead of disabling them in the
beginning and later on masked the wrong interrupts.
Unclear how this worked on the Versatile Express, but this fix is
needed to get Calxeda Midway running (and works on VExpress, too).

Signed-off-by: Andre Przywara <andre.przywara@linaro.org>
---
 xen/drivers/char/pl011.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/char/pl011.c b/xen/drivers/char/pl011.c
index 05d034f..8e90520 100644
--- a/xen/drivers/char/pl011.c
+++ b/xen/drivers/char/pl011.c
@@ -87,7 +87,7 @@ static void __init pl011_init_preirq(struct serial_port *port)
     unsigned int divisor;
 
     /* No interrupts, please. */
-    pl011_write(uart, IMSC, ALLI);
+    pl011_write(uart, IMSC, 0);
 
     /* Definitely no DMA */
     pl011_write(uart, DMACR, 0x0);
@@ -115,7 +115,7 @@ static void __init pl011_init_preirq(struct serial_port *port)
     pl011_write(uart, RSR, 0);
 
     /* Mask and clear the interrupts */
-    pl011_write(uart, IMSC, ALLI);
+    pl011_write(uart, IMSC, 0);
     pl011_write(uart, ICR, ALLI);
 
     /* Enable the UART for RX and TX; no flow ctrl */
@@ -140,7 +140,7 @@ static void __init pl011_init_postirq(struct serial_port *port)
     pl011_write(uart, ICR, OEI|BEI|PEI|FEI);
 
     /* Unmask interrupts */
-    pl011_write(uart, IMSC, RTI|DSRMI|DCDMI|CTSMI|RIMI);
+    pl011_write(uart, IMSC, OEI|BEI|PEI|FEI|TXI|RXI);
 }
 
 static void pl011_suspend(struct serial_port *port)
-- 
1.7.12.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread
* Re: [PATCH] PL011: fix reverse logic for interrupt mask register
@ 2013-08-20 17:27 Ian Campbell
  0 siblings, 0 replies; 14+ messages in thread
From: Ian Campbell @ 2013-08-20 17:27 UTC (permalink / raw)
  To: Andre Przywara; +Cc: julien.grall, xen-devel, patches, Stefano Stabellini

Sorry, I've gotten behind while traveling. I cleared a bunch of backlog this afternoon but didn't manage to get to this one. I hope I can review it tomorrow.

Ian. (Sorry for top post, on my phone)

Andre Przywara <andre.przywara@linaro.org> wrote:

>On 08/13/2013 05:12 PM, Andre Przywara wrote:
>
>Ian,
>
>what about this one?
>This is a real showstopper on Midway.
>
>Thanks,
>Andre.
>
>> The PL011 IMSC register description is somehow fuzzy in the
>> documentation; by comparing it with the Linux implementation one can
>> see that the logic is actually reversed to Xen's implementation:
>> A "0" in field means interrupt disabled, a "1" enables it.
>> Therefore we enabled all interrupts instead of disabling them in the
>> beginning and later on masked the wrong interrupts.
>> Unclear how this worked on the Versatile Express, but this fix is
>> needed to get Calxeda Midway running (and works on VExpress, too).
>>
>> Signed-off-by: Andre Przywara <andre.przywara@linaro.org>
>> ---
>>   xen/drivers/char/pl011.c | 6 +++---
>>   1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/xen/drivers/char/pl011.c b/xen/drivers/char/pl011.c
>> index 05d034f..8e90520 100644
>> --- a/xen/drivers/char/pl011.c
>> +++ b/xen/drivers/char/pl011.c
>> @@ -87,7 +87,7 @@ static void __init pl011_init_preirq(struct serial_port *port)
>>       unsigned int divisor;
>>
>>       /* No interrupts, please. */
>> -    pl011_write(uart, IMSC, ALLI);
>> +    pl011_write(uart, IMSC, 0);
>>
>>       /* Definitely no DMA */
>>       pl011_write(uart, DMACR, 0x0);
>> @@ -115,7 +115,7 @@ static void __init pl011_init_preirq(struct serial_port *port)
>>       pl011_write(uart, RSR, 0);
>>
>>       /* Mask and clear the interrupts */
>> -    pl011_write(uart, IMSC, ALLI);
>> +    pl011_write(uart, IMSC, 0);
>>       pl011_write(uart, ICR, ALLI);
>>
>>       /* Enable the UART for RX and TX; no flow ctrl */
>> @@ -140,7 +140,7 @@ static void __init pl011_init_postirq(struct serial_port *port)
>>       pl011_write(uart, ICR, OEI|BEI|PEI|FEI);
>>
>>       /* Unmask interrupts */
>> -    pl011_write(uart, IMSC, RTI|DSRMI|DCDMI|CTSMI|RIMI);
>> +    pl011_write(uart, IMSC, OEI|BEI|PEI|FEI|TXI|RXI);
>>   }
>>
>>   static void pl011_suspend(struct serial_port *port)
>>
>

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

end of thread, other threads:[~2013-08-27 11:00 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-13 15:12 [PATCH] PL011: fix reverse logic for interrupt mask register Andre Przywara
2013-08-20 16:51 ` Andre Przywara
2013-08-21 10:04 ` Ian Campbell
2013-08-21 13:58   ` Andre Przywara
2013-08-21 14:27     ` Ian Campbell
2013-08-21 14:34     ` Ian Campbell
2013-08-21 16:11 ` Julien Grall
2013-08-22  7:23   ` Ian Campbell
2013-08-26 15:55     ` Julien Grall
2013-08-27 10:37       ` Ian Campbell
2013-08-27 10:45         ` Ian Campbell
2013-08-27 10:58           ` Julien Grall
2013-08-27 11:00             ` Ian Campbell
  -- strict thread matches above, loose matches on Subject: below --
2013-08-20 17:27 Ian Campbell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.