Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3760615pxt; Tue, 10 Aug 2021 10:41:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxk9ZZQ/wwalzYsgVclM9EZeaRssfdI4mk43BfXBSwafpY+LZ3ZR/doTlU3DN8yB6FIlaZA X-Received: by 2002:a05:6e02:1d12:: with SMTP id i18mr281496ila.26.1628617275756; Tue, 10 Aug 2021 10:41:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628617275; cv=none; d=google.com; s=arc-20160816; b=vAbpC3Ycsr8M2lk0SAMC9fZ0HXoEeoRSsmoqmW3t1DmFgZFxS0UsNfdSH7MEY4EKay 4TeSHgl7zUYnw0CM9/xjL16kVa9x1DUQJHG7GSfqdOCkawZzMQX6JoccbU3ktsPuY5kB +Gt4HiUFOMRR7KarXUhs2Uf7ZdNf7JzOgO9NjNjhLH0KnGD5VHltX7XaS//DdMbzbMsY 18wOtnjzFE3rzCa65E269wgeHU9QCJifnCjmAp+XcfM+COZy14gR+N8ergFgaYkynkMQ JaAgX/bC7az/fOs/wmsX68STdZQvDWsH0rrjpWMp1ODRm5Cf6agUZDW4MVMYJdGphEQI CXwA== 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=man4EkgzLRPEiAV/f1BlSIaysiu8twYSjgWI6ERzHgM=; b=mg/dzG9S3tCWvNNU1cjHaBJSNYSwed44kBu+YP0km11hHnCMMreQJIA7rbPuXmoxia BSpETlZS+AF/dYOxWpu/9yCpIfujHnRNJQjz7oSscVdynS52r406te2DTb/pdqEprwza VSQnaMmFtPFykEiN243J0jOIR0WKziouVpz4dQkoL18kH+tIMU7eIX6Yo4+/brajooAK OY/vdYkr5UNHxli/WWGiNAnebTaWQfbxx8h/nwGNUUO1HxQbol4DO8k/sI8YiGCpjGD/ H4YwcRtTmO8uxZn9FNOA33oBdWRrOlkPrC6/nJdR82/vhpKyACHjbefpznWGE/rZEilZ p0DA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LZIjy5Yl; 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 e101si23682513jai.50.2021.08.10.10.41.04; Tue, 10 Aug 2021 10:41:15 -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=LZIjy5Yl; 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 S234485AbhHJRke (ORCPT + 99 others); Tue, 10 Aug 2021 13:40:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:42350 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234985AbhHJRiw (ORCPT ); Tue, 10 Aug 2021 13:38:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7D9C9606A5; Tue, 10 Aug 2021 17:36:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628616998; bh=Fr9fWJZ6P9hFkMTIaJf8zVHekJKi7LwuDtiSoVlG4Pg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LZIjy5YlbuFD+DMfhpr8k8MyyU1fcPambB9gJ+5Mhs2FaFjHjoJXNLz7LWhpaXKLD CUeIHE2olGmYh/6uKLW1UKh1qKzLPEW61HfJt3BwH2elGYYbF+yOEpI9UV45/yeXTQ 29w2XNxJuCUOjxGlRFmXmwKx1TQOgL2AOPTtYHrg= 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.4 84/85] net/qla3xxx: fix schedule while atomic in ql_wait_for_drvr_lock and ql_adapter_reset Date: Tue, 10 Aug 2021 19:30:57 +0200 Message-Id: <20210810172951.073260425@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210810172948.192298392@linuxfoundation.org> References: <20210810172948.192298392@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 5dc36c51636c..6ca2216e4058 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"); @@ -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) -- 2.30.2