Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp2824907imb; Mon, 4 Mar 2019 15:29:14 -0800 (PST) X-Google-Smtp-Source: AHgI3Ibk7DaJxwj+E3tVLsBpn3ViBi1qu6tcmA3NoXSSCihQXHk9kx/fsbR0gyOZ+5+y8PWyu/tx X-Received: by 2002:a62:1bd4:: with SMTP id b203mr22137035pfb.144.1551742154691; Mon, 04 Mar 2019 15:29:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551742154; cv=none; d=google.com; s=arc-20160816; b=C37W60xHq3IMw/kRGU3A3SwI6WA4fqV3YTGp0XD7IxbjqsiJmkE++NKJVrt/YwAEA4 PZQH5G9l8miG6jbOgWFkz2VVkWsPCoMLHoYiVqpR3073t2YSpAdcoGTtY837dUl5WJ2/ ryFWiKc6YRxkbA2OPThEhPEh6m7YFeyesinKOLWI657HJQrZKEG4Jktwtf0ouCy/ygIE 35tgbRR0qjvWNpQrHhwX+/l9WjavnMEycWFeQtpSW20QwDPG6FOWZKXf5eadOlLQISqh mVv73sISaKCQ0tyzbzAAVNVpqRgXKcECTGaI+h1pGjoIb7E6ch0z7GF+g+mUNDkOpHs7 3GvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=TP9ow76+2iHCis9tGduENGJXLBk6W+xs4yT24MZU1qw=; b=azfxt894riCxSPv/RPgZOiRZ2UEoU3lZzCullml17sk1Rm30vA1pV2Z2x5i02RJ5Lp u/jCPDP0Wap2TC1RTtYL7jPDuQya6cD70MqKZtjNzkQKnrRmAIPWX1484D04cB5IPvno aw74M1nLiKSMee37DCsbC8uLZo4w1sjUzgTLKx7eI9bvCRA6Ba07tK1/dZph0W0gkYaj pyXMJPWKRW53JLLZwQL2rvneUxzTbcjKq7vxGQwEzFJPOHlUUQMZeTs8kR4KRDUNpibn Sty/jbA9iSCxcB4/4PgpngZuG2U1vKBWWJbcY2iEfr7RswJV5gsXOdVR4UqV/TwgZSn1 juzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xilinx.onmicrosoft.com header.s=selector1-xilinx-com header.b=O60e3kd+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l77si6444770pfj.260.2019.03.04.15.28.59; Mon, 04 Mar 2019 15:29:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@xilinx.onmicrosoft.com header.s=selector1-xilinx-com header.b=O60e3kd+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726344AbfCDX2M (ORCPT + 99 others); Mon, 4 Mar 2019 18:28:12 -0500 Received: from mail-eopbgr760048.outbound.protection.outlook.com ([40.107.76.48]:62272 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726066AbfCDX2L (ORCPT ); Mon, 4 Mar 2019 18:28:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TP9ow76+2iHCis9tGduENGJXLBk6W+xs4yT24MZU1qw=; b=O60e3kd+/8CBH06RBsAp2wCw/YFGU0drNSwoSYCaPLdF1oz0nqk0qsESGnXLKan2GvvtGXaEwVzvQ5B2Jfdv5HmAi4YrnzJV5gOfE9bYXULjbkop4IAs2RJ/YAiOiX/PTNmX74SOw6tyPsMD6yhrpRDgn/DnyoOi2k9+6EDuD/o= Received: from BYAPR02CA0033.namprd02.prod.outlook.com (2603:10b6:a02:ee::46) by SN6PR02MB4224.namprd02.prod.outlook.com (2603:10b6:805:2f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1665.19; Mon, 4 Mar 2019 23:28:08 +0000 Received: from CY1NAM02FT053.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::209) by BYAPR02CA0033.outlook.office365.com (2603:10b6:a02:ee::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1665.16 via Frontend Transport; Mon, 4 Mar 2019 23:28:08 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by CY1NAM02FT053.mail.protection.outlook.com (10.152.74.165) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1643.11 via Frontend Transport; Mon, 4 Mar 2019 23:28:07 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:59849 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1h0x0B-0001Hx-4T; Mon, 04 Mar 2019 15:28:07 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1h0x06-00079T-19; Mon, 04 Mar 2019 15:28:02 -0800 Received: from xsj-pvapsmtp01 (xsj-smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id x24NRq5U030278; Mon, 4 Mar 2019 15:27:52 -0800 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1h0wzw-00077M-Gg; Mon, 04 Mar 2019 15:27:52 -0800 From: Jolly Shah To: , , , CC: , , , Rajan Vaja , Jolly Shah Subject: [PATCH] drivers: clk: zynqmp: Allow zero divisor value Date: Mon, 4 Mar 2019 15:27:46 -0800 Message-ID: <1551742066-10825-1-git-send-email-jollys@xilinx.com> X-Mailer: git-send-email 2.7.4 X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(39860400002)(396003)(136003)(346002)(376002)(2980300002)(189003)(199004)(2201001)(106466001)(4326008)(50466002)(9786002)(26005)(47776003)(77096007)(356004)(48376002)(44832011)(110136005)(54906003)(2616005)(50226002)(6666004)(486006)(126002)(476003)(106002)(36386004)(16586007)(63266004)(316002)(336012)(51416003)(305945005)(7696005)(426003)(4744005)(107886003)(478600001)(2906002)(8936002)(186003)(72206003)(8676002)(81156014)(81166006)(5660300002)(36756003)(107986001)(5001870100001);DIR:OUT;SFP:1101;SCL:1;SRVR:SN6PR02MB4224;H:xsj-pvapsmtpgw02;FPR:;SPF:Pass;LANG:en;PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com;MX:1;A:1; MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a85278b1-1233-4e79-a0ee-08d6a0f90efe X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4608103)(4709054)(2017052603328)(7153060);SRVR:SN6PR02MB4224; X-MS-TrafficTypeDiagnostic: SN6PR02MB4224: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Exchange-Diagnostics: 1;SN6PR02MB4224;20:tbZuq20oM/0tCu2UsgQfNO6Vw1cIRiT70wL5IxXbMDSIRZav+TxMLugGF+9OZ56v9Cdx2D/ui94fpPGCnYXT7TFBWx7euPVluI+RxmyGoL8HlPjaXZVdL7gSKmcE4q/vZ1sYiJ9X3vsoGCHE2PHXJW4ki661Du1o59mpOySi4WMjEHTcaEIEHoVFyDOSGwbcWVePtcf7LSSRXLedksuurkr0/V15fG8/gJ1YwJIFbRyUGV4Mx/VNhu0m+hT7PfRS8kV/cAJgkLgU1Xhnb/uxibLIRQZYr8VG4C2IUCRoDUUfqnlBPG7UIGXvWBG9RsH3kRqhxAZWH1ai5l00ELIz6cGXByK0r2hsha+aBT2jVG3LbaOQVMcH+Wvh+bdRKEZu7FZxQLhKqM+IIb/98nv2dr51Tm2MqKu+VPfnwI1ASddQtsUuG+G4tWrHUoJ4TYz9uOqjOdQlCNA/lSAx1VlzvrzX1fd+WPdQdrrZpCo/NGv0uIZJETZzWUSWCaiSUdUh X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 09669DB681 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;SN6PR02MB4224;23:c3hdkoqog1kA7HnW5rtHehESft/a93i5ZUJG2oD0M?= =?us-ascii?Q?jZTmgXtCkwUlN3bThh4VHdaYbtrPcdDZF4KLXx8mmFjN/uhDIEDzUprnzsyI?= =?us-ascii?Q?qupdR1CghnlEX8Xodq3Fg5xmX/FxAhNfhOi/5zteXqjVgOJqsjPrz7qaxGqm?= =?us-ascii?Q?7Hj04W2oc3hOpeIxIt85zjxEJQigNtfQv+kccrKl4+DxlUrZ4Ldbpz3SwWy2?=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Dc43x3EfV3RCPN1ZLuJAWx2mXyU5PF2IuIzhQtD?= =?us-ascii?Q?0VBOQMEmaCwTwMuh/thLoz2UDiU+6a1?= X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: aF4RJxHHJ8TLBEpnBkoy4dp6mQ8WHZZbUT6urqZ8qCdUs2NuhBg5ax9XM2VrA9KAcG/Qs+UvHa3JkG+1UxD+beiwwuAVKhh4JXgkmBmgo4gCrFXz7f0kc5Tbs406Jwx60rXvFe1eCCgyjZ8p0+RHMXrLaYLG45lJjgiKYeb5QceYtrmuArOMjiVc3IhtSRGp4Amq1cmfKHe07L6N+A2HbsnxvodDLy5SR2KjegRM60NUH2z+lvwa4XtMKat7XtRslKDVnxyeYhQzEdH0nMbUB2gL9E3nMKAk9m05XIDDac5M3TKyaGq4VCR6wLVzXYTzEvflwu54gV9lWS5f8/518WGRfpUOTh+yOwonlBuLPWfqmTBqbkoLoMnGDjnIFnoHImS7oCP0/WuVUNSX+4H5CSEnp6lEjWhZH3LRCSNI0kE= X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Mar 2019 23:28:07.5430 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a85278b1-1233-4e79-a0ee-08d6a0f90efe X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.100];Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR02MB4224 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rajan Vaja Zero divider is valid and default for some of ZynqMP clocks. Allow zero divisor when CLK_DIVIDER_ALLOW_ZERO for the clock is set. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah --- drivers/clk/zynqmp/divider.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/clk/zynqmp/divider.c b/drivers/clk/zynqmp/divider.c index a371c66..e146b6f 100644 --- a/drivers/clk/zynqmp/divider.c +++ b/drivers/clk/zynqmp/divider.c @@ -76,6 +76,13 @@ static unsigned long zynqmp_clk_divider_recalc_rate(struct clk_hw *hw, else value = div >> 16; + if (!value) { + WARN(!(divider->flags & CLK_DIVIDER_ALLOW_ZERO), + "%s: Zero divisor and CLK_DIVIDER_ALLOW_ZERO not set\n", + clk_name); + return parent_rate; + } + return DIV_ROUND_UP_ULL(parent_rate, value); } -- 2.7.4