Skip to contentSkip to conversation

UPDATE hermes: serialization fixes

PATCH In review Stephen Evanchik 2 participants 2 messages Jan 3, 2003 – Jan 4, 2003 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 UPDATE hermes: serialization fixes

This fixes "Error -110 writing Tx descriptor to BAP" bug as referenced in David Gibson's README.

As per a suggestion, I've moved the spin_lock/unlock to hermes_bap_seek(). I'm currently running with this module and it's working nicely.

As always, any comments are appreciated. Patches can be always downloaded from here:

http://www.clarkson.edu/~evanchsa/software/kernel/patches

Stephen Evanchik

drivers/net/wireless/hermes.h +3 -0
@@ -288,6 +288,9 @@
 
 	u16 inten; /* Which interrupts should be enabled? */
 
+	/* Lock used in hermes_bap_seek */
+	spinlock_t baplock;
+
 #ifdef HERMES_DEBUG_BUFFER
 	struct hermes_debug_entry dbuf[HERMES_DEBUG_BUFSIZE];
 	unsigned long dbufp;
drivers/net/wireless/hermes.c +6 -0
@@ -342,11 +342,15 @@
 	int oreg = bap ? HERMES_OFFSET1 : HERMES_OFFSET0;
 	int k;
 	u16 reg;
+	unsigned long flags;
 
 	/* Paranoia.. */
 	if ( (offset > HERMES_BAP_OFFSET_MAX) || (offset % 2) )
 		return -EINVAL;
 
+	/* Without it, network connection errors occur.. */
+	spin_lock_irqsave(&(hw->baplock), flags);
+
 	k = HERMES_BAP_BUSY_TIMEOUT;
 	reg = hermes_read_reg(hw, oreg);
 	while ((reg & HERMES_OFFSET_BUSY) && k) {
@@ -368,6 +372,8 @@
 	}
 #endif
 
+	spin_unlock_irqrestore(&(hw->baplock), flags);
+
 	if (reg & HERMES_OFFSET_BUSY)
 		return -ETIMEDOUT;
 
#1 lore raw
Quoted 6 lines · Stephen Evanchik

This fixes "Error -110 writing Tx descriptor to BAP" bug as referenced in David Gibson's README.

As per a suggestion, I've moved the spin_lock/unlock to hermes_bap_seek(). I'm currently running with this module and it's working nicely.

As always, any comments are appreciated. Patches can be always downloaded from here:

I don't see how this can make any difference on the 0.13 and later versions of the driver (which is in 2.5), since all BAP operations are already serialized by the lock in the orinoco_private structure.

Signature · 4 lines
David Gibson			| For every complex problem there is a
[email protected]	| solution which is simple, neat and
				| wrong.
http://www.ozlabs.org/people/dgibson