From patchwork Fri Mar 19 10:43:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 405836 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.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_SANE_1 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 18310C433DB for ; Fri, 19 Mar 2021 10:44:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CF18E64F10 for ; Fri, 19 Mar 2021 10:44:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229785AbhCSKne (ORCPT ); Fri, 19 Mar 2021 06:43:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229524AbhCSKnO (ORCPT ); Fri, 19 Mar 2021 06:43:14 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 611F4C06174A; Fri, 19 Mar 2021 03:43:14 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id e18so8613701wrt.6; Fri, 19 Mar 2021 03:43:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:cc:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=8zTF3XjRrTXJesSju14px5T0UCOaTESdK/3HSU0rgLg=; b=K05cQOofbFZIG0kbTpwTS+LznsRUxV2WO9QkPRdn764odDfSBRZK6j0Ke4srMHyHQc qY0tqBPHodAgPe3F3HgiNvGIrul6OYJ7iSGyYmWdMFAdzBlnbagCUr/3Njar+f6QqQwz RMNAXRZtnrQCl9zxXg+r2zmmgI93M92Aa1xAv70pYMFRa8UOr0lzUH3M0X3KSdmkb3H+ sEm5S9whGpPR0RYsWMbT1B4Lq/8/qvjcTHScP/Aq/VJiqS1SdRITUBB0CGYF/TVndcHm 2tGrseFdSgbBHdPAe31oLBqbKtI9t24RgCbTzGLX0QyZg4FSUrlEgRKBxxrGZ6RUr26l YSHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=8zTF3XjRrTXJesSju14px5T0UCOaTESdK/3HSU0rgLg=; b=S3uBNZPCbOAh6VbiYC/vJTtMbASRWJcb8vo72WMmyEzdo9P/vYeiot0uqC0MW0n08n 748NK6Cfdd7ufQGjndirFGKq9M9cmsG2Yjmi5b+aTtWYGKKLDG7OphvBqKE4W6xLg1VR qQqdOB6fM+zJ3oBAJ6scbPPNobq8jee4sljdYtPiaegykYMd/8nTWh09Xs7fj7deuIzL nEx5kSCLy7WIDAd7rH3DWGinDh3B9VUZU1BAZ5tZl7Pfct+3Qbp8HV9gpL7Cc8Yg/4rY f1BcKRS9U1qrv4FSqGXtEn94JcpHnpx1XEbzEm/0GfcwgpfWLI3BVbcKYddZ5ztJ1PhS u6GQ== X-Gm-Message-State: AOAM530KxLQ/lw0nCSkbbGFbohDsOD+6HubQgYUjNcQaS63sHC6mexog BuBV/JrYnX6iHaBvEuNTenraM6SDGWUq1Q== X-Google-Smtp-Source: ABdhPJwZD4034lzcDKSxbKwA0wW2JjAkew3JLGDNYb/PWjf7aD0dITbpf7GzEoTN5e73IFdSvCFxKw== X-Received: by 2002:adf:fe8d:: with SMTP id l13mr3746264wrr.81.1616150592839; Fri, 19 Mar 2021 03:43:12 -0700 (PDT) Received: from ?IPv6:2003:ea:8f1f:bb00:fd2c:a424:dc3d:ffa1? (p200300ea8f1fbb00fd2ca424dc3dffa1.dip0.t-ipconnect.de. [2003:ea:8f1f:bb00:fd2c:a424:dc3d:ffa1]) by smtp.googlemail.com with ESMTPSA id t23sm7536601wra.50.2021.03.19.03.43.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 19 Mar 2021 03:43:12 -0700 (PDT) To: Luca Coelho , Kalle Valo , Johannes Berg Cc: Jakub Kicinski , linux-wireless@vger.kernel.org, David Miller , "netdev@vger.kernel.org" From: Heiner Kallweit Subject: Problem in iwl_pcie_gen2_enqueue_hcmd if irqs are disabled Message-ID: <0af0ac51-1e13-8406-221e-db2c31b3695e@gmail.com> Date: Fri, 19 Mar 2021 11:43:04 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org I get the following error on linux-next when bringing the device up. It's such an obvious error that I wonder how it could pass your QA. led_trigger_event() disables interrupts, and spin_unlock_bh() complains about this. The following fixes the warning for me. I'd say this means also commit "iwlwifi: pcie: don't disable interrupts for reg_lock" is wrong. diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c b/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c index 4456abb9a..34bde8c87 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c @@ -40,6 +40,7 @@ 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 flags; copy_size = sizeof(struct iwl_cmd_header_wide); cmd_size = sizeof(struct iwl_cmd_header_wide); @@ -108,14 +109,14 @@ int iwl_pcie_gen2_enqueue_hcmd(struct iwl_trans *trans, 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); @@ -250,7 +251,7 @@ int iwl_pcie_gen2_enqueue_hcmd(struct iwl_trans *trans, 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);