From patchwork Tue Oct 27 13:49:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 290023 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=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 AD1B9C388F9 for ; Tue, 27 Oct 2020 14:31:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5D7B62225E for ; Tue, 27 Oct 2020 14:31:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603809061; bh=ODdMXT6rEqYE41sd1IuwIbG6hQnUrMyDYBUkElowpf4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=FShvG9fGn0DJoFxLrHJukEuCrma5paF/zuvqOw1YzLk1uO5xc9omAvgMrOx0UxJDy YEw4XmPdFVGBjnx7Ltgniml9MNJwO6cXbA7IZ1VhvKPBjeMS9IsYfEt4wbPQ97F5J7 ZoQN2okPgmprTKUZi+H2IAfJrzNOoD1uSB+ruGKY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2896827AbgJ0Oa4 (ORCPT ); Tue, 27 Oct 2020 10:30:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:56594 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2902103AbgJ0O3x (ORCPT ); Tue, 27 Oct 2020 10:29:53 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 F044820780; Tue, 27 Oct 2020 14:29:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603808993; bh=ODdMXT6rEqYE41sd1IuwIbG6hQnUrMyDYBUkElowpf4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2cEQfwXdTkRBbhWI3rpCJi2cjhNh5uvO3+sidN2O1X+VDOfRM3wbKDSaS/yi7yoAK tWLLehCaBNTvHP93MvM3j6ShRSs8Ry1/7J7bForTNqL+X06PWCg/4HnGt/XHtg1a4j ourjOQ7Wxd3aJ8020wQ9r+3rZqLEwdWkijQAeVEg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Heiner Kallweit , Jakub Kicinski Subject: [PATCH 5.4 036/408] r8169: fix operation under forced interrupt threading Date: Tue, 27 Oct 2020 14:49:34 +0100 Message-Id: <20201027135456.754963604@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135455.027547757@linuxfoundation.org> References: <20201027135455.027547757@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Heiner Kallweit [ Upstream commit 424a646e072a887aa87283b53aa6f8b19c2a7bef ] For several network drivers it was reported that using __napi_schedule_irqoff() is unsafe with forced threading. One way to fix this is switching back to __napi_schedule, but then we lose the benefit of the irqoff version in general. As stated by Eric it doesn't make sense to make the minimal hard irq handlers in drivers using NAPI a thread. Therefore ensure that the hard irq handler is never thread-ified. Fixes: 9a899a35b0d6 ("r8169: switch to napi_schedule_irqoff") Link: https://lkml.org/lkml/2020/10/18/19 Signed-off-by: Heiner Kallweit Link: https://lore.kernel.org/r/4d3ef84a-c812-5072-918a-22a6f6468310@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/realtek/r8169_main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c @@ -6418,7 +6418,7 @@ static int rtl8169_close(struct net_devi phy_disconnect(tp->phydev); - pci_free_irq(pdev, 0, tp); + free_irq(pci_irq_vector(pdev, 0), tp); dma_free_coherent(&pdev->dev, R8169_RX_RING_BYTES, tp->RxDescArray, tp->RxPhyAddr); @@ -6469,8 +6469,8 @@ static int rtl_open(struct net_device *d rtl_request_firmware(tp); - retval = pci_request_irq(pdev, 0, rtl8169_interrupt, NULL, tp, - dev->name); + retval = request_irq(pci_irq_vector(pdev, 0), rtl8169_interrupt, + IRQF_NO_THREAD | IRQF_SHARED, dev->name, tp); if (retval < 0) goto err_release_fw_2; @@ -6503,7 +6503,7 @@ out: return retval; err_free_irq: - pci_free_irq(pdev, 0, tp); + free_irq(pci_irq_vector(pdev, 0), tp); err_release_fw_2: rtl_release_firmware(tp); rtl8169_rx_clear(tp);