Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2355303pxb; Fri, 5 Feb 2021 16:12:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJwI2A0azObWnnRp9jyySmEioy9O8jSkjbkxT76vDhQwvEWJfxS4ok7uIW9j93BXc/t6Z/df X-Received: by 2002:a17:906:6057:: with SMTP id p23mr6479186ejj.281.1612570344423; Fri, 05 Feb 2021 16:12:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612570344; cv=none; d=google.com; s=arc-20160816; b=L1IcoyvlGF2dqaELiw0uM0Jy0u3ceIOzbJLd8BTgXa55/uCE/dH+bO9il1Bnr0BNw5 EOeB1Uonem9oOJHo64nWov3mkjfAd4ThSnF0mmWpC6K5BomRlW0q85GPUSSPsUvo0mIU hD0JM8acg4mKCrFy5xxgyUByZhiWfZu4+BNeGYrdJeX59Ngdym7oj8FgqRuc000rubGS ZO+pMVBH4iFtljlPKWwHuajc4bkXUxge4V3c4IoJAGAcolPVusz36aJrSKaE+4VsVCfr vLDUc2r22Ju+pTuGQbLiSLhtvN2QjCx8MsaxAQ9XZnjZPfGfW/RDwBFc5y9C9C3ejNFr x/Mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=UBxTTZ2+IW27OF71JEat8UhTSxbriC22Djm7XAu/Szs=; b=NEVCXRn3N5q0UG+7R8XkaFbigq/Purv/xAWQShazIJSKsgOe6TzRoc/bCWHfhbB8a5 SUfmunJv0e3DBu87snL6tS5wi6o7CD8Rioeouh/b8PQjyK4+mEG9Dp1SqufW3ec1Fazh Xr+Vr0GJSToU+K11iuwko+MzWTq8Wi5uy7fVI2AA3IUSja24OT+OsS3vwsbchv2nSwnd thM1QtDHaOLOzIYkfPWzlHiP/IeFdDuMSX1qTi+07ENJFkELg+aQkQOjoPjpxYXYMuCW fkmVsAsiiovwN7Xj2PKOvIpgB7Ns1OlpOSyT1iHmNqVFJIWrM0Mm8YLu6DkQocCPCBRZ kHxg== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z7si3473976ejj.261.2021.02.05.16.11.59; Fri, 05 Feb 2021 16:12:24 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231191AbhBFAJJ (ORCPT + 99 others); Fri, 5 Feb 2021 19:09:09 -0500 Received: from mga11.intel.com ([192.55.52.93]:50761 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229466AbhBEN36 (ORCPT ); Fri, 5 Feb 2021 08:29:58 -0500 IronPort-SDR: P4CHLGU32cUGboFJJxqw7qAb5SIftnQfYweKWxnVkMeoRBQhxLHoyP+atqYUkVD3FJ8hkUDheA UDYnzgC783Dw== X-IronPort-AV: E=McAfee;i="6000,8403,9885"; a="177925968" X-IronPort-AV: E=Sophos;i="5.81,154,1610438400"; d="scan'208";a="177925968" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Feb 2021 05:24:24 -0800 IronPort-SDR: aS+rBOk+j+5+bJwejQHF/loJJtOuS4YLhMerS8SYm8LqmL6nEu9donoeOafigRuSS/x9xfrC4v hWdqWkg2JXow== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,154,1610438400"; d="scan'208";a="434448918" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.171]) by orsmga001.jf.intel.com with SMTP; 05 Feb 2021 05:24:21 -0800 Received: by stinkbox (sSMTP sendmail emulation); Fri, 05 Feb 2021 15:24:20 +0200 Date: Fri, 5 Feb 2021 15:24:20 +0200 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Sam McNally Cc: Hans Verkuil , LKML , Thomas Zimmermann , David Airlie , Hans Verkuil , dri-devel@lists.freedesktop.org Subject: Re: [PATCH v3 2/4] drm_dp_mst_topology: use correct AUX channel Message-ID: References: <20200923121320.v3.1.I8693156f555875e5c8342e86ab37ce968dfdd277@changeid> <20200923121320.v3.2.Ided0ab0808c4908238bd2eb9ebb6ffb2c9312789@changeid> <2a7c2edc-b83c-dccf-487d-1415b4bc23ff@xs4all.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Patchwork-Hint: comment Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 05, 2021 at 04:17:51PM +1100, Sam McNally wrote: > On Thu, 4 Feb 2021 at 21:19, Hans Verkuil wrote: > > > > 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? > > It almost just works; drm_dp_cec uses whether aux.transfer is non-null > to filter out non-DP connectors. Using aux.is_remote as another signal > indicating a DP connector seems plausible. We can drop this patch. Why would anyone even call this stuff on a non-DP connector? And where did they even get the struct drm_dp_aux to do so? > Thanks all! > > > > 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 > > > > > -- Ville Syrj?l? Intel