wimax/i2400m: fix deadlock: don't do BUS reset under i2400m->init_mutex
authorInaky Perez-Gonzalez <inaky@linux.intel.com>
Wed, 7 Oct 2009 03:34:13 +0000 (12:34 +0900)
committerInaky Perez-Gonzalez <inaky@linux.intel.com>
Mon, 19 Oct 2009 06:56:18 +0000 (15:56 +0900)
commitb9ee95010bee6c0e17d18bc9d9c0cfab6e8cb73a
treed1fd6706e054bb337d3ac79e96e32d2ec5145047
parent5eeae35b9a2e304fc4ae3d9eed63afeea23b482c
wimax/i2400m: fix deadlock: don't do BUS reset under i2400m->init_mutex

Since the addition of the pre/post reset handlers, it became clear
that we cannot do a I2400M-RT-BUS type reset while holding the
init_mutex, as in the case of USB, it will deadlock when trying to
call i2400m_pre_reset().

Thus, the following changes:

 - clarify the fact that calling bus_reset() w/ I2400M_RT_BUS while
   holding init_mutex is a no-no.

 - i2400m_dev_reset_handle() will do a BUS reset to recover a gone
   device after unlocking init_mutex.

 - in the USB reset implementation, when cold and warm reset fails,
   fallback to QUEUING a usb reset, not executing a USB reset, so it
   happens from another context and does not deadlock.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
drivers/net/wimax/i2400m/driver.c
drivers/net/wimax/i2400m/i2400m.h
drivers/net/wimax/i2400m/usb.c