Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp378370pxy; Fri, 30 Apr 2021 07:22:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZgF9Lkxx6uu87NBGgfhXOE+xPfoKIo1UIJ0/7T5CbSPzEgJoTq5MZ1afHNGiByuRaMsud X-Received: by 2002:a17:90a:a60b:: with SMTP id c11mr5612618pjq.125.1619792538591; Fri, 30 Apr 2021 07:22:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619792538; cv=none; d=google.com; s=arc-20160816; b=0cPvuzLGCX85IWLrzCJvVMvEcirmb+ILS6XhMTUC6HxEsQqIkm4muD42zRKxQw6SYo UoNRtAY2M0tTEqSVkZ7i9O3ig5/s9r/sgREDjCx9u4PCEKjfboeBYkuC72qYMLdtr8g7 nSramwtO7V/0uL8zcQRvsbIzaCPMz1kyCO9KDO2Q9VlB7ylmwNE//b6XXpoteEVyhIOW ejvxXoPS1hFGRgUIjolXp8VA+V1/d+YWZW2LhDpoigyo+LVy0j0kGNQeqfg5KdRIHGso cTu83DNGJ/PxIo/iPJvhYRNHZeXIiS0Gp1NL7wkC6zY6ej6Mw3PkhToglSQudxFUplSi 1RIg== 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=ULOKCw29MWWuCjy/ssctKpmUPa98wJU/buPx0ceYjWo=; b=l5WO5EH8Qh+f374d80BY50OMxh+eOh/1oIzJIQz1B7aVykO1CLsChPTbz/HUblA9/2 i7C7qRJJ5XSoIn6bRrYjwtwb6TsjkDn8Dh/QZmO+YL7Di7p8/Sss8O0QfZgbs44DY90f fNBWe7oi3rPswuSXPuivTgeR1+VmiYHs4gU3cOXMMugt/D8MUpefdVYscMAdQM0sAy1V IRS5ayEluc/QaPFfUXaYYBszL42eKlQV2OsIanlN2SbMC5mB4x/IV5VYGBfDV+IZPR/X r7pRgDLuoVYDTM/rI4snloOWBfKLAShQJK1FtEFeJk6a6D0/T0Hww8aMk3hkmcryJEaD ZEkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zWd32D1z; 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 z15si3419108pgf.291.2021.04.30.07.21.59; Fri, 30 Apr 2021 07:22:18 -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=zWd32D1z; 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 S233079AbhD3OVt (ORCPT + 99 others); Fri, 30 Apr 2021 10:21:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:58044 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233059AbhD3OVl (ORCPT ); Fri, 30 Apr 2021 10:21:41 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2FBD661450; Fri, 30 Apr 2021 14:20:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1619792453; bh=yY8fxTjX6OuivqE/J6SUM/vE4vFDOvs5H/wh4+0vNrQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zWd32D1z1eWgtMBCY9k3p8IWgPKzPNm0OQK5HcgQqTdJmIPiegcBgnrcZOHscOfc8 AN19sDnPSSDmMjGB/1T55h2CmC83O8wTerBC1RM2geeQWxMQdp62VCNuIrx24IbFcA hu7F/EVpDcT/eU5rx01C6uyW7NSW7JHT5yD1jD88= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiri Kosina , Kalle Valo Subject: [PATCH 5.10 1/2] iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_gen2_enqueue_hcmd() Date: Fri, 30 Apr 2021 16:20:42 +0200 Message-Id: <20210430141910.521897363@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210430141910.473289618@linuxfoundation.org> References: <20210430141910.473289618@linuxfoundation.org> User-Agent: quilt/0.66 X-stable: review X-Patchwork-Hint: ignore 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: Jiri Kosina commit e7020bb068d8be50a92f48e36b236a1a1ef9282e upstream. Analogically to what we did in 2800aadc18a6 ("iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_enqueue_hcmd()"), we must apply the same fix to iwl_pcie_gen2_enqueue_hcmd(), as it's being called from exactly the same contexts. Reported-by: Heiner Kallweit Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/nycvar.YFH.7.76.2104171112390.18270@cbobk.fhfr.pm Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) --- a/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c @@ -87,6 +87,7 @@ static int iwl_pcie_gen2_enqueue_hcmd(st const u8 *cmddata[IWL_MAX_CMD_TBS_PER_TFD]; u16 cmdlen[IWL_MAX_CMD_TBS_PER_TFD]; struct iwl_tfh_tfd *tfd; + unsigned long flags; copy_size = sizeof(struct iwl_cmd_header_wide); cmd_size = sizeof(struct iwl_cmd_header_wide); @@ -155,14 +156,14 @@ static int iwl_pcie_gen2_enqueue_hcmd(st goto free_dup_buf; } - spin_lock_bh(&txq->lock); + spin_lock_irqsave(&txq->lock, flags); idx = iwl_txq_get_cmd_index(txq, txq->write_ptr); tfd = iwl_txq_get_tfd(trans, txq, txq->write_ptr); memset(tfd, 0, sizeof(*tfd)); if (iwl_txq_space(trans, txq) < ((cmd->flags & CMD_ASYNC) ? 2 : 1)) { - spin_unlock_bh(&txq->lock); + spin_unlock_irqrestore(&txq->lock, flags); IWL_ERR(trans, "No space in command queue\n"); iwl_op_mode_cmd_queue_full(trans->op_mode); @@ -297,7 +298,7 @@ static int iwl_pcie_gen2_enqueue_hcmd(st spin_unlock(&trans_pcie->reg_lock); out: - spin_unlock_bh(&txq->lock); + spin_unlock_irqrestore(&txq->lock, flags); free_dup_buf: if (idx < 0) kfree(dup_buf);