Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7474300imu; Thu, 31 Jan 2019 10:40:55 -0800 (PST) X-Google-Smtp-Source: ALg8bN5WYfT7YV/3LO3LpFE0N4hPPJfFue4RUbMrQI14vedJ3e4JS8IaXf5nwdyR6bIo/WK0Ktjq X-Received: by 2002:a62:6503:: with SMTP id z3mr34891887pfb.169.1548960055478; Thu, 31 Jan 2019 10:40:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548960055; cv=none; d=google.com; s=arc-20160816; b=cogTtkd33K2eEqJO5cEqyaafvljJTgAXqLWU+Gm5TurVlZ34u21XJURHzhYWD8J4F/ fMihs+y9G0SIeSGPRNGxPngxw6bZ9Ja4OT3KsHPTmMEqihP8Tf1g0M09neL8FrGBnqLl Zr1reWzMHDMuQ/CuX+GiD3fJ5og0DELwMdlVmHRRmS7z3I7JWC+Okwoeb3qoB6mAJEvq Z4SjLCZ0Wz8jAjoT8MvsnIpxD6zqt5XGT5Z7U8QhgWQfwh9hMzxjH8Zi3UsG5vUXMxAc z4XIyBvE61JNM+bnDDWpK9umXouCUjMtd/GQqirwtCnf9uuJZdPs4LfjMvOmLcU+Nz8U 4FOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=owLbYclAuN3GBERSCEViDZYVHBagSDsGPMPw2l2m+P0=; b=FJZ5WSvkkZ6cJ2pOJXvItjzueSTCgdCFyF45SPJixCNtQdQni4IUL4MfXg2a8yRRgW iOTHeRx4TnSezPSzx3oHeJ4g8M2MjtHGw7bh2g4k5crgdBrIEjsBfi/ax0kxHO1gdTsS GkrXR/LLZ5NCcpwe9Gjf5kSDCbwJ5eVSY3OfttBBLNnNBr55RTQz3fUxndiHQJI7QmM5 e4WQ10wB8rWWNKq4BqX20JvFtUp5zDJcKsftgpaDrRhBqdsR+8qpOXJ+4ZT6k63aa4Hx LGr1vMWQqRaJGVkDh20eGCr8m0CFU0XOA0o/D61xctkG6uoyJEirdVpsPn4VuAU0yIUz Ldyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=oTlYPCBw; 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 g21si5023342plo.435.2019.01.31.10.40.39; Thu, 31 Jan 2019 10:40:55 -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; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=oTlYPCBw; 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 S1727101AbfAaSkM (ORCPT + 99 others); Thu, 31 Jan 2019 13:40:12 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:50800 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725777AbfAaSkM (ORCPT ); Thu, 31 Jan 2019 13:40:12 -0500 Received: by mail-wm1-f66.google.com with SMTP id n190so3600696wmd.0 for ; Thu, 31 Jan 2019 10:40:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=owLbYclAuN3GBERSCEViDZYVHBagSDsGPMPw2l2m+P0=; b=oTlYPCBwFzOpuwn9c8u1+7bH8vbYS2kxONB4bj0bpfn7Hoz1JGJ3g/ER3WQ86zYIid w+LLnOxBNer1rhdOPn3VAab85kkQIsazlTYYqOtISv86jIWnUr8MSzObbexV4Nh4+KPt dQgI+4/rAsne71YfnZdWiJuyaAIP1VkENzMftoaN19X01t8sCI0BS0Ri0B8UKlo3QhTj XYAvPY7FahMVhjx7V42mIF+pBImhR1aJf/jOKl9s+rMWqjXAOWEJsjKaJ2BsYYDsPQvp jRqohkarJ+JX94/0S5//8GFOJGNGvdAkOigyxYj3nEbqRS+EN+NNAveFpW5A0nklrG96 y4nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=owLbYclAuN3GBERSCEViDZYVHBagSDsGPMPw2l2m+P0=; b=PIYBvt8JH/LYeNf28JCU9vYON3mJ8oBT4CZsgfUrCYq5oEAtr6eLgh6f1g3WNjtGs7 RI101iV45x5VT6OtEpJwKH2BlaDKl8uBvRF10lggf5M3TWqlts6PpTkE/2paBH/pMUme 4YkcUJ9SIQFT5DtZC1tmxCLEln7osoTLd+bKXiFgFhbVigOFqeTZ7Cn/z/ABbssjp8i3 1DVancoPf63fJHDe1SUCCkGK2xRf7mqFIN4i+0M1izouGThXwZOg8HP0Zp7WgV5fENU0 zhcx5S/4qLvv5iDG6bHn1UryyxjuAMSz1RTbtyW3RHQGVuSzpv2uhCZJzaV7pFk8GEHQ zXeQ== X-Gm-Message-State: AJcUukeIiCGWeKTUoa7WKlWl6nez6UxbvHAilNTMrPGvuOO7mbXc0FuR etmgCLWu/k+cdYtnYIy35k384A== X-Received: by 2002:a1c:68d7:: with SMTP id d206mr29377794wmc.43.1548960010400; Thu, 31 Jan 2019 10:40:10 -0800 (PST) Received: from boomer.baylibre.com ([2a01:e34:eeb6:4690:106b:bae3:31ed:7561]) by smtp.gmail.com with ESMTPSA id z14sm3761305wrm.48.2019.01.31.10.40.08 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 31 Jan 2019 10:40:09 -0800 (PST) Message-ID: <97c2375f41fe7dabc4d71f66c9808912eb0ce611.camel@baylibre.com> Subject: Re: [PATCH 2/9] clk: Introduce get_parent_hw clk op From: Jerome Brunet To: Stephen Boyd , Michael Turquette Cc: linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Miquel Raynal , Russell King Date: Thu, 31 Jan 2019 19:40:07 +0100 In-Reply-To: <154888381385.169292.12776041058756822056@swboyd.mtv.corp.google.com> References: <20190129061021.94775-1-sboyd@kernel.org> <20190129061021.94775-3-sboyd@kernel.org> <154879654428.136743.10048771201181501034@swboyd.mtv.corp.google.com> <154888381385.169292.12776041058756822056@swboyd.mtv.corp.google.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.4 (3.30.4-1.fc29) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2019-01-30 at 13:30 -0800, Stephen Boyd wrote: > > With this quirk, CCF is making an assumption that might be wrong. > > > > The quirk is very easy put in the get_parent() callback of the said > > driver, or > > even better, don't provide the callback if it should not be called. > > > > I understand the need for a cautious approach. It seems I'm only one with > > that > > issue right now and since I have a work around, there is no rush. But we > > must > > have plan to make it right. > > > > To be clear, I'm not against your new API but I don't think it should be a > > reason to keep a broken behavior the framework. > > > > So do you think you can use this new clk_op and ignore the problems with > the .get_parent clk op? Putting effort into fixing the .get_parent > design isn't very useful from my perspective. There's more than just the > problem that we don't call it when .num_parents is 1. There's the > inability to return errors without doing weird things to return an index > out of range and there isn't any way for us to really know if the clk is > an orphan or not. If we can migrate all drivers to use the new clk op > then we can fix these problems too, and deprecate and eventually remove > the broken by design .get_parent clk op API. Stephen, I have nothing against your new API, I'm sure it will solve many issues I'm also quite sure that, like round_rate() and determine_rate(), migrating to the new API won't happen overnight. We are likely to still see get_parent() for a while. I don't understand why we would keep something wrong when it is that easy to fix. I have spent quite sometime debugging this weird behavior of CCF, I'd prefer if it can avoided for others. Yes, fixing the case I reported does not solves all the problem you have mentionned. Keeping this bug does not help either, AFAICT. The fact is that get_parent() already return out of bound values on some occasion, and we already have to deal with this when converting the index to parent clk_hw pointer. Doing it in the same way when num_parent == 1 does not change anything. I really don't understand why you insist on keeping this special case for num_parent == 1, when we know it is not coherent. Considering, that I already proposed the fix, what is the effort here ? If it is fixing the driver that rely this weird thing, I'd be happy to do it. Regards Jerome