Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1061843imm; Fri, 3 Aug 2018 17:29:56 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcZee4l1dqz+siPQ9JtSg6aXwKbMNuew40N8Sk9gCVU/hBRgftqat2YFIZohglj6LbP2YcD X-Received: by 2002:a63:4d5:: with SMTP id 204-v6mr5675626pge.129.1533342596603; Fri, 03 Aug 2018 17:29:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533342596; cv=none; d=google.com; s=arc-20160816; b=Ssf7/aii/rbAdMsekmCW7JtfISo6g7FoFubTk9OIao7z5TSX5RUC5gASo8T4zM3Lm2 /c/1IdgnwNsEAgiu+7FwAVP/fI8QoD1/gcYk/fHXGcnh+9p5I097uh4aL0u2Gw1u9lNL cWtdxk2Zk9TPwbhXAA9qU1hAMYdZuh2NWQaykwYHL7AW2XJ0Nq8Nyf0bfd1zL5Q2kFso ImnQwKWsj5oBsi5/98pIG1kja7HGi/s9VuGTFcqdX/kBs9Q5x6HxtiksoEYscHMZCVKS 1kK+55Nd2rZMf9ZoiKf9t7aYGeGk1C7vx8EUIOOLiOULORdJkpdbZVYFk57XWz5BabRX PP8g== 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=qw8IHGM/V3Ya7KcgKXAKGaDV+Bhj+ZJbxWNdtmMN10w=; b=L2r8rzvQkNlVM4ra24oVIvCrB2VxY7bNox6q7lOexqQ8BOfHWPheMWzH4K6WdBu5v+ dxWaXCjVgBD1ohjhHkXtzZ+81d4R4wnvlO6hPvBXXNvcK+qUPTxCIpxwIYm2EsUhAjLC hrlQQ8K+w3fu3PQb5sYoXzfnWsOMpUXdU8MQy6/oLW5xoHjufDRSxDOWpfAwyVmeAMw8 BJD1jWEgwc0kZgmmidsPw8wxQMzFSfQj22fWof78NgOvfZ3ZGaDn2F2tDpM20KX+lBpp M2IGXcfgaEdukuQUR0BBaGiBWTF5RjH3R30P/8FW3mYvhSDZGQrNzmNQLM+L05tFjo/Q 5/TA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=h3tc1dwn; 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 h7-v6si6051803pgl.399.2018.08.03.17.29.41; Fri, 03 Aug 2018 17:29: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=h3tc1dwn; 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 S1732124AbeHDC12 (ORCPT + 99 others); Fri, 3 Aug 2018 22:27:28 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:39934 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731986AbeHDC12 (ORCPT ); Fri, 3 Aug 2018 22:27:28 -0400 Received: by mail-pf1-f193.google.com with SMTP id j8-v6so4059010pff.6 for ; Fri, 03 Aug 2018 17:28:54 -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=qw8IHGM/V3Ya7KcgKXAKGaDV+Bhj+ZJbxWNdtmMN10w=; b=h3tc1dwnVoThTVbBKkLFlpF5grqz18S4Jnf8dTFLQab8ZnOqmZz3maFueLF6C8VrQM 57LHGjpUisEetVLZng3lWJHuimU0XfQHizgiGtTUnWX8bJWScw5PEc3fHntV5oDqnlgO GDPY1FhWlA3ueS3RrD25ajKHooQrWTQ1iYzpLDUM9vr08qZJfErIJlhBwTROPAq7H1vw Euvt2WBhil989IaKv16ZrfBRptxF9c7ugv8uyej1r/Oe4VmY0OA/CXgDEqWpwpgS0bRQ nSFVUdZdZS8edlZU/Ibh8+VOCtNbA0hgKE6X17fith5ySXsr5OtSFiFcStrs44fv+S/3 5EgQ== 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=qw8IHGM/V3Ya7KcgKXAKGaDV+Bhj+ZJbxWNdtmMN10w=; b=dzEM+bu+QNJZwIsGc0pL9DMPR7sX9m9IoccnADJczoasTbWi1GGPpAdIvTWMl/52/G pZqoPu3JMBtkW2/S5kEGt7/WQuzXLgnfGKvTQpKDCt/5zSGOgUutlUgs0xZTd6nO/U5y Yq1/oQWutxPe9AQ/O/nssh2gT6SpTZtCdjuRa+fcJ31Fo1h+Dq3W5HRJRnDjxbqQ2d5k FEMTSYEsc3JbAaMLq9XlM8tXrYLuDMv2PErTyWRl0QuZCfV3W7M1fLzN/UuF/YzY45sb wDYeCvDiBOfz4OB+O6rPbI3yENp0pAhMYxEdMCshU/mYzo/WXcIPuBALLqLt7iFlHP7U uaCg== X-Gm-Message-State: AOUpUlEbUCHt87FAQTPbdOI620G9240crvKWdNENwiSjYOK3WP8Yhinx 7CE9o63AbeVDZcK8vzUGP2fcWPW4 X-Received: by 2002:a63:d74f:: with SMTP id w15-v6mr5774971pgi.306.1533342534600; Fri, 03 Aug 2018 17:28:54 -0700 (PDT) Received: from localhost.localdomain ([2402:f000:1:4414:80c0:93b4:a4e2:6d2f]) by smtp.gmail.com with ESMTPSA id p26-v6sm10110338pfi.183.2018.08.03.17.28.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Aug 2018 17:28:54 -0700 (PDT) From: Jia-Ju Bai To: bskeggs@redhat.com, airlied@linux.ie Cc: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] gpu: drm: nouveau: nvkm: nv40: Replace mdelay() with msleep() in nv40_sensor_setup() Date: Sat, 4 Aug 2018 08:28:45 +0800 Message-Id: <20180804002845.18557-1-baijiaju1990@gmail.com> X-Mailer: git-send-email 2.17.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org nv40_sensor_setup() is never called in atomic context. It calls mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep(). This is found by a static analysis tool named DCNS written by myself Signed-off-by: Jia-Ju Bai --- drivers/gpu/drm/nouveau/nvkm/subdev/therm/nv40.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/nv40.c b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/nv40.c index 2c92ffb5f9d0..36c4b8865083 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/nv40.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/nv40.c @@ -59,11 +59,11 @@ nv40_sensor_setup(struct nvkm_therm *therm) if (style == NEW_STYLE) { nvkm_mask(device, 0x15b8, 0x80000000, 0); nvkm_wr32(device, 0x15b0, 0x80003fff); - mdelay(20); /* wait for the temperature to stabilize */ + msleep(20); /* wait for the temperature to stabilize */ return nvkm_rd32(device, 0x15b4) & 0x3fff; } else if (style == OLD_STYLE) { nvkm_wr32(device, 0x15b0, 0xff); - mdelay(20); /* wait for the temperature to stabilize */ + msleep(20); /* wait for the temperature to stabilize */ return nvkm_rd32(device, 0x15b4) & 0xff; } else return -ENODEV; -- 2.17.0