All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
To: Marc St-Jean <Marc_St-Jean@pmc-sierra.com>
Cc: linux-mips@linux-mips.org
Subject: Re: [PATCH 6/12] drivers: PMC MSP71xx serial driver
Date: Tue, 27 Mar 2007 22:48:05 +0400	[thread overview]
Message-ID: <460966E5.10109@ru.mvista.com> (raw)
In-Reply-To: <460963FB.9090101@pmc-sierra.com>

Hello.

Marc St-Jean wrote:

>> > diff --git a/arch/mips/pmc-sierra/msp71xx/msp_serial.c 
>>b/arch/mips/pmc-sierra/msp71xx/msp_serial.c
>> > new file mode 100644
>> > index 0000000..3b956e9
>> > --- /dev/null
>> > +++ b/arch/mips/pmc-sierra/msp71xx/msp_serial.c
>> > @@ -0,0 +1,185 @@
>>[...]
>> > +#ifdef CONFIG_KGDB
>> > +/*
>> > + * kgdb uses serial port 1 so the console can remain on port 0.
>> > + * To use port 0 change the definition to read as follows:
>> > + * #define DEBUG_PORT_BASE KSEG1ADDR(MSP_UART0_BASE)
>> > + */
>> > +#define DEBUG_PORT_BASE KSEG1ADDR(MSP_UART1_BASE)
>> > +
>> > +int putDebugChar(char c)
>> > +{
>> > +     volatile uint32_t *uart = (volatile uint32_t *)DEBUG_PORT_BASE;
>> > +     uint32_t val = (uint32_t)c;
>> > +
>> > +     local_irq_disable();
>> > +     while (!(uart[5] & 0x20)); /* Wait for TXRDY */
>> > +     uart[0] = val;
>> > +     while (!(uart[5] & 0x20)); /* Wait for TXRDY */
>> > +     local_irq_enable();

>>    Gah, why you decided to put local_irq_enable() there?!  KGDB expects
>>interrupts to be *disabled* while it has control, else some subtle state
>>corruptions will ensue, and it will eventually lock up. Please remove 
>>these 2 calls completely.

> Hmmm, this has been working for several months. I'll remove, retest and
> resubmit.

    I should probably have said "may".  From my experience with KGDBoE though 
(well, it's somewhat different KGDB implementation :-) it locks up pretty 
quickly because of local_irq_enable() or spin_unlock_irq().  Nevertheless, 
enabling interrupts while KGDB has control is undesirable.  And look at the 
other KGDB serial code inarch/mips/ -- nobody else does this.

> Are you aware if this is the case for the "putchar" used by early_printk
> as well?

    No idea, ask Ralf. ;-)

> Thanks,
> Marc

WBR, Sergei

  reply	other threads:[~2007-03-27 18:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-27 18:35 [PATCH 6/12] drivers: PMC MSP71xx serial driver Marc St-Jean
2007-03-27 18:48 ` Sergei Shtylyov [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-03-27 21:07 Marc St-Jean
2007-03-27 20:56 Marc St-Jean
2007-03-26 21:59 Marc St-Jean
2007-03-27 14:30 ` Sergei Shtylyov
2007-03-16 21:38 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=460966E5.10109@ru.mvista.com \
    --to=sshtylyov@ru.mvista.com \
    --cc=Marc_St-Jean@pmc-sierra.com \
    --cc=linux-mips@linux-mips.org \
    /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 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.