Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp996457pxb; Thu, 4 Feb 2021 02:22:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJzUZxUw87Hyrzk3+jlfqoaLx/398N6klHEUpVb7845GQmIwjl3SdrTDWKEuoK8JrD6EhW/D X-Received: by 2002:a05:6402:40c4:: with SMTP id z4mr7252021edb.233.1612434143349; Thu, 04 Feb 2021 02:22:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612434143; cv=none; d=google.com; s=arc-20160816; b=AyJ4koS8ICx8Bp9AmpxrVGQLjvEC8sDY/NV++K8vh8xrPV3hxXJJAVgUDi/jJN1KgN sm0kWThT8egSvg6wjgv8WB4dGjDzfqDW9NOvmsRzGXUR4NgTYpnZlzNe7K4Jjqz51lF+ Q1FRPn6H/81jGabJaklaCXhNaIPVTyd391Ii76PxWAK7P9lFTSR2/S6YsXWniA1ULiDg UjSqiJ5vYUC20rqkUFIGEmJXwqs5gnRyDeeP5CmjVYLyzPMQb94Tt9lQvZHFnyZcWh39 yt3y+q9wTzeLQM0Z+eIUW1jAHFEsHRU4PbF7/Dhd0r3BboSv7Ym5VdY+b7oz3RWMnKIw NeCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=rNgoJgbHD7TTIu0rLfFdDvFg5hk3GBBsYt265YMiUgs=; b=eE2xqLuOG38fqSJLKOy8BBBNrGQQ+DMgdw7p4qNwCAfrVLWc0J3dVEWYIaVzyCXbmj 02gqzQVXjH0SP41qMPDJhnxsq6GkYB5Y8S4hFR7ocWcbI+jOGpFF40PjCkXm0d3kXhrU n04eonKeO0B5G5GIiM8VIlyrVdx0Iklp+ZZlvAiLPV0J4ai3/IDA6JZqwVk/KJpLTVUk 6bbmb9c9HF2TLpf6S7Qe3nPp4O1Lb1NnXcV2dv7V13WQkiQ+DzPrsoY3JzE/HevY2h6N 9ndt8UDEPErC5qj0c543FuznaL7xsPOHA74qFn56+oTVGMTSgB2ke0AFx8aW4tT+QzcI BOEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xs4all.nl header.s=s2 header.b=Iwyb+wP+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a1si620129edj.524.2021.02.04.02.21.57; Thu, 04 Feb 2021 02:22:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@xs4all.nl header.s=s2 header.b=Iwyb+wP+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235373AbhBDKU1 (ORCPT + 99 others); Thu, 4 Feb 2021 05:20:27 -0500 Received: from lb1-smtp-cloud8.xs4all.net ([194.109.24.21]:41861 "EHLO lb1-smtp-cloud8.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231244AbhBDKUY (ORCPT ); Thu, 4 Feb 2021 05:20:24 -0500 Received: from cust-b5b5937f ([IPv6:fc0c:c16d:66b8:757f:c639:739b:9d66:799d]) by smtp-cloud8.xs4all.net with ESMTPA id 7bjalHRIBW4yN7bjdlc377; Thu, 04 Feb 2021 11:19:40 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xs4all.nl; s=s2; t=1612433980; bh=rNgoJgbHD7TTIu0rLfFdDvFg5hk3GBBsYt265YMiUgs=; h=Subject:To:From:Message-ID:Date:MIME-Version:Content-Type:From: Subject; b=Iwyb+wP+J+s1F1mi2rLxtZfqYYM1Xir+ayJ0Dnr5ZG2ffGT20up8gV1Uaue8X6Wv2 IaftSAQQpK/m/UunW1W22JsnQZtzRlbziDu1cVKlAdfgPMztMLRo/08CwsQn4UDX5U kfN5HsLI0iB1NREIUKrQz3SclV+AcjT5dpOJKMgVpeeQOqniqEYTwaPO98sgrbv+g1 gHs1JVy4MlVv/PGGaNpFmxkvYido3atEIqanr24hzecbOsrzimTQSECFy4NfEngVTI p/HMujXmTfaETVxa1fUYABwqAxNgAof+coBx7I2ijiDGIDNomDSjN6GMPZl09vRz7M mpPnd4PYeSIwQ== Subject: Re: [PATCH v3 2/4] drm_dp_mst_topology: use correct AUX channel To: =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?= , Sam McNally Cc: LKML , Thomas Zimmermann , David Airlie , Hans Verkuil , dri-devel@lists.freedesktop.org References: <20200923121320.v3.1.I8693156f555875e5c8342e86ab37ce968dfdd277@changeid> <20200923121320.v3.2.Ided0ab0808c4908238bd2eb9ebb6ffb2c9312789@changeid> From: Hans Verkuil Message-ID: <2a7c2edc-b83c-dccf-487d-1415b4bc23ff@xs4all.nl> Date: Thu, 4 Feb 2021 11:19:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4xfJIAEhcGV8870J9oblZUYSUzZcvQeLy+fIP6P1UDWwpeh7ycXqMz/ikMNP2SR6gwVq5zuCqdeH7tILOMTt/F1OyBrV8O7jhdOCdtrt3fJ0zx9qoQW2Wb C9nPYYbu4/6zSXgt4vy49CWqQpQYmgylz/r4Oup2Ba2c4p82Epa/LNuh7+P1uTBwm4/R1QwiNHtuh3TtJ1QsJE54ueda+BLQLuYTylaXuVHvN8OB3GA1eUs6 pJDo2Sesm44mteX2MMrA3G0dpse1g+DA/klIlh+HFSSKCJR8Y20H+jhnATQOOIW+3c55XtXU0ZraNNltsJzkcAd6tHDcn86B3ZEzwGL55u+ABgdNc3AXeaXk iewyj0dC8PYMZQamurpbqZbmqTZmQLazWbF70BDT2oTAcLH1CeJbJBhyGFHFkfVOo+q8WrHm Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/02/2021 23:13, Ville Syrjälä wrote: > On Wed, Sep 23, 2020 at 12:13:53PM +1000, Sam McNally wrote: >> From: Hans Verkuil >> >> For adapters behind an MST hub use the correct AUX channel. >> >> Signed-off-by: Hans Verkuil >> [sammc@chromium.org: rebased, removing redundant changes] >> Signed-off-by: Sam McNally >> --- >> >> (no changes since v1) >> >> drivers/gpu/drm/drm_dp_mst_topology.c | 36 +++++++++++++++++++++++++++ >> 1 file changed, 36 insertions(+) >> >> diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c >> index 15b6cc39a754..0d753201adbd 100644 >> --- a/drivers/gpu/drm/drm_dp_mst_topology.c >> +++ b/drivers/gpu/drm/drm_dp_mst_topology.c >> @@ -2255,6 +2255,9 @@ drm_dp_mst_topology_unlink_port(struct drm_dp_mst_topology_mgr *mgr, >> drm_dp_mst_topology_put_port(port); >> } >> >> +static ssize_t >> +drm_dp_mst_aux_transfer(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg); >> + >> static struct drm_dp_mst_port * >> drm_dp_mst_add_port(struct drm_device *dev, >> struct drm_dp_mst_topology_mgr *mgr, >> @@ -2271,9 +2274,13 @@ drm_dp_mst_add_port(struct drm_device *dev, >> port->port_num = port_number; >> port->mgr = mgr; >> port->aux.name = "DPMST"; >> + mutex_init(&port->aux.hw_mutex); >> + mutex_init(&port->aux.cec.lock); >> port->aux.dev = dev->dev; >> port->aux.is_remote = true; >> >> + port->aux.transfer = drm_dp_mst_aux_transfer; >> + > > This was supposed to be handled via higher levels checking for > is_remote==true. Ah, I suspect this patch can be dropped entirely: it predates commit 2f221a5efed4 ("drm/dp_mst: Add MST support to DP DPCD R/W functions"). It looks like that commit basically solved what this older patch attempts to do as well. Sam, can you test if it works without this patch? Regards, Hans > >> /* initialize the MST downstream port's AUX crc work queue */ >> drm_dp_remote_aux_init(&port->aux); >> >> @@ -3503,6 +3510,35 @@ static int drm_dp_send_up_ack_reply(struct drm_dp_mst_topology_mgr *mgr, >> return 0; >> } >> >> +static ssize_t >> +drm_dp_mst_aux_transfer(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg) >> +{ >> + struct drm_dp_mst_port *port = >> + container_of(aux, struct drm_dp_mst_port, aux); >> + int ret; >> + >> + switch (msg->request & ~DP_AUX_I2C_MOT) { >> + case DP_AUX_NATIVE_WRITE: >> + case DP_AUX_I2C_WRITE: >> + case DP_AUX_I2C_WRITE_STATUS_UPDATE: >> + ret = drm_dp_send_dpcd_write(port->mgr, port, msg->address, >> + msg->size, msg->buffer); > > That doesn't make sense to me. I2c writes and DPCD writes > are definitely not the same thing. > > aux->transfer is a very low level thing. I don't think it's the > correct level of abstraction for sideband. > >> + break; >> + >> + case DP_AUX_NATIVE_READ: >> + case DP_AUX_I2C_READ: >> + ret = drm_dp_send_dpcd_read(port->mgr, port, msg->address, >> + msg->size, msg->buffer); >> + break; >> + >> + default: >> + ret = -EINVAL; >> + break; >> + } >> + >> + return ret; >> +} >> + >> static int drm_dp_get_vc_payload_bw(u8 dp_link_bw, u8 dp_link_count) >> { >> if (dp_link_bw == 0 || dp_link_count == 0) >> -- >> 2.28.0.681.g6f77f65b4e-goog >> >> _______________________________________________ >> dri-devel mailing list >> dri-devel@lists.freedesktop.org >> https://lists.freedesktop.org/mailman/listinfo/dri-devel >