diff options
author | Ramneek Mehresh <ramneek.mehresh@freescale.com> | 2015-03-23 12:49:52 (GMT) |
---|---|---|
committer | Honghua Yin <Hong-Hua.Yin@freescale.com> | 2015-04-30 00:44:39 (GMT) |
commit | 3231fc3c1d23399f6c6ba4189992671504653daf (patch) | |
tree | 7d5e649a6736c7083a63b84ce9bb93473c3a6964 /arch/powerpc/platforms | |
parent | 643a1e03bf9c7a62044ea9380d6e82f1971f6e44 (diff) | |
download | linux-fsl-qoriq-3231fc3c1d23399f6c6ba4189992671504653daf.tar.xz |
powerpc:rcpm:usb: Fix kernel crash in setting usb as wakeup source
Fix kernel crash issue in setting usb as wake-up source for system
sleep feature for relevant qoriq platforms (those supporting system
sleep via rcpm)
Signed-off-by: Ramneek Mehresh <ramneek.mehresh@freescale.com>
Change-Id: I838234aff00800b6fafbb02ec12de7d3f2cc6075
Reviewed-on: http://git.am.freescale.net:8181/33283
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Honghua Yin <Hong-Hua.Yin@freescale.com>
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r-- | arch/powerpc/platforms/85xx/qoriq_pm.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/85xx/qoriq_pm.c b/arch/powerpc/platforms/85xx/qoriq_pm.c index f1ec1bd..147656b 100644 --- a/arch/powerpc/platforms/85xx/qoriq_pm.c +++ b/arch/powerpc/platforms/85xx/qoriq_pm.c @@ -14,6 +14,7 @@ #include <linux/kernel.h> #include <linux/suspend.h> #include <linux/of_platform.h> +#include <linux/usb.h> #include <asm/fsl_pm.h> @@ -42,7 +43,17 @@ void fsl_set_power_except(struct device *dev, int on) struct device_node *mac_node; int ret; - ret = of_property_read_u32_array(dev->of_node, "sleep", value, 2); + if (dev && !strncmp(dev->bus->name, "usb", 3)) { + struct usb_device *udev = container_of(dev, + struct usb_device, dev); + struct device *controller = udev->bus->controller; + + ret = of_property_read_u32_array(controller->parent->of_node, + "sleep", value, 2); + } else + ret = of_property_read_u32_array(dev->of_node, "sleep", + value, 2); + if (ret) { /* search fman mac node */ phandle_prop = of_get_property(dev->of_node, "fsl,fman-mac", |