cdc-acm: fix incorrect runtime wakeup in acm_tty_write
v3 cover cdc-acm: fix incorrect runtime wakeup in acm_tty_write
Resend as V1/V2 have email format issue. Sorry for bothering.
I use Thunderbird. It has no a button to enable LKML email simply. :)
V3: Change email config to resend.
Add a space in comment.
---
There is a scenario about cdc-acm utilization.Application opens n_gsm tty and cdc-acm tty. cdc-acm tty connects to xhci device. The application configures cdc-adm tty to n_gsm tty as ldisc tty.
n_gsm=>cdc-acm=>xhci driver
acm_tty_write can be called from n_gsm driver by ldisc connection, and from application when application opens cdc-acm tty directly. acm_tty_write wakes up the device by calling usb_autopm_get_interface_async, which calls pm_runtime_get. However, pm_runtime_get can't wake up the device before returning as it's an async wake up. Then, acm_tty_write might access the device when it is off.
The patchset fixes it by:
1) add a new function usb_autopm_get_interface_upgrade to deal with above 2 requirements;
2) wake up device in n_gsm driver if n_gsm drivers calls cdc-acm driver;
Quoted 1 line · Yanmin
Resend as V1/V2 have email format issue. Sorry for bothering.
Greg,
We have to abandon this patchset. Zhuang Jin Can, a USB expert, reviewed the patches. He says acm_tty_write already considers it carefully.
acm_tty_write puts the urb to a delayed queue when acm->susp_count is not 0. acm_suspend adds 1 to acm->susp_count and acm_resume decreases 1 from it .
Sorry for the bothering. Also thank Jin Can for the comments.
Yanmin
Quoted 33 lines
I use Thunderbird. It has no a button to enable LKML email simply. :)
V3: Change email config to resend.
Add a space in comment.---
There is a scenario about cdc-acm utilization.Application opens
n_gsmtty and cdc-acm tty. cdc-acm tty connects to xhci device. The application configures cdc-adm tty ton_gsmtty as ldisc tty.n_gsm=>cdc-acm=>xhci driver
acm_tty_writecan be called fromn_gsmdriver by ldisc connection, and from application when application opens cdc-acm tty directly.acm_tty_writewakes up the device by callingusb_autopm_get_interface_async, which callspm_runtime_get. However,pm_runtime_getcan't wake up the device before returning as it's an async wake up. Then,acm_tty_writemight access the device when it is off.The patchset fixes it by:
1) add a new functionusb_autopm_get_interface_upgradeto deal with above 2 requirements;
2) wake up device inn_gsmdriver ifn_gsmdrivers calls cdc-acm driver;--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/