aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-12-12 02:41:26 -0500
committerMartin K. Petersen <martin.petersen@oracle.com>2019-01-08 21:58:35 -0500
commitd8e1e6add226e57fe467483d117e4b6113fe2e2e (patch)
tree33c0ee5645bcaca0be41a99bba555931fd2b80d5
parent9affa597850fb53918f7069f73bb7235756a4dc7 (diff)
scsi: gdth: remove interrupt coalescing support
This code has been under a never defined ifdef since the beginning of time (or at least history), and has just bitrotted. Nuke it. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r--drivers/scsi/gdth.c151
1 files changed, 12 insertions, 139 deletions
diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c
index 93d9c2f14ab9..878b9ccc3d6d 100644
--- a/drivers/scsi/gdth.c
+++ b/drivers/scsi/gdth.c
@@ -89,10 +89,6 @@
89 * phase: unused 89 * phase: unused
90 */ 90 */
91 91
92
93/* interrupt coalescing */
94/* #define INT_COAL */
95
96/* statistics */ 92/* statistics */
97#define GDTH_STATISTICS 93#define GDTH_STATISTICS
98 94
@@ -192,9 +188,6 @@ static u8 DebugState = DEBUG_GDTH;
192 188
193#ifdef GDTH_STATISTICS 189#ifdef GDTH_STATISTICS
194static u32 max_rq=0, max_index=0, max_sg=0; 190static u32 max_rq=0, max_index=0, max_sg=0;
195#ifdef INT_COAL
196static u32 max_int_coal=0;
197#endif
198static u32 act_ints=0, act_ios=0, act_stats=0, act_rq=0; 191static u32 act_ints=0, act_ios=0, act_stats=0, act_rq=0;
199static struct timer_list gdth_timer; 192static struct timer_list gdth_timer;
200#endif 193#endif
@@ -1189,9 +1182,6 @@ static int gdth_search_drives(gdth_ha_str *ha)
1189 gdth_arcdl_str *alst; 1182 gdth_arcdl_str *alst;
1190 gdth_alist_str *alst2; 1183 gdth_alist_str *alst2;
1191 gdth_oem_str_ioctl *oemstr; 1184 gdth_oem_str_ioctl *oemstr;
1192#ifdef INT_COAL
1193 gdth_perf_modes *pmod;
1194#endif
1195 1185
1196 TRACE(("gdth_search_drives() hanum %d\n", ha->hanum)); 1186 TRACE(("gdth_search_drives() hanum %d\n", ha->hanum));
1197 ok = 0; 1187 ok = 0;
@@ -1234,35 +1224,6 @@ static int gdth_search_drives(gdth_ha_str *ha)
1234 cdev_cnt = (u16)ha->info; 1224 cdev_cnt = (u16)ha->info;
1235 ha->fw_vers = ha->service; 1225 ha->fw_vers = ha->service;
1236 1226
1237#ifdef INT_COAL
1238 if (ha->type == GDT_PCIMPR) {
1239 /* set perf. modes */
1240 pmod = (gdth_perf_modes *)ha->pscratch;
1241 pmod->version = 1;
1242 pmod->st_mode = 1; /* enable one status buffer */
1243 *((u64 *)&pmod->st_buff_addr1) = ha->coal_stat_phys;
1244 pmod->st_buff_indx1 = COALINDEX;
1245 pmod->st_buff_addr2 = 0;
1246 pmod->st_buff_u_addr2 = 0;
1247 pmod->st_buff_indx2 = 0;
1248 pmod->st_buff_size = sizeof(gdth_coal_status) * MAXOFFSETS;
1249 pmod->cmd_mode = 0; // disable all cmd buffers
1250 pmod->cmd_buff_addr1 = 0;
1251 pmod->cmd_buff_u_addr1 = 0;
1252 pmod->cmd_buff_indx1 = 0;
1253 pmod->cmd_buff_addr2 = 0;
1254 pmod->cmd_buff_u_addr2 = 0;
1255 pmod->cmd_buff_indx2 = 0;
1256 pmod->cmd_buff_size = 0;
1257 pmod->reserved1 = 0;
1258 pmod->reserved2 = 0;
1259 if (gdth_internal_cmd(ha, CACHESERVICE, GDT_IOCTL, SET_PERF_MODES,
1260 INVALID_CHANNEL,sizeof(gdth_perf_modes))) {
1261 printk("GDT-HA %d: Interrupt coalescing activated\n", ha->hanum);
1262 }
1263 }
1264#endif
1265
1266 /* detect number of buses - try new IOCTL */ 1227 /* detect number of buses - try new IOCTL */
1267 iocr = (gdth_raw_iochan_str *)ha->pscratch; 1228 iocr = (gdth_raw_iochan_str *)ha->pscratch;
1268 iocr->hdr.version = 0xffffffff; 1229 iocr->hdr.version = 0xffffffff;
@@ -2538,12 +2499,6 @@ static irqreturn_t __gdth_interrupt(gdth_ha_str *ha,
2538 u8 IStatus; 2499 u8 IStatus;
2539 u16 Service; 2500 u16 Service;
2540 unsigned long flags = 0; 2501 unsigned long flags = 0;
2541#ifdef INT_COAL
2542 int coalesced = FALSE;
2543 int next = FALSE;
2544 gdth_coal_status *pcs = NULL;
2545 int act_int_coal = 0;
2546#endif
2547 2502
2548 TRACE(("gdth_interrupt() IRQ %d\n", ha->irq)); 2503 TRACE(("gdth_interrupt() IRQ %d\n", ha->irq));
2549 2504
@@ -2570,24 +2525,6 @@ static irqreturn_t __gdth_interrupt(gdth_ha_str *ha,
2570 ++act_ints; 2525 ++act_ints;
2571#endif 2526#endif
2572 2527
2573#ifdef INT_COAL
2574 /* See if the fw is returning coalesced status */
2575 if (IStatus == COALINDEX) {
2576 /* Coalesced status. Setup the initial status
2577 buffer pointer and flags */
2578 pcs = ha->coal_stat;
2579 coalesced = TRUE;
2580 next = TRUE;
2581 }
2582
2583 do {
2584 if (coalesced) {
2585 /* For coalesced requests all status
2586 information is found in the status buffer */
2587 IStatus = (u8)(pcs->status & 0xff);
2588 }
2589#endif
2590
2591 if (ha->type == GDT_PCI) { 2528 if (ha->type == GDT_PCI) {
2592 dp6_ptr = ha->brd; 2529 dp6_ptr = ha->brd;
2593 if (IStatus & 0x80) { /* error flag */ 2530 if (IStatus & 0x80) { /* error flag */
@@ -2620,28 +2557,15 @@ static irqreturn_t __gdth_interrupt(gdth_ha_str *ha,
2620 dp6m_ptr = ha->brd; 2557 dp6m_ptr = ha->brd;
2621 if (IStatus & 0x80) { /* error flag */ 2558 if (IStatus & 0x80) { /* error flag */
2622 IStatus &= ~0x80; 2559 IStatus &= ~0x80;
2623#ifdef INT_COAL 2560 ha->status = readw(&dp6m_ptr->i960r.status);
2624 if (coalesced)
2625 ha->status = pcs->ext_status & 0xffff;
2626 else
2627#endif
2628 ha->status = readw(&dp6m_ptr->i960r.status);
2629 TRACE2(("gdth_interrupt() error %d/%d\n",IStatus,ha->status)); 2561 TRACE2(("gdth_interrupt() error %d/%d\n",IStatus,ha->status));
2630 } else /* no error */ 2562 } else /* no error */
2631 ha->status = S_OK; 2563 ha->status = S_OK;
2632#ifdef INT_COAL 2564
2633 /* get information */ 2565 ha->info = readl(&dp6m_ptr->i960r.info[0]);
2634 if (coalesced) { 2566 ha->service = readw(&dp6m_ptr->i960r.service);
2635 ha->info = pcs->info0; 2567 ha->info2 = readl(&dp6m_ptr->i960r.info[1]);
2636 ha->info2 = pcs->info1; 2568
2637 ha->service = (pcs->ext_status >> 16) & 0xffff;
2638 } else
2639#endif
2640 {
2641 ha->info = readl(&dp6m_ptr->i960r.info[0]);
2642 ha->service = readw(&dp6m_ptr->i960r.service);
2643 ha->info2 = readl(&dp6m_ptr->i960r.info[1]);
2644 }
2645 /* event string */ 2569 /* event string */
2646 if (IStatus == ASYNCINDEX) { 2570 if (IStatus == ASYNCINDEX) {
2647 if (ha->service != SCREENSERVICE && 2571 if (ha->service != SCREENSERVICE &&
@@ -2656,15 +2580,8 @@ static irqreturn_t __gdth_interrupt(gdth_ha_str *ha,
2656 } 2580 }
2657 } 2581 }
2658 } 2582 }
2659#ifdef INT_COAL 2583 writeb(0xff, &dp6m_ptr->i960r.edoor_reg);
2660 /* Make sure that non coalesced interrupts get cleared 2584 writeb(0, &dp6m_ptr->i960r.sema1_reg);
2661 before being handled by gdth_async_event/gdth_sync_event */
2662 if (!coalesced)
2663#endif
2664 {
2665 writeb(0xff, &dp6m_ptr->i960r.edoor_reg);
2666 writeb(0, &dp6m_ptr->i960r.sema1_reg);
2667 }
2668 } else { 2585 } else {
2669 TRACE2(("gdth_interrupt() unknown controller type\n")); 2586 TRACE2(("gdth_interrupt() unknown controller type\n"));
2670 if (!gdth_polling) 2587 if (!gdth_polling)
@@ -2727,31 +2644,6 @@ static irqreturn_t __gdth_interrupt(gdth_ha_str *ha,
2727 gdth_scsi_done(scp); 2644 gdth_scsi_done(scp);
2728 } 2645 }
2729 2646
2730#ifdef INT_COAL
2731 if (coalesced) {
2732 /* go to the next status in the status buffer */
2733 ++pcs;
2734#ifdef GDTH_STATISTICS
2735 ++act_int_coal;
2736 if (act_int_coal > max_int_coal) {
2737 max_int_coal = act_int_coal;
2738 printk("GDT: max_int_coal = %d\n",(u16)max_int_coal);
2739 }
2740#endif
2741 /* see if there is another status */
2742 if (pcs->status == 0)
2743 /* Stop the coalesce loop */
2744 next = FALSE;
2745 }
2746 } while (next);
2747
2748 /* coalescing only for new GDT_PCIMPR controllers available */
2749 if (ha->type == GDT_PCIMPR && coalesced) {
2750 writeb(0xff, &dp6m_ptr->i960r.edoor_reg);
2751 writeb(0, &dp6m_ptr->i960r.sema1_reg);
2752 }
2753#endif
2754
2755 gdth_next(ha); 2647 gdth_next(ha);
2756 return IRQ_HANDLED; 2648 return IRQ_HANDLED;
2757} 2649}
@@ -4264,15 +4156,6 @@ static int gdth_pci_probe_one(gdth_pci_str *pcistr, gdth_ha_str **ha_out)
4264 goto out_free_pscratch; 4156 goto out_free_pscratch;
4265 ha->msg_phys = scratch_dma_handle; 4157 ha->msg_phys = scratch_dma_handle;
4266 4158
4267#ifdef INT_COAL
4268 ha->coal_stat = pci_alloc_consistent(ha->pdev,
4269 sizeof(gdth_coal_status) * MAXOFFSETS,
4270 &scratch_dma_handle);
4271 if (!ha->coal_stat)
4272 goto out_free_pmsg;
4273 ha->coal_stat_phys = scratch_dma_handle;
4274#endif
4275
4276 ha->scratch_busy = FALSE; 4159 ha->scratch_busy = FALSE;
4277 ha->req_first = NULL; 4160 ha->req_first = NULL;
4278 ha->tid_cnt = pdev->device >= 0x200 ? MAXID : MAX_HDRIVES; 4161 ha->tid_cnt = pdev->device >= 0x200 ? MAXID : MAX_HDRIVES;
@@ -4285,7 +4168,7 @@ static int gdth_pci_probe_one(gdth_pci_str *pcistr, gdth_ha_str **ha_out)
4285 error = -ENODEV; 4168 error = -ENODEV;
4286 if (!gdth_search_drives(ha)) { 4169 if (!gdth_search_drives(ha)) {
4287 printk("GDT-PCI %d: Error during device scan\n", ha->hanum); 4170 printk("GDT-PCI %d: Error during device scan\n", ha->hanum);
4288 goto out_free_coal_stat; 4171 goto out_free_pmsg;
4289 } 4172 }
4290 4173
4291 if (hdr_channel < 0 || hdr_channel > ha->bus_cnt) 4174 if (hdr_channel < 0 || hdr_channel > ha->bus_cnt)
@@ -4298,7 +4181,7 @@ static int gdth_pci_probe_one(gdth_pci_str *pcistr, gdth_ha_str **ha_out)
4298 if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) { 4181 if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) {
4299 printk(KERN_WARNING "GDT-PCI %d: " 4182 printk(KERN_WARNING "GDT-PCI %d: "
4300 "Unable to set 32-bit DMA\n", ha->hanum); 4183 "Unable to set 32-bit DMA\n", ha->hanum);
4301 goto out_free_coal_stat; 4184 goto out_free_pmsg;
4302 } 4185 }
4303 } else { 4186 } else {
4304 shp->max_cmd_len = 16; 4187 shp->max_cmd_len = 16;
@@ -4307,7 +4190,7 @@ static int gdth_pci_probe_one(gdth_pci_str *pcistr, gdth_ha_str **ha_out)
4307 } else if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) { 4190 } else if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) {
4308 printk(KERN_WARNING "GDT-PCI %d: " 4191 printk(KERN_WARNING "GDT-PCI %d: "
4309 "Unable to set 64/32-bit DMA\n", ha->hanum); 4192 "Unable to set 64/32-bit DMA\n", ha->hanum);
4310 goto out_free_coal_stat; 4193 goto out_free_pmsg;
4311 } 4194 }
4312 } 4195 }
4313 4196
@@ -4320,7 +4203,7 @@ static int gdth_pci_probe_one(gdth_pci_str *pcistr, gdth_ha_str **ha_out)
4320 4203
4321 error = scsi_add_host(shp, &pdev->dev); 4204 error = scsi_add_host(shp, &pdev->dev);
4322 if (error) 4205 if (error)
4323 goto out_free_coal_stat; 4206 goto out_free_pmsg;
4324 list_add_tail(&ha->list, &gdth_instances); 4207 list_add_tail(&ha->list, &gdth_instances);
4325 4208
4326 pci_set_drvdata(ha->pdev, ha); 4209 pci_set_drvdata(ha->pdev, ha);
@@ -4332,12 +4215,7 @@ static int gdth_pci_probe_one(gdth_pci_str *pcistr, gdth_ha_str **ha_out)
4332 4215
4333 return 0; 4216 return 0;
4334 4217
4335 out_free_coal_stat:
4336#ifdef INT_COAL
4337 pci_free_consistent(ha->pdev, sizeof(gdth_coal_status) * MAXOFFSETS,
4338 ha->coal_stat, ha->coal_stat_phys);
4339 out_free_pmsg: 4218 out_free_pmsg:
4340#endif
4341 pci_free_consistent(ha->pdev, sizeof(gdth_msg_str), 4219 pci_free_consistent(ha->pdev, sizeof(gdth_msg_str),
4342 ha->pmsg, ha->msg_phys); 4220 ha->pmsg, ha->msg_phys);
4343 out_free_pscratch: 4221 out_free_pscratch:
@@ -4369,11 +4247,6 @@ static void gdth_remove_one(gdth_ha_str *ha)
4369 if (shp->irq) 4247 if (shp->irq)
4370 free_irq(shp->irq,ha); 4248 free_irq(shp->irq,ha);
4371 4249
4372#ifdef INT_COAL
4373 if (ha->coal_stat)
4374 pci_free_consistent(ha->pdev, sizeof(gdth_coal_status) *
4375 MAXOFFSETS, ha->coal_stat, ha->coal_stat_phys);
4376#endif
4377 if (ha->pscratch) 4250 if (ha->pscratch)
4378 pci_free_consistent(ha->pdev, GDTH_SCRATCH, 4251 pci_free_consistent(ha->pdev, GDTH_SCRATCH,
4379 ha->pscratch, ha->scratch_phys); 4252 ha->pscratch, ha->scratch_phys);