Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp56851imm; Thu, 2 Aug 2018 13:54:10 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfJVrUDC1h9Bx4pV3jvgf+biBBqsSWaJpXhzi2yZlfsSKXdJ6M5mTuUCLVH4jYcpklvAxaw X-Received: by 2002:a62:5ec3:: with SMTP id s186-v6mr1104361pfb.129.1533243250782; Thu, 02 Aug 2018 13:54:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533243250; cv=none; d=google.com; s=arc-20160816; b=uWlDzE2whrq+GhlqkpzdqOfb6UunL9omDLnRkHSUjCN70cyi3CsrrmmiMf2ZKZEoX0 szVN9/ABqiLTiJgs5UWqNvF4vjkFO2+iyl24S7DyEoiF5xe3PicmZ7dUf9svs5IjmYYP ZFktZeO6OzRXAg3Y9wQO5cRQ3ZDaaSoP1KSLsgANwyNMvEWyVEhRMXNoE35G0r7LSAPR v1YjIh96xPHqIiVg3YLss6Up9MCsTKKXbND9p01KiuE/MkLVnwdOdTbN6Xr2G3fruBXg +WKrs2mvDhTHih4JdZEfITKvTmLTbAzVJIDYQTGPVPFSFjDL0wTKxfKgKhqKWtTH63+h SXQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:subject:user-agent:message-id :references:cc:in-reply-to:from:to:content-transfer-encoding :mime-version:dkim-signature:arc-authentication-results; bh=wHBzWALFHn02b9lp0zLq5QNOqweNM711H3QBLAVmuBA=; b=Gohnji4PejOa8LFTe727PWhOFwpYkXlYhd45eACmqCgKa38UXgGER/acTsGhlXOP6G 51S9fT7iebkyd1Io5Ej0Fvytdg3bqamjYd87q5dN0+0Cv7PP1JbzkVDIy+ByLWEnFMmO /zLNbUfjqQ02Fb1ZAbtHna3urAclXdXVMOYBsYcebpmAaQVWVFOMExllzchQtdnLJCI2 P6CGxiZF6t1uzWh0tI3WSDTbha5897MV9mV+ARUS/PdhpPmrc02LpYnqBMy+3XcGPnhT EmgD/d30RlruNoQBQh8x1V+vbA9U/zasSpIFQf19MMGd5ooTMhNqNWcUGY5sLezfMgHc PzFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oACscB5G; 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 31-v6si2563648pla.129.2018.08.02.13.53.56; Thu, 02 Aug 2018 13:54:10 -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=oACscB5G; 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 S1732009AbeHBWps (ORCPT + 99 others); Thu, 2 Aug 2018 18:45:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:60638 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729774AbeHBWps (ORCPT ); Thu, 2 Aug 2018 18:45:48 -0400 Received: from localhost (unknown [104.132.0.94]) (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 A20E52154D; Thu, 2 Aug 2018 20:52:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1533243178; bh=hR/DSVcPp5Aigb1d835aeK4rfBJV3yNG0NVnXPNIrgw=; h=To:From:In-Reply-To:Cc:References:Subject:Date:From; b=oACscB5GdBPWEYNjdrCnXl8DHtfhfzja5iXLDkC1nNU3B6JwSy50ZIAEPmgZEIpeu amKstCdK5mAqoeHhetdyPrf7cv5bo+asYA2V3qWNdM4QhB4u3fbvbd5LIAk45JAFC2 153xvOSZwFDdW29OTwtD9WUUUw9uoHRYaNsvQSbk= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: Marek Vasut , Michael Turquette , Steve Longerbeam From: Stephen Boyd In-Reply-To: <9b8f68f6-dd88-cc1a-6f13-b4d2fedadead@gmail.com> Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Steve Longerbeam References: <1527818357-8154-1-git-send-email-steve_longerbeam@mentor.com> <153090140728.143105.7720351459587498082@swboyd.mtv.corp.google.com> <9b8f68f6-dd88-cc1a-6f13-b4d2fedadead@gmail.com> Message-ID: <153324317799.10763.16530922080427544645@swboyd.mtv.corp.google.com> User-Agent: alot/0.7 Subject: Re: [PATCH] clk: vc5: Avoid divide by zero when rounding or setting rates Date: Thu, 02 Aug 2018 13:52:57 -0700 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Steve Longerbeam (2018-07-18 10:56:51) > = > = > On 07/06/2018 11:23 AM, Stephen Boyd wrote: > > Quoting Steve Longerbeam (2018-05-31 18:59:17) > >> Add checks in the .round_rate and .set_rate ops for zero requested > >> rate or zero parent rate. If either are zero in .round_rate, just > >> return zero. If either are zero in .set_rate, return -EINVAL. > > Are you seeing problems when the clk is unparented and we're trying to > > recalculate the rate or change rates, and thus the parent frequency > > looks like 0? > = > The problem appeared when suspending the rcar-du driver. > The kernel tested is a Renesas BSP release (3.6.2), and in the > version of the rcar-du driver from that release, the driver calls > clk_set_rate() with a rate of zero in its suspend PM op. This is > fixed in mainline kernel. So the divide-by-zero in vc5 clock driver > probably will not show up in mainline. Ok so then this patch shouldn't be applied on mainline? > = > > Should this get a Fixes: tag so that it goes back to > > stable kernels? > > > = > Zero rates are not checked beginning with the initial commit > 3e1aec4e2c ("clk: vc5: Add support for IDT VersaClock 5P49V5923 and = > 5P49V5933"). > so that would have to be the Fixes: tag. Thanks!