diff options
author | David Brown <davidb@codeaurora.org> | 2013-03-12 14:41:51 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-03-25 13:39:40 -0400 |
commit | 3f7a73b57c2f57aa25342ebdb7312f78c68502eb (patch) | |
tree | 068b9fcf5ffe224ab011c633cf83219282497c72 | |
parent | 97f00f7120fe3396302693cdc4b1d11bbacad963 (diff) |
ssbi: Comment the use of udelay()
The ssbi driver uses a busywait loop to read its status register. Add
a comment explaining the timing of the device itself so that future
developers can better understand this delay, and possibly diagnose any
problems.
Signed-off-by: David Brown <davidb@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/ssbi/ssbi.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/ssbi/ssbi.c b/drivers/ssbi/ssbi.c index 6fbcb25907ff..7ae892590c75 100644 --- a/drivers/ssbi/ssbi.c +++ b/drivers/ssbi/ssbi.c | |||
@@ -87,6 +87,15 @@ static inline void ssbi_writel(struct msm_ssbi *ssbi, u32 val, u32 reg) | |||
87 | writel(val, ssbi->base + reg); | 87 | writel(val, ssbi->base + reg); |
88 | } | 88 | } |
89 | 89 | ||
90 | /* | ||
91 | * Via private exchange with one of the original authors, the hardware | ||
92 | * should generally finish a transaction in about 5us. The worst | ||
93 | * case, is when using the arbiter and both other CPUs have just | ||
94 | * started trying to use the SSBI bus will result in a time of about | ||
95 | * 20us. It should never take longer than this. | ||
96 | * | ||
97 | * As such, this wait merely spins, with a udelay. | ||
98 | */ | ||
90 | static int ssbi_wait_mask(struct msm_ssbi *ssbi, u32 set_mask, u32 clr_mask) | 99 | static int ssbi_wait_mask(struct msm_ssbi *ssbi, u32 set_mask, u32 clr_mask) |
91 | { | 100 | { |
92 | u32 timeout = SSBI_TIMEOUT_US; | 101 | u32 timeout = SSBI_TIMEOUT_US; |
@@ -161,6 +170,10 @@ err: | |||
161 | return ret; | 170 | return ret; |
162 | } | 171 | } |
163 | 172 | ||
173 | /* | ||
174 | * See ssbi_wait_mask for an explanation of the time and the | ||
175 | * busywait. | ||
176 | */ | ||
164 | static inline int | 177 | static inline int |
165 | msm_ssbi_pa_transfer(struct msm_ssbi *ssbi, u32 cmd, u8 *data) | 178 | msm_ssbi_pa_transfer(struct msm_ssbi *ssbi, u32 cmd, u8 *data) |
166 | { | 179 | { |