Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753664Ab3EMOPf (ORCPT ); Mon, 13 May 2013 10:15:35 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:56385 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751846Ab3EMOPd (ORCPT ); Mon, 13 May 2013 10:15:33 -0400 Date: Mon, 13 May 2013 10:15:32 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: linux fddl cc: linux-usb@vger.kernel.org, , Subject: Re: usb: why we need a msleep(5) in ehci_bus_suspend/resume In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1117 Lines: 36 On Mon, 13 May 2013, linux fddl wrote: > Hi, > > From the ehci-hub.c, I find that ehci_bus_suspend/resume have some > code like this: > > if (time_before(jiffies, ehci->netx_statechange)) > msleep(5); > ... > ehci->next_statechange = jiffies + msec_to_jiffies(10); > > and > > if (time_before(jiffies, ehci->netx_statechange)) > msleep(5); > ... > ehci->next_statechange = jiffies + msec_to_jiffies(5); > > but I don't know why such a short sleep is needed, and why one is > [ehci->next_statechange = jiffies + msec_to_jiffies(10)] and the other is > [ehci->next_statechange = jiffies + msec_to_jiffies(5)], > I googled for a long time, but it seems that there is no explanation. > > Anyone knows why and can give any explanation? At this point I don't think anybody knows. The person who originally wrote that code died a few years ago. Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/