Search Linux Wireless

[PATCH 22/35] Only retry resubmitting rx_urb once

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

 



Other drivers don't even bother resubmitting it with GFP_KERNEL.  If it
fails with GFP_KERNEL, we have a problem, and restarting the task is not
likely to be helpful.

Signed-off-by: Pavel Roskin <proski@xxxxxxx>
---

 drivers/net/wireless/at76_usb.c |   21 +++++----------------
 drivers/net/wireless/at76_usb.h |    3 ---
 2 files changed, 5 insertions(+), 19 deletions(-)


diff --git a/drivers/net/wireless/at76_usb.c b/drivers/net/wireless/at76_usb.c
index 233c4c1..4ad3173 100644
--- a/drivers/net/wireless/at76_usb.c
+++ b/drivers/net/wireless/at76_usb.c
@@ -3407,21 +3407,11 @@ static int at76_submit_rx_urb(struct at76_priv *priv)
 	}
 
 exit:
-	if (ret < 0) {
-		if (ret != -ENODEV) {
-			/* If we can't submit the URB, the adapter becomes
-			 * completely useless, so try again later */
-			if (--priv->nr_submit_rx_tries > 0)
-				schedule_work(&priv->work_submit_rx);
-			else
-				err("%s: giving up to submit rx urb after %d "
-				    "failures - please unload the driver "
-				    "and/or power cycle the device",
-				    priv->netdev->name, NR_SUBMIT_RX_TRIES);
-		}
-	} else
-		/* reset counter to initial value */
-		priv->nr_submit_rx_tries = NR_SUBMIT_RX_TRIES;
+	if (ret < 0 && ret != -ENODEV) {
+		printk(KERN_ERR "%s: cannot submit rx urb - please unload the "
+		       "driver and/or power cycle the device\n",
+		       priv->netdev->name);
+	}
 
 	return ret;
 }
@@ -3449,7 +3439,6 @@ static int at76_open(struct net_device *netdev)
 
 	priv->scan_state = SCAN_IDLE;
 	priv->last_scan = jiffies;
-	priv->nr_submit_rx_tries = NR_SUBMIT_RX_TRIES;	/* init counter */
 
 	ret = at76_submit_rx_urb(priv);
 	if (ret < 0) {
diff --git a/drivers/net/wireless/at76_usb.h b/drivers/net/wireless/at76_usb.h
index 33ba517..6c4ebf2 100644
--- a/drivers/net/wireless/at76_usb.h
+++ b/drivers/net/wireless/at76_usb.h
@@ -430,8 +430,6 @@ struct rx_data_buf {
 };
 
 #define NR_RX_DATA_BUF		8
-/* how often do we try to submit a rx urb until giving up */
-#define NR_SUBMIT_RX_TRIES	8
 
 /* Data for one loaded firmware file */
 struct fwentry {
@@ -477,7 +475,6 @@ struct at76_priv {
 	struct delayed_work dwork_auth;
 	struct delayed_work dwork_assoc;
 
-	int nr_submit_rx_tries;	/* number of tries to submit an rx urb left */
 	struct tasklet_struct rx_tasklet;
 
 	/* the WEP stuff */
-
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux