linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
To: Marc St-Jean <Marc_St-Jean@pmc-sierra.com>
Cc: Marc St-Jean <stjeanma@pmc-sierra.com>,
	akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
	linux-mips@linux-mips.org, linux-serial@vger.kernel.org
Subject: Re: [PATCH] serial driver PMC MSP71xx, kernel linux-mips.git mast er
Date: Fri, 16 Feb 2007 20:21:31 +0300	[thread overview]
Message-ID: <45D5E81B.7030304@ru.mvista.com> (raw)
In-Reply-To: <45D5E4A7.3070807@pmc-sierra.com>

Hello.

Marc St-Jean wrote:

>> > diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
>> > index 3d91bfc..bfaacc5 100644
>> > --- a/drivers/serial/8250.c
>> > +++ b/drivers/serial/8250.c
>> > @@ -308,6 +308,7 @@ static unsigned int serial_in(struct uar
>> >               return inb(up->port.iobase + 1);
>> > 
>> >       case UPIO_MEM:
>> > +     case UPIO_DWAPB:
>> >               return readb(up->port.membase + offset);
>> > 
>> >       case UPIO_MEM32:
>> > @@ -333,6 +334,8 @@ #endif
>> >  static void
>> >  serial_out(struct uart_8250_port *up, int offset, int value)
>> >  {
>> > +     /* Save the offset before it's remapped */
>> > +     int save_offset = offset;
>> >       offset = map_8250_out_reg(up, offset) << up->port.regshift;
>> > 
>> >       switch (up->port.iotype) {

>>    I've just got an idea how to "beautify" this code -- rename the 
>>'offset'
>>arg to something like reg, and then declare/init 'offset' as local 
>>variable.
>>Would certainly look better (and worth doing in all serial_* accessros).

> I agree but am having enough of a hard time getting the bare minimum
> accepted that I don't dare touch any unnecessary lines.

    Well, I can try pushing this simple cleanup myself... seems worth doing 
for alike future cases anyway.

>> > @@ -359,6 +362,18 @@ #endif
>> >                       writeb(value, up->port.membase + offset);
>> >               break;
>> > 
>> > +     case UPIO_DWAPB:
>> > +             /* Save the LCR value so it can be re-written when a
>> > +              * Busy Detect interrupt occurs. */
>> > +             if (save_offset == UART_LCR)
>> > +                     up->lcr = value;
>> > +             writeb(value, up->port.membase + offset);
>> > +             /* Read the IER to ensure any interrupt is cleared before
>> > +              * returning from ISR. */
>> > +             if (save_offset == UART_TX || save_offset == UART_IER)
>> > +                     value = serial_in(up, UART_IER);
>> > +             break;
>> > +            
>> >       default:
>> >               outb(value, up->port.iobase + offset);
>> >       }
>> > @@ -2454,8 +2485,8 @@ int __init serial8250_start_console(stru
>> > 
>> >       add_preferred_console("ttyS", line, options);
>> >       printk("Adding console on ttyS%d at %s 0x%lx (options '%s')\n",
>> > -             line, port->iotype == UPIO_MEM ? "MMIO" : "I/O port",
>> > -             port->iotype == UPIO_MEM ? (unsigned long) port->mapbase :
>> > +             line, port->iotype >= UPIO_MEM ? "MMIO" : "I/O port",
>> > +             port->iotype >= UPIO_MEM ? (unsigned long) port->mapbase :
>> >                   (unsigned long) port->iobase, options);
>> >       if (!(serial8250_console.flags & CON_ENABLED)) {
>> >               serial8250_console.flags &= ~CON_PRINTBUFFER;

>>    I've remembered why I decided not to fix it: this code only gets called
>>from 8250__eraly.c which can't handle anything beyond UPIO_MEM anyway.

> We don't use 8250_early and I've tested it works without, so I'll drop this
> change.

    No need I guess since this is the Right Thing (TM) anyway.

> Thanks,
> Marc

WBR, Sergei

  reply	other threads:[~2007-02-16 17:21 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-16 17:06 [PATCH] serial driver PMC MSP71xx, kernel linux-mips.git mast er Marc St-Jean
2007-02-16 17:21 ` Sergei Shtylyov [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-02-16 16:30 Marc St-Jean
2007-02-13 22:11 Marc St-Jean
2007-02-12 17:46 Marc St-Jean
2007-02-12 17:56 ` Sergei Shtylyov
2007-02-09 19:39 Marc St-Jean
2007-02-10 17:30 ` Sergei Shtylyov
2007-02-07 20:50 Marc St-Jean
2007-02-06 16:52 Marc St-Jean
2007-01-27  0:28 Marc St-Jean
2007-01-25 23:10 Marc St-Jean
2007-01-26 13:58 ` Sergei Shtylyov
2007-01-24 21:10 Marc St-Jean
2007-01-25 14:29 ` Sergei Shtylyov
2007-01-24 16:48 Marc St-Jean
2007-01-24 20:38 ` Sergei Shtylyov
2007-01-24 16:40 Marc St-Jean
2007-01-24 19:40 ` Sergei Shtylyov
2007-01-23 22:37 Marc St-Jean
2007-01-23 23:41 ` Alan
2007-01-24 15:33 ` Sergei Shtylyov
2007-01-22 20:35 Marc St-Jean
2007-01-22 20:34 Marc St-Jean
2007-01-22 19:07 Marc St-Jean

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45D5E81B.7030304@ru.mvista.com \
    --to=sshtylyov@ru.mvista.com \
    --cc=Marc_St-Jean@pmc-sierra.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=stjeanma@pmc-sierra.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).