diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2013-01-08 16:07:27 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-08 19:40:47 -0500 |
commit | adfba3220b625ce4bee08e7e6f48c8a27aac23bb (patch) | |
tree | be763cb3537e28f43bb43df856bdbe82bc2bdbbd /drivers/misc/mei/hw-me.c | |
parent | 528c8eb4e7c08c5531533de62a558aaf3d076ebb (diff) |
mei: don't use cached value for hcsr in mei_hw_reset
Open code mei_hw_reset to avoid using cached hcsr.
Using cached hcsr can cause unwanted side effects.
Move mei_hw_restet function to hw-me.c as it is hw dependent
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei/hw-me.c')
-rw-r--r-- | drivers/misc/mei/hw-me.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/misc/mei/hw-me.c b/drivers/misc/mei/hw-me.c index 1e82e3311ea2..ec4ab895f03d 100644 --- a/drivers/misc/mei/hw-me.c +++ b/drivers/misc/mei/hw-me.c | |||
@@ -132,6 +132,41 @@ void mei_disable_interrupts(struct mei_device *dev) | |||
132 | mei_hcsr_set(dev); | 132 | mei_hcsr_set(dev); |
133 | } | 133 | } |
134 | 134 | ||
135 | /** | ||
136 | * mei_hw_reset - resets fw via mei csr register. | ||
137 | * | ||
138 | * @dev: the device structure | ||
139 | * @interrupts_enabled: if interrupt should be enabled after reset. | ||
140 | */ | ||
141 | void mei_hw_reset(struct mei_device *dev, bool intr_enable) | ||
142 | { | ||
143 | u32 hcsr = mei_hcsr_read(dev); | ||
144 | |||
145 | dev_dbg(&dev->pdev->dev, "before reset HCSR = 0x%08x.\n", hcsr); | ||
146 | |||
147 | hcsr |= (H_RST | H_IG); | ||
148 | |||
149 | if (intr_enable) | ||
150 | hcsr |= H_IE; | ||
151 | else | ||
152 | hcsr &= ~H_IE; | ||
153 | |||
154 | hcsr &= ~H_IS; | ||
155 | |||
156 | mei_reg_write(dev, H_CSR, hcsr); | ||
157 | hcsr = mei_hcsr_read(dev); | ||
158 | |||
159 | hcsr &= ~H_RST; | ||
160 | hcsr |= H_IG; | ||
161 | hcsr &= ~H_IS; | ||
162 | |||
163 | mei_reg_write(dev, H_CSR, hcsr); | ||
164 | |||
165 | hcsr = mei_hcsr_read(dev); | ||
166 | |||
167 | dev_dbg(&dev->pdev->dev, "current HCSR = 0x%08x.\n", hcsr); | ||
168 | } | ||
169 | |||
135 | 170 | ||
136 | /** | 171 | /** |
137 | * mei_interrupt_quick_handler - The ISR of the MEI device | 172 | * mei_interrupt_quick_handler - The ISR of the MEI device |