From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE766C432C3 for ; Wed, 27 Nov 2019 20:51:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B743421847 for ; Wed, 27 Nov 2019 20:51:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574887896; bh=ZdfIT4acldax/0aBpIDoPq29X7aqh95wXh2ik/TGRMs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=rwmz5o72n+2aoEQ8GITqP6uy139MBligcxW8AJy67XZjbS0EhxTLGhJTnYm1Rx4x/ R42o9W4IUEr+MVc01043DGHFm/RZXDNEr77XcMgIh+s6HfwjlKVMoGpEAgbA4Sp09i QQ0NHxFt0EL860olE3tjDZcuWuWLrPKgABsGtJMk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730507AbfK0Uvf (ORCPT ); Wed, 27 Nov 2019 15:51:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:38344 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730496AbfK0Uvd (ORCPT ); Wed, 27 Nov 2019 15:51:33 -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 8224521847; Wed, 27 Nov 2019 20:51:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574887893; bh=ZdfIT4acldax/0aBpIDoPq29X7aqh95wXh2ik/TGRMs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MpzaB/I0O9xXBubnLJOhbBvLp17yIKtDcUxAEM8EnjvodSuIgxfeIHLA6VgOygqhn pY3DAuKFupgyZIQ8dtsVHxQvk30RvPf7rEBi+oSX5c1z2wBtNn8YR1K7aZfPDrUGCT Bvx16kDDfUnEzA242Y8YGhdawANnoZCh7dM0BPNc= 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.14 133/211] wil6210: fix locking in wmi_call Date: Wed, 27 Nov 2019 21:31:06 +0100 Message-Id: <20191127203106.606165918@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203049.431810767@linuxfoundation.org> References: <20191127203049.431810767@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 d63d7c3268018..798516f42f2f9 100644 --- a/drivers/net/wireless/ath/wil6210/wmi.c +++ b/drivers/net/wireless/ath/wil6210/wmi.c @@ -1002,15 +1002,16 @@ int wmi_call(struct wil6210_priv *wil, u16 cmdid, 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_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, buf, len); if (rc) @@ -1030,11 +1031,11 @@ int wmi_call(struct wil6210_priv *wil, u16 cmdid, 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_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