diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2013-09-09 10:00:16 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2013-09-09 10:00:16 -0600 |
commit | 4425b0261bfdcd4cf8765917dc2b3a8b0d80c177 (patch) | |
tree | bfd39a8d3439e9bd78c11cc926b4a6b05cc75c95 /nuttx/drivers | |
parent | 8b5a8f98e261f31f15cae44fe8847ada4a0654e0 (diff) | |
download | px4-nuttx-4425b0261bfdcd4cf8765917dc2b3a8b0d80c177.tar.gz px4-nuttx-4425b0261bfdcd4cf8765917dc2b3a8b0d80c177.tar.bz2 px4-nuttx-4425b0261bfdcd4cf8765917dc2b3a8b0d80c177.zip |
USB MSC host class driver: Don't bother retrying to initialize the FLASH if the interface is returning fatal transfer errors
Diffstat (limited to 'nuttx/drivers')
-rw-r--r-- | nuttx/drivers/usbhost/usbhost_storage.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/nuttx/drivers/usbhost/usbhost_storage.c b/nuttx/drivers/usbhost/usbhost_storage.c index d72203bdf..c6126131f 100644 --- a/nuttx/drivers/usbhost/usbhost_storage.c +++ b/nuttx/drivers/usbhost/usbhost_storage.c @@ -1248,6 +1248,19 @@ static inline int usbhost_initvolume(FAR struct usbhost_state_s *priv) uvdbg("Request sense\n"); ret = usbhost_requestsense(priv); } + + /* It is acceptable for a mass storage device to respond to the + * Test Unit Ready and Request Sense commands with a stall if it is + * unable to respond. But other failures mean that something is + * wrong and a device reset is in order. The transfer functions will + * return -EPERM if the transfer failed due to a stall. + */ + + if (ret < 0 && ret != -EPERM) + { + udbg("ERROR: DRVR_TRANSFER returned: %d\n", ret); + break; + } } /* Did the unit become ready? Did an error occur? Or did we time out? */ @@ -1569,6 +1582,7 @@ static inline int usbhost_tfree(FAR struct usbhost_state_s *priv) priv->tbuffer = NULL; priv->tbuflen = 0; } + return result; } |