Received: by 2002:a05:6a10:8a4d:0:0:0:0 with SMTP id dn13csp873153pxb; Fri, 13 Aug 2021 08:10:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2LF1wY/dx8wecoIpZtyWJfRtT7yDTitdc1hD9p/4N4YBt1WP+ArolRziN2mI30uOhaYuu X-Received: by 2002:a17:907:2706:: with SMTP id w6mr2913309ejk.101.1628867454671; Fri, 13 Aug 2021 08:10:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628867454; cv=none; d=google.com; s=arc-20160816; b=hkCIDy59xPC7IEegJ77daIIt1Bykq9Cjrn5H3GrnfFdc+S8UByj54iSRAXmAzxjb2k U6LLEQvyk0TczVBSQGRb8099C3/Wdxyu3+1gHU7Md4NUBRZ2rU4jRhq7M9M9RCunajt9 hbKDNfHQOcN0lInlw/cu4W9jOKNQg3hrTfDsCjiZlcdeREfXeh77toLt0X499489GWJh p7e/4T8tysgPoJP4QT74IzbPUD615LOFTy5KTJCLTjVtLVQctw4YjdiN4Fn4nwL3YpiH XyNerdgifadGtQ4ONuW0mUc65IC69TLghxF76LtaeMqsSu8Al+NHpK78+M3tEpAdtYc4 Ok4A== 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=zCNEfr2Uq467fWuuq9mUJV/NEN+ElEzvntCu83TXWDQ=; b=F7xzXm8AbUh9odpKcYsq7pPWkFNRGdvDTGsrDBcUIMui4XH3FSsoEGj1dGyaxyy/0x y+V6xDx6eJkH8dDu1gSFGO+4FuWyzKbuGhs8e0DBH1QSb290zM7KYsPYiZgsnXECgcij 0hn/lTZn1vFrp6TY8roI2NHGm2kWd3sX19vKqXSwA1t5EVwkrGWzsslJpZohE7S0I6Xd KAdFoqF18YdoFfQXWUTvAinCa0ThP1jzZgz2iisz33IiOTUJRRp7svf3yleE8sWmhkHX Pn5c5167GZaP/AhUle5Zyq2k/qGDZE1MY6Rqo/06qvMLRvx0Rw9YOkh1FfgOP9B1OWPF CsvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TRXkNzBH; 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 n15si1909337ejd.124.2021.08.13.08.10.30; Fri, 13 Aug 2021 08:10:54 -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=TRXkNzBH; 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 S241206AbhHMPJC (ORCPT + 99 others); Fri, 13 Aug 2021 11:09:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:51406 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241235AbhHMPIz (ORCPT ); Fri, 13 Aug 2021 11:08:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 74F1261103; Fri, 13 Aug 2021 15:08:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628867309; bh=3/4sIaaFElelnzWqEYEbJuoxm01lynaT1jMQ92lvVTw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TRXkNzBHg42QFuPJdYpKTdcFaVr/FcmosBF6yegMZc/anaRyFrXpS5Zs5qzIPLT5G d/mLAC/XiNnsg1KipNNs26N0Q5hRErZrxbjtntLVsWWLjnEbWocR7u/CBwEzJwGhre t+lHQymCgQA6/2mC+vY8lEAoLsReaaghCtc0xuD8= 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.4 21/25] net/qla3xxx: fix schedule while atomic in ql_wait_for_drvr_lock and ql_adapter_reset Date: Fri, 13 Aug 2021 17:06:45 +0200 Message-Id: <20210813150521.404196201@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210813150520.718161915@linuxfoundation.org> References: <20210813150520.718161915@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 192950a112c9..cb9d43c871c4 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"); @@ -3287,7 +3287,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)); /* @@ -3323,7 +3323,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