Hi Greg,

It looks like several stable trees are missing this commit:

commit fb3d85bc7193f23c9a564502df95564c49a32c91
Author: Sarah Sharp <[email protected]>
Date:   Fri Mar 16 13:27:39 2012 -0700

    xhci: Restore event ring dequeue pointer on resume.
    
    The xhci_save_registers() function saved the event ring dequeue pointer
    in the s3 register structure, but xhci_restore_registers() never
    restored it.  No other code in the xHCI successful resume path would
    ever restore it either.  Fix that.
    
    This should be backported to kernels as old as 2.6.37, that contain the
    commit 5535b1d5f8885695c6ded783c692e3c0d0eda8ca "USB: xHCI: PCI power
    management implementation".
    
    Signed-off-by: Sarah Sharp <[email protected]>
    Tested-by: Elric Fu <[email protected]>
    Cc: Andiry Xu <[email protected]>
    Cc: [email protected]

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index f68bc15..d2222dc 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -684,6 +684,7 @@ static void xhci_restore_registers(struct xhci_hcd *xhci)
        xhci_writel(xhci, xhci->s3.irq_control, &xhci->ir_set->irq_control);
        xhci_writel(xhci, xhci->s3.erst_size, &xhci->ir_set->erst_size);
        xhci_write_64(xhci, xhci->s3.erst_base, &xhci->ir_set->erst_base);
+       xhci_write_64(xhci, xhci->s3.erst_dequeue, &xhci->ir_set->erst_dequeue);
 }
 
 static void xhci_set_cmd_ring_deq(struct xhci_hcd *xhci)

Once you apply commit fb3d85bc, then commit c7713e7 applies cleanly.

I'm not sure exactly how fb3d85bc missed being applied to stable, or if
there are other xHCI stable patches missing.  I can go through the
patches I submitted that were marked for stable if you think there might
be more patches missing.

Sarah Sharp

On Tue, Apr 17, 2012 at 04:57:17PM -0700, [email protected] wrote:
> 
> The patch below does not apply to the 3.3-stable tree.
> If someone wants it applied there, or to any other stable or longterm
> tree, then please email the backport, including the original git commit
> id to <[email protected]>.
> 
> thanks,
> 
> greg k-h
> 
> ------------------ original commit in Linus's tree ------------------
> 
> From c7713e736526d8c9f6f87716fb90562a8ffaff2c Mon Sep 17 00:00:00 2001
> From: Sarah Sharp <[email protected]>
> Date: Fri, 16 Mar 2012 13:19:35 -0700
> Subject: [PATCH] xhci: Fix register save/restore order.
> 
> The xHCI 1.0 spec errata released on June 13, 2011, changes the ordering
> that the xHCI registers are saved and restored in.  It moves the
> interrupt pending (IMAN) and interrupt control (IMOD) registers to be
> saved and restored last.  I believe that's because the host controller
> may attempt to fetch the event ring table when interrupts are
> re-enabled.  Therefore we need to restore the event ring registers
> before we re-enable interrupts.
> 
> This should be backported to kernels as old as 2.6.37, that contain the
> commit 5535b1d5f8885695c6ded783c692e3c0d0eda8ca "USB: xHCI: PCI power
> management implementation"
> 
> Signed-off-by: Sarah Sharp <[email protected]>
> Tested-by: Elric Fu <[email protected]>
> Cc: Andiry Xu <[email protected]>
> Cc: [email protected]
> 
> diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
> index d2222dc..36641a7 100644
> --- a/drivers/usb/host/xhci.c
> +++ b/drivers/usb/host/xhci.c
> @@ -667,11 +667,11 @@ static void xhci_save_registers(struct xhci_hcd *xhci)
>       xhci->s3.dev_nt = xhci_readl(xhci, &xhci->op_regs->dev_notification);
>       xhci->s3.dcbaa_ptr = xhci_read_64(xhci, &xhci->op_regs->dcbaa_ptr);
>       xhci->s3.config_reg = xhci_readl(xhci, &xhci->op_regs->config_reg);
> -     xhci->s3.irq_pending = xhci_readl(xhci, &xhci->ir_set->irq_pending);
> -     xhci->s3.irq_control = xhci_readl(xhci, &xhci->ir_set->irq_control);
>       xhci->s3.erst_size = xhci_readl(xhci, &xhci->ir_set->erst_size);
>       xhci->s3.erst_base = xhci_read_64(xhci, &xhci->ir_set->erst_base);
>       xhci->s3.erst_dequeue = xhci_read_64(xhci, &xhci->ir_set->erst_dequeue);
> +     xhci->s3.irq_pending = xhci_readl(xhci, &xhci->ir_set->irq_pending);
> +     xhci->s3.irq_control = xhci_readl(xhci, &xhci->ir_set->irq_control);
>  }
>  
>  static void xhci_restore_registers(struct xhci_hcd *xhci)
> @@ -680,11 +680,11 @@ static void xhci_restore_registers(struct xhci_hcd 
> *xhci)
>       xhci_writel(xhci, xhci->s3.dev_nt, &xhci->op_regs->dev_notification);
>       xhci_write_64(xhci, xhci->s3.dcbaa_ptr, &xhci->op_regs->dcbaa_ptr);
>       xhci_writel(xhci, xhci->s3.config_reg, &xhci->op_regs->config_reg);
> -     xhci_writel(xhci, xhci->s3.irq_pending, &xhci->ir_set->irq_pending);
> -     xhci_writel(xhci, xhci->s3.irq_control, &xhci->ir_set->irq_control);
>       xhci_writel(xhci, xhci->s3.erst_size, &xhci->ir_set->erst_size);
>       xhci_write_64(xhci, xhci->s3.erst_base, &xhci->ir_set->erst_base);
>       xhci_write_64(xhci, xhci->s3.erst_dequeue, &xhci->ir_set->erst_dequeue);
> +     xhci_writel(xhci, xhci->s3.irq_pending, &xhci->ir_set->irq_pending);
> +     xhci_writel(xhci, xhci->s3.irq_control, &xhci->ir_set->irq_control);
>  }
>  
>  static void xhci_set_cmd_ring_deq(struct xhci_hcd *xhci)
> 
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to