Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1876626pxb; Fri, 5 Mar 2021 01:38:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJzBDzRKLclsDDC0vRZEg8SRgdTeUpZ3otTausvUEN4ZO4TiuQYYmolCB3l94PAglouWa6aL X-Received: by 2002:a17:906:d790:: with SMTP id pj16mr1445392ejb.255.1614937136229; Fri, 05 Mar 2021 01:38:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614937136; cv=none; d=google.com; s=arc-20160816; b=u0LhSQ9yKNw/KBKDLKh9jWasIkamnGhN+7St48OOnaAcDUDMokKItWIR05G2I6Tp4M KpQ5OKS9LNnURCWUhMCi6wqv/C5C0CrunHcBQi0K+Gt4Td1p8kxDm6JMqRxU8ulCZYhF AydRdi5QgloW4AYeuhT3+qyrfo/Le/JRBetumtvgw6nIe2KAkPcTqiszEJROseOca+GW elG2LFxt3UhcLtyR/fPH/MPj01X4FXNNgKC/hWmEQH7r5AKPZ4no/C1uxcIhMd56PNKs ESCajQfTmaN9PEh5tOYCJCYEaLuZZsIqI1DpcQfLRtFKcwX+sdMlYMVP64AFwLtgF0fW vM7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=RILTuos+/4uGXaIvv2E6Tv4+ETwAKChCZFIHdb+5Izw=; b=FoLyHL9W6zcgJRAucwSs7kDw/kOOUjlBPCr00Uyw9ZOzzlElhX6LOsKTy30ivtevvG 6RwZzinNvXrQ1VwFS43b/dOu4NtLiwAV5GBuMJ+bYnUgUT+oTj+kjM5o2GYtkPkfuNIx c3tIoopcyNuUo9iCWevIG8ISB7yQ+kHbbU4irVi06V6iQdrkzn8AVWnYG25R6EoxI64D X9txN6ThT40YyuaAQdS7l4RLqBp9vPkDam2VYF7yALpJRl+VkKDQC1u1JcN2XSKiDn1v Ei47NxnLbX/nPKFww4vyRxxa7TJMbkVcN/r4iPJiv0y8DBZDOeYR0biTZoIiwfXT7LIk i8OQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y3si1263287eds.265.2021.03.05.01.38.34; Fri, 05 Mar 2021 01:38:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229611AbhCEJgT (ORCPT + 99 others); Fri, 5 Mar 2021 04:36:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229582AbhCEJfv (ORCPT ); Fri, 5 Mar 2021 04:35:51 -0500 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60197C061574; Fri, 5 Mar 2021 01:35:51 -0800 (PST) Received: from [IPv6:2a01:e0a:4cb:a870:b9e2:e9f:d661:5a2f] (unknown [IPv6:2a01:e0a:4cb:a870:b9e2:e9f:d661:5a2f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: benjamin.gaignard) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 79EF21F468C5; Fri, 5 Mar 2021 09:35:47 +0000 (GMT) Subject: Re: [PATCH v3 0/5] Reset driver for IMX8MQ VPU hardware block To: Philipp Zabel , robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, festevam@gmail.com, ezequiel@collabora.com, mchehab@kernel.org, gregkh@linuxfoundation.org Cc: kernel@pengutronix.de, linux-imx@nxp.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, devel@driverdev.osuosl.org, kernel@collabora.com References: <20210301151754.104749-1-benjamin.gaignard@collabora.com> <2d55ad69-9b93-ab0e-04af-cd775cc9248b@collabora.com> From: Benjamin Gaignard Message-ID: Date: Fri, 5 Mar 2021 10:35:44 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 03/03/2021 à 17:25, Philipp Zabel a écrit : > On Wed, 2021-03-03 at 16:20 +0100, Benjamin Gaignard wrote: >> Le 03/03/2021 à 15:17, Philipp Zabel a écrit : >>> Hi Benjamin, >>> >>> On Mon, 2021-03-01 at 16:17 +0100, Benjamin Gaignard wrote: >>>> The two VPUs inside IMX8MQ share the same control block which can be see >>>> as a reset hardware block. >>> This isn't a reset controller though. The control block also contains >>> clock gates of some sort and a filter register for the featureset fuses. >>> Those shouldn't be manipulated via the reset API. >> They are all part of the control block and of the reset process for this >> hardware that why I put them here. I guess it is border line :-) > I'm pushing back to keep the reset control framework focused on > controlling reset lines. Every side effect (such as the asymmetric clock > ungating) in a random driver makes it harder to reason about behaviour > at the API level, and to review patches for hardware I am not familiar > with. > >>>> In order to be able to add the second VPU (for HECV decoding) it will be >>>> more handy if the both VPU drivers instance don't have to share the >>>> control block registers. This lead to implement it as an independ reset >>>> driver and to change the VPU driver to use it. >>> Why not switch to a syscon regmap for the control block? That should >>> also allow to keep backwards compatibility with the old binding with >>> minimal effort. >> I will give a try in this direction. > Thank you. > >>>> Please note that this series break the compatibility between the DTB and >>>> kernel. This break is limited to IMX8MQ SoC and is done when the driver >>>> is still in staging directory. >>> I know in this case we are pretty sure there are no users of this >>> binding except for a staging driver, but it would still be nice to keep >>> support for the deprecated binding, to avoid the requirement of updating >>> kernel and DT in lock-step. >> If I want to use a syscon (or a reset) the driver must not ioremap the "ctrl" >> registers. It means that "ctrl" has to be removed from the driver requested >> reg-names (imx8mq_reg_names[]). Doing that break the kernel/DT compatibility. >> Somehow syscon and "ctrl" are exclusive. > The way the driver is set up currently, yes. You could add a bit of > platform specific probe code, though, that would set up the regmap > either by calling > syscon_regmap_lookup_by_phandle(); > for the new binding, or, if the phandle is not available, fall back to > platform_get_resource_byname(..., "ctrl"); > devm_ioremap_resource(); > devm_regmap_init_mmio(); > for the old binding. > The actual codec .reset and variant .runtime_resume ops could be > identical then. I made it works with syscon and your proposal. The next version of the patches will be without reset and won't break DT compatibility. Thanks for your help, Benjamin > > regards > Philipp >