Skip to content

Commit b13a65e

Browse files
ausyskingregkh
authored andcommitted
mei: clean reset bit before reset
H_RST bit in H_CSR register may be found lit before reset is started, for example if preceding reset flow hasn't completed. In that case asserting H_RST will be ignored, therefore we need to clean H_RST bit to start a successful reset sequence. Cc: <stable@vger.kernel.org> raspberrypi#3.10+ Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent b7392d2 commit b13a65e

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎drivers/misc/mei/hw-me.c‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,18 @@ static int mei_me_hw_reset(struct mei_device *dev, bool intr_enable)
234234
struct mei_me_hw *hw = to_me_hw(dev);
235235
u32 hcsr = mei_hcsr_read(hw);
236236

237+
/* H_RST may be found lit before reset is started,
238+
* for example if preceding reset flow hasn't completed.
239+
* In that case asserting H_RST will be ignored, therefore
240+
* we need to clean H_RST bit to start a successful reset sequence.
241+
*/
242+
if ((hcsr & H_RST) == H_RST) {
243+
dev_warn(dev->dev, "H_RST is set = 0x%08X", hcsr);
244+
hcsr &= ~H_RST;
245+
mei_me_reg_write(hw, H_CSR, hcsr);
246+
hcsr = mei_hcsr_read(hw);
247+
}
248+
237249
hcsr |= H_RST | H_IG | H_IS;
238250

239251
if (intr_enable)

0 commit comments

Comments
 (0)