Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Jia-Ju Bai <baijiaju1990@163.com>
To: forest@alittletooquiet.net, gregkh@linuxfoundation.org,
	simon@nikanor.nu, tvboxspy@gmail.com, scott@matheina.com,
	dan.a.cashman@gmail.com, golubev.mikhail@gmail.com,
	bhelgaas@google.com
Cc: devel@driverdev.osuosl.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-pci@vger.kernel.org
Subject: [BUG] vt6655: A possible sleep-in-atomic bug in vt6655_suspend
Date: Mon, 9 Oct 2017 09:10:28 +0800	[thread overview]
Message-ID: <f3f4b129-471e-6ccd-a2fa-6ffd915bcb7f@163.com> (raw)

According to device_main.c, the driver may sleep under a spinlock,
and the function call path is:
vt6655_suspend (acquire the spinlock)
   pci_set_power_state
     __pci_start_power_transition (drivers/pci/pci.c)
       msleep --> may sleep

A possible fix is to replace msleep with mdelay in 
__pci_start_power_transition in drivers/pci/pci.c.

This bug is found by my static analysis tool and my code review.


Thanks,
Jia-Ju Bai

             reply	other threads:[~2017-10-09  1:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-09  1:10 Jia-Ju Bai [this message]
2017-10-09  5:43 ` [BUG] vt6655: A possible sleep-in-atomic bug in vt6655_suspend Greg KH
2017-10-09  7:56   ` Jia-Ju Bai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f3f4b129-471e-6ccd-a2fa-6ffd915bcb7f@163.com \
    --to=baijiaju1990@163.com \
    --cc=bhelgaas@google.com \
    --cc=dan.a.cashman@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=forest@alittletooquiet.net \
    --cc=golubev.mikhail@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=scott@matheina.com \
    --cc=simon@nikanor.nu \
    --cc=tvboxspy@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox