From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org
Subject: [PATCH] 53c700 compile fixes for 2.5.1-preX
Date: Wed, 12 Dec 2001 10:55:54 -0500 [thread overview]
Message-ID: <200112121555.fBCFts102280@localhost.localdomain> (raw)
[-- Attachment #1: Type: text/plain, Size: 111 bytes --]
The attached now makes the 53c700 driver and it's dependents compile and run
in 2.5.1-preX.
James Bottomley
[-- Attachment #2: 53c700-2.5.1-pre8.diff --]
[-- Type: text/plain , Size: 3256 bytes --]
Index: drivers/scsi/53c700.c
===================================================================
RCS file: /home/jejb/CVSROOT/linux/2.5/drivers/scsi/53c700.c,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 53c700.c
--- drivers/scsi/53c700.c 9 Dec 2001 18:21:22 -0000 1.1.1.2
+++ drivers/scsi/53c700.c 12 Dec 2001 15:52:14 -0000
@@ -310,7 +310,6 @@
hostdata->pScript = pScript;
NCR_700_dma_cache_wback((unsigned long)script, sizeof(SCRIPT));
hostdata->state = NCR_700_HOST_FREE;
- spin_lock_init(&hostdata->lock);
hostdata->cmd = NULL;
host->max_id = 7;
host->max_lun = NCR_700_MAX_LUNS;
@@ -1410,17 +1409,18 @@
(struct NCR_700_command_slot *)SCp->host_scribble;
struct NCR_700_Host_Parameters *hostdata =
(struct NCR_700_Host_Parameters *)SCp->host->hostdata[0];
- unsigned long flags;
__u16 count = 1; /* for IDENTIFY message */
- save_flags(flags);
- cli();
+ /* Routine must be protected against interruption while we
+ * tamper with the SCSI hardware. Since this lock is also an
+ * IRQ one, we can rely on interrupts being disabled as well */
+ ASSERT_LOCK(&SCp->host->host_lock, 1);
+
if(hostdata->state != NCR_700_HOST_FREE) {
/* keep this inside the lock to close the race window where
* the running command finishes on another CPU while we don't
* change the state to queued on this one */
slot->state = NCR_700_SLOT_QUEUED;
- restore_flags(flags);
DEBUG(("scsi%d: host busy, queueing command %p, slot %p\n",
SCp->host->host_no, slot->cmnd, slot));
@@ -1488,12 +1488,6 @@
NCR_700_writel(slot->temp, SCp->host, TEMP_REG);
NCR_700_writel(slot->resume_offset, SCp->host, DSP_REG);
- /* allow interrupts here so that if we're selected we can take
- * a selection interrupt. The script start may not be
- * effective in this case, but the selection interrupt will
- * save our command in that case */
- restore_flags(flags);
-
return 1;
}
@@ -1519,7 +1513,7 @@
* of locking in queuecommand: 1) io_request_lock then 2)
* hostdata->lock would be the reverse of taking it in this
* routine */
- spin_lock_irqsave(&io_request_lock, flags);
+ spin_lock_irqsave(&host->host_lock, flags);
if((istat = NCR_700_readb(host, ISTAT_REG))
& (SCSI_INT_PENDING | DMA_INT_PENDING)) {
__u32 dsps;
@@ -1764,7 +1758,7 @@
}
}
out_unlock:
- spin_unlock_irqrestore(&io_request_lock, flags);
+ spin_unlock_irqrestore(&host->host_lock, flags);
}
/* FIXME: Need to put some proc information in and plumb it
Index: drivers/scsi/53c700.h
===================================================================
RCS file: /home/jejb/CVSROOT/linux/2.5/drivers/scsi/53c700.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 53c700.h
--- drivers/scsi/53c700.h 9 Dec 2001 17:08:58 -0000 1.1.1.1
+++ drivers/scsi/53c700.h 12 Dec 2001 15:52:14 -0000
@@ -234,10 +234,6 @@
__u32 *script; /* pointer to script location */
__u32 pScript; /* physical mem addr of script */
- /* This will be the host lock. Unfortunately, we can't use it
- * at the moment because of the necessity of holding the
- * io_request_lock */
- spinlock_t lock;
enum NCR_700_Host_State state; /* protected by state lock */
Scsi_Cmnd *cmd;
/* Note: pScript contains the single consistent block of
next reply other threads:[~2001-12-12 15:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-12-12 15:55 James Bottomley [this message]
2001-12-12 16:04 ` [PATCH] 53c700 compile fixes for 2.5.1-preX Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200112121555.fBCFts102280@localhost.localdomain \
--to=james.bottomley@hansenpartnership.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.