From patchwork Sun Apr 26 18:52:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Bottomley X-Patchwork-Id: 6277141 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6359EBF4A7 for ; Sun, 26 Apr 2015 18:52:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8A489202EB for ; Sun, 26 Apr 2015 18:52:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 90461202E6 for ; Sun, 26 Apr 2015 18:52:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752316AbbDZSwu (ORCPT ); Sun, 26 Apr 2015 14:52:50 -0400 Received: from bedivere.hansenpartnership.com ([66.63.167.143]:55207 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752264AbbDZSws (ORCPT ); Sun, 26 Apr 2015 14:52:48 -0400 Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id 1AD3A8EE167; Sun, 26 Apr 2015 11:52:48 -0700 (PDT) Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id f6xtyGLJTbLh; Sun, 26 Apr 2015 11:52:48 -0700 (PDT) Received: from [153.66.254.242] (unknown [50.46.149.214]) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id 979B28EE129; Sun, 26 Apr 2015 11:52:47 -0700 (PDT) Message-ID: <1430074366.2314.3.camel@HansenPartnership.com> Subject: Re: [PATCH 19/23] advansys: Remove cmd_per_lun setting From: James Bottomley To: Ondrej Zary Cc: Hannes Reinecke , Christoph Hellwig , Doug Gilberg , linux-scsi@vger.kernel.org Date: Sun, 26 Apr 2015 11:52:46 -0700 In-Reply-To: <201504261657.01552.linux@rainbow-software.org> References: <1429874322-85488-1-git-send-email-hare@suse.de> <1429874322-85488-21-git-send-email-hare@suse.de> <201504261657.01552.linux@rainbow-software.org> X-Mailer: Evolution 3.12.11 Mime-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Sun, 2015-04-26 at 16:57 +0200, Ondrej Zary wrote: > On Friday 24 April 2015 13:18:38 Hannes Reinecke wrote: > > Ancient, and pretty much obsolete by now. > > > > Signed-off-by: Hannes Reinecke > > --- > > drivers/scsi/advansys.c | 18 ------------------ > > 1 file changed, 18 deletions(-) > > > > diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c > > index 74e5518..5a55272 100644 > > --- a/drivers/scsi/advansys.c > > +++ b/drivers/scsi/advansys.c > > @@ -11212,24 +11212,6 @@ static int advansys_board_found(struct Scsi_Host > > *shost, unsigned int iop, } > > > > /* > > - * Following v1.3.89, 'cmd_per_lun' is no longer needed > > - * and should be set to zero. > > - * > > - * But because of a bug introduced in v1.3.89 if the driver is > > - * compiled as a module and 'cmd_per_lun' is zero, the Mid-Level > > - * SCSI function 'allocate_device' will panic. To allow the driver > > - * to work as a module in these kernels set 'cmd_per_lun' to 1. > > - * > > - * Note: This is wrong. cmd_per_lun should be set to the depth > > - * you want on untagged devices always. > > - #ifdef MODULE > > - */ > > - shost->cmd_per_lun = 1; > > -/* #else > > - shost->cmd_per_lun = 0; > > -#endif */ > > - > > - /* > > * Set the maximum number of scatter-gather elements the > > * adapter can handle. > > */ > > This patch breaks my setup: "modprobe advansys" hangs. > > It works when all other patches are applied except this one. The specific problem is that a cmd_per_lun of zero breaks everything because we use it for the initial queue depth and if you don't actually set it, you get zero (because the template is in static memory). This should be a global fix that changes the default initial queue depth to 1 for the probe phase if it's unset in the template or the host. Hopefully this should set us up for removing cmd_per_lun. James --- -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 60aae01..681a59a 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c @@ -280,7 +280,8 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget, sdev->host->cmd_per_lun, shost->bqt, shost->hostt->tag_alloc_policy); } - scsi_change_queue_depth(sdev, sdev->host->cmd_per_lun); + scsi_change_queue_depth(sdev, sdev->host->cmd_per_lun ? + sdev->host->cmd_per_lun : 1); scsi_sysfs_device_initialize(sdev);