Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp6025097rwd; Mon, 19 Jun 2023 00:51:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5w9KT11SjTDhpJ/EjKYsj6+5MeO6IM+RfNs2K1UwZL1BQwocFaYjtgyGF9+0/XaTmWoKTF X-Received: by 2002:a05:6a00:2d09:b0:656:e7a2:5322 with SMTP id fa9-20020a056a002d0900b00656e7a25322mr11325071pfb.26.1687161060624; Mon, 19 Jun 2023 00:51:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687161060; cv=none; d=google.com; s=arc-20160816; b=y2V/JDVYG9nZCXbocXYRwxE0ACqW91H/wsfasCqPKgs621cM6bNaHeCPNonWxddfwl 0OV5nm8nLNfD7FAG2WjF2YZDs2M5c7PY4gqDwAqnisolxPQrDT+4pv3YKNA1vuLN0Tzf rrEWDB6a8+p0KazNdyqGYP2YtY/qiuAnTI8fMm2mY9JaJ5a9pn8ZIEhl2Bj0jR5gxkAi zOzLyBmXV/hCVoOEy8MxkOCa9kq4KP/I8xsCU7BQvljJ+2ydiOvOcqXbAx54ehgYqRvx JYDjCejIMywW2y2grnlkVuKJs65YR57wWkKUxtXm/UI4CZXdrXgHGPr0JpZw4wXdYRat yf+A== 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 :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=HrxZ5Qc3CMMHgFpjUxPgNxEuNSiYWWs3o8a88oToH+4=; b=1FXLZuOFbCQ2SepYV2Kmlu4fIDaZaWg/LAYuJLfAqEW0LUXQthnqL7cJ6JezJKzHZQ Ru+ljxF0J3ICJFkBpLUIG9bgHVC3bW4XW0fMPIQbCY0kzS7VY4RfOobc0kPzO7W0L7GX G7TKMbPzZcb7mP+c8exk+5qlFA8VaMjIPi9ZUTRTlysNQ3bbhjqkfOg/M44zZbk04v8Z 8A90kfLaO6eDY2NJoqHxvj5KrOckwIEQfPqU6kIcfQv+AZ8ulvRoH4IQjKcDyDnhWq7u 9QN/NLYZge8gXiq5Gn75vr6tdEgziQ+JCQ4LogCPpF9rM61NxV+f/DzBd5SwtFXR0qCS FOmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=GGqRtKhW; 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 a22-20020aa795b6000000b0064f6a531c88si8004655pfk.323.2023.06.19.00.50.43; Mon, 19 Jun 2023 00:51:00 -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=GGqRtKhW; 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 S229612AbjFSHpe (ORCPT + 99 others); Mon, 19 Jun 2023 03:45:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229448AbjFSHpc (ORCPT ); Mon, 19 Jun 2023 03:45:32 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3D5BB1; Mon, 19 Jun 2023 00:45:30 -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)) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id E859E6606EAC; Mon, 19 Jun 2023 08:45:28 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1687160729; bh=PUG5piy46+BtYUKqIE057P4sOhXAzTDm9lhm1PwoWoY=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=GGqRtKhW4JTknQ5gxd+v4wckj01dUHFUW/D+sKxscKEtYmWQbkXiunIs2qh+v+Zhd dcuWE4vDEjQjJaelk+7IgREEp2ZFdhfqTZtVJHgk5ClzG7Jvel9Uhh8xg9Q/edK9XA mEYgdCxOjqpyA7XFmmsXn+z26lg6lrRQkDEoVrCKWo0aJm5F4CBP4Gpr3BzGKSR1Db Wm1aFnS9KerDDF+f82XQAJoEbvHOzZw6jJIgYFL2fDzYd3QMM4YEtBWoOHquj8dtCE KbLlNwPdhdPdHwdbXyNM0+lLgm+qQbLvDA5iPXpPTe3Oog1hy1F9XSBQBjuFuX/2rJ 4j+X8ySOP18nA== Message-ID: <4736dabb-8585-3906-d6f1-165eff96eb26@collabora.com> Date: Mon, 19 Jun 2023 09:45:27 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH v2 3/5] media: mediatek: vcodec: Read HW active status from clock Content-Language: en-US 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> <76a641e6-64ef-a973-422c-de50d498e52f@collabora.com> 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 19:40, Stephen Boyd ha scritto: > Quoting AngeloGioacchino Del Regno (2023-06-15 00:30:56) >> 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 > > You don't have to add the power domain in DT, do you? You can populate a > power domain in software directly? > Right. I didn't evaluate that possibility at all. Looks good! >> really looks like being the only viable option. >> >> Stephen, many thanks for the valuable suggestions and the nice conversation. >> >