Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp727112rwd; Thu, 15 Jun 2023 00:53:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4+weinxu+zejrXVk6OH+NzfI71bSXWnIdseNNQnsG2nZWo1QJq1SH9MgamEafsT6/PxnwV X-Received: by 2002:a17:907:7202:b0:97e:e39b:f901 with SMTP id dr2-20020a170907720200b0097ee39bf901mr12309613ejc.28.1686815600059; Thu, 15 Jun 2023 00:53:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686815600; cv=none; d=google.com; s=arc-20160816; b=Lk8zc6IFd8DOr26zqiOcukG3/n/OeYZMSHfJNdm7W+eZSIQnvWMpvSoAU/DM8vv+CB NTEcTSVmurxCvb6WH4xvSfcxN2ilq/yebhzxEY5dsM+oKDf0LgALWaxT8fIZw4a7z/Ge e90V25p+gEh8RQkFgOh8CMlAzdRw8LbvrETayWYYUO6tV7xFrJXyqGRnQjxWnmNXJSzP 36ps/3qLM7U3JtWp0aLUtAhQZDYXt99RaCEpc2YudG23fo2hppDdSCwUnNZVnFzGy+hh nw72X4S1j5eMrqUiez7x819oJBKcm44g0BAwWLJEcz8WsIZzbtD2k1d50+ZTiWTvz8Z5 uSFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=mN/eBe4rj+0m8M/v44Y3MYjKHGb5iIYNtA3VC0zmq0c=; b=k9+CYN23M6XKNjJ0hxdeB0swbllQOKZXGxDBGgBgcHEmBmBPn0XkC+1TVzLNtOZ6Rt fQzaEPX8senAGqnfA7MxU5b7xq8IMT/C2mYh3oaWuM8AwY1CoClpyvlCn8ZEaZVNacIl 0wGsYNjbicVYR9SPOJWwQhEIq5YNH2mZuHmeqebFDkjNyNbTwd+oDyir2lOeqMGHk8ne +RfHPvBQdNybjQhNJ0isjgO90M5qJX82aEz01Q6wkasqZNJMgjlDbsPn98/qwIlgQWQp ZP3lQ5cccDaeQA/6mCYRRWZjp5IyTix4gIRQ6talACng7lBCCGG/YBDb98dsjupEcLH1 8UVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=IHs8zNUa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qq22-20020a17090720d600b0096176dedf7bsi9142755ejb.436.2023.06.15.00.52.55; Thu, 15 Jun 2023 00:53:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=IHs8zNUa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243701AbjFOHbS (ORCPT + 99 others); Thu, 15 Jun 2023 03:31:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243571AbjFOHbC (ORCPT ); Thu, 15 Jun 2023 03:31:02 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFEC82119; Thu, 15 Jun 2023 00:31:00 -0700 (PDT) Received: from [IPV6:2001:b07:2ed:14ed:c5f8:7372:f042:90a2] (unknown [IPv6:2001:b07:2ed:14ed:c5f8:7372:f042:90a2]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 83E5D6606F57; Thu, 15 Jun 2023 08:30:58 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1686814259; bh=rt1mTW7EaJvWtRAZ3znsro/fBoT/5AxcK9NrRg/J3L0=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=IHs8zNUavIObe8ZCxd2ay1YS97Q6a5tzUlccD9O3323Pjtism0gUBqXaaQIcZgyqL jlTckS4DHIr9yAqKS1n19O8nSEnCqs0q8eGFRhJGO5c0dWRfRG3pQeM+UCqebsTAtx AqeXFtCigaG87dKCslHy7DX5fYUf4QvJVyBPGaYoMnb9GN/giAKELxIDncV2B7lx68 MQ2VxxHGLLtnohp0HWb0meN0o48cUoQHC7PjQzSf8CM73h6q62s0pq4wdsOVT4Yhoq 3D3epLe3MM230EwVus67qQTHFrmiBt5H8Bu9rcsyHrptFXBGxDGDdRBLGDHhoFNBkh njI3SSfJZlUWg== Message-ID: <76a641e6-64ef-a973-422c-de50d498e52f@collabora.com> Date: Thu, 15 Jun 2023 09:30:56 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 Subject: Re: [PATCH v2 3/5] media: mediatek: vcodec: Read HW active status from clock To: Stephen Boyd , Chen-Yu Tsai , =?UTF-8?B?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= Cc: Matthias Brugger , Hans Verkuil , kernel@collabora.com, Andrew-CT Chen , Mauro Carvalho Chehab , Tiffany Lin , Yunfei Dong , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-mediatek@lists.infradead.org References: <20230607205714.510012-1-nfraprado@collabora.com> <20230607205714.510012-4-nfraprado@collabora.com> <83770481aa762b69738c27f9d9934dd9.sboyd@kernel.org> <90781ea3-d43a-6267-278c-184050fe456e@collabora.com> Content-Language: en-US From: AngeloGioacchino Del Regno In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Il 15/06/23 02:40, Stephen Boyd ha scritto: > Quoting AngeloGioacchino Del Regno (2023-06-14 01:13:43) >> Il 12/06/23 21:19, Stephen Boyd ha scritto: >>> Quoting AngeloGioacchino Del Regno (2023-06-09 00:42:13) >>>> Il 09/06/23 01:56, Stephen Boyd ha scritto: >>>>> Quoting AngeloGioacchino Del Regno (2023-06-08 02:01:58) >>>>>> Il 08/06/23 10:12, Chen-Yu Tsai ha scritto: >>>>>>> On Thu, Jun 8, 2023 at 4:57 AM Nícolas F. R. A. Prado >>>>>>> wrote: >>>> >>>> The firmware gives an indication of "boot done", but that's for the "core" part >>>> of the vcodec... then it manages this clock internally to enable/disable the >>>> "compute" IP of the decoder. >>>> >>>> As far as I know (and I've been researching about this) the firmware will not >>>> give any "decoder powered, clocked - ready to get data" indication, and the >>>> only way that we have to judge whether it is in this specific state or not is >>>> to check if the "VDEC_ACTIVE" clock got enabled by the firmware. >>> >>> Is Linux ever going to use clk consumer APIs like clk_enable/clk_disable >>> on this VDEC_ACTIVE clk? If the answer is no, then there isn't any >>> reason to put it in the clk framework, and probably syscon is the way to >>> go for now. >>> >> >> Not for the current platform, but that may change in future SoCs... we're not sure. > > If you're not using the clk consumer APIs then it shouldn't be a clk. > >> >>> Another approach could be to wait for some amount of time after telling >>> firmware to power up and assume the hardware is active. >>> >> >> That would be highly error prone though. Expecting that the HW is alive means that >> we're 100% sure that both firmware and driver are doing the right thing at every >> moment, which is something that we'd like to assume but, realistically, for safety >> reasons we just don't. >> >> Should we anyway go for a syscon *now* and then change it to a clock later, if any >> new platform needs this as a clock? > > Yeah. Or implement this as a power domain and have it read the register > directly waiting to return from the power_on()? A power domain would force us to incorrectly describe the hardware in the bindings though, I think... so, Nícolas, please, let's go for a syscon at this point, as it really looks like being the only viable option. Stephen, many thanks for the valuable suggestions and the nice conversation. Cheers! Angelo