Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp94968imu; Thu, 15 Nov 2018 22:49:05 -0800 (PST) X-Google-Smtp-Source: AJdET5cXOqs4tbzRgv3t5OrU8myHHhBhW96UHnqXIAopkbkQ+PclRKxir4tdRoE53odsStbRVJAQ X-Received: by 2002:a63:4342:: with SMTP id q63mr8814659pga.63.1542350945057; Thu, 15 Nov 2018 22:49:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542350945; cv=none; d=google.com; s=arc-20160816; b=WmDevN7x9c4xClgN+1S9mOf74xr4QcU0sMI5W0RSB2bv8MLHgChxNdAe/zpSmtcdFI z90ZToDWANKpcQZ4N9CYgmaihGlKmB+uK6bFvW/oWLrp8BW7uF1Ndp02NYBREvIca6hO RWV6XzLpXYo4WzVmxLvwUEScMFS/LCPMFwycvqn1/EmNR2aum4fyYiR5vAV1nOLpZq1p GwPKp0Vkzku/lQm/7oVbOc/0N1zH2w33ABI7GEnLU2Kng1l+eb0cZ/Hvf7VpRCbQ0GRz w1VUMnkXDZwKWDELk6cfDkzp7YY9qnD+8u3JEgZBVaczhfonWI0oYm8JjA7XKWWws9gA 3l6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=Y55mkQzIZoR2Gm9RFX8sFZ/jBIrY/mH3uBBSDZeYMpQ=; b=0lX3wpZjrWTwcXtCmKBuWc6uOov3SqvRLBKDt1ndf2WwMlkwfaLSky+fHd1+IDlYS/ 30ly1pi4Cq+MPSCZRaW/rlTZjUjVFF/ZEdnNtJD5028zfdVpm1O/y5/P/vhAvHnx/Y4k rTfySHI3ugJIY38Cq7Vsu+KHseObNoq3pZZn4sDQ+tV/ExKknCNprRNqS3dDxyxAL8iB dx0lKCB4wvJ9YeAwV50Nx+Obhu7FFbDu9vu7za9mJu8xX1Hfv4Ze0Z3LaEZ9AVskUEu6 x49Q+Lha17KOjXTInJA3GJ/WcYOvRsiHH0CGo26Hz5osjWA15NspGyxCCjrnK0yNSbmw cUmg== 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 1-v6si31430958plj.146.2018.11.15.22.48.50; Thu, 15 Nov 2018 22:49:05 -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 S1727878AbeKPQ7F (ORCPT + 99 others); Fri, 16 Nov 2018 11:59:05 -0500 Received: from metis.ext.pengutronix.de ([85.220.165.71]:58303 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727353AbeKPQ7F (ORCPT ); Fri, 16 Nov 2018 11:59:05 -0500 Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gNXuv-0004Qm-Bx; Fri, 16 Nov 2018 07:47:49 +0100 Received: from ukl by ptx.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1gNXuu-00030N-El; Fri, 16 Nov 2018 07:47:48 +0100 Date: Fri, 16 Nov 2018 07:47:48 +0100 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= To: Thierry Reding Cc: Ryder Lee , 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, John Crispin Subject: Re: [resend PATCH 1/3] pwm: mediatek: drop flag 'has_clks' Message-ID: <20181116064748.6c7shn3am4wejrnj@pengutronix.de> References: <4c9044427b1aab373acd6ac76f0c905e2be79784.1542074855.git.ryder.lee@mediatek.com> <20181114124752.GI2620@ulmo> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20181114124752.GI2620@ulmo> User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 14, 2018 at 01:47:52PM +0100, 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. The usual policy is: If the things specified in the dt are wrong or incomplete, it's ok to fail however you like. So from a correctness POV I think the change is fine. I don't know about the mips details that John pointed out in a followup to this mail though. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |