Re: zte_ev not properly handling ZTE AC2726 CDMA modems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[ Please, try to avoid top-posting. ]

On Tue, Nov 26, 2013 at 12:37:21PM -0800, Dmitry Kunilov wrote:
> Hi Jonah,
> 
> Do you think this patch will work against 3.9.11? If not, I'll have to
> invest some time into upgrading to 3.12 which proved to be difficult given
> all the Broadcom-related modifications in the kernel..

Yes, the patch should work on 3.9 as well, although it might not apply
cleanly. Try the patch below instead if your stuck with 3.9.

Thanks,
Johan

> -----Original Message-----
> From: Johan Hovold [mailto:jhovold@xxxxxxxxx] 
> Sent: Tuesday, November 26, 2013 6:39 AM
> To: Dmitry Kunilov
> Cc: linux-usb@xxxxxxxxxxxxxxx
> Subject: Re: zte_ev not properly handling ZTE AC2726 CDMA modems
> 
> On Mon, Nov 25, 2013 at 06:15:28PM -0800, Dmitry Kunilov wrote:
> > Hi everyone,
> > 
> > As a late follow-up to the discussion that happened in June about 
> > moving support for most ZTE CDMA devices from option.c to zte_ev.c 
> > (where the decision was to "convert and see if anyone complains"), I'd 
> > like to complain
> > :)
> > 
> > We have a park of approximately thirty ZTE AC2726 EVDO modems 
> > connected to Broadcom-based routers running Linux-mips. After recent 
> > upgrade from ancient
> > 2.6.22 to relatively modern 3.9.11, all 30 are having the same 
> > problem: pppd connects and Internet access works for 20 to 60 seconds, 
> > then connectivity drops and pppd logs an LCP timeout. After that, pppd 
> > is able to restart the connection and run for another 20-60 seconds.
> > 
> > I did notice that these modems are now handled by zte_ev instead of 
> > option, so I went and moved all the DEVICE_INFO's back from zte_ev.c 
> > to option.c and also disabled zte_ev module in the kernel 
> > configuration. After this change, the modems work just fine, like they 
> > did on 2.6.22 - using the option driver.
> > 
> > Please let me know if there is any debug info I can collect to help 
> > resolve this issue.
> 
> Would you mind trying the patch below (against v3.12)?
> 
> Thanks,
> Johan

>From 9520079e3047f2c74a1965196e4d1993e6ca11a0 Mon Sep 17 00:00:00 2001
From: Johan Hovold <jhovold@xxxxxxxxx>
Date: Tue, 26 Nov 2013 15:26:49 +0100
Subject: [PATCH v3.9] USB: serial: zte_ev debug patch

Continue to read on errors.
Warn about failed reads and writes.
Increase zte_ev buffer sizes.
Fix race in write which could lead to (temporarily) degraded throughput
(backport of fix in Greg's usb-linus branch).
---
 drivers/usb/serial/generic.c | 23 ++++++++---------------
 drivers/usb/serial/zte_ev.c  |  2 ++
 2 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c
index 4c5c23f1cae5..01ab8c78eb9d 100644
--- a/drivers/usb/serial/generic.c
+++ b/drivers/usb/serial/generic.c
@@ -187,14 +187,7 @@ retry:
 		return result;
 	}
 
-	/* Try sending off another urb, unless in irq context (in which case
-	 * there will be no free urb). */
-	if (!in_irq())
-		goto retry;
-
-	clear_bit_unlock(USB_SERIAL_WRITE_BUSY, &port->flags);
-
-	return 0;
+	goto retry;
 }
 
 /**
@@ -350,15 +343,15 @@ void usb_serial_generic_read_bulk_callback(struct urb *urb)
 	dev_dbg(&port->dev, "%s - port %d, urb %d, len %d\n",
 		__func__, port->number, i, urb->actual_length);
 
-	if (urb->status) {
-		dev_dbg(&port->dev, "%s - non-zero urb status: %d\n",
+	if (!urb->status) {
+		usb_serial_debug_data(&port->dev, __func__, urb->actual_length,
+									data);
+		port->serial->type->process_read_urb(urb);
+	} else {
+		dev_warn(&port->dev, "%s - non-zero urb status: %d\n",
 			__func__, urb->status);
-		return;
 	}
 
-	usb_serial_debug_data(&port->dev, __func__, urb->actual_length, data);
-	port->serial->type->process_read_urb(urb);
-
 	/* Throttle the device if requested by tty */
 	spin_lock_irqsave(&port->lock, flags);
 	port->throttled = port->throttle_req;
@@ -387,7 +380,7 @@ void usb_serial_generic_write_bulk_callback(struct urb *urb)
 	spin_unlock_irqrestore(&port->lock, flags);
 
 	if (status) {
-		dev_dbg(&port->dev, "%s - non-zero urb status: %d\n",
+		dev_warn(&port->dev, "%s - non-zero urb status: %d\n",
 			__func__, status);
 
 		spin_lock_irqsave(&port->lock, flags);
diff --git a/drivers/usb/serial/zte_ev.c b/drivers/usb/serial/zte_ev.c
index 39ee7373b4ee..952dbb23cbbc 100644
--- a/drivers/usb/serial/zte_ev.c
+++ b/drivers/usb/serial/zte_ev.c
@@ -295,6 +295,8 @@ static struct usb_serial_driver zio_device = {
 	},
 	.id_table =		id_table,
 	.num_ports =		1,
+	.bulk_in_size =		2048,
+	.bulk_out_size =	2048,
 	.open =			zte_ev_usb_serial_open,
 	.close =		zte_ev_usb_serial_close,
 };
-- 
1.8.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux