Re: [PATCH v1 1/1] scsi: Synchronize request queue PM status only on successful resume

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2019-01-02 at 14:25 +-0800, stanley.chu+AEA-mediatek.com wrote:
+AD4 From: Stanley Chu +ADw-stanley.chu+AEA-mediatek.com+AD4
+AD4 
+AD4 The commit 356fd2663cff (+ACI-scsi: Set request queue runtime PM status
+AD4 back to active on resume+ACI) fixed up the inconsistent RPM status between
+AD4 request queue and device. However changing request queue RPM status
+AD4 shall be done only on successful resume, otherwise status may be still
+AD4 inconsistent as below,
+AD4 
+AD4 Request queue: RPM+AF8-ACTIVE
+AD4 Device: RPM+AF8-SUSPENDED
+AD4 
+AD4 This ends up soft lockup because requests can be submitted to
+AD4 underlying devices but those devices and their required resource
+AD4 are not resumed.
+AD4 
+AD4 Signed-off-by: Stanley Chu +ADw-stanley.chu+AEA-mediatek.com+AD4

Please add +ACI-Fixes:+ACI and +ACI-Cc: stable+ACI tags and also Cc the author of commit
356fd2663cff.


+AD4 ---
+AD4  drivers/scsi/scsi+AF8-pm.c +AHw 24 +-+-+-+-+-+-+-+-+-+-+-+-+-+-----------
+AD4  1 file changed, 14 insertions(+-), 10 deletions(-)
+AD4 
+AD4 diff --git a/drivers/scsi/scsi+AF8-pm.c b/drivers/scsi/scsi+AF8-pm.c
+AD4 index a2b4179..eff3e59 100644
+AD4 --- a/drivers/scsi/scsi+AF8-pm.c
+AD4 +-+-+- b/drivers/scsi/scsi+AF8-pm.c
+AD4 +AEAAQA -82,6 +-82,20 +AEAAQA static int scsi+AF8-dev+AF8-type+AF8-resume(struct device +ACo-dev,
+AD4  		pm+AF8-runtime+AF8-disable(dev)+ADs
+AD4  		pm+AF8-runtime+AF8-set+AF8-active(dev)+ADs
+AD4  		pm+AF8-runtime+AF8-enable(dev)+ADs
+AD4 +-
+AD4 +-		/+ACo
+AD4 +-		 +ACo Forcibly set runtime PM status of request queue to +ACI-active+ACI
+AD4 +-		 +ACo to make sure we can again get requests from the queue
+AD4 +-		 +ACo (see also blk+AF8-pm+AF8-peek+AF8-request()).
+AD4 +-		 +ACo
+AD4 +-		 +ACo The resume hook will correct runtime PM status of the disk.
+AD4 +-		 +ACo-/
+AD4 +-		if (+ACE-err +ACYAJg scsi+AF8-is+AF8-sdev+AF8-device(dev)) +AHs
+AD4 +-			struct scsi+AF8-device +ACo-sdev +AD0 to+AF8-scsi+AF8-device(dev)+ADs
+AD4 +-
+AD4 +-			if (sdev-+AD4-request+AF8-queue-+AD4-dev)
+AD4 +-				blk+AF8-set+AF8-runtime+AF8-active(sdev-+AD4-request+AF8-queue)+ADs
+AD4 +-		+AH0

What makes you think that the sdev-+AD4-request+AF8-queue-+AD4-dev test is necessary? The
scsi+AF8-dev+AF8-type+AF8-resume() function is only called after blk+AF8-pm+AF8-runtime+AF8-init() has
finished so I don't think that test is necessary.

Additionally, since the above code occurs inside a block controlled by an
+ACI-if (err +AD0APQ 0)+ACI statement, I think the +ACE-err test is redundant and should be
left out.

Thanks,

Bart.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux