* [PATCH] dc395x - description
@ 2003-08-03 8:27 Jamie Lenehan
2003-08-03 8:27 ` [PATCH] dc395x - 1/3 remove-static-eeprom-struct Jamie Lenehan
0 siblings, 1 reply; 11+ messages in thread
From: Jamie Lenehan @ 2003-08-03 8:27 UTC (permalink / raw)
To: linux-scsi; +Cc: dc395x
A few updates for the dc395x driver.
Patches against 2.6.0-test2-bk2
01-remove-static-eeprom-struct.patch:
Move the eeprom details from a static struct indexed by adapter
number into the adapter information block of the adapter. This
removes the fixed size static array and removes the need to count
the number of adapters.
02-remove-static-adapter-list.patch:
Remove the static list of adapters and the code related to keeping
this up to date. The only remaining use for the static list was for
the proc info function to find the scsi_host, but that's passed as a
parameter anyway.
03-fix-failures.patch:
Handle the case where scsi_add_host fails and update the removal
function to correctly unregister everything.
--
Jamie Lenehan Work Phone: +61 3 9843 8817
lenehan@twibble.org Work Email: jamie.lenehan@activcard.com.au
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH] dc395x - 1/3 remove-static-eeprom-struct
2003-08-03 8:27 [PATCH] dc395x - description Jamie Lenehan
@ 2003-08-03 8:27 ` Jamie Lenehan
2003-08-03 8:28 ` [PATCH] dc395x - 2/3 remove-static-adapter-list Jamie Lenehan
2003-08-03 15:01 ` [PATCH] dc395x - 1/3 remove-static-eeprom-struct James Bottomley
0 siblings, 2 replies; 11+ messages in thread
From: Jamie Lenehan @ 2003-08-03 8:27 UTC (permalink / raw)
To: linux-scsi; +Cc: dc395x
Move the eeprom details from a static struct indexed by adapter
number into the adapter information block of the adapter. This
removes the fixed size static array and removes the need to count the
number of adapters.
diff -r -du a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c
--- a/drivers/scsi/dc395x.c 2003-08-03 17:01:45.000000000 +1000
+++ b/drivers/scsi/dc395x.c 2003-08-03 18:07:05.912280016 +1000
@@ -264,6 +264,44 @@
};
+/*
+ * The SEEPROM structure for TRM_S1040
+ */
+struct NVRamTarget {
+ u8 cfg0; /* Target configuration byte 0 */
+ u8 period; /* Target period */
+ u8 cfg2; /* Target configuration byte 2 */
+ u8 cfg3; /* Target configuration byte 3 */
+};
+
+
+struct NvRamType {
+ u8 sub_vendor_id[2]; /* 0,1 Sub Vendor ID */
+ u8 sub_sys_id[2]; /* 2,3 Sub System ID */
+ u8 sub_class; /* 4 Sub Class */
+ u8 vendor_id[2]; /* 5,6 Vendor ID */
+ u8 device_id[2]; /* 7,8 Device ID */
+ u8 reserved; /* 9 Reserved */
+ struct NVRamTarget target[DC395x_MAX_SCSI_ID];
+ /** 10,11,12,13
+ ** 14,15,16,17
+ ** ....
+ ** ....
+ ** 70,71,72,73
+ */
+ u8 scsi_id; /* 74 Host Adapter SCSI ID */
+ u8 channel_cfg; /* 75 Channel configuration */
+ u8 delay_time; /* 76 Power on delay time */
+ u8 max_tag; /* 77 Maximum tags */
+ u8 reserved0; /* 78 */
+ u8 boot_target; /* 79 */
+ u8 boot_lun; /* 80 */
+ u8 reserved1; /* 81 */
+ u16 reserved2[22]; /* 82,..125 */
+ u16 cksum; /* 126,127 */
+};
+
+
/*-----------------------------------------------------------------------
SCSI Request Block
-----------------------------------------------------------------------*/
@@ -365,7 +403,6 @@
struct timer_list selto_timer;
u16 srb_count;
- u16 adapter_index; /* nth Adapter this driver */
u8 dcb_count;
u8 sel_timeout;
@@ -389,45 +426,11 @@
struct ScsiReqBlk srb_array[DC395x_MAX_SRB_CNT];
struct ScsiReqBlk srb;
-};
-
-/*
- * The SEEPROM structure for TRM_S1040
- */
-struct NVRamTarget {
- u8 cfg0; /* Target configuration byte 0 */
- u8 period; /* Target period */
- u8 cfg2; /* Target configuration byte 2 */
- u8 cfg3; /* Target configuration byte 3 */
+ struct NvRamType eeprom; /* eeprom settings for this adapter */
};
-struct NvRamType {
- u8 sub_vendor_id[2]; /* 0,1 Sub Vendor ID */
- u8 sub_sys_id[2]; /* 2,3 Sub System ID */
- u8 sub_class; /* 4 Sub Class */
- u8 vendor_id[2]; /* 5,6 Vendor ID */
- u8 device_id[2]; /* 7,8 Device ID */
- u8 reserved; /* 9 Reserved */
- struct NVRamTarget target[DC395x_MAX_SCSI_ID];
- /** 10,11,12,13
- ** 14,15,16,17
- ** ....
- ** ....
- ** 70,71,72,73
- */
- u8 scsi_id; /* 74 Host Adapter SCSI ID */
- u8 channel_cfg; /* 75 Channel configuration */
- u8 delay_time; /* 76 Power on delay time */
- u8 max_tag; /* 77 Maximum tags */
- u8 reserved0; /* 78 */
- u8 boot_target; /* 79 */
- u8 boot_lun; /* 80 */
- u8 reserved1; /* 81 */
- u16 reserved2[22]; /* 82,..125 */
- u16 cksum; /* 126,127 */
-};
/*---------------------------------------------------------------------------
@@ -514,7 +517,6 @@
---------------------------------------------------------------------------*/
static struct AdapterCtlBlk *acb_list_head = NULL;
static struct AdapterCtlBlk *acb_list_tail = NULL;
-static u16 adapter_count = 0;
static u16 current_sync_offset = 0;
static char monitor_next_irq = 0;
@@ -546,7 +548,6 @@
msgin_phase1, /* phase:7 */
};
-struct NvRamType eeprom_buf[DC395x_MAX_ADAPTER_NUM];
/*
*Fast20: 000 50ns, 20.0 MHz
* 001 75ns, 13.3 MHz
@@ -1611,14 +1612,12 @@
*/
static void reset_dev_param(struct AdapterCtlBlk *acb)
{
- struct DeviceCtlBlk *dcb;
+ struct DeviceCtlBlk *dcb = acb->link_dcb;
struct DeviceCtlBlk *dcb_temp;
- struct NvRamType *eeprom;
+ struct NvRamType *eeprom = &acb->eeprom;
u8 period_index;
- u16 index;
dprintkdbg(DBG_0, "reset_dev_param..............\n");
- dcb = acb->link_dcb;
if (dcb == NULL)
return;
@@ -1627,8 +1626,6 @@
dcb->sync_mode &= ~(SYNC_NEGO_DONE + WIDE_NEGO_DONE);
dcb->sync_period = 0;
dcb->sync_offset = 0;
- index = acb->adapter_index;
- eeprom = &eeprom_buf[index];
dcb->dev_mode = eeprom->target[dcb->target_id].cfg0;
/*dcb->AdpMode = eeprom->channel_cfg; */
@@ -1679,7 +1676,7 @@
/* We may be in serious trouble. Wait some seconds */
acb->scsi_host->last_reset =
jiffies + 3 * HZ / 2 +
- HZ * eeprom_buf[acb->adapter_index].delay_time;
+ HZ * acb->eeprom.delay_time;
/*
* re-enable interrupt
@@ -3832,9 +3829,7 @@
/* Suspend queue for a while */
acb->scsi_host->last_reset =
jiffies + HZ / 2 +
- HZ *
- eeprom_buf[acb->adapter_index].
- delay_time;
+ HZ * acb->eeprom.delay_time;
clear_fifo(acb, "DiscEx");
DC395x_write16(acb, TRM_S1040_SCSI_CONTROL, DO_HWRESELECT);
return;
@@ -4640,7 +4635,7 @@
/* Maybe we locked up the bus? Then lets wait even longer ... */
acb->scsi_host->last_reset =
jiffies + 5 * HZ / 2 +
- HZ * eeprom_buf[acb->adapter_index].delay_time;
+ HZ * acb->eeprom.delay_time;
clear_fifo(acb, "RstDet");
set_basic_config(acb);
@@ -4731,9 +4726,8 @@
void init_dcb(struct AdapterCtlBlk *acb, struct DeviceCtlBlk **pdcb,
u8 target, u8 lun)
{
- struct NvRamType *eeprom;
+ struct NvRamType *eeprom = &acb->eeprom;
u8 period_index;
- u16 index;
struct DeviceCtlBlk *dcb;
struct DeviceCtlBlk *dcb2;
@@ -4771,8 +4765,6 @@
dcb->flag = 0;
dcb->max_command = 1;
/* $$$$$$$ */
- index = acb->adapter_index;
- eeprom = &eeprom_buf[index];
dcb->dev_mode = eeprom->target[target].cfg0;
/*dcb->AdpMode = eeprom->channel_cfg; */
dcb->inquiry7 = 0;
@@ -4951,13 +4943,12 @@
***********************************************************************
*/
static
-int __init init_acb(struct Scsi_Host *host, u32 io_port, u8 irq, u16 index)
+int __init init_acb(struct Scsi_Host *host, u32 io_port, u8 irq)
{
- struct NvRamType *eeprom;
- struct AdapterCtlBlk *acb;
+ struct AdapterCtlBlk *acb = (struct AdapterCtlBlk *)host->hostdata;
+ struct NvRamType *eeprom = &acb->eeprom;
u16 i;
- eeprom = &eeprom_buf[index];
host->max_cmd_len = 24;
host->can_queue = DC395x_MAX_CMD_QUEUE;
host->cmd_per_lun = DC395x_MAX_CMD_PER_LUN;
@@ -4969,7 +4960,6 @@
host->irq = irq;
host->last_reset = jiffies;
- acb = (struct AdapterCtlBlk *) host->hostdata;
host->max_id = 16;
if (host->max_id - 1 == eeprom->scsi_id)
@@ -4991,7 +4981,6 @@
acb->dcb_run_robin = NULL;
acb->active_dcb = NULL;
acb->srb_count = DC395x_MAX_SRB_CNT;
- acb->adapter_index = index;
acb->scsi_host->this_id = eeprom->scsi_id;
acb->hostid_bit = (1 << acb->scsi_host->this_id);
/*acb->scsi_host->this_lun = 0; */
@@ -5050,16 +5039,14 @@
* @host: This hosts adapter strcuture
* @io_port: The base I/O port
* @irq: IRQ
- * @index: Card instance number
*
* Returns 0 if the initialization succeeds, any other value on failure.
**/
static
-int __init init_adapter(struct Scsi_Host *host, u32 io_port,
- u8 irq, u16 index)
+int __init init_adapter(struct Scsi_Host *host, u32 io_port, u8 irq)
{
- struct NvRamType *eeprom = &eeprom_buf[index];
struct AdapterCtlBlk *acb = (struct AdapterCtlBlk *)host->hostdata;
+ struct NvRamType *eeprom = &acb->eeprom;
if (!request_region(io_port, host->n_io_port, DC395X_NAME)) {
dprintkl(KERN_ERR, "Failed to reserve IO region 0x%x\n", io_port);
@@ -5106,9 +5093,7 @@
acb->scsi_host->last_reset =
jiffies + HZ / 2 +
- HZ *
- eeprom_buf[acb->adapter_index].
- delay_time;
+ HZ * acb->eeprom.delay_time;
/*spin_lock_irq (&io_request_lock); */
}
@@ -5465,22 +5450,22 @@
* print_eeprom_settings - output the eeprom settings
* to the kernel log so people can see what they were.
*
- * @index: Adapter number
+ * @eeprom: The eeprom data strucutre to show details for.
**/
static
-void __init print_eeprom_settings(u16 index)
+void __init print_eeprom_settings(struct NvRamType *eeprom)
{
dprintkl(KERN_INFO, "Used settings: AdapterID=%02i, Speed=%i(%02i.%01iMHz), dev_mode=0x%02x\n",
- eeprom_buf[index].scsi_id,
- eeprom_buf[index].target[0].period,
- clock_speed[eeprom_buf[index].target[0].period] / 10,
- clock_speed[eeprom_buf[index].target[0].period] % 10,
- eeprom_buf[index].target[0].cfg0);
+ eeprom->scsi_id,
+ eeprom->target[0].period,
+ clock_speed[eeprom->target[0].period] / 10,
+ clock_speed[eeprom->target[0].period] % 10,
+ eeprom->target[0].cfg0);
dprintkl(KERN_INFO, " AdaptMode=0x%02x, Tags=%i(%02i), DelayReset=%is\n",
- eeprom_buf[index].channel_cfg,
- eeprom_buf[index].max_tag,
- 1 << eeprom_buf[index].max_tag,
- eeprom_buf[index].delay_time);
+ eeprom->channel_cfg,
+ eeprom->max_tag,
+ 1 << eeprom->max_tag,
+ eeprom->delay_time);
}
@@ -5497,39 +5482,27 @@
*/
static
struct Scsi_Host *__init host_init(Scsi_Host_Template * host_template,
- u32 io_port, u8 irq,
- u16 index)
+ u32 io_port, u8 irq)
{
struct Scsi_Host *host;
struct AdapterCtlBlk *acb;
- /*
- * Read the eeprom contents info the buffer we supply. Use
- * defaults is eeprom checksum is wrong.
- */
- check_eeprom(&eeprom_buf[index], (u16) io_port);
-
- /*
- *$$$$$$$$$$$ MEMORY ALLOCATE FOR ADAPTER CONTROL BLOCK $$$$$$$$$$$$
- */
host = scsi_host_alloc(host_template, sizeof(struct AdapterCtlBlk));
if (!host) {
- dprintkl(KERN_INFO, "pSH scsi_host_alloc ERROR\n");
- return 0;
+ dprintkl(KERN_INFO, "scsi_host_alloc failed\n");
+ goto failed;
}
- print_eeprom_settings(index);
+ acb = (struct AdapterCtlBlk *)host->hostdata;
- acb = (struct AdapterCtlBlk *) host->hostdata;
- if (init_acb(host, io_port, irq, index)) {
- scsi_host_put(host);
- return 0;
+ check_eeprom(&acb->eeprom, (u16)io_port);
+ print_eeprom_settings(&acb->eeprom);
+
+ if (init_acb(host, io_port, irq)) {
+ goto failed;
}
print_config(acb);
- /*
- *$$$$$$$$$$$$$$$$$ INITIAL ADAPTER $$$$$$$$$$$$$$$$$
- */
- if (!init_adapter(host, io_port, irq, index)) {
+ if (!init_adapter(host, io_port, irq)) {
if (!acb_list_head) {
acb_list_head = acb;
} else {
@@ -5539,10 +5512,15 @@
acb->next_acb = NULL;
} else {
dprintkl(KERN_INFO, "DC395x_initAdapter initial ERROR\n");
- scsi_host_put(host);
- host = NULL;
+ goto failed;
}
+
return host;
+
+failed:
+ if (host)
+ scsi_host_put(host);
+ return NULL;
}
#undef SEARCH
@@ -5607,9 +5585,8 @@
DC395x_LOCK_IO(acb->scsi_host, flags);
SPRINTF("SCSI Host Nr %i, ", shpnt->host_no);
- SPRINTF("DC395U/UW/F DC315/U %s Adapter Nr %i\n",
- (acb->config & HCC_WIDE_CARD) ? "Wide" : "",
- acb->adapter_index);
+ SPRINTF("DC395U/UW/F DC315/U %s\n",
+ (acb->config & HCC_WIDE_CARD) ? "Wide" : "");
SPRINTF("IOPortBase 0x%04x, ", acb->IOPortBase);
SPRINTF("irq_level 0x%02x, ", acb->irq_level);
SPRINTF(" SelTimeout %ims\n", (1638 * acb->sel_timeout) / 1000);
@@ -5621,8 +5598,7 @@
/*SPRINTF(", DMA_Status %i\n", DC395x_read8(acb, TRM_S1040_DMA_STATUS)); */
SPRINTF(", FilterCfg 0x%02x",
DC395x_read8(acb, TRM_S1040_SCSI_CONFIG1));
- SPRINTF(", DelayReset %is\n",
- eeprom_buf[acb->adapter_index].delay_time);
+ SPRINTF(", DelayReset %is\n", acb->eeprom.delay_time);
/*SPRINTF("\n"); */
SPRINTF("Nr of DCBs: %i\n", acb->dcb_count);
@@ -5871,7 +5847,7 @@
irq = dev->irq;
dprintkdbg(DBG_0, "IO_PORT=%04x,IRQ=%x\n", (unsigned int) io_port, irq);
- scsi_host = host_init(&dc395x_driver_template, io_port, irq, adapter_count);
+ scsi_host = host_init(&dc395x_driver_template, io_port, irq);
if (!scsi_host)
{
dprintkdbg(DBG_0, "host_init failed\n");
@@ -5883,9 +5859,6 @@
/* store pci devices in out host data object. */
((struct AdapterCtlBlk *)(scsi_host->hostdata))->dev = dev;
- /* increment adaptor count */
- adapter_count++;
-
/* store ptr to scsi host in the PCI device structure */
pci_set_drvdata(dev, scsi_host);
diff -r -du a/drivers/scsi/dc395x.h b/drivers/scsi/dc395x.h
--- a/drivers/scsi/dc395x.h 2003-08-03 17:01:45.000000000 +1000
+++ b/drivers/scsi/dc395x.h 2003-08-03 18:06:26.406285840 +1000
@@ -28,7 +28,6 @@
#define DC395x_MAX_CMD_QUEUE 32
/* #define DC395x_MAX_QTAGS 32 */
#define DC395x_MAX_QTAGS 16
-#define DC395x_MAX_ADAPTER_NUM 4
#define DC395x_MAX_SCSI_ID 16
#define DC395x_MAX_CMD_PER_LUN DC395x_MAX_QTAGS
#define DC395x_MAX_SG_TABLESIZE 64 /* HW limitation */
--
Jamie Lenehan Work Phone: +61 3 9843 8817
lenehan@twibble.org Work Email: jamie.lenehan@activcard.com.au
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH] dc395x - 2/3 remove-static-adapter-list
2003-08-03 8:27 ` [PATCH] dc395x - 1/3 remove-static-eeprom-struct Jamie Lenehan
@ 2003-08-03 8:28 ` Jamie Lenehan
2003-08-03 8:29 ` [PATCH] dc395x - 3/3 fix-failures Jamie Lenehan
2003-08-03 15:01 ` [PATCH] dc395x - 1/3 remove-static-eeprom-struct James Bottomley
1 sibling, 1 reply; 11+ messages in thread
From: Jamie Lenehan @ 2003-08-03 8:28 UTC (permalink / raw)
To: linux-scsi; +Cc: dc395x
Remove the static list of adapters and the code related to keeping
this up to date. The only remaining use for the static list was for
the proc info function to find the scsi_host, but that's passed as a
parameter anyway.
diff -r -du a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c
--- a/drivers/scsi/dc395x.c 2003-08-03 18:08:11.097370376 +1000
+++ b/drivers/scsi/dc395x.c 2003-08-03 18:08:20.215984136 +1000
@@ -387,7 +387,6 @@
-----------------------------------------------------------------------*/
struct AdapterCtlBlk {
struct Scsi_Host *scsi_host;
- struct AdapterCtlBlk *next_acb;
u16 IOPortBase;
@@ -515,8 +514,6 @@
/*---------------------------------------------------------------------------
Static Data
---------------------------------------------------------------------------*/
-static struct AdapterCtlBlk *acb_list_head = NULL;
-static struct AdapterCtlBlk *acb_list_tail = NULL;
static u16 current_sync_offset = 0;
static char monitor_next_irq = 0;
@@ -5502,15 +5499,7 @@
}
print_config(acb);
- if (!init_adapter(host, io_port, irq)) {
- if (!acb_list_head) {
- acb_list_head = acb;
- } else {
- acb_list_tail->next_acb = acb;
- }
- acb_list_tail = acb;
- acb->next_acb = NULL;
- } else {
+ if (init_adapter(host, io_port, irq)) {
dprintkl(KERN_INFO, "DC395x_initAdapter initial ERROR\n");
goto failed;
}
@@ -5557,25 +5546,15 @@
else SPRINTF(" No ")
static
-int dc395x_proc_info(struct Scsi_Host *shpnt, char *buffer, char **start, off_t offset, int length,
+int dc395x_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t offset, int length,
int inout)
{
+ struct AdapterCtlBlk *acb = (struct AdapterCtlBlk *)host->hostdata;
int dev, spd, spd1;
char *pos = buffer;
- struct AdapterCtlBlk *acb;
struct DeviceCtlBlk *dcb;
unsigned long flags;
- acb = acb_list_head;
-
- while (acb) {
- if (acb->scsi_host == shpnt)
- break;
- acb = acb->next_acb;
- }
- if (!acb)
- return -ESRCH;
-
if (inout) /* Has data been written to the file ? */
return -EPERM;
@@ -5584,15 +5563,15 @@
DC395x_LOCK_IO(acb->scsi_host, flags);
- SPRINTF("SCSI Host Nr %i, ", shpnt->host_no);
+ SPRINTF("SCSI Host Nr %i, ", host->host_no);
SPRINTF("DC395U/UW/F DC315/U %s\n",
(acb->config & HCC_WIDE_CARD) ? "Wide" : "");
SPRINTF("IOPortBase 0x%04x, ", acb->IOPortBase);
SPRINTF("irq_level 0x%02x, ", acb->irq_level);
SPRINTF(" SelTimeout %ims\n", (1638 * acb->sel_timeout) / 1000);
- SPRINTF("MaxID %i, MaxLUN %i, ", shpnt->max_id, shpnt->max_lun);
- SPRINTF("AdapterID %i\n", shpnt->this_id);
+ SPRINTF("MaxID %i, MaxLUN %i, ", host->max_id, host->max_lun);
+ SPRINTF("AdapterID %i\n", host->this_id);
SPRINTF("tag_max_num %i", acb->tag_max_num);
/*SPRINTF(", DMA_Status %i\n", DC395x_read8(acb, TRM_S1040_DMA_STATUS)); */
--
Jamie Lenehan Work Phone: +61 3 9843 8817
lenehan@twibble.org Work Email: jamie.lenehan@activcard.com.au
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH] dc395x - 3/3 fix-failures
2003-08-03 8:28 ` [PATCH] dc395x - 2/3 remove-static-adapter-list Jamie Lenehan
@ 2003-08-03 8:29 ` Jamie Lenehan
0 siblings, 0 replies; 11+ messages in thread
From: Jamie Lenehan @ 2003-08-03 8:29 UTC (permalink / raw)
To: linux-scsi; +Cc: dc395x
Handle the case where scsi_add_host fails and update the removal
function to correctly unregister everything.
diff -r -du a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c
--- a/drivers/scsi/dc395x.c 2003-08-03 18:09:08.178692696 +1000
+++ b/drivers/scsi/dc395x.c 2003-08-03 18:09:11.006262840 +1000
@@ -5807,6 +5807,7 @@
u8 irq;
struct Scsi_Host *scsi_host;
static int banner_done = 0;
+ int error = 0;
dprintkdbg(DBG_0, "Init one instance of the dc395x\n");
if (!banner_done)
@@ -5832,20 +5833,21 @@
dprintkdbg(DBG_0, "host_init failed\n");
return -ENOMEM;
}
-
- pci_set_master(dev);
-
- /* store pci devices in out host data object. */
((struct AdapterCtlBlk *)(scsi_host->hostdata))->dev = dev;
-
- /* store ptr to scsi host in the PCI device structure */
+ pci_set_master(dev);
pci_set_drvdata(dev, scsi_host);
/* get the scsi mid level to scan for new devices on the bus */
- scsi_add_host(scsi_host, &dev->dev); /* XXX handle failure */
- scsi_scan_host(scsi_host);
-
- return 0;
+ error = scsi_add_host(scsi_host, &dev->dev);
+ if (error) {
+ dprintkl(KERN_ERR, "scsi_add_host failed\n");
+ error = -ENODEV;
+ host_release(scsi_host);
+ scsi_host_put(scsi_host);
+ } else
+ scsi_scan_host(scsi_host);
+
+ return error;
}
@@ -5858,9 +5860,18 @@
static void __devexit dc395x_remove_one(struct pci_dev *dev)
{
struct Scsi_Host *host = pci_get_drvdata(dev);
+
dprintkdbg(DBG_0, "Removing instance\n");
- scsi_remove_host(host);
+ if (!host) {
+ dprintkl(KERN_ERR, "no host allocated\n");
+ return;
+ }
+ if (scsi_remove_host(host)) {
+ dprintkl(KERN_ERR, "scsi_remove_host failed\n");
+ return;
+ }
host_release(host);
+ scsi_host_put(host);
pci_set_drvdata(dev, NULL);
}
--
Jamie Lenehan Work Phone: +61 3 9843 8817
lenehan@twibble.org Work Email: jamie.lenehan@activcard.com.au
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] dc395x - 1/3 remove-static-eeprom-struct
2003-08-03 8:27 ` [PATCH] dc395x - 1/3 remove-static-eeprom-struct Jamie Lenehan
2003-08-03 8:28 ` [PATCH] dc395x - 2/3 remove-static-adapter-list Jamie Lenehan
@ 2003-08-03 15:01 ` James Bottomley
2003-08-03 15:04 ` [Dc395x] " Ali Akcaagac
1 sibling, 1 reply; 11+ messages in thread
From: James Bottomley @ 2003-08-03 15:01 UTC (permalink / raw)
To: Jamie Lenehan; +Cc: SCSI Mailing List, dc395x
On Sun, 2003-08-03 at 03:27, Jamie Lenehan wrote:
> Move the eeprom details from a static struct indexed by adapter
> number into the adapter information block of the adapter. This
> removes the fixed size static array and removes the need to count the
> number of adapters.
This patch is rejecting fairly comprehensively against the dc395x driver
in the tree, could you rediff against either 2.6.0-test2 or the
bitkeeper scsi-misc-2.5 tree?
Thanks,
James
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Dc395x] Re: [PATCH] dc395x - 1/3 remove-static-eeprom-struct
2003-08-03 15:01 ` [PATCH] dc395x - 1/3 remove-static-eeprom-struct James Bottomley
@ 2003-08-03 15:04 ` Ali Akcaagac
2003-08-03 15:13 ` James Bottomley
0 siblings, 1 reply; 11+ messages in thread
From: Ali Akcaagac @ 2003-08-03 15:04 UTC (permalink / raw)
To: James Bottomley; +Cc: Jamie Lenehan, SCSI Mailing List
On Sun, 2003-08-03 at 17:01, James Bottomley wrote:
> This patch is rejecting fairly comprehensively against the dc395x driver
> in the tree, could you rediff against either 2.6.0-test2 or the
> bitkeeper scsi-misc-2.5 tree?
Works pretty nice for me agains 2.6.0-test2-bk2. There are around 2800
lines of changes between 2.6.0-test2 and 2.6.0-test2-bk2 so it's most
likely that this fails. Use the BK2 version please. Works like a charm
here.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Dc395x] Re: [PATCH] dc395x - 1/3 remove-static-eeprom-struct
2003-08-03 15:04 ` [Dc395x] " Ali Akcaagac
@ 2003-08-03 15:13 ` James Bottomley
2003-08-03 15:36 ` Ali Akcaagac
0 siblings, 1 reply; 11+ messages in thread
From: James Bottomley @ 2003-08-03 15:13 UTC (permalink / raw)
To: Ali Akcaagac; +Cc: Jamie Lenehan, SCSI Mailing List
On Sun, 2003-08-03 at 10:04, Ali Akcaagac wrote:
> Works pretty nice for me agains 2.6.0-test2-bk2. There are around 2800
> lines of changes between 2.6.0-test2 and 2.6.0-test2-bk2 so it's most
> likely that this fails. Use the BK2 version please. Works like a charm
> here.
Ah, OK, the driver's coming through the -ac tree. OK, I'll revert the
current change I have in the scsi tree from you so as not to damage the
merge.
James
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Dc395x] Re: [PATCH] dc395x - 1/3 remove-static-eeprom-struct
2003-08-03 15:13 ` James Bottomley
@ 2003-08-03 15:36 ` Ali Akcaagac
2003-08-03 17:31 ` James Bottomley
0 siblings, 1 reply; 11+ messages in thread
From: Ali Akcaagac @ 2003-08-03 15:36 UTC (permalink / raw)
To: James Bottomley; +Cc: Jamie Lenehan, SCSI Mailing List
On Sun, 2003-08-03 at 17:13, James Bottomley wrote:
> Ah, OK, the driver's coming through the -ac tree. OK, I'll
> revert the current change I have in the scsi tree from you
> so as not to damage the merge.
Well the driver got in during 2.5.7x times through Linus himself after
we sent him the initial stuff we did. During that time we made around
250-270kb of changes to the driver which we had some problems getting in
due to the size. Around 2 weeks ago I contacted Alan Cox if he may
review the changes we made during that time and if he could get it in
somehow. So the changes (the 2500-2800 lines) showed up in the AC tree 1
week ago and now got merged into the test2-bk1/2 tree some days ago.
During the merge there seemed to be a one char issue in bk2 which
prevented the driver from compiling, that's why I sent in a little one
liner patch that fixes this behaviour.
Jamie Lenehan fixed that stuff correctly now (because there was some XXX
Fixme's in the code) as you see thats the 3 patches Jamie sent to the
scsi list today/yesterday (depends on the timezone). These 3 patches
should go against bk2 (which I have tested this morning) works and
applies without any problems.
So if possible please add these 3 patches ontop of what's inside bk2,
this will save us a lot of pain :)
greetings,
Ali Akcaagac
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Dc395x] Re: [PATCH] dc395x - 1/3 remove-static-eeprom-struct
2003-08-03 15:36 ` Ali Akcaagac
@ 2003-08-03 17:31 ` James Bottomley
2003-08-12 4:12 ` Ali Akcaagac
0 siblings, 1 reply; 11+ messages in thread
From: James Bottomley @ 2003-08-03 17:31 UTC (permalink / raw)
To: Ali Akcaagac; +Cc: Jamie Lenehan, SCSI Mailing List
On Sun, 2003-08-03 at 10:36, Ali Akcaagac wrote:
> So if possible please add these 3 patches ontop of what's inside bk2,
> this will save us a lot of pain :)
That's not actually possible for me: the -bkX snapshots aren't tagged in
the main BK tree. However, as long as no further updates are coming
from elsewhere, the tree head is usually "good enough" to apply patches
to.
In this case, it looks like with the exclusion I can apply to the tree
head, so I'll merge the scsi-misc-2.5 repository up there.
James
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Dc395x] Re: [PATCH] dc395x - 1/3 remove-static-eeprom-struct
2003-08-03 17:31 ` James Bottomley
@ 2003-08-12 4:12 ` Ali Akcaagac
2003-08-12 10:29 ` Jamie Lenehan
0 siblings, 1 reply; 11+ messages in thread
From: Ali Akcaagac @ 2003-08-12 4:12 UTC (permalink / raw)
To: James Bottomley; +Cc: Jamie Lenehan, SCSI Mailing List
On Sun, 2003-08-03 at 19:31, James Bottomley wrote:
> That's not actually possible for me: the -bkX snapshots aren't tagged in
> the main BK tree. However, as long as no further updates are coming
> from elsewhere, the tree head is usually "good enough" to apply patches
> to.
>
> In this case, it looks like with the exclusion I can apply to the tree
> head, so I'll merge the scsi-misc-2.5 repository up there.
Can you now please include the 3 new patches in the test3 ? As long as
no one contributes other patches it's the chance to do it.
http://www.twibble.org/dist/dc395x/2.05/
01-03 should fit on bk3 w/o problems.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Dc395x] Re: [PATCH] dc395x - 1/3 remove-static-eeprom-struct
2003-08-12 4:12 ` Ali Akcaagac
@ 2003-08-12 10:29 ` Jamie Lenehan
0 siblings, 0 replies; 11+ messages in thread
From: Jamie Lenehan @ 2003-08-12 10:29 UTC (permalink / raw)
To: Ali Akcaagac; +Cc: James Bottomley, SCSI Mailing List
On Tue, Aug 12, 2003 at 06:12:09AM +0200, Ali Akcaagac wrote:
[...]
> Can you now please include the 3 new patches in the test3 ? As long as
> no one contributes other patches it's the chance to do it.
The patches were added to the scsi-misc when the were originally sent
to linux-scsi (see http://linux-scsi.bkbits.net:8080/scsi-misc-2.5).
They are not critical and they will get pushed along when James is
ready to push them in.
So there's nothing to worry about.
--
Jamie Lenehan <lenehan@twibble.org>
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2003-08-12 10:29 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-03 8:27 [PATCH] dc395x - description Jamie Lenehan
2003-08-03 8:27 ` [PATCH] dc395x - 1/3 remove-static-eeprom-struct Jamie Lenehan
2003-08-03 8:28 ` [PATCH] dc395x - 2/3 remove-static-adapter-list Jamie Lenehan
2003-08-03 8:29 ` [PATCH] dc395x - 3/3 fix-failures Jamie Lenehan
2003-08-03 15:01 ` [PATCH] dc395x - 1/3 remove-static-eeprom-struct James Bottomley
2003-08-03 15:04 ` [Dc395x] " Ali Akcaagac
2003-08-03 15:13 ` James Bottomley
2003-08-03 15:36 ` Ali Akcaagac
2003-08-03 17:31 ` James Bottomley
2003-08-12 4:12 ` Ali Akcaagac
2003-08-12 10:29 ` Jamie Lenehan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox