Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp842693ybl; Wed, 4 Dec 2019 11:50:24 -0800 (PST) X-Google-Smtp-Source: APXvYqw03GYarwP3HPZYfGfIlP3c4b4vt8w4zalopxpn15UngaQnDDqaW/7VaNYst8SAJu9IlGYI X-Received: by 2002:aca:de0a:: with SMTP id v10mr3982432oig.156.1575489024652; Wed, 04 Dec 2019 11:50:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575489024; cv=none; d=google.com; s=arc-20160816; b=dbvG45VFHzyp+MNhypkF2wkGLxIt58zl/z/bIry3c9tIciLCdFJICPOh9qjnhsC5DS syFEGLni+VGtkqiAMBonY+o5hH9liGtUT1KwBX24E74rtVpZBweZxkzfrvY7ffDskQfF spIVZrX7qDk9j7QHDrJXyNGeNxa0nvLJBh/hKxKigO6rBbFVd/xn8MAKCM1ZCryhRVSx BRPV7ZNzPHeAZKEn8ETbwb4H7o8Rt6pRFCf2t+m9Li6ior6/62v3f7fRwHHYVfv/D7Iw kStB81kmr9PwmFH6kVfo3kCBEX7yOFLXcQKb10R2lpyEH9XQjUST7rG6AV1tWd5BZ6PY 9hDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject:dkim-signature; bh=INvrPZI5l4kkjk9uHY07YAmvrsfziEoknfrwIChpOz8=; b=Lsldx9wQZMj2+KK0yBdtmD6Dv1eNilM6LvC9sgXsVTU9v/9jwg0uMJFVu+ezqt0hVx MeG8ZgBFCgTDfSL02QEujlseMLUuW/SQ0jq09/BAcUY8sdbphlkwJ4bjC06CGHcKY8SL iNyRFvZzpNIQHc8nDjP2ZqlDAsfuk0tewfV1upkL5a52XNzeeuG0FTUSux8R1PctxmYm rObNji4JilFctQhksWUqhB2D4reWP86r86jbThGYbHJZJTUK6wS4C5X6QIicWJtTOCbO Sb1FRtPMRLnjwMBFrO30w4Kj3eVMUduF03TCQgHfn9erCXz8jGzuHuRjAQAm4kmuUy+K KQmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=cAKtD1Tv; 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=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k23si3758917oic.205.2019.12.04.11.50.12; Wed, 04 Dec 2019 11:50:24 -0800 (PST) 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; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=cAKtD1Tv; 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=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729169AbfLDTOL (ORCPT + 99 others); Wed, 4 Dec 2019 14:14:11 -0500 Received: from lelv0143.ext.ti.com ([198.47.23.248]:33466 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729152AbfLDTOK (ORCPT ); Wed, 4 Dec 2019 14:14:10 -0500 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id xB4JDxBK000406; Wed, 4 Dec 2019 13:13:59 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1575486839; bh=INvrPZI5l4kkjk9uHY07YAmvrsfziEoknfrwIChpOz8=; h=Subject:From:To:CC:References:Date:In-Reply-To; b=cAKtD1TvJwPuHmdqJGLoZN/AHr7XxMIhG01lF19iVzEUCJ0GGnbV+mbb9h9nIMj/W y3bI2aTrNRSNjFhyj5hJ2L4g3T1uLfBC7zUr/DjtAUFOhSRJwcpjosKeG5llno/xsZ nrnpIrHZ0ZCiOc6iNnXtjcCOqqbOQKoWXjX5n6ts= Received: from DLEE108.ent.ti.com (dlee108.ent.ti.com [157.170.170.38]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTP id xB4JDxm9125014; Wed, 4 Dec 2019 13:13:59 -0600 Received: from DLEE115.ent.ti.com (157.170.170.26) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Wed, 4 Dec 2019 13:13:58 -0600 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Wed, 4 Dec 2019 13:13:58 -0600 Received: from [192.168.2.6] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id xB4JDtxj035343; Wed, 4 Dec 2019 13:13:55 -0600 Subject: Re: [PATCH v6 03/15] drm/bridge: tc358767: Simplify polling in tc_link_training() From: Tomi Valkeinen To: Andrey Smirnov , CC: Andrzej Hajda , Laurent Pinchart , Andrey Gusakov , Philipp Zabel , Cory Tusar , Chris Healy , Lucas Stach , , Jyri Sarha References: <20190619052716.16831-1-andrew.smirnov@gmail.com> <20190619052716.16831-4-andrew.smirnov@gmail.com> <0d84fa72-bc96-9b88-cd89-c04327109e0e@ti.com> Message-ID: Date: Wed, 4 Dec 2019 21:13:54 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.1 MIME-Version: 1.0 In-Reply-To: <0d84fa72-bc96-9b88-cd89-c04327109e0e@ti.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/12/2019 20:27, Tomi Valkeinen wrote: > Hi Andrey, > > On 19/06/2019 08:27, Andrey Smirnov wrote: > >> @@ -748,22 +748,19 @@ static int tc_set_video_mode(struct tc_data *tc, >>   static int tc_wait_link_training(struct tc_data *tc) >>   { >> -    u32 timeout = 1000; >>       u32 value; >>       int ret; >> -    do { >> -        udelay(1); >> -        tc_read(DP0_LTSTAT, &value); >> -    } while ((!(value & LT_LOOPDONE)) && (--timeout)); >> - >> -    if (timeout == 0) { >> +    ret = tc_poll_timeout(tc, DP0_LTSTAT, LT_LOOPDONE, >> +                  LT_LOOPDONE, 1, 1000); > > This seems to break DP at least with some monitors for me. I think it's just a timeout problem, as > increasing the values helps. > > Using ktime, I can see that during link training, the first call takes ~2ms, the second ~7ms. I > think this worked before, as udelay(1) takes much longer than 1 us. Also the timeout in tc_aux_link_setup takes ~500us for me, and max is 1000us. So it works, but I think it's a bit tight. Tomi -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki