Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp8308697rwl; Tue, 10 Jan 2023 11:40:07 -0800 (PST) X-Google-Smtp-Source: AMrXdXsg4CWkjoyu/VoQvzNjy/fC7KZhGQDGn92J4Fq4oSZV8PFtUKCvoEWEiTRuyJAV6KZAlwhq X-Received: by 2002:a17:906:13d6:b0:7c1:99a7:e10b with SMTP id g22-20020a17090613d600b007c199a7e10bmr58935299ejc.49.1673379607655; Tue, 10 Jan 2023 11:40:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673379607; cv=none; d=google.com; s=arc-20160816; b=lLjccgJj6AKLwgRCvJVEjG3gqNILJxSG29Bcse7I+gnfInuytXcekUVdTU06aGH9tI 6bFWX7S6MKGfquaTWxw4t2F8cvgcfTANqOy2VbcKUtruONJsT4mZabDInRtbeTDhHbXT KNrMRfXhWJh2s+0uj3KabP4hzHEd6A+/Xt2NbgS8a4nSUFtZTy2GDuwiSbh0ravWOIX/ 6TRWZRyvmDs93KUEmWXgFh5uOnbIEwotblEHiJhfRhYHV8DW9h4zdwG05MWU+JjE8YHH /9fXH2Ms2jpdlFzrlDHu/h5ixEnIB/u1xxGyOx0A3GSljE0+96lYQChT5NrAllupp0OP rdaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:user-agent:from :references:in-reply-to:mime-version:dkim-signature; bh=C0mrhoty+Ut/5gp43tpMbErT7DWwGt+4GLr6GpRkjbQ=; b=EX7uSCgjHCC7s/CKY1HjYPRuJRuY+r+kK0rEctds4agqeSOn/500kMCecCXqUFsL9i BJJrp/Ic1Ufc6OD0gdEjon83J7EtRfu0cCqpPNqurLzS5sAujF8H6GRs41HLPbdTHLuE wnzeBRvWL5KOVexXq3aCiZVNQ+o/jhQLPIzPems/XjvSej0AYU3QiKEoGDCJ7wVhs4Tn 9t6Ete0dAvp6qci++o4pHb2vEICGYfvmng2PoM36hInx9TL3FdL96Y390EWkrHL8C3BL Gjfwqa4su8dnUwY1JkDSv69uhzVl3yGIt1quJTOc4ahNHTX02hYgA7rG7zNBx1JBczGy Wsiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=i1+w0zA7; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sb40-20020a1709076da800b007baa6e2275asi14406050ejc.236.2023.01.10.11.39.54; Tue, 10 Jan 2023 11:40:07 -0800 (PST) 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=@chromium.org header.s=google header.b=i1+w0zA7; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230362AbjAJT3r (ORCPT + 53 others); Tue, 10 Jan 2023 14:29:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229758AbjAJT3p (ORCPT ); Tue, 10 Jan 2023 14:29:45 -0500 Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2325E49152 for ; Tue, 10 Jan 2023 11:29:44 -0800 (PST) Received: by mail-lj1-x236.google.com with SMTP id f21so9210187ljc.7 for ; Tue, 10 Jan 2023 11:29:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:subject:message-id:date:user-agent:from:references :in-reply-to:mime-version:from:to:cc:subject:date:message-id :reply-to; bh=C0mrhoty+Ut/5gp43tpMbErT7DWwGt+4GLr6GpRkjbQ=; b=i1+w0zA7s1qv8jt4zUE+emrBPpmeSdaUBPz0yCFo1nbNg9YBG5C9AAvS4RNrL0co/Y dqSyexwdFchejaYEPv5Wfg4lBoPaVxUCnM4E9fys7J60ul6YlINQL+lxBN5cjLvLT7fy V1Xpg8rHHMcctUni8OS7+vepJW4M0IZKby69k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:user-agent:from:references :in-reply-to:mime-version:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=C0mrhoty+Ut/5gp43tpMbErT7DWwGt+4GLr6GpRkjbQ=; b=wXxf1yDcjCJxJ8CtHeX7WCJK1Xu/YAsuwDPQKydO0B1BW+Sco3q3vB6rysBdqiz9Eb sJNSVELl1te/3E9C3LsQ+Dmp1XJz0dkD5npsFtqxxisWzmp8eypK67LXbA5vuBOlcwDe vmBwrF4NTnRE3eFoNHtVvd4bU+RB1adfwzb/XjREQS6snMpwkqyWc6+72U/7vRcp7Bo1 HnKJWgj7UML+sTmwtc3eOs2Llh5pCx1KUWl6NtiYV9gRXHLjuhRnKpVMtcmJlr27h/tG IqYFdfNT1Sxvw41qtg/guZvXKs3KNGCBAKtBZNzqeLu/1JMQVXxS4xY/mGCfrkfys2bQ +TRw== X-Gm-Message-State: AFqh2koeuOovgFoUXbRU1PA14LXIz9vszaHYrKseHm7IHIfRr1AxlyLv dO521U3k7LdKPcArv0/qYIZ9gK+dCjgehVpGWavP2Q== X-Received: by 2002:a2e:2ac4:0:b0:27f:cc03:496a with SMTP id q187-20020a2e2ac4000000b0027fcc03496amr3837868ljq.359.1673378982518; Tue, 10 Jan 2023 11:29:42 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Tue, 10 Jan 2023 11:29:41 -0800 MIME-Version: 1.0 In-Reply-To: References: <20230106030108.2542081-1-swboyd@chromium.org> From: Stephen Boyd User-Agent: alot/0.10 Date: Tue, 10 Jan 2023 11:29:41 -0800 Message-ID: Subject: Re: [PATCH] drm/panel: boe-tv101wum-nl6: Ensure DSI writes succeed during disable To: Sam Ravnborg Cc: Thierry Reding , linux-kernel@vger.kernel.org, patches@lists.linux.dev, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, yangcong , Douglas Anderson , Jitao Shi , Rob Clark , Dmitry Baryshkov Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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 Quoting Sam Ravnborg (2023-01-07 12:28:41) > On Thu, Jan 05, 2023 at 07:01:08PM -0800, Stephen Boyd wrote: > > The unprepare sequence has started to fail after moving to panel bridge > > code in the msm drm driver (commit 007ac0262b0d ("drm/msm/dsi: switch to > > DRM_PANEL_BRIDGE")). You'll see messages like this in the kernel logs: > > > > panel-boe-tv101wum-nl6 ae94000.dsi.0: failed to set panel off: -22 > > > > This is because boe_panel_enter_sleep_mode() needs an operating DSI link > > to set the panel into sleep mode. Performing those writes in the > > unprepare phase of bridge ops is too late, because the link has already > > been torn down by the DSI controller in post_disable, i.e. the PHY has > > been disabled, etc. See dsi_mgr_bridge_post_disable() for more details > > on the DSI . > > > > Split the unprepare function into a disable part and an unprepare part. > > For now, just the DSI writes to enter sleep mode are put in the disable > > function. This fixes the panel off routine and keeps the panel happy. > > > > My Wormdingler has an integrated touchscreen that stops responding to > > touch if the panel is only half disabled too. This patch fixes it. And > > finally, this saves power when the screen is off because without this > > fix the regulators for the panel are left enabled when nothing is being > > displayed on the screen. > > The pattern we use in several (but not all) panel drivers are that > errors in unprepare/disable are logged but the function do not skip > the remainder of the function. This is to avoid that we do not disable > power supplies etc. Ah that would have made it so I didn't see a problem. But I wonder if the panel gets borked if you don't disable it via DSI writes before yanking the power? > > For this case we could ask ourself if the display needs to enter sleep > mode right before we disable the regulator. But if the regulator is > fixed, so the disable has no effect, this seems OK. What do you mean by fixed? > > Please fix the unprepare to not jump out early, on top of or together > with the other fix. After this patch the unprepare only bails out early if the bool 'prepared' flag isn't set. Are you suggesting to get rid of that flag and unconditionally disable the regulators? Is it possible for the unprepare to be called multiple times without a balanced call to prepare?