Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6680980imu; Wed, 14 Nov 2018 05:29:50 -0800 (PST) X-Google-Smtp-Source: AJdET5eWAoaIIU4w5CLL10vggM5G+LyxpKXsyX7g7Js7ZRAuOFVGoHB4mtgPJB1dgUIR0AAd0o3V X-Received: by 2002:a62:47d9:: with SMTP id p86mr1495611pfi.95.1542202189991; Wed, 14 Nov 2018 05:29:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542202189; cv=none; d=google.com; s=arc-20160816; b=NE4siSGlJRF80kd94Gin1OrnQQ0PNO+AtdZ5q12WWzoXMDG4FmKDAgz2GmHIJfFQ7v lrSeEjDcNi+MFn3S9VAfQG7PqByDzhSTRbt4FrulUzmxpcYSaB+Tx2P87ItPV3yvzy8o iiBh8pv9iUlSx+GGftmTvAtZu/3W0E8KVXdQYn++ed13+n8p3Nqlqxf/b3XPlOXAow+I w3f8lxzHC+8YG3Y3IZGr6RHTp/rY78CzOvhh/aiNZQQICeTs7jy+iC5IZy1dcz7v/dMN 3UfS6HGVLkEvZbqFaj8wfTxCxeZouIOYaKpJs9cDU6kzgzDRs3J1v4yTqj9R1Qia1M3m 66ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=6yLG+IBmIX8RWJmsFvNdyeXnvhzTgw855QaMus4YMGo=; b=rRyiKgQVRgHkYLWfPIAOrUjGhS+WMypzM9m5u/tZN4ZUcQzQXG6vFzviXNv1np8bOy 7Zh08fthCsRKu0BYDcu2tpjXh85t7ACXo+SpibLTJOdRk1aY+jbAChK6htdRg7+KEKSj c5B5YpvfocNmZaUY/4fWtL/YtGP1jniRD5kFaExIokE2/94a48m6mLqKNqh4KbRaQ211 dqg11MN1gx7UfoPcXNpVf+Ue/vbB/AWQi5G9NZ5txYXxX/Oah1sqM9xvW/1IszgTSfZU Qo33YP1fOEgWw1MmPO00lFndUd21CABBwVUtfEApUXoR18wDyLiL0ZrJ/p77JcmvfP+0 iocg== ARC-Authentication-Results: i=1; mx.google.com; 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 e20si6822821pgv.486.2018.11.14.05.29.33; Wed, 14 Nov 2018 05:29:49 -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; 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 S1732837AbeKNXas (ORCPT + 99 others); Wed, 14 Nov 2018 18:30:48 -0500 Received: from nbd.name ([46.4.11.11]:55034 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726823AbeKNXar (ORCPT ); Wed, 14 Nov 2018 18:30:47 -0500 Subject: Re: [resend PATCH 1/3] pwm: mediatek: drop flag 'has_clks' To: Thierry Reding , Ryder Lee Cc: Rob Herring , linux-pwm@vger.kernel.org, Weijie Gao , Roy Luo , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org References: <4c9044427b1aab373acd6ac76f0c905e2be79784.1542074855.git.ryder.lee@mediatek.com> <20181114124752.GI2620@ulmo> From: John Crispin Message-ID: <2fc9dbac-4919-4ceb-49ac-67ddd7f203b5@phrozen.org> Date: Wed, 14 Nov 2018 14:27:25 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <20181114124752.GI2620@ulmo> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14/11/2018 13:47, Thierry Reding wrote: > On Tue, Nov 13, 2018 at 10:08:22AM +0800, Ryder Lee wrote: >> The flag 'has_clks' and related checks are superfluous as the CCF >> subsystem does this for you. > Both of these mechanisms aren't equivalent. While CCF can deal with > optional clocks, what the has_clks flag actually means is that the > device doesn't need a clock (or doesn't have a clock input) on the > devices where it is cleared. > > So I'd actually be in favor of keeping the has_clks property because it > serves as an additional sanity check. For example if you run this driver > on an SoC that "has clocks" but if you don't list them in DT, then after > this patch the driver will happily continue without clocks, even though > it may break completely without those clocks. I've seen SoCs respond to > disabled clocks for a hardware block in different ways, in many cases an > access to any of the registers will completely hang the CPU. In other > cases it may just crash in some other way or give you some sort of > machine exception. None of those are good, and make the tiny bit of > additional code required to support the has_clks flag very attractive. > > But that's just my opinion. If you prefer to throw away that safety > barrier, be my guest. But if you do, please move this functionality into > the clock framework first and then make the driver use it. > > Thierry Hi, sorry for my late response. I added the flag for the legacy MIPS silicon. These SoCs only have a single clock register with a few on/off bits. there is no complex clocktree or scaling. Hence COMMON_CLK is not supported by those SoCs. I fully agree with Thierry, that the flag makes this explicit and the intent was indeed to make sure that on silicon where clocks are required, that they really are listed in OF. This is indeed an extra sanity check and hiding it in an implicit check inside CCF does not feel right. ??? John