Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1063125imm; Fri, 3 Aug 2018 17:31:41 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe6x7mrFrx2xkD94czCPYlM57yrz2DuylzSGnnY/oVJuiK8R88BHTvTFtdqmH1Y6kXiCX0O X-Received: by 2002:a17:902:4081:: with SMTP id c1-v6mr5417061pld.169.1533342701910; Fri, 03 Aug 2018 17:31:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533342701; cv=none; d=google.com; s=arc-20160816; b=gUtaldGcogtgKqwuLZU8h9I/ebv3eAycfBFWXyJbjDEJnkfbyOSJUJWp+bY/DpJExs oMzM47Lpwy7gIb+AlapiW9remyIi8Ot1gyhGLB4TApapnYl+MjwCNQACjs08buqLoXQ3 2o76Qa8G6wzG4RG/bgvo1sLL759IpmxdUdkRqpz/EbM4A2GE1Ssa/m+3xtYXtLNsM8aI 7a8tPb/o+XWxwtSi6ZCmoGe5S7TapXHMa7eiZAk//ADWYitHp3EJPpcw8bsNATSWglHB lsavAnR33RSfnid8KQLd+ovQ2zfzN33RLbEzq/1Vm38U+e8ETZYqbzDufC4ryjFsJMDq 0QiQ== 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=HT0qfXR1a7UHzfd+dXBGc+vhC9vE9qM53mDMm7UJpLs=; b=nSHGt5mhpkf719n/a7dj49H3gFQlL0qzX7gtqzem3bZ9G4jiWDZrLx6g7smcnlrIS3 4XaUZCx4Vebp0YWAg2d1FEWOjDJemY41SVClvvvMt3WaSZO4vHP7eeZohcKJZvzG7qnu lHPMNhyjmJL70B4csY9OoW+hPbR/dezuB4tnuW7t/zGfVj8tl1VUxlpB/a/bL3xdiNUf 632jh9TtK7de1ZzZ35zQl7KJnBdOWpT2UWEYrJe7d6bv/mJVd4ksz/+zp7M+pEPqDGPg bfK5JczDV7ACC3jyVpKQL/vaE2DE4gpQgzVDxExybQwNYjp5eKXJ31RbPvhM6sRA4k/F ew0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="UwUI/AWv"; 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 o1-v6si4829095pld.223.2018.08.03.17.31.27; Fri, 03 Aug 2018 17:31:41 -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="UwUI/AWv"; 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 S1732173AbeHDC3O (ORCPT + 99 others); Fri, 3 Aug 2018 22:29:14 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:34188 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728173AbeHDC3O (ORCPT ); Fri, 3 Aug 2018 22:29:14 -0400 Received: by mail-pl0-f65.google.com with SMTP id f6-v6so3242343plo.1 for ; Fri, 03 Aug 2018 17:30:40 -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=HT0qfXR1a7UHzfd+dXBGc+vhC9vE9qM53mDMm7UJpLs=; b=UwUI/AWvga74ih5dq+aqQurwV63MNQkm1B59NWnIfrartLmwju0Oq55jOyY+hKnjZF plg1+HW2vaASf3sLWKdC5zcPMktu+AuWz8yR5/nSZsfsIndpoMhFklGyKdtDQrtEqZIZ qKKEnjIk50+Twg4BluU2XikDdPv38eYJeWMKaKOJRWKUtWuyZaB8rzSEhrOpzBE5XP98 7AVKOJqI/swDGR9x46cUE0qy5nWVeAR5P3zRD4sEe9O+t8fEY1Qyo5/UAXMCwH1ZEcvo tiWcwhyw3+VUwQhUFadWS2D3q+C2KEeB3loglCvMzlqCAncaJbK2T2TYBJzq9FE4rsjm 6WcQ== 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=HT0qfXR1a7UHzfd+dXBGc+vhC9vE9qM53mDMm7UJpLs=; b=MW5WdIrGG5W2yTQBYJUV2TLIHpHuqdpZXwSn3MgopcizUW8pENEiFqoRW23YpqJnN4 uI/DIfv54kUfAi9QuyqppHXyaYm5DVPIK7Lf4VETe1iLDc3h70g823HlRVcgv0TMxAxp rK95XdiD3o+g1bO04bhFdjs/cTelgBdHx37PUjMNmOunU9I0mZEJEx4L2FF0DGt93Gyv stU7isZYAb018VUeAk+U776HK4d0D7XLOXdHpdalOkdFzq/qQpguxLaDN8JRkxa7m5/2 w3o0NObvkJO1NuHKCcVkuFjp42adoYLRxhmF/W7l2cj9iS6xp0bnMjfkvO8tDZ636oIw nXjg== X-Gm-Message-State: AOUpUlHSwnQ0wrQko4qIWWJLhmJuPtpG1NKehCFD8f7Bap9lOAF16s7K ua6S3SIOhitNxNMBVMs67L4= X-Received: by 2002:a17:902:4201:: with SMTP id g1-v6mr5456228pld.203.1533342640064; Fri, 03 Aug 2018 17:30:40 -0700 (PDT) Received: from localhost.localdomain ([2402:f000:1:4414:80c0:93b4:a4e2:6d2f]) by smtp.gmail.com with ESMTPSA id 16-v6sm10067970pfo.164.2018.08.03.17.30.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Aug 2018 17:30:39 -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: nv50: Replace mdelay() with msleep() in nv50_sensor_setup() Date: Sat, 4 Aug 2018 08:30:30 +0800 Message-Id: <20180804003030.18669-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 nv50_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/nv50.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/nv50.c b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/nv50.c index 9b57b433d4cf..ce8f98f3ee48 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/nv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/nv50.c @@ -122,7 +122,7 @@ nv50_sensor_setup(struct nvkm_therm *therm) { struct nvkm_device *device = therm->subdev.device; nvkm_mask(device, 0x20010, 0x40000000, 0x0); - mdelay(20); /* wait for the temperature to stabilize */ + msleep(20); /* wait for the temperature to stabilize */ } static int -- 2.17.0