Patch "usb: musb: fix runtime PM in debugfs" has been added to the 4.9-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
usb: musb: fix runtime PM in debugfs
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
usb-musb-fix-runtime-pm-in-debugfs.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
7b6c1b4c0e1e44544aa18161dba6a741c080a7efMon Sep 17 00:00:00 2001
From: Bin Liu <[email protected]>
Date: Tue, 10 Jan 2017 10:46:00 -0600
Subject: usb: musb: fix runtime PM in debugfs
From: Bin Liu <[email protected]>
commit 7b6c1b4c0e1e44544aa18161dba6a741c080a7ef upstream.
MUSB driver now has runtime PM support, but the debugfs driver misses the PM _get/_put() calls, which could cause MUSB register access failure.
--- drivers/usb/musb/musb_debugfs.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-)
drivers/usb/musb/musb_debugfs.c +19 -1
@@ -114,6 +114,7 @@ static int musb_regdump_show(struct seq_unsigned i;seq_printf (s,"MUSB (M)HDRC Register Dump\n" ); +pm_runtime_get_sync (musb->controller);for (i =0 ; i <ARRAY_SIZE (musb_regmap); i++) {switch (musb_regmap[i].size) {
@@ -132,6 +133,8 @@ static int musb_regdump_show(struct seq_ } } +pm_runtime_mark_last_busy (musb->controller); +pm_runtime_put_autosuspend (musb->controller);return 0 ; }
@@ -145,7 +148,10 @@ static int musb_test_mode_show(struct sestruct musb *musb = s->private;unsigned test; +pm_runtime_get_sync (musb->controller); test =musb_readb (musb->mregs,MUSB_TESTMODE ); +pm_runtime_mark_last_busy (musb->controller); +pm_runtime_put_autosuspend (musb->controller);if (test &MUSB_TEST_FORCE_HOST )seq_printf (s,"force host\n" );
@@ -194,11 +200,12 @@ static ssize_t musb_test_mode_write(struu8 test;char buf[18 ]; +pm_runtime_get_sync (musb->controller); test =musb_readb (musb->mregs,MUSB_TESTMODE );if (test) {dev_err (musb->controller,"Error: test mode is already set. " "Please do USB Bus Reset to start a new test.\n" ); -return count; + goto ret; }memset (buf,0x00 ,sizeof (buf));
@@ -234,6 +241,9 @@ static ssize_t musb_test_mode_write(strumusb_writeb (musb->mregs,MUSB_TESTMODE , test); +ret: +pm_runtime_mark_last_busy (musb->controller); +pm_runtime_put_autosuspend (musb->controller);return count; }
@@ -254,8 +264,13 @@ static int musb_softconnect_show(structswitch (musb->xceiv->otg->state) {case OTG_STATE_A_HOST :case OTG_STATE_A_WAIT_BCON : +pm_runtime_get_sync (musb->controller); + reg =musb_readb (musb->mregs,MUSB_DEVCTL ); connect = reg &MUSB_DEVCTL_SESSION ?1 :0 ; + +pm_runtime_mark_last_busy (musb->controller); +pm_runtime_put_autosuspend (musb->controller);break ;default : connect =-1 ;
@@ -284,6 +299,7 @@ static ssize_t musb_softconnect_write(stif (copy_from_user (&buf, ubuf,min_t (size_t,sizeof (buf) -1 , count)))return -EFAULT ; +pm_runtime_get_sync (musb->controller);if (!strncmp (buf,"0" ,1 )) {switch (musb->xceiv->otg->state) {case OTG_STATE_A_HOST :
@@ -314,6 +330,8 @@ static ssize_t musb_softconnect_write(st } } +pm_runtime_mark_last_busy (musb->controller); +pm_runtime_put_autosuspend (musb->controller);return count; }
Patches currently in stable-queue which might be from [email protected] are
queue-4.9/usb-musb-fix-runtime-pm-in-debugfs.patch