diff options
Diffstat (limited to 'drivers/misc/mei/hw-me.c')
-rw-r--r-- | drivers/misc/mei/hw-me.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/drivers/misc/mei/hw-me.c b/drivers/misc/mei/hw-me.c index 45ea7185c003..642c6223fa6c 100644 --- a/drivers/misc/mei/hw-me.c +++ b/drivers/misc/mei/hw-me.c | |||
@@ -152,6 +152,20 @@ static void mei_me_intr_disable(struct mei_device *dev) | |||
152 | } | 152 | } |
153 | 153 | ||
154 | /** | 154 | /** |
155 | * mei_me_hw_reset_release - release device from the reset | ||
156 | * | ||
157 | * @dev: the device structure | ||
158 | */ | ||
159 | static void mei_me_hw_reset_release(struct mei_device *dev) | ||
160 | { | ||
161 | struct mei_me_hw *hw = to_me_hw(dev); | ||
162 | u32 hcsr = mei_hcsr_read(hw); | ||
163 | |||
164 | hcsr |= H_IG; | ||
165 | hcsr &= ~H_RST; | ||
166 | mei_hcsr_set(hw, hcsr); | ||
167 | } | ||
168 | /** | ||
155 | * mei_me_hw_reset - resets fw via mei csr register. | 169 | * mei_me_hw_reset - resets fw via mei csr register. |
156 | * | 170 | * |
157 | * @dev: the device structure | 171 | * @dev: the device structure |
@@ -169,18 +183,14 @@ static void mei_me_hw_reset(struct mei_device *dev, bool intr_enable) | |||
169 | if (intr_enable) | 183 | if (intr_enable) |
170 | hcsr |= H_IE; | 184 | hcsr |= H_IE; |
171 | else | 185 | else |
172 | hcsr &= ~H_IE; | 186 | hcsr |= ~H_IE; |
173 | |||
174 | mei_hcsr_set(hw, hcsr); | ||
175 | |||
176 | hcsr = mei_hcsr_read(hw) | H_IG; | ||
177 | hcsr &= ~H_RST; | ||
178 | 187 | ||
179 | mei_hcsr_set(hw, hcsr); | 188 | mei_hcsr_set(hw, hcsr); |
180 | 189 | ||
181 | hcsr = mei_hcsr_read(hw); | 190 | if (dev->dev_state == MEI_DEV_POWER_DOWN) |
191 | mei_me_hw_reset_release(dev); | ||
182 | 192 | ||
183 | dev_dbg(&dev->pdev->dev, "current HCSR = 0x%08x.\n", hcsr); | 193 | dev_dbg(&dev->pdev->dev, "current HCSR = 0x%08x.\n", mei_hcsr_read(hw)); |
184 | } | 194 | } |
185 | 195 | ||
186 | /** | 196 | /** |
@@ -466,7 +476,8 @@ irqreturn_t mei_me_irq_thread_handler(int irq, void *dev_id) | |||
466 | mutex_unlock(&dev->device_lock); | 476 | mutex_unlock(&dev->device_lock); |
467 | return IRQ_HANDLED; | 477 | return IRQ_HANDLED; |
468 | } else { | 478 | } else { |
469 | dev_dbg(&dev->pdev->dev, "FW not ready.\n"); | 479 | dev_dbg(&dev->pdev->dev, "Reset Completed.\n"); |
480 | mei_me_hw_reset_release(dev); | ||
470 | mutex_unlock(&dev->device_lock); | 481 | mutex_unlock(&dev->device_lock); |
471 | return IRQ_HANDLED; | 482 | return IRQ_HANDLED; |
472 | } | 483 | } |