Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4139114pxb; Mon, 8 Feb 2021 08:50:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJz6+hs2Ym483GHsJSln9rseHQ8hwG8SIWgfEQMbID7ZCBlrJ5C/7sHH3f1OHapW5Asv4jez X-Received: by 2002:a17:906:af15:: with SMTP id lx21mr17562718ejb.139.1612803020803; Mon, 08 Feb 2021 08:50:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612803020; cv=none; d=google.com; s=arc-20160816; b=etgFjw1sOHOEVd2gI6NowfWVyOkCVaAqVO6ouVMvhVAPxXuYfE+xutump1ZCAgJlwt Ow6F1ATIBSo6MC5MDi4tRcI6BJCTuo4hskqcMEZxlngxjdrjveUYBJ3eUnFGHIVgB6/8 B3qTDRVHELxOdA0ih/DgDbQYf6lDVXDDgYYl3qn5fb1+U4UMjbgp9uYVGVkQiSE5yuQO 9jP8ukftNtjhbA3Vx2HPjqpntwKeVprGfGC39WouAiLzoODcf1b5kP6d7OOtAXAVot4b m57kVNm0uckaK3luMF/cm5BHOynuWnGhd7OzFDJusfzI5MVJ16YtO9RRZQcdUha154SO FbDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=roebXqjmftf5AcGEtcHNUpTxsp5zoW+Gbb6bbK+0WQE=; b=M775p652dS345anLT7ZNr1ArWwxDjidOPhtDsN/0qhhOdjz3hIGmQ+iWR9b1y8q5ca Jc+8cUEtvxTnDo06LEgzDuA3+jJS/g6T3OJazUGsOsksR5dxizah3iR3iwEKuUxi7J7b jpPDA9eWn5PlQyCXPyNiSPLx5BNXKQrSPaq1+8+I2BaKVg0eYPLwSH5SWbw30lJkTA29 XCsPGKfxTgfoGm4Lgbux9Ur0EoP2sYWqxo7qGTVTEuBQwadONBvzrILgxkBgfWY3eeJ4 SglZ7inXLFggpJDUE2jC2yqpdCyGYtdNwO82DGTRiUn6Ay2Gks+3PgE2w79gElT26v8N B6ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QlrJx4Pp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t22si11257898ejb.452.2021.02.08.08.49.55; Mon, 08 Feb 2021 08:50:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QlrJx4Pp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234475AbhBHQqz (ORCPT + 99 others); Mon, 8 Feb 2021 11:46:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:32772 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233570AbhBHPQN (ORCPT ); Mon, 8 Feb 2021 10:16:13 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 575B364E8F; Mon, 8 Feb 2021 15:11:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612797082; bh=1nXBXdKfOELf7jr8kGkf0QOzPMOZdhYj2GdyYwNJQ0g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QlrJx4PpfGoI1rnrPsATX7xx5Mdm70Xd2xrCDUDwkBcfNRTB1r/NqG55yM3R41nvY tdTZPqwGqQ9PWzIq7BhZW9E+OvK5J7f5v6y5ALJcfCJEzgU79W/vVB8tHhr46418KE JCtZHCayTbxI9y7jw45EzCR5EAz/jGi5RUnHBBCk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Heiner Kallweit , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.4 19/65] r8169: fix WoL on shutdown if CONFIG_DEBUG_SHIRQ is set Date: Mon, 8 Feb 2021 16:00:51 +0100 Message-Id: <20210208145810.979039645@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210208145810.230485165@linuxfoundation.org> References: <20210208145810.230485165@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Heiner Kallweit [ Upstream commit cc9f07a838c4988ed244d0907cb71d54b85482a5 ] So far phy_disconnect() is called before free_irq(). If CONFIG_DEBUG_SHIRQ is set and interrupt is shared, then free_irq() creates an "artificial" interrupt by calling the interrupt handler. The "link change" flag is set in the interrupt status register, causing phylib to eventually call phy_suspend(). Because the net_device is detached from the PHY already, the PHY driver can't recognize that WoL is configured and powers down the PHY. Fixes: f1e911d5d0df ("r8169: add basic phylib support") Signed-off-by: Heiner Kallweit Link: https://lore.kernel.org/r/fe732c2c-a473-9088-3974-df83cfbd6efd@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/realtek/r8169_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c index 366ca1b5da5cc..1e8244ec5b332 100644 --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c @@ -6419,10 +6419,10 @@ static int rtl8169_close(struct net_device *dev) cancel_work_sync(&tp->wk.work); - phy_disconnect(tp->phydev); - free_irq(pci_irq_vector(pdev, 0), tp); + phy_disconnect(tp->phydev); + dma_free_coherent(&pdev->dev, R8169_RX_RING_BYTES, tp->RxDescArray, tp->RxPhyAddr); dma_free_coherent(&pdev->dev, R8169_TX_RING_BYTES, tp->TxDescArray, -- 2.27.0