Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp5994913ybc; Wed, 27 Nov 2019 13:05:33 -0800 (PST) X-Google-Smtp-Source: APXvYqzxBleMYCpwly24NRt99wxXYfNLv9EM2bxDYOLS+Bx789uEosQeZvFpRbrLCBRjvVFjaapU X-Received: by 2002:a17:906:7c5:: with SMTP id m5mr50714747ejc.231.1574888733808; Wed, 27 Nov 2019 13:05:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574888733; cv=none; d=google.com; s=arc-20160816; b=Bg35b3nOTh4FKmT1VgYCnMjadEWArplVMANzDiVUcQUHGOrzI47vMJL46AEbjQYzLR GnYDFZy1QJLdp+XeynXLJRBK5eN6WYwhjCaskwv2kC2Cn4ZQA2TIloLjbo/zeXmEIgd+ 12fg57wmZjoqLbRKATkuzSlfHKxRQ1q/z+S5GIcij+rwGOCVU0s3iKK0wViXz3xpaMBm hp30ZCKiP2/dp31WmmLM85MmGwlXkCr8uE8pxRNRBkeSUv+D7+TxJWNgENW+tW44PH+v GlbnbBE+Ty2nSIhY1rctC6jB1y8aC7EQJuNSbLfs4FN51GsE4jCMafa1Z9FMidlYnPXj 02SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0JpbuJZ12FMmJ79kpGO0j7SS72lys5Xbsh5RHh9ACRI=; b=U7/1c5cS0q+Aq81c5HW2opdCfynzdPL47gTgcU5CsKKxJvonwxS5SdRCWd1KX3bdPk 93vPgK4wJ1fijrQCtnQCEUng9+b9Ig3MGipAXwGjHVnXNPuDPkNuZNTY/iVwZwJ7sxYJ WyS7BkoxWl3XlZf/z7gkfV6/TC3CFG9r5P8qQbVmZ98qxR3xNi+5X/ih4zw/0urzcBG9 76BvrrNGsSl66hU0VY7agTx4fZQEWtg6pU6q/BvDXg2FDCSeY/M6+n/RjMVmQlOQyp8O 6RprxmDGVXjq5pEHHPkQLzhAc67R641Nhw4wzaxh/xRaF7Q2WEcr2HuzuZ6qL5rVUBuu H+AA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XqEATSGV; 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 si11si10490806ejb.71.2019.11.27.13.05.10; Wed, 27 Nov 2019 13:05:33 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=XqEATSGV; 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 S1731677AbfK0VEN (ORCPT + 99 others); Wed, 27 Nov 2019 16:04:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:57576 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731521AbfK0VEK (ORCPT ); Wed, 27 Nov 2019 16:04:10 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 368952086A; Wed, 27 Nov 2019 21:04:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574888649; bh=1EzmoxlhEX6IlHcaaJRCa8HqlvFEPSAV4f3se9ynVhc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XqEATSGVtfDAeM3v/59zDrtje653+l1feYJaqd15lYPHk4lsyKEHj5Urn/pebjcMS HQ/qZ60jzLn0W2OeqXY6lZwHkANlmGvlrIkLbx3wRDp2DTZg9+NRLv5SP7DG0tvSPb jLFe9YxvaYiwagmT9cYm+G5xvLV3AVc1FoYbUS4w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lior David , Maya Erez , Kalle Valo , Sasha Levin Subject: [PATCH 4.19 216/306] wil6210: fix locking in wmi_call Date: Wed, 27 Nov 2019 21:31:06 +0100 Message-Id: <20191127203130.864518018@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203114.766709977@linuxfoundation.org> References: <20191127203114.766709977@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lior David [ Upstream commit dc57731dbd535880fe6ced31c229262c34df7d64 ] Switch from spin_lock to spin_lock_irqsave, because wmi_ev_lock is used inside interrupt handler. Signed-off-by: Lior David Signed-off-by: Maya Erez Signed-off-by: Kalle Valo Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/wil6210/wmi.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/wil6210/wmi.c b/drivers/net/wireless/ath/wil6210/wmi.c index 2010f771478df..8a603432f5317 100644 --- a/drivers/net/wireless/ath/wil6210/wmi.c +++ b/drivers/net/wireless/ath/wil6210/wmi.c @@ -1639,16 +1639,17 @@ int wmi_call(struct wil6210_priv *wil, u16 cmdid, u8 mid, void *buf, u16 len, { int rc; unsigned long remain; + ulong flags; mutex_lock(&wil->wmi_mutex); - spin_lock(&wil->wmi_ev_lock); + spin_lock_irqsave(&wil->wmi_ev_lock, flags); wil->reply_id = reply_id; wil->reply_mid = mid; wil->reply_buf = reply; wil->reply_size = reply_size; reinit_completion(&wil->wmi_call); - spin_unlock(&wil->wmi_ev_lock); + spin_unlock_irqrestore(&wil->wmi_ev_lock, flags); rc = __wmi_send(wil, cmdid, mid, buf, len); if (rc) @@ -1668,12 +1669,12 @@ int wmi_call(struct wil6210_priv *wil, u16 cmdid, u8 mid, void *buf, u16 len, } out: - spin_lock(&wil->wmi_ev_lock); + spin_lock_irqsave(&wil->wmi_ev_lock, flags); wil->reply_id = 0; wil->reply_mid = U8_MAX; wil->reply_buf = NULL; wil->reply_size = 0; - spin_unlock(&wil->wmi_ev_lock); + spin_unlock_irqrestore(&wil->wmi_ev_lock, flags); mutex_unlock(&wil->wmi_mutex); -- 2.20.1