Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753302AbcL2QQ6 (ORCPT ); Thu, 29 Dec 2016 11:16:58 -0500 Received: from shards.monkeyblade.net ([184.105.139.130]:53904 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753284AbcL2QQz (ORCPT ); Thu, 29 Dec 2016 11:16:55 -0500 Date: Thu, 29 Dec 2016 11:16:51 -0500 (EST) Message-Id: <20161229.111651.1486287401918317471.davem@davemloft.net> To: jbaron@akamai.com Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, sathya.prakash@broadcom.com, chaitra.basappa@broadcom.com, suganath-prabu.subramani@broadcom.com, Sreekanth.Reddy@broadcom.com, hare@suse.de, martin.petersen@oracle.com, bart.vanassche@sandisk.com, sagi@grimberg.me, jejb@linux.vnet.ibm.com, hch@lst.de, dledford@redhat.com Subject: Re: [PATCH] scsi: mpt3sas: fix hang on ata passthru commands From: David Miller In-Reply-To: <1482985824-7270-1-git-send-email-jbaron@akamai.com> References: <1482985824-7270-1-git-send-email-jbaron@akamai.com> X-Mailer: Mew version 6.7 on Emacs 25.1 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Thu, 29 Dec 2016 07:17:41 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1033 Lines: 26 From: Jason Baron Date: Wed, 28 Dec 2016 23:30:24 -0500 > On ata passthru commands scsih_qcmd() ends up spinning in > scsi_wait_for_queuecommand() indefinitely. scsih_qcmd() is called from > __blk_run_queue_uncond() which first increments request_fn_active to a > non-zero value. Thus, scsi_wait_for_queuecommand() never completes because > its spinning waiting for request_fn_active to become 0. > > Two patches interact here. The first: > > commit 18f6084a989b ("scsi: mpt3sas: Fix secure erase premature > termination") calls scsi_internal_device_block() for ata passthru commands. > > The second patch: > > commit 669f044170d8 ("scsi: srp_transport: Move queuecommand() wait code > to SCSI core") adds a call to scsi_wait_for_queuecommand() from > scsi_internal_device_block(). > > Add a new parameter to scsi_internal_device_block() to decide whether > or not to invoke scsi_wait_for_queuecommand(). > > Signed-off-by: Jason Baron Tested-by: David S. Miller