From patchwork Fri Feb 15 08:23:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alexandre Courbot X-Patchwork-Id: 2145001 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 1227D3FDF1 for ; Fri, 15 Feb 2013 08:24:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754309Ab3BOIYF (ORCPT ); Fri, 15 Feb 2013 03:24:05 -0500 Received: from hqemgate04.nvidia.com ([216.228.121.35]:15245 "EHLO hqemgate04.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753671Ab3BOIYE convert rfc822-to-8bit (ORCPT ); Fri, 15 Feb 2013 03:24:04 -0500 Received: from hqnvupgp08.nvidia.com (Not Verified[216.228.121.13]) by hqemgate04.nvidia.com id ; Fri, 15 Feb 2013 00:23:53 -0800 Received: from hqemhub01.nvidia.com ([172.17.108.22]) by hqnvupgp08.nvidia.com (PGP Universal service); Fri, 15 Feb 2013 00:20:00 -0800 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Fri, 15 Feb 2013 00:20:00 -0800 Received: from [10.19.57.117] (172.20.144.16) by hqemhub01.nvidia.com (172.20.150.30) with Microsoft SMTP Server id 8.3.297.1; Fri, 15 Feb 2013 00:24:01 -0800 Message-ID: <511DF09F.3070401@nvidia.com> Date: Fri, 15 Feb 2013 17:23:59 +0900 From: Alex Courbot Organization: NVIDIA User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130109 Thunderbird/17.0.2 MIME-Version: 1.0 To: =?UTF-8?B?QmrDuHJuIE1vcms=?= CC: USB list , "linux-pm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Alexandre Courbot Subject: Re: usb_wwan_write() called while device still being resumed References: <511CBCE8.9070204@nvidia.com> <87ehgivlmg.fsf@nemi.mork.no> In-Reply-To: <87ehgivlmg.fsf@nemi.mork.no> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Hi Bjørn, thanks for the reply! On 02/15/2013 02:41 AM, Bjørn Mork wrote: > I believe the usb_autopm_get_interface_async() failing is OK in this > case, but that should not cause the modem to stop working. > > Wonder if this patch solves the problem? : > > From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= > Date: Thu, 14 Feb 2013 18:34:48 +0100 > Subject: [PATCH] USB: usb_wwan: clear port busy state on error > MIME-Version: 1.0 > Content-Type: text/plain; charset=UTF-8 > Content-Transfer-Encoding: 8bit > > Reported-by: Alex Courbot > Signed-off-by: Bjørn Mork > --- > drivers/usb/serial/usb_wwan.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c > index 01c94aa..44e106d 100644 > --- a/drivers/usb/serial/usb_wwan.c > +++ b/drivers/usb/serial/usb_wwan.c > @@ -230,8 +230,10 @@ int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port, > usb_pipeendpoint(this_urb->pipe), i); > > err = usb_autopm_get_interface_async(port->serial->interface); > - if (err < 0) > + if (err < 0) { > + clear_bit(i, &portdata->out_busy); > break; > + } > > /* send the data */ > memcpy(this_urb->transfer_buffer, buf, todo); > Unfortunately it does not, and fails the same way. On the other hand, I do not see the issue when doing the following: /* send the data */ memcpy(this_urb->transfer_buffer, buf, todo); After doing this I don't see this issue anymore. It looks wrong though. But it seems to work despite the obvious unbalance in autopm calls that results. If I understand you correctly, usb_wwan_write() failing here is not a problem in itself, and the ack should just be sent again later? > that should not cause the modem to stop working. Actually it might also be that the network stack ends up in a bad state and remains stuck in it. I don't think the modem by itself is affected. All I observe is that no network traffic takes place after this. I'm not familiar enough with networking to make any stronger assumption. FWIW, when usb_autopm_get_interface_async() returns -EACCES, the power parameters of port->serial->interface->dev are as follows: disable_depth = 1 is_suspended = 1 runtime_status = 2 (RPM_SUSPENDED) Thanks, Alex. --- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c index e4fad5e..1490029 100644 --- a/drivers/usb/serial/usb_wwan.c +++ b/drivers/usb/serial/usb_wwan.c @@ -238,8 +238,6 @@ int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port, usb_pipeendpoint(this_urb->pipe), i); err = usb_autopm_get_interface_async(port->serial->interface); - if (err < 0) - break;