Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp346306imm; Fri, 21 Sep 2018 00:58:44 -0700 (PDT) X-Google-Smtp-Source: ANB0VdboxXXWBIrAK2cqzcHmVkD7UxFpDq/cRW8psDPj7WlgMxnIK49Fel2FVbHX70R2ORsKarv4 X-Received: by 2002:a62:1605:: with SMTP id 5-v6mr45105346pfw.11.1537516723978; Fri, 21 Sep 2018 00:58:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537516723; cv=none; d=google.com; s=arc-20160816; b=r6YfHWWCGkXKPSgHgTJENHQusEKWCoXjqD7GmQN5xF+Gaq4EsrsFRmtU5zGbIbIpON nmoZQQmbxK9n0HR55Gnlf3ivm2kOb9YioBnIQKVwL234gQqADGrXohfOS+NLGfQ1EpVr dclVje+M8uCPj2oMC9fqGjStn/83ZV2s2wB8gd7n8Es76URBge5n5W5BlgZz+lwzdZ5D kJmDCpQrlQckn4D9FJnRdwduleohXa1jyJBf5XLNUnX8v5P9f2sHdx+AoleTj5H1KD49 u+QS8TDGk4pVK0gudiAPrHdAaVi980sk7BqeUBh5NFMYxA4adoJ9p7eQJMgWfvaNdkLn melQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=kArUnrpPD7IBct04tez+WLX0D12XwJ/zK3y8dFo9myc=; b=EqsgXBkR4UrTJwCAg1IpY67Z10JIjOjOTmCe+BOWwNGX2ixnFaqaKPhyWBfLWtAGie QG1c9iZ7YtAoGv/1jCnqj4HeK+qmJ94s8YjaPcz8mOGB5bJ6i3kgeDOvnZPsaOi2R5lb 12t/XXJyamr1+CqxCxOi+rTK4qOWLiRJfY2dwB8nldAspp6yGF7qFJUgxIh3hn1wmUU7 WVD5qG73oUmWFXPgD2dSJcMy6uk5rGSRRL9ADSkw15kavI0YYj8Brs4FRaxp59Ta/Hqg sEkxVbBlS3q/qx8O+SU9nON51KTf9HN6juVkWpkKjI9cNRYj7S8yMXwwLFtrDp5TaZKl WhjQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id e4-v6si25049801pfn.340.2018.09.21.00.58.26; Fri, 21 Sep 2018 00:58:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S2389419AbeIUNoo (ORCPT + 99 others); Fri, 21 Sep 2018 09:44:44 -0400 Received: from mga14.intel.com ([192.55.52.115]:7615 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389156AbeIUNoo (ORCPT ); Fri, 21 Sep 2018 09:44:44 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Sep 2018 00:57:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,284,1534834800"; d="scan'208";a="74816928" Received: from labuser-z97x-ud5h.jf.intel.com (HELO intel.com) ([10.54.75.151]) by orsmga007.jf.intel.com with ESMTP; 21 Sep 2018 00:57:02 -0700 Date: Fri, 21 Sep 2018 00:59:30 -0700 From: Manasi Navare To: Damian Kos Cc: David Airlie , Rob Herring , Mark Rutland , Archit Taneja , Andrzej Hajda , Laurent Pinchart , Gustavo Padovan , Maarten Lankhorst , Sean Paul , Sandy Huang , Heiko =?iso-8859-1?Q?St=FCbner?= , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, quentin.schulz@bootlin.com, jartur@cadence.com, jbergsagel@ti.com, ltyrala@cadence.com, stelford@cadence.com, Quentin Schulz , pgaj@cadence.com, piotrs@cadence.com Subject: Re: [PATCH v4 2/5] drm/dp: fix link probing for devices supporting DP 1.4+ Message-ID: <20180921075929.GA28323@intel.com> References: <1537455288-20223-1-git-send-email-dkos@cadence.com> <1537455288-20223-3-git-send-email-dkos@cadence.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1537455288-20223-3-git-send-email-dkos@cadence.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks for the patch. Verified with the DP 1.4 spec and looks good to me. Also look at the related patch that makes use of the correct extended capabilities: https://patchwork.freedesktop.org/patch/249400/ Reviewed-by: Manasi Navare Manasi On Thu, Sep 20, 2018 at 03:54:37PM +0100, Damian Kos wrote: > From: Quentin Schulz > > DP 1.4 introduced a DP_EXTENDED_RECEIVER_CAP_FIELD_PRESENT bit in > DP_TRAINING_AUX_RD_INTERVAL register. If set, DPCD registers from > DP_DPCD_REV to DP_ADAPTER_CAP should be retrieved starting from > DP_DPCD_REV_EXTENDED. All registers are copied except DP_DPCD_REV, > DP_MAX_LINK_RATE and DP_DOWNSTREAMPORT_PRESENT which represent the > "true capabilities" of DPRX device. > > Original DP_DPCD_REV, DP_MAX_LINK_RATE and DP_DOWNSTREAMPORT_PRESENT > might falsely return lower capabilities to "avoid interoperability > issues with some of the existing DP Source devices that malfunction > when they discover the higher capabilities within those three > registers.". > > Before DP 1.4, DP_EXTENDED_RECEIVER_CAP_FIELD_PRESENT bit was reserved > and read 0 so it's safe to check against it even if DP revision is > <1.4 > > Signed-off-by: Quentin Schulz > Signed-off-by: Damian Kos > --- > drivers/gpu/drm/drm_dp_helper.c | 30 +++++++++++++++++++++++++++++- > 1 file changed, 29 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c > index 8c6b9fd89f8a..735ebde5c2f0 100644 > --- a/drivers/gpu/drm/drm_dp_helper.c > +++ b/drivers/gpu/drm/drm_dp_helper.c > @@ -370,10 +370,38 @@ int drm_dp_link_probe(struct drm_dp_aux *aux, struct drm_dp_link *link) > { > u8 values[3]; > int err; > + unsigned int addr; > > memset(link, 0, sizeof(*link)); > > - err = drm_dp_dpcd_read(aux, DP_DPCD_REV, values, sizeof(values)); > + /* > + * DP 1.4 introduced a DP_EXTENDED_RECEIVER_CAP_FIELD_PRESENT bit in > + * DP_TRAINING_AUX_RD_INTERVAL register. If set, DPCD registers from > + * DP_DPCD_REV to DP_ADAPTER_CAP should be retrieved starting from > + * DP_DPCD_REV_EXTENDED. All registers are copied except DP_DPCD_REV, > + * DP_MAX_LINK_RATE and DP_DOWNSTREAMPORT_PRESENT which represent the > + * "true capabilities" of DPRX device. > + * > + * Original DP_DPCD_REV, DP_MAX_LINK_RATE and DP_DOWNSTREAMPORT_PRESENT > + * might falsely return lower capabilities to "avoid interoperability > + * issues with some of the existing DP Source devices that malfunction > + * when they discover the higher capabilities within those three > + * registers.". > + * > + * Before DP 1.4, DP_EXTENDED_RECEIVER_CAP_FIELD_PRESENT bit was reserved > + * and read 0 so it's safe to check against it even if DP revision is > + * <1.4 > + */ > + err = drm_dp_dpcd_readb(aux, DP_TRAINING_AUX_RD_INTERVAL, values); > + if (err < 0) > + return err; > + > + if (values[0] & DP_EXTENDED_RECEIVER_CAP_FIELD_PRESENT) > + addr = DP_DP13_DPCD_REV; > + else > + addr = DP_DPCD_REV; > + > + err = drm_dp_dpcd_read(aux, addr, values, sizeof(values)); > if (err < 0) > return err; > > -- > 2.17.1 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel