Received: by 10.192.165.156 with SMTP id m28csp419933imm; Wed, 11 Apr 2018 01:01:56 -0700 (PDT) X-Google-Smtp-Source: AIpwx48h05cIB4L+uNOwInfDbtO3L6JjhjXtEzJTwm8hI7nJ5djVws0mjDGtoM4XWCODFiqr55KZ X-Received: by 10.98.107.138 with SMTP id g132mr3085525pfc.163.1523433716461; Wed, 11 Apr 2018 01:01:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523433716; cv=none; d=google.com; s=arc-20160816; b=aVYT/tcvDcSjYXboImXP3LgZJHEZ3Aw1hm+WK1d8cYC4aZsmCrhyXq1LspbUDZ1bzQ ORc/YSNHmEcLHVBVJNOBxI6/kARYaiokZLs+t+O0RLTDFz5V9LT4F16B2vG6gba4JkSE GDa4YxQpi4oNAYCmOO7tYz+JHuWRB16ZcpOO2CtmdfeMVJC4XDyLKwVQiE4l+A+CRKH1 M+hWpMniqjTbge+7llKcwLt7/QHizgK4z4VH6ZsvM25VhuTkfN2NhfmbibteoCN0vBOW 3HKqtgrDNTzeJmFFmy4Oa+jB/ZwnGPzIn96jROZsyzclofIx+HhvcJ643u8mCilMCdor 4TXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=NTqyfd6GXVUm+gobc2ucE71OoUSUxUQcA/OLaqspayU=; b=tTww1q8VcwRV8NLnL7l2pR+TqiMZNScT0w+UMY7SuIAaZY0uf/ltxG8yOTbIsUv7bB wR8oZs2BaIMyFIGTIn31/hHirpxsoWHKbBO0f5RfHiYxYoQtiq7zwdyhsm4VkojEW4cy zA2mXs3qag11Ckf+HFR6Mppt/1klCA5xmFyC/5QMl3rzGWLCIlFLKqxAkz2AdWKphAXN sN4GAY8Z6pmGnlGSHquOgI/b+VishA7bxbcQkekS3Yydoqh+h/ErQeoQ5oncDxRrZY8R VVspIMXDbw1ECOCdwBZxP4DGjPjvrjjXjC+P5+zLC/rd3lGz8f3wjCtu9mMww15FmLp5 Z3fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WpLOFys9; 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 g66si443535pfc.383.2018.04.11.01.01.19; Wed, 11 Apr 2018 01:01:56 -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=WpLOFys9; 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 S1752411AbeDKH62 (ORCPT + 99 others); Wed, 11 Apr 2018 03:58:28 -0400 Received: from mail-it0-f66.google.com ([209.85.214.66]:51197 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750785AbeDKH61 (ORCPT ); Wed, 11 Apr 2018 03:58:27 -0400 Received: by mail-it0-f66.google.com with SMTP id r19-v6so1618100itc.0 for ; Wed, 11 Apr 2018 00:58:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=NTqyfd6GXVUm+gobc2ucE71OoUSUxUQcA/OLaqspayU=; b=WpLOFys90cerQeyG9RQ6zGi2ayrpanXWdJK1R7uy+kZnz9jG4bT3aQDNBEB8sQlLjn uJppRf0GXwNCzV0FmbjojBcBscnmdi0U6vK+yKqJjdVw6g4p2A++fnyGh9RSx8aCaHj3 w0PgOdvf0SXdX/I2/3ZPqOTH7a6n/JPQiGXrzJaxgw9H6iNgz051vTTZrepdNwn0Ot4J aCu97S4QnN4wkHyi3qEuHaoPQG4tIoEw5dwxZnTPDXZcT9+kY+kCzKkL4F9e4j7isasA K9a8KFzpwobH2ckZumKSQ26RuZur8susu4oAGiK70cVzKMqVnNg/6rDcKmTOBJw0K0wS 7RJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=NTqyfd6GXVUm+gobc2ucE71OoUSUxUQcA/OLaqspayU=; b=eGpNQR/+fW70G6nGH/WD7pm8hGuM9rGPnFNnfWgLs7Ksf0JOt+zslIsfPyNtRIFYSF 1ePncgKFt7K4Ef6hI0/nRpGQsRXTbMfe+JpvSy4kaCSDb1kkrllY9Bf/xTJqN6ufKQq1 gYCL6reR8ioizVNCElHqyDMgTJnbrN2X3ClExb1Dimrrnvk2pvV75dlHymczwdz8hlS+ 1xA9+C3tfm6ZdjAAKBA5RBkRbW7n5czLfR3VJYx9Cvlu5WQAOXhmMaBgUWbZ70jvpO1k AUKvYgdVmGAkw52t2Dm9Z649Sc+OHL7X0uM84kSHGNEayPIW5U+AHOnqr8sK9KFWFMWw OiGQ== X-Gm-Message-State: ALQs6tCaTznPZsoOvchxQkC68YkRFqbj3HkrvvMOjyWYl8MD87PfWiie g3+Ot15Wit4BUqVN0gzWCqI= X-Received: by 2002:a24:694a:: with SMTP id e71-v6mr2751937itc.33.1523433506831; Wed, 11 Apr 2018 00:58:26 -0700 (PDT) Received: from oslab.tsinghua.edu.cn ([2402:f000:1:4413:edc8:c1dd:b0a8:461d]) by smtp.gmail.com with ESMTPSA id 67sm270380iow.4.2018.04.11.00.58.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 Apr 2018 00:58:26 -0700 (PDT) From: Jia-Ju Bai To: thierry.reding@gmail.com, airlied@linux.ie Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] panel-jdi-lt070me05000: Replace mdelay with usleep_range and msleep in jdi_panel_init Date: Wed, 11 Apr 2018 15:58:10 +0800 Message-Id: <1523433490-4032-1-git-send-email-baijiaju1990@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org jdi_panel_init() is never called in atomic context. Despite never getting called from atomic context, jdi_panel_init() calls mdelay() to busily wait. This is not necessary and can be replaced with usleep_range() and msleep() to avoid busy waiting. This is found by a static analysis tool named DCNS written by myself. And I also manually check it. Signed-off-by: Jia-Ju Bai --- drivers/gpu/drm/panel/panel-jdi-lt070me05000.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c b/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c index 5b2340e..46b12a6 100644 --- a/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c +++ b/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c @@ -128,7 +128,7 @@ static int jdi_panel_init(struct jdi_panel *jdi) return ret; } - mdelay(10); + usleep_range(10000, 11000); /* Interface setting, video mode */ ret = mipi_dsi_generic_write(dsi, (u8[]) @@ -139,7 +139,7 @@ static int jdi_panel_init(struct jdi_panel *jdi) return ret; } - mdelay(20); + msleep(20); ret = mipi_dsi_generic_write(dsi, (u8[]){0xB0, 0x03}, 2); if (ret < 0) { -- 1.9.1