From patchwork Mon Oct 10 20:48:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shenwei Wang X-Patchwork-Id: 13003258 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 506E9C433FE for ; Mon, 10 Oct 2022 20:50:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=XuQGJSu8AUhu2zf7M3l8Wtxs63mH5SNzhPxOsmwxKyw=; b=npSK83fQf2KNH5 kbpcAVGt8a86OfVWutpQnpCWnSfWx3jkTlR/FJ+atJhDpYWv6qpex9VEDmYnja+XuxOxIY/xTkriK MLCIrh02eAYTo6EGfy5Gpy629jo64oa/ERHtsfX6WevhXjEwAc45364ghUy9sn5xCWBNlA0tNa8BA SjYJIYdjnNbcM3asoV1TfKWfieAoWoq6CMinw4TkZTAhCN4NR9dRMwbtm3lNfjqWmgzCDNC2h30ut OceXpe8oltyN1MylTLeouo6mdTbOauyZ1wGFSUCILKrcHdYslD5gMdzNAZY4c7ggG+zAGIRIzq3bl zYntrPN9EUYYDJ7IPtdQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ohzhx-002FlX-8x; Mon, 10 Oct 2022 20:49:05 +0000 Received: from mail-am7eur03on2075.outbound.protection.outlook.com ([40.107.105.75] helo=EUR03-AM7-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ohzhu-002FkS-88 for linux-arm-kernel@lists.infradead.org; Mon, 10 Oct 2022 20:49:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I2KpbApWShG2RHiLTtzZHU0+WRckxO9HhSEYZ6bIgz6nDMWlgHUfnbg/gH1xU9NxPJD6ySB4HvnKnu2uH9DMZCnONbFaf1QB/cPJg9v+gLnuclz45rN77jNK/1JUI6wkekME19suEy24LQZdmBmbeAPDf0d+4ngpxoHnNlVfuKewZEwaRRSAeiSsTC1PqTw8HOksWtiHw7FxVnJWOR94Qlb0gryJV1WbAeh/mqoURnWehKlzACARQKDW7GISUsY6dqq8F0kfBrJXXiWcI+OBfEypY8qsQQXDQo8xan4VnZX9Ebvxg7k5HV88SoKyyCkn8930d1chEhgUGrxtBgUo9w== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4ziL0ZJdG3/BSd2EePcpwNj1CvB27Ws5/zYaQ0SfMR0=; b=hueWPzpeljzxUz5YX6YH9SvRSjkk/ETGDP1OUz0EXm1v4qSCAFt22NSVZ2cVJHGY8e4aqWFigU+Dnkq51NkTUQ6/STConr9XC7ak59TIzbvplUosvPitxtPnTlBHyZRJsEhUnFj+JinJa4ghBQOophb0DKhu+Rd0zYrjeJ+F1VIuuIFb7+yQ9yZrjAwNCI9vNo9AHJIG3qH6x3vuFSCTJveszHE0YfegUtrrNmX/QYXlTtFWvPHUtKH5n5tY9VUO+WnmsIYE4yR/+MWpwP14KQfC+3Z3uHjkDmMovCQCJKP9SNJymMoEvLo3lgVn7IYjqRKzBAGkZQTvZWWO2bf4hQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4ziL0ZJdG3/BSd2EePcpwNj1CvB27Ws5/zYaQ0SfMR0=; b=JwRngmtCWFQoxpcq8SwgCBW6YME55kQqu0A/GfuUQBY8BSO2QKxnZf9mKwAWAIn+Oy9TQuqR4UrIEPEaby3rzs4e9n1ruvX8YvEQ5gYquMEhzFyplyxq1BP4niYR53gkcvSTbwn0kbfAd21wwX99F92CXeX3orqFMUawHnk6J6c= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9185.eurprd04.prod.outlook.com (2603:10a6:102:231::11) by PAXPR04MB8686.eurprd04.prod.outlook.com (2603:10a6:102:21d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.15; Mon, 10 Oct 2022 20:48:59 +0000 Received: from PAXPR04MB9185.eurprd04.prod.outlook.com ([fe80::4d83:404:c74a:7563]) by PAXPR04MB9185.eurprd04.prod.outlook.com ([fe80::4d83:404:c74a:7563%5]) with mapi id 15.20.5709.015; Mon, 10 Oct 2022 20:48:58 +0000 From: Shenwei Wang To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Russell King , Andrew Lunn , Heiner Kallweit Cc: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, Shenwei Wang Subject: [PATCH v4 1/2] net: phylink: add mac_managed_pm in phylink_config structure Date: Mon, 10 Oct 2022 15:48:26 -0500 Message-Id: <20221010204827.153296-2-shenwei.wang@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221010204827.153296-1-shenwei.wang@nxp.com> References: <20221010204827.153296-1-shenwei.wang@nxp.com> X-ClientProxiedBy: BY5PR17CA0046.namprd17.prod.outlook.com (2603:10b6:a03:167::23) To PAXPR04MB9185.eurprd04.prod.outlook.com (2603:10a6:102:231::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9185:EE_|PAXPR04MB8686:EE_ X-MS-Office365-Filtering-Correlation-Id: fc4e12ba-dca9-4371-ccd4-08daab00dae1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0bdkiT9APHqdTfq701pizcwJvIh82wFS/XeUKVX4dAmSfSEQIf43JRRiLgo1j8GWGvRLZ9hW/eXXJjgtEi8xatMBKKRSjSEHNu7MwR1FS9ug+QC3MhA90VAys0220amteGmvkzqnU9mwVN5WwGyzHqDPZDSI3NmXdSgmTlBeFRHKFYNCDyKUNM42F8P+Y6qkG5qyjuynAqE+QXKVIajnwfF2ItWyc7fwvUy4PSvT0S5xxfaa/p8GWG1s1pSor038tnSiFrJvKv0zu64YEA6h3oKzX4b0r0l58Y9eueeRIOw6S6eNibCEPAgMUxr8BaYL5cwn9DXGQkQ2hgaj3uypqCLeIE0d4VAD6K4R0EJllIev/D1WmCjLkalLYZ1q+jMZQbHgTA6O30hjzkD/kKBhNwaRDUd/CZywfmjrLjpfZt6rD4qhgmXYZpNvVdjMGkdvp0lM/RuYtj0xc7dgfU1s4NuU77IRORwYkbBMKlb2he54Yj3ZTFc4n5BZV/0k6D/mHUn79k1ZEB8OLvo/9Tz32n9gxrQgzRzz7M8D4epDEkqTj/azz2rHtWGzDexg6GpVBQw3E+hrpHZFTZ0h+aB1hdvXulTpM2qXaTdPqGQQApDIRiv5a9x76EawrapjsmU20QmOSMB428uCPshoblycWhj0s35eFU8FOUDT9uZ2FmXhuLTN4z9vD/Nb3L2mdfGzjCePtsG61sfR/vNg1nigpM1s5TEuLz0jxo/d2D+aCqDY5fdjr8+pXOx1uDw4hLRhgRrWd9XrrqheDAVo80ZZlg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9185.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(396003)(366004)(136003)(346002)(376002)(451199015)(66476007)(36756003)(38100700002)(66556008)(38350700002)(4326008)(66946007)(316002)(86362001)(8676002)(54906003)(2906002)(7416002)(6512007)(41300700001)(44832011)(5660300002)(8936002)(110136005)(186003)(83380400001)(1076003)(6486002)(2616005)(6666004)(478600001)(55236004)(26005)(52116002)(6506007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: bG/rXRBNuYMsOBH1JgCky1U0HH62/aBNW/r85hebB9yn0JAz2kABAmCoWSE7fDDZeeJt9qKqQq8RgTTcKNQAHVvoJH1yPT3gRidbvE6LLdSthur8qB9ZRRFmGTaiHKgUmqG942Y4ezc2QFbnXXDRMeu4PRds0db61COc+KtxNgVOxpoLarBdbebOtIjVkSfblQ8ZIRCfDbITO/MYsWPb30dNU0tKpfGZju3myMS1PWJwggv8IFws5PIBYNuusnqdGzjY0UGtbAINwwHmuYBS1051+lZMIv81JXDDpTzLxehlGln2UQSD0gOonn1SMBblpCK5SAs+IsxrdG3fXZe4aOrJE3tfolsNHuVWUQ4aEx3tDl8snVyYpXNB62qoq3oTJpvLDDaZlfzwRSrSn1YcUCXkSIo1cEEUuBh6+mtIT0POUQrhF4g3FVrBM0LafoB0PRKi94erDAgr69WZKJ6ugJtp8Rr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wNeGC42uteL1PWQVJEaHDnBmzj6dUmNXBlpX31SiUcMjeUE4aGSn X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: fc4e12ba-dca9-4371-ccd4-08daab00dae1 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9185.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2022 20:48:58.8332 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: d+LTVLEB5jCYuR23/kXHboGVwDFm3ZlX3Pm6tsAFFHG/HnPvO7akIJ6rFRdErAqkGn2xVEMQ+io+EUvZ0/EE7g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8686 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221010_134902_310830_907A39A0 X-CRM114-Status: GOOD ( 14.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The recent commit 'commit 47ac7b2f6a1f ("net: phy: Warn about incorrect mdio_bus_phy_resume() state")' requires the MAC driver explicitly tell the phy driver who is managing the PM, otherwise you will see warning during resume stage. Add a boolean property in the phylink_config structure so that the MAC driver can use it to tell the PHY driver if it wants to manage the PM. Signed-off-by: Shenwei Wang Reviewed-by: Russell King (Oracle) --- drivers/net/phy/phylink.c | 3 +++ include/linux/phylink.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index e9d62f9598f9..8d54bbe14b6a 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -1439,6 +1439,9 @@ static int phylink_bringup_phy(struct phylink *pl, struct phy_device *phy, if (phy_interrupt_is_valid(phy)) phy_request_interrupt(phy); + if (pl->config->mac_managed_pm) + phy->mac_managed_pm = true; + return 0; } diff --git a/include/linux/phylink.h b/include/linux/phylink.h index 6d06896fc20d..a3adf7fe7eaf 100644 --- a/include/linux/phylink.h +++ b/include/linux/phylink.h @@ -88,6 +88,7 @@ enum phylink_op_type { * (See commit 7cceb599d15d ("net: phylink: avoid mac_config calls") * @poll_fixed_state: if true, starts link_poll, * if MAC link is at %MLO_AN_FIXED mode. + * @mac_managed_pm: if true, indicate the MAC driver is responsible for PHY PM. * @ovr_an_inband: if true, override PCS to MLO_AN_INBAND * @get_fixed_state: callback to execute to determine the fixed link state, * if MAC link is at %MLO_AN_FIXED mode. @@ -100,6 +101,7 @@ struct phylink_config { enum phylink_op_type type; bool legacy_pre_march2020; bool poll_fixed_state; + bool mac_managed_pm; bool ovr_an_inband; void (*get_fixed_state)(struct phylink_config *config, struct phylink_link_state *state);