From patchwork Wed Jun 16 09:14:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joakim Zhang X-Patchwork-Id: 12324601 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=-16.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,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 8116DC48BE5 for ; Wed, 16 Jun 2021 09:18:16 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 4E39A61107 for ; Wed, 16 Jun 2021 09:18:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4E39A61107 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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=ke/6uIRPTUc6jz3qsUu8/ffgQAA0Aben+ktV4ReY0Lk=; b=a9fFKO3rhbVbSg 7gUqHC18tDNTe6EK49JSySU5OVwM2rida186wE6daDn1J9FCkGeL/XJsw53HhcxZrCmmeZE9sgk9Z 3KoHMbXUR2CxFX8e24vOGNjPr3itCebtHwI9EpFbCg5Hyq75oSnuvZ3oFGBXMu94fpRuyvtezMQK7 Jy+TgUZmFZmM+dR3lx1PhvsThiIEaeq4c6/+UHfSwFHwB51ReLBrIHN6Z3BEXgLdzEp+6ajTusedF 07bmaLroFtyW4Z2w5xdC+QQivz5jPPMgoF+pOrNYBR5+lcNv4TyH5EOazQ1IhJT91pOSQlYs/6BMM Emg9GMsECWYEIWRUrtYg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ltRei-005Y7d-6U; Wed, 16 Jun 2021 09:16:16 +0000 Received: from mail-eopbgr150073.outbound.protection.outlook.com ([40.107.15.73] helo=EUR01-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ltRdu-005Xmb-8f for linux-arm-kernel@lists.infradead.org; Wed, 16 Jun 2021 09:15:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ieMOd+ARO1qTxMoQB9msDin4YxiS7S7RujlzV8Dm8PsBhW1NSzxvy3wEPYg+hyU8vFYa7helqjyZ5Yd+Gc4HsAc5IZGroTh53GpD0XODm5YsP0HHh2BDCSrlNkbEGjVTk65YIiRIAPp13GQfXoeeZVmJ4RAN27sMV9SS0woBJTr5WQzhDlcP80T5MtiVbhvKkdJpdIZDzoJtaJcmlMGVLnqQ4gfneR2q7gSVrMYz/n8Pe3VEWstFAitpvy+pPwfqwueo/ktUsrtlVzlzxyHmqDyFpgEGpZy7MfRi8ofZXOkQQw8QLCl1rm2PZDanj5rxNGBcOfQV/7hdwKhrgQ6IRg== 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=GUl1y4Jg7eMgXIC0FjWdnqzMrqLRLNIwrz3uZb/tj9o=; b=OFYbgunRCJ/nhEnbUaijZgqk5WZFQMG0uI7JcXOtl/bPCOSHzpsxMKjMFUIb7oNsVAHjCVHWCJwsK3gHfIs+anpSB7LWrtO4lyzH4DqJIYqeXhI0rrSpyWQo5uMXdpnaul0o7I8Sp3Hg5eFs51vtHBavNqegsMUIK2W4dICIxaRwVU3gT1NlgVbPhffsHQ7gIEm72s8ZjGJN//riuTZG/ic5n2maCTOJZlq/z+3eadRXdOjSu/J97cMGz5Fi96IhR5GgO5CIibcksglFUMHhliym+4fUy2dYL3cQNvYc9UHvxDLV5AWI06s8rHtmjE+kVuzOhYrOuHnVBdHUYkqcqw== 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=GUl1y4Jg7eMgXIC0FjWdnqzMrqLRLNIwrz3uZb/tj9o=; b=mN5oqSojA8sUN5GgVKVB7HOp20seVjDxcm+NUJ/XY0XGe/v8rEv0MIHS123OCRV7R1w+QSHU8qVsQYlpAyQ6WmGjmWaW5r6IdzO9jga/vIT0aFZ4qNnbc2RNZmvtM6zkgFU7/SVaHbnhxQ0IXwqyBJWiXyfwAEarqLPEP/MbqTw= Authentication-Results: davemloft.net; dkim=none (message not signed) header.d=none;davemloft.net; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB6800.eurprd04.prod.outlook.com (2603:10a6:803:133::16) by VI1PR04MB4735.eurprd04.prod.outlook.com (2603:10a6:803:53::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.22; Wed, 16 Jun 2021 09:15:23 +0000 Received: from VI1PR04MB6800.eurprd04.prod.outlook.com ([fe80::d48b:48ed:c060:78de]) by VI1PR04MB6800.eurprd04.prod.outlook.com ([fe80::d48b:48ed:c060:78de%7]) with mapi id 15.20.4242.016; Wed, 16 Jun 2021 09:15:23 +0000 From: Joakim Zhang To: davem@davemloft.net, kuba@kernel.org, peppe.cavallaro@st.com, alexandre.torgue@foss.st.com, joabreu@synopsys.com, mcoquelin.stm32@gmail.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-imx@nxp.com Subject: [PATCH net 1/2] net: fec_ptp: add clock rate zero check Date: Wed, 16 Jun 2021 17:14:25 +0800 Message-Id: <20210616091426.13694-2-qiangqing.zhang@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210616091426.13694-1-qiangqing.zhang@nxp.com> References: <20210616091426.13694-1-qiangqing.zhang@nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR02CA0081.apcprd02.prod.outlook.com (2603:1096:4:90::21) To VI1PR04MB6800.eurprd04.prod.outlook.com (2603:10a6:803:133::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.71) by SG2PR02CA0081.apcprd02.prod.outlook.com (2603:1096:4:90::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.18 via Frontend Transport; Wed, 16 Jun 2021 09:15:20 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 69ac9730-82e5-4917-ccb7-08d930a74568 X-MS-TrafficTypeDiagnostic: VI1PR04MB4735: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:88; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9n96qghcHXq3Lkr6lpUNTaRoqkkARIF1x5aFBAb1jbb32hHguaVUxxk9TYmXdq8UMSpQc+stRRyzcX6qvi4FFWLosEioDr1JFfgR+WOKv3SeurxOOyxfowQ4sxD4yyhEk8UoO3dsXHPtNivV2OrlCxHYEFrAD4+Pwp6NJ8polUZKkYtCGbeqOvNAsA+/0+A5XX+139RgHHEdn1QTW+EuMvwVCZ+/IoU0XxfK7+gSsQD6NmMLmvfH2RQsAUAnAsBUWSD+y2Orvcc0QLzxTMiUP0u3P0Wzf4OKtaVDw+PhAatYXc1y5b8Ta8ZGt79NmWgciiEkswrmrRv/A5lyJUMk9KYytx3sVELLZJxWd1NfP0GHYGoVmAFcYNtGBCNCpV5RUgZ/CMcvytnBPlby+4uOyZFwCgpNRQJdPgH74AHN10A8voF0UWZAYqqznmkKmio8NfHUlacyEhwOqwH1wQ+gXRrKIlQRzhQaV36p+ZIcusIh26/ShzcHx5+PNEGX8STFvJjR7vNq2tNC/JfTU4XLs+Ka9T0XxTcxhMPYCcWvezhHTzHuOcWPVjMcgwOLCcOt2yjhRA2ewvGhf23RMh9+wcoICy8yWRJn1kAJFSU1l1e29Eddvs047tTKaPMMjgV1gLmxv087LD4p1YRJr+heOqSkWYBzq+F3JqgHmanScmiuEwt4ITUPV3z3Oxy1Uupn X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB6800.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(376002)(39860400002)(346002)(396003)(136003)(2906002)(36756003)(1076003)(186003)(38100700002)(26005)(83380400001)(16526019)(6512007)(8936002)(38350700002)(6506007)(66476007)(956004)(6486002)(86362001)(2616005)(5660300002)(8676002)(4326008)(316002)(7416002)(66946007)(4744005)(478600001)(66556008)(52116002)(69590400013); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: R9uFp25LTkmoujxbVOZ72RypVA9+vvZlqSqGryRAEU7w7IJBQLjiG9RDjiHsWqkjwdT6raITBCigZNd0slc5b2agrUrcnw+vZ7pP/YVlA5gO1tBI5Kpus4Nofp1z+D7jqzb1lDcI2dFcb/t97naKd9P4rgAXukIzwqNlr1GzeJVMs5ev7sveIX+Hqc13OZqJY9fgpZigIbxqCfJTPTsHXsKs0CBpv/fM0TTxcncg3kNRn5s0wsqXi39EXuYD+s0i58UXs2fkwfHjuBnAAaCTkgsPveQRGHeFPupEzX1kSFemrvsp5yFnrCwfGIwOuCJY8D0nyrFk8xi13S78/kCmMFQpzAaFvd/vx4ssIbUSGQZxTDa+3+d2ibyWgDZAz7ZPkjPQsd0hjHwf+N4oV4EFnNMLv9eWzq5HCScYLM5XW3JnyJo0SV6HWF/bTwr3lmPlXPPTfxuUkw/Pud/lp0fQrw5WksGYgL9cFIQSdCQFdQJnf2wM23zp6PT0ol4CdxV67nE/bqxYof6TJ0ELCLvBL2hAlhBbiiacYRi3FnRp4htF3vrx4Zil5yHj95FCeDbK8pT4VD+iUU0LLa6oyUD0Hb4RsfON6X6MceZgQtpNwswCjCaLoR3C3VNN4kn3UJhIuknq4f9T2GrFCsULHnNmbBpyvf6oxxzoC1i8csqWTCaU6uvcVN5UmjSFpn68f9w06wDPf7VEPX8/G0fyVzz3IbxQQIxXiqqthPwY7H8FS+YqbSaxej8NiraG06/erSdKTEt+QOusJY1D3ckaXFPGTyKtqdPbRprB+kGI7TZzJp4WiU4t1wiDFkEKrm7jRcIY3uDSOsNb89KW8p3OLVKLXrZtQJdUvDu3xUuNBiFM4say8sj2xvdSPFyfbB3vCU0T2xSmQL3p2nN14aCtSuntt7gibhiY4kiuTHA8JVu/6w60wXEYbTVQXMi6qazf2v1F/XZ8pAvuXnK7o2OURbNFxDe1Qhe6SV/qASzbz0curhTHal5bXGkJGsgVTooWW363hDH2Yr6pjQcrYBNmV16igEpCT2pc9cQtsFfeOeQWKqheV9NqZXESxt3VZ1IfMo8ioZuLA/vymwBjkEG/8Ps3+fBi+AAPZY7uujh+31bNWmY9iZ808HN5UlQ8QEk5ANfOSH5i/ax3agMocpLhV1Bt+SRm/Zs/EjMTugEeuK/uX767JeVcUpfdlY3CSkQYN3t0UFhxyudIhsmZsShNRuHjcNCOAPhz8uvr6gkQO1f7Hcmynzx/qG5v8+kTuks+ZbmDGhUVq3lQ8Yru56Zq2opncDxnrfIbPoFtoSqeru3HWTiWxCSrcN0ggPhB9nq3rETL X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 69ac9730-82e5-4917-ccb7-08d930a74568 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB6800.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2021 09:15:23.4740 (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: 1OJ6HLmOPIE8UJvGxzNx1PS7lU5sn3gyQCQw4GFu9NKw9cgD33pKgcV68ejS3ZGILyQ8QErZ3FkmcCiv6Ev0nQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4735 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210616_021526_378752_A9ADB5F2 X-CRM114-Status: UNSURE ( 9.62 ) X-CRM114-Notice: Please train this message. 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 From: Fugang Duan Add clock rate zero check to fix coverity issue of "divide by 0". Fixes: commit 85bd1798b24a ("net: fec: fix spin_lock dead lock") Signed-off-by: Fugang Duan Signed-off-by: Joakim Zhang --- drivers/net/ethernet/freescale/fec_ptp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/freescale/fec_ptp.c b/drivers/net/ethernet/freescale/fec_ptp.c index 1753807cbf97..7326a0612823 100644 --- a/drivers/net/ethernet/freescale/fec_ptp.c +++ b/drivers/net/ethernet/freescale/fec_ptp.c @@ -604,6 +604,10 @@ void fec_ptp_init(struct platform_device *pdev, int irq_idx) fep->ptp_caps.enable = fec_ptp_enable; fep->cycle_speed = clk_get_rate(fep->clk_ptp); + if (!fep->cycle_speed) { + fep->cycle_speed = NSEC_PER_SEC; + dev_err(&fep->pdev->dev, "clk_ptp clock rate is zero\n"); + } fep->ptp_inc = NSEC_PER_SEC / fep->cycle_speed; spin_lock_init(&fep->tmreg_lock); From patchwork Wed Jun 16 09:14:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joakim Zhang X-Patchwork-Id: 12324603 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=-16.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,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 BD170C48BE6 for ; Wed, 16 Jun 2021 09:19:19 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 909DD61107 for ; Wed, 16 Jun 2021 09:19:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 909DD61107 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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=cFIt3HHaB3FBzVeReUT9nPrtzqMbvfQxQ7lXx60K6H0=; b=YpUj0Ym3bEuCvo oCNvbyPLFMZ0Iy9EH+uzWCWfEgDVzr+ODk60ZxM1hP8gNoCNhsf2aDaqZAabpBDJpkuXsO7GSzmKF EyCrwLNcqt0tQPjGvkrjHz3vNH4KCeGMZQSpSyS6YWbnizVDpTpULbUEcC3kveIiIOx5KqVSOwNsn v6ycwxyt720clZ4Y+RD3Cx9Kj04YNKy46JWXE4s3ZzsWvnyQOoRFQy1O/SdiBtOxPz21en834tqE3 SwsC7AEynbSB70lvad2hidzOBQB5FnKvU++eQqzWNYg3MKXL6H0FjuTHx/pnxUyRLsvQWWkj1VTzm cJco4bm46tMyF2Sgfqwg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ltRfO-005YPf-FM; Wed, 16 Jun 2021 09:16:59 +0000 Received: from mail-eopbgr150072.outbound.protection.outlook.com ([40.107.15.72] helo=EUR01-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ltRdz-005XqY-F6 for linux-arm-kernel@lists.infradead.org; Wed, 16 Jun 2021 09:15:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hFeqp2CZgjj8xriO/QAKBVAmeRgPGnJAV+5gvbwOoZJOHfY2XRBfyJRXzZrL/5IXZ96WIOEoCkGbi6nKx9z5W/GTeq9BM7utuWke+F6W1gy31VN8wJ2+HDKXDCC2DKJT1dR33wuT8UQo6CJtIpGxPmPjtNvzX+eFIVLSkVwheC73bCQMuMkAZ5eoRAxBF9l6obz/JO8Gjk/ZOo2G2LsOBdpusS/G9ra9oV3zBCRirls/aCyCs7Uk+E1LJakBJD+4QOrEMusI2xL/zWWqSvxVqnQpwBj4IzkmWxlGZqHeJZt4xyRAhrRTVQwGBnjXxqo89fi/KHr/LiG9XHrCuL8fww== 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=r8r0RcEEPidCAPGUlXARw+T2Pw8jT6UwcuOajhYiiWE=; b=aSl4KyAaYpChmyq0K72Xb9l3vypjcstFGqkjmEwLA29rAmHiaBfzjUqO8HURzo8i3ZF6Gh5ipo9AmimUHOdZizDcfAhD/KHQL+4RYI3BkgkK48TF8pGYCBF6JPTD4fRvQbzVgAKX01uQu358TNVIV4I9aH3crswTH23t91D+3/dls2b4ZyC34mnCVcvOJjNzvD8vyWHdYc69gPVTsXun8rYZWPq4K0aITrxIIXeWqailPjIjmXmtJA4u6cL/PgAJJQC7gcq1ElOuRVCy3w7iyjT5VFWAlinqMVjymdx79mqfoDfVA+X+l+9QtD+hTFl96XNhKmufPUS+VK+pwGWgcA== 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=r8r0RcEEPidCAPGUlXARw+T2Pw8jT6UwcuOajhYiiWE=; b=P7MNd1lA/4M2/5NvI9TgcNLZlx0sxz6V1TbM4YWSSKlgyW4xCWkTSODvbpYfWEHO2CTDkmeQxf7SYd/ncUmCk24zo9sn9K83BlXoulQrYELZmZ6M0JHnZWomnOw7EfiDwZBE69EKIdvSkJa5q7MhM8Mog0ZK7yA8RrmqA7zYCK0= Authentication-Results: davemloft.net; dkim=none (message not signed) header.d=none;davemloft.net; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB6800.eurprd04.prod.outlook.com (2603:10a6:803:133::16) by VI1PR04MB4735.eurprd04.prod.outlook.com (2603:10a6:803:53::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.22; Wed, 16 Jun 2021 09:15:27 +0000 Received: from VI1PR04MB6800.eurprd04.prod.outlook.com ([fe80::d48b:48ed:c060:78de]) by VI1PR04MB6800.eurprd04.prod.outlook.com ([fe80::d48b:48ed:c060:78de%7]) with mapi id 15.20.4242.016; Wed, 16 Jun 2021 09:15:27 +0000 From: Joakim Zhang To: davem@davemloft.net, kuba@kernel.org, peppe.cavallaro@st.com, alexandre.torgue@foss.st.com, joabreu@synopsys.com, mcoquelin.stm32@gmail.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-imx@nxp.com Subject: [PATCH net 2/2] net: fec_ptp: fix issue caused by refactor the fec_devtype Date: Wed, 16 Jun 2021 17:14:26 +0800 Message-Id: <20210616091426.13694-3-qiangqing.zhang@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210616091426.13694-1-qiangqing.zhang@nxp.com> References: <20210616091426.13694-1-qiangqing.zhang@nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR02CA0081.apcprd02.prod.outlook.com (2603:1096:4:90::21) To VI1PR04MB6800.eurprd04.prod.outlook.com (2603:10a6:803:133::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.71) by SG2PR02CA0081.apcprd02.prod.outlook.com (2603:1096:4:90::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.18 via Frontend Transport; Wed, 16 Jun 2021 09:15:23 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a8de3302-36f4-4fde-32f5-08d930a747ae X-MS-TrafficTypeDiagnostic: VI1PR04MB4735: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1002; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: z+gXvn0ffG/uEF/QGvjPlMtFG9ClQ9aCwREVpuDmNhKjka2Gfgv+KNUly3rtoEwM0IU6v3BWRFqlWpcSYukhKj8tVrXqP+WZex0dxI0ntZVoFKuz77vcwty+Gk5pjCzLJvMp005xoyy37Cwhnea7NM4G7r1vfnexputXHinBzotbBfq6iKN8y39EBwIqCD39VclnH7iYihBTLxaGtpg1ITpHCQCZg5I7PCmjHfRzw14ZveVVrTDvtnMUkN85mEYVafGJYbmTs057SDeVa5AQA4660hZPLioEi68CJv4Ci4KMSCXs9qQ8CP2uojWNkBqmiyGzsvxvFh6Pmo8bTU+cMWMdbTh1ysAFaIhcI1aoG/hPlL4udl8hfywg9vz9sAFsjpP8Wn6gthGj7OudAruFWdRqu0mfoEHOc8TqAWISqn+V1iCGm1e2XcQuIcoZRN7eLdilE6eOUySsJx0vethh7PqIyPCxo5xP66kkZlYgCShd3CeysvPDxf0WhDKVyUAB0jb+7m3TGVp5if+zJzb6W7JN3eeba0Hc9uSiF7XdNX643YgAvXtnllSCRsn/HYlYCHmcR6+Trj/ORELV7j57Pv1ygYZkhWgaG+jKO+DqsDVmaTO7w+G3XYzg8hZQwzn839B4GRhExgzYmUbNKD4CPMM1It6Q0PrShxdSc1EPKgSk6bP3fSEmS0Fz02d4tdrP X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB6800.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(376002)(39860400002)(346002)(396003)(136003)(2906002)(36756003)(1076003)(186003)(38100700002)(26005)(83380400001)(16526019)(6512007)(8936002)(38350700002)(6506007)(66476007)(956004)(6486002)(86362001)(2616005)(5660300002)(8676002)(4326008)(316002)(7416002)(66946007)(478600001)(66556008)(52116002)(69590400013); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8N2ATCvVgZwkOZLS9pIVMMaxDmqYhcFzEJBXXYx3lMtgjp52S5AAGvKSZOuXbeLSNqJffc1qjkQS1w4nMcc+YV5CWEJZHyZDcp5nzdWf3B/BVHtdF4RIzP+9U854yVyaXjsSO2imfjf2oVFQc+7Fxvolbtk2ELa8Oblj3+fGZARlOgKDvFNdxjcGohWef8ln/z/Ru5RyZWBvFWL+bcL6E5lfW+7cZhSEQTyBdhUg7bAjs3anvdMxH/bGuflFmT8xv+hVs0lvDIbrRWcKkk3PrIImUWb7L+Sq+Jhlhz9k1PJvcY0WMPc7MeGzEFHg3GXsfenDSORUKw4W2wL/Jwn8ugZZzUl26smsI0bGYd21oJ1hpfRb3aHo0qzMEzX936gLwzbb6SMJyB4/azopa5uygwdmK1myS2EvrAEMYE7igBYR50O8Cq8aFAPeIqrKkWQQQfjQD+9OJuDbJigxOGx8cJIFdSIAhzxcLQa9VWCvSMxMZkY1pH9uxPRL47J6RS3zfog7FqC6JKDPZzViNTFCBHJ/P6OLJHXEjFtO5edVQTVpDlN1cV7tSFQnOSVwDG5Ps+hYATQFgOrZX72FHTxlLz5savEk+ePOYNrpGhGiJJzeM/rb3r30tlGLP8DNX32LXo20Exc08bwMXvPPkMccCC8mWwkawBysxjmRaEut7tVkMPyt0W46M1nHychHhrHNMYFVoa2FWko+toABaGB7QKPLJ3Vu7dYqpxpnfXZYVz6tuCNIjH5hMq9JPM1BrCqT+OIpNHziQf0L5OmJPQDo14crgTdKpssRyQZHPy3/I1w0+fAuim/Q4nQTb89Mmpt2Jk3W32fC4mDzPc3T5fqlxGKgfJMzkMk4pRIwV28ulVB0OEdnuk7s+Z86f1ig9xphlUlvd4XISHDI1MW61tutp/3OZyYxzxkXh9onKAfdpJv2EAk8pYW6giSXcBeKgibW0ZDynQySjwhwJhICjU5n+Cd8LNLBFqzm1kk6igXzHsQnTyybdQkQrEici5StBy0FAUWEJCivxWzWKEERbgDFM7eD147/vGpJ+2rlv6cx3KHF+L5SISlEOx3ET1DOpeOPoprIGwJoH0KkmLOozbTBJOFUFqsLY9GJzQMtqAtptiKm5iOqbi7dLa38QrWlyf0cX7RksBxRcTef4cBOMeHgo3ql93163662924m4JatOxkccaY3nxw6kYEGE0dAmIF4JU3Cn+V/PU3S0bZ1KOKF82Z+EDQDggok2PmWPZF8fVDVqJ42f3HGRy9lSRlNM/W5gTWdjR6gVHUiIKHG8JaYHZYPNB/G8cLsh9qoHG876wQIjdw53s8zctXyXeqQZWkw X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a8de3302-36f4-4fde-32f5-08d930a747ae X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB6800.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2021 09:15:27.2833 (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: JN6St/3cSKzVEMdpOAgG2g/M/M/HOFcSEpdJ4AHC1rZB3FoitzXpIsZLhTzxM0eeyDqcSMVgsTqAx0X89YA9tw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4735 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210616_021531_556181_7948F933 X-CRM114-Status: GOOD ( 11.17 ) 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 Commit da722186f654 ("net: fec: set GPR bit on suspend by DT configuration.") refactor the fec_devtype, need adjust ptp driver accordingly. Fixes: da722186f654 ("net: fec: set GPR bit on suspend by DT configuration.") Signed-off-by: Joakim Zhang --- drivers/net/ethernet/freescale/fec_ptp.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/ethernet/freescale/fec_ptp.c b/drivers/net/ethernet/freescale/fec_ptp.c index 7326a0612823..d71eac7e1924 100644 --- a/drivers/net/ethernet/freescale/fec_ptp.c +++ b/drivers/net/ethernet/freescale/fec_ptp.c @@ -215,15 +215,13 @@ static u64 fec_ptp_read(const struct cyclecounter *cc) { struct fec_enet_private *fep = container_of(cc, struct fec_enet_private, cc); - const struct platform_device_id *id_entry = - platform_get_device_id(fep->pdev); u32 tempval; tempval = readl(fep->hwp + FEC_ATIME_CTRL); tempval |= FEC_T_CTRL_CAPTURE; writel(tempval, fep->hwp + FEC_ATIME_CTRL); - if (id_entry->driver_data & FEC_QUIRK_BUG_CAPTURE) + if (fep->quirks & FEC_QUIRK_BUG_CAPTURE) udelay(1); return readl(fep->hwp + FEC_ATIME);