Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp700984imm; Fri, 27 Jul 2018 04:44:38 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe//R2YYwlLdL/iPw/IH9RN+tgea6EatcjC7DaDE4hxR+CjC9698QazfuXm2mddV8XGY6xe X-Received: by 2002:a63:e0b:: with SMTP id d11-v6mr5844831pgl.134.1532691878047; Fri, 27 Jul 2018 04:44:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532691878; cv=none; d=google.com; s=arc-20160816; b=UN3kBBxMVKON5TsT3MINLq8bTDCQ4tFR24DqMg8Geug4cd/1xQam/zvC4xDwAVekwk Q96cXTvc6H13AZOoM/cUgMX9eE1LGf3d+/rnT53nwZch+gdii/UZzGINnpaW/IIkXhqp +Dl0YRwtiuOj85UECVaFYL16cIR8ideleRPnyHkOtZSPYfsjqrq69wt61e2fy2nYcTdk zBm2QSnfrkEFciyHonDQHC8iCbduPfGDcDIvJe/oK1nIeeaxSd7/KsiXIijYE1bxfDyd QPvPwRsd4vJA8bJbcElTeTTtTPEJsFaJgC+B+PXf2S8/c7ScPjR6wQEY2rjcsCl9pYMv K+Fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=SHvt2nRo0vCTaEFnymhPEyi+ziLqDdq0wZ8DjqZdMHo=; b=SMrxOlfsLFJptx98c+iAR78kyJgmS8yWzO/gZoJv2Hg2Fp+VB9WoiGLsEZnPEibdPr vWBp73FuEX1GEr+1+0W/+I3QENPMF2kZlPXAEZNc1n8q6KWACoFiNiMhSBwfV9DBV7ye nl6pKf4xtuT7RN99pas3EVDZEEq0rnQLC6SboojaHg6fv2F2+yVSwZlS+kCCnevx4nEz PkDaY/RVJ+OetFFGQ1npb3flyLItUZ+52O/oHWVVqy4f2NlV2GngD0YPRerCILWdLowB 99cMy+BDn6EH/B/OzeKvZQ7mYuNUYLNdyNVsQfN8G/YTEYfiXIA9RsxSDZuOcwDssNj1 c5dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="LAI/3x+n"; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z33-v6si3763590pga.197.2018.07.27.04.44.23; Fri, 27 Jul 2018 04:44:38 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b="LAI/3x+n"; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730516AbeG0NFI (ORCPT + 99 others); Fri, 27 Jul 2018 09:05:08 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:37176 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729492AbeG0NFH (ORCPT ); Fri, 27 Jul 2018 09:05:07 -0400 Received: by mail-pg1-f194.google.com with SMTP id n7-v6so3110521pgq.4 for ; Fri, 27 Jul 2018 04:43:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=SHvt2nRo0vCTaEFnymhPEyi+ziLqDdq0wZ8DjqZdMHo=; b=LAI/3x+ndSvVSvr1ekAM6tgMAm+rWvvM9iB78iRSeWW9XaN/LINEUGAk6EptlMLMnU 3yB/QEi/Y1osu31Ldv++X45MThXWAjrTFeKV7atlQRSt22LI7hYxHXhfC7Cs03+gtJlL 5I3pN8DpS8a9m5yfiW0OstjCq1tv7k8rkkQjYsAu2532zFPDm2Wn1oFB7W9PGWCIjQGn I43t2pt9Ij0w67iWXUKVONjmHoOxGnbTZPCzOv7OTQw7Cx6j9npptyAIvwalhDXG26mq +ucAx+rBGhn6gUbdsgf0K2Lgava83ztn+JSq53KKjNmmrLy0I2HUR+uJy4YIWIFvtZdy 9y5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=SHvt2nRo0vCTaEFnymhPEyi+ziLqDdq0wZ8DjqZdMHo=; b=SEj9Y6aIsUVjYW0xYU+CRLDh9iQBoDremXu7YwO5G5f58IC387YkVm04EbcU9x9m2c W7G2t+ch6ODuhRYKD5vG0MtwAMAXD97jmGYS9GR0wYcS2ar4OVsKIPngklj3jxMoUiAr tA39PsVCzLhDkWDwzn98el7d9RBQ4NXC3FfSnJJWmQMpD7mF/1ykJCmaTamollzLB4+U qc3XrMo5RFRML13iMFJ1q9U3rMTpQwUsNNhehsYOSVxn2L3XqI7UFp731AfgRlR+HeRB aEwyOyt2bhN1kMlpb7sVMD2VrUdAHE8+9yptBa6UfqVIn2scC/zB5krmpeDU2nHfnPxU oNsg== X-Gm-Message-State: AOUpUlF7+uF9UYGDwWX/QKlhr71OoKZ10bd8Zm3/s8b5mxC7Myc5qCQI hkKPtq56rm0UDD3U+vuM6XXeva6OixI= X-Received: by 2002:a65:5581:: with SMTP id j1-v6mr5942627pgs.203.1532691815070; Fri, 27 Jul 2018 04:43:35 -0700 (PDT) Received: from ?IPv6:2402:f000:1:1501:200:5efe:101.5.211.5? ([2402:f000:1:1501:200:5efe:6505:d305]) by smtp.gmail.com with ESMTPSA id q25-v6sm7153531pfk.96.2018.07.27.04.43.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Jul 2018 04:43:34 -0700 (PDT) Subject: Re: [PATCH] staging: fbtft: Replace mdelay() with msleep() and usleep_range() To: Andy Shevchenko Cc: Thomas Petazzoni , Greg Kroah-Hartman , devel@driverdev.osuosl.org, Linux Kernel Mailing List References: <20180727092111.7218-1-baijiaju1990@gmail.com> From: Jia-Ju Bai Message-ID: <6ed64d7e-2899-ac18-78ed-508d14abf845@gmail.com> Date: Fri, 27 Jul 2018 19:43:28 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/7/27 18:34, Andy Shevchenko wrote: > On Fri, Jul 27, 2018 at 12:21 PM, Jia-Ju Bai wrote: >> reset() and init_display() are never called in atomic context. >> They call mdelay() to busily wait, which is not necessary. >> mdelay() can be replaced with msleep(). >> gpio_set_value(par->gpio.reset, 0); >> udelay(20); >> gpio_set_value(par->gpio.reset, 1); >> - mdelay(120); >> + msleep(120); > I didn't look to the rest, but this one will be inconsistent after your patch. > > The question here is why udelay() is needed, while mdelay() changed? > I thought udelay() is used for short delay, so it is not very necessary to change udelay() to usleep_range(). mdelay() is used for longer delay, so I changed it to msleep(). If you think udelay() should be also changed, I can send a new patch :) Best wishes, Jia-Ju Bai