From patchwork Mon Dec 4 18:06:24 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: 10091231 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 E3CCF600C5 for ; Mon, 4 Dec 2017 18:06:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD6E4289F6 for ; Mon, 4 Dec 2017 18:06:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D1B81289FD; Mon, 4 Dec 2017 18:06:35 +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 4E97A28A61 for ; Mon, 4 Dec 2017 18:06:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752367AbdLDSGe (ORCPT ); Mon, 4 Dec 2017 13:06:34 -0500 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:29886 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752235AbdLDSGc (ORCPT ); Mon, 4 Dec 2017 13:06:32 -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=1512410792; x=1543946792; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=zJ2L8Lv5VY7nJGS7G39U72jl0z5/LsXG8vN4lOY44JA=; b=HFsIAFSVoUJxl7QjjCKokJwVkpIWEpdeCyU3iGGp+/WmHdH5qS0BXNaj VZvhr0BlgIrK03Lo85vLIC55PGbMJ55O52cDLgpEmyRjCFW/wdkUuJG/+ H3Hkrq6Y3TrNn1jJzhNc46lyosCRqN9XGHSPAhip4g3NvXU4gjTkO9wnV 4+OGJaOAREL9obIe9+JxQnZjglpySX3BabvkxCtcaTbZyh/52X/0KCK5T Cj9HPV+hPuG8D/+BIV9OoozzM4qdFYLoKDzunGjjrDR5g+YOQ+xkq6S3t ifNMdvekwIMv11HC5CVQW7oW0WRaKKwX7HhpAdCWv7ni4ES7hvyfRMKYs g==; X-IronPort-AV: E=Sophos;i="5.45,359,1508774400"; d="scan'208";a="63934870" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 05 Dec 2017 02:06:24 +0800 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP; 04 Dec 2017 10:03:04 -0800 Received: from thinkpad-bart.sdcorp.global.sandisk.com (HELO thinkpad-bart.int.fusionio.com) ([10.11.166.51]) by uls-op-cesaip01.wdc.com with ESMTP; 04 Dec 2017 10:06:24 -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 v3 2/2] Convert a source code comment into a runtime check Date: Mon, 4 Dec 2017 10:06:24 -0800 Message-Id: <20171204180624.18722-3-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171204180624.18722-1-bart.vanassche@wdc.com> References: <20171204180624.18722-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 --- 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 258b8a741992..9cae0194e21a 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);