From patchwork Tue Jun 14 15:05:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 9176081 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 5C62A60573 for ; Tue, 14 Jun 2016 15:05:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F3122656B for ; Tue, 14 Jun 2016 15:05:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 43E8528047; Tue, 14 Jun 2016 15:05:58 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 263C42656B for ; Tue, 14 Jun 2016 15:05:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751239AbcFNPF4 (ORCPT ); Tue, 14 Jun 2016 11:05:56 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:52730 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750985AbcFNPF4 (ORCPT ); Tue, 14 Jun 2016 11:05:56 -0400 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1bCpud-00035b-4d; Tue, 14 Jun 2016 15:05:55 +0000 Date: Tue, 14 Jun 2016 08:05:55 -0700 From: Christoph Hellwig To: James Bottomley Cc: linux-scsi , Parisc List , Christoph Hellwig Subject: Re: [PATCH] 53c700: fix BUG on untagged commands Message-ID: <20160614150555.GA698@infradead.org> References: <1465880407.18583.18.camel@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1465880407.18583.18.camel@linux.vnet.ibm.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Looks fine: Acked-by: Christoph Hellwig But it should really go together with something like this: Tested-by: Helge Deller Reviewed-by: Hannes Reinecke --- From e54d1462ae244db3189a8b69018bc5f3e3d3b468 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Tue, 14 Jun 2016 17:04:10 +0200 Subject: scsi: move current_cmnd into the 53c700 driver The 53c700 driver is the only user of the current_cmnd field in struct scsi_device, so let's move it into the driver private data. Signed-off-by: Christoph Hellwig --- drivers/scsi/53c700.c | 8 +++++--- drivers/scsi/53c700.h | 1 + include/scsi/scsi_device.h | 1 - 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/53c700.c b/drivers/scsi/53c700.c index 3ddc85e..de53b23 100644 --- a/drivers/scsi/53c700.c +++ b/drivers/scsi/53c700.c @@ -1120,9 +1120,9 @@ process_script_interrupt(__u32 dsps, __u32 dsp, struct scsi_cmnd *SCp, "reselection is tag %d, slot %p(%d)\n", hostdata->msgin[2], slot, slot->tag); } else { - struct scsi_cmnd *SCp; + struct NCR_700_Device_Parameters *p = SDp->hostdata; + struct scsi_cmnd *SCp = p->current_cmnd; - SCp = SDp->current_cmnd; if(unlikely(SCp == NULL)) { sdev_printk(KERN_ERR, SDp, "no saved request for untagged cmd\n"); @@ -1825,9 +1825,11 @@ NCR_700_queuecommand_lck(struct scsi_cmnd *SCp, void (*done)(struct scsi_cmnd *) CDEBUG(KERN_DEBUG, SCp, "sending out tag %d, slot %p\n", slot->tag, slot); } else { + struct NCR_700_Device_Parameters *p = SCp->device->hostdata; + slot->tag = SCSI_NO_TAG; /* save current command for reselection */ - SCp->device->current_cmnd = SCp; + p->current_cmnd = SCp; } /* sanity check: some of the commands generated by the mid-layer * have an eccentric idea of their sc_data_direction */ diff --git a/drivers/scsi/53c700.h b/drivers/scsi/53c700.h index e06bdfe..83b157e 100644 --- a/drivers/scsi/53c700.h +++ b/drivers/scsi/53c700.h @@ -82,6 +82,7 @@ struct NCR_700_Device_Parameters { * cmnd[1], this could be in static storage */ unsigned char cmnd[MAX_COMMAND_SIZE]; __u8 depth; + struct scsi_cmnd *current_cmnd; /* currently active command */ }; diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index a6c346d..8a95631 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -94,7 +94,6 @@ struct scsi_device { spinlock_t list_lock; struct list_head cmd_list; /* queue of in use SCSI Command structures */ struct list_head starved_entry; - struct scsi_cmnd *current_cmnd; /* currently active command */ unsigned short queue_depth; /* How deep of a queue we want */ unsigned short max_queue_depth; /* max queue depth */ unsigned short last_queue_full_depth; /* These two are used by */