From patchwork Tue Apr 24 18:27:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10360761 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9B5EB60225 for ; Tue, 24 Apr 2018 18:27:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8300128D01 for ; Tue, 24 Apr 2018 18:27:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8175C28D51; Tue, 24 Apr 2018 18:27:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9C4D028D01 for ; Tue, 24 Apr 2018 18:27:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751518AbeDXS1H (ORCPT ); Tue, 24 Apr 2018 14:27:07 -0400 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:31808 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751095AbeDXS1F (ORCPT ); Tue, 24 Apr 2018 14:27:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1524594426; x=1556130426; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=Eb7e8sP3I2QM+f6WEND7GOuhGrNxg/kLzsfopzOBHE8=; b=Ri4jF1jtax2ox5/1LJpFC1b7Q9f7p42yiDq5H0zLy0FN8Zou7W9YaCH/ fGGVydYJjmrgLvJrMdxYng3uPiFzyM5w4wnkm8hAWtGTB+BFLABVV/cIE Upn6Uq/+5PZY7zvRFDB9SbqkhbAfn/czz0cXI4uw3lthDspF+Ra+SkATK uRdaRo1TtFaW1JhoY9oIlKP6Nlyq+EvuUMAwHM+4KL5udu1D/94ZmV1VO hhS55YsZMxII/ydMHOvFLR2cYnuUads9S5f5w4Yahd+7826ijjh3uMQ30 fEA0Q8/+24zEJ/9BuW27uKTW4l9g3RaETu2f7JU+It+yqp4bzVvrRbqSb A==; X-IronPort-AV: E=Sophos;i="5.49,324,1520870400"; d="scan'208";a="77533562" Received: from mail-dm3nam03lp0016.outbound.protection.outlook.com (HELO NAM03-DM3-obe.outbound.protection.outlook.com) ([207.46.163.16]) by ob1.hgst.iphmx.com with ESMTP; 25 Apr 2018 02:27:03 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-wdc-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Eb7e8sP3I2QM+f6WEND7GOuhGrNxg/kLzsfopzOBHE8=; b=VZwSeZWkyHROBSZRgE80rhBD4wV7qh8zjgZhA0Te680pfnh06rfMhJeBnUdXdutvlXuMyYjCzQIHM6bP4QYrY2yx4X5K8S4xN3N5QX3rRGXLIx/qjIaGuRvBInYesel/Yywt1tVOr3WXTKy3VCmup8KMx00JcaCsDaF3WdWdePw= Received: from MWHPR04MB1198.namprd04.prod.outlook.com (10.173.48.151) by MWHPR04MB0912.namprd04.prod.outlook.com (10.174.174.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.17; Tue, 24 Apr 2018 18:27:00 +0000 Received: from MWHPR04MB1198.namprd04.prod.outlook.com ([fe80::3154:614a:12c7:987c]) by MWHPR04MB1198.namprd04.prod.outlook.com ([fe80::3154:614a:12c7:987c%13]) with mapi id 15.20.0696.017; Tue, 24 Apr 2018 18:27:00 +0000 From: Bart Van Assche To: "pmenzel+linux-block@molgen.mpg.de" , "axboe@kernel.dk" CC: "jejb@linux.vnet.ibm.com" , "regressions@leemhuis.info" , "linux-kernel@vger.kernel.org" , "linux-block@vger.kernel.org" , "martin.petersen@oracle.com" , "linux-scsi@vger.kernel.org" Subject: Re: Regression 4.17-rc1: SSD doesn properly resume causing system hang (NULL pointer dereference) Thread-Topic: Regression 4.17-rc1: SSD doesn properly resume causing system hang (NULL pointer dereference) Thread-Index: AQHT2/Iaokzl6JZ9+0atRxesfkEEnKQQLgAAgAANxAA= Date: Tue, 24 Apr 2018 18:27:00 +0000 Message-ID: <134955874b401e6764077393c75ab2d4549b940a.camel@wdc.com> References: <59ca6556-11a6-4f77-76e7-d51c7175eb32@molgen.mpg.de> <67ffdf0050a04bf3615c3d8a3a90b0c9c2aeb1ad.camel@wdc.com> <2cc5f0fb-4caa-9c28-7daa-68993d5cb41a@molgen.mpg.de> <14ff1ed06e36a372680872c227b5abe389c753da.camel@wdc.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Bart.VanAssche@wdc.com; x-originating-ip: [198.233.165.212] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; MWHPR04MB0912; 7:aHeRBYo53CwPpwf/WuTllgOChRSTaG/VaSyxitoMhB3f3FegZeXE8GNuHKED3kFrRrwwK9hRwPyxy04AvVcbk9vzuKgkx6VJKHRDqeYN94RvREM0PUkDbe45Wa2cu5GVM2nsS5e2gwkLrPV2dtTAbV2VDuuIemFYEHJkwjQe6xyjeu2VCfR9GMn0SqLF7PHRAKrWOlzx666kLeH2l0sCdiGz0mf5Z8oc2TZ2bG1XMIN5YulUeg/FIVNjBz99kcMF; 20:iw7ZATwhqokGOXC79O0vkftS5H5wgjS55yTIpyH7/NjlJNTxDboaeYHQeRJv9BaNm0nW88jfyGImMphXmw6OqcYeHwIatmZpIlCL6EeacWnf7Axdl/gfAJ6++ZXzb9tLyp1ay+fllZmtEJbeMT/Un636dtbJAJ16Y64XMVVqvN8= x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:MWHPR04MB0912; x-ms-traffictypediagnostic: MWHPR04MB0912: wdcipoutbound: EOP-TRUE x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(8121501046)(5005006)(3002001)(10201501046)(3231232)(944501410)(52105095)(93006095)(93001095)(6055026)(6041310)(20161123562045)(20161123560045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:MWHPR04MB0912; BCL:0; PCL:0; RULEID:; SRVR:MWHPR04MB0912; x-forefront-prvs: 0652EA5565 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39380400002)(396003)(346002)(39860400002)(376002)(366004)(189003)(51444003)(377424004)(199004)(575784001)(446003)(476003)(2616005)(2906002)(478600001)(106356001)(105586002)(305945005)(2900100001)(59450400001)(11346002)(72206003)(86362001)(118296001)(66066001)(486006)(229853002)(5250100002)(54906003)(2501003)(6436002)(316002)(25786009)(6486002)(4326008)(102836004)(76176011)(6246003)(53936002)(5660300001)(93886005)(110136005)(97736004)(7736002)(186003)(14454004)(3846002)(68736007)(6116002)(26005)(6506007)(36756003)(81156014)(53546011)(3660700001)(6512007)(8936002)(3280700002)(8676002)(81166006)(99286004); DIR:OUT; SFP:1102; SCL:1; SRVR:MWHPR04MB0912; H:MWHPR04MB1198.namprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; x-microsoft-antispam-message-info: duuGK4qKaQw5jcnT1UAeKksxF8PsbwNBF8fkv/CHWDgKHqgvdlGo43f8ydZRDbMkBK6DGTNE3gCzYYnPY9dNle2EWgLX4UtAjmZWwwmHzlBUhla5cbypWln1BDr2diSIvgKwumTo7/8jL9cf1pniJWwWrFKz6n72NVEGTMUFEdsdAmPzAq97yC6CEzKwbwMX spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-ID: <00C2865DF868434DBD0A303CCF8BD2F6@namprd04.prod.outlook.com> MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 4e869bc1-03e8-46b9-4f63-08d5aa10f848 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4e869bc1-03e8-46b9-4f63-08d5aa10f848 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Apr 2018 18:27:00.3542 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR04MB0912 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Tue, 2018-04-24 at 19:37 +0200, Paul Menzel wrote: > On 04/24/18 19:31, Bart Van Assche wrote: > Here it is, pasted as citation, as otherwise Thunderbird would wrap the > line. > > > (gdb) disas blk_set_runtime_active > > Dump of assembler code for function blk_set_runtime_active: > > 0xc1518610 <+0>: call 0xc106ac9c <__fentry__> > > 0xc1518615 <+5>: push %ebp > > 0xc1518616 <+6>: mov %esp,%ebp > > 0xc1518618 <+8>: sub $0x14,%esp > > 0xc151861b <+11>: mov %ebx,-0xc(%ebp) > > 0xc151861e <+14>: mov %eax,%ebx > > 0xc1518620 <+16>: mov %gs:0x14,%eax > > 0xc1518626 <+22>: mov %eax,-0x10(%ebp) > > 0xc1518629 <+25>: xor %eax,%eax > > 0xc151862b <+27>: test %ebx,%ebx > > 0xc151862d <+29>: mov %esi,-0x8(%ebp) > > 0xc1518630 <+32>: mov %edi,-0x4(%ebp) > > 0xc1518633 <+35>: je 0xc15186b3 > > 0xc1518635 <+37>: mov 0xfc(%ebx),%eax > > 0xc151863b <+43>: call 0xc1a4b920 <_raw_spin_lock_irq> > > 0xc1518640 <+48>: mov 0x150(%ebx),%esi > > 0xc1518646 <+54>: xor %eax,%eax > > 0xc1518648 <+56>: mov 0xc1ca7d20,%edi > > 0xc151864e <+62>: mov %eax,0x154(%ebx) > > 0xc1518654 <+68>: cmp $0xffffff0c,%esi > > 0xc151865a <+74>: mov %edi,-0x14(%ebp) > > 0xc151865d <+77>: je 0xc15186a5 > > 0xc151865f <+79>: mov %edi,0xf4(%esi) The e-mail at the start of this e-mail thread shows that %esi == NULL at the time of the crash and also that the crash occurred at offset 79 (0x4f) in this function. I think that means that the crash occurred in the following code: pm_request_autosuspend(q->dev) and also that this means that q->dev == NULL. Can you test the (untested) patch below? Thanks, Bart. diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 57cae47ab1c2..b029a94a1e66 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -3272,7 +3272,6 @@ static void sd_probe_async(struct work_struct *work) gd->events |= DISK_EVENT_MEDIA_CHANGE; } - blk_pm_runtime_init(sdp->request_queue, dev); device_add_disk(dev, gd); if (sdkp->capacity) sd_dif_config_host(sdkp); @@ -3390,6 +3389,8 @@ static int sd_probe(struct device *dev) get_device(dev); dev_set_drvdata(dev, sdkp); + blk_pm_runtime_init(sdp->request_queue, dev); + get_device(&sdkp->dev); /* prevent release before sd_probe_async() */ WARN_ON_ONCE(!queue_work(system_unbound_wq, &sdkp->probe_work));