diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2020-08-06 16:50:07 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2020-08-06 16:50:07 -0700 |
commit | dfdf16ecfd6abafc22b7f02364d9bb879ca8a5ee (patch) | |
tree | 634f3ddf9bacc60daddc01366a78420c9a86e66e /drivers/scsi/megaraid | |
parent | d7806bbd22cabc3e3b0a985cfcffa29cf156bb30 (diff) | |
parent | bf1a28f92a8b00ee8ce48cc11338980e31ddb7b3 (diff) | |
download | linux-dfdf16ecfd6abafc22b7f02364d9bb879ca8a5ee.tar.gz linux-dfdf16ecfd6abafc22b7f02364d9bb879ca8a5ee.tar.bz2 linux-dfdf16ecfd6abafc22b7f02364d9bb879ca8a5ee.zip |
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI updates from James Bottomley:
"This consists of the usual driver updates (ufs, qla2xxx, tcmu, lpfc,
hpsa, zfcp, scsi_debug) and minor bug fixes.
We also have a huge docbook fix update like most other subsystems and
no major update to the core (the few non trivial updates are either
minor fixes or removing an unused feature [scsi_sdb_cache])"
* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (307 commits)
scsi: scsi_transport_srp: Sanitize scsi_target_block/unblock sequences
scsi: ufs-mediatek: Apply DELAY_AFTER_LPM quirk to Micron devices
scsi: ufs: Introduce device quirk "DELAY_AFTER_LPM"
scsi: virtio-scsi: Correctly handle the case where all LUNs are unplugged
scsi: scsi_debug: Implement tur_ms_to_ready parameter
scsi: scsi_debug: Fix request sense
scsi: lpfc: Fix typo in comment for ULP
scsi: ufs-mediatek: Prevent LPM operation on undeclared VCC
scsi: iscsi: Do not put host in iscsi_set_flashnode_param()
scsi: hpsa: Correct ctrl queue depth
scsi: target: tcmu: Make TMR notification optional
scsi: target: tcmu: Implement tmr_notify callback
scsi: target: tcmu: Fix and simplify timeout handling
scsi: target: tcmu: Factor out new helper ring_insert_padding
scsi: target: tcmu: Do not queue aborted commands
scsi: target: tcmu: Use priv pointer in se_cmd
scsi: target: Add tmr_notify backend function
scsi: target: Modify core_tmr_abort_task()
scsi: target: iscsi: Fix inconsistent debug message
scsi: target: iscsi: Fix login error when receiving
...
Diffstat (limited to 'drivers/scsi/megaraid')
-rw-r--r-- | drivers/scsi/megaraid/megaraid_mbox.c | 4 | ||||
-rw-r--r-- | drivers/scsi/megaraid/megaraid_mm.c | 1 | ||||
-rw-r--r-- | drivers/scsi/megaraid/megaraid_sas.h | 20 | ||||
-rw-r--r-- | drivers/scsi/megaraid/megaraid_sas_base.c | 184 | ||||
-rw-r--r-- | drivers/scsi/megaraid/megaraid_sas_fp.c | 11 | ||||
-rw-r--r-- | drivers/scsi/megaraid/megaraid_sas_fusion.c | 93 |
6 files changed, 180 insertions, 133 deletions
diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c index 8f918df631bf..19469a2c0ea3 100644 --- a/drivers/scsi/megaraid/megaraid_mbox.c +++ b/drivers/scsi/megaraid/megaraid_mbox.c @@ -3304,7 +3304,6 @@ blocked_mailbox: * megaraid_mbox_display_scb - display SCB information, mostly debug purposes * @adapter : controller's soft state * @scb : SCB to be displayed - * @level : debug level for console print * * Diplay information about the given SCB iff the current debug level is * verbose. @@ -3972,7 +3971,8 @@ megaraid_sysfs_get_ldmap(adapter_t *adapter) /** * megaraid_sysfs_show_app_hndl - display application handle for this adapter - * @cdev : class device object representation for the host + * @dev : class device object representation for the host + * @attr : device attribute (unused) * @buf : buffer to send data to * * Display the handle used by the applications while executing management diff --git a/drivers/scsi/megaraid/megaraid_mm.c b/drivers/scsi/megaraid/megaraid_mm.c index e83163c66884..8df53446641a 100644 --- a/drivers/scsi/megaraid/megaraid_mm.c +++ b/drivers/scsi/megaraid/megaraid_mm.c @@ -95,7 +95,6 @@ mraid_mm_open(struct inode *inode, struct file *filep) /** * mraid_mm_ioctl - module entry-point for ioctls - * @inode : inode (ignored) * @filep : file operations pointer (ignored) * @cmd : ioctl command * @arg : user ioctl packet diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h index af2c7a2a9565..5e4137f10e0e 100644 --- a/drivers/scsi/megaraid/megaraid_sas.h +++ b/drivers/scsi/megaraid/megaraid_sas.h @@ -2709,4 +2709,24 @@ int megasas_adp_reset_wait_for_ready(struct megasas_instance *instance, int ocr_context); int megasas_irqpoll(struct irq_poll *irqpoll, int budget); void megasas_dump_fusion_io(struct scsi_cmnd *scmd); +u32 megasas_readl(struct megasas_instance *instance, + const volatile void __iomem *addr); +struct megasas_cmd *megasas_get_cmd(struct megasas_instance *instance); +void megasas_return_cmd(struct megasas_instance *instance, + struct megasas_cmd *cmd); +int megasas_issue_polled(struct megasas_instance *instance, + struct megasas_cmd *cmd); +void megaraid_sas_kill_hba(struct megasas_instance *instance); +void megasas_check_and_restore_queue_depth(struct megasas_instance *instance); +void megasas_start_timer(struct megasas_instance *instance); +int megasas_sriov_start_heartbeat(struct megasas_instance *instance, + int initial); +int megasas_alloc_cmds(struct megasas_instance *instance); +void megasas_free_cmds(struct megasas_instance *instance); + +void megasas_init_debugfs(void); +void megasas_exit_debugfs(void); +void megasas_setup_debugfs(struct megasas_instance *instance); +void megasas_destroy_debugfs(struct megasas_instance *instance); + #endif /*LSI_MEGARAID_SAS_H */ diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index 00668335c2af..861f7140f52e 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -202,10 +202,6 @@ static bool support_pci_lane_margining; static spinlock_t poll_aen_lock; extern struct dentry *megasas_debugfs_root; -extern void megasas_init_debugfs(void); -extern void megasas_exit_debugfs(void); -extern void megasas_setup_debugfs(struct megasas_instance *instance); -extern void megasas_destroy_debugfs(struct megasas_instance *instance); void megasas_complete_cmd(struct megasas_instance *instance, struct megasas_cmd *cmd, @@ -427,14 +423,14 @@ megasas_decode_evt(struct megasas_instance *instance) evt_detail->description); } -/** -* The following functions are defined for xscale -* (deviceid : 1064R, PERC5) controllers -*/ +/* + * The following functions are defined for xscale + * (deviceid : 1064R, PERC5) controllers + */ /** * megasas_enable_intr_xscale - Enables interrupts - * @regs: MFI register set + * @instance: Adapter soft state */ static inline void megasas_enable_intr_xscale(struct megasas_instance *instance) @@ -450,7 +446,7 @@ megasas_enable_intr_xscale(struct megasas_instance *instance) /** * megasas_disable_intr_xscale -Disables interrupt - * @regs: MFI register set + * @instance: Adapter soft state */ static inline void megasas_disable_intr_xscale(struct megasas_instance *instance) @@ -466,7 +462,7 @@ megasas_disable_intr_xscale(struct megasas_instance *instance) /** * megasas_read_fw_status_reg_xscale - returns the current FW status value - * @regs: MFI register set + * @instance: Adapter soft state */ static u32 megasas_read_fw_status_reg_xscale(struct megasas_instance *instance) @@ -475,7 +471,7 @@ megasas_read_fw_status_reg_xscale(struct megasas_instance *instance) } /** * megasas_clear_interrupt_xscale - Check & clear interrupt - * @regs: MFI register set + * @instance: Adapter soft state */ static int megasas_clear_intr_xscale(struct megasas_instance *instance) @@ -509,9 +505,10 @@ megasas_clear_intr_xscale(struct megasas_instance *instance) /** * megasas_fire_cmd_xscale - Sends command to the FW - * @frame_phys_addr : Physical address of cmd - * @frame_count : Number of frames for the command - * @regs : MFI register set + * @instance: Adapter soft state + * @frame_phys_addr : Physical address of cmd + * @frame_count : Number of frames for the command + * @regs : MFI register set */ static inline void megasas_fire_cmd_xscale(struct megasas_instance *instance, @@ -529,7 +526,8 @@ megasas_fire_cmd_xscale(struct megasas_instance *instance, /** * megasas_adp_reset_xscale - For controller reset - * @regs: MFI register set + * @instance: Adapter soft state + * @regs: MFI register set */ static int megasas_adp_reset_xscale(struct megasas_instance *instance, @@ -570,7 +568,8 @@ megasas_adp_reset_xscale(struct megasas_instance *instance, /** * megasas_check_reset_xscale - For controller reset check - * @regs: MFI register set + * @instance: Adapter soft state + * @regs: MFI register set */ static int megasas_check_reset_xscale(struct megasas_instance *instance, @@ -599,19 +598,19 @@ static struct megasas_instance_template megasas_instance_template_xscale = { .issue_dcmd = megasas_issue_dcmd, }; -/** -* This is the end of set of functions & definitions specific -* to xscale (deviceid : 1064R, PERC5) controllers -*/ +/* + * This is the end of set of functions & definitions specific + * to xscale (deviceid : 1064R, PERC5) controllers + */ -/** -* The following functions are defined for ppc (deviceid : 0x60) -* controllers -*/ +/* + * The following functions are defined for ppc (deviceid : 0x60) + * controllers + */ /** * megasas_enable_intr_ppc - Enables interrupts - * @regs: MFI register set + * @instance: Adapter soft state */ static inline void megasas_enable_intr_ppc(struct megasas_instance *instance) @@ -629,7 +628,7 @@ megasas_enable_intr_ppc(struct megasas_instance *instance) /** * megasas_disable_intr_ppc - Disable interrupt - * @regs: MFI register set + * @instance: Adapter soft state */ static inline void megasas_disable_intr_ppc(struct megasas_instance *instance) @@ -645,7 +644,7 @@ megasas_disable_intr_ppc(struct megasas_instance *instance) /** * megasas_read_fw_status_reg_ppc - returns the current FW status value - * @regs: MFI register set + * @instance: Adapter soft state */ static u32 megasas_read_fw_status_reg_ppc(struct megasas_instance *instance) @@ -655,7 +654,7 @@ megasas_read_fw_status_reg_ppc(struct megasas_instance *instance) /** * megasas_clear_interrupt_ppc - Check & clear interrupt - * @regs: MFI register set + * @instance: Adapter soft state */ static int megasas_clear_intr_ppc(struct megasas_instance *instance) @@ -688,9 +687,10 @@ megasas_clear_intr_ppc(struct megasas_instance *instance) /** * megasas_fire_cmd_ppc - Sends command to the FW - * @frame_phys_addr : Physical address of cmd - * @frame_count : Number of frames for the command - * @regs : MFI register set + * @instance: Adapter soft state + * @frame_phys_addr: Physical address of cmd + * @frame_count: Number of frames for the command + * @regs: MFI register set */ static inline void megasas_fire_cmd_ppc(struct megasas_instance *instance, @@ -708,7 +708,8 @@ megasas_fire_cmd_ppc(struct megasas_instance *instance, /** * megasas_check_reset_ppc - For controller reset check - * @regs: MFI register set + * @instance: Adapter soft state + * @regs: MFI register set */ static int megasas_check_reset_ppc(struct megasas_instance *instance, @@ -738,7 +739,7 @@ static struct megasas_instance_template megasas_instance_template_ppc = { /** * megasas_enable_intr_skinny - Enables interrupts - * @regs: MFI register set + * @instance: Adapter soft state */ static inline void megasas_enable_intr_skinny(struct megasas_instance *instance) @@ -756,7 +757,7 @@ megasas_enable_intr_skinny(struct megasas_instance *instance) /** * megasas_disable_intr_skinny - Disables interrupt - * @regs: MFI register set + * @instance: Adapter soft state */ static inline void megasas_disable_intr_skinny(struct megasas_instance *instance) @@ -772,7 +773,7 @@ megasas_disable_intr_skinny(struct megasas_instance *instance) /** * megasas_read_fw_status_reg_skinny - returns the current FW status value - * @regs: MFI register set + * @instance: Adapter soft state */ static u32 megasas_read_fw_status_reg_skinny(struct megasas_instance *instance) @@ -782,7 +783,7 @@ megasas_read_fw_status_reg_skinny(struct megasas_instance *instance) /** * megasas_clear_interrupt_skinny - Check & clear interrupt - * @regs: MFI register set + * @instance: Adapter soft state */ static int megasas_clear_intr_skinny(struct megasas_instance *instance) @@ -825,9 +826,10 @@ megasas_clear_intr_skinny(struct megasas_instance *instance) /** * megasas_fire_cmd_skinny - Sends command to the FW - * @frame_phys_addr : Physical address of cmd - * @frame_count : Number of frames for the command - * @regs : MFI register set + * @instance: Adapter soft state + * @frame_phys_addr: Physical address of cmd + * @frame_count: Number of frames for the command + * @regs: MFI register set */ static inline void megasas_fire_cmd_skinny(struct megasas_instance *instance, @@ -847,7 +849,8 @@ megasas_fire_cmd_skinny(struct megasas_instance *instance, /** * megasas_check_reset_skinny - For controller reset check - * @regs: MFI register set + * @instance: Adapter soft state + * @regs: MFI register set */ static int megasas_check_reset_skinny(struct megasas_instance *instance, @@ -876,14 +879,14 @@ static struct megasas_instance_template megasas_instance_template_skinny = { }; -/** -* The following functions are defined for gen2 (deviceid : 0x78 0x79) -* controllers -*/ +/* + * The following functions are defined for gen2 (deviceid : 0x78 0x79) + * controllers + */ /** * megasas_enable_intr_gen2 - Enables interrupts - * @regs: MFI register set + * @instance: Adapter soft state */ static inline void megasas_enable_intr_gen2(struct megasas_instance *instance) @@ -902,7 +905,7 @@ megasas_enable_intr_gen2(struct megasas_instance *instance) /** * megasas_disable_intr_gen2 - Disables interrupt - * @regs: MFI register set + * @instance: Adapter soft state */ static inline void megasas_disable_intr_gen2(struct megasas_instance *instance) @@ -918,7 +921,7 @@ megasas_disable_intr_gen2(struct megasas_instance *instance) /** * megasas_read_fw_status_reg_gen2 - returns the current FW status value - * @regs: MFI register set + * @instance: Adapter soft state */ static u32 megasas_read_fw_status_reg_gen2(struct megasas_instance *instance) @@ -928,7 +931,7 @@ megasas_read_fw_status_reg_gen2(struct megasas_instance *instance) /** * megasas_clear_interrupt_gen2 - Check & clear interrupt - * @regs: MFI register set + * @instance: Adapter soft state */ static int megasas_clear_intr_gen2(struct megasas_instance *instance) @@ -961,11 +964,13 @@ megasas_clear_intr_gen2(struct megasas_instance *instance) return mfiStatus; } + /** * megasas_fire_cmd_gen2 - Sends command to the FW - * @frame_phys_addr : Physical address of cmd - * @frame_count : Number of frames for the command - * @regs : MFI register set + * @instance: Adapter soft state + * @frame_phys_addr: Physical address of cmd + * @frame_count: Number of frames for the command + * @regs: MFI register set */ static inline void megasas_fire_cmd_gen2(struct megasas_instance *instance, @@ -983,7 +988,8 @@ megasas_fire_cmd_gen2(struct megasas_instance *instance, /** * megasas_adp_reset_gen2 - For controller reset - * @regs: MFI register set + * @instance: Adapter soft state + * @reg_set: MFI register set */ static int megasas_adp_reset_gen2(struct megasas_instance *instance, @@ -1043,7 +1049,8 @@ megasas_adp_reset_gen2(struct megasas_instance *instance, /** * megasas_check_reset_gen2 - For controller reset check - * @regs: MFI register set + * @instance: Adapter soft state + * @regs: MFI register set */ static int megasas_check_reset_gen2(struct megasas_instance *instance, @@ -1071,10 +1078,10 @@ static struct megasas_instance_template megasas_instance_template_gen2 = { .issue_dcmd = megasas_issue_dcmd, }; -/** -* This is the end of set of functions & definitions -* specific to gen2 (deviceid : 0x78, 0x79) controllers -*/ +/* + * This is the end of set of functions & definitions + * specific to gen2 (deviceid : 0x78, 0x79) controllers + */ /* * Template added for TB (Fusion) @@ -1609,7 +1616,7 @@ megasas_build_ldio(struct megasas_instance *instance, struct scsi_cmnd *scp, /** * megasas_cmd_type - Checks if the cmd is for logical drive/sysPD * and whether it's RW or non RW - * @scmd: SCSI command + * @cmd: SCSI command * */ inline int megasas_cmd_type(struct scsi_cmnd *cmd) @@ -1749,8 +1756,8 @@ out_return_cmd: /** * megasas_queue_command - Queue entry point + * @shost: adapter SCSI host * @scmd: SCSI command to be queued - * @done: Callback entry point */ static int megasas_queue_command(struct Scsi_Host *shost, struct scsi_cmnd *scmd) @@ -2916,11 +2923,7 @@ megasas_dump(void *buf, int sz, int format) /** * megasas_dump_reg_set - This function will print hexdump of register set - * @buf: Buffer to be dumped - * @sz: Size in bytes - * @format: Different formats of dumping e.g. format=n will - * cause only 'n' 32 bit words to be dumped in a - * single line. + * @reg_set: Register set to be dumped */ inline void megasas_dump_reg_set(void __iomem *reg_set) @@ -2997,6 +3000,7 @@ megasas_dump_sys_regs(void __iomem *reg_set, char *buf) /** * megasas_reset_bus_host - Bus & host reset handler entry point + * @scmd: Mid-layer SCSI command */ static int megasas_reset_bus_host(struct scsi_cmnd *scmd) { @@ -3777,7 +3781,7 @@ megasas_issue_pending_cmds_again(struct megasas_instance *instance) megasas_register_aen(instance, seq_num, class_locale.word); } -/** +/* * Move the internal reset pending commands to a deferred queue. * * We move the commands pending at internal reset time to a @@ -3785,7 +3789,7 @@ megasas_issue_pending_cmds_again(struct megasas_instance *instance) * completion of the internal reset sequence. if the internal reset * did not complete in time, the kernel reset handler would flush * these commands. - **/ + */ static void megasas_internal_reset_defer_cmds(struct megasas_instance *instance) { @@ -3963,8 +3967,11 @@ megasas_deplete_reply_queue(struct megasas_instance *instance, tasklet_schedule(&instance->isr_tasklet); return IRQ_HANDLED; } + /** * megasas_isr - isr entry point + * @irq: IRQ number + * @devp: IRQ context address */ static irqreturn_t megasas_isr(int irq, void *devp) { @@ -3986,6 +3993,7 @@ static irqreturn_t megasas_isr(int irq, void *devp) /** * megasas_transition_to_ready - Move the FW to READY state * @instance: Adapter soft state + * @ocr: Adapter reset state * * During the initialization, FW passes can potentially be in any one of * several possible states. If the FW in operational, waiting-for-handshake @@ -4743,7 +4751,7 @@ megasas_get_ld_list(struct megasas_instance *instance) /** * megasas_ld_list_query - Returns FW's ld_list structure * @instance: Adapter soft state - * @ld_list: ld_list structure + * @query_type: ld_list structure type * * Issues an internal command (DCMD) to get the FW's controller PD * list structure. This information is mainly used to find out SYSTEM @@ -5602,9 +5610,13 @@ megasas_setup_irqs_msix(struct megasas_instance *instance, u8 is_probe) &instance->irq_context[i])) { dev_err(&instance->pdev->dev, "Failed to register IRQ for vector %d.\n", i); - for (j = 0; j < i; j++) + for (j = 0; j < i; j++) { + if (j < instance->low_latency_index_start) + irq_set_affinity_hint( + pci_irq_vector(pdev, j), NULL); free_irq(pci_irq_vector(pdev, j), &instance->irq_context[j]); + } /* Retry irq register for IO_APIC*/ instance->msix_vectors = 0; instance->msix_load_balance = false; @@ -5642,6 +5654,9 @@ megasas_destroy_irqs(struct megasas_instance *instance) { if (instance->msix_vectors) for (i = 0; i < instance->msix_vectors; i++) { + if (i < instance->low_latency_index_start) + irq_set_affinity_hint( + pci_irq_vector(instance->pdev, i), NULL); free_irq(pci_irq_vector(instance->pdev, i), &instance->irq_context[i]); } @@ -5653,7 +5668,6 @@ megasas_destroy_irqs(struct megasas_instance *instance) { /** * megasas_setup_jbod_map - setup jbod map for FP seq_number. * @instance: Adapter soft state - * @is_probe: Driver probe check * * Return 0 on success. */ @@ -6494,7 +6508,7 @@ dcmd_failed: * megasas_register_aen - Registers for asynchronous event notification * @instance: Adapter soft state * @seq_num: The starting sequence number - * @class_locale: Class of the event + * @class_locale_word: Class of the event * * This function subscribes for AEN for events beyond the @seq_num. It requests * to be notified if and only if the event is of type @class_locale @@ -7014,8 +7028,9 @@ static inline void megasas_free_ctrl_mem(struct megasas_instance *instance) * megasas_alloc_ctrl_dma_buffers - Allocate consistent DMA buffers during * driver load time * - * @instance- Adapter soft instance - * @return- O for SUCCESS + * @instance: Adapter soft instance + * + * @return: O for SUCCESS */ static inline int megasas_alloc_ctrl_dma_buffers(struct megasas_instance *instance) @@ -7931,7 +7946,7 @@ skip_firing_dcmds: /** * megasas_shutdown - Shutdown entry point - * @device: Generic device structure + * @pdev: Generic device structure */ static void megasas_shutdown(struct pci_dev *pdev) { @@ -7956,8 +7971,10 @@ skip_firing_dcmds: pci_free_irq_vectors(instance->pdev); } -/** +/* * megasas_mgmt_open - char node "open" entry point + * @inode: char node inode + * @filep: char node file */ static int megasas_mgmt_open(struct inode *inode, struct file *filep) { @@ -7970,8 +7987,11 @@ static int megasas_mgmt_open(struct inode *inode, struct file *filep) return 0; } -/** +/* * megasas_mgmt_fasync - Async notifier registration from applications + * @fd: char node file descriptor number + * @filep: char node file + * @mode: notifier on/off * * This function adds the calling process to a driver global queue. When an * event occurs, SIGIO will be sent to all processes in this queue. @@ -7997,9 +8017,11 @@ static int megasas_mgmt_fasync(int fd, struct file *filep, int mode) return rc; } -/** +/* * megasas_mgmt_poll - char node "poll" entry point - * */ + * @filep: char node file + * @wait: Events to poll for + */ static __poll_t megasas_mgmt_poll(struct file *file, poll_table *wait) { __poll_t mask; @@ -8057,7 +8079,8 @@ static int megasas_set_crash_dump_params_ioctl(struct megasas_cmd *cmd) /** * megasas_mgmt_fw_ioctl - Issues management ioctls to FW * @instance: Adapter soft state - * @argp: User's ioctl packet + * @user_ioc: User's ioctl packet + * @ioc: ioctl packet */ static int megasas_mgmt_fw_ioctl(struct megasas_instance *instance, @@ -8397,6 +8420,9 @@ static int megasas_mgmt_ioctl_aen(struct file *file, unsigned long arg) /** * megasas_mgmt_ioctl - char node ioctl entry point + * @file: char device file pointer + * @cmd: ioctl command + * @arg: ioctl command arguments address */ static long megasas_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg) diff --git a/drivers/scsi/megaraid/megaraid_sas_fp.c b/drivers/scsi/megaraid/megaraid_sas_fp.c index 3b3d04d7671f..b6c08d620033 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fp.c +++ b/drivers/scsi/megaraid/megaraid_sas_fp.c @@ -80,21 +80,20 @@ u32 mega_mod64(u64 dividend, u32 divisor) } /** - * @param dividend : Dividend - * @param divisor : Divisor + * mega_div64_32 - Do a 64-bit division + * @dividend: Dividend + * @divisor: Divisor * * @return quotient **/ static u64 mega_div64_32(uint64_t dividend, uint32_t divisor) { - u32 remainder; - u64 d; + u64 d = dividend; if (!divisor) printk(KERN_ERR "megasas : DIVISOR is zero in mod fn\n"); - d = dividend; - remainder = do_div(d, divisor); + do_div(d, divisor); return d; } diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index fcf03f733e41..0824410f78f8 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -48,9 +48,6 @@ #include "megaraid_sas.h" -extern void megasas_free_cmds(struct megasas_instance *instance); -extern struct megasas_cmd *megasas_get_cmd(struct megasas_instance - *instance); extern void megasas_complete_cmd(struct megasas_instance *instance, struct megasas_cmd *cmd, u8 alt_status); @@ -58,24 +55,14 @@ int wait_and_poll(struct megasas_instance *instance, struct megasas_cmd *cmd, int seconds); -void -megasas_return_cmd(struct megasas_instance *instance, struct megasas_cmd *cmd); -int megasas_alloc_cmds(struct megasas_instance *instance); int megasas_clear_intr_fusion(struct megasas_instance *instance); -int -megasas_issue_polled(struct megasas_instance *instance, - struct megasas_cmd *cmd); -void -megasas_check_and_restore_queue_depth(struct megasas_instance *instance); int megasas_transition_to_ready(struct megasas_instance *instance, int ocr); -void megaraid_sas_kill_hba(struct megasas_instance *instance); extern u32 megasas_dbg_lvl; int megasas_sriov_start_heartbeat(struct megasas_instance *instance, int initial); -void megasas_start_timer(struct megasas_instance *instance); extern struct megasas_mgmt_info megasas_mgmt_info; extern unsigned int resetwaittime; extern unsigned int dual_qdepth_disable; @@ -84,15 +71,13 @@ static void megasas_free_reply_fusion(struct megasas_instance *instance); static inline void megasas_configure_queue_sizes(struct megasas_instance *instance); static void megasas_fusion_crash_dump(struct megasas_instance *instance); -extern u32 megasas_readl(struct megasas_instance *instance, - const volatile void __iomem *addr); /** * megasas_adp_reset_wait_for_ready - initiate chip reset and wait for * controller to come to ready state - * @instance - adapter's soft state - * @do_adp_reset - If true, do a chip reset - * @ocr_context - If called from OCR context this will + * @instance: adapter's soft state + * @do_adp_reset: If true, do a chip reset + * @ocr_context: If called from OCR context this will * be set to 1, else 0 * * This function initates a chip reset followed by a wait for controller to @@ -146,10 +131,10 @@ out: /** * megasas_check_same_4gb_region - check if allocation * crosses same 4GB boundary or not - * @instance - adapter's soft instance - * start_addr - start address of DMA allocation - * size - size of allocation in bytes - * return - true : allocation does not cross same + * @instance: adapter's soft instance + * @start_addr: start address of DMA allocation + * @size: size of allocation in bytes + * @return: true : allocation does not cross same * 4GB boundary * false: allocation crosses same * 4GB boundary @@ -174,7 +159,7 @@ static inline bool megasas_check_same_4gb_region /** * megasas_enable_intr_fusion - Enables interrupts - * @regs: MFI register set + * @instance: adapter's soft instance */ static void megasas_enable_intr_fusion(struct megasas_instance *instance) @@ -196,7 +181,7 @@ megasas_enable_intr_fusion(struct megasas_instance *instance) /** * megasas_disable_intr_fusion - Disables interrupt - * @regs: MFI register set + * @instance: adapter's soft instance */ static void megasas_disable_intr_fusion(struct megasas_instance *instance) @@ -238,6 +223,7 @@ megasas_clear_intr_fusion(struct megasas_instance *instance) /** * megasas_get_cmd_fusion - Get a command from the free pool * @instance: Adapter soft state + * @blk_tag: Command tag * * Returns a blk_tag indexed mpt frame */ @@ -309,8 +295,8 @@ megasas_fire_cmd_fusion(struct megasas_instance *instance, /** * megasas_fusion_update_can_queue - Do all Adapter Queue depth related calculations here - * @instance: Adapter soft state - * fw_boot_context: Whether this function called during probe or after OCR + * @instance: Adapter soft state + * @fw_boot_context: Whether this function called during probe or after OCR * * This function is only for fusion controllers. * Update host can queue, if firmware downgrade max supported firmware commands. @@ -1016,6 +1002,7 @@ fail_exit: * wait_and_poll - Issues a polling command * @instance: Adapter soft state * @cmd: Command packet to be issued + * @seconds: Maximum poll time * * For polling, MFI requires the cmd_status to be set to 0xFF before posting. */ @@ -1906,6 +1893,7 @@ fail_alloc_mfi_cmds: /** * megasas_fault_detect_work - Worker function of * FW fault handling workqueue. + * @work: FW fault work struct */ static void megasas_fault_detect_work(struct work_struct *work) @@ -1989,11 +1977,13 @@ megasas_fusion_stop_watchdog(struct megasas_instance *instance) /** * map_cmd_status - Maps FW cmd status to OS cmd status - * @cmd : Pointer to cmd - * @status : status of cmd returned by FW - * @ext_status : ext status of cmd returned by FW + * @fusion: fusion context + * @scmd: Pointer to cmd + * @status: status of cmd returned by FW + * @ext_status: ext status of cmd returned by FW + * @data_length: command data length + * @sense: command sense data */ - static void map_cmd_status(struct fusion_context *fusion, struct scsi_cmnd *scmd, u8 status, u8 ext_status, @@ -2234,7 +2224,7 @@ megasas_make_prp_nvme(struct megasas_instance *instance, struct scsi_cmnd *scmd, * @scp: SCSI command from the mid-layer * @sgl_ptr: SGL to be filled in * @cmd: cmd we are working on - * @sge_count sge count + * @sge_count: sge count * */ static void @@ -2343,9 +2333,12 @@ int megasas_make_sgl(struct megasas_instance *instance, struct scsi_cmnd *scp, /** * megasas_set_pd_lba - Sets PD LBA - * @cdb: CDB + * @io_request: IO request * @cdb_len: cdb length - * @start_blk: Start block of IO + * @io_info: IO information + * @scp: SCSI command + * @local_map_ptr: Raid map + * @ref_tag: Primary reference tag * * Used to set the PD LBA in CDB for FP IOs */ @@ -2603,10 +2596,12 @@ static void megasas_stream_detect(struct megasas_instance *instance, * affinity (cpu of the controller) and raid_flags in the raid context * based on IO type. * + * @fusion: Fusion context * @praid_context: IO RAID context * @raid: LD raid map * @fp_possible: Is fast path possible? * @is_read: Is read IO? + * @scsi_buff_len: SCSI command buffer length * */ static void @@ -2940,7 +2935,7 @@ megasas_build_ldio_fusion(struct megasas_instance *instance, /** * megasas_build_ld_nonrw_fusion - prepares non rw ios for virtual disk * @instance: Adapter soft state - * @scp: SCSI command + * @scmd: SCSI command * @cmd: Command to be prepared * * Prepares the io_request frame for non-rw io cmds for vd. @@ -3028,7 +3023,7 @@ static void megasas_build_ld_nonrw_fusion(struct megasas_instance *instance, /** * megasas_build_syspd_fusion - prepares rw/non-rw ios for syspd * @instance: Adapter soft state - * @scp: SCSI command + * @scmd: SCSI command * @cmd: Command to be prepared * @fp_possible: parameter to detect fast path or firmware path io. * @@ -3405,7 +3400,7 @@ megasas_build_and_issue_cmd_fusion(struct megasas_instance *instance, * megasas_complete_r1_command - * completes R1 FP write commands which has valid peer smid * @instance: Adapter soft state - * @cmd_fusion: MPT command frame + * @cmd: MPT command frame * */ static inline void @@ -3459,6 +3454,9 @@ megasas_complete_r1_command(struct megasas_instance *instance, /** * complete_cmd_fusion - Completes command * @instance: Adapter soft state + * @MSIxIndex: MSI number + * @irq_context: IRQ context + * * Completes all commands that is in reply descriptor queue */ static int @@ -3634,6 +3632,7 @@ complete_cmd_fusion(struct megasas_instance *instance, u32 MSIxIndex, /** * megasas_enable_irq_poll() - enable irqpoll + * @instance: Adapter soft state */ static void megasas_enable_irq_poll(struct megasas_instance *instance) { @@ -3650,7 +3649,7 @@ static void megasas_enable_irq_poll(struct megasas_instance *instance) /** * megasas_sync_irqs - Synchronizes all IRQs owned by adapter - * @instance: Adapter soft state + * @instance_addr: Adapter soft state address */ static void megasas_sync_irqs(unsigned long instance_addr) { @@ -3706,7 +3705,7 @@ int megasas_irqpoll(struct irq_poll *irqpoll, int budget) /** * megasas_complete_cmd_dpc_fusion - Completes command - * @instance: Adapter soft state + * @instance_addr: Adapter soft state address * * Tasklet to complete cmds */ @@ -3729,6 +3728,8 @@ megasas_complete_cmd_dpc_fusion(unsigned long instance_addr) /** * megasas_isr_fusion - isr entry point + * @irq: IRQ number + * @devp: IRQ context */ static irqreturn_t megasas_isr_fusion(int irq, void *devp) { @@ -3761,7 +3762,7 @@ static irqreturn_t megasas_isr_fusion(int irq, void *devp) /** * build_mpt_mfi_pass_thru - builds a cmd fo MFI Pass thru * @instance: Adapter soft state - * mfi_cmd: megasas_cmd pointer + * @mfi_cmd: megasas_cmd pointer * */ static void @@ -3878,7 +3879,7 @@ megasas_release_fusion(struct megasas_instance *instance) /** * megasas_read_fw_status_reg_fusion - returns the current FW status value - * @regs: MFI register set + * @instance: Adapter soft state */ static u32 megasas_read_fw_status_reg_fusion(struct megasas_instance *instance) @@ -3889,7 +3890,7 @@ megasas_read_fw_status_reg_fusion(struct megasas_instance *instance) /** * megasas_alloc_host_crash_buffer - Host buffers for Crash dump collection from Firmware * @instance: Controller's soft instance - * return: Number of allocated host crash buffers + * @return: Number of allocated host crash buffers */ static void megasas_alloc_host_crash_buffer(struct megasas_instance *instance) @@ -3927,6 +3928,7 @@ megasas_free_host_crash_buffer(struct megasas_instance *instance) /** * megasas_adp_reset_fusion - For controller reset + * @instance: Controller's soft instance * @regs: MFI register set */ static int @@ -4004,6 +4006,7 @@ megasas_adp_reset_fusion(struct megasas_instance *instance, /** * megasas_check_reset_fusion - For controller reset check + * @instance: Controller's soft instance * @regs: MFI register set */ static int @@ -4333,8 +4336,8 @@ static int megasas_track_scsiio(struct megasas_instance *instance, /** * megasas_tm_response_code - translation of device response code - * @ioc: per adapter object - * @mpi_reply: MPI reply returned by firmware + * @instance: Controller's soft instance + * @mpi_reply: MPI reply returned by firmware * * Return nothing. */ @@ -4389,9 +4392,9 @@ megasas_tm_response_code(struct megasas_instance *instance, * @device_handle: device handle * @channel: the channel assigned by the OS * @id: the id assigned by the OS - * @type: MPI2_SCSITASKMGMT_TASKTYPE__XXX (defined in megaraid_sas_fusion.c) * @smid_task: smid assigned to the task - * @m_type: TM_MUTEX_ON or TM_MUTEX_OFF + * @type: MPI2_SCSITASKMGMT_TASKTYPE__XXX (defined in megaraid_sas_fusion.c) + * @mr_device_priv_data: private data * Context: user * * MegaRaid use MPT interface for Task Magement request. |