From patchwork Fri Apr 2 22:28:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 12181699 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50A39C43470 for ; Fri, 2 Apr 2021 22:29:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2577461155 for ; Fri, 2 Apr 2021 22:29:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236052AbhDBW3l (ORCPT ); Fri, 2 Apr 2021 18:29:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235975AbhDBW3i (ORCPT ); Fri, 2 Apr 2021 18:29:38 -0400 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00976C061788 for ; Fri, 2 Apr 2021 15:29:36 -0700 (PDT) Received: by mail-pl1-x633.google.com with SMTP id y2so3063449plg.5 for ; Fri, 02 Apr 2021 15:29:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aTj0OGH7KaDzYKPFyz84iOUTYicqvk+ZBNlKttoJO+Q=; b=CgOs8CxEUCEHeF6iUU0vfsG5kJCASq3JPLdC4yt8vdPnN9hjSeAU5189WyCt326Ghi AfEwxJzlF73Zao6yjX7YMnN/6+Hzayv9NF1Re/lHKkogMMNs8JVCoypq231b1EOSy6uE LDNJt2tmY72VHDhggS5OHqI1LD1ogF85M64dM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aTj0OGH7KaDzYKPFyz84iOUTYicqvk+ZBNlKttoJO+Q=; b=Mpp7VaaDp5OhiL4lsynua7BEX/+zbr5a17kogFMyJQO9VzDxJefbwdNZDkDH+0bkFR Ktqa/7MT57KQNpn/yTITVc4/tOgBtdCCtQEk9ArNuwhEVYg3FeIq20WtcBPlhraJNwJh IatTUaFiNbjXiqIdn4Rnds2/khooFelzOTCSUONyg0A2rtFcd9+nw7rOwAu0dVF2ik7w y+wJ2Y0zsB8drFabim0ZvLSaijF3YE43PmkeAyyOBHWSjcu9WeEDTMNMrlbde9pkn1Uo oaABk95NT0OsrUGYPTjbZ8lz8DRHfdZjhkqAx9dA9cZFDZLmldwGWN4wgz5n/PENMlGK 3gmw== X-Gm-Message-State: AOAM532MJzyJYXQB9+vk1v1CqFQoxmuVRJFg3xUtOlTFR/hbqIZud68x HKcfjIxzGOebOJGhpdWEs5JMAg== X-Google-Smtp-Source: ABdhPJy/TfR1o90gA4kNkharNT2qLPaUBedqIkni2GWNH7z0Lj8Zn/4GcUMFAsIKElP5fYQSV9d9BA== X-Received: by 2002:a17:902:b210:b029:e6:33b4:cd9e with SMTP id t16-20020a170902b210b02900e633b4cd9emr14325791plr.67.1617402576574; Fri, 02 Apr 2021 15:29:36 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:201:6c58:fab2:c5e2:f2d7]) by smtp.gmail.com with ESMTPSA id t16sm9233094pfc.204.2021.04.02.15.29.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Apr 2021 15:29:36 -0700 (PDT) From: Douglas Anderson To: Andrzej Hajda , Neil Armstrong , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Sam Ravnborg Cc: Linus W , Bjorn Andersson , robdclark@chromium.org, Stephen Boyd , Steev Klimaszewski , Maarten Lankhorst , linux-arm-msm@vger.kernel.org, Stanislav Lisovskiy , Douglas Anderson , Daniel Vetter , David Airlie , Robert Foss , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 09/12] drm/bridge: ti-sn65dsi86: Fail aux transfers right away if not powered Date: Fri, 2 Apr 2021 15:28:43 -0700 Message-Id: <20210402152701.v3.9.Ifda98514600b646db4fc7bc55f0d0f9a4f1650db@changeid> X-Mailer: git-send-email 2.31.0.208.g409f899ff0-goog In-Reply-To: <20210402222846.2461042-1-dianders@chromium.org> References: <20210402222846.2461042-1-dianders@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org If the bridge (and panel) haven't been powered on then AUX transfers just won't work. Let's just fail them instantly. Signed-off-by: Douglas Anderson --- If the patch ("drm/panel: panel-simple: Use runtime pm to avoid excessive unprepare / prepare") is accepted then we could consider actually powering the panel on instead of failing the transfer. However, without that patch the overhead would just be too much since we need to do several AUX transfers for a single EDID read and powering up and down each time would just be too much. Changes in v3: - ("Fail aux transfers right away if not powered") split out for v3. drivers/gpu/drm/bridge/ti-sn65dsi86.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c index 543590801a8e..a76cac93cb46 100644 --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c @@ -896,6 +896,13 @@ static ssize_t ti_sn_aux_transfer(struct drm_dp_aux *aux, int ret; u8 addr_len[SN_AUX_LENGTH_REG + 1 - SN_AUX_ADDR_19_16_REG]; + /* + * Things just won't work if the panel isn't powered. Return failure + * right away. + */ + if (!pdata->pre_enabled) + return -EIO; + if (len > SN_AUX_MAX_PAYLOAD_BYTES) return -EINVAL;