Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752097AbbE0CtN (ORCPT ); Tue, 26 May 2015 22:49:13 -0400 Received: from mga02.intel.com ([134.134.136.20]:24192 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751504AbbE0CtM (ORCPT ); Tue, 26 May 2015 22:49:12 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,502,1427785200"; d="scan'208";a="735801207" Message-ID: <556530A6.1060008@linux.intel.com> Date: Wed, 27 May 2015 10:49:10 +0800 From: "Zhang, Yanmin" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: linux-kernel@vger.kernel.org, xinhuix.pan@intel.com, gregkh@linuxfoundation.org, alan@linux.intel.com Subject: [PATCH V2 0/3] cdc-acm: fix incorrect runtime wakeup in acm_tty_write Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1119 Lines: 28 Resend as V1 has email format issue. Sorry for bothering. --- 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; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/