Received: by 10.213.65.68 with SMTP id h4csp3308598imn; Mon, 9 Apr 2018 18:45:13 -0700 (PDT) X-Google-Smtp-Source: AIpwx49eqrzSN0EK89MypWI2aMdxo3ZavQbRxLc9yvZ+8hT5TVPxMQr+ic+kEMsTP5mPZW6CVNXN X-Received: by 2002:a17:902:3f83:: with SMTP id a3-v6mr41457536pld.279.1523324713915; Mon, 09 Apr 2018 18:45:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523324713; cv=none; d=google.com; s=arc-20160816; b=zS1BhxgpfdIwAN/PKtcv+p6JABlGJmdK4oKk5rMSw6MtrMl3aicAij03fpCJn5lLtD 7JhHkF4Crr2RFXJvl71bVEb79fpZe3xJPWy4/jiXvloprPf23RFOaT9h9+ihT5Ikb/pe yQD9GaOdAHO90q/oSDc9/c67kIRV5ioDG2BnYYYZJbshVwMLUYhrcmeSp6pMcvSib4px nD7/Yl3uuSaTBHxY1rkLh69hsLopomz1LD00PV5mPrqqAl1s+IWHtYYK4valEAckJpGD KLu+PrBgBJha2S2oolVinDA4C+P2vxRDx6BD0Odr6SIoNqkOc35qo3MYPe8O39Wj593B q/lw== 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=xvNzqJjaTwn8dpUlPeL4ut3MgVTJyeqfLrr2r3kERPw=; b=hc2IgW3v13QVVSLJh3SRVA8VW4WPP+0rQBkf3yqo7lEzwy6NOCS4/V8MZFLCoNF1pt VwA7ozUyxlqOkCd7oEpgd5Phle5lBJucEVhDU9nSnwu5Sti1aTyJrhMRYyqJ8/u4ScGm woSV6w1phFKLiwGVj8oeA0kmjDAtg2MBV6bqSdfdYHjmIlR9z1RHnFUbNJqht6QAB9bt ddTG6/i2wB18eMVFFuvyhU0exLOhKxZA8So7a0aonCVuC74+dC6ipMyFvHiQ0OaW2RAm 3z+ZqcKBJSYTWzFlyHRTyc2sAQBncpzP2FeaEvTcr1aeU/gzw9szq0+neASoV+y4hIu9 pOSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qi7reEF7; 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 e15-v6si1527418pli.163.2018.04.09.18.44.35; Mon, 09 Apr 2018 18:45:13 -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=qi7reEF7; 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 S1752084AbeDJBkr (ORCPT + 99 others); Mon, 9 Apr 2018 21:40:47 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:40697 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751543AbeDJBkp (ORCPT ); Mon, 9 Apr 2018 21:40:45 -0400 Received: by mail-pl0-f67.google.com with SMTP id x4-v6so6340937pln.7; Mon, 09 Apr 2018 18:40:45 -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=xvNzqJjaTwn8dpUlPeL4ut3MgVTJyeqfLrr2r3kERPw=; b=qi7reEF7PiWKPHjcHi+CjMk0rtgExGnR3z+H3aZtnl2LdJ6DRBihhnxi4AFwYeI3O3 KskeCRwKuJbjRqCoYiG9MCO3leqdK0+ow70Z3ox0FNwBCz2tTut6bmPKw8zxgedzSYP7 T5paim496wlQIenngnZgwt40TLVYTekIyoot5IjXYKPGixFNP1qZY/axcSB/4+2vPkmS j8bZeXPA4+LlaF1fnYhkMpSbr1vFymqKA2aiwp63uihE70KJrjKS5v4QPY5Nrt35opgw Q3Ds3VQnWEik/tojfYgQQ3Q773DunaXOEVWA20EfT9SafyJ5Wl+2MK8CzD2X4JLh2Yz5 cW/A== 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=xvNzqJjaTwn8dpUlPeL4ut3MgVTJyeqfLrr2r3kERPw=; b=rYIzbVy3HJuWBNAwJhQ1FC/f9QS7MqzyfFq0ECWi0PN7s4vrLvFvNVek65YdxV1xpP Nsj/Nj/hdHbeoPc0qt5LNyREpGI0rV6B7xqU7v/ubBN1p+crHiRow2Lb9HS4zRXOmwMK CjoT3jWSmpn56sLTfZ+K7xhPQtWequNx2eCPGdOaNOC34MFkJxfv5mJm9IbGUYwi/qsD yl7cQ6b03kUb34LbFwoPyFea39mnNDQRBAiH2aMfuW2R6kJ8ElU+x0lXVYX3jT+sJqvw CHo7fWsxsUiLQJpXVlPGe3rQ43xFO+EPG8a8v3RDwsQDe2ZCTU4qEm8zpWjK9BhWkRg0 V2NQ== X-Gm-Message-State: ALQs6tAAG3oU0gwzj8QFZVEJZ4tGTH8j3FenNVyGqre6F1PeH7pmJUZB 3m3BFyp/3wchc088+jZX7IQ= X-Received: by 2002:a17:902:d807:: with SMTP id a7-v6mr8345726plz.314.1523324445329; Mon, 09 Apr 2018 18:40:45 -0700 (PDT) Received: from oslab.tsinghua.edu.cn ([2402:f000:1:4413:8dc7:7954:4991:f324]) by smtp.gmail.com with ESMTPSA id x137sm2489401pfd.162.2018.04.09.18.40.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Apr 2018 18:40:44 -0700 (PDT) From: Jia-Ju Bai To: paulus@samba.org, b.zolnierkie@samsung.com Cc: linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] video: fbdev: aty: aty128fb: Replace mdelay with msleep in aty128_set_suspend Date: Tue, 10 Apr 2018 09:40:35 +0800 Message-Id: <1523324435-28719-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 aty128_set_suspend() is never called in atomic context. The call chains ending up at aty128_set_suspend() are: [1] aty128_set_suspend() <- aty128_pci_suspend() [2] aty128_set_suspend() <- aty128_do_resume() <- aty128_pci_resume() [3] aty128_set_suspend() <- aty128_do_resume() <- aty128_early_resume() aty128_pci_suspend() is set as ".suspend" in struct pci_driver. aty128_pci_resume() is set as ".resume" in struct pci_driver. aty128_early_resume() is never called. These functions are not called in atomic context. Despite never getting called from atomic context, aty128_set_suspend() calls mdelay() to busily wait. This is not necessary and can be replaced with 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/video/fbdev/aty/aty128fb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/fbdev/aty/aty128fb.c b/drivers/video/fbdev/aty/aty128fb.c index db18474..15dfdff 100644 --- a/drivers/video/fbdev/aty/aty128fb.c +++ b/drivers/video/fbdev/aty/aty128fb.c @@ -2442,7 +2442,7 @@ static void aty128_set_suspend(struct aty128fb_par *par, int suspend) (void)aty_ld_pll(POWER_MANAGEMENT); aty_st_le32(BUS_CNTL1, 0x00000010); aty_st_le32(MEM_POWER_MISC, 0x0c830000); - mdelay(100); + msleep(100); /* Switch PCI power management to D2 */ pci_set_power_state(pdev, PCI_D2); -- 1.9.1