Commit fdd91bc1 authored by James Bottomley's avatar James Bottomley

Various bugfixes to sync with 2.4 version:

- Fix bug in scripts that was causing CDRW hang
- add sense buffer length initialisation
- update lasi700 to new driver model and fix rmmod hang
- add correct MCA reporting to D700 driver
parent 36c69833
...@@ -207,7 +207,7 @@ CLEAN_FILES = \ ...@@ -207,7 +207,7 @@ CLEAN_FILES = \
drivers/scsi/aic7xxx/aicasm/aicasm_scan.c \ drivers/scsi/aic7xxx/aicasm/aicasm_scan.c \
drivers/scsi/aic7xxx/aicasm/y.tab.h \ drivers/scsi/aic7xxx/aicasm/y.tab.h \
drivers/scsi/aic7xxx/aicasm/aicasm \ drivers/scsi/aic7xxx/aicasm/aicasm \
drivers/scsi/53c700-mem.c \ drivers/scsi/53c700_d.h \
net/khttpd/make_times_h \ net/khttpd/make_times_h \
net/khttpd/times.h \ net/khttpd/times.h \
submenu* submenu*
......
...@@ -50,6 +50,14 @@ ...@@ -50,6 +50,14 @@
* */ * */
/* CHANGELOG /* CHANGELOG
*
* Version 2.7
*
* Fixed scripts problem which caused certain devices (notably CDRWs)
* to hang on initial INQUIRY. Updated NCR_700_readl/writel to use
* __raw_readl/writel for parisc compatibility (Thomas
* Bogendoerfer). Added missing SCp->request_bufflen initialisation
* for sense requests (Ryan Bradetich).
* *
* Version 2.6 * Version 2.6
* *
...@@ -96,7 +104,7 @@ ...@@ -96,7 +104,7 @@
* Initial modularisation from the D700. See NCR_D700.c for the rest of * Initial modularisation from the D700. See NCR_D700.c for the rest of
* the changelog. * the changelog.
* */ * */
#define NCR_700_VERSION "2.6" #define NCR_700_VERSION "2.7"
#include <linux/config.h> #include <linux/config.h>
#include <linux/version.h> #include <linux/version.h>
...@@ -310,7 +318,6 @@ NCR_700_detect(Scsi_Host_Template *tpnt, ...@@ -310,7 +318,6 @@ NCR_700_detect(Scsi_Host_Template *tpnt,
hostdata->pScript = pScript; hostdata->pScript = pScript;
NCR_700_dma_cache_wback((unsigned long)script, sizeof(SCRIPT)); NCR_700_dma_cache_wback((unsigned long)script, sizeof(SCRIPT));
hostdata->state = NCR_700_HOST_FREE; hostdata->state = NCR_700_HOST_FREE;
spin_lock_init(&hostdata->lock);
hostdata->cmd = NULL; hostdata->cmd = NULL;
host->max_id = 7; host->max_id = 7;
host->max_lun = NCR_700_MAX_LUNS; host->max_lun = NCR_700_MAX_LUNS;
...@@ -1048,6 +1055,7 @@ process_script_interrupt(__u32 dsps, __u32 dsp, Scsi_Cmnd *SCp, ...@@ -1048,6 +1055,7 @@ process_script_interrupt(__u32 dsps, __u32 dsp, Scsi_Cmnd *SCp,
slot->pCmd, slot->pCmd,
SCp->cmd_len, SCp->cmd_len,
PCI_DMA_TODEVICE); PCI_DMA_TODEVICE);
SCp->request_bufflen = sizeof(SCp->sense_buffer);
slot->dma_handle = pci_map_single(hostdata->pci_dev, SCp->sense_buffer, sizeof(SCp->sense_buffer), PCI_DMA_FROMDEVICE); slot->dma_handle = pci_map_single(hostdata->pci_dev, SCp->sense_buffer, sizeof(SCp->sense_buffer), PCI_DMA_FROMDEVICE);
slot->SG[0].ins = bS_to_host(SCRIPT_MOVE_DATA_IN | sizeof(SCp->sense_buffer)); slot->SG[0].ins = bS_to_host(SCRIPT_MOVE_DATA_IN | sizeof(SCp->sense_buffer));
slot->SG[0].pAddr = bS_to_host(slot->dma_handle); slot->SG[0].pAddr = bS_to_host(slot->dma_handle);
...@@ -1508,6 +1516,11 @@ NCR_700_intr(int irq, void *dev_id, struct pt_regs *regs) ...@@ -1508,6 +1516,11 @@ NCR_700_intr(int irq, void *dev_id, struct pt_regs *regs)
__u8 pun = 0xff, lun = 0xff; __u8 pun = 0xff, lun = 0xff;
unsigned long flags; unsigned long flags;
/* Use the host lock to serialise acess to the 53c700
* hardware. Note: In future, we may need to take the queue
* lock to enter the done routines. When that happens, we
* need to ensure that for this driver, the host lock and the
* queue lock point to the same thing. */
spin_lock_irqsave(host->host_lock, flags); spin_lock_irqsave(host->host_lock, flags);
if((istat = NCR_700_readb(host, ISTAT_REG)) if((istat = NCR_700_readb(host, ISTAT_REG))
& (SCSI_INT_PENDING | DMA_INT_PENDING)) { & (SCSI_INT_PENDING | DMA_INT_PENDING)) {
......
...@@ -210,7 +210,7 @@ struct NCR_700_command_slot { ...@@ -210,7 +210,7 @@ struct NCR_700_command_slot {
struct NCR_700_Host_Parameters { struct NCR_700_Host_Parameters {
/* These must be filled in by the calling driver */ /* These must be filled in by the calling driver */
int clock; /* board clock speed in MHz */ int clock; /* board clock speed in MHz */
__u32 base; /* the base for the port (copied to host) */ unsigned long base; /* the base for the port (copied to host) */
struct pci_dev *pci_dev; struct pci_dev *pci_dev;
__u32 dmode_extra; /* adjustable bus settings */ __u32 dmode_extra; /* adjustable bus settings */
__u32 differential:1; /* if we are differential */ __u32 differential:1; /* if we are differential */
...@@ -234,10 +234,6 @@ struct NCR_700_Host_Parameters { ...@@ -234,10 +234,6 @@ struct NCR_700_Host_Parameters {
__u32 *script; /* pointer to script location */ __u32 *script; /* pointer to script location */
__u32 pScript; /* physical mem addr of script */ __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 */ enum NCR_700_Host_State state; /* protected by state lock */
Scsi_Cmnd *cmd; Scsi_Cmnd *cmd;
/* Note: pScript contains the single consistent block of /* Note: pScript contains the single consistent block of
...@@ -503,7 +499,7 @@ NCR_700_readb(struct Scsi_Host *host, __u32 reg) ...@@ -503,7 +499,7 @@ NCR_700_readb(struct Scsi_Host *host, __u32 reg)
static inline __u32 static inline __u32
NCR_700_readl(struct Scsi_Host *host, __u32 reg) NCR_700_readl(struct Scsi_Host *host, __u32 reg)
{ {
__u32 value = readl(host->base + reg); __u32 value = __raw_readl(host->base + reg);
const struct NCR_700_Host_Parameters *hostdata __attribute__((unused)) const struct NCR_700_Host_Parameters *hostdata __attribute__((unused))
= (struct NCR_700_Host_Parameters *)host->hostdata[0]; = (struct NCR_700_Host_Parameters *)host->hostdata[0];
#if 1 #if 1
...@@ -536,7 +532,7 @@ NCR_700_writel(__u32 value, struct Scsi_Host *host, __u32 reg) ...@@ -536,7 +532,7 @@ NCR_700_writel(__u32 value, struct Scsi_Host *host, __u32 reg)
BUG(); BUG();
#endif #endif
writel(bS_to_host(value), host->base + reg); __raw_writel(bS_to_host(value), host->base + reg);
} }
#elif defined(CONFIG_53C700_IO_MAPPED) #elif defined(CONFIG_53C700_IO_MAPPED)
static inline __u8 static inline __u8
......
...@@ -242,7 +242,7 @@ SendMessageWithATN: ...@@ -242,7 +242,7 @@ SendMessageWithATN:
SendIdentifyMsg: SendIdentifyMsg:
CALL SendMessage CALL SendMessage
JUMP SendCommand CLEAR ATN
IgnoreMsgBeforeCommand: IgnoreMsgBeforeCommand:
CLEAR ACK CLEAR ACK
......
...@@ -35,6 +35,10 @@ ...@@ -35,6 +35,10 @@
/* CHANGELOG /* CHANGELOG
*
* Version 2.2
*
* Added mca_set_adapter_name().
* *
* Version 2.1 * Version 2.1
* *
...@@ -86,7 +90,7 @@ ...@@ -86,7 +90,7 @@
* disconnections and reselections are being processed correctly. * disconnections and reselections are being processed correctly.
* */ * */
#define NCR_D700_VERSION "2.1" #define NCR_D700_VERSION "2.2"
#include <linux/config.h> #include <linux/config.h>
#include <linux/version.h> #include <linux/version.h>
...@@ -299,6 +303,7 @@ D700_detect(Scsi_Host_Template *tpnt) ...@@ -299,6 +303,7 @@ D700_detect(Scsi_Host_Template *tpnt)
continue; continue;
} }
found++; found++;
mca_set_adapter_name(slot, "NCR D700 SCSI Adapter (version " NCR_D700_VERSION ")");
} }
} }
......
...@@ -136,7 +136,6 @@ static int __init ...@@ -136,7 +136,6 @@ static int __init
lasi700_driver_callback(struct parisc_device *dev) lasi700_driver_callback(struct parisc_device *dev)
{ {
unsigned long base = dev->hpa + LASI_SCSI_CORE_OFFSET; unsigned long base = dev->hpa + LASI_SCSI_CORE_OFFSET;
int irq = busdevice_alloc_irq(dev);
char *driver_name; char *driver_name;
struct Scsi_Host *host; struct Scsi_Host *host;
struct NCR_700_Host_Parameters *hostdata = struct NCR_700_Host_Parameters *hostdata =
...@@ -170,14 +169,15 @@ lasi700_driver_callback(struct parisc_device *dev) ...@@ -170,14 +169,15 @@ lasi700_driver_callback(struct parisc_device *dev)
hostdata->chip710 = 1; hostdata->chip710 = 1;
hostdata->dmode_extra = DMODE_FC2; hostdata->dmode_extra = DMODE_FC2;
} }
hostdata->pci_dev = ccio_get_fake(dev);
if((host = NCR_700_detect(host_tpnt, hostdata)) == NULL) { if((host = NCR_700_detect(host_tpnt, hostdata)) == NULL) {
kfree(hostdata); kfree(hostdata);
release_mem_region(host->base, 64); release_mem_region(host->base, 64);
return 1; return 1;
} }
host->irq = irq; host->irq = dev->irq;
if(request_irq(irq, NCR_700_intr, SA_SHIRQ, driver_name, host)) { if(request_irq(dev->irq, NCR_700_intr, SA_SHIRQ, driver_name, host)) {
printk(KERN_ERR "%s: irq problem, detatching\n", printk(KERN_ERR "%s: irq problem, detaching\n",
driver_name); driver_name);
scsi_unregister(host); scsi_unregister(host);
NCR_700_release(host); NCR_700_release(host);
...@@ -197,6 +197,7 @@ lasi700_release(struct Scsi_Host *host) ...@@ -197,6 +197,7 @@ lasi700_release(struct Scsi_Host *host)
kfree(hostdata); kfree(hostdata);
free_irq(host->irq, host); free_irq(host->irq, host);
release_mem_region(host->base, 64); release_mem_region(host->base, 64);
unregister_parisc_driver(&lasi700_driver);
return 1; return 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment