From patchwork Tue May 4 17:24:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jari Ruusu X-Patchwork-Id: 431621 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=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS 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 1BA09C433B4 for ; Tue, 4 May 2021 17:24:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E5786613AA for ; Tue, 4 May 2021 17:24:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230328AbhEDRZi (ORCPT ); Tue, 4 May 2021 13:25:38 -0400 Received: from mail-40138.protonmail.ch ([185.70.40.138]:38868 "EHLO mail-40138.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230319AbhEDRZi (ORCPT ); Tue, 4 May 2021 13:25:38 -0400 X-Greylist: delayed 108008 seconds by postgrey-1.27 at vger.kernel.org; Tue, 04 May 2021 13:25:37 EDT Date: Tue, 04 May 2021 17:24:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1620149081; bh=4VXUpqUkQHnQnHXSQVZldgHqnsafUJMYO36/7cP3I44=; h=Date:To:From:Cc:Reply-To:Subject:From; b=eSbIrYpHihhLoFfhYrocltw8AKCHo97bh2r4Av2mubvrcDvjOoVifAQkLJ5uX/OLy uBgSoaqTz+RHbOuc7uOOR3rfFacSpmAHpgCX4yF3+kceituh8tIyETgGVAHYLFp84r 8ekwY8CWO7GDhYecsIPmY3NclDVDz1eOv88KBHLc= To: Greg Kroah-Hartman From: Jari Ruusu Cc: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" , Jiri Kosina , Kalle Valo Reply-To: Jari Ruusu Subject: Backport for 5.4 and 4.19, iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_gen2_enqueue_hcmd() Message-ID: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_gen2_enqueue_hcmd() upstream commit e7020bb068d8be50a92f48e36b236a1a1ef9282e, backport for linux-5.4.y and linux-4.19.y (booted and ping tested) Signed-off-by: Jari Ruusu --- Jari Ruusu  4096R/8132F189 12D6 4C3A DCDA 0AA4 27BD  ACDF F073 3C80 8132 F189 --- a/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c @@ -705,6 +705,7 @@ static int iwl_pcie_gen2_enqueue_hcmd(struct iwl_trans *trans, const u8 *cmddata[IWL_MAX_CMD_TBS_PER_TFD]; u16 cmdlen[IWL_MAX_CMD_TBS_PER_TFD]; struct iwl_tfh_tfd *tfd; + unsigned long flags2; copy_size = sizeof(struct iwl_cmd_header_wide); cmd_size = sizeof(struct iwl_cmd_header_wide); @@ -773,14 +774,14 @@ static int iwl_pcie_gen2_enqueue_hcmd(struct iwl_trans *trans, goto free_dup_buf; } - spin_lock_bh(&txq->lock); + spin_lock_irqsave(&txq->lock, flags2); idx = iwl_pcie_get_cmd_index(txq, txq->write_ptr); tfd = iwl_pcie_get_tfd(trans, txq, txq->write_ptr); memset(tfd, 0, sizeof(*tfd)); if (iwl_queue_space(trans, txq) < ((cmd->flags & CMD_ASYNC) ? 2 : 1)) { - spin_unlock_bh(&txq->lock); + spin_unlock_irqrestore(&txq->lock, flags2); IWL_ERR(trans, "No space in command queue\n"); iwl_op_mode_cmd_queue_full(trans->op_mode); @@ -915,7 +916,7 @@ static int iwl_pcie_gen2_enqueue_hcmd(struct iwl_trans *trans, spin_unlock_irqrestore(&trans_pcie->reg_lock, flags); out: - spin_unlock_bh(&txq->lock); + spin_unlock_irqrestore(&txq->lock, flags2); free_dup_buf: if (idx < 0) kfree(dup_buf);