Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751205AbbBFLMT (ORCPT ); Fri, 6 Feb 2015 06:12:19 -0500 Received: from mail-lb0-f175.google.com ([209.85.217.175]:40063 "EHLO mail-lb0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750733AbbBFLMR (ORCPT ); Fri, 6 Feb 2015 06:12:17 -0500 Message-ID: <54D4A18D.3010504@cogentembedded.com> Date: Fri, 06 Feb 2015 14:12:13 +0300 From: Sergei Shtylyov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Laurent Pinchart CC: Mike Turquette , Wolfram Sang , Geert Uytterhoeven , Stephen Boyd , Ulrich Hecht , Wolfram Sang , linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] clk: shmobile: div6: Avoid division by zero in .round_rate() References: <1423052841-15194-1-git-send-email-geert+renesas@glider.be> <54D29760.4010009@cogentembedded.com> <54D299D6.7060809@cogentembedded.com> <4034374.lq5RZGeRAm@avalon> In-Reply-To: <4034374.lq5RZGeRAm@avalon> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1316 Lines: 37 Hello. On 2/5/2015 8:19 PM, Laurent Pinchart wrote: >>>>>>> Anyone may call clk_round_rate() with a zero rate value, so we have to >>>>>>> protect against that. >>>>>>> Signed-off-by: Geert Uytterhoeven >>>>>> Acked-by: Wolfram Sang >>>>>> I agree that this should not be fixed in the core because the fixup is >>>>>> really driver dependant. >>>>> Dunno, zero frequency seems generally insane to me. >>>> It is useful to find the lowest frequency a clock can support. Basically >>>> it is a search for the floor frequency. >>> Why not just use 1? Or are you assuming that some hardware could actually >>> support 0 Hz? >> Replying to myself: yes, this has happened to me, when I forgot to override >> the EXTAL frequency in the board .dts file (default was 0). > So it was a good thing that the driver crashed, it let you find a bug ;-) None of the clock drivers crashed, but the SDHI driver hanged instead, and I spent much time tracing it in order to find where it hanged. :-/ WBR, Sergei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/