Received: by 2002:a05:6a10:8a4d:0:0:0:0 with SMTP id dn13csp875751pxb; Fri, 13 Aug 2021 08:13:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyF66tMHcUy74hpUqyOJ8i4Vpt3+mZ5JE7eRfsxwR51A/aU6mcO0GUO5gZbOGXpmBYH5V7G X-Received: by 2002:a17:906:38db:: with SMTP id r27mr3091248ejd.338.1628867624562; Fri, 13 Aug 2021 08:13:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628867624; cv=none; d=google.com; s=arc-20160816; b=sTa7eZhN4t7whYeijH3IT2nPc0zNG4gQWd21IKsdqF6XXjgPZ7MiINR5U+EHaP5xkD ybBbnI46DmfoE9N7PiXDN8ULCGPoxN3zT7UQUo6e2ppqLFZtrNR4OtUm4PfodQkDZiPk GZu2+AtYzTHvbKog61WA0asORJX+WNDV6Tq21DTPF1iW4QunCmTOSEEJMYohsZKuTZpN sma9TUhR/gyTolpYpvYImyamPlg0UOXtz65H98VxJV7qkCVEmP2D6QZXWCGcMCjoN2eL tDzK1QfDT9L+w0qLJsfWs4St+HQDm9XvwZI8mVKqmqX2YsQaj6D2SCMi1rG166R5r+IF 6kCw== 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=F7tPYp3mRgMrzvSffGdxnS7x9h8IS3MHwQtALuObJCA=; b=lmybXohpVPASNr9AUdXf4Mi4P24PvnOiE177+8KggR0coSfi+Whw1kB7dro34HuxVD tiEQF5kcPROX9t5kxx/N8rjqJci9Seu5X/gVycxPZDpe3jczurXjPPbrGvsjMqJmolcS hx7kZM6zJmD66WuHHs+xXhwL0zePeynPFXjh6G8qYBCjGVUcMi/W8om1Cwcl2AgkI0Jb WhNq6dcUEjybZFjG4/K9KhEctVQZq5q/0WItB5MpGumD8Bi7HTCSWhDg8kiMrVA0FmBs Vg86GxM+0drCxEpC/4ufXoQTQ39albJgI5DEU/NckpW59evK2SyMZqFMTSbcT0IiO/7N F9pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QEIk69dx; 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 j23si2298655eje.719.2021.08.13.08.13.16; Fri, 13 Aug 2021 08:13:44 -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=QEIk69dx; 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 S241891AbhHMPLT (ORCPT + 99 others); Fri, 13 Aug 2021 11:11:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:54086 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241738AbhHMPKi (ORCPT ); Fri, 13 Aug 2021 11:10:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7982F61131; Fri, 13 Aug 2021 15:10:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628867412; bh=0HwXxBgV4lUjdQgqjR5GL8H3n+p5DveIEMlAlZRdATc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QEIk69dxinuChl+hmmZ4NPv/I7VH8lLpOYfhJScJ4lSwRRI4NWYlhrZV6WUWXlreV WI5bsyx7jh3kBC33VMNgdBcZaWMc9CJWXyMQW30llihaupALILQX1ZB4+3EuSVjUk4 dtnCDp1a9e6Yia+EAGkahoyaaoYYqiWIpCe9Sn2Q= 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.9 26/30] net/qla3xxx: fix schedule while atomic in ql_wait_for_drvr_lock and ql_adapter_reset Date: Fri, 13 Aug 2021 17:06:54 +0200 Message-Id: <20210813150523.293477392@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210813150522.445553924@linuxfoundation.org> References: <20210813150522.445553924@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(-) --- 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 "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_a 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_a ispControlStatus); if ((value & ISP_CONTROL_FSR) == 0) break; - ssleep(1); + mdelay(1000); } while ((--max_wait_time)); } if (max_wait_time == 0)