Received: by 2002:a05:7412:b795:b0:e2:908c:2ebd with SMTP id iv21csp202028rdb; Thu, 2 Nov 2023 00:33:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHuBYcIr5UGgkGIVigwx7h5tZZ4HfubZu7NEpRqMumw1jwgR3Htp9MXXg3yJpLK8j0k6Pc7 X-Received: by 2002:a17:902:6b89:b0:1cc:6101:20c7 with SMTP id p9-20020a1709026b8900b001cc610120c7mr7681848plk.46.1698910438372; Thu, 02 Nov 2023 00:33:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698910438; cv=none; d=google.com; s=arc-20160816; b=k7TTD3Mkdz5FLp4a52Ob70Bhf2bbPdTauj54tBQZYdXmonDEA6vPG/WkNU//8zChWG ZohkmR5DmIp3WrZZfLPkHEd4asXtYkfTrBuRFFdV64BdlruQK5TdnHrQXw1ZRKlYGVnW zZCo+bfKna97CdOsdZURiM+nKlhrEcHrnUlpggqVk4mz/lCrQmL0D02CTHHogCLUJdgK /rUqiNsGwAC5LPPCdHJKmjc9658umO8n80ACoQq3gQg8LtxNgn7jMwmatjrvSzFJrl9x wE/nkqHucNAi3yvCWNJlvyLiWEcmAdXfJLDOpcKbXhty7xPvXSI1rgjUePQBNylhaKgN t3Vw== 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:autocrypt :from:references:cc:to:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature; bh=pXXk/TwEDzw8xDMOV2t7kOE4klneFeU+7gL2ovq4KO0=; fh=OsSgmFzadAUn0DjzfPlpZpO0oO19ZvwhLQFcltgMC98=; b=ivEgjOpbn4eFOSiKiadzoDa7hy1ByyaEGYhGrY3Q19Rl0xKHHMlC906a4Ylk89DU4o KlHAi/vp248E1fRJsLNnIXO8AjIKFaCp7Uh+usz/KpefmUTttjKEAeuMlAPm52Uriu0j yzPBpi2lI8XT8odWYrqarE1Dn7yOJXPHRtl3AsjZTIqnvmgyJf6C6kisnSnrIdIrnqF1 sLvXw58bIkFyxwSdGcvIi9pjr+5GyURaaSTSF8XYy1CJnXLurZiRwQED1ZZT14r1wQ6j rRTRVnDinaRTYy1oUNixXuKeIKljD7aQN15pw4cUdpYvVKb0HWyXsXdyzeruU28eUUpU Q0uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b="E/UZfgBg"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id je17-20020a170903265100b001c9b3c3ce7asi4272771plb.300.2023.11.02.00.33.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 00:33:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b="E/UZfgBg"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id A55D280EB861; Thu, 2 Nov 2023 00:33:52 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344056AbjKBHd1 (ORCPT + 99 others); Thu, 2 Nov 2023 03:33:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234353AbjKBHd0 (ORCPT ); Thu, 2 Nov 2023 03:33:26 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0ACF128 for ; Thu, 2 Nov 2023 00:33:20 -0700 (PDT) Received: from [192.168.88.20] (91-158-149-209.elisa-laajakaista.fi [91.158.149.209]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id D6DB9667; Thu, 2 Nov 2023 08:33:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1698910381; bh=laYSoHqIWHQNbO7AzIweJ9rM6mr5Mp4/bdBblDZOxuQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=E/UZfgBgSMmjelaZad6QeiWIQiYk5G6Igs9H1p2xcspvx1zFOoH+oe2K1LFqFD4Nd K2u10gJkVETK+jTSxnGmzF3oARPEapqNgoMPrnDfFFzn3XGjYetxrAoKmMpWeGauRD Uz145xMP0bwGgrXI8mrmKMP7P5NbUv61B/NucB5w= Message-ID: <8d82bde2-8861-49e4-9796-3bd74b89194b@ideasonboard.com> Date: Thu, 2 Nov 2023 09:33:15 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 07/10] drm/tidss: Fix dss reset Content-Language: en-US To: Laurent Pinchart Cc: Aradhya Bhatia , Devarsh Thakkar , Jyri Sarha , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20231101-tidss-probe-v1-0-45149e0f9415@ideasonboard.com> <20231101-tidss-probe-v1-7-45149e0f9415@ideasonboard.com> <20231101143059.GW12764@pendragon.ideasonboard.com> From: Tomi Valkeinen Autocrypt: addr=tomi.valkeinen@ideasonboard.com; keydata= xsFNBE6ms0cBEACyizowecZqXfMZtnBniOieTuFdErHAUyxVgtmr0f5ZfIi9Z4l+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h7QxWIfWtp+VnwNGc6nq5IQDESH mvQcsFS7d3eGVI6eyjCFdcAO8eMAEQEAAcLBXwQYAQIACQUCTqazRwIbDAAKCRD6PaqMvJYe 9fA7EACS6exUedsBKmt4pT7nqXBcRsqm6YzT6DeCM8PWMTeaVGHiR4TnNFiT3otD5UpYQI7S suYxoTdHrrrBzdlKe5rUWpzoZkVK6p0s9OIvGzLT0lrb0HC9iNDWT3JgpYDnk4Z2mFi6tTbq xKMtpVFRA6FjviGDRsfkfoURZI51nf2RSAk/A8BEDDZ7lgJHskYoklSpwyrXhkp9FHGMaYII m9EKuUTX9JPDG2FTthCBrdsgWYPdJQvM+zscq09vFMQ9Fykbx5N8z/oFEUy3ACyPqW2oyfvU CH5WDpWBG0s5BALp1gBJPytIAd/pY/5ZdNoi0Cx3+Z7jaBFEyYJdWy1hGddpkgnMjyOfLI7B CFrdecTZbR5upjNSDvQ7RG85SnpYJTIin+SAUazAeA2nS6gTZzumgtdw8XmVXZwdBfF+ICof 92UkbYcYNbzWO/GHgsNT1WnM4sa9lwCSWH8Fw1o/3bX1VVPEsnESOfxkNdu+gAF5S6+I6n3a ueeIlwJl5CpT5l8RpoZXEOVtXYn8zzOJ7oGZYINRV9Pf8qKGLf3Dft7zKBP832I3PQjeok7F yjt+9S+KgSFSHP3Pa4E7lsSdWhSlHYNdG/czhoUkSCN09C0rEK93wxACx3vtxPLjXu6RptBw 3dRq7n+mQChEB1am0BueV1JZaBboIL0AGlSJkm23kw== In-Reply-To: <20231101143059.GW12764@pendragon.ideasonboard.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 02 Nov 2023 00:33:52 -0700 (PDT) On 01/11/2023 16:30, Laurent Pinchart wrote: > Hi Tomi, > > Thank you for the patch. > > On Wed, Nov 01, 2023 at 11:17:44AM +0200, Tomi Valkeinen wrote: >> The probe function calls dispc_softreset() before runtime PM is enabled >> and without enabling any of the DSS clocks. This happens to work by >> luck, and we need to make sure the DSS HW is active and the fclk is >> enabled. >> >> To fix the above, add a new function, dispc_init_hw(), which does: >> >> - pm_runtime_set_active() >> - clk_prepare_enable(fclk) >> - dispc_softreset(). >> >> This ensures that the reset can be successfully accomplished. >> >> Note that we use pm_runtime_set_active(), not the normal >> pm_runtime_get(). The reason for this is that at this point we haven't >> enabled the runtime PM yet and also we don't want the normal resume >> callback to be called: the dispc resume callback does some initial HW >> setup, and it expects that the HW was off (no video ports are >> streaming). If the bootloader has enabled the DSS and has set up a >> boot time splash-screen, the DSS would be enabled and streaming which >> might lead to issues with the normal resume callback. > > I think the right way to do this would be, in probe(), to > > - power on the device > - enable runtime PM, masking the device as active > - at end of probe, calling pm_runtime_put_autosuspend() Can you explain what that would accomplish, or why the code in this patch is wrong? If I understand it right, you're suggesting a more "normal" power up at the probe time, and then leaving the DSS enabled, but with autosuspend. That would require powering up, doing a reset, and calling dispc_runtime_resume. Which can be done, but I'm not sure why it's better, as we're not interested in "normal" power up at probe time. But I can see that my approach looks perhaps a bit odd just by looking at these patches. This work was related to keeping the bootloader's splash screen on the screen for a longer time, i.e. delaying reset. For that, I wanted an early function (dispc_init_hw) which would, instead of always resetting the DSS as it does in this version, peek at the DSS hardware, and see if the DSS is already streaming. If no, do a reset and proceed normally. If yes, skip the reset, leave the clocks enabled, and keep DSS PM active. Later, when we'd be doing the first modeset, the driver would do the initial reset. So, that's why I wanted an independent function for the HW probing/init, which is called before runtime PM is enabled, and I did not want normal runtime resume to be called as dispc_runtime_resume() would break the display. I think a better solution would be to set up the fb of tidss's fbdev to use the reserved memory, used for the boot splash screen. But I didn't figure out a way to do this. But even there we'd like to delay the reset until the first modeset (when the fbdev display is getting enabled). Tomi