Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp721252img; Mon, 18 Mar 2019 12:44:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqx5sppmbWU6W1MgZfgkj68GMcbT3Lxe1haCw3KHZrlYAgQXVL+XftaMe8jhbEL7lkuUMAOR X-Received: by 2002:a17:902:2bab:: with SMTP id l40mr20201543plb.273.1552938243359; Mon, 18 Mar 2019 12:44:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552938243; cv=none; d=google.com; s=arc-20160816; b=eu2dUsK7aCRi0pyfDTJlG4gihmoJkFUBjKMpclxxcGYmTweAatO0wDjrMq+fPUAfPP 7RWn7opLx5XdrgdjYvTGNoqJj3gtt3bnqTEvdLeWKNQfAY+Wy8P8WzgoerlvfhHzoDD7 0kyZlHMppygTKIuhLJzqSpjq4Cwf/vqvlOTsK2znV/Md16H2ns/S1LBNTAw5URtW/U0L UQgV7I8iRKMMOcBT2RPs0/xN+u5gCrbzA9OckTCJwhohNPOyzTP2uCPyYl8idQdVSItc sw9Vi8uyIFzwdaT8JXt2Y/AgGZSBRkpeROGDnEmRAbFW3Z596WE5pyPi828xdJeqkm2b Dg4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:user-agent:message-id:to:cc:subject :from:references:in-reply-to:content-transfer-encoding:mime-version :dkim-signature; bh=af7B+yZTB2bccoQOakAEpGF14nwsYNuUMo27iCY5aEE=; b=Tmd2ZGrVoRq5eBTrBH6Stp93eFhc55ZymGeg4jrl5jpk+Bx7qGYBq2vvIBb71/vv9X hmbmHQZyePVI3b9xo902bj3pTJQ03K2595+/D7BICyQ3nqFfR1bRwC3MgFbh9Ch85RTb sFV2GdW+Hh6JZlGfwwLMXmw1I60AFBancNuyTq4ErXN5eWgm9nrjJgwdlBF7RNgBEJZT xs+y2bheruykod+zAQPUGcWS6IXBkpbuX4+xQUssdYm4nVhRXlOjdvp0NHMgVJP8Jnxu ZD84TywPttg20Z2MDCwCz9AeDzOGzkFeX/ntjTS11Jpvp0tqFsPsCMIFWaEh+agjbt88 OfTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qVQlr9Bs; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z3si10218741pgr.90.2019.03.18.12.43.47; Mon, 18 Mar 2019 12:44:03 -0700 (PDT) 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=@kernel.org header.s=default header.b=qVQlr9Bs; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727642AbfCRTm7 (ORCPT + 99 others); Mon, 18 Mar 2019 15:42:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:35316 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727028AbfCRTm6 (ORCPT ); Mon, 18 Mar 2019 15:42:58 -0400 Received: from localhost (unknown [104.132.0.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B90AF20685; Mon, 18 Mar 2019 19:42:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1552938177; bh=jU0Hvq4xla+ij8ejd0tcj9NnaSuDFRrX9qP2lKseDPg=; h=In-Reply-To:References:From:Subject:Cc:To:Date:From; b=qVQlr9BsdYS76JtNhqSj3QIOxFKXc2z2VQs4TpCU1moyxOUfWM5U4IRjctLCKZUDZ Vu1L9U9Ak+RPqaSFOoYctYHU9ideR7weDasoC6n6rMwTkPjfqjmgE/Ba4TI+5UArKj ybH9dl6JzPXd8Z+mN6oUnWO/2qlJrXZvedq3ddec= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <15f0f82f-0607-4cf5-f5a5-5edd7c5321bc@xilinx.com> References: <1551742066-10825-1-git-send-email-jollys@xilinx.com> <15f0f82f-0607-4cf5-f5a5-5edd7c5321bc@xilinx.com> From: Stephen Boyd Subject: Re: [PATCH] drivers: clk: zynqmp: Allow zero divisor value Cc: rajanv@xilinx.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Rajan Vaja , Jolly Shah To: Jolly Shah , linux-clk@vger.kernel.org, michal.simek@xilinx.com, mturquette@baylibre.com, sboyd@codeaurora.org Message-ID: <155293817691.20095.7275560826051843640@swboyd.mtv.corp.google.com> User-Agent: alot/0.8 Date: Mon, 18 Mar 2019 12:42:56 -0700 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Michal Simek (2019-03-18 05:48:52) > On 05. 03. 19 0:27, Jolly Shah wrote: > > From: Rajan Vaja > >=20 > > Zero divider is valid and default for some of ZynqMP > > clocks. Allow zero divisor when CLK_DIVIDER_ALLOW_ZERO > > for the clock is set. > >=20 > > Signed-off-by: Rajan Vaja > > Signed-off-by: Jolly Shah > > --- > > drivers/clk/zynqmp/divider.c | 7 +++++++ > > 1 file changed, 7 insertions(+) > >=20 > > 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 =3D div >> 16; > > =20 > > + 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); > > } > > =20 > >=20 >=20 > Stephen: Do you want to take it via your tree? >=20 Sure.