mt76: mt7915: fix polling firmware-own status

[ Upstream commit 71bb496ce17f6976c8a75b054861781965b07ac0 ]

Check the register status bit instead of the trigger bit

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Felix Fietkau 2020-11-23 14:06:50 +01:00 committed by Greg Kroah-Hartman
parent 9af6aa18b4
commit a25ff23ba2
2 changed files with 2 additions and 1 deletions

View File

@ -2689,7 +2689,7 @@ static int mt7915_driver_own(struct mt7915_dev *dev)
{
mt76_wr(dev, MT_TOP_LPCR_HOST_BAND0, MT_TOP_LPCR_HOST_DRV_OWN);
if (!mt76_poll_msec(dev, MT_TOP_LPCR_HOST_BAND0,
MT_TOP_LPCR_HOST_FW_OWN, 0, 500)) {
MT_TOP_LPCR_HOST_FW_OWN_STAT, 0, 500)) {
dev_err(dev->mt76.dev, "Timeout for driver own\n");
return -EIO;
}

View File

@ -426,6 +426,7 @@
#define MT_TOP_LPCR_HOST_BAND0 MT_TOP(0x10)
#define MT_TOP_LPCR_HOST_FW_OWN BIT(0)
#define MT_TOP_LPCR_HOST_DRV_OWN BIT(1)
#define MT_TOP_LPCR_HOST_FW_OWN_STAT BIT(2)
#define MT_TOP_MISC MT_TOP(0xf0)
#define MT_TOP_MISC_FW_STATE GENMASK(2, 0)