Skip to contentSkip to conversation

serial driver PMC MSP71xx, kernel linux-mips.git mast er

PATCH Marc St-Jean 2 participants 2 messages Feb 9, 2007 – Feb 10, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw
Quoted 21 lines · Sergei Shtylyov
Quoted 1 line · Marc St-Jean

Fourth attempt at the serial driver patch for the PMC-Sierra MSP71xx

device.

Quoted 9 lines

There are three different fixes:
1. Fix for DesignWare THRE errata
- Dropped our fix since the "8250-uart-backup-timer.patch" in the "mm" tree also fixes it. This patch needs to be applied on top of "mm" patch.

2. Fix for Busy Detect on LCR write
- Changed the ordering of test in serial8250_interrupt().
- Combined test for UPIO_DWAPB with UPIO_MEM in

serial8250_start_console().

Quoted 8 lines

- Renamed new uart_8250_port member to private_data.

3. Workaround for interrupt/data concurrency issue
- No changes since last patch.

(quoted diff) +0 -0
@@ -1383,6 +1399,19 @@ static irqreturn_t serial8250_interrupt(
                      handled = 1;
 
Quoted 6 lines

Review static irqreturn_t serial8250_interrupt( · line 1403

Quoted 3 lines
(quoted diff) +2 -0
                      end = NULL;
+             } else if (up->port.iotype == UPIO_DWAPB &&
+                             (iir & UART_IIR_BUSY) == UART_IIR_BUSY) {

Worth aligning this line with the opening paren of if... but's that's
nitpicking. :-)

No problem I'll change it. I just usually align to the closest tab stop to the opening parenthesis.

Quoted 18 lines

Review static irqreturn_t serial8250_interrupt( · line 1404

Quoted 1 line
(quoted diff) +1 -0
+                     /* The DesignWare APB UART has an Busy Detect 

(0x07)

Review static irqreturn_t serial8250_interrupt( · line 1405

Quoted 1 line
(quoted diff) +1 -0
+                      * interrupt meaning an LCR write attempt 

occured while the

Review static irqreturn_t serial8250_interrupt( · line 1406

Quoted 1 line
(quoted diff) +1 -0
+                      * UART was busy. The interrupt must be cleared 

by reading

Review static irqreturn_t serial8250_interrupt( · line 1407

Quoted 1 line
(quoted diff) +1 -0
+                      * the UART status register (USR) and the LCR 

re-written. */

Quoted 10 lines
(quoted diff) +7 -0
+                     unsigned int status;
+                     status = *(volatile u32 *)up->port.private_data;
+                     serial_out(up, UART_LCR, up->lcr);
+
+                     handled = 1;
+
+                     end = NULL;
              } else if (end == NULL)
                      end = l;
 
Quoted 3 lines
Quoted 1 line
      return 0;

Still, shouldn't you be doing this in serial8250_timeout()

No, the serial8250_timeout is for issue 1 at the top, this is for issue 2.

Quoted 2 lines

also?
What IRQ numbers this UART is using, BTW?

For the ports on the device they are 27 and 42. Is there any significance that I'm not aware of?

Quoted 7 lines

include/linux/serial_core.h #define UPF_USR_MASK ((__force upf_t) ( · line 277

Quoted 6 lines
include/linux/serial_core.h +0 -0
index cf23813..bd9711a 100644
@@ -276,6 +277,7 @@ #define UPF_USR_MASK              ((__force upf_t) (
      struct device           *dev;                   /* parent 

device */

Quoted 7 lines

include/linux/serial_core.h #define UPF_USR_MASK ((__force upf_t) ( · line 278

Quoted 1 line
include/linux/serial_core.h +0 -0
      unsigned char           hub6;                   /* this should 

be in the 8250 driver */

include/linux/serial_core.h #define UPF_USR_MASK ((__force upf_t) ( · line 280

Quoted 2 lines
include/linux/serial_core.h +1 -0
      unsigned char           unused[3];
+     void                            *private_data;          /* 

generic platform data pointer */

One tab to many before *private_data...

In my editor using 4 columns per tab it lines up with everything. Is there some convention that patches should be made assuming 8 columns?

Quoted 9 lines

include/linux/serial_reg.h #define UART_IIR_THRI 0x02 /* Transmitt · line 39

Quoted 7 lines
include/linux/serial_reg.h +0 -0
index 3c8a6aa..1c5ed7d 100644
@@ -38,6 +38,8 @@ #define UART_IIR_THRI               0x02 /* Transmitt
  #define UART_IIR_RDI                0x04 /* Receiver data interrupt */
  #define UART_IIR_RLSI               0x06 /* Receiver line status 

interrupt */

Quoted 1 line
Quoted 8 lines
Quoted 1 line

+#define UART_IIR_BUSY 0x07 /* DesignWare APB Busy

Detect */

Quoted 4 lines

+
#define UART_FCR 2 /* Out: FIFO Control Register */
#define UART_FCR_ENABLE_FIFO 0x01 /* Enable the FIFO */
#define UART_FCR_CLEAR_RCVR 0x02 /* Clear the RCVR FIFO */

Oops, your mailer went and did it again. :-)

