From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
Hannes Reinecke <hare@suse.com>, Ming Lei <ming.lei@redhat.com>,
Johannes Thumshirn <jthumshirn@suse.de>,
Oleksandr Natalenko <oleksandr@natalenko.name>,
Martin Steigerwald <martin@lichtvoll.de>,
Jisheng Zhang <Jisheng.Zhang@synaptics.com>,
Bart Van Assche <bvanassche@acm.org>,
"Martin K. Petersen" <martin.petersen@oracle.com>
Subject: [PATCH 4.19 32/32] scsi: core: Avoid that a kernel warning appears during system resume
Date: Fri, 2 Aug 2019 11:40:06 +0200 [thread overview]
Message-ID: <20190802092111.551503666@linuxfoundation.org> (raw)
In-Reply-To: <20190802092101.913646560@linuxfoundation.org>
From: Bart Van Assche <bvanassche@acm.org>
commit 17605afaae825b0291f80c62a7f6565879edaa8a upstream.
Since scsi_device_quiesce() skips SCSI devices that have another state than
RUNNING, OFFLINE or TRANSPORT_OFFLINE, scsi_device_resume() should not
complain about SCSI devices that have been skipped. Hence this patch. This
patch avoids that the following warning appears during resume:
WARNING: CPU: 3 PID: 1039 at blk_clear_pm_only+0x2a/0x30
CPU: 3 PID: 1039 Comm: kworker/u8:49 Not tainted 5.0.0+ #1
Hardware name: LENOVO 4180F42/4180F42, BIOS 83ET75WW (1.45 ) 05/10/2013
Workqueue: events_unbound async_run_entry_fn
RIP: 0010:blk_clear_pm_only+0x2a/0x30
Call Trace:
? scsi_device_resume+0x28/0x50
? scsi_dev_type_resume+0x2b/0x80
? async_run_entry_fn+0x2c/0xd0
? process_one_work+0x1f0/0x3f0
? worker_thread+0x28/0x3c0
? process_one_work+0x3f0/0x3f0
? kthread+0x10c/0x130
? __kthread_create_on_node+0x150/0x150
? ret_from_fork+0x1f/0x30
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Ming Lei <ming.lei@redhat.com>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Cc: Oleksandr Natalenko <oleksandr@natalenko.name>
Cc: Martin Steigerwald <martin@lichtvoll.de>
Cc: <stable@vger.kernel.org>
Reported-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Tested-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Fixes: 3a0a529971ec ("block, scsi: Make SCSI quiesce and resume work reliably") # v4.15
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/scsi/scsi_lib.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -3102,8 +3102,10 @@ void scsi_device_resume(struct scsi_devi
* device deleted during suspend)
*/
mutex_lock(&sdev->state_mutex);
- sdev->quiesced_by = NULL;
- blk_clear_pm_only(sdev->request_queue);
+ if (sdev->quiesced_by) {
+ sdev->quiesced_by = NULL;
+ blk_clear_pm_only(sdev->request_queue);
+ }
if (sdev->sdev_state == SDEV_QUIESCE)
scsi_device_set_state(sdev, SDEV_RUNNING);
mutex_unlock(&sdev->state_mutex);
next prev parent reply other threads:[~2019-08-02 9:56 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-02 9:39 [PATCH 4.19 00/32] 4.19.64-stable review Greg Kroah-Hartman
2019-08-02 9:39 ` [PATCH 4.19 01/32] hv_sock: Add support for delayed close Greg Kroah-Hartman
2019-08-02 9:39 ` [PATCH 4.19 02/32] vsock: correct removal of socket from the list Greg Kroah-Hartman
2019-08-02 9:39 ` [PATCH 4.19 03/32] NFS: Fix dentry revalidation on NFSv4 lookup Greg Kroah-Hartman
2019-08-02 9:39 ` [PATCH 4.19 04/32] NFS: Refactor nfs_lookup_revalidate() Greg Kroah-Hartman
2019-08-02 9:39 ` [PATCH 4.19 05/32] NFSv4: Fix lookup revalidate of regular files Greg Kroah-Hartman
2019-08-02 9:39 ` [PATCH 4.19 06/32] usb: dwc2: Disable all EPs on disconnect Greg Kroah-Hartman
2019-08-02 9:39 ` [PATCH 4.19 07/32] usb: dwc2: Fix disable " Greg Kroah-Hartman
2019-08-02 9:39 ` [PATCH 4.19 08/32] arm64: compat: Provide definition for COMPAT_SIGMINSTKSZ Greg Kroah-Hartman
2019-08-02 9:39 ` [PATCH 4.19 09/32] binder: fix possible UAF when freeing buffer Greg Kroah-Hartman
2019-08-02 9:39 ` [PATCH 4.19 10/32] ISDN: hfcsusb: checking idx of ep configuration Greg Kroah-Hartman
2019-08-02 9:39 ` [PATCH 4.19 11/32] media: au0828: fix null dereference in error path Greg Kroah-Hartman
2019-08-02 9:39 ` [PATCH 4.19 12/32] ath10k: Change the warning message string Greg Kroah-Hartman
2019-08-02 9:39 ` [PATCH 4.19 13/32] media: cpia2_usb: first wake up, then free in disconnect Greg Kroah-Hartman
2019-08-02 9:39 ` [PATCH 4.19 14/32] media: pvrusb2: use a different format for warnings Greg Kroah-Hartman
2019-08-02 9:39 ` [PATCH 4.19 15/32] NFS: Cleanup if nfs_match_client is interrupted Greg Kroah-Hartman
2019-08-02 9:39 ` [PATCH 4.19 16/32] media: radio-raremono: change devm_k*alloc to k*alloc Greg Kroah-Hartman
2019-08-02 9:39 ` [PATCH 4.19 17/32] iommu/vt-d: Dont queue_iova() if there is no flush queue Greg Kroah-Hartman
2019-08-03 21:34 ` Pavel Machek
2019-08-06 22:47 ` Dmitry Safonov
2019-08-06 23:16 ` Dmitry Safonov
2019-08-02 9:39 ` [PATCH 4.19 18/32] iommu/iova: Fix compilation error with !CONFIG_IOMMU_IOVA Greg Kroah-Hartman
2019-08-02 9:39 ` [PATCH 4.19 19/32] Bluetooth: hci_uart: check for missing tty operations Greg Kroah-Hartman
2019-08-02 9:39 ` [PATCH 4.19 20/32] vhost: introduce vhost_exceeds_weight() Greg Kroah-Hartman
2019-08-02 9:39 ` [PATCH 4.19 21/32] vhost_net: fix possible infinite loop Greg Kroah-Hartman
2019-08-03 21:49 ` Pavel Machek
2019-08-05 4:17 ` Jason Wang
2019-08-02 9:39 ` [PATCH 4.19 22/32] vhost: vsock: add weight support Greg Kroah-Hartman
2019-08-02 9:39 ` [PATCH 4.19 23/32] vhost: scsi: " Greg Kroah-Hartman
2019-08-02 9:39 ` [PATCH 4.19 24/32] sched/fair: Dont free p->numa_faults with concurrent readers Greg Kroah-Hartman
2019-08-02 9:39 ` [PATCH 4.19 25/32] sched/fair: Use RCU accessors consistently for ->numa_group Greg Kroah-Hartman
2019-08-02 9:40 ` [PATCH 4.19 26/32] /proc/<pid>/cmdline: remove all the special cases Greg Kroah-Hartman
2019-08-02 9:40 ` [PATCH 4.19 27/32] /proc/<pid>/cmdline: add back the setproctitle() special case Greg Kroah-Hartman
2019-08-02 9:40 ` [PATCH 4.19 28/32] drivers/pps/pps.c: clear offset flags in PPS_SETPARAMS ioctl Greg Kroah-Hartman
2019-08-02 9:40 ` [PATCH 4.19 29/32] Fix allyesconfig output Greg Kroah-Hartman
2019-08-02 9:40 ` [PATCH 4.19 30/32] ceph: hold i_ceph_lock when removing caps for freeing inode Greg Kroah-Hartman
2019-08-02 9:40 ` [PATCH 4.19 31/32] block, scsi: Change the preempt-only flag into a counter Greg Kroah-Hartman
2019-08-02 9:40 ` Greg Kroah-Hartman [this message]
2019-08-02 23:22 ` [PATCH 4.19 00/32] 4.19.64-stable review shuah
2019-08-03 5:46 ` Naresh Kamboju
2019-08-03 9:58 ` Pavel Machek
2019-08-03 10:34 ` Greg Kroah-Hartman
2019-08-03 15:59 ` Guenter Roeck
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=20190802092111.551503666@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=Jisheng.Zhang@synaptics.com \
--cc=bvanassche@acm.org \
--cc=hare@suse.com \
--cc=hch@lst.de \
--cc=jthumshirn@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=martin@lichtvoll.de \
--cc=ming.lei@redhat.com \
--cc=oleksandr@natalenko.name \
--cc=stable@vger.kernel.org \
/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