From patchwork Tue May 4 17:26:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jari Ruusu X-Patchwork-Id: 431127 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 9736BC433ED for ; Tue, 4 May 2021 17:26:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 76DD96054E for ; Tue, 4 May 2021 17:26:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231579AbhEDR10 (ORCPT ); Tue, 4 May 2021 13:27:26 -0400 Received: from mail-40141.protonmail.ch ([185.70.40.141]:31365 "EHLO mail-40141.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231502AbhEDR10 (ORCPT ); Tue, 4 May 2021 13:27:26 -0400 X-Greylist: delayed 11017 seconds by postgrey-1.27 at vger.kernel.org; Tue, 04 May 2021 13:27:25 EDT Date: Tue, 04 May 2021 17:26:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1620149189; bh=VOuXsPA3D+q5QOcWnf6vc7Q/RxQzQx+++abTtPCYqrM=; h=Date:To:From:Cc:Reply-To:Subject:From; b=Et7VucL2B0TcLyz/Q884yy7jTPSfShYHKRqzgWwiaJKTds0oj04xDqA/PAYsuEB6v XxEJWEaFequpNgrVihnox6ov6kaVE0lD27A7Q8FMjlTg8JBwGqRA5L7tF1j2QFvdp4 6e/hNHXFntRr9xJt5MCi6CtPNO7fc+rjIYk5uAoM= 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 4.14, 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-4.14.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 @@ -559,6 +559,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 = iwl_pcie_get_tfd(trans, txq, txq->write_ptr); + unsigned long flags2; memset(tfd, 0, sizeof(*tfd)); @@ -629,10 +630,10 @@ 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); if (iwl_queue_space(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); @@ -773,7 +774,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);