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=unavailable 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 B42EAC10F27 for ; Tue, 10 Mar 2020 13:35:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8ECEB2468D for ; Tue, 10 Mar 2020 13:35:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583847348; bh=zelQCojRdjTRJfT/utokvhhGatHdiVoh5veId4tJeag=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=TWIkmjyjwirWKsgvwkckbf0tqvz1Qcp9jZ2E83zN2axTgP64QgIQl0ZrUJZVfXss/ jLx1X0QVUF8GC1t8D7PGJFb2FXND+6t6+96Ujrz7ca692K1U9kPxiNx8IFAVomdgEc emZdwna4MJpO8bQB/lgjJKoaYdMeOh0OBGCXk9hE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727668AbgCJMn6 (ORCPT ); Tue, 10 Mar 2020 08:43:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:44446 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726501AbgCJMn5 (ORCPT ); Tue, 10 Mar 2020 08:43:57 -0400 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 06DA924686; Tue, 10 Mar 2020 12:43:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583844237; bh=zelQCojRdjTRJfT/utokvhhGatHdiVoh5veId4tJeag=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m1DkBiyFMHB81QRoaEVnEF2rMml+6DKV/A4NcwESl6UZAWa5tbA4C2YLyX/TiVxNn eaZlulIdtsJ4ygoGoWCL5PtOG4pwvbQ5jC+LIqWk/rufXHA6trInUo5xk8/lrHxXHQ 9+nfforcqX/fJTU3GP5Cf8cr69sEkYJP3oRu0w9M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johannes Berg , Luca Coelho , Ajay Kaher , Sasha Levin Subject: [PATCH 4.9 01/88] iwlwifi: pcie: fix rb_allocator workqueue allocation Date: Tue, 10 Mar 2020 13:38:09 +0100 Message-Id: <20200310123606.848982431@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200310123606.543939933@linuxfoundation.org> References: <20200310123606.543939933@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 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Johannes Berg commit 8188a18ee2e48c9a7461139838048363bfce3fef upstream We don't handle failures in the rb_allocator workqueue allocation correctly. To fix that, move the code earlier so the cleanup is easier and we don't have to undo all the interrupt allocations in this case. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho [Ajay: Rewrote this patch for v4.9.y, as 4.9.y codebase is different from mainline] Signed-off-by: Ajay Kaher Signed-off-by: Sasha Levin --- drivers/net/wireless/intel/iwlwifi/pcie/rx.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/rx.c b/drivers/net/wireless/intel/iwlwifi/pcie/rx.c index a2ebe46bcfc5b..395bbe2c0f983 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/rx.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/rx.c @@ -898,9 +898,13 @@ int iwl_pcie_rx_init(struct iwl_trans *trans) return err; } def_rxq = trans_pcie->rxq; - if (!rba->alloc_wq) + if (!rba->alloc_wq) { rba->alloc_wq = alloc_workqueue("rb_allocator", WQ_HIGHPRI | WQ_UNBOUND, 1); + if (!rba->alloc_wq) + return -ENOMEM; + } + INIT_WORK(&rba->rx_alloc, iwl_pcie_rx_allocator_work); cancel_work_sync(&rba->rx_alloc); -- 2.20.1