aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/gdth.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2007-10-02 16:59:53 -0400
committerJames Bottomley <jejb@mulgrave.localdomain>2007-10-12 14:55:42 -0400
commit52759e6abc88fe007a080772ee01ef1154f96f30 (patch)
tree54d780f27ad1c522d0ceb0e4f300a1090d77feca /drivers/scsi/gdth.c
parent69916b7ceac0dfbbc868ae5451062cb789b1b58a (diff)
[SCSI] gdth: Remove virt hosts
The virt_ctr option allows to register a new scsi_host for each bus on the raid controller. This non-default option makes no sense with the current scsi code and prevents cleaning up the host registration, so remove it. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/gdth.c')
-rw-r--r--drivers/scsi/gdth.c88
1 files changed, 12 insertions, 76 deletions
diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c
index dba27b3b979a..c4db926a7dd8 100644
--- a/drivers/scsi/gdth.c
+++ b/drivers/scsi/gdth.c
@@ -56,8 +56,6 @@
56 * max_ids:x x - target ID count per channel (1..MAXID) 56 * max_ids:x x - target ID count per channel (1..MAXID)
57 * rescan:Y rescan all channels/IDs 57 * rescan:Y rescan all channels/IDs
58 * rescan:N use all devices found until now 58 * rescan:N use all devices found until now
59 * virt_ctr:Y map every channel to a virtual controller
60 * virt_ctr:N use multi channel support
61 * hdr_channel:x x - number of virtual bus for host drives 59 * hdr_channel:x x - number of virtual bus for host drives
62 * shared_access:Y disable driver reserve/release protocol to 60 * shared_access:Y disable driver reserve/release protocol to
63 * access a shared resource from several nodes, 61 * access a shared resource from several nodes,
@@ -69,7 +67,7 @@
69 * force_dma32:N use 64 bit DMA mode, if supported 67 * force_dma32:N use 64 bit DMA mode, if supported
70 * 68 *
71 * The default values are: "gdth=disable:N,reserve_mode:1,reverse_scan:N, 69 * The default values are: "gdth=disable:N,reserve_mode:1,reverse_scan:N,
72 * max_ids:127,rescan:N,virt_ctr:N,hdr_channel:0, 70 * max_ids:127,rescan:N,hdr_channel:0,
73 * shared_access:Y,probe_eisa_isa:N,force_dma32:N". 71 * shared_access:Y,probe_eisa_isa:N,force_dma32:N".
74 * Here is another example: "gdth=reserve_list:0,1,2,0,0,1,3,0,rescan:Y". 72 * Here is another example: "gdth=reserve_list:0,1,2,0,0,1,3,0,rescan:Y".
75 * 73 *
@@ -80,7 +78,7 @@
80 * '1' in place of 'Y' and '0' in place of 'N'. 78 * '1' in place of 'Y' and '0' in place of 'N'.
81 * 79 *
82 * Default: "modprobe gdth disable=0 reserve_mode=1 reverse_scan=0 80 * Default: "modprobe gdth disable=0 reserve_mode=1 reverse_scan=0
83 * max_ids=127 rescan=0 virt_ctr=0 hdr_channel=0 shared_access=0 81 * max_ids=127 rescan=0 hdr_channel=0 shared_access=0
84 * probe_eisa_isa=0 force_dma32=0" 82 * probe_eisa_isa=0 force_dma32=0"
85 * The other example: "modprobe gdth reserve_list=0,1,2,0,0,1,3,0 rescan=1". 83 * The other example: "modprobe gdth reserve_list=0,1,2,0,0,1,3,0 rescan=1".
86 */ 84 */
@@ -303,10 +301,8 @@ static unchar gdth_polling; /* polling if TRUE */
303static unchar gdth_from_wait = FALSE; /* gdth_wait() */ 301static unchar gdth_from_wait = FALSE; /* gdth_wait() */
304static int wait_index,wait_hanum; /* gdth_wait() */ 302static int wait_index,wait_hanum; /* gdth_wait() */
305static int gdth_ctr_count = 0; /* controller count */ 303static int gdth_ctr_count = 0; /* controller count */
306static int gdth_ctr_vcount = 0; /* virt. ctr. count */
307static int gdth_ctr_released = 0; /* gdth_release() */ 304static int gdth_ctr_released = 0; /* gdth_release() */
308static struct Scsi_Host *gdth_ctr_tab[MAXHA]; /* controller table */ 305static struct Scsi_Host *gdth_ctr_tab[MAXHA]; /* controller table */
309static struct Scsi_Host *gdth_ctr_vtab[MAXHA*MAXBUS]; /* virt. ctr. table */
310static unchar gdth_write_through = FALSE; /* write through */ 306static unchar gdth_write_through = FALSE; /* write through */
311static gdth_evt_str ebuffer[MAX_EVENTS]; /* event buffer */ 307static gdth_evt_str ebuffer[MAX_EVENTS]; /* event buffer */
312static int elastidx; 308static int elastidx;
@@ -358,8 +354,6 @@ static int hdr_channel = 0;
358static int max_ids = MAXID; 354static int max_ids = MAXID;
359/* rescan all IDs */ 355/* rescan all IDs */
360static int rescan = 0; 356static int rescan = 0;
361/* map channels to virtual controllers */
362static int virt_ctr = 0;
363/* shared access */ 357/* shared access */
364static int shared_access = 1; 358static int shared_access = 1;
365/* enable support for EISA and ISA controllers */ 359/* enable support for EISA and ISA controllers */
@@ -376,7 +370,6 @@ module_param(reverse_scan, int, 0);
376module_param(hdr_channel, int, 0); 370module_param(hdr_channel, int, 0);
377module_param(max_ids, int, 0); 371module_param(max_ids, int, 0);
378module_param(rescan, int, 0); 372module_param(rescan, int, 0);
379module_param(virt_ctr, int, 0);
380module_param(shared_access, int, 0); 373module_param(shared_access, int, 0);
381module_param(probe_eisa_isa, int, 0); 374module_param(probe_eisa_isa, int, 0);
382module_param(force_dma32, int, 0); 375module_param(force_dma32, int, 0);
@@ -2018,7 +2011,7 @@ static void gdth_putq(int hanum,Scsi_Cmnd *scp,unchar priority)
2018 2011
2019 if (!IS_GDTH_INTERNAL_CMD(scp)) { 2012 if (!IS_GDTH_INTERNAL_CMD(scp)) {
2020 scp->SCp.this_residual = (int)priority; 2013 scp->SCp.this_residual = (int)priority;
2021 b = virt_ctr ? NUMDATA(scp->device->host)->busnum:scp->device->channel; 2014 b = scp->device->channel;
2022 t = scp->device->id; 2015 t = scp->device->id;
2023 if (priority >= DEFAULT_PRI) { 2016 if (priority >= DEFAULT_PRI) {
2024 if ((b != ha->virt_bus && ha->raw[BUS_L2P(ha,b)].lock) || 2017 if ((b != ha->virt_bus && ha->raw[BUS_L2P(ha,b)].lock) ||
@@ -2080,8 +2073,7 @@ static void gdth_next(int hanum)
2080 if (nscp != pscp && nscp != (Scsi_Cmnd *)pscp->SCp.ptr) 2073 if (nscp != pscp && nscp != (Scsi_Cmnd *)pscp->SCp.ptr)
2081 pscp = (Scsi_Cmnd *)pscp->SCp.ptr; 2074 pscp = (Scsi_Cmnd *)pscp->SCp.ptr;
2082 if (!IS_GDTH_INTERNAL_CMD(nscp)) { 2075 if (!IS_GDTH_INTERNAL_CMD(nscp)) {
2083 b = virt_ctr ? 2076 b = nscp->device->channel;
2084 NUMDATA(nscp->device->host)->busnum : nscp->device->channel;
2085 t = nscp->device->id; 2077 t = nscp->device->id;
2086 l = nscp->device->lun; 2078 l = nscp->device->lun;
2087 if (nscp->SCp.this_residual >= DEFAULT_PRI) { 2079 if (nscp->SCp.this_residual >= DEFAULT_PRI) {
@@ -3397,7 +3389,7 @@ static int gdth_sync_event(int hanum,int service,unchar index,Scsi_Cmnd *scp)
3397 printk("\n"); 3389 printk("\n");
3398 3390
3399 } else { 3391 } else {
3400 b = virt_ctr ? NUMDATA(scp->device->host)->busnum : scp->device->channel; 3392 b = scp->device->channel;
3401 t = scp->device->id; 3393 t = scp->device->id;
3402 if (scp->SCp.sent_command == -1 && b != ha->virt_bus) { 3394 if (scp->SCp.sent_command == -1 && b != ha->virt_bus) {
3403 ha->raw[BUS_L2P(ha,b)].io_cnt[t]--; 3395 ha->raw[BUS_L2P(ha,b)].io_cnt[t]--;
@@ -3883,8 +3875,6 @@ static void __init internal_setup(char *str,int *ints)
3883 max_ids = val; 3875 max_ids = val;
3884 else if (!strncmp(argv, "rescan:", 7)) 3876 else if (!strncmp(argv, "rescan:", 7))
3885 rescan = val; 3877 rescan = val;
3886 else if (!strncmp(argv, "virt_ctr:", 9))
3887 virt_ctr = val;
3888 else if (!strncmp(argv, "shared_access:", 14)) 3878 else if (!strncmp(argv, "shared_access:", 14))
3889 shared_access = val; 3879 shared_access = val;
3890 else if (!strncmp(argv, "probe_eisa_isa:", 15)) 3880 else if (!strncmp(argv, "probe_eisa_isa:", 15))
@@ -3931,7 +3921,6 @@ int __init option_setup(char *str)
3931 return 1; 3921 return 1;
3932} 3922}
3933 3923
3934
3935static int __init gdth_detect(struct scsi_host_template *shtp) 3924static int __init gdth_detect(struct scsi_host_template *shtp)
3936{ 3925{
3937#ifdef DEBUG_GDTH 3926#ifdef DEBUG_GDTH
@@ -4018,7 +4007,7 @@ static int __init gdth_detect(struct scsi_host_template *shtp)
4018 register_reboot_notifier(&gdth_notifier); 4007 register_reboot_notifier(&gdth_notifier);
4019 } 4008 }
4020 gdth_polling = FALSE; 4009 gdth_polling = FALSE;
4021 return gdth_ctr_vcount; 4010 return gdth_ctr_count;
4022} 4011}
4023 4012
4024static int gdth_release(struct Scsi_Host *shp) 4013static int gdth_release(struct Scsi_Host *shp)
@@ -4027,7 +4016,6 @@ static int gdth_release(struct Scsi_Host *shp)
4027 gdth_ha_str *ha; 4016 gdth_ha_str *ha;
4028 4017
4029 TRACE2(("gdth_release()\n")); 4018 TRACE2(("gdth_release()\n"));
4030 if (NUMDATA(shp)->busnum == 0) {
4031 hanum = NUMDATA(shp)->hanum; 4019 hanum = NUMDATA(shp)->hanum;
4032 ha = HADATA(gdth_ctr_tab[hanum]); 4020 ha = HADATA(gdth_ctr_tab[hanum]);
4033 if (ha->sdev) { 4021 if (ha->sdev) {
@@ -4069,7 +4057,6 @@ static int gdth_release(struct Scsi_Host *shp)
4069 unregister_chrdev(major,"gdth"); 4057 unregister_chrdev(major,"gdth");
4070 unregister_reboot_notifier(&gdth_notifier); 4058 unregister_reboot_notifier(&gdth_notifier);
4071 } 4059 }
4072 }
4073 4060
4074 scsi_unregister(shp); 4061 scsi_unregister(shp);
4075 return 0; 4062 return 0;
@@ -4131,7 +4118,7 @@ static int gdth_eh_bus_reset(Scsi_Cmnd *scp)
4131 TRACE2(("gdth_eh_bus_reset()\n")); 4118 TRACE2(("gdth_eh_bus_reset()\n"));
4132 4119
4133 hanum = NUMDATA(scp->device->host)->hanum; 4120 hanum = NUMDATA(scp->device->host)->hanum;
4134 b = virt_ctr ? NUMDATA(scp->device->host)->busnum : scp->device->channel; 4121 b = scp->device->channel;
4135 ha = HADATA(gdth_ctr_tab[hanum]); 4122 ha = HADATA(gdth_ctr_tab[hanum]);
4136 4123
4137 /* clear command tab */ 4124 /* clear command tab */
@@ -4185,7 +4172,7 @@ static int gdth_bios_param(struct scsi_device *sdev,struct block_device *bdev,se
4185 sd = sdev; 4172 sd = sdev;
4186 capacity = cap; 4173 capacity = cap;
4187 hanum = NUMDATA(sd->host)->hanum; 4174 hanum = NUMDATA(sd->host)->hanum;
4188 b = virt_ctr ? NUMDATA(sd->host)->busnum : sd->channel; 4175 b = sd->channel;
4189 t = sd->id; 4176 t = sd->id;
4190 TRACE2(("gdth_bios_param() ha %d bus %d target %d\n", hanum, b, t)); 4177 TRACE2(("gdth_bios_param() ha %d bus %d target %d\n", hanum, b, t));
4191 ha = HADATA(gdth_ctr_tab[hanum]); 4178 ha = HADATA(gdth_ctr_tab[hanum]);
@@ -4805,7 +4792,7 @@ static int gdth_ioctl(struct inode *inode, struct file *filep,
4805 scp->device = ha->sdev; 4792 scp->device = ha->sdev;
4806 scp->cmd_len = 12; 4793 scp->cmd_len = 12;
4807 scp->use_sg = 0; 4794 scp->use_sg = 0;
4808 scp->device->channel = virt_ctr ? 0 : res.number; 4795 scp->device->channel = res.number;
4809 rval = gdth_eh_bus_reset(scp); 4796 rval = gdth_eh_bus_reset(scp);
4810 res.status = (rval == SUCCESS ? S_OK : S_GENERR); 4797 res.status = (rval == SUCCESS ? S_OK : S_GENERR);
4811 kfree(scp); 4798 kfree(scp);
@@ -4932,7 +4919,6 @@ static int gdth_isa_probe_one(struct scsi_host_template *shtp, ulong32 isa_bios)
4932 gdth_ha_str *ha; 4919 gdth_ha_str *ha;
4933 dma_addr_t scratch_dma_handle = 0; 4920 dma_addr_t scratch_dma_handle = 0;
4934 int error, hanum, i; 4921 int error, hanum, i;
4935 u8 b;
4936 4922
4937 if (!gdth_search_isa(isa_bios)) 4923 if (!gdth_search_isa(isa_bios))
4938 return -ENXIO; 4924 return -ENXIO;
@@ -4969,10 +4955,8 @@ static int gdth_isa_probe_one(struct scsi_host_template *shtp, ulong32 isa_bios)
4969 shp->dma_channel = ha->drq; 4955 shp->dma_channel = ha->drq;
4970 hanum = gdth_ctr_count; 4956 hanum = gdth_ctr_count;
4971 gdth_ctr_tab[gdth_ctr_count++] = shp; 4957 gdth_ctr_tab[gdth_ctr_count++] = shp;
4972 gdth_ctr_vtab[gdth_ctr_vcount++] = shp;
4973 4958
4974 NUMDATA(shp)->hanum = (ushort)hanum; 4959 NUMDATA(shp)->hanum = (ushort)hanum;
4975 NUMDATA(shp)->busnum= 0;
4976 4960
4977 ha->pccb = CMDDATA(shp); 4961 ha->pccb = CMDDATA(shp);
4978 ha->ccb_phys = 0L; 4962 ha->ccb_phys = 0L;
@@ -5025,20 +5009,7 @@ static int gdth_isa_probe_one(struct scsi_host_template *shtp, ulong32 isa_bios)
5025 5009
5026 shp->max_id = ha->tid_cnt; 5010 shp->max_id = ha->tid_cnt;
5027 shp->max_lun = MAXLUN; 5011 shp->max_lun = MAXLUN;
5028 shp->max_channel = virt_ctr ? 0 : ha->bus_cnt; 5012 shp->max_channel = ha->bus_cnt;
5029 if (virt_ctr) {
5030 virt_ctr = 1;
5031 /* register addit. SCSI channels as virtual controllers */
5032 for (b = 1; b < ha->bus_cnt + 1; ++b) {
5033 shp = scsi_register(shtp,sizeof(gdth_num_str));
5034 shp->unchecked_isa_dma = 1;
5035 shp->irq = ha->irq;
5036 shp->dma_channel = ha->drq;
5037 gdth_ctr_vtab[gdth_ctr_vcount++] = shp;
5038 NUMDATA(shp)->hanum = (ushort)hanum;
5039 NUMDATA(shp)->busnum = b;
5040 }
5041 }
5042 5013
5043 spin_lock_init(&ha->smp_lock); 5014 spin_lock_init(&ha->smp_lock);
5044 gdth_enable_int(hanum); 5015 gdth_enable_int(hanum);
@@ -5058,7 +5029,6 @@ static int gdth_isa_probe_one(struct scsi_host_template *shtp, ulong32 isa_bios)
5058 ha->pscratch, ha->scratch_phys); 5029 ha->pscratch, ha->scratch_phys);
5059 out_dec_counters: 5030 out_dec_counters:
5060 gdth_ctr_count--; 5031 gdth_ctr_count--;
5061 gdth_ctr_vcount--;
5062 out_free_irq: 5032 out_free_irq:
5063 free_irq(ha->irq, ha); 5033 free_irq(ha->irq, ha);
5064 out_host_put: 5034 out_host_put:
@@ -5075,7 +5045,6 @@ static int gdth_eisa_probe_one(struct scsi_host_template *shtp,
5075 gdth_ha_str *ha; 5045 gdth_ha_str *ha;
5076 dma_addr_t scratch_dma_handle = 0; 5046 dma_addr_t scratch_dma_handle = 0;
5077 int error, hanum, i; 5047 int error, hanum, i;
5078 u8 b;
5079 5048
5080 if (!gdth_search_eisa(eisa_slot)) 5049 if (!gdth_search_eisa(eisa_slot))
5081 return -ENXIO; 5050 return -ENXIO;
@@ -5104,10 +5073,8 @@ static int gdth_eisa_probe_one(struct scsi_host_template *shtp,
5104 shp->dma_channel = 0xff; 5073 shp->dma_channel = 0xff;
5105 hanum = gdth_ctr_count; 5074 hanum = gdth_ctr_count;
5106 gdth_ctr_tab[gdth_ctr_count++] = shp; 5075 gdth_ctr_tab[gdth_ctr_count++] = shp;
5107 gdth_ctr_vtab[gdth_ctr_vcount++] = shp;
5108 5076
5109 NUMDATA(shp)->hanum = (ushort)hanum; 5077 NUMDATA(shp)->hanum = (ushort)hanum;
5110 NUMDATA(shp)->busnum= 0;
5111 TRACE2(("EISA detect Bus 0: hanum %d\n", 5078 TRACE2(("EISA detect Bus 0: hanum %d\n",
5112 NUMDATA(shp)->hanum)); 5079 NUMDATA(shp)->hanum));
5113 5080
@@ -5167,20 +5134,7 @@ static int gdth_eisa_probe_one(struct scsi_host_template *shtp,
5167 5134
5168 shp->max_id = ha->tid_cnt; 5135 shp->max_id = ha->tid_cnt;
5169 shp->max_lun = MAXLUN; 5136 shp->max_lun = MAXLUN;
5170 shp->max_channel = virt_ctr ? 0 : ha->bus_cnt; 5137 shp->max_channel = ha->bus_cnt;
5171 if (virt_ctr) {
5172 virt_ctr = 1;
5173 /* register addit. SCSI channels as virtual controllers */
5174 for (b = 1; b < ha->bus_cnt + 1; ++b) {
5175 shp = scsi_register(shtp,sizeof(gdth_num_str));
5176 shp->unchecked_isa_dma = 0;
5177 shp->irq = ha->irq;
5178 shp->dma_channel = 0xff;
5179 gdth_ctr_vtab[gdth_ctr_vcount++] = shp;
5180 NUMDATA(shp)->hanum = (ushort)hanum;
5181 NUMDATA(shp)->busnum = b;
5182 }
5183 }
5184 5138
5185 spin_lock_init(&ha->smp_lock); 5139 spin_lock_init(&ha->smp_lock);
5186 gdth_enable_int(hanum); 5140 gdth_enable_int(hanum);
@@ -5203,7 +5157,6 @@ static int gdth_eisa_probe_one(struct scsi_host_template *shtp,
5203 out_free_irq: 5157 out_free_irq:
5204 free_irq(ha->irq, ha); 5158 free_irq(ha->irq, ha);
5205 gdth_ctr_count--; 5159 gdth_ctr_count--;
5206 gdth_ctr_vcount--;
5207 out_host_put: 5160 out_host_put:
5208 scsi_unregister(shp); 5161 scsi_unregister(shp);
5209 return error; 5162 return error;
@@ -5218,7 +5171,6 @@ static int gdth_pci_probe_one(struct scsi_host_template *shtp,
5218 gdth_ha_str *ha; 5171 gdth_ha_str *ha;
5219 dma_addr_t scratch_dma_handle = 0; 5172 dma_addr_t scratch_dma_handle = 0;
5220 int error, hanum, i; 5173 int error, hanum, i;
5221 u8 b;
5222 5174
5223 shp = scsi_register(shtp,sizeof(gdth_ext_str)); 5175 shp = scsi_register(shtp,sizeof(gdth_ext_str));
5224 if (!shp) 5176 if (!shp)
@@ -5247,10 +5199,8 @@ static int gdth_pci_probe_one(struct scsi_host_template *shtp,
5247 shp->dma_channel = 0xff; 5199 shp->dma_channel = 0xff;
5248 hanum = gdth_ctr_count; 5200 hanum = gdth_ctr_count;
5249 gdth_ctr_tab[gdth_ctr_count++] = shp; 5201 gdth_ctr_tab[gdth_ctr_count++] = shp;
5250 gdth_ctr_vtab[gdth_ctr_vcount++] = shp;
5251 5202
5252 NUMDATA(shp)->hanum = (ushort)hanum; 5203 NUMDATA(shp)->hanum = (ushort)hanum;
5253 NUMDATA(shp)->busnum= 0;
5254 5204
5255 ha->pccb = CMDDATA(shp); 5205 ha->pccb = CMDDATA(shp);
5256 ha->ccb_phys = 0L; 5206 ha->ccb_phys = 0L;
@@ -5318,20 +5268,7 @@ static int gdth_pci_probe_one(struct scsi_host_template *shtp,
5318 5268
5319 shp->max_id = ha->tid_cnt; 5269 shp->max_id = ha->tid_cnt;
5320 shp->max_lun = MAXLUN; 5270 shp->max_lun = MAXLUN;
5321 shp->max_channel = virt_ctr ? 0 : ha->bus_cnt; 5271 shp->max_channel = ha->bus_cnt;
5322 if (virt_ctr) {
5323 virt_ctr = 1;
5324 /* register addit. SCSI channels as virtual controllers */
5325 for (b = 1; b < ha->bus_cnt + 1; ++b) {
5326 shp = scsi_register(shtp,sizeof(gdth_num_str));
5327 shp->unchecked_isa_dma = 0;
5328 shp->irq = ha->irq;
5329 shp->dma_channel = 0xff;
5330 gdth_ctr_vtab[gdth_ctr_vcount++] = shp;
5331 NUMDATA(shp)->hanum = (ushort)hanum;
5332 NUMDATA(shp)->busnum = b;
5333 }
5334 }
5335 5272
5336 spin_lock_init(&ha->smp_lock); 5273 spin_lock_init(&ha->smp_lock);
5337 gdth_enable_int(hanum); 5274 gdth_enable_int(hanum);
@@ -5351,7 +5288,6 @@ static int gdth_pci_probe_one(struct scsi_host_template *shtp,
5351 out_free_irq: 5288 out_free_irq:
5352 free_irq(ha->irq, ha); 5289 free_irq(ha->irq, ha);
5353 gdth_ctr_count--; 5290 gdth_ctr_count--;
5354 gdth_ctr_vcount--;
5355 out_host_put: 5291 out_host_put:
5356 scsi_unregister(shp); 5292 scsi_unregister(shp);
5357 return error; 5293 return error;