All of lore.kernel.org
 help / color / mirror / Atom feed
From: Malcolm Crossley <malcolm.crossley@citrix.com>
To: Ben Guthro <ben@guthro.net>
Cc: Jinsong Liu <jinsong.liu@intel.com>,
	Jan Beulich <JBeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: S3 resume issues
Date: Tue, 15 Jan 2013 18:17:39 +0000	[thread overview]
Message-ID: <50F59D43.9080304@citrix.com> (raw)
In-Reply-To: <CAOvdn6WpeRg7upBz4_O+NCnNn9ePAYUKzrU0WaXC7VxL99ynzg@mail.gmail.com>

On 15/01/13 18:10, Ben Guthro wrote:
> On Tue, Jan 15, 2013 at 7:55 AM, Ben Guthro <ben@guthro.net> wrote:
>> I'll continue down the rcu_check_callbacks() path, I guess.
> I believe I've found the culprit of the issue, but am unsure of what
> the proper solution is.
>
> It looks like after resume, on these newer machines, the ns16550
> registers contain all FF's - and so, the timer code was getting stuck
> in
> __ns16550_poll in the following stack:
>
> __ns16550_poll()
> execute_timer()
> timer_softirq_action()
> __do_softirq()
> process_pending_softirqs()
> rcu_barrier_action()
> rcu_barrier()
> enter_state()
>
> The while loop in this function was spinning, calling
> serial_rx_interrupt() over, and over again, since the LSR register was
> 0xFF
>
> A workaround seems to be to check some of the named registers at
> resume time, and bail out if they contain 0xFF's:
>
> diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
> index d77042e..b370581 100644
> --- a/xen/drivers/char/ns16550.c
> +++ b/xen/drivers/char/ns16550.c
> @@ -342,6 +342,15 @@ static void ns16550_resume(struct serial_port *port)
>                           PCI_COMMAND, uart->cr);
>       }
>
> +    if ( (((unsigned char)ns_read_reg(uart, LSR)) == 0xff) &&
> +         (((unsigned char)ns_read_reg(uart, MCR)) == 0xff) &&
> +         (((unsigned char)ns_read_reg(uart, IER)) == 0xff) &&
> +         (((unsigned char)ns_read_reg(uart, IIR)) == 0xff) &&
> +         (((unsigned char)ns_read_reg(uart, LCR)) == 0xff) ) {
> +        printk(KERN_ERR "ns16550 resume has bad register data!\n");
> +       return;
> +    }
> +
>       ns16550_setup_preirq(port->uart);
>       ns16550_setup_postirq(port->uart);
>   }
>
>
> This, of course means that you don't get any serial data after resume,
> which is not ideal.
>
>
> I'm going to try to figure out if there is any chipset (Panther Point)
> specific initialization that should be getting done.
> If you (or anyone else) has any other thoughts on this serial
> initialization, please let me know.
>
>
> Ben
You get 0xFF when there is nothing responding to the ioport. If the 
16550 is on a PCI card then it could be the PCI connection has not been 
setup again after the resume and you can't get to that ioport range.

Malcolm

  reply	other threads:[~2013-01-15 18:17 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-02 13:08 S3 resume issues Ben Guthro
2013-01-02 15:15 ` Malcolm Crossley
2013-01-02 15:31   ` Ben Guthro
2013-01-02 16:46     ` Ben Guthro
2013-01-02 20:35       ` Malcolm Crossley
2013-01-02 20:50         ` Ben Guthro
2013-01-03 10:19       ` Jan Beulich
2013-01-03 16:33         ` Ben Guthro
2013-01-03 17:08           ` Jan Beulich
2013-01-03 17:28             ` Ben Guthro
2013-01-03 21:26               ` Ben Guthro
2013-01-04  8:34                 ` Jan Beulich
2013-01-11 20:32                   ` Ben Guthro
2013-01-14 22:00                     ` Ben Guthro
2013-01-15  8:33                       ` Jan Beulich
2013-01-15 12:55                         ` Ben Guthro
2013-01-15 18:10                           ` Ben Guthro
2013-01-15 18:17                             ` Malcolm Crossley [this message]
2013-01-15 18:22                               ` Ben Guthro
2013-01-15 18:32                                 ` Malcolm Crossley
2013-01-15 18:38                                   ` Ben Guthro
2013-01-15 18:39                                     ` Malcolm Crossley
2013-01-16 16:16                                       ` Ben Guthro
2013-01-16  9:35                             ` Jan Beulich
     [not found]                               ` <CAOvdn6V6N1V9ZYbARTJPEgSvxPe83pSiO6TmxBLy1LJEkods6A@mail.gmail.com>
2013-01-16 10:57                                 ` Jan Beulich
2013-01-16 11:05                                   ` Ben Guthro
2013-01-16 11:09                                     ` Jan Beulich
2013-01-16 11:17                                       ` Ben Guthro
2013-01-02 17:14     ` Pasi Kärkkäinen
2013-01-02 17:20       ` Ben Guthro
2013-01-16  2:18 ` Tomasz Wroblewski

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=50F59D43.9080304@citrix.com \
    --to=malcolm.crossley@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=ben@guthro.net \
    --cc=jinsong.liu@intel.com \
    --cc=xen-devel@lists.xen.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.