From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0BAFFC433F5 for ; Fri, 8 Apr 2022 13:43:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236427AbiDHNpw (ORCPT ); Fri, 8 Apr 2022 09:45:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230187AbiDHNpu (ORCPT ); Fri, 8 Apr 2022 09:45:50 -0400 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0AA441FB3 for ; Fri, 8 Apr 2022 06:43:46 -0700 (PDT) Received: by mail-ej1-x62b.google.com with SMTP id k23so17460563ejd.3 for ; Fri, 08 Apr 2022 06:43:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1ZpanQL7fJ5Imrl94t4mOv+0fifiSCixQTFhocGBbW4=; b=ocU4WzdvqVtDrF+QNMkeIFKSbQDrw614kxrKDCXUNEPj0TcZTn2VF33O7pzWeuQcUi /kpIefrRb+tIPM7KdnbR0CjVrj0C7uFD+iwBJMThlUaqxYgu/HgyrOL3xZXxjwikkwPM /w5y4+LqxJFClA/AFhhdE9da2MRmrUgMM0sYM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1ZpanQL7fJ5Imrl94t4mOv+0fifiSCixQTFhocGBbW4=; b=6CId9B7uU6YAjFMTD3on3SvdAZ/tfqaHzZiRtmWps77F55lRnGoarZBivBjp77x0an nllD52xcYAteJMHPDqxx1HbjnIVF6KbAQKo1gNm2zrYF7qF5vfauIZ9NMJc63WEm1USS GcWNB2CMDGB1vG36pLOKHPmt183dG0kNU4a2BlRitY48QCYs2R6RGLDribZzuxhhUAQM DCsxDsshtlhxaJyIOIe/j96qn2v9iS9Cu4ltn789HahUMqFvuk5pGHe1UBq6u6PuKpmy 70wSAp/C/XIG4llyQ6xU1kcZq+jv/KT6MhmsMVCeJtNUctACLk7JDfMJdyNtkHajcdEi YQcw== X-Gm-Message-State: AOAM532uZHqZ0YGdfr1boM6nx6D+YWZryefb1XU9olzPn2yTjMzqOsKy Mbb7K4+K/CmYkFBAGMgDWnnjf8znJ0NGwQAHOVI= X-Google-Smtp-Source: ABdhPJzXd1ZoehENiZCm57vnHqNZf3N1QdWVA6TEr/j+gsij9saL27MIuaSTBPzqlD5PyrkJMsYk+g== X-Received: by 2002:a17:907:3f03:b0:6df:b04b:8712 with SMTP id hq3-20020a1709073f0300b006dfb04b8712mr18796519ejc.290.1649425424938; Fri, 08 Apr 2022 06:43:44 -0700 (PDT) Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com. [209.85.221.51]) by smtp.gmail.com with ESMTPSA id ky5-20020a170907778500b006d1b2dd8d4csm8738709ejc.99.2022.04.08.06.43.42 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 08 Apr 2022 06:43:43 -0700 (PDT) Received: by mail-wr1-f51.google.com with SMTP id m30so12961736wrb.1 for ; Fri, 08 Apr 2022 06:43:42 -0700 (PDT) X-Received: by 2002:adf:e591:0:b0:206:1202:214 with SMTP id l17-20020adfe591000000b0020612020214mr14896572wrm.342.1649425421934; Fri, 08 Apr 2022 06:43:41 -0700 (PDT) MIME-Version: 1.0 References: <1648656179-10347-1-git-send-email-quic_sbillaka@quicinc.com> <1648656179-10347-2-git-send-email-quic_sbillaka@quicinc.com> <392b933f-760c-3c81-1040-c514045df3da@linaro.org> <3e5fa57f-d636-879a-b98f-77323d07c156@linaro.org> <225d2c0a-42ec-28ad-688c-e7e9e2035ee1@quicinc.com> In-Reply-To: From: Doug Anderson Date: Fri, 8 Apr 2022 06:43:28 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v6 1/8] drm/msm/dp: Add eDP support via aux_bus To: Dmitry Baryshkov Cc: Abhinav Kumar , "Sankeerth Billakanti (QUIC)" , quic_kalyant , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , quic_vproddut , David Airlie , linux-arm-msm , "Kuogee Hsieh (QUIC)" , freedreno , dri-devel , "bjorn.andersson@linaro.org" , Sean Paul , "Aravind Venkateswaran (QUIC)" , Stephen Boyd , Sean Paul , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Hi, On Fri, Apr 8, 2022 at 5:20 AM Dmitry Baryshkov wrote: > > > I guess my thought was that in DP you could still create the AUX bus > > at probe time. Then for DP you just return an instant "transfer > > failed" from the AUX bus if HPD isn't asserted. For eDP (as discussed > > elsewhere) when we try to do an AUX transfer then we delay until HPD > > is there. > > I think panel-edp would already handle the delay, so we do not need to > have this logic in the DP driver. There's a whole discussion about this between Stephen and me in patch #5 ("drm/msm/dp: wait for hpd high before any sink interaction"). Basically: * If panel HPD is hooked up to the dedicated HPD pin on the eDP controller then the panel driver doesn't have a way to read it. * We can't leverage the existing "HPD" query functions in DRM because those indicate whether a panel is _physically_ connected. For eDP, it always is. For now the rule is that the AUX transfer function is in charge of waiting for HPD for eDP if the dedicated HPD pin is used. If we want to re-invent this we could, but that system works, isn't _too_ ugly, and we're already making big enough changes in this series. > > So we can still acquire resources (clocks, PHY, io maps, etc) at probe > > time for DP and create the AUX bus, right? It will just return > > "-ENODEV" if HPD isn't asserted and you're DP? > > Yes, please. I still suppose that we'd need a separate case to > power_on eDP's PHY during the probe time. Maybe I'm mistaken here. I think the ideal way is to do it like Kieran's proposal for sn65dsi86: https://lore.kernel.org/r/20220317131250.1481275-4-kieran.bingham+renesas@ideasonboard.com/ * When enabling HPD (physical hot plug detect) in the hpd_enable() callback you do a pm_runtime_get(). You do the pm_runtime_put_autosuspend() when disabling. This is only used for DP since we only provide DRM_BRIDGE_OP_HPD for DP, not for eDP. * We do a pm_runtime_get() / pm_runtime_put_autosuspend() in the AUX transfer routine. While holding the pm_runtime reference we check HPD. For DP we return immediately if HPD isn't asserted. For eDP, we delay. * We do the pm_runtime_get() in pre_enable and the pm_runtime_put() in post_disable. For DP this will add a 2nd refcount (since we probably were holding the reference for HPD). For eDP this will cause us to power on. * If there's any other time we need to read HW registers, and we aren't guaranteed to already have a pm_runtime reference (like during probe), we can do a temporary pm_runtime_get() / pm_runtime_put_autosuspend().