Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp520847iob; Wed, 4 May 2022 01:58:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxFM3YeQl78s6kjH2P3Uo6DgEjrsL+lJ1SX/0q+RDu79Tr7bEyxmDQLF5me8ERuKUDCTw6 X-Received: by 2002:a17:90b:350d:b0:1dc:6680:6f1d with SMTP id ls13-20020a17090b350d00b001dc66806f1dmr9161655pjb.27.1651654739120; Wed, 04 May 2022 01:58:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651654739; cv=none; d=google.com; s=arc-20160816; b=qezhAjO5vevl4/iabqnLvBUOSAW5ioT4KUm/hUKts2+TVBSV1I26yX69/jypV0hvpf 7eSBWHEJH8r5+oB/Rfj9yHCzj9GpZIkluiDyEwc7SOCEjW4jk+r+Usr0zE7YgfYkfre+ FOQj3uR7QwlUZyGRDK86hk83md3QjJ2x/CfRJn2YQP96xc9HyHeGaljTD4cOmpb43IwF t6dMAbNXZB+mCNg0VCMpO+E4pm2fHYpERJo37FgjSppc+9+H7/2XtWeERkeJAX4zvxj7 RIF6fXaaFK7g5lXHnUleStIQgc1LJUdxg5cHabpdzs1QauJs/8g/vLuydmip2dpgWieE RPug== 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:from:in-reply-to :references:mime-version:dkim-signature; bh=pb2U3zzfrat2Xd0DhY49bpvdy5b4ExUKudiUVsDW2+w=; b=phVEOj0sttQi6ZL8pJy407gMkE60aZpqgclB243PamqJt4qevIDAITP79ZMlBup9zx yohm44NMy+E/50pL7WpyRZTTsErPZI2k0s7Y/khcJtDnjYY4wZ704ROiyaBnS9IyJYho FwSyAPxvJYGkF8ub7dC4/THuCL6L8oummeKN5CPmTwXBibSOKlhIZBPVS9Jf9bhxoacE MZVaazhRrDBnIijg+tGAtENU5f48iezWAr6ZFpnWZu5rcjGNgB/KnMPYFgRAvqEwmRU/ 9CYmz8VQnw4M4EOGNVO7/5b+R81A5nqzZ76o4auKzT0Z1+cZlKEBISv+WN5umVpAFaNg a06Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=j2Ims4VZ; 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 q203-20020a632ad4000000b003abada69f69si19138821pgq.282.2022.05.04.01.58.43; Wed, 04 May 2022 01:58:59 -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=@chromium.org header.s=google header.b=j2Ims4VZ; 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 S244186AbiECXdc (ORCPT + 99 others); Tue, 3 May 2022 19:33:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234889AbiECXda (ORCPT ); Tue, 3 May 2022 19:33:30 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5FB93E0C9 for ; Tue, 3 May 2022 16:29:56 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id x17so32779354lfa.10 for ; Tue, 03 May 2022 16:29:56 -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=pb2U3zzfrat2Xd0DhY49bpvdy5b4ExUKudiUVsDW2+w=; b=j2Ims4VZpVmii4E0axF1CCzezk8fwHYMt/8idecqKu1txaHoaQXg6+B0OvU5mEDEVw UG1+OP9QqPtFm9+LbKBcl8eD52RmqUp6vujaPn7DKSBdvTDvilEqdaCTbgyl8xtbp4+T xTEZaTKDLWIFhkzwq/5AsD+3oFVfy3EXQilpI= 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=pb2U3zzfrat2Xd0DhY49bpvdy5b4ExUKudiUVsDW2+w=; b=0WdE1Zcleg7otMaymtC1wZIutzM+NHdcsXaFze72XW73+uBgyoN/o1F6M77QJVEkw/ htxzqkyFngAhElGW3q1jOBI390DpFIA3duSNnbc0NIqTyoBOnHcKFN+SViNHA8PlkXbv D/XU4tlkgOVZVDw0uzMu9aBGYwAF/ioJAfaGD4r18/l50b38VTlZmiKsZ34wFlA3xfFl v57PjMywdIl5zDI5eSAK8dk6zVkke6QeBT4KlyvJ4NPhzeKN74VX/IBjOff8sMmbJu9H TUouPBT2Kn8SdUireN5eSxC4s9YRuNWAVDJohPB2lAVd94i08UFl67CDyoiYnStXlvnz kXtQ== X-Gm-Message-State: AOAM5321Aw9q3PhjTxwH0t4ocClHMkpeuW6Kl41Qv4OxFFKEUQtox+wK L1tyx0n8HR3IQ+piMH09XYQ0VTv/BW3sydCj X-Received: by 2002:ac2:5285:0:b0:472:54b8:f62e with SMTP id q5-20020ac25285000000b0047254b8f62emr12277858lfm.231.1651620594679; Tue, 03 May 2022 16:29:54 -0700 (PDT) Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com. [209.85.167.53]) by smtp.gmail.com with ESMTPSA id h11-20020ac25d6b000000b0047255d2112bsm1055345lft.90.2022.05.03.16.29.54 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 May 2022 16:29:54 -0700 (PDT) Received: by mail-lf1-f53.google.com with SMTP id x33so32839675lfu.1 for ; Tue, 03 May 2022 16:29:54 -0700 (PDT) X-Received: by 2002:a5d:42c8:0:b0:20a:d91f:87b5 with SMTP id t8-20020a5d42c8000000b0020ad91f87b5mr14592104wrr.301.1651620248197; Tue, 03 May 2022 16:24:08 -0700 (PDT) MIME-Version: 1.0 References: <20220409023628.2104952-1-dianders@chromium.org> <20220408193536.RFC.1.I4182ae27e00792842cb86f1433990a0ef9c0a073@changeid> In-Reply-To: From: Doug Anderson Date: Tue, 3 May 2022 16:23:56 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH 1/6] drm/dp: Helpers to make it easier for drivers to use DP AUX bus properly To: Dmitry Baryshkov Cc: dri-devel , Robert Foss , Hsin-Yi Wang , Abhinav Kumar , Sankeerth Billakanti , Philip Chen , Stephen Boyd , Daniel Vetter , David Airlie , Linus Walleij , Lyude Paul , Thomas Zimmermann , LKML Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.7 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,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 Hi, On Mon, Apr 18, 2022 at 4:10 PM Doug Anderson wrote: > > > > 5. In general I've been asserting that it should be up to the panel to > > > power things on and drive all AUX transactions. ...but clearly my > > > model isn't reality. We certainly do AUX transactions from the DP > > > driver because the DP driver needs to know things about the connected > > > device, like the number of lanes it has, the version of eDP it > > > supports, and the available bit rates to name a few. Those things all > > > work today by relying on the fact that pre-enable powers the panel on. > > > It's pretty easy to say that reading the EDID (and I guess AUX > > > backlight) is the odd one out. So right now I guess my model is: > > > > > > 5a) If the panel code wants to access the AUX bus it can do so by > > > powering itself on and then just doing an AUX transaction and assuming > > > that the provider of the AUX bus can power itself on as needed. > > > > > > 5b) If the DP code wants to access the AUX bus it should make sure > > > that the next bridge's pre_enable() has been called. It can then > > > assume that the device is powered on until the next bridge's > > > post_disable() has been called. > > > > > > So I guess tl;dr: I'm not really a huge fan of the DP driver powering > > > the panel on by doing a pm_runtime_get() on it. I'd prefer to keep > > > with the interface that we have to pre_enable() the panel to turn it > > > on. > > > > Again, thank for the explanation. Your concerns make more sense now. > > As much as I hate writing docs, maybe we should put at least basic notes > > (regarding panel requirements) somewhere to the DP/DP AUX documentation? > > Sure. I actually don't mind writing docs, but my problem is trying to > figure out where the heck to put them where someone would actually > notice them. I could throw a blurb in the kernel doc for `struct > drm_dp_aux` I guess? How about a deal: if you can tell me where to put > the above facts (essentially 5a and 5b) then I'm happy to post a patch > adding them. > > Huh, actually, maybe the right place is in the "transfer" function of > that structure which, as of commit bacbab58f09d ("drm: Mention the > power state requirement on side-channel operations"), actually has a > blurb. ...but I don't think the blurb there is totally complete. What > if I changed it to this: > > * Also note that this callback can be called no matter the > * state @dev is in and also no matter what state the panel is > * in. It's expected: > * - If the @dev providing the AUX bus is currently unpowered then > * it will power itself up for the transfer. > * - If the panel is not in a state where it can respond (it's not > * powered or it's in a low power state) then this function will > * fail. Note that if a panel driver is initiating a DP AUX transfer > * it may power itself up however it wants. All other code should > * use the pre_enable() bridge chain (which eventually calls the > * panel prepare function) to power the panel. I didn't ignore this documentation request. Please take a look here and see what you think: https://lore.kernel.org/r/20220503162033.1.Ia8651894026707e4fa61267da944ff739610d180@changeid -Doug