Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751237AbdH3FRr (ORCPT ); Wed, 30 Aug 2017 01:17:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47484 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750803AbdH3FRq (ORCPT ); Wed, 30 Aug 2017 01:17:46 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com ECA39461E0 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ming.lei@redhat.com Date: Wed, 30 Aug 2017 13:17:31 +0800 From: Ming Lei To: Oleksandr Natalenko Cc: Jens Axboe , Christoph Hellwig , linux-block@vger.kernel.org, linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org, Shaohua Li Subject: Re: I/O hangs after resuming from suspend-to-ram Message-ID: <20170830051725.GA5840@ming.t460p> References: <3926917.BCSovyVWdL@natalenko.name> <1615033.Xza1AIGLzP@natalenko.name> <20170829002425.GA28904@ming.t460p> <2329566.kid2YYBOAQ@natalenko.name> <20170830021537.GA4897@ming.t460p> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170830021537.GA4897@ming.t460p> User-Agent: Mutt/1.8.3 (2017-05-23) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 30 Aug 2017 05:17:46 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2624 Lines: 81 On Wed, Aug 30, 2017 at 10:15:37AM +0800, Ming Lei wrote: > Hi, > > On Tue, Aug 29, 2017 at 05:52:42PM +0200, Oleksandr Natalenko wrote: > > Hello. > > > > Re-tested with v4.13-rc7 + proposed patch and got the same result. > > Maybe there is another issue, I didn't use dmcrypt on raid10, will > test in your way to see if I can reproduce it. > > BTW, could you share us which blk-mq scheduler you are using on sata? > The patch I posted should address one issue on none scheduler. Can't reproduce even with putting dmcypt on raid10 after applying my patch. Could you apply the following debug patch and provide the dmesg log after running the commands below? # echo 9 > /proc/sys/kernel/printk # echo devices > /sys/power/pm_test # echo mem > /sys/power/state BTW, it is better to provide the two sata disk(behind raid10) name. diff --git a/drivers/scsi/scsi_pm.c b/drivers/scsi/scsi_pm.c index b44c1bb687a2..75b13248ea1c 100644 --- a/drivers/scsi/scsi_pm.c +++ b/drivers/scsi/scsi_pm.c @@ -53,17 +53,22 @@ static int scsi_dev_type_suspend(struct device *dev, { const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL; int err; + struct scsi_device *sdev = to_scsi_device(dev); /* flush pending in-flight resume operations, suspend is synchronous */ async_synchronize_full_domain(&scsi_sd_pm_domain); - err = scsi_device_quiesce(to_scsi_device(dev)); + sdev_printk(KERN_WARNING, sdev, "%s: enter\n", __func__); + err = scsi_device_quiesce(sdev); if (err == 0) { + sdev_printk(KERN_WARNING, sdev, "%s: before suspend\n", __func__); err = cb(dev, pm); + sdev_printk(KERN_WARNING, sdev, "%s: after suspend\n", __func__); if (err) - scsi_device_resume(to_scsi_device(dev)); + scsi_device_resume(sdev); } dev_dbg(dev, "scsi suspend: %d\n", err); + sdev_printk(KERN_WARNING, sdev, "%s: exit\n", __func__); return err; } @@ -72,9 +77,13 @@ static int scsi_dev_type_resume(struct device *dev, { const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL; int err = 0; + struct scsi_device *sdev = to_scsi_device(dev); + sdev_printk(KERN_WARNING, sdev, "%s: enter\n", __func__); + sdev_printk(KERN_WARNING, sdev, "%s: before resume\n", __func__); err = cb(dev, pm); - scsi_device_resume(to_scsi_device(dev)); + sdev_printk(KERN_WARNING, sdev, "%s: after resume\n", __func__); + scsi_device_resume(sdev); dev_dbg(dev, "scsi resume: %d\n", err); if (err == 0) { @@ -83,6 +92,7 @@ static int scsi_dev_type_resume(struct device *dev, pm_runtime_enable(dev); } + sdev_printk(KERN_WARNING, sdev, "%s: exit\n", __func__); return err; } -- Ming