Skip to contentSkip to conversation

Fixes autosuspend and auto_pm fields missing

PATCH In review Felipe Balbi 3 participants 4 messages Oct 31, 2006 – Nov 1, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fixes autosuspend and auto_pm fields missing

This small patch changes omap_h3_1710_defconfig to fix the bug.

The catch is: for struct usb_device to have the fields struct work_struct autosuspend and unsigned autopm:1 CONFIG_PM should be set "y".

make uImage
CHK include/linux/version.h
make[1]: `include/asm-arm/mach-types.h' is up to date.

 CHK     include/linux/utsrelease.h
 CHK     include/linux/compile.h
 CC      drivers/usb/core/usb.o

drivers/usb/core/usb.c: In function 'usb_release_dev':
drivers/usb/core/usb.c:177: error: 'struct usb_device' has no member named 'autosuspend' drivers/usb/core/usb.c: In function 'usb_autosuspend_work':
drivers/usb/core/usb.c:218: error: 'struct usb_device' has no member named 'auto_pm' drivers/usb/core/usb.c:219: warning: statement with no effect
make[3]: *** [drivers/usb/core/usb.o] Error 1
make[2]: *** [drivers/usb/core] Error 2
make[1]: *** [drivers/usb] Error 2
make: *** [drivers] Error 2

Signature · 5 lines
Best Regards,

Felipe Balbi
[email protected]
OSMRC - INdT
include/linux/usb.h +2 -2
Index: linux-omap-2.6-dev/include/linux/usb.h
===================================================================
@@ -381,13 +381,13 @@ struct usb_device {
 	struct usb_device *children[USB_MAXCHILDREN];
 
 	int pm_usage_cnt;		/* usage counter for autosuspend */
-#ifdef CONFIG_PM
+/* #ifdef CONFIG_PM */
 	struct work_struct autosuspend;	/* for delayed autosuspends */
 	struct mutex pm_mutex;		/* protects PM operations */
 
 	unsigned auto_pm:1;		/* autosuspend/resume in progress */
 	unsigned do_remote_wakeup:1;	/* remote wakeup should be enabled */
-#endif
+/* #endif */
 };
 #define	to_usb_device(d) container_of(d, struct usb_device, dev)
 
#1 lore raw

PATCH 1/1 Fixes autosuspend and auto_pm fields missing

Please forget about the other patch... this is the right one...

sorry guys

Quoted 22 lines · ext Felipe Balbi

This small patch changes omap_h3_1710_defconfig to fix the bug.

The catch is: for struct usb_device to have the fields struct work_struct autosuspend and unsigned autopm:1 CONFIG_PM should be set "y".

make uImage
CHK include/linux/version.h
make[1]: `include/asm-arm/mach-types.h' is up to date.

 CHK     include/linux/utsrelease.h
 CHK     include/linux/compile.h
 CC      drivers/usb/core/usb.o

drivers/usb/core/usb.c: In function 'usb_release_dev':
drivers/usb/core/usb.c:177: error: 'struct usb_device' has no member named 'autosuspend' drivers/usb/core/usb.c: In function 'usb_autosuspend_work':
drivers/usb/core/usb.c:218: error: 'struct usb_device' has no member named 'auto_pm' drivers/usb/core/usb.c:219: warning: statement with no effect
make[3]: *** [drivers/usb/core/usb.o] Error 1
make[2]: *** [drivers/usb/core] Error 2
make[1]: *** [drivers/usb] Error 2
make: *** [drivers] Error 2

Signature · 5 lines
Best Regards,

Felipe Balbi
[email protected]
OSMRC - INdT
arch/arm/configs/omap_h3_1710_defconfig +1 -1
Index: linux-omap-2.6-dev/arch/arm/configs/omap_h3_1710_defconfig
===================================================================
@@ -223,7 +223,7 @@ CONFIG_BINFMT_AOUT=y
 #
 # Power management options
 #
-# CONFIG_PM is not set
+CONFIG_PM=y
 
 #
 # Networking
#2 lore raw
In reply to Felipe Balbi

Hi David,

Quoted 7 lines · Felipe Balbi

CC drivers/usb/core/usb.o
drivers/usb/core/usb.c: In function 'usb_release_dev':
drivers/usb/core/usb.c:177: error: 'struct usb_device' has no member named 'autosuspend' drivers/usb/core/usb.c: In function 'usb_autosuspend_work':
drivers/usb/core/usb.c:218: error: 'struct usb_device' has no member named 'auto_pm' drivers/usb/core/usb.c:219: warning: statement with no effect
make[3]: *** [drivers/usb/core/usb.o] Error 1

do we have a mismatch here between usage of CONFIG_PM in include/linux/usb.h and CONFIG_USB_SUSPEND in usb/core/usb.c if CONFIG_PM isn't set for OMAP?

Cheers

Dirk

include/linux/usb.h:

#ifdef CONFIG_PM
struct work_struct autosuspend; /* for delayed autosuspends */
struct mutex pm_mutex; /* protects PM operations */

unsigned auto_pm:1; /* autosuspend/resume in progress */
unsigned do_remote_wakeup:1; /* remote wakeup should be
enabled */
#endif

usb/core/usb.c line ~177:

#ifdef	CONFIG_USB_SUSPEND
	cancel_delayed_work(&udev->autosuspend);

...
#endif

usb/core/usb.c line ~218:

#ifdef CONFIG_USB_SUSPEND
...

	udev->auto_pm = 1;

...

#3 lore raw
Quoted 3 lines · Dirk Behme

do we have a mismatch here between usage of CONFIG_PM in include/linux/usb.h and CONFIG_USB_SUSPEND in usb/core/usb.c if CONFIG_PM isn't set for OMAP?

We have a case of patches not getting into the OMAP tree yet; I'm not sure if they've been merged into kernel.org yet.

Alan, this tree is at ~RC3 ... is this fix in the main kernel GIT tree yet, or just in MM?

- Dave