Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 72fcaf69 authored by Letu Ren's avatar Letu Ren Committed by Greg Kroah-Hartman
Browse files

net/qla3xxx: fix schedule while atomic in ql_wait_for_drvr_lock and ql_adapter_reset



[ Upstream commit 92766c4628ea349c8ddab0cd7bd0488f36e5c4ce ]

When calling the 'ql_wait_for_drvr_lock' and 'ql_adapter_reset', the driver
has already acquired the spin lock, so the driver should not call 'ssleep'
in atomic context.

This bug can be fixed by using 'mdelay' instead of 'ssleep'.

Reported-by: default avatarLetu Ren <fantasquex@gmail.com>
Signed-off-by: default avatarLetu Ren <fantasquex@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 742e85fa
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -155,7 +155,7 @@ static int ql_wait_for_drvr_lock(struct ql3_adapter *qdev)
				      "driver lock acquired\n");
			return 1;
		}
		ssleep(1);
		mdelay(1000);
	} while (++i < 10);

	netdev_err(qdev->ndev, "Timed out waiting for driver lock...\n");
@@ -3291,7 +3291,7 @@ static int ql_adapter_reset(struct ql3_adapter *qdev)
		if ((value & ISP_CONTROL_SR) == 0)
			break;

		ssleep(1);
		mdelay(1000);
	} while ((--max_wait_time));

	/*
@@ -3327,7 +3327,7 @@ static int ql_adapter_reset(struct ql3_adapter *qdev)
						   ispControlStatus);
			if ((value & ISP_CONTROL_FSR) == 0)
				break;
			ssleep(1);
			mdelay(1000);
		} while ((--max_wait_time));
	}
	if (max_wait_time == 0)