Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp3711316ybd; Tue, 25 Jun 2019 07:14:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqzPfj3CyWGNxREgC3cp+737bHmz97h2cO0RcBjH6CsRKMgMlsv6rvlFAnY51Nw4bK99SiAv X-Received: by 2002:a17:902:7581:: with SMTP id j1mr154082827pll.23.1561472044969; Tue, 25 Jun 2019 07:14:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561472044; cv=none; d=google.com; s=arc-20160816; b=c7/pmeL8dvLh9UwfoO6r4Y/mvsaD+ngych4VqyPKbDzB0upjS1Cd1kGXVbtWHkYJ7e wb70da+x/u2F81BCM8RvHrt/xOv4D6pYL35a5GrhV7DTwMDWA1t4Sfvo6aL8SnmnJkmO 0msdTqRWnUsPREImScS72aupgc7A0If0iyR5RpD6LVbzwtyChPREOvDsbQ7sICZxL+k0 p3G+fyP2I//RmWBsc8pyozxmKRvSxMDxq3dHPps7VQ5/ipoJcuIl0uZPtz22ffmZlF0e Ys1Wf3w+23fa7VqLAPxqJ2IEcldIu3KhvthMb8cWU2hr75WHyStsaeX0c7N/N6rR2ueR y9HQ== 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:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=iQw4n8t+uwpyeSbD7pxmQZA+z4eDhg0QLsaqn/8KXOE=; b=oDwJCLAmjhN1VUIwdIuKAShYpBbtp7Uc8wFLud1TZn6zHXG53I9YrdYETAKfDAmvRP jPpUKhIu8VmQnnbC7LUd6wSVqDBEi8cSaV0Ly/jwx0G6Kg7DOltSbs+Yxs7ZqdqN/NHC dEqLzPsWtLGMHCQuznLVA/6ZhMNL1G1997IG2KUVvbzKti2VJhH8f58DGaqBVNEvdVQG BEMR1ufeY6DmCmfrIp5bdWdrjJAeGgj3Q0jw2T+TPBZPXh5PcL5HZd3M2PazQUFQSTxu lw4Q4gwWvibGh4P7TJnknh5yw+RS2K87O8BXmqEBCup8bpyBa2OamaE2U/jDPHEq3krM GDlg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 135si13231977pgb.357.2019.06.25.07.13.49; Tue, 25 Jun 2019 07:14:04 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728878AbfFYOMV (ORCPT + 99 others); Tue, 25 Jun 2019 10:12:21 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:53027 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727070AbfFYOMU (ORCPT ); Tue, 25 Jun 2019 10:12:20 -0400 Received: from kresse.hi.pengutronix.de ([2001:67c:670:100:1d::2a]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1hfmBE-0004Im-Hb; Tue, 25 Jun 2019 16:12:16 +0200 Message-ID: <1561471935.2587.11.camel@pengutronix.de> Subject: Re: [PATCH] drm/amd/display: Use msleep instead of udelay for 8ms wait From: Lucas Stach To: Harry Wentland , airlied@gmail.com, natechancellor@gmail.com Cc: sunpeng.li@amd.com, Anthony.Koo@amd.com, linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, alexander.deucher@amd.com, Jun.Lei@amd.com, Bhawanpreet.Lakha@amd.com, christian.koenig@amd.com Date: Tue, 25 Jun 2019 16:12:15 +0200 In-Reply-To: <20190625140046.31682-1-harry.wentland@amd.com> References: <20190625140046.31682-1-harry.wentland@amd.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6-1+deb9u1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::2a X-SA-Exim-Mail-From: l.stach@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Harry, Am Dienstag, den 25.06.2019, 10:00 -0400 schrieb Harry Wentland: > arm32's udelay only allows values up to 2000 microseconds. msleep > does the trick for us here as there is no problem if this isn't > microsecond accurate and takes a tad longer. A "tad" longer in this case means likely double the intended wait. Please see "SLEEPING FOR ~USECS OR SMALL MSECS ( 10us - 20ms)" in Documentation/timers/timers-howto.txt. The sleep here should use usleep_range. In general the DC code seems to use quite a lot of the udelay busy waits. I doubt that many of those occurrences are in atomic context, so could easily use a sleeping wait. Digging further this seems to apply across amdgpu, not only DC. Regards, Lucas > Signed-off-by: Harry Wentland > --- >  drivers/gpu/drm/amd/display/dc/core/dc_link.c | 2 +- >  1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c > b/drivers/gpu/drm/amd/display/dc/core/dc_link.c > index 4c31930f1cdf..f5d02f89b3f9 100644 > --- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c > +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c > @@ -548,7 +548,7 @@ static void > read_edp_current_link_settings_on_detect(struct dc_link *link) >   break; >   } >   > - udelay(8000); > + msleep(8); >   } >   >   ASSERT(status == DC_OK);