timers and busy detection

Oliver Neukum <[email protected]>
Newsgroups gmane.linux.usb.devel
Organization Novell
Message-ID <[email protected]>
Hi,

I'd like to make the following change to autosuspend:

--- linux-2.6.21-rc4-git6/include/linux/usb.h.alt	2007-03-22 14:26:26.000000000 +0100
+++ linux-2.6.21-rc4-git6/include/linux/usb.h	2007-03-22 14:28:18.000000000 +0100
@@ -155,6 +155,9 @@
 	struct device dev;		/* interface specific device info */
 	struct device *usb_dev;		/* pointer to the usb class's device, if any */
 	int pm_usage_cnt;		/* usage counter for autosuspend */
+	spinlock_t			suspend_time_lock;
+	unsigned long			last_busy;
+	unsigned long			last_elevated;
 };
 #define	to_usb_interface(d) container_of(d, struct usb_interface, dev)
 #define	interface_to_usbdev(intf) \

To avoid manipulating timers in autosuspend for usb storage, I propose
that the timer is killed only if autosuspend_delay > jiffies - last_elevated.
Otherwise it is kept running and last_busy can be used to calculate whether
enough time has elapsed.

Might it be sensible to fire up a timer for longer than autosuspend_delay if
the check fails often?

	Regards
		Oliver
-- 
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
This signature is a legal requirement

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.