Received: by 10.192.165.156 with SMTP id m28csp1070133imm; Wed, 11 Apr 2018 11:52:43 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/FoilrszS2LYeYmbvEtHzkU4usgrfGFtJp+5zIu6ELEalQ5yJ1F3JdkDhKCsUCbLxMYqsK X-Received: by 10.98.61.80 with SMTP id k77mr5088131pfa.2.1523472763185; Wed, 11 Apr 2018 11:52:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523472763; cv=none; d=google.com; s=arc-20160816; b=qt/IYq4kHMKtGs6H/xfk2jdTnxStnP11E4ZSCZt2fLtH/J+KtBLhWz9c5uuFOK36td y7wjRNaTc9GsnML50aFJrhnfV+fPdTokWkpXt35ZusNpFjv56XAmkPoCvIwfvUZ+aOpo YCPLWXVVEffiJuNW/ATLLPMwuYbIMCB2tqiPhsI+ARDEeT9EVg8yuxuQRQqkL4G7smCk e3qVHF5v5UiBacappBn+COAoedI/L0GjH40shHu8qWC/cE2Fv+3yzZeKys+d61TV2iZu XMVwRjEdsWEoOs9hfQBhdisRpQ0rFQnPcUn1kY42Nq4pPof7pVa5/Q1231nSuFDcYh+O pBRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=1Alawsq7jSAdcJHjHG6fJ5ZRCtY9Qrpz6X25FSWPeiM=; b=TjVI1VMjdE4Z98T4zAljMoUuVKWC7ylpMFwKORI5HFhp362Zw8S8iVU1RZWrdk8FES +QoES9tWMbnEunxM8ma/OpKgN3+BPbhYn/T3UcsN9xX7d/oh4jP+YGfAX1hc3DAcZamF BIhwhiVbhsiAACc/J1UOD7QsjRzN5aTfGqf2M/RnKPknoeKP9H3fWOMB349enM9u67vo MTDvoGn2AfGwR5CU04bghRe2JFzDZKcaT/FLCaP1K3q7sG/+in1gKdAsZschwEHSdRfe LZBtDYHHSsr/E+F1x39msMwAGeevOELVe5dbWtwjXoWv3kc3thwO7yV84fipcPmuBWYw JrOg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 4-v6si1672950plb.205.2018.04.11.11.52.06; Wed, 11 Apr 2018 11:52:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756064AbeDKSsX (ORCPT + 99 others); Wed, 11 Apr 2018 14:48:23 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:59630 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756016AbeDKSsU (ORCPT ); Wed, 11 Apr 2018 14:48:20 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id F13FFE27; Wed, 11 Apr 2018 18:48:19 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jia-Ju Bai , "David S. Miller" , Sasha Levin Subject: [PATCH 4.4 111/190] qlcnic: Fix a sleep-in-atomic bug in qlcnic_82xx_hw_write_wx_2M and qlcnic_82xx_hw_read_wx_2M Date: Wed, 11 Apr 2018 20:35:57 +0200 Message-Id: <20180411183557.408069945@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180411183550.114495991@linuxfoundation.org> References: <20180411183550.114495991@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jia-Ju Bai [ Upstream commit 5ea6d691aac6c93b790f0905e3460d44cc4c449b ] The driver may sleep under a write spin lock, and the function call path is: qlcnic_82xx_hw_write_wx_2M (acquire the lock by write_lock_irqsave) crb_win_lock qlcnic_pcie_sem_lock usleep_range qlcnic_82xx_hw_read_wx_2M (acquire the lock by write_lock_irqsave) crb_win_lock qlcnic_pcie_sem_lock usleep_range To fix it, the usleep_range is replaced with udelay. Signed-off-by: Jia-Ju Bai Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c @@ -341,7 +341,7 @@ qlcnic_pcie_sem_lock(struct qlcnic_adapt } return -EIO; } - usleep_range(1000, 1500); + udelay(1200); } if (id_reg)