From patchwork Thu Nov 30 22:44:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10085739 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 385BF605D2 for ; Thu, 30 Nov 2017 22:45:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2A53A2A3E8 for ; Thu, 30 Nov 2017 22:45:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1E0882A3ED; Thu, 30 Nov 2017 22:45:03 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 747A62A3E8 for ; Thu, 30 Nov 2017 22:45:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750994AbdK3WpB (ORCPT ); Thu, 30 Nov 2017 17:45:01 -0500 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:2571 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751057AbdK3Wo7 (ORCPT ); Thu, 30 Nov 2017 17:44:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1512081900; x=1543617900; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=RKNV5Ut41BdU+/dZlhlrAvm1vYRuO3LmdY+mMt2sfUs=; b=g+akReRGnYsWXowQgcXW3wcx9VlGZi+hsblE/D/z5VBjCSuUAWPy/ket ZEXMNrak7H9q6XOUGdjhfjol2kBo+ANK56F72ELKTGclFd92SCz8LwClA 9BYkQz++LCQMeP4onQW2nDUBoKh3P6iwlFBFBgxdedenkfr+QuTvfeZw6 ZvSkr0LjkiYJT5oupylPGoUr3r/zE2FpWy0Xedo3h7w2E35AxuDzbDEVz hrH0xHrmWYZQGPq13TCm/F1mGXkvQkDMzF2j1Ef5DC/JnqBLsZff/vxMy vVG2TbGA5Oy630EZ+5IkQCBI8Zw8S4/uPBHRGlVsLTxIjNMWiZVyjzFgf A==; X-IronPort-AV: E=Sophos;i="5.45,343,1508774400"; d="scan'208";a="63682125" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 01 Dec 2017 06:44:58 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 30 Nov 2017 14:41:43 -0800 Received: from thinkpad-bart.sdcorp.global.sandisk.com (HELO thinkpad-bart.int.fusionio.com) ([10.11.166.51]) by uls-op-cesaip02.wdc.com with ESMTP; 30 Nov 2017 14:44:57 -0800 From: Bart Van Assche To: "Martin K . Petersen" , "James E . J . Bottomley" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Christoph Hellwig , Hannes Reinecke , Johannes Thumshirn Subject: [PATCH 2/2] Convert a source code comment into a runtime check Date: Thu, 30 Nov 2017 14:44:56 -0800 Message-Id: <20171130224456.23100-3-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171130224456.23100-1-bart.vanassche@wdc.com> References: <20171130224456.23100-1-bart.vanassche@wdc.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Johannes Thumshirn Reviewed-by: Johannes Thumshirn --- drivers/scsi/scsi_error.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index b22a9a23c74c..1622eacbf577 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -61,9 +61,10 @@ static int scsi_eh_try_stu(struct scsi_cmnd *scmd); static int scsi_try_to_abort_cmd(struct scsi_host_template *, struct scsi_cmnd *); -/* called with shost->host_lock held */ void scsi_eh_wakeup(struct Scsi_Host *shost) { + lockdep_assert_held(shost->host_lock); + if (atomic_read(&shost->host_busy) == shost->host_failed) { trace_scsi_eh_wakeup(shost); wake_up_process(shost->ehandler);