Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp765278ybl; Wed, 4 Dec 2019 10:28:44 -0800 (PST) X-Google-Smtp-Source: APXvYqzF+nCfVu9W7qyr2+7khZBba9i5YOJfucIO/3XULSLJan7gpH9TnN12zKp59xPQDfoi1nTI X-Received: by 2002:a9d:630d:: with SMTP id q13mr3392064otk.31.1575484124298; Wed, 04 Dec 2019 10:28:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575484124; cv=none; d=google.com; s=arc-20160816; b=Lx+EkhZU0vP9Xw1hg99V5YE6EAlCqzMf+LzH4GTpR+n3BKAAaZPYq8t1KrjqGoNuP4 DlZIzGqgVlGoHAGLwJRwR8xW5cH2B4C7LX+Cd46FOc2knGyQhxnKUBDFTdrCvby6iXQX srm/x6ndxKKdP5TxmxaagnHjWtm/bdxce1/ft6YT8fjr0fjmZYp6QDBUPqjm7Me0SWiP MEUQl2AQ7OuvOjDWHA2I3JMMUwHKrmOqWWOG/ZXspNZhp40FwVJlrTII79D94HKJbNk1 PxOuh6emnu2tFYKZxEi+m/0JE0KD5omQTrispSrWjcSCUtKSoRrHFOlNlo5Hmer+a/IU KBlQ== 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:from:references:cc:to:subject:dkim-signature; bh=Uet6ftlBWt6BLt4lGobOQD5+cFdGEWSfTiuKL7t91js=; b=yl4tnU+TD2CvhLZlQP+3yrOyApWrHW3foNYE4yMWlxpVqFbOqQxEnBAWI/5XcRVtjt 7lLI/KBX8ddbncMo+UX4L0VhGMKKh4zq1Gj3sjnG1Al2C7gN2nSwq9bY4O8UWsGEyd6h AsLaeyInKtPZGKiO6bLaC9INWzwavcW2NWcxMKR8zNwomuLRiZEq7kVdX3GoYMbUUw17 gSGti2dHpk06SB2Ar6zAlAWdUUYaOOIT7Wjn7wmrkqO25M976ZxCH+1dYjc3N07QY7zS biBNwtLEOXDG1IERxnRlCjWYaRxxZTkPKf4WDYUWT7dcgqp/jMiPhygxkscTiPGeEnzk 9z9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=SbzuqJJ3; 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 p10si3617481oib.88.2019.12.04.10.28.31; Wed, 04 Dec 2019 10:28:44 -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=SbzuqJJ3; 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 S1729980AbfLDS1Y (ORCPT + 99 others); Wed, 4 Dec 2019 13:27:24 -0500 Received: from lelv0143.ext.ti.com ([198.47.23.248]:56970 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729423AbfLDS1V (ORCPT ); Wed, 4 Dec 2019 13:27:21 -0500 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id xB4IR9uL118997; Wed, 4 Dec 2019 12:27:09 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1575484029; bh=Uet6ftlBWt6BLt4lGobOQD5+cFdGEWSfTiuKL7t91js=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=SbzuqJJ3+pluoOby71dsCavu5VY1IJbySeO+FHIVH2JAUN6StofHWG/cC1GLh6F17 LDw6r7+PbTZtCvHUaRrRIxN8e7jV2AdctsNbU4vKyqu7FaEfhAMgi5d53K/QIjCtlc q58YXAV6zNHqrtQk9b87TGsUYr4gve4UuoeudWu4= Received: from DLEE109.ent.ti.com (dlee109.ent.ti.com [157.170.170.41]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id xB4IR9Tb051413 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 4 Dec 2019 12:27:09 -0600 Received: from DLEE115.ent.ti.com (157.170.170.26) by DLEE109.ent.ti.com (157.170.170.41) 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 12:27:07 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) 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 12:27:07 -0600 Received: from [192.168.2.6] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id xB4IR4nI106520; Wed, 4 Dec 2019 12:27:05 -0600 Subject: Re: [PATCH v6 03/15] drm/bridge: tc358767: Simplify polling in tc_link_training() 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> From: Tomi Valkeinen Message-ID: <0d84fa72-bc96-9b88-cd89-c04327109e0e@ti.com> Date: Wed, 4 Dec 2019 20:27:04 +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: <20190619052716.16831-4-andrew.smirnov@gmail.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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 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. We have 1000us limit in a few other places too, which I don't see causing issues, but might need increasing too. Also, 1us sleep_us may be a bit too small to be sane. If the loops take milliseconds, probably 100us or even more would make sense. This didn't cause any issues with your display? Tomi -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki