Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3768399pxt; Tue, 10 Aug 2021 10:52:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyqKGl2CqQD0+9LSj984MplgH4bFEXYA96+ERh8f3SU1uQlrSxGwycgZLSgK7t3HPBvRIBD X-Received: by 2002:a02:7f4c:: with SMTP id r73mr2384016jac.95.1628617971789; Tue, 10 Aug 2021 10:52:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628617971; cv=none; d=google.com; s=arc-20160816; b=D4Ty4oHk42z8Dk1pVc1P1H641SAZB7f1gSH7TUS/+yQDS4UiegP+I/OeprLdcvxUyn /5pgWhCUEBSRJJR12Yd3DyKIYKUKdLQ4oVguSvXN2YqDYLP+y29oY2jydDgkDYK302+P LkfNMCkB+lD03iH3PdHYxRn3UJsZS4TbUa263nm9OtiQA74tCBl25TVVRa0c/sY2jZ/k xSXNgHUFbHMcwIy3AAl7bSo23/CIxzoScehoAZmBysWut7zm73S0LDMbPFMVgA8jB4iV 2ZjmWOgV0wIz4t9rtJC6MI8DR6ela0oKrqpEZc8CGJlbq9q50A3Pvi9Qzx1nbXJPkNHe cTDg== 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=WRR+6+TQ15pVeRziVEQ/W217uf9rkOa0Zhxfb0koqys=; b=hDXfz4OU6iGdbXMs5RCo1AlNB4eoewInni1Dh986PHssvfBdgIDc2iqrwl2F3nKlqq yVHGnFtaVz5+SmCo/5bsMn08ncymHrkF/PvHXoQ6D8+8Katig9TiC3jB3iRj4GoJ8ekH 9vPUbmvrELoCMtIwHICmalrxDKzOs4yspzpYRPsW/PwF8tfQMd1nFoCd5lkBds23DIM1 VCrS8TIg6OGG/vGekOSec67LWSoRRaYAS6eK2l81nd3L5KTAO4emdtj8zuzIMV3Q5UUk XQoBbyNwAfnskx1PjH/2ffa8tkhWfz4zz7vEXp+xLMAOT51LT/4E7TLxXcq854DsLCZl 6qBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ngz0bYHo; 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 n14si26418057ilk.78.2021.08.10.10.52.39; Tue, 10 Aug 2021 10:52:51 -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=Ngz0bYHo; 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 S233895AbhHJRwU (ORCPT + 99 others); Tue, 10 Aug 2021 13:52:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:54474 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233362AbhHJRtH (ORCPT ); Tue, 10 Aug 2021 13:49:07 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A0A7F61206; Tue, 10 Aug 2021 17:41:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628617297; bh=P3+TL1keUYZBZaLxIF3fHhzvn7Fe40RSSg5FJi9pLqg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ngz0bYHomQRpvzXVtX/h49JPydM/Flr/M/5Cg0xD9y5vq8Y5EW7BFAj94l1JipfWc hAlSghCTw3PetEL4Keyj/3YjyF3Bch5B5J02qw/lZAQpMac2gdvHOj3OeeI+kThAMy vEyjcl7tzCC8UeNL+udejgEoN8Apvz8Hm12UdLGI= 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 5.10 132/135] net/qla3xxx: fix schedule while atomic in ql_wait_for_drvr_lock and ql_adapter_reset Date: Tue, 10 Aug 2021 19:31:06 +0200 Message-Id: <20210810173000.295481628@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210810172955.660225700@linuxfoundation.org> References: <20210810172955.660225700@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 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