lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 15 Feb 2013 17:23:59 +0900
From:	Alex Courbot <acourbot@...dia.com>
To:	Bjørn Mork <bjorn@...k.no>
CC:	USB list <linux-usb@...r.kernel.org>,
	"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Alexandre Courbot <gnurou@...il.com>
Subject: Re: usb_wwan_write() called while device still being resumed

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?= <bjorn@...k.no>
> 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 <acourbot@...dia.com>
> Signed-off-by: Bjørn Mork <bjorn@...k.no>
> ---
>   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:

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;

                 /* 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-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