Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7461813imu; Wed, 14 Nov 2018 18:18:02 -0800 (PST) X-Google-Smtp-Source: AJdET5fY/1wuWnDhFdfbY/JNj6Pj4lvrAZBAFQtBZoCOaPvaWZYYrmM0FCjhVxAults6Pe36yIrQ X-Received: by 2002:a17:902:8e8a:: with SMTP id bg10-v6mr4436471plb.214.1542248282495; Wed, 14 Nov 2018 18:18:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542248282; cv=none; d=google.com; s=arc-20160816; b=OuOB/D3399BQpKjGWN5cFZbiYHNRA9BmkPyLI5n8RzJsdzwcoczpCj7E20sQuAJp/2 /sKplvgruzkjMNIOVvYzRjBqJgI6y4gMoF8W+Q1ENYMImr61eXUs7UMxyIIuGqDqKayI IU5WEV7bH20cWCZgkU9ezba7FpRQ/8B5l7SZnJLZGyo+TCTVEytq3i76MNjiRmGjtaX1 NUdQrKBmU9tA7K7fpsifZgMK+p35Vt1U2vlIyvpwwVu9K8fHe0fYkCLXu5UVPutU61+C gMv2xN4BCDizBQolSMgdjAePHg96aUnd0zHDnnnUpH/i0xg505VFq6DOAc65ca8qWHB8 lhJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :references:in-reply-to:date:cc:to:from:subject:message-id; bh=2nNaPvNhVSDYEtKcRQf3QNlpADHbsSMOFww7lN9e6V0=; b=He9J8926V1vhXvlGnEonnJwSfiHouBc58OQhFN7vzZCTnd4/sHLmwj1e/paFHjuNe/ RATyxzMYPH+hgbq1a4O8XsoRViZRFx4uSPq1DxcaajH4Eqft0KFKrmeP+ro5XfDzCNt1 bQ6JrL+J0pKZjjEwBC2UKgRjDaEaD20l95QmOuQXNFWz/iMsdNJbZiWhsYif5olNXCXb Pg8gLwYNM/zhPOj3hDaYDq6Bm1taa/452MjViqIQl6kDQHXJjeLIirKAi4dTt70pY27d pOFSlbxV2fbt/xBpnaIbIx3Kl7TS3nQ9UX6aS42Qhorkuw/hGubC/YkBa/iGCwPhjB2F cuCw== 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 g9-v6si25310201plo.328.2018.11.14.18.17.48; Wed, 14 Nov 2018 18:18:02 -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 S1728499AbeKOMW2 (ORCPT + 99 others); Thu, 15 Nov 2018 07:22:28 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:63199 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726574AbeKOMW2 (ORCPT ); Thu, 15 Nov 2018 07:22:28 -0500 X-UUID: 18d2ffdbec494684a6da295c3f24ece5-20181115 X-UUID: 18d2ffdbec494684a6da295c3f24ece5-20181115 Received: from mtkcas08.mediatek.inc [(172.21.101.126)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 138560396; Thu, 15 Nov 2018 10:16:24 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs02n2.mediatek.inc (172.21.101.101) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 15 Nov 2018 10:16:16 +0800 Received: from [172.21.77.33] (172.21.77.33) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Thu, 15 Nov 2018 10:16:16 +0800 Message-ID: <1542248176.30611.4.camel@mtkswgap22> Subject: Re: [resend PATCH 1/3] pwm: mediatek: drop flag 'has_clks' From: Ryder Lee To: John Crispin CC: Thierry Reding , Rob Herring , , Weijie Gao , Roy Luo , , , , Date: Thu, 15 Nov 2018 10:16:16 +0800 In-Reply-To: <2fc9dbac-4919-4ceb-49ac-67ddd7f203b5@phrozen.org> References: <4c9044427b1aab373acd6ac76f0c905e2be79784.1542074855.git.ryder.lee@mediatek.com> <20181114124752.GI2620@ulmo> <2fc9dbac-4919-4ceb-49ac-67ddd7f203b5@phrozen.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-TM-SNTS-SMTP: 81364D0BD973C495A397C616D90E803CBAEBF535F8DFF9CCC6EA8C1EF360420C2000:8 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2018-11-14 at 14:27 +0100, John Crispin wrote: > 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 > Thanks for the detailed information:) I will drop this patch in v1. Ryder