LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Letu Ren <fantasquex@gmail.com>,
	"David S . Miller" <davem@davemloft.net>,
	Sasha Levin <sashal@kernel.org>,
	netdev@vger.kernel.org
Subject: [PATCH AUTOSEL 5.10 7/9] net/qla3xxx: fix schedule while atomic in ql_wait_for_drvr_lock and ql_adapter_reset
Date: Tue,  3 Aug 2021 07:44:06 -0400	[thread overview]
Message-ID: <20210803114408.2252713-7-sashal@kernel.org> (raw)
In-Reply-To: <20210803114408.2252713-1-sashal@kernel.org>

From: Letu Ren <fantasquex@gmail.com>

[ 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: Letu Ren <fantasquex@gmail.com>
Signed-off-by: Letu Ren <fantasquex@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/qlogic/qla3xxx.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qla3xxx.c b/drivers/net/ethernet/qlogic/qla3xxx.c
index a83b3d69a656..c7923e22a4c4 100644
--- a/drivers/net/ethernet/qlogic/qla3xxx.c
+++ b/drivers/net/ethernet/qlogic/qla3xxx.c
@@ -154,7 +154,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");
@@ -3290,7 +3290,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));
 
 	/*
@@ -3326,7 +3326,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)
-- 
2.30.2


  parent reply	other threads:[~2021-08-03 11:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-03 11:44 [PATCH AUTOSEL 5.10 1/9] libata: fix ata_pio_sector for CONFIG_HIGHMEM Sasha Levin
2021-08-03 11:44 ` [PATCH AUTOSEL 5.10 2/9] reiserfs: add check for root_inode in reiserfs_fill_super Sasha Levin
2021-08-03 11:44 ` [PATCH AUTOSEL 5.10 3/9] reiserfs: check directory items on read from disk Sasha Levin
2021-08-03 11:44 ` [PATCH AUTOSEL 5.10 4/9] virt_wifi: fix error on connect Sasha Levin
2021-08-03 11:44 ` [PATCH AUTOSEL 5.10 5/9] net: qede: Fix end of loop tests for list_for_each_entry Sasha Levin
2021-08-03 11:44 ` [PATCH AUTOSEL 5.10 6/9] alpha: Send stop IPI to send to online CPUs Sasha Levin
2021-08-03 11:44 ` Sasha Levin [this message]
2021-08-03 11:44 ` [PATCH AUTOSEL 5.10 8/9] smb3: rc uninitialized in one fallocate path Sasha Levin
2021-08-03 11:44 ` [PATCH AUTOSEL 5.10 9/9] drm/amdgpu/display: only enable aux backlight control for OLED panels Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210803114408.2252713-7-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=davem@davemloft.net \
    --cc=fantasquex@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --subject='Re: [PATCH AUTOSEL 5.10 7/9] net/qla3xxx: fix schedule while atomic in ql_wait_for_drvr_lock and ql_adapter_reset' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).