Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3757063pxt; Tue, 10 Aug 2021 10:35:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTwungYxuh43c/z/UAV+xP4DFng6D2fUfji8p9EnTRbQ/mdziwNBnjhNDv9h+7G/tYeEz9 X-Received: by 2002:a92:dc52:: with SMTP id x18mr798020ilq.300.1628616953731; Tue, 10 Aug 2021 10:35:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628616953; cv=none; d=google.com; s=arc-20160816; b=QCDaZHfMj5J0xsoKajD9RQ2DdBbJK8SGkyyM3gSOc2KCX9S3LvbKpSmecGIqdvFjl2 +m3NEuIxESJkr7pAn1oMFFZYs3a/e5GkRKLkn6LLnB3Zc/zwy2kSUntVkMeFMI6jybbH 8NYhual23QKZYyYA5CPbx0N7ptaaY6fJHCamqI2hYwb2gPUWpFqXH9NYlyDvO56Dg7FL uyMM9/bDWpDZ3eBBW4Q9LPwE/7iG8UX01iNuOhaOblYUtw4GCIx7rKyn5Be8zc3VcHXP Fmzp9dRFNkc34oSgmeuHiAYF2bW7MRFUDoYVbu3j1MWoj86ZWXITHrkAhUbQZt8+mJI7 1aog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7xOb2wOpeHjOU+61kcPDC/sAqBDBfulRKkfCfqoH/xY=; b=qjQN3S4Ymi9lz2XmYDVY2evITPN9N5gCTks+k0gqA76zjuxwhfpXNCnXDi9M3owbz4 8wpaFNskLCS4ajetkQt9QsvqEtEzTfofoUMtOjMncdR/jILz1UVyAuE1nyBwHLpz/1kM 7ch/0wmPoeOq2h6rqxN2z9YnWHIBMj84iL+Rwu7BAo8Ie9VDWzsGtU5iFOv0Xjk0o4k3 FeWCgrUKMb69uvOwQ9tNUtMvFzpvpg/dDXFkmdF+28wKjREEdQdA3lHro2HJZXcJOLDE 7Aaye4rkHDL4flXXA5pSmSOycK91l2VZNQPGCdhfAnZF7V3DtG3c/OvtxYZRzNj8tykM VyBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YYiZOtIl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x26si11398473jai.112.2021.08.10.10.35.41; Tue, 10 Aug 2021 10:35:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YYiZOtIl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230380AbhHJRe1 (ORCPT + 99 others); Tue, 10 Aug 2021 13:34:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:33340 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232733AbhHJRdm (ORCPT ); Tue, 10 Aug 2021 13:33:42 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 453AE61076; Tue, 10 Aug 2021 17:33:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628616800; bh=GN2Tr7/pBi5qdMqjJjgwJA2k7JHS8uhr6WJxPT49L28=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YYiZOtIl5BcxOkVrr1V/IKkPxavFW9NcYhlS4pR+R7wmtV+Lzro86lEx0krTPqLgy TPHbhRMjE+ndyqVSjDSO/QwBeMFbS2dIhxx0uLfy/xWxfLJUEcdficjEXD+KuoH53r f8SKUVTTh7F14+RfQUGIAjvZ9E+mrn0RvXteTdFM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Letu Ren , "David S. Miller" , Sasha Levin Subject: [PATCH 4.19 53/54] net/qla3xxx: fix schedule while atomic in ql_wait_for_drvr_lock and ql_adapter_reset Date: Tue, 10 Aug 2021 19:30:47 +0200 Message-Id: <20210810172945.953066300@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210810172944.179901509@linuxfoundation.org> References: <20210810172944.179901509@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Letu Ren [ 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 Signed-off-by: Letu Ren Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- 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 2d71646640ac..f98e2f417c2e 100644 --- a/drivers/net/ethernet/qlogic/qla3xxx.c +++ b/drivers/net/ethernet/qlogic/qla3xxx.c @@ -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"); @@ -3292,7 +3292,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)); /* @@ -3328,7 +3328,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