From patchwork Mon Aug 3 08:56:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 11697629 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0925F138C for ; Mon, 3 Aug 2020 08:59:13 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D5EF62070A for ; Mon, 3 Aug 2020 08:59:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="gWKMl3Du"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=Synaptics.onmicrosoft.com header.i=@Synaptics.onmicrosoft.com header.b="FGHgE6y/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D5EF62070A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=synaptics.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:To:From:Date: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=aFYROSXI8Jz7+28bTGrvUtAQP6IqBDWdz7F040GhJ2Y=; b=gWKMl3DuZPtQOLdo8NKfwhQ1c9 WuTSBznHy0Vk3FCFzi6A6tg7faGrLzV7pbKqUL3COL3xnpguO8HtYG4vJfrcoyPp4JCu1HpKn8d9T PyIrleEyuI4tzMhNh7xseG9TdtQZPF7ueKh+DoB0U+Sc7TFGqRdEi6cq7E+uWOsplkdEHlC824c6Z uZauTjq8jH/sLYxcvCr7PpFU95VMEXj28jutWWKV3gFTXayMYl4kky9M2p9vyIvaY65AUr2A2Rtwl x9qO6FeO/kCINjrJoDCnhAMVEy8zenwSGDFR8oOJGAC7tHU3fDIj2AeexVVf07s09EbD5Gb8HKeyt MES4cjjw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k2WHd-0003Gr-N3; Mon, 03 Aug 2020 08:57:25 +0000 Received: from mail-eopbgr750048.outbound.protection.outlook.com ([40.107.75.48] helo=NAM02-BL2-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k2WHa-0003GF-OB for linux-arm-kernel@lists.infradead.org; Mon, 03 Aug 2020 08:57:23 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g8K4QE1MlGjPZinTbAdmW0yvIR6273m8yZg3asdC4yJdmoIvlxq8ybO4ottl4x1ZjfOJImIP2JEazmVxF7Ak41oDjxQrU9osFhrIOdtfuhimaZSvrKpQS6RDoCZ/IEcgZQ9D6+QMwTEKZWvgmorOJ8M/DSZXftDXfLvGs89ekjseYh28CvucOVGBcxaXgG0M3kgWZpeGzg2Nc4r0QdbcizHENd9HAcp2bc1GWFQSXEgg6p6rpy8f0P7KMNU/Ch6O883K1suVmEvYH2nKLSIaceGk/uO7RdZ1aA/xVg7y3aRZi5rxLd3qfmIfHcAJ1oiz3ajbXRARlHtU32BmKXQZgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CydEfDRwmajU2XoV4YQmb03N8esx268Olbs2N/mk5WU=; b=j7hyVq0S+Xlr2sQaKNaepLdWjcCQO7TOSNSmqkF3Jmk2Q5sWyhegYoA36p8RkoFEVNTRVXzQ9Uod793HBn4PbiGvyNtYpIzr9HTLE2ea6hxvNSYyThefx1Oe9rvrXundyojLCpa7CAD7UVQu4Q1EdIAeriZ+MazLblMpqEMVv1Dj60aiwfKcuJESmh0Mq0kCGhhTGmFLCqWKJXHhnHzX1I0QPHsD0uRsOZRxQH6QYYbzhbGe5iFQx+GHOI/cmRFqPrOTcbU31rS7jJV8q63Ls9LvzEENyr4cJNGBEQOSfTvYaKhdnM/QcKBoojdjYzcM++n1OgDi4cQPAE6X2p4cjg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=synaptics.com; dmarc=pass action=none header.from=synaptics.com; dkim=pass header.d=synaptics.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Synaptics.onmicrosoft.com; s=selector2-Synaptics-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CydEfDRwmajU2XoV4YQmb03N8esx268Olbs2N/mk5WU=; b=FGHgE6y/UOqtvpdxAO4a0jI0B2tci7UhiGEYWOIjTvlcFKsi2oHAbdHlabxAHjVWDxCaz3mLNNJdBgSQgPog1Ryw6ACwBvGJ4/IwDFisHOTgaJz00GR/HydNNGLVOd5LsbvNg2uX96R2SH3gSV/z/iFLiT9kRVqYmip8sJA79o4= Authentication-Results: st.com; dkim=none (message not signed) header.d=none;st.com; dmarc=none action=none header.from=synaptics.com; Received: from DM6PR03MB4555.namprd03.prod.outlook.com (2603:10b6:5:102::17) by DM6PR03MB3498.namprd03.prod.outlook.com (2603:10b6:5:ae::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3239.20; Mon, 3 Aug 2020 08:57:18 +0000 Received: from DM6PR03MB4555.namprd03.prod.outlook.com ([fe80::d9af:b798:6945:27b]) by DM6PR03MB4555.namprd03.prod.outlook.com ([fe80::d9af:b798:6945:27b%3]) with mapi id 15.20.3239.021; Mon, 3 Aug 2020 08:57:18 +0000 Date: Mon, 3 Aug 2020 16:56:47 +0800 From: Jisheng Zhang To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Jakub Kicinski , Maxime Coquelin Subject: [PATCH net-next] net: stmmac: fix failed to suspend if phy based WOL is enabled Message-ID: <20200803165647.296e6f21@xhacker.debian> X-Mailer: Claws Mail 3.17.6 (GTK+ 2.24.32; x86_64-pc-linux-gnu) X-ClientProxiedBy: HK2P15301CA0008.APCP153.PROD.OUTLOOK.COM (2603:1096:202:1::18) To DM6PR03MB4555.namprd03.prod.outlook.com (2603:10b6:5:102::17) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from xhacker.debian (124.74.246.114) by HK2P15301CA0008.APCP153.PROD.OUTLOOK.COM (2603:1096:202:1::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3283.2 via Frontend Transport; Mon, 3 Aug 2020 08:57:15 +0000 X-Mailer: Claws Mail 3.17.6 (GTK+ 2.24.32; x86_64-pc-linux-gnu) X-Originating-IP: [124.74.246.114] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0d6f6ff9-865b-4a33-3d9b-08d8378b396c X-MS-TrafficTypeDiagnostic: DM6PR03MB3498: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2CGl0osAMVqt62G2SIgSdCpSzz8Rlr5cd0L9NWvcieXUpfSjZH3mbffZRR6jKxEdfINlP7911sgNIWi6B2V5T/OQBhDXyQrnVclxr92x4NkX2HTNaumvcCu7GrwIqHWX9QRNzHw/+Ss09P+zCBghI8Rb2IFoXFu8g5FtKn0Ok/GBoXWzG1o7e9ixzkjdDWgL4N7VAATyRsDcmFK3u17yVlLwdSQrFLLTxA6NPh5tm6mtOIt2HcSXrNaAx40wBXU024IeV8hqxIGtpMC84OVyREvLlQRY+w6ryQ5Nl+ef74IUpqfdNToHmRAX/tCHTvAMQQzHKDozKn5tUF4V/oO7U1N1zBhpcsyHV04Y4duucnCvl8JlpdNc1ozswHV8Cd+e X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR03MB4555.namprd03.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(39850400004)(396003)(136003)(366004)(376002)(346002)(66476007)(2906002)(66556008)(15650500001)(1076003)(6666004)(5660300002)(7696005)(55016002)(66946007)(52116002)(6506007)(8676002)(110136005)(956004)(316002)(83380400001)(9686003)(16526019)(186003)(478600001)(26005)(8936002)(86362001)(4326008)(309714004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: Kiy53CcW+JBaPpvvvmzvspSh4JTWzKps9dMXC9fbvWvZOlRHev3xDbrnDO+4+TxnOyA8JjZj2mSonibpPpvqBcH158mxrGp/p8UZuF1MigOZmbQl6qYjMHUQljawwAv04TjxblMBeYw6nuOe4yUNm37OVmgh2bZJo0MudHoYSVQZSDi/f8zyDzBkiwd4CEePXNF6VdwLQ1gbN2FkYb4acojRWA6uN4TTaZTMe6noKTgKN6Iu4QS7H2l5rZU1WLkFLv02M9JHCIPyFelienNWHAmXEPwqzTGe/gyBNw0ZwLb5bpLJwOFemhTBz+cXKE94bboduYVgNRSUGdzumS4SK9SdCNXG/WMkDFc+CZJrzI60ot6lpGSmYoYyAJrsewlNrHBSrEfHJy/8Amkzl+1vjLUS/ztdlNEFTx2/mCvpSbJoj4W0uIv6NVlEgvIrGQ7tZ3rm095JiOo29262zkhfWI2XdshysWNo/IGsX6OeSPDQj6eJsMUH9A7wtUf8ChehpZKCngSqZIPBSTJ4hux0hkxhs5/Pf3EVAFYFTkz43Aq7QDG//gta2FYhd3pB2VeEuGY9xvxDORVFJzKLjuwKcV6MxUaHIbJViqyyBy4zVZoEUAHRbh/8PZXnBZsVwyvGs8zj+kH5eH0JI6ZJdZa+OQ== X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0d6f6ff9-865b-4a33-3d9b-08d8378b396c X-MS-Exchange-CrossTenant-AuthSource: DM6PR03MB4555.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Aug 2020 08:57:17.9480 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335d1fbc-2124-4173-9863-17e7051a2a0e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 81n3XWiI4mxvssZtA6kxNy09P6n7Mqu/tEmsHq7NhSShO7Jscp1Fu2etjGoDMUn8O69Q2jfbFBOx7Zoz+hBWBg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR03MB3498 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200803_045722_831800_C3C53281 X-CRM114-Status: GOOD ( 13.71 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.75.48 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [40.107.75.48 listed in wl.mailspike.net] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org With the latest net-next tree, if test suspend/resume after enabling WOL, we get error as below: [ 487.086365] dpm_run_callback(): mdio_bus_suspend+0x0/0x30 returns -16 [ 487.086375] PM: Device stmmac-0:00 failed to suspend: error -16 -16 means -EBUSY, this is because I didn't enable wakeup of the correct device when implementing phy based WOL feature. To be honest, I caught the issue when implementing phy based WOL and then fix it locally, but forgot to amend the phy based wol patch. Today, I found the issue by testing net-next tree. Signed-off-by: Jisheng Zhang --- drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c index 05d63963fdb7..ac5e8cc5fb9f 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c @@ -625,7 +625,7 @@ static int stmmac_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) int ret = phylink_ethtool_set_wol(priv->phylink, wol); if (!ret) - device_set_wakeup_enable(&dev->dev, !!wol->wolopts); + device_set_wakeup_enable(priv->device, !!wol->wolopts); return ret; }