Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp2084323ybb; Fri, 29 Mar 2019 18:39:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqwB3Ep5Mt8LmBKV9S4KKahar7S9TYKJKhSJ8wBeqSeTLFGvHjj9n/QKObbTnrbPh0qrQgvs X-Received: by 2002:a63:2c55:: with SMTP id s82mr42205771pgs.356.1553909948352; Fri, 29 Mar 2019 18:39:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553909948; cv=none; d=google.com; s=arc-20160816; b=LL71P3myHqXP4mZbQWQkbX87qjpkory1QyoJ3JVCnKzNNhZRmApPYc6MeH1pvfGHAQ 34C1rsSFQgY9XCuPYbKtzo6Q0/OK1vU6MUioa5kgLx+EboQNUKv5+u7NxiQkwWOajkai Azkg8YrDYmqCEYovNyARK45vngmSbgl1kvp1No/xURDXA+NOTX3UzAIPXebSNCThIRMh Ld0+XnEVcEYnAeUjeapeuT9ltw5CValkTMV6Y4eHUFXmgHSrDtCnv25WsTcryVfLjVgI 2Bs3dambDYo4S0ZoxK5U00oACoYU3S9llDQUeZXTPQ/e1/CXy7jHS/N9XW6+un/c2h5r 2whA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=olkPBzpO07nkwKo8k1SO811E2W6kOk9wvfAAB9/nGkU=; b=n6hEAb4fSTWgv1KVn/PqgkUC5q1S2182bOi0TJY6Dbn41Bky3Ixk+rWG6rL0vEoTuH qp3blCLEqtpn/kK9aX+gZ3JqqwBeHgwFgpyYBt9Ac28NrbNFzU5MC4UaQ0Dxd6Ntzu9R CIRJiWSh9rY0bE9v1ifz6nE4u+pZ1poKUz060FAExXTELSoThR+9N995QdyXbbfhijp4 0uzU/n+G6DNScSuy24q3Qmk1RA7/+Fop+SZI/94UHTR66ND4EAZ7IvgllUfMAbujVM+0 FHkBRhmUpMLT0DHsVyabQQ9+YppBXUpW5oIKXz1NQ9U1Kjd/6m7iN8eaV3I0g+ia7HeH Da7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Fu6dLFde; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 12si3235570pgu.111.2019.03.29.18.38.53; Fri, 29 Mar 2019 18:39:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Fu6dLFde; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731453AbfC3BaT (ORCPT + 99 others); Fri, 29 Mar 2019 21:30:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:37322 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731327AbfC3BaN (ORCPT ); Fri, 29 Mar 2019 21:30:13 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 64F6D218D9; Sat, 30 Mar 2019 01:30:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553909412; bh=JLzQlWt0boTi6yvZh3Jwb3iPIXo0kW4misJTt5D4JDE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Fu6dLFdee4sZ6b/FmPZ0ZVvEQYHLxe1XWIpId9+UqTyjkczmKkxDgYRCAjqFn/coo kYVgHCgmm3MTr0/9rqy1+YXCvaJ9JAmIgUJBtW2jGm5L1QjeFmiTEt0vb7HipGog8n YkAf2nHjvCokFlM3tB030lnCb/PfhSSNhg3jA6Sw= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Bart Van Assche , Przemek Socha , "Martin K . Petersen" , Sasha Levin , linux-scsi@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 39/57] scsi: core: Avoid that system resume triggers a kernel warning Date: Fri, 29 Mar 2019 21:28:32 -0400 Message-Id: <20190330012854.32212-39-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190330012854.32212-1-sashal@kernel.org> References: <20190330012854.32212-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bart Van Assche [ Upstream commit 388b4e6a00bb3097278ed1648ac5a1cb48c894e6 ] scsi_device_quiesce() and scsi_device_resume() are called during system-wide suspend and resume. scsi_device_quiesce() only succeeds for SCSI devices that are in one of the RUNNING, OFFLINE or TRANSPORT_OFFLINE states (see also scsi_set_device_state()). This patch avoids that the following warning is triggered when resuming a system for which quiescing a SCSI device failed: WARNING: CPU: 2 PID: 11303 at drivers/scsi/scsi_lib.c:2600 scsi_device_resume+0x4f/0x58 CPU: 2 PID: 11303 Comm: kworker/u8:70 Not tainted 5.0.0-rc1+ #50 Hardware name: LENOVO 80E3/Lancer 5B2, BIOS A2CN45WW(V2.13) 08/04/2016 Workqueue: events_unbound async_run_entry_fn Call Trace: scsi_dev_type_resume+0x2e/0x60 async_run_entry_fn+0x32/0xd8 process_one_work+0x1f4/0x420 worker_thread+0x28/0x3c0 kthread+0x118/0x130 ret_from_fork+0x22/0x40 Cc: Przemek Socha Reported-by: Przemek Socha Fixes: 3a0a529971ec ("block, scsi: Make SCSI quiesce and resume work reliably") # v4.15 Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/scsi_lib.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 18e4289baf99..655790f30434 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -3095,7 +3095,6 @@ void scsi_device_resume(struct scsi_device *sdev) * device deleted during suspend) */ mutex_lock(&sdev->state_mutex); - WARN_ON_ONCE(!sdev->quiesced_by); sdev->quiesced_by = NULL; blk_clear_preempt_only(sdev->request_queue); if (sdev->sdev_state == SDEV_QUIESCE) -- 2.19.1