From patchwork Fri Mar 15 21:36:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 13594073 Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 817D054914 for ; Fri, 15 Mar 2024 21:37:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710538665; cv=none; b=V1w4O18Z7Rxb7ldeda4e+V1wRkrOG7mqVaOjFxkj8sfHAzuyi+TY3AWMFm/HBzeLcVfeyUr7DS2L3l6y70vVHdyM0YvrU8CnXhZ+6C85rv//SM6IkXtwETnXClrK74q5qYM1cr+bwREKJDhsPZvi/Jkv2YVP0s2RO+vnXRY8SGc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710538665; c=relaxed/simple; bh=liSqK4bha3G0UMa5WwMSg9FNt50L6xUCUmE3EFyB78s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WygWNoSECVndkkMTCLQU5XVKXYMQkpfnseyju9kTY3yUxlPw+4sOGmWKRhXuhcCj6jJvGtJg7X7ovvJHUrvGiL4Ct8lwcnstqXJAslBdADfi8TxrPdy8jaLchQ6E/gCT2HB+B6rz6LxdVW7PJrUybyJcjWwhaz+3CfjFN2urvtg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=KohhdyEz; arc=none smtp.client-ip=209.85.210.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="KohhdyEz" Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-6e6f69e850bso1318823b3a.0 for ; Fri, 15 Mar 2024 14:37:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1710538660; x=1711143460; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3H6OXEbfvIDjIIA1tOpuyHi0Op96O49XQrGRIR14qb8=; b=KohhdyEzSvoGzOtlMpVfTJThhS/MJAuzfjzHLHTVIkOsRvwZZ3EPUbUUK3bBxb9rjD R+CZVbWuD7nJrrswJBRZgiie9vEvl1BxqQwtVdUH27O0u+4kTpj0tlQAqm/haMkichP1 NhvrEY5DkSKJ/ckxMwI/GIEoQ3aVt5RxJ1vTU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710538660; x=1711143460; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3H6OXEbfvIDjIIA1tOpuyHi0Op96O49XQrGRIR14qb8=; b=Uy9MdqDfj6wsTil11+cpvZMmOxGO0dsxTsc2ci7H2QpX2sGKiupkqjVnOwNsjRLiv4 PPXVy1vgh17cgBEz6SuoWV5b4U36MQ/5bjhu1U+mBJKH4KC2zuPhwZLDpiG/CyO2p4Pp AFMXAygmDi5ANwB89cwWCoIi/N70NlsAZSw0l5s8AGnIDbkU6Cto6ufd7GjBAcd33EwB wQ83w1F+iuMLYXO/XpTgr6dTR+0XcQu9MzhGTtIbFDNh8Go21N/CdG708N6SKlmIJR7Z XkIS2TWIDQ6JTIgI6qUHMB1M0T2Bxjjyd86ZokhCP65bbFkd0P6UjP9Libpj0X5G8Uy3 s6Ew== X-Forwarded-Encrypted: i=1; AJvYcCVvnhkvuGF7Um3OAM7GiqjDZnVZj9mCmcb19Ukdehdy7wNLHFB4s4AcNJGW3s/y+df51NgKhec+il1cqs4gkjsdbEoMiSVSFaWBA2V1WA== X-Gm-Message-State: AOJu0YxAcuZuOebp8BwqX/CPmdj1mB7yP23yZB1M0CvNqtShExtVhIh2 J2GMcO8POtfeLo0QK6P9X8xWCE8eo8vrS+tuAx6ukx7Mgud9nP9WPQypxCChnA== X-Google-Smtp-Source: AGHT+IELVx8nj+GWNrW14grfom6LFcSIwtz44rFdKRDSOfNG3DdINnqC2cuXSkNUt4NU7HimWVkT7g== X-Received: by 2002:a05:6a20:12c6:b0:1a2:b33b:d6e0 with SMTP id v6-20020a056a2012c600b001a2b33bd6e0mr7220673pzg.59.1710538659655; Fri, 15 Mar 2024 14:37:39 -0700 (PDT) Received: from dianders.sjc.corp.google.com ([2620:15c:9d:2:b23e:e8dc:3df4:aa2a]) by smtp.gmail.com with ESMTPSA id a26-20020aa7865a000000b006e6b5e65579sm3837142pfo.106.2024.03.15.14.37.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 14:37:38 -0700 (PDT) From: Douglas Anderson To: Rob Clark , Abhinav Kumar , Dmitry Baryshkov Cc: Douglas Anderson , Bjorn Andersson , Daniel Vetter , David Airlie , Guenter Roeck , Kuogee Hsieh , Marijn Suijten , Sean Paul , Stephen Boyd , Vara Reddy , dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/4] drm/msm/dp: Avoid a long timeout for AUX transfer if nothing connected Date: Fri, 15 Mar 2024 14:36:29 -0700 Message-ID: <20240315143621.v2.1.I16aff881c9fe82b5e0fc06ca312da017aa7b5b3e@changeid> X-Mailer: git-send-email 2.44.0.291.gc1ea87d7ee-goog In-Reply-To: <20240315213717.1411017-1-dianders@chromium.org> References: <20240315213717.1411017-1-dianders@chromium.org> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 As documented in the description of the transfer() function of "struct drm_dp_aux", the transfer() function can be called at any time regardless of the state of the DP port. Specifically if the kernel has the DP AUX character device enabled and userspace accesses "/dev/drm_dp_auxN" directly then the AUX transfer function will be called regardless of whether a DP device is connected. For eDP panels we have a special rule where we wait (with a 5 second timeout) for HPD to go high. This rule was important before all panels drivers were converted to call wait_hpd_asserted() and actually can be removed in a future commit. For external DP devices we never checked for HPD. That means that trying to access the DP AUX character device (AKA `hexdump -C /dev/drm_dp_auxN`) would very, very slowly timeout. Specifically on my system: $ time hexdump -C /dev/drm_dp_aux0 hexdump: /dev/drm_dp_aux0: Connection timed out real 0m8.200s We want access to the drm_dp_auxN character device to fail faster than 8 seconds when no DP cable is plugged in. Let's add a test to make transfers fail right away if a device isn't plugged in. Rather than testing the HPD line directly, we have the dp_display module tell us when AUX transfers should be enabled so we can handle cases where HPD is signaled out of band like with Type C. Fixes: c943b4948b58 ("drm/msm/dp: add displayPort driver support") Signed-off-by: Douglas Anderson Reviewed-by: Guenter Roeck Reviewed-by: Abhinav Kumar --- Changes in v2: - Don't look at the HPD line directly; have dp_display call us. drivers/gpu/drm/msm/dp/dp_aux.c | 20 ++++++++++++++++++++ drivers/gpu/drm/msm/dp/dp_aux.h | 1 + drivers/gpu/drm/msm/dp/dp_display.c | 4 ++++ 3 files changed, 25 insertions(+) diff --git a/drivers/gpu/drm/msm/dp/dp_aux.c b/drivers/gpu/drm/msm/dp/dp_aux.c index 03f4951c49f4..e67a80d56948 100644 --- a/drivers/gpu/drm/msm/dp/dp_aux.c +++ b/drivers/gpu/drm/msm/dp/dp_aux.c @@ -35,6 +35,7 @@ struct dp_aux_private { bool no_send_stop; bool initted; bool is_edp; + bool enable_xfers; u32 offset; u32 segment; @@ -301,6 +302,17 @@ static ssize_t dp_aux_transfer(struct drm_dp_aux *dp_aux, goto exit; } + /* + * If we're using DP and an external display isn't connected then the + * transfer won't succeed. Return right away. If we don't do this we + * can end up with long timeouts if someone tries to access the DP AUX + * character device when no DP device is connected. + */ + if (!aux->is_edp && !aux->enable_xfers) { + ret = -ENXIO; + goto exit; + } + /* * For eDP it's important to give a reasonably long wait here for HPD * to be asserted. This is because the panel driver may have _just_ @@ -433,6 +445,14 @@ irqreturn_t dp_aux_isr(struct drm_dp_aux *dp_aux) return IRQ_HANDLED; } +void dp_aux_enable_xfers(struct drm_dp_aux *dp_aux, bool enabled) +{ + struct dp_aux_private *aux; + + aux = container_of(dp_aux, struct dp_aux_private, dp_aux); + aux->enable_xfers = enabled; +} + void dp_aux_reconfig(struct drm_dp_aux *dp_aux) { struct dp_aux_private *aux; diff --git a/drivers/gpu/drm/msm/dp/dp_aux.h b/drivers/gpu/drm/msm/dp/dp_aux.h index 511305da4f66..f3052cb43306 100644 --- a/drivers/gpu/drm/msm/dp/dp_aux.h +++ b/drivers/gpu/drm/msm/dp/dp_aux.h @@ -12,6 +12,7 @@ int dp_aux_register(struct drm_dp_aux *dp_aux); void dp_aux_unregister(struct drm_dp_aux *dp_aux); irqreturn_t dp_aux_isr(struct drm_dp_aux *dp_aux); +void dp_aux_enable_xfers(struct drm_dp_aux *dp_aux, bool enabled); void dp_aux_init(struct drm_dp_aux *dp_aux); void dp_aux_deinit(struct drm_dp_aux *dp_aux); void dp_aux_reconfig(struct drm_dp_aux *dp_aux); diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index 4c72124ffb5d..b0f3e2ef5a6b 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -565,6 +565,8 @@ static int dp_hpd_plug_handle(struct dp_display_private *dp, u32 data) int ret; struct platform_device *pdev = dp->dp_display.pdev; + dp_aux_enable_xfers(dp->aux, true); + mutex_lock(&dp->event_mutex); state = dp->hpd_state; @@ -629,6 +631,8 @@ static int dp_hpd_unplug_handle(struct dp_display_private *dp, u32 data) u32 state; struct platform_device *pdev = dp->dp_display.pdev; + dp_aux_enable_xfers(dp->aux, false); + mutex_lock(&dp->event_mutex); state = dp->hpd_state; From patchwork Fri Mar 15 21:36:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 13594072 Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 58BD154FA0 for ; Fri, 15 Mar 2024 21:37:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710538663; cv=none; b=F1R0xc5o6Kz0Hhh7C09AqLICHBH26RUgHpxTmx17UjdiFkN91lcgLyN5WjS+fa5LUvKTPiJKhFgb8cLSaHwMg5fJ3KEUa6fXWnGwkomvK46t7b40SM2mh/BzrGoiLSVotjNrztofJJrHgvqFhjTn5ydLodi/XDtg9DC2gsmkreE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710538663; c=relaxed/simple; bh=S/LWxQwTqkvVjY27spi8XPjxed8P0WjgsxAUuc0By38=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fX6aNIZ4uXkIluQcxj33ugslEHmZcnskyRbEz4pS788v0DdoYknDg9hIm2Pva2w63+Wxm4hW/49RDKNCfoPJ6AEvUgQOOdxOcJRNNNNPxxTIbHBXmewPVXutvsSPbLeLDBG/2G3EDII2Flzyzdb0aOK2H8hDgnUwF3mDuZsY/GY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=M+4I/rWV; arc=none smtp.client-ip=209.85.210.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="M+4I/rWV" Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-6e703e0e5deso401604b3a.3 for ; Fri, 15 Mar 2024 14:37:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1710538662; x=1711143462; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=u21mx/A0InX+jfUvXdgWsx7ujtb0nq15BM8VeCC2N2w=; b=M+4I/rWVitMgjJvBweePN+XLiA/uls9oc6I0/hQgoa76n6cVSfdx+NO4OyZTEQ2zNo eZGedtH1uMvWwLZYb1HV65kbIXsHjvS9yX9Gi3P20blULupMYz25U6480Wg9IK7GwLiQ ia4m9YKbC7Wy/90Nc1Fvw9RwL7fYNh6J9y8QU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710538662; x=1711143462; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=u21mx/A0InX+jfUvXdgWsx7ujtb0nq15BM8VeCC2N2w=; b=RkR0tTsImmQ2/TsDTST6DHzGPn9apvrJ/XQa0wHrPDfpNk8WTKysAN0M5MDbPcxymf d++EtBa7Q3/SK1V1iSVm3N/FHTr1agRdrQaQuC7HVxy3YmwkZJdWa/5Zw+IlDmCCvN4e 3cEatzUGOQW875hynmREuDjeHiE+Rr2kJ9vDVxCMWKgUtzNMkLxEdqmDLdIy034G2bEx SX3clfvkznfLCtrMzJ/jJXInhjoGomyBw386xgCUBgMFpkYA4hLFcRdpPGpWZGFLUlrE PkBDEcM5HtVOEg7G8LDxLogXznlgcZYpRw0GZM6zM7XkMQ4IZg8Dr9tiwsYKjQXmbN8z vuDw== X-Forwarded-Encrypted: i=1; AJvYcCWeZ36uIPSI5FnebwqmEi5Xr8+x643UIRj6krbF1Qk2pIj/yKmeIeE0ubM11Xe2hQ1+bZfFDbkWgXvXa8WoiK6F8+FZ/cQyH0sInAYT6w== X-Gm-Message-State: AOJu0Yy8Wv+MaWDKdJcHPDVJhAPyipSPDxumQwf4mI6U1UIHTbVQH61j SXBdUzV1zaRI9V5RnyJszsfQsYFLFA0rtpDVcsPQhV0QCV0x0GlyuT0tRJL/tw== X-Google-Smtp-Source: AGHT+IFHkJVolH5h+841qAYWFr1aVz8UmRYXrXeiD5DmDtlSomkKbIXgspiQa3PcR0RRjxQiW+T8Ew== X-Received: by 2002:a05:6a20:7290:b0:1a3:539a:b23d with SMTP id o16-20020a056a20729000b001a3539ab23dmr1693119pzk.58.1710538661792; Fri, 15 Mar 2024 14:37:41 -0700 (PDT) Received: from dianders.sjc.corp.google.com ([2620:15c:9d:2:b23e:e8dc:3df4:aa2a]) by smtp.gmail.com with ESMTPSA id a26-20020aa7865a000000b006e6b5e65579sm3837142pfo.106.2024.03.15.14.37.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 14:37:40 -0700 (PDT) From: Douglas Anderson To: Rob Clark , Abhinav Kumar , Dmitry Baryshkov Cc: Douglas Anderson , Daniel Vetter , David Airlie , Kuogee Hsieh , Marijn Suijten , Sean Paul , dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/4] drm/msm/dp: Account for the timeout in wait_hpd_asserted() callback Date: Fri, 15 Mar 2024 14:36:30 -0700 Message-ID: <20240315143621.v2.2.I7758d18a1773821fa39c034b16a12ef3f18a51ee@changeid> X-Mailer: git-send-email 2.44.0.291.gc1ea87d7ee-goog In-Reply-To: <20240315213717.1411017-1-dianders@chromium.org> References: <20240315213717.1411017-1-dianders@chromium.org> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The DP wait_hpd_asserted() callback is passed a timeout which indicates how long we should wait for HPD. This timeout was being ignored in the MSM DP implementation and instead a hardcoded 500 ms timeout was used. Fix it to use the proper timeout. As part of this we move the hardcoded 500 ms number into the AUX transfer function, which isn't given a timeout. The wait in the AUX transfer function will be removed in a future commit. Fixes: e2969ee30252 ("drm/msm/dp: move of_dp_aux_populate_bus() to eDP probe()") Signed-off-by: Douglas Anderson Reviewed-by: Abhinav Kumar --- (no changes since v1) drivers/gpu/drm/msm/dp/dp_aux.c | 5 +++-- drivers/gpu/drm/msm/dp/dp_catalog.c | 7 ++++--- drivers/gpu/drm/msm/dp/dp_catalog.h | 3 ++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_aux.c b/drivers/gpu/drm/msm/dp/dp_aux.c index e67a80d56948..75c51f3ee106 100644 --- a/drivers/gpu/drm/msm/dp/dp_aux.c +++ b/drivers/gpu/drm/msm/dp/dp_aux.c @@ -322,7 +322,8 @@ static ssize_t dp_aux_transfer(struct drm_dp_aux *dp_aux, * avoid ever doing the extra long wait for DP. */ if (aux->is_edp) { - ret = dp_catalog_aux_wait_for_hpd_connect_state(aux->catalog); + ret = dp_catalog_aux_wait_for_hpd_connect_state(aux->catalog, + 500000); if (ret) { DRM_DEBUG_DP("Panel not ready for aux transactions\n"); goto exit; @@ -530,7 +531,7 @@ static int dp_wait_hpd_asserted(struct drm_dp_aux *dp_aux, aux = container_of(dp_aux, struct dp_aux_private, dp_aux); pm_runtime_get_sync(aux->dev); - ret = dp_catalog_aux_wait_for_hpd_connect_state(aux->catalog); + ret = dp_catalog_aux_wait_for_hpd_connect_state(aux->catalog, wait_us); pm_runtime_put_sync(aux->dev); return ret; diff --git a/drivers/gpu/drm/msm/dp/dp_catalog.c b/drivers/gpu/drm/msm/dp/dp_catalog.c index 5142aeb705a4..944ccb74f06c 100644 --- a/drivers/gpu/drm/msm/dp/dp_catalog.c +++ b/drivers/gpu/drm/msm/dp/dp_catalog.c @@ -253,17 +253,18 @@ void dp_catalog_aux_update_cfg(struct dp_catalog *dp_catalog) phy_calibrate(phy); } -int dp_catalog_aux_wait_for_hpd_connect_state(struct dp_catalog *dp_catalog) +int dp_catalog_aux_wait_for_hpd_connect_state(struct dp_catalog *dp_catalog, + unsigned long wait_us) { u32 state; struct dp_catalog_private *catalog = container_of(dp_catalog, struct dp_catalog_private, dp_catalog); - /* poll for hpd connected status every 2ms and timeout after 500ms */ + /* poll for hpd connected status every 2ms and timeout after wait_us */ return readl_poll_timeout(catalog->io->dp_controller.aux.base + REG_DP_DP_HPD_INT_STATUS, state, state & DP_DP_HPD_STATE_STATUS_CONNECTED, - 2000, 500000); + min(wait_us, 2000), wait_us); } static void dump_regs(void __iomem *base, int len) diff --git a/drivers/gpu/drm/msm/dp/dp_catalog.h b/drivers/gpu/drm/msm/dp/dp_catalog.h index 38786e855b51..d116df1fc3ac 100644 --- a/drivers/gpu/drm/msm/dp/dp_catalog.h +++ b/drivers/gpu/drm/msm/dp/dp_catalog.h @@ -85,7 +85,8 @@ int dp_catalog_aux_clear_hw_interrupts(struct dp_catalog *dp_catalog); void dp_catalog_aux_reset(struct dp_catalog *dp_catalog); void dp_catalog_aux_enable(struct dp_catalog *dp_catalog, bool enable); void dp_catalog_aux_update_cfg(struct dp_catalog *dp_catalog); -int dp_catalog_aux_wait_for_hpd_connect_state(struct dp_catalog *dp_catalog); +int dp_catalog_aux_wait_for_hpd_connect_state(struct dp_catalog *dp_catalog, + unsigned long wait_us); u32 dp_catalog_aux_get_irq(struct dp_catalog *dp_catalog); /* DP Controller APIs */ From patchwork Fri Mar 15 21:36:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 13594075 Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9D1F95676D for ; Fri, 15 Mar 2024 21:37:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710538670; cv=none; b=QlBhBF7dijIJ6xw3IRbwR3jYt5fXyp6LtOD2pYgailWr4KGi9AQjPuSp9aZkhVlT3VUpsWIN1vIfmcR0Vlgo8lJ56/qUR5U7XoBnZSK1H3tooraN6l0KJFJ/Jen+lWG4HUDQPvVB4Y+rtotofxFjef0MWY3YyIhC9sDGqZ2rZf4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710538670; c=relaxed/simple; bh=acyFtJQRnelnWZYDGUSGDw6BXQBKRCxuM7aVkptR+Ns=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VDFp3pIJrv+FP94VTBHR3bkxxOYX+xBlPA1+qOUpStvTsPpxMiCbJz6bFGuT1/7NxAYREXP8P1FuJpy5/Wt2Eumc5RzIkqrr2KhgEZn1HC7o523ob4gLEqnD9oJdaOsa6pAaNkneeyNty5DLrF44f8uTt6facbWgj3JEE041N0Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=lu77+Ek9; arc=none smtp.client-ip=209.85.210.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="lu77+Ek9" Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-6e6b5aa0b52so2325097b3a.3 for ; Fri, 15 Mar 2024 14:37:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1710538664; x=1711143464; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+b4mQbGcIQsTKsNYPQB3QvL0YJEVDJmGJzSl3gUd7iE=; b=lu77+Ek9s4dF2Z/zzJS5bnscpZ2m2JM2miJOrXe0pY0mT1wjHVzdyxGLLAvnYwf6QN l9zqaWHNorYJuBfeTsMrz76PJY/7VXO5vWuJzBUEFRUDDvy6kxaiMnnguluoxxOD4Rmu sQBykeNnFxHRYQivD8A21MpxuKyEfqjQUzINs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710538664; x=1711143464; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+b4mQbGcIQsTKsNYPQB3QvL0YJEVDJmGJzSl3gUd7iE=; b=KYwAsD/6mmwtroULtAmwO5cLjeFwsaAftd9MPxWdwIn5pi2vDNxWIDZczv9u2eNCR0 E7vJeEHa9e6/BzZ/JjPcUNyxiMhadkDtkRW3zP3Yz4c5JRq8QYSe5ZZu5vgNeo/mcr+I w2sUYgd/rZK2Kl3ysqO5ciBoi8NOaEI6zKD2Mp/MUHZP13Peq9bdVYgFgsWzVLeaoSPS OsXPkICtbVflHN0zZLEv2rgODI9AupJopv5gC3WGjPZjpJ/AAZ7e0tAC602d3cNrkRJn 3dVNVRUbMYAy7rCkon7MsvgtoxnJXvDKHa63xHZFvbCS2bFYRiR6BsLMiOiZVqUonJu0 LVHA== X-Forwarded-Encrypted: i=1; AJvYcCVdP7RnBNABCZbRaJa11/XUdmSWQdpBNIjWaY7pyohIWoYjtOPZ3PEH22y6Z7nV7Y751S+EC/n2DViliT7gfWgAjuAghSLVzsEUZ7Iw+Q== X-Gm-Message-State: AOJu0YzwyYF15Line/aYAemJNs0pcMUxZUHXJ8v5qsj9nJtvGTMGz9mU JHG/oRQpe4hmh2v/djyJBw7CeWGBG/a40LCEIBNWDGi3dOQZbsIB6hy52aFkLQ== X-Google-Smtp-Source: AGHT+IE6dILwhQwRnscQL2HZqCpcQ27ndmx7cXGzDQCIBh26yGtAACsBjiXvN4gTm/UODHNKDKm1Kg== X-Received: by 2002:a05:6a00:92a4:b0:6e6:5396:ce43 with SMTP id jw36-20020a056a0092a400b006e65396ce43mr6495390pfb.7.1710538663984; Fri, 15 Mar 2024 14:37:43 -0700 (PDT) Received: from dianders.sjc.corp.google.com ([2620:15c:9d:2:b23e:e8dc:3df4:aa2a]) by smtp.gmail.com with ESMTPSA id a26-20020aa7865a000000b006e6b5e65579sm3837142pfo.106.2024.03.15.14.37.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 14:37:42 -0700 (PDT) From: Douglas Anderson To: Rob Clark , Abhinav Kumar , Dmitry Baryshkov Cc: Douglas Anderson , Daniel Vetter , David Airlie , Kuogee Hsieh , Marijn Suijten , Sean Paul , dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/4] drm/msm/dp: Delete the old 500 ms wait for eDP HPD in aux transfer Date: Fri, 15 Mar 2024 14:36:31 -0700 Message-ID: <20240315143621.v2.3.I535606f6d4f7e3e5588bb75c55996f61980183cd@changeid> X-Mailer: git-send-email 2.44.0.291.gc1ea87d7ee-goog In-Reply-To: <20240315213717.1411017-1-dianders@chromium.org> References: <20240315213717.1411017-1-dianders@chromium.org> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Before the introduction of the wait_hpd_asserted() callback in commit 841d742f094e ("drm/dp: Add wait_hpd_asserted() callback to struct drm_dp_aux") the API between panel drivers and DP AUX bus drivers was that it was up to the AUX bus driver to wait for HPD in the transfer() function. Now wait_hpd_asserted() has been added. The two panel drivers that are DP AUX endpoints use it. See commit 2327b13d6c47 ("drm/panel-edp: Take advantage of wait_hpd_asserted() in struct drm_dp_aux") and commit 3b5765df375c ("drm/panel: atna33xc20: Take advantage of wait_hpd_asserted() in struct drm_dp_aux"). We've implemented wait_hpd_asserted() in the MSM DP driver as of commit e2969ee30252 ("drm/msm/dp: move of_dp_aux_populate_bus() to eDP probe()"). There is no longer any reason for long wait in the AUX transfer() function. Remove it. NOTE: the wait_hpd_asserted() is listed as "optional". That means it's optional for the DP AUX bus to implement. In the case of the MSM DP driver we implement it so we can assume it will be called. ALSO NOTE: the wait wasn't actually _hurting_ anything and wasn't even causing long timeouts, but it's still nice to get rid of unneeded code. Specificaly it's not truly needed because to handle other DP drivers that can't power on as quickly (specifically parade-ps8640) we already avoid DP AUX transfers for eDP panels that aren't powered on. See commit 8df1ddb5bf11 ("drm/dp: Don't attempt AUX transfers when eDP panels are not powered"). Signed-off-by: Douglas Anderson Reviewed-by: Abhinav Kumar --- (no changes since v1) drivers/gpu/drm/msm/dp/dp_aux.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_aux.c b/drivers/gpu/drm/msm/dp/dp_aux.c index 75c51f3ee106..ecefd1922d6d 100644 --- a/drivers/gpu/drm/msm/dp/dp_aux.c +++ b/drivers/gpu/drm/msm/dp/dp_aux.c @@ -313,23 +313,6 @@ static ssize_t dp_aux_transfer(struct drm_dp_aux *dp_aux, goto exit; } - /* - * For eDP it's important to give a reasonably long wait here for HPD - * to be asserted. This is because the panel driver may have _just_ - * turned on the panel and then tried to do an AUX transfer. The panel - * driver has no way of knowing when the panel is ready, so it's up - * to us to wait. For DP we never get into this situation so let's - * avoid ever doing the extra long wait for DP. - */ - if (aux->is_edp) { - ret = dp_catalog_aux_wait_for_hpd_connect_state(aux->catalog, - 500000); - if (ret) { - DRM_DEBUG_DP("Panel not ready for aux transactions\n"); - goto exit; - } - } - dp_aux_update_offset_and_segment(aux, msg); dp_aux_transfer_helper(aux, msg, true); From patchwork Fri Mar 15 21:36:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 13594074 Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A9E5457881 for ; Fri, 15 Mar 2024 21:37:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710538669; cv=none; b=twVJR3T6sGoFA6IGFQK8PyY5NZya9Mvn9W+CC6/8/vihqrrvopWBWJW8CRe2slIY19AbHAGj4OB6oTAXKaow3Ivo6t0MSCEtxFhDiMX3/r9Q+u9owENQnXST68KnEDtTkrXxdQh4fOJ4MGA+KZ1pynxuo3Hyp5uUshWS07v1JvQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710538669; c=relaxed/simple; bh=j7l/Wm2Ft+e3LgNffRWN0vGzV11pIV6gqysmAZ2ebYQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rMhu1oe4oU4MsupIECYpbi5HhI4YksESdF8oLbPSpL0Do86dR264mdW9ddXHzO7kNBPJfXrS8s7PAHOOjT+/LX4GyZE2rSCUPusd28sAntDxkzUtgvTtVUBO/6siQNDPpljdny9iteQKlOlnf9JcJTaPvMMvDjXLVK463XzEMgA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=IHBg+r/o; arc=none smtp.client-ip=209.85.210.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="IHBg+r/o" Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-6e6ccd69ebcso1647075b3a.0 for ; Fri, 15 Mar 2024 14:37:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1710538666; x=1711143466; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Gz22lebM2rTHwhNkx5aAaX7EA6Wa3wOGuC1PNKA3MCs=; b=IHBg+r/oUGxaLys6qlwFNA47SFc2j/1FkFfzxcsEZHFgKJm2+EF7sIiTn98TzGKLrg wVMsqkDOPI70Z/bJrVM8zoEYhDnaL3GF1yd53jYxkjebDFwfk5fRcE/uagPTE1p+BRoB Bfee85uLs7tByJfW6UQG1/yCiGOW2LaZeQN48= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710538666; x=1711143466; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Gz22lebM2rTHwhNkx5aAaX7EA6Wa3wOGuC1PNKA3MCs=; b=hOh/XEfaYeWteXJOLhJwu4DwabWHgbpXMdAN9mGFxfBlZwaJy+9hpwUkAXFbuo114c NEoywOQ+ouzFQSKa3w//i7PNG/TWXJ1ybKHSKXXumEUkeIXsxLO0Xzy4WZG7j7FZR01j AmcgxeQZN/fn7jOMChQyqdc5cDdl9vnwtKJYLPEmx+dggF9WsMrXtKDjSkKPrq82dk2S DSK7yjt+QRKJYCEbCZAskP4iIN+1SE1oPjusBILfjej4zRlgNSMZeMXYwbyAQnAtVkjG 8k1d6V7yte94jj8s7Ck5xUxfONRt4T5WRMGNXFcTezALHwGoJLKt2hm16VPttQImrw3v Ifow== X-Forwarded-Encrypted: i=1; AJvYcCUt3R+sSwfFf5C4B6sPLgGbK4ECLqVFWW3bpEzQXp3BHzlanRaYQEnjXSr9s/MRImaxC19ARMuo2tXyfOrV6xWKV5VGkMRu/mN1BVL6MQ== X-Gm-Message-State: AOJu0YyohbPUwdzDPAbvVOJcYObfv/jkOnjkyPi3Tq7WZ2BosyCQxlVu M94l8AreG0qHhw2vgLbxFn88rykjd9ok676ZAoX5pmIfYdfQgLBUB9J25Da6PyMnhfVcCnsSLZA = X-Google-Smtp-Source: AGHT+IHQFsTaKAjTWRRsrq1ZbLWnGQEVyGRFX2DMyF+SJJVN6Bd0rkX5tleEQkFmHdo17KUR5G1ENw== X-Received: by 2002:a05:6a00:845:b0:6e6:fb34:2568 with SMTP id q5-20020a056a00084500b006e6fb342568mr3035362pfk.0.1710538666024; Fri, 15 Mar 2024 14:37:46 -0700 (PDT) Received: from dianders.sjc.corp.google.com ([2620:15c:9d:2:b23e:e8dc:3df4:aa2a]) by smtp.gmail.com with ESMTPSA id a26-20020aa7865a000000b006e6b5e65579sm3837142pfo.106.2024.03.15.14.37.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 14:37:44 -0700 (PDT) From: Douglas Anderson To: Rob Clark , Abhinav Kumar , Dmitry Baryshkov Cc: Douglas Anderson , Bjorn Andersson , Daniel Vetter , David Airlie , Kuogee Hsieh , Marijn Suijten , Sean Paul , Stephen Boyd , dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 4/4] drm/msm/dp: Fix typo in static function (ststus => status) Date: Fri, 15 Mar 2024 14:36:32 -0700 Message-ID: <20240315143621.v2.4.Ia5dd755f81d7cc9a4393c43f77b9be4ed2278ee3@changeid> X-Mailer: git-send-email 2.44.0.291.gc1ea87d7ee-goog In-Reply-To: <20240315213717.1411017-1-dianders@chromium.org> References: <20240315213717.1411017-1-dianders@chromium.org> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This is a no-op change to just fix a typo in the name of a static function. Signed-off-by: Douglas Anderson --- Changes in v2: - ("Fix typo in static function (ststus => status)") new for v2. drivers/gpu/drm/msm/dp/dp_display.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index b0f3e2ef5a6b..78e702f66ed2 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -494,7 +494,7 @@ static void dp_display_handle_video_request(struct dp_display_private *dp) } } -static int dp_display_handle_port_ststus_changed(struct dp_display_private *dp) +static int dp_display_handle_port_status_changed(struct dp_display_private *dp) { int rc = 0; @@ -551,7 +551,7 @@ static int dp_display_usbpd_attention_cb(struct device *dev) drm_dbg_dp(dp->drm_dev, "hpd_state=%d sink_request=%d\n", dp->hpd_state, sink_request); if (sink_request & DS_PORT_STATUS_CHANGED) - rc = dp_display_handle_port_ststus_changed(dp); + rc = dp_display_handle_port_status_changed(dp); else rc = dp_display_handle_irq_hpd(dp); }