Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1461240ybb; Sun, 29 Mar 2020 05:23:55 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsk1hKyWBL/M0SexVoDoxXxzEAwQzjVUuzayWXb145oUuS8RFfdFtM23ArqSqoDnWt4tRAe X-Received: by 2002:a9d:4102:: with SMTP id o2mr1088525ote.98.1585484635070; Sun, 29 Mar 2020 05:23:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585484635; cv=none; d=google.com; s=arc-20160816; b=E1gLuH4+JgadqSpp4B3uFlbThI8482aLQVjYHhOyNQqoTfYYIV/dE9DZ5gjRiVmXC+ EMrizKqPIRmaJMGl+Lkk3E/iV5CkncPMW/Qyqw5mFY2VsNnKvYdqx9gtzXMm3vtBOd0I urX/62FZ59DKYbJYT/LJh5shk5b3moGfnm5Skdq6zo5rMEZ50FFWznIW47Jw431C8sll ZnNWCqPMbOyOYOlVgpn7Lc0tmA2+m5ypm3J/OHVOCJ5otFGAsfDMn2p4Xd7Hgplgk6nX A+uj0+D+ZBeBUqLx5M5ziL8t1b9fRBE6YfRu8PKafzalvcpWp3tsINEZoceSPfVWM9nD JY4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=6UClIPWeDMQPAzXntBk2QoHfbWj9MDU21yOBf0GHeHw=; b=Eb99g/AGg9jgikL7HbJtdN9Y9x55yqXn7UTsMq5ieZ++TJDy4e01jr3eMwZ+zywBm1 nXdfLfcbrXn4pj6HlZaVg4cXTeQ9XuQxq7Xfx9YjAXTmO5ORYwoxI9ey5QagEsZUBHCW K7Gie77IvmhvYZvYg14yLffbfYXMQR/CQ6zWwMAaPWzRdj8tTIstGDTtfM6IMPxvdXVK gDjxx9ltzJLcs9RIFZubfxocDt4LGM9xGCCBFGoKqqnaXrEs1L4mh2yQewslhGIBQ/XP GElF2+GsAKjyjdb679ECPbgElTPurZo/ISv5Fhlv5mMvlpcTE9cXYhqj9GfK2bcscR3g FKLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jdUOwg33; 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 z13si4224001oix.27.2020.03.29.05.23.42; Sun, 29 Mar 2020 05:23:55 -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=jdUOwg33; 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 S1728164AbgC2MWz (ORCPT + 99 others); Sun, 29 Mar 2020 08:22:55 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:42771 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728044AbgC2MWy (ORCPT ); Sun, 29 Mar 2020 08:22:54 -0400 Received: by mail-pf1-f193.google.com with SMTP id 22so7162620pfa.9; Sun, 29 Mar 2020 05:22:53 -0700 (PDT) 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=6UClIPWeDMQPAzXntBk2QoHfbWj9MDU21yOBf0GHeHw=; b=jdUOwg337Wg8hPuF5NdV1z+1iXNGjwb+YDUmS97pf9xkU/BWMOmRa8gpqg/wHMmz2a h58yHx1+HaoLmCL6hnIeTPqm+2YMk9XzXIgi8Vgh9+ZM41zzixi1r10H3tUGl6hbw2fa +/SCEv5PddejDs3d49ieJ06lzLGUMqG9GyxGvtAAn6VGkc3VIzvQFeTpteUPogXC2Pzf Nck2ZgMO6TY1u9JXPbiayQdMPaVsYZN0gYMyxOTiZ2uHnfym+nSJ5RCtbfwJVF5O2hRj FXgxRY9UmwUvEuFr258gE1lMF0n3PSTtd9BUt9ycNv+7B5vOzdWySiaKBoIv9i+HiGuE 66Yg== 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=6UClIPWeDMQPAzXntBk2QoHfbWj9MDU21yOBf0GHeHw=; b=KnEe6XjPVjmNADNjUjazYFiieYsEpGXBrvx734J77qKEV74h7t1VVqZ+nDksLazaC4 QKgn+cMIpVqPNG5RCUZTTeSXSxqkxt+gDHnz8F6iqeWAHwUfP2OOEYT1XCvYxHPa4Z7t /ajQeKH6GFa9uotjWYec9CCf1Y2aNhgnUjV/2DkOwVb1Ygm6B+CrZXtzJu7uu/LpVfHe lepCJabgYeRi57lvxhjdt3ysLjdbgokwId2ER/IHJK/ln3rz9K+QyRwjQGMyoxuz4Aak QPLM/mrT9LilH7CG9PA6hfT3RcA48lsCBlmqnYoyyNhdaSo/MMQVLkwDkyxviQF+7EzX qGgQ== X-Gm-Message-State: ANhLgQ1U/0zf2lpPzYbVrDLusyT3qAZBiW4hfKVmViIGdCJUPICJLte9 DFTdkENCCbxP/uKVNypcgizCvtl1iSpb1I01dx0= X-Received: by 2002:a63:798a:: with SMTP id u132mr8699746pgc.203.1585484573149; Sun, 29 Mar 2020 05:22:53 -0700 (PDT) MIME-Version: 1.0 References: <20200329092204.770405-1-jbwyatt4@gmail.com> <2fccf96c3754e6319797a10856e438e023f734a7.camel@gmail.com> In-Reply-To: From: Andy Shevchenko Date: Sun, 29 Mar 2020 15:22:41 +0300 Message-ID: Subject: Re: [Outreachy kernel] [PATCH] staging: fbtft: Replace udelay with preferred usleep_range To: Sam Muhammed Cc: Julia Lawall , Soumyajit Deb , John Wyatt , outreachy-kernel@googlegroups.com, Greg Kroah-Hartman , Payal Kshirsagar , dri-devel , linux-fbdev@vger.kernel.org, "open list:STAGING SUBSYSTEM" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Mar 29, 2020 at 2:23 PM Sam Muhammed wrote: > On Sun, 2020-03-29 at 12:37 +0200, Julia Lawall wrote: > > On Sun, 29 Mar 2020, Soumyajit Deb wrote: > > First of all, let's stop topposting. > > > I had the same doubt the other day about the replacement of udelay() with > > > usleep_range(). The corresponding range for the single argument value of > > > udelay() is quite confusing as I couldn't decide the range. But as much as I > > > noticed checkpatch.pl gives warning for replacing udelay() with > > > usleep_range() by checking the argument value of udelay(). In the > > > documentation, it is written udelay() should be used for a sleep time of at > > > most 10 microseconds but between 10 microseconds and 20 milliseconds, > > > usleep_range() should be used. > > > I think the range is code specific and will depend on what range is > > > acceptable and doesn't break the code. > > > Please correct me if I am wrong. > > > > The range depends on the associated hardware. Just because checkpatch > > suggests something doesn't mean that it is easy to address the problem. > Hi all, i think when it comes to a significant change in the code, we > should at least be familiar with the driver or be able to test the > change. > > In the very beginning of the Documentation/timers/timers-howto.rst > there is the question: > "Is my code in an atomic context?" > It's not just about the range, it's more of at which context this code > runs, for atomic-context -> udelay must be used. > for non-atomic context -> usleep-range is better for power-management. > > unless we are familiar with the driver we wouldn't really know in what > context this code is run at. > > This thread though had the same conversation about this change, for the > same driver. > https://patchwork.kernel.org/patch/11137125/ While it's a good discussion it reminds me that this entire function, i.e. reset(), repeats the on provided by fbtft core. Yes, the only question if it's atomic or not. IIRC ->reset() is being called only in non-atomic contexts and keeping reset signal longer is fine (but better to check with datasheet). So, I would rather to drop the function completely in order to use fbtft's core one. -- With Best Regards, Andy Shevchenko