Re: [RFC]avoid running out of endpoints with multiple S4

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 04, 2012 at 09:05:56AM -0700, Sarah Sharp wrote:
> On Fri, May 04, 2012 at 03:09:00PM +0200, Oliver Neukum wrote:
> > Hi,
> > 
> > I am experiencing the kernel on PantherPoint still running out of endpoints.
> > It runs into the error case of xhci_reserve_host_control_ep_resources()
> > It seems to me that for whatever reason a HC is reinitialized, the number of active
> > endpoints should be reset to zero. That fixes the issue. What do you think?
> 
> A while back, you reported that endpoint contexts were not getting
> removed on a resume from hibernate.  Is this bug related?  I.e. is there
> code in the hibernate resume path that isn't cleaning up after the
> endpoint and bandwidth tracking code?  I would rather fix the issue at
> the resume than paper over it on re-init.

It looks like xhci_resume() will call xhci_mem_cleanup() on resume from
S4 or power loss on resume from S3.  That will only free the xhci->rh_bw
table, but it won't actually go through the TT or endpoint lists that
are stored in that table and delete the items from those lists.  So we
are leaking memory from the lists in xhci_mem_cleanup(), as well as not
setting xhci->num_active_eps to zero.

I will attempt to look at this next week, but if you have time to look
at it, you might be able to come up with a patch sooner than I can.

Sarah Sharp

> > From 2ddb4ea9255e59d92515193aa21a536a4e14e50c Mon Sep 17 00:00:00 2001
> > From: Oliver Neukum <oliver@xxxxxxxxxx>
> > Date: Fri, 4 May 2012 14:28:18 +0200
> > Subject: [PATCH] xhci: fix counting of active endpoints
> > 
> > The number of active endpoints should be zeroed
> > when the HCD is reinitialized, because it is not predictable
> > in which state the controller had been stopped.
> > 
> > Signed-off-by: Oliver Neukum <oneukum@xxxxxxx>
> > ---
> >  drivers/usb/host/xhci.c |    1 +
> >  1 files changed, 1 insertions(+), 0 deletions(-)
> > 
> > diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
> > index 36641a7..e7842cb 100644
> > --- a/drivers/usb/host/xhci.c
> > +++ b/drivers/usb/host/xhci.c
> > @@ -410,6 +410,7 @@ int xhci_init(struct usb_hcd *hcd)
> >  		xhci_dbg(xhci, "xHCI doesn't need link TRB QUIRK\n");
> >  	}
> >  	retval = xhci_mem_init(xhci, GFP_KERNEL);
> > +	xhci->num_active_eps = 0;
> >  	xhci_dbg(xhci, "Finished xhci_init\n");
> >  
> >  	return retval;
> > -- 
> > 1.7.1
> > 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux