Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4161327pxb; Mon, 1 Feb 2021 14:17:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJyHWtdq93uaGTLr4HdXA54SsvhvF61+xMTg88+4vtKJJgH+nC/zc1Br2n5xrzrOegFYUqYI X-Received: by 2002:a17:906:3c41:: with SMTP id i1mr20057880ejg.443.1612217834134; Mon, 01 Feb 2021 14:17:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612217834; cv=none; d=google.com; s=arc-20160816; b=iPqJGC+/y50JJlYp/w12fpt/tAWmSGysJv1/Xxc+LvhfkoaVB7QyTP3PIv8nNZahl+ hF9GLnaiI/TI7CYfW2ObI+SPbqU2kZy6BeNXXjpIsWbYSorxYG7iaZuX+z/4MK0i4KDb Td9tpGJ6b8rGs47I7KQ3p6/P3JfKQYOqH9OAy/VMWn+QklkMlEIRus1GogFGDNCI5W9h 7oPWHTQ03HjptWAwaMbTRnLtD1f8yJTL0+IA0+XM8xle3xQCWM/lA9IyDvmDN+oqNLUs aJqVq7z6DZ1xHuFiY0vN4Mh4UKBwZp/CvZOeFfcN6xYKJ4wV1adGma5IgL6T23Lx+eBC 5bKQ== 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=vhqKQ1VyYgr2QHGT14xpSnRwlDb/JrgrXZGCsntEfDo=; b=A69wYJZEDK2oWwgAdo8CMHqmRN3iP36aQmGxW3TiQbj7Yvsqah8rSz4uz9IFXgrfmx dDtNI1dKL3GOcqEWQ3gYDz50uJy6dvsxKMsitQrMX4vuOeiegYrLbQPNddDLL3IngmCG kN+v+Gv+WbLuW9BCdVJh5XE6q48JU79AAYhwPP8K+kYVaoIkx23llG8+5qY2IIxN2yIl +FV8oN/kBTic3dQELnNj0lmyB6svf0wTLJZRmQWG6Tt3gYTRZFrFzb3Gnij0VzIHBJNo wtko/2w7aRr0n5UVJgyyH0bcr45uO32NPSy+CaYChE4lcRu0ishR1A4KQpocE8vTdih0 Difg== 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 j18si12310185edw.197.2021.02.01.14.16.49; Mon, 01 Feb 2021 14:17:14 -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 S229481AbhBAWPn (ORCPT + 99 others); Mon, 1 Feb 2021 17:15:43 -0500 Received: from mga18.intel.com ([134.134.136.126]:21874 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229527AbhBAWPl (ORCPT ); Mon, 1 Feb 2021 17:15:41 -0500 IronPort-SDR: KpqDNxTTqGSN7kY+dJZCL3hfkEYI8jBrzthrlGJdJDal28olaErKcJSzdImDxz46l4i0f6n3/b oPuW02ik3NkQ== X-IronPort-AV: E=McAfee;i="6000,8403,9882"; a="168441607" X-IronPort-AV: E=Sophos;i="5.79,393,1602572400"; d="scan'208";a="168441607" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2021 14:13:55 -0800 IronPort-SDR: k+DSzuSbx/nUyBmHFSNswXkbIERwisUZHZgb+djSOhQQ0beal1nSEl0Aqn7J1V/qDXZoa+lntX auRjh2B+D2GA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,393,1602572400"; d="scan'208";a="370133505" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.171]) by fmsmga008.fm.intel.com with SMTP; 01 Feb 2021 14:13:51 -0800 Received: by stinkbox (sSMTP sendmail emulation); Tue, 02 Feb 2021 00:13:50 +0200 Date: Tue, 2 Feb 2021 00:13:50 +0200 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Sam McNally Cc: LKML , Thomas Zimmermann , David Airlie , Hans Verkuil , 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> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200923121320.v3.2.Ided0ab0808c4908238bd2eb9ebb6ffb2c9312789@changeid> X-Patchwork-Hint: comment Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > /* 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