diff options
author | ian <ian@FreeBSD.org> | 2014-02-15 20:45:53 +0000 |
---|---|---|
committer | ian <ian@FreeBSD.org> | 2014-02-15 20:45:53 +0000 |
commit | b2b116ed427142c946b92125510b8ea974181f1e (patch) | |
tree | dde2b21c696b9476659eac70ce0ac442f37da044 /sys/dev/sdhci/sdhci.h | |
parent | 128f1a43fea4c86d8283525ea3a753bb47fad453 (diff) | |
download | FreeBSD-src-b2b116ed427142c946b92125510b8ea974181f1e.zip FreeBSD-src-b2b116ed427142c946b92125510b8ea974181f1e.tar.gz |
Add timeout logic to sdhci, separate from the timeouts done by the hardware.
If the hardware is not in a good state (like maybe clocks aren't running
because of a configuration glitch) its timeout clock may also not work
correctly, and the next command sent will hang that thread forever. The
thread in question is usually the one and only thread (at init time) or
a bio queue worker thread whose lockup will eventually lead to the whole
system locking up when it runs out of buffers.
No sd card command should take longer than 250ms. This new code establishes
a 1-second timeout to allow plenty of safety margin over that.
Diffstat (limited to 'sys/dev/sdhci/sdhci.h')
-rw-r--r-- | sys/dev/sdhci/sdhci.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/dev/sdhci/sdhci.h b/sys/dev/sdhci/sdhci.h index 8ad2429..05832ec 100644 --- a/sys/dev/sdhci/sdhci.h +++ b/sys/dev/sdhci/sdhci.h @@ -241,6 +241,7 @@ struct sdhci_slot { bus_addr_t paddr; /* DMA buffer address */ struct task card_task; /* Card presence check task */ struct callout card_callout; /* Card insert delay callout */ + struct callout timeout_callout;/* Card command/data response timeout */ struct mmc_host host; /* Host parameters */ struct mmc_request *req; /* Current request */ struct mmc_command *curcmd; /* Current command of current request */ |