forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/drivers/scsi/ipr.c
....@@ -1,24 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * ipr.c -- driver for IBM Power Linux RAID adapters
34 *
45 * Written By: Brian King <brking@us.ibm.com>, IBM Corporation
56 *
67 * Copyright (C) 2003, 2004 IBM Corporation
7
- *
8
- * This program is free software; you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License as published by
10
- * the Free Software Foundation; either version 2 of the License, or
11
- * (at your option) any later version.
12
- *
13
- * This program is distributed in the hope that it will be useful,
14
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- * GNU General Public License for more details.
17
- *
18
- * You should have received a copy of the GNU General Public License
19
- * along with this program; if not, write to the Free Software
20
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
- *
228 */
239
2410 /*
....@@ -684,6 +670,7 @@
684670 /**
685671 * ipr_init_ipr_cmnd - Initialize an IPR Cmnd block
686672 * @ipr_cmd: ipr command struct
673
+ * @fast_done: fast done function call-back
687674 *
688675 * Return value:
689676 * none
....@@ -701,7 +688,7 @@
701688
702689 /**
703690 * __ipr_get_free_ipr_cmnd - Get a free IPR Cmnd block
704
- * @ioa_cfg: ioa config struct
691
+ * @hrrq: hrr queue
705692 *
706693 * Return value:
707694 * pointer to ipr command struct
....@@ -751,7 +738,6 @@
751738 static void ipr_mask_and_clear_interrupts(struct ipr_ioa_cfg *ioa_cfg,
752739 u32 clr_ints)
753740 {
754
- volatile u32 int_reg;
755741 int i;
756742
757743 /* Stop new interrupts */
....@@ -771,7 +757,7 @@
771757 if (ioa_cfg->sis64)
772758 writel(~0, ioa_cfg->regs.clr_interrupt_reg);
773759 writel(clr_ints, ioa_cfg->regs.clr_interrupt_reg32);
774
- int_reg = readl(ioa_cfg->regs.sense_interrupt_reg);
760
+ readl(ioa_cfg->regs.sense_interrupt_reg);
775761 }
776762
777763 /**
....@@ -1178,7 +1164,7 @@
11781164 default:
11791165 res->ata_class = ATA_DEV_UNKNOWN;
11801166 break;
1181
- };
1167
+ }
11821168 }
11831169
11841170 /**
....@@ -1301,7 +1287,7 @@
13011287 /**
13021288 * __ipr_format_res_path - Format the resource path for printing.
13031289 * @res_path: resource path
1304
- * @buf: buffer
1290
+ * @buffer: buffer
13051291 * @len: length of buffer provided
13061292 *
13071293 * Return value:
....@@ -1313,9 +1299,9 @@
13131299 char *p = buffer;
13141300
13151301 *p = '\0';
1316
- p += snprintf(p, buffer + len - p, "%02X", res_path[0]);
1302
+ p += scnprintf(p, buffer + len - p, "%02X", res_path[0]);
13171303 for (i = 1; res_path[i] != 0xff && ((i * 3) < len); i++)
1318
- p += snprintf(p, buffer + len - p, "-%02X", res_path[i]);
1304
+ p += scnprintf(p, buffer + len - p, "-%02X", res_path[i]);
13191305
13201306 return buffer;
13211307 }
....@@ -1324,7 +1310,7 @@
13241310 * ipr_format_res_path - Format the resource path for printing.
13251311 * @ioa_cfg: ioa config struct
13261312 * @res_path: resource path
1327
- * @buf: buffer
1313
+ * @buffer: buffer
13281314 * @len: length of buffer provided
13291315 *
13301316 * Return value:
....@@ -1336,7 +1322,7 @@
13361322 char *p = buffer;
13371323
13381324 *p = '\0';
1339
- p += snprintf(p, buffer + len - p, "%d/", ioa_cfg->host->host_no);
1325
+ p += scnprintf(p, buffer + len - p, "%d/", ioa_cfg->host->host_no);
13401326 __ipr_format_res_path(res_path, p, len - (buffer - p));
13411327 return buffer;
13421328 }
....@@ -1405,7 +1391,6 @@
14051391 * ipr_clear_res_target - Clear the bit in the bit map representing the target
14061392 * for the resource.
14071393 * @res: resource entry struct
1408
- * @cfgtew: config table entry wrapper struct
14091394 *
14101395 * Return value:
14111396 * none
....@@ -2681,7 +2666,7 @@
26812666
26822667 /**
26832668 * ipr_timeout - An internally generated op has timed out.
2684
- * @ipr_cmd: ipr command struct
2669
+ * @t: Timer context used to fetch ipr command struct
26852670 *
26862671 * This function blocks host requests and initiates an
26872672 * adapter reset.
....@@ -2714,7 +2699,7 @@
27142699
27152700 /**
27162701 * ipr_oper_timeout - Adapter timed out transitioning to operational
2717
- * @ipr_cmd: ipr command struct
2702
+ * @t: Timer context used to fetch ipr command struct
27182703 *
27192704 * This function blocks host requests and initiates an
27202705 * adapter reset.
....@@ -3498,6 +3483,7 @@
34983483 /**
34993484 * ipr_show_fw_version - Show the firmware version
35003485 * @dev: class device struct
3486
+ * @attr: device attribute (unused)
35013487 * @buf: buffer
35023488 *
35033489 * Return value:
....@@ -3532,6 +3518,7 @@
35323518 /**
35333519 * ipr_show_log_level - Show the adapter's error logging level
35343520 * @dev: class device struct
3521
+ * @attr: device attribute (unused)
35353522 * @buf: buffer
35363523 *
35373524 * Return value:
....@@ -3554,7 +3541,9 @@
35543541 /**
35553542 * ipr_store_log_level - Change the adapter's error logging level
35563543 * @dev: class device struct
3544
+ * @attr: device attribute (unused)
35573545 * @buf: buffer
3546
+ * @count: buffer size
35583547 *
35593548 * Return value:
35603549 * number of bytes printed to buffer
....@@ -3585,6 +3574,7 @@
35853574 /**
35863575 * ipr_store_diagnostics - IOA Diagnostics interface
35873576 * @dev: device struct
3577
+ * @attr: device attribute (unused)
35883578 * @buf: buffer
35893579 * @count: buffer size
35903580 *
....@@ -3645,7 +3635,8 @@
36453635
36463636 /**
36473637 * ipr_show_adapter_state - Show the adapter's state
3648
- * @class_dev: device struct
3638
+ * @dev: device struct
3639
+ * @attr: device attribute (unused)
36493640 * @buf: buffer
36503641 *
36513642 * Return value:
....@@ -3671,6 +3662,7 @@
36713662 /**
36723663 * ipr_store_adapter_state - Change adapter state
36733664 * @dev: device struct
3665
+ * @attr: device attribute (unused)
36743666 * @buf: buffer
36753667 * @count: buffer size
36763668 *
....@@ -3722,6 +3714,7 @@
37223714 /**
37233715 * ipr_store_reset_adapter - Reset the adapter
37243716 * @dev: device struct
3717
+ * @attr: device attribute (unused)
37253718 * @buf: buffer
37263719 * @count: buffer size
37273720 *
....@@ -3763,6 +3756,7 @@
37633756 /**
37643757 * ipr_show_iopoll_weight - Show ipr polling mode
37653758 * @dev: class device struct
3759
+ * @attr: device attribute (unused)
37663760 * @buf: buffer
37673761 *
37683762 * Return value:
....@@ -3786,7 +3780,9 @@
37863780 /**
37873781 * ipr_store_iopoll_weight - Change the adapter's polling mode
37883782 * @dev: class device struct
3783
+ * @attr: device attribute (unused)
37893784 * @buf: buffer
3785
+ * @count: buffer size
37903786 *
37913787 * Return value:
37923788 * number of bytes printed to buffer
....@@ -3885,7 +3881,7 @@
38853881
38863882 /**
38873883 * ipr_free_ucode_buffer - Frees a microcode download buffer
3888
- * @p_dnld: scatter/gather list pointer
3884
+ * @sglist: scatter/gather list pointer
38893885 *
38903886 * Free a DMA'able ucode download buffer previously allocated with
38913887 * ipr_alloc_ucode_buffer
....@@ -3915,22 +3911,23 @@
39153911 u8 *buffer, u32 len)
39163912 {
39173913 int bsize_elem, i, result = 0;
3918
- struct scatterlist *scatterlist;
3914
+ struct scatterlist *sg;
39193915 void *kaddr;
39203916
39213917 /* Determine the actual number of bytes per element */
39223918 bsize_elem = PAGE_SIZE * (1 << sglist->order);
39233919
3924
- scatterlist = sglist->scatterlist;
3920
+ sg = sglist->scatterlist;
39253921
3926
- for (i = 0; i < (len / bsize_elem); i++, buffer += bsize_elem) {
3927
- struct page *page = sg_page(&scatterlist[i]);
3922
+ for (i = 0; i < (len / bsize_elem); i++, sg = sg_next(sg),
3923
+ buffer += bsize_elem) {
3924
+ struct page *page = sg_page(sg);
39283925
39293926 kaddr = kmap(page);
39303927 memcpy(kaddr, buffer, bsize_elem);
39313928 kunmap(page);
39323929
3933
- scatterlist[i].length = bsize_elem;
3930
+ sg->length = bsize_elem;
39343931
39353932 if (result != 0) {
39363933 ipr_trace;
....@@ -3939,13 +3936,13 @@
39393936 }
39403937
39413938 if (len % bsize_elem) {
3942
- struct page *page = sg_page(&scatterlist[i]);
3939
+ struct page *page = sg_page(sg);
39433940
39443941 kaddr = kmap(page);
39453942 memcpy(kaddr, buffer, len % bsize_elem);
39463943 kunmap(page);
39473944
3948
- scatterlist[i].length = len % bsize_elem;
3945
+ sg->length = len % bsize_elem;
39493946 }
39503947
39513948 sglist->buffer_len = len;
....@@ -3966,6 +3963,7 @@
39663963 struct ipr_ioarcb *ioarcb = &ipr_cmd->ioarcb;
39673964 struct ipr_ioadl64_desc *ioadl64 = ipr_cmd->i.ioadl64;
39683965 struct scatterlist *scatterlist = sglist->scatterlist;
3966
+ struct scatterlist *sg;
39693967 int i;
39703968
39713969 ipr_cmd->dma_use_sg = sglist->num_dma_sg;
....@@ -3974,10 +3972,10 @@
39743972
39753973 ioarcb->ioadl_len =
39763974 cpu_to_be32(sizeof(struct ipr_ioadl64_desc) * ipr_cmd->dma_use_sg);
3977
- for (i = 0; i < ipr_cmd->dma_use_sg; i++) {
3975
+ for_each_sg(scatterlist, sg, ipr_cmd->dma_use_sg, i) {
39783976 ioadl64[i].flags = cpu_to_be32(IPR_IOADL_FLAGS_WRITE);
3979
- ioadl64[i].data_len = cpu_to_be32(sg_dma_len(&scatterlist[i]));
3980
- ioadl64[i].address = cpu_to_be64(sg_dma_address(&scatterlist[i]));
3977
+ ioadl64[i].data_len = cpu_to_be32(sg_dma_len(sg));
3978
+ ioadl64[i].address = cpu_to_be64(sg_dma_address(sg));
39813979 }
39823980
39833981 ioadl64[i-1].flags |= cpu_to_be32(IPR_IOADL_FLAGS_LAST);
....@@ -3997,6 +3995,7 @@
39973995 struct ipr_ioarcb *ioarcb = &ipr_cmd->ioarcb;
39983996 struct ipr_ioadl_desc *ioadl = ipr_cmd->i.ioadl;
39993997 struct scatterlist *scatterlist = sglist->scatterlist;
3998
+ struct scatterlist *sg;
40003999 int i;
40014000
40024001 ipr_cmd->dma_use_sg = sglist->num_dma_sg;
....@@ -4006,11 +4005,11 @@
40064005 ioarcb->ioadl_len =
40074006 cpu_to_be32(sizeof(struct ipr_ioadl_desc) * ipr_cmd->dma_use_sg);
40084007
4009
- for (i = 0; i < ipr_cmd->dma_use_sg; i++) {
4008
+ for_each_sg(scatterlist, sg, ipr_cmd->dma_use_sg, i) {
40104009 ioadl[i].flags_and_data_len =
4011
- cpu_to_be32(IPR_IOADL_FLAGS_WRITE | sg_dma_len(&scatterlist[i]));
4010
+ cpu_to_be32(IPR_IOADL_FLAGS_WRITE | sg_dma_len(sg));
40124011 ioadl[i].address =
4013
- cpu_to_be32(sg_dma_address(&scatterlist[i]));
4012
+ cpu_to_be32(sg_dma_address(sg));
40144013 }
40154014
40164015 ioadl[i-1].flags_and_data_len |=
....@@ -4070,7 +4069,8 @@
40704069
40714070 /**
40724071 * ipr_store_update_fw - Update the firmware on the adapter
4073
- * @class_dev: device struct
4072
+ * @dev: device struct
4073
+ * @attr: device attribute (unused)
40744074 * @buf: buffer
40754075 * @count: buffer size
40764076 *
....@@ -4150,6 +4150,7 @@
41504150 /**
41514151 * ipr_show_fw_type - Show the adapter's firmware type.
41524152 * @dev: class device struct
4153
+ * @attr: device attribute (unused)
41534154 * @buf: buffer
41544155 *
41554156 * Return value:
....@@ -4491,7 +4492,6 @@
44914492 * ipr_change_queue_depth - Change the device's queue depth
44924493 * @sdev: scsi device struct
44934494 * @qdepth: depth to set
4494
- * @reason: calling context
44954495 *
44964496 * Return value:
44974497 * actual depth set
....@@ -4661,6 +4661,7 @@
46614661 /**
46624662 * ipr_show_raw_mode - Show the adapter's raw mode
46634663 * @dev: class device struct
4664
+ * @attr: device attribute (unused)
46644665 * @buf: buffer
46654666 *
46664667 * Return value:
....@@ -4688,7 +4689,9 @@
46884689 /**
46894690 * ipr_store_raw_mode - Change the adapter's raw mode
46904691 * @dev: class device struct
4692
+ * @attr: device attribute (unused)
46914693 * @buf: buffer
4694
+ * @count: buffer size
46924695 *
46934696 * Return value:
46944697 * number of bytes printed to buffer
....@@ -5071,7 +5074,7 @@
50715074
50725075 /**
50735076 * ipr_cmnd_is_free - Check if a command is free or not
5074
- * @ipr_cmd ipr command struct
5077
+ * @ipr_cmd: ipr command struct
50755078 *
50765079 * Returns:
50775080 * true / false
....@@ -5107,7 +5110,7 @@
51075110
51085111 /**
51095112 * ipr_wait_for_ops - Wait for matching commands to complete
5110
- * @ipr_cmd: ipr command struct
5113
+ * @ioa_cfg: ioa config struct
51115114 * @device: device to match (sdev)
51125115 * @match: match function to use
51135116 *
....@@ -5272,6 +5275,7 @@
52725275 * ipr_sata_reset - Reset the SATA port
52735276 * @link: SATA link to reset
52745277 * @classes: class of the attached device
5278
+ * @deadline: unused
52755279 *
52765280 * This function issues a SATA phy reset to the affected ATA link.
52775281 *
....@@ -5451,7 +5455,7 @@
54515455
54525456 /**
54535457 * ipr_abort_timeout - An abort task has timed out
5454
- * @ipr_cmd: ipr command struct
5458
+ * @t: Timer context used to fetch ipr command struct
54555459 *
54565460 * This function handles when an abort task times out. If this
54575461 * happens we issue a bus reset since we have resources tied
....@@ -5505,7 +5509,7 @@
55055509 struct ipr_ioa_cfg *ioa_cfg;
55065510 struct ipr_resource_entry *res;
55075511 struct ipr_cmd_pkt *cmd_pkt;
5508
- u32 ioasc, int_reg;
5512
+ u32 ioasc;
55095513 int i, op_found = 0;
55105514 struct ipr_hrr_queue *hrrq;
55115515
....@@ -5528,7 +5532,7 @@
55285532 * by a still not detected EEH error. In such cases, reading a register will
55295533 * trigger the EEH recovery infrastructure.
55305534 */
5531
- int_reg = readl(ioa_cfg->regs.sense_interrupt_reg);
5535
+ readl(ioa_cfg->regs.sense_interrupt_reg);
55325536
55335537 if (!ipr_is_gscsi(res))
55345538 return FAILED;
....@@ -5580,7 +5584,8 @@
55805584
55815585 /**
55825586 * ipr_eh_abort - Abort a single op
5583
- * @scsi_cmd: scsi command struct
5587
+ * @shost: scsi host struct
5588
+ * @elapsed_time: elapsed time
55845589 *
55855590 * Return value:
55865591 * 0 if scan in progress / 1 if scan is complete
....@@ -5707,6 +5712,7 @@
57075712 * ipr_isr_eh - Interrupt service routine error handler
57085713 * @ioa_cfg: ioa config struct
57095714 * @msg: message to log
5715
+ * @number: various meanings depending on the caller/message
57105716 *
57115717 * Return value:
57125718 * none
....@@ -5773,7 +5779,6 @@
57735779
57745780 static int ipr_iopoll(struct irq_poll *iop, int budget)
57755781 {
5776
- struct ipr_ioa_cfg *ioa_cfg;
57775782 struct ipr_hrr_queue *hrrq;
57785783 struct ipr_cmnd *ipr_cmd, *temp;
57795784 unsigned long hrrq_flags;
....@@ -5781,7 +5786,6 @@
57815786 LIST_HEAD(doneq);
57825787
57835788 hrrq = container_of(iop, struct ipr_hrr_queue, iopoll);
5784
- ioa_cfg = hrrq->ioa_cfg;
57855789
57865790 spin_lock_irqsave(hrrq->lock, hrrq_flags);
57875791 completed_ops = ipr_process_hrrq(hrrq, budget, &doneq);
....@@ -6279,8 +6283,7 @@
62796283
62806284 /**
62816285 * ipr_gen_sense - Generate SCSI sense data from an IOASA
6282
- * @ioasa: IOASA
6283
- * @sense_buf: sense data buffer
6286
+ * @ipr_cmd: ipr command struct
62846287 *
62856288 * Return value:
62866289 * none
....@@ -6696,7 +6699,8 @@
66966699 * Return value:
66976700 * 0 on success / other on failure
66986701 **/
6699
-static int ipr_ioctl(struct scsi_device *sdev, int cmd, void __user *arg)
6702
+static int ipr_ioctl(struct scsi_device *sdev, unsigned int cmd,
6703
+ void __user *arg)
67006704 {
67016705 struct ipr_resource_entry *res;
67026706
....@@ -6712,7 +6716,7 @@
67126716
67136717 /**
67146718 * ipr_info - Get information about the card/driver
6715
- * @scsi_host: scsi host struct
6719
+ * @host: scsi host struct
67166720 *
67176721 * Return value:
67186722 * pointer to buffer with description string
....@@ -6737,7 +6741,11 @@
67376741 .name = "IPR",
67386742 .info = ipr_ioa_info,
67396743 .ioctl = ipr_ioctl,
6744
+#ifdef CONFIG_COMPAT
6745
+ .compat_ioctl = ipr_ioctl,
6746
+#endif
67406747 .queuecommand = ipr_queuecommand,
6748
+ .dma_need_drain = ata_scsi_dma_need_drain,
67416749 .eh_abort_handler = ipr_eh_abort,
67426750 .eh_device_reset_handler = ipr_eh_dev_reset,
67436751 .eh_host_reset_handler = ipr_eh_host_reset,
....@@ -6754,7 +6762,6 @@
67546762 .sg_tablesize = IPR_MAX_SGLIST,
67556763 .max_sectors = IPR_IOA_MAX_SECTORS,
67566764 .cmd_per_lun = IPR_MAX_CMD_PER_LUN,
6757
- .use_clustering = ENABLE_CLUSTERING,
67586765 .shost_attrs = ipr_ioa_attrs,
67596766 .sdev_attrs = ipr_dev_attrs,
67606767 .proc_name = IPR_NAME,
....@@ -7599,7 +7606,7 @@
75997606 /**
76007607 * ipr_build_mode_sense - Builds a mode sense command
76017608 * @ipr_cmd: ipr command struct
7602
- * @res: resource entry struct
7609
+ * @res_handle: resource entry struct
76037610 * @parm: Byte 2 of mode sense command
76047611 * @dma_addr: DMA address of mode sense buffer
76057612 * @xfer_len: Size of DMA buffer
....@@ -7946,6 +7953,7 @@
79467953 /**
79477954 * ipr_ioafp_set_caching_parameters - Issue Set Cache parameters service
79487955 * action
7956
+ * @ipr_cmd: ipr command struct
79497957 *
79507958 * Return value:
79517959 * none
....@@ -7982,6 +7990,10 @@
79827990 /**
79837991 * ipr_ioafp_inquiry - Send an Inquiry to the adapter.
79847992 * @ipr_cmd: ipr command struct
7993
+ * @flags: flags to send
7994
+ * @page: page to inquire
7995
+ * @dma_addr: DMA address
7996
+ * @xfer_len: transfer data length
79857997 *
79867998 * This utility function sends an inquiry to the adapter.
79877999 *
....@@ -8272,7 +8284,7 @@
82728284
82738285 /**
82748286 * ipr_reset_timer_done - Adapter reset timer function
8275
- * @ipr_cmd: ipr command struct
8287
+ * @t: Timer context used to fetch ipr command struct
82768288 *
82778289 * Description: This function is used in adapter reset processing
82788290 * for timing events. If the reset_cmd pointer in the IOA
....@@ -8666,7 +8678,6 @@
86668678 static int ipr_reset_restore_cfg_space(struct ipr_cmnd *ipr_cmd)
86678679 {
86688680 struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg;
8669
- u32 int_reg;
86708681
86718682 ENTER;
86728683 ioa_cfg->pdev->state_saved = true;
....@@ -8682,7 +8693,7 @@
86828693 if (ioa_cfg->sis64) {
86838694 /* Set the adapter to the correct endian mode. */
86848695 writel(IPR_ENDIAN_SWAP_KEY, ioa_cfg->regs.endian_swap_reg);
8685
- int_reg = readl(ioa_cfg->regs.endian_swap_reg);
8696
+ readl(ioa_cfg->regs.endian_swap_reg);
86868697 }
86878698
86888699 if (ioa_cfg->ioa_unit_checked) {
....@@ -9490,7 +9501,6 @@
94909501 * Description: This is the second phase of adapter initialization
94919502 * This function takes care of initilizing the adapter to the point
94929503 * where it can accept new commands.
9493
-
94949504 * Return value:
94959505 * 0 on success / -EIO on failure
94969506 **/
....@@ -9537,8 +9547,7 @@
95379547 }
95389548 }
95399549
9540
- if (ioa_cfg->ipr_cmd_pool)
9541
- dma_pool_destroy(ioa_cfg->ipr_cmd_pool);
9550
+ dma_pool_destroy(ioa_cfg->ipr_cmd_pool);
95429551
95439552 kfree(ioa_cfg->ipr_cmnd_list);
95449553 kfree(ioa_cfg->ipr_cmnd_list_dma);
....@@ -9605,7 +9614,7 @@
96059614
96069615 /**
96079616 * ipr_free_all_resources - Free all allocated resources for an adapter.
9608
- * @ipr_cmd: ipr command struct
9617
+ * @ioa_cfg: ioa config struct
96099618 *
96109619 * This function frees all allocated resources for the
96119620 * specified adapter.
....@@ -9783,7 +9792,7 @@
97839792 GFP_KERNEL);
97849793
97859794 if (!ioa_cfg->hrrq[i].host_rrq) {
9786
- while (--i > 0)
9795
+ while (--i >= 0)
97879796 dma_free_coherent(&pdev->dev,
97889797 sizeof(u32) * ioa_cfg->hrrq[i].size,
97899798 ioa_cfg->hrrq[i].host_rrq,
....@@ -10056,7 +10065,7 @@
1005610065 ioa_cfg->vectors_info[i].desc,
1005710066 &ioa_cfg->hrrq[i]);
1005810067 if (rc) {
10059
- while (--i >= 0)
10068
+ while (--i > 0)
1006010069 free_irq(pci_irq_vector(pdev, i),
1006110070 &ioa_cfg->hrrq[i]);
1006210071 return rc;
....@@ -10067,7 +10076,8 @@
1006710076
1006810077 /**
1006910078 * ipr_test_intr - Handle the interrupt generated in ipr_test_msi().
10070
- * @pdev: PCI device struct
10079
+ * @devp: PCI device struct
10080
+ * @irq: IRQ number
1007110081 *
1007210082 * Description: Simply set the msi_received flag to 1 indicating that
1007310083 * Message Signaled Interrupts are supported.
....@@ -10093,6 +10103,7 @@
1009310103
1009410104 /**
1009510105 * ipr_test_msi - Test for Message Signaled Interrupt (MSI) support.
10106
+ * @ioa_cfg: ioa config struct
1009610107 * @pdev: PCI device struct
1009710108 *
1009810109 * Description: This routine sets up and initiates a test interrupt to determine
....@@ -10105,7 +10116,6 @@
1010510116 static int ipr_test_msi(struct ipr_ioa_cfg *ioa_cfg, struct pci_dev *pdev)
1010610117 {
1010710118 int rc;
10108
- volatile u32 int_reg;
1010910119 unsigned long lock_flags = 0;
1011010120 int irq = pci_irq_vector(pdev, 0);
1011110121
....@@ -10116,7 +10126,7 @@
1011610126 ioa_cfg->msi_received = 0;
1011710127 ipr_mask_and_clear_interrupts(ioa_cfg, ~IPR_PCII_IOA_TRANS_TO_OPER);
1011810128 writel(IPR_PCII_IO_DEBUG_ACKNOWLEDGE, ioa_cfg->regs.clr_interrupt_mask_reg32);
10119
- int_reg = readl(ioa_cfg->regs.sense_interrupt_mask_reg);
10129
+ readl(ioa_cfg->regs.sense_interrupt_mask_reg);
1012010130 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
1012110131
1012210132 rc = request_irq(irq, ipr_test_intr, 0, IPR_NAME, ioa_cfg);
....@@ -10127,7 +10137,7 @@
1012710137 dev_info(&pdev->dev, "IRQ assigned: %d\n", irq);
1012810138
1012910139 writel(IPR_PCII_IO_DEBUG_ACKNOWLEDGE, ioa_cfg->regs.sense_interrupt_reg32);
10130
- int_reg = readl(ioa_cfg->regs.sense_interrupt_reg);
10140
+ readl(ioa_cfg->regs.sense_interrupt_reg);
1013110141 wait_event_timeout(ioa_cfg->msi_wait_q, ioa_cfg->msi_received, HZ);
1013210142 spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
1013310143 ipr_mask_and_clear_interrupts(ioa_cfg, ~IPR_PCII_IOA_TRANS_TO_OPER);
....@@ -10538,6 +10548,8 @@
1053810548
1053910549 /**
1054010550 * ipr_probe - Adapter hot plug add entry point
10551
+ * @pdev: pci device struct
10552
+ * @dev_id: pci device ID
1054110553 *
1054210554 * Return value:
1054310555 * 0 on success / non-zero on failure
....@@ -10794,6 +10806,7 @@
1079410806
1079510807 /**
1079610808 * ipr_halt_done - Shutdown prepare completion
10809
+ * @ipr_cmd: ipr command struct
1079710810 *
1079810811 * Return value:
1079910812 * none
....@@ -10805,6 +10818,9 @@
1080510818
1080610819 /**
1080710820 * ipr_halt - Issue shutdown prepare to all adapters
10821
+ * @nb: Notifier block
10822
+ * @event: Notifier event
10823
+ * @buf: Notifier data (unused)
1080810824 *
1080910825 * Return value:
1081010826 * NOTIFY_OK on success / NOTIFY_DONE on failure