netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hso for error -22 (-EINVAL) printk's
@ 2008-09-16 14:50 Denis Joseph Barrow
  2008-09-25  2:10 ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: Denis Joseph Barrow @ 2008-09-16 14:50 UTC (permalink / raw)
  To: Linux USB kernel mailing list, Linux netdev Mailing list

Added check for IFF_UP in hso_resume, this should eliminate -EINVAL (-22)
errors caused from urb's being submitted twice, once by hso_resume
& once in hso_net_open, if suspend/resume USB power saving  mode is enabled
Signed-off-by: Denis Joseph Barrow <D.Barow-x9gZzRpC1QbQT0dZR+AlfA@public.gmane.org>
---
Index: linux-2.6.27-rc6/drivers/net/usb/hso.c
===================================================================
--- linux-2.6.27-rc6.orig/drivers/net/usb/hso.c	2008-09-16 16:17:11.000000000 +0200
+++ linux-2.6.27-rc6/drivers/net/usb/hso.c	2008-09-16 16:32:05.000000000 +0200
@@ -2606,18 +2606,21 @@
 		if (network_table[i] &&
 		    (network_table[i]->interface == iface)) {
 			hso_net = dev2net(network_table[i]);
-			/* First transmit any lingering data, then restart the
-			 * device. */
-			if (hso_net->skb_tx_buf) {
-				dev_dbg(&iface->dev,
-					"Transmitting lingering data\n");
-				hso_net_start_xmit(hso_net->skb_tx_buf,
-						   hso_net->net);
-				hso_net->skb_tx_buf = NULL;
+			if (hso_net->flags & IFF_UP) {
+				/* First transmit any lingering data,
+				   then restart the device. */
+				if (hso_net->skb_tx_buf) {
+					dev_dbg(&iface->dev,
+						"Transmitting"
+						" lingering data\n");
+					hso_net_start_xmit(hso_net->skb_tx_buf,
+							   hso_net->net);
+					hso_net->skb_tx_buf = NULL;
+				}
+				result = hso_start_net_device(network_table[i]);
+				if (result)
+					goto out;
 			}
-			result = hso_start_net_device(network_table[i]);
-			if (result)
-				goto out;
 		}
 	}
 

-- 
best regards,
D.J. Barrow
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] hso for error -22 (-EINVAL) printk's
  2008-09-16 14:50 [PATCH] hso for error -22 (-EINVAL) printk's Denis Joseph Barrow
@ 2008-09-25  2:10 ` Jeff Garzik
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2008-09-25  2:10 UTC (permalink / raw)
  To: Denis Joseph Barrow
  Cc: Linux USB kernel mailing list, Linux netdev Mailing list

Denis Joseph Barrow wrote:
> Added check for IFF_UP in hso_resume, this should eliminate -EINVAL (-22)
> errors caused from urb's being submitted twice, once by hso_resume
> & once in hso_net_open, if suspend/resume USB power saving  mode is enabled
> Signed-off-by: Denis Joseph Barrow <D.Barow@option.com>
> ---
> Index: linux-2.6.27-rc6/drivers/net/usb/hso.c
> ===================================================================
> --- linux-2.6.27-rc6.orig/drivers/net/usb/hso.c	2008-09-16 16:17:11.000000000 +0200
> +++ linux-2.6.27-rc6/drivers/net/usb/hso.c	2008-09-16 16:32:05.000000000 +0200
> @@ -2606,18 +2606,21 @@
>  		if (network_table[i] &&
>  		    (network_table[i]->interface == iface)) {
>  			hso_net = dev2net(network_table[i]);
> -			/* First transmit any lingering data, then restart the
> -			 * device. */
> -			if (hso_net->skb_tx_buf) {
> -				dev_dbg(&iface->dev,
> -					"Transmitting lingering data\n");
> -				hso_net_start_xmit(hso_net->skb_tx_buf,
> -						   hso_net->net);
> -				hso_net->skb_tx_buf = NULL;
> +			if (hso_net->flags & IFF_UP) {
> +				/* First transmit any lingering data,
> +				   then restart the device. */
> +				if (hso_net->skb_tx_buf) {
> +					dev_dbg(&iface->dev,
> +						"Transmitting"
> +						" lingering data\n");
> +					hso_net_start_xmit(hso_net->skb_tx_buf,
> +							   hso_net->net);
> +					hso_net->skb_tx_buf = NULL;
> +				}
> +				result = hso_start_net_device(network_table[i]);
> +				if (result)
> +					goto out;

you should be checking netif_running() not IFF_UP



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-09-25  2:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-16 14:50 [PATCH] hso for error -22 (-EINVAL) printk's Denis Joseph Barrow
2008-09-25  2:10 ` Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).