Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp101113pxb; Mon, 2 Nov 2020 15:18:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJzhTODgLBsokr3liVgWgvnaXol7R2hnjw46rv3NgdcnMEyf8Dt1awk0EnVKeRPSXzlqaM4W X-Received: by 2002:a50:cc86:: with SMTP id q6mr19754876edi.78.1604359134330; Mon, 02 Nov 2020 15:18:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604359134; cv=none; d=google.com; s=arc-20160816; b=UUWTCPdD8037GM2FXcBrL+Idn9R9ZtCVePgWnOG5M0upJQ0POh8ytvqtQMFT1O4zOa vk7VhF63+GRqaRUWWCKgJBiOqaDVzzNhrotdm6oFr+thpl5wDAl29/XPEDm1a95FY9hE 1wN+gs/NsyMJkUyi/0rqL7+MIQ2r/OyqOaFMdSnBBo6pvTapGwKm/O8e3YBZIuMvBpiz RkI33xO1C5QiFrtZhWpv7sMUelamitndjwCvwSA63DZMGHUeNkBOTjp7bIcru2fA94Q3 GyMbHjnRnO9ur+4J59nPjGsg2imE5YW9xvuO+i+flnEsP4hpiSQ+Y12VVNhA7p5Q54W7 B53w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Yd/yHPwpX3j/PkBKgMI4UlExzusZQuxmftwkBiDfwd0=; b=abApVncNAkebrm3x2GUFfcy+4a6dvLHKXKj3UAAVWAS6+sN1TNv+T+JjwXCE82FhXV g+e2r9ztggTnN2g1yTHWYLIQosLkrFby3o+KO0sbN569VnSeFNSnURG31npoYhNofre2 YLJwCPNHugnMZIFHl4rUM/n58C9AIYOtQXzl8aVuMeuciEzolEpeeERBpZ6VaYa5u3S7 LP0zmGxAF3Cs8lYidanopyQMjy4jBO2qy9nvSa8K6/z552uNPH/TbTT4DHd4GwwykdtK kQhi/R+bdXbfIKm8HpyL8CH3kxU4TdvJApij9duaiUjwKc3AmsrjKyjvemefo+Ip91oW 4K2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="Hp/PzG2n"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l7si11126582ejb.373.2020.11.02.15.18.32; Mon, 02 Nov 2020 15:18:54 -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=@gmail.com header.s=20161025 header.b="Hp/PzG2n"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726928AbgKBXOm (ORCPT + 99 others); Mon, 2 Nov 2020 18:14:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725841AbgKBXOm (ORCPT ); Mon, 2 Nov 2020 18:14:42 -0500 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D62C7C0617A6; Mon, 2 Nov 2020 15:14:41 -0800 (PST) Received: by mail-wm1-x341.google.com with SMTP id c18so10989872wme.2; Mon, 02 Nov 2020 15:14:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Yd/yHPwpX3j/PkBKgMI4UlExzusZQuxmftwkBiDfwd0=; b=Hp/PzG2nBC1gTiutjecqG6sDMBWHpgxt68CWrv7FKoC2KpclVQi5DiALbyOH/UcWEE pQXKbYe/q6R7+nfsAwBRSWgf6LEXMHlbzywmE9ffoTe5xjvyaVB9nGgsq4MnnZnf3F7s wOPYrOWMdoiPXfr+yVkOhf3z5JyZm0BSSJFj2WGltz5ZwHfd3v6p8bAs2G/TfvXs1wEA tKbJBU1HxsqBWxSZc/HBWRLZWDFDclhHUrPTST+38gO/i9jnWdaBaEQ6qQp7T/bCml11 G5ahd5unJCmCcd0EL39PVQDFmIUVJQKmFjLpOUCpt4LGTRpkOg0yVog98tDRygh2Xky1 aMZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Yd/yHPwpX3j/PkBKgMI4UlExzusZQuxmftwkBiDfwd0=; b=YO47PwgeLvHbd+owvz+Y8Q0fou2CgBYyshdZlKJtJYU+SXxUtGlviyNJXHaBvRnsRj B4Oc7mMuOm/82ncO9+Eh0QcfIcz5b0SmTD4XprS0iYG89CErehkF8coOKsoi5mO7OoZZ BruBaHGfkgYoEskvlJET29ZT+/4P+OGXjcrNwrsZ6VPLSbqAdFZK1bJivxFR3zsSWydr air3i5gTRz/YDxlXSM9XuNt4tKXRZJAn/tgTHbixKobpr7cBbmG2xbXn2pDgkySsuDY7 O3i9M6StB3DqAe0fDnjxx2t2toeny6fPTd57f3gjSpduuI39Yl8WqXsCIp4nYjqD30SE 4/OA== X-Gm-Message-State: AOAM531aW+AUYxH91MEt9fX6SuomRukCuS3WQCwP1QunlgBxdtMEH/hn OFGzWw33FtRaY6G2czpsToXfULoY+y998bfNvpezq8CGI7YKEw== X-Received: by 2002:a1c:8194:: with SMTP id c142mr440404wmd.94.1604358880548; Mon, 02 Nov 2020 15:14:40 -0800 (PST) MIME-Version: 1.0 References: <20201030232324.11170-1-khsieh@codeaurora.org> <160434536802.884498.16389146296525781476@swboyd.mtv.corp.google.com> In-Reply-To: <160434536802.884498.16389146296525781476@swboyd.mtv.corp.google.com> From: Rob Clark Date: Mon, 2 Nov 2020 15:16:13 -0800 Message-ID: Subject: Re: [PATCH] drm/msm/dp: promote irq_hpd handle to handle link trainign correctly To: Stephen Boyd Cc: Kuogee Hsieh , Sean Paul , Tanmay Shah , Abhinav Kumar , aravindh@codeaurora.org, Rajendra Nayak , David Airlie , Daniel Vetter , linux-arm-msm , dri-devel , freedreno , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 2, 2020 at 11:29 AM Stephen Boyd wrote: > > Subject has a typo in "training". > > Quoting Kuogee Hsieh (2020-10-30 16:23:24) > > Some dongles, such as Apple, required link training done at irq_hpd > > s/required/require/ > > > request instead of plugin request. This patch promote irq_hpd hanlder > > s/hanlder/handler/ > > > to handle link training and setup hpd_state correctly. > > > > Signed-off-by: Kuogee Hsieh > > --- > > Any Fixes tag? > > > drivers/gpu/drm/msm/dp/dp_display.c | 20 ++++++++++++++++++-- > > 1 file changed, 18 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c > > index 13b66266cd69..55627530957c 100644 > > --- a/drivers/gpu/drm/msm/dp/dp_display.c > > +++ b/drivers/gpu/drm/msm/dp/dp_display.c > > @@ -483,10 +485,24 @@ static int dp_display_usbpd_attention_cb(struct device *dev) > > return -ENODEV; > > } > > > > + hpd = dp->usbpd; > > + > > /* check for any test request issued by sink */ > > rc = dp_link_process_request(dp->link); > > - if (!rc) > > - dp_display_handle_irq_hpd(dp); > > + if (!rc) { > > + sink_request = dp->link->sink_request; > > + if (sink_request & DS_PORT_STATUS_CHANGED) { > > + dp->hpd_state = ST_CONNECT_PENDING; > > + hpd->hpd_high = 1; > > + } > > + > > + rc = dp_display_handle_irq_hpd(dp); > > + > > + if (rc && sink_request & DS_PORT_STATUS_CHANGED) { > > Can you add parenthesis around this? > > if (rc && (sink_request & DS_PORT_STATUS_CHANGED)) { > > > I honestly don't know what's going on in this patch. It talks about > making link training happen during irq hpd handler but this is the > attention handler and we're checking port status changed? This is > related? The code is really not clear. > > > + hpd->hpd_high = 0; > > + dp->hpd_state = ST_DISCONNECTED; > > + } > > + } > > > > return rc; > > } > > > > base-commit: 0e162b10644605428cd2596c12f8ed410cf9d2d9 > > What commit is this? Note that I skipped over a few dp related patches yesterday while starting to pull things into msm-next-staging. Kuogee, when you send the next version can you make sure it is based against v5.10-rc or msm-next-staging? BR, -R