I'm completely giving up on Thunderbird,unless someone can point out the specific internal configuration items which needs a kick!

Thanks,
Marc

#1 lore raw

Hello.

Quoted 7 lines · Marc St-Jean
Quoted 7 lines
Quoted 1 line

Fourth attempt at the serial driver patch for the PMC-Sierra MSP71xx

device.

Quoted 4 lines

There are three different fixes:
1. Fix for DesignWare THRE errata
- Dropped our fix since the "8250-uart-backup-timer.patch" in the "mm" tree also fixes it. This patch needs to be applied on top of "mm" patch.

I think you need to submit your patch to Andrew Morton since it requires a
patch from his tree.

Quoted 10 lines
Quoted 9 lines

Review static irqreturn_t serial8250_interrupt( · line 1403

Quoted 6 lines
(quoted diff) +2 -0
@@ -1383,6 +1399,19 @@ static irqreturn_t serial8250_interrupt(
                      handled = 1;
 
                      end = NULL;
+             } else if (up->port.iotype == UPIO_DWAPB &&
+                             (iir & UART_IIR_BUSY) == UART_IIR_BUSY) {

Worth aligning this line with the opening paren of if... but's that's
nitpicking. :-)

Quoted 2 lines

No problem I'll change it. I just usually align to the closest tab stop to the opening parenthesis.

It haven't really changed in the last patch. :-)

Quoted 18 lines
Quoted 18 lines

Review static irqreturn_t serial8250_interrupt( · line 1404

Quoted 1 line
(quoted diff) +1 -0
+                     /* The DesignWare APB UART has an Busy Detect 

(0x07)

Review static irqreturn_t serial8250_interrupt( · line 1405

Quoted 1 line
(quoted diff) +1 -0
+                      * interrupt meaning an LCR write attempt 

occured while the

Review static irqreturn_t serial8250_interrupt( · line 1406

Quoted 1 line
(quoted diff) +1 -0
+                      * UART was busy. The interrupt must be cleared 

by reading

Review static irqreturn_t serial8250_interrupt( · line 1407

Quoted 1 line
(quoted diff) +1 -0
+                      * the UART status register (USR) and the LCR 

re-written. */

Quoted 10 lines
(quoted diff) +7 -0
+                     unsigned int status;
+                     status = *(volatile u32 *)up->port.private_data;
+                     serial_out(up, UART_LCR, up->lcr);
+
+                     handled = 1;
+
+                     end = NULL;
              } else if (end == NULL)
                      end = l;
 
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
      return 0;

Still, shouldn't you be doing this in serial8250_timeout()

No, the serial8250_timeout is for issue 1 at the top, this is for issue 2.

It's for lost interrupts, IIUC. They use anothe timeout handler for the
workaround...

Quoted 5 lines
Quoted 2 lines

also?
What IRQ numbers this UART is using, BTW?

For the ports on the device they are 27 and 42. Is there any significance that I'm not aware of?

Yeah, IRQ0 is treated as no IRQ by 8250, and in this case it falls back to
using serial8250_timeout() to handle "interrupts".

Quoted 9 lines
Quoted 9 lines

include/linux/serial_core.h #define UPF_USR_MASK ((__force upf_t) ( · line 277

Quoted 6 lines
include/linux/serial_core.h +0 -0
index cf23813..bd9711a 100644
@@ -276,6 +277,7 @@ #define UPF_USR_MASK              ((__force upf_t) (
      struct device           *dev;                   /* parent 

device */

include/linux/serial_core.h #define UPF_USR_MASK ((__force upf_t) ( · line 278

Quoted 1 line
include/linux/serial_core.h +0 -0
      unsigned char           hub6;                   /* this should 

be in the 8250 driver */

Quoted 8 lines
Quoted 5 lines

include/linux/serial_core.h #define UPF_USR_MASK ((__force upf_t) ( · line 280

Quoted 2 lines
include/linux/serial_core.h +1 -0
      unsigned char           unused[3];
+     void                            *private_data;          /* 

generic platform data pointer */

One tab to many before *private_data...

In my editor using 4 columns per tab it lines up with everything. Is there some convention that patches should be made assuming 8 columns?

Documentation/CodingStyle, chapter 1. :-)

Quoted 3 lines
Quoted 1 line

Oops, your mailer went and did it again. :-)

I'm completely giving up on Thunderbird,unless someone can point out

Ypu should have long ago. :-)

Quoted 1 line

the specific internal configuration items which needs a kick!

Only the attachments will work in the Mozilla kind mailer, AFAIK.
The last patch looked OK at last. :-)

Quoted 2 lines

Thanks,
Marc

WBR, Sergei