Commit da0dc9fb authored by Bjorn Helgaas's avatar Bjorn Helgaas Committed by James Bottomley

megaraid_sas: fix whitespace errors

Fix whitespace and indentation errors.  No code change.

[jejb: checkpatch fixes]
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Acked-by: default avatarSumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Odin.com>
parent 1be18254
...@@ -273,6 +273,7 @@ static inline void ...@@ -273,6 +273,7 @@ static inline void
megasas_enable_intr_xscale(struct megasas_instance *instance) megasas_enable_intr_xscale(struct megasas_instance *instance)
{ {
struct megasas_register_set __iomem *regs; struct megasas_register_set __iomem *regs;
regs = instance->reg_set; regs = instance->reg_set;
writel(0, &(regs)->outbound_intr_mask); writel(0, &(regs)->outbound_intr_mask);
...@@ -289,6 +290,7 @@ megasas_disable_intr_xscale(struct megasas_instance *instance) ...@@ -289,6 +290,7 @@ megasas_disable_intr_xscale(struct megasas_instance *instance)
{ {
struct megasas_register_set __iomem *regs; struct megasas_register_set __iomem *regs;
u32 mask = 0x1f; u32 mask = 0x1f;
regs = instance->reg_set; regs = instance->reg_set;
writel(mask, &regs->outbound_intr_mask); writel(mask, &regs->outbound_intr_mask);
/* Dummy readl to force pci flush */ /* Dummy readl to force pci flush */
...@@ -313,6 +315,7 @@ megasas_clear_intr_xscale(struct megasas_register_set __iomem * regs) ...@@ -313,6 +315,7 @@ megasas_clear_intr_xscale(struct megasas_register_set __iomem * regs)
{ {
u32 status; u32 status;
u32 mfiStatus = 0; u32 mfiStatus = 0;
/* /*
* Check if it is our interrupt * Check if it is our interrupt
*/ */
...@@ -348,6 +351,7 @@ megasas_fire_cmd_xscale(struct megasas_instance *instance, ...@@ -348,6 +351,7 @@ megasas_fire_cmd_xscale(struct megasas_instance *instance,
struct megasas_register_set __iomem *regs) struct megasas_register_set __iomem *regs)
{ {
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&instance->hba_lock, flags); spin_lock_irqsave(&instance->hba_lock, flags);
writel((frame_phys_addr >> 3)|(frame_count), writel((frame_phys_addr >> 3)|(frame_count),
&(regs)->inbound_queue_port); &(regs)->inbound_queue_port);
...@@ -364,6 +368,7 @@ megasas_adp_reset_xscale(struct megasas_instance *instance, ...@@ -364,6 +368,7 @@ megasas_adp_reset_xscale(struct megasas_instance *instance,
{ {
u32 i; u32 i;
u32 pcidata; u32 pcidata;
writel(MFI_ADP_RESET, &regs->inbound_doorbell); writel(MFI_ADP_RESET, &regs->inbound_doorbell);
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
...@@ -402,7 +407,6 @@ static int ...@@ -402,7 +407,6 @@ static int
megasas_check_reset_xscale(struct megasas_instance *instance, megasas_check_reset_xscale(struct megasas_instance *instance,
struct megasas_register_set __iomem *regs) struct megasas_register_set __iomem *regs)
{ {
if ((instance->adprecovery != MEGASAS_HBA_OPERATIONAL) && if ((instance->adprecovery != MEGASAS_HBA_OPERATIONAL) &&
(le32_to_cpu(*instance->consumer) == (le32_to_cpu(*instance->consumer) ==
MEGASAS_ADPRESET_INPROG_SIGN)) MEGASAS_ADPRESET_INPROG_SIGN))
...@@ -444,6 +448,7 @@ static inline void ...@@ -444,6 +448,7 @@ static inline void
megasas_enable_intr_ppc(struct megasas_instance *instance) megasas_enable_intr_ppc(struct megasas_instance *instance)
{ {
struct megasas_register_set __iomem *regs; struct megasas_register_set __iomem *regs;
regs = instance->reg_set; regs = instance->reg_set;
writel(0xFFFFFFFF, &(regs)->outbound_doorbell_clear); writel(0xFFFFFFFF, &(regs)->outbound_doorbell_clear);
...@@ -462,6 +467,7 @@ megasas_disable_intr_ppc(struct megasas_instance *instance) ...@@ -462,6 +467,7 @@ megasas_disable_intr_ppc(struct megasas_instance *instance)
{ {
struct megasas_register_set __iomem *regs; struct megasas_register_set __iomem *regs;
u32 mask = 0xFFFFFFFF; u32 mask = 0xFFFFFFFF;
regs = instance->reg_set; regs = instance->reg_set;
writel(mask, &regs->outbound_intr_mask); writel(mask, &regs->outbound_intr_mask);
/* Dummy readl to force pci flush */ /* Dummy readl to force pci flush */
...@@ -522,6 +528,7 @@ megasas_fire_cmd_ppc(struct megasas_instance *instance, ...@@ -522,6 +528,7 @@ megasas_fire_cmd_ppc(struct megasas_instance *instance,
struct megasas_register_set __iomem *regs) struct megasas_register_set __iomem *regs)
{ {
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&instance->hba_lock, flags); spin_lock_irqsave(&instance->hba_lock, flags);
writel((frame_phys_addr | (frame_count<<1))|1, writel((frame_phys_addr | (frame_count<<1))|1,
&(regs)->inbound_queue_port); &(regs)->inbound_queue_port);
...@@ -566,6 +573,7 @@ static inline void ...@@ -566,6 +573,7 @@ static inline void
megasas_enable_intr_skinny(struct megasas_instance *instance) megasas_enable_intr_skinny(struct megasas_instance *instance)
{ {
struct megasas_register_set __iomem *regs; struct megasas_register_set __iomem *regs;
regs = instance->reg_set; regs = instance->reg_set;
writel(0xFFFFFFFF, &(regs)->outbound_intr_mask); writel(0xFFFFFFFF, &(regs)->outbound_intr_mask);
...@@ -584,6 +592,7 @@ megasas_disable_intr_skinny(struct megasas_instance *instance) ...@@ -584,6 +592,7 @@ megasas_disable_intr_skinny(struct megasas_instance *instance)
{ {
struct megasas_register_set __iomem *regs; struct megasas_register_set __iomem *regs;
u32 mask = 0xFFFFFFFF; u32 mask = 0xFFFFFFFF;
regs = instance->reg_set; regs = instance->reg_set;
writel(mask, &regs->outbound_intr_mask); writel(mask, &regs->outbound_intr_mask);
/* Dummy readl to force pci flush */ /* Dummy readl to force pci flush */
...@@ -654,6 +663,7 @@ megasas_fire_cmd_skinny(struct megasas_instance *instance, ...@@ -654,6 +663,7 @@ megasas_fire_cmd_skinny(struct megasas_instance *instance,
struct megasas_register_set __iomem *regs) struct megasas_register_set __iomem *regs)
{ {
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&instance->hba_lock, flags); spin_lock_irqsave(&instance->hba_lock, flags);
writel(upper_32_bits(frame_phys_addr), writel(upper_32_bits(frame_phys_addr),
&(regs)->inbound_high_queue_port); &(regs)->inbound_high_queue_port);
...@@ -706,6 +716,7 @@ static inline void ...@@ -706,6 +716,7 @@ static inline void
megasas_enable_intr_gen2(struct megasas_instance *instance) megasas_enable_intr_gen2(struct megasas_instance *instance)
{ {
struct megasas_register_set __iomem *regs; struct megasas_register_set __iomem *regs;
regs = instance->reg_set; regs = instance->reg_set;
writel(0xFFFFFFFF, &(regs)->outbound_doorbell_clear); writel(0xFFFFFFFF, &(regs)->outbound_doorbell_clear);
...@@ -725,6 +736,7 @@ megasas_disable_intr_gen2(struct megasas_instance *instance) ...@@ -725,6 +736,7 @@ megasas_disable_intr_gen2(struct megasas_instance *instance)
{ {
struct megasas_register_set __iomem *regs; struct megasas_register_set __iomem *regs;
u32 mask = 0xFFFFFFFF; u32 mask = 0xFFFFFFFF;
regs = instance->reg_set; regs = instance->reg_set;
writel(mask, &regs->outbound_intr_mask); writel(mask, &regs->outbound_intr_mask);
/* Dummy readl to force pci flush */ /* Dummy readl to force pci flush */
...@@ -750,6 +762,7 @@ megasas_clear_intr_gen2(struct megasas_register_set __iomem *regs) ...@@ -750,6 +762,7 @@ megasas_clear_intr_gen2(struct megasas_register_set __iomem *regs)
{ {
u32 status; u32 status;
u32 mfiStatus = 0; u32 mfiStatus = 0;
/* /*
* Check if it is our interrupt * Check if it is our interrupt
*/ */
...@@ -786,6 +799,7 @@ megasas_fire_cmd_gen2(struct megasas_instance *instance, ...@@ -786,6 +799,7 @@ megasas_fire_cmd_gen2(struct megasas_instance *instance,
struct megasas_register_set __iomem *regs) struct megasas_register_set __iomem *regs)
{ {
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&instance->hba_lock, flags); spin_lock_irqsave(&instance->hba_lock, flags);
writel((frame_phys_addr | (frame_count<<1))|1, writel((frame_phys_addr | (frame_count<<1))|1,
&(regs)->inbound_queue_port); &(regs)->inbound_queue_port);
...@@ -821,7 +835,7 @@ megasas_adp_reset_gen2(struct megasas_instance *instance, ...@@ -821,7 +835,7 @@ megasas_adp_reset_gen2(struct megasas_instance *instance,
HostDiag = (u32)readl(hostdiag_offset); HostDiag = (u32)readl(hostdiag_offset);
while ( !( HostDiag & DIAG_WRITE_ENABLE) ) { while (!(HostDiag & DIAG_WRITE_ENABLE)) {
msleep(100); msleep(100);
HostDiag = (u32)readl(hostdiag_offset); HostDiag = (u32)readl(hostdiag_offset);
dev_notice(&instance->pdev->dev, "RESETGEN2: retry=%x, hostdiag=%x\n", dev_notice(&instance->pdev->dev, "RESETGEN2: retry=%x, hostdiag=%x\n",
...@@ -839,7 +853,7 @@ megasas_adp_reset_gen2(struct megasas_instance *instance, ...@@ -839,7 +853,7 @@ megasas_adp_reset_gen2(struct megasas_instance *instance,
ssleep(10); ssleep(10);
HostDiag = (u32)readl(hostdiag_offset); HostDiag = (u32)readl(hostdiag_offset);
while ( ( HostDiag & DIAG_RESET_ADAPTER) ) { while (HostDiag & DIAG_RESET_ADAPTER) {
msleep(100); msleep(100);
HostDiag = (u32)readl(hostdiag_offset); HostDiag = (u32)readl(hostdiag_offset);
dev_notice(&instance->pdev->dev, "RESET_GEN2: retry=%x, hostdiag=%x\n", dev_notice(&instance->pdev->dev, "RESET_GEN2: retry=%x, hostdiag=%x\n",
...@@ -904,7 +918,6 @@ int ...@@ -904,7 +918,6 @@ int
megasas_issue_polled(struct megasas_instance *instance, struct megasas_cmd *cmd) megasas_issue_polled(struct megasas_instance *instance, struct megasas_cmd *cmd)
{ {
int seconds; int seconds;
struct megasas_header *frame_hdr = &cmd->frame->hdr; struct megasas_header *frame_hdr = &cmd->frame->hdr;
frame_hdr->cmd_status = MFI_CMD_STATUS_POLL_MODE; frame_hdr->cmd_status = MFI_CMD_STATUS_POLL_MODE;
...@@ -940,6 +953,7 @@ megasas_issue_blocked_cmd(struct megasas_instance *instance, ...@@ -940,6 +953,7 @@ megasas_issue_blocked_cmd(struct megasas_instance *instance,
struct megasas_cmd *cmd, int timeout) struct megasas_cmd *cmd, int timeout)
{ {
int ret = 0; int ret = 0;
cmd->cmd_status_drv = MFI_STAT_INVALID_STATUS; cmd->cmd_status_drv = MFI_STAT_INVALID_STATUS;
instance->instancet->issue_dcmd(instance, cmd); instance->instancet->issue_dcmd(instance, cmd);
...@@ -1120,7 +1134,7 @@ static u32 megasas_get_frame_count(struct megasas_instance *instance, ...@@ -1120,7 +1134,7 @@ static u32 megasas_get_frame_count(struct megasas_instance *instance,
int num_cnt; int num_cnt;
int sge_bytes; int sge_bytes;
u32 sge_sz; u32 sge_sz;
u32 frame_count=0; u32 frame_count = 0;
sge_sz = (IS_DMA64) ? sizeof(struct megasas_sge64) : sge_sz = (IS_DMA64) ? sizeof(struct megasas_sge64) :
sizeof(struct megasas_sge32); sizeof(struct megasas_sge32);
...@@ -1151,14 +1165,14 @@ static u32 megasas_get_frame_count(struct megasas_instance *instance, ...@@ -1151,14 +1165,14 @@ static u32 megasas_get_frame_count(struct megasas_instance *instance,
num_cnt = sge_count - 3; num_cnt = sge_count - 3;
} }
if(num_cnt>0){ if (num_cnt > 0) {
sge_bytes = sge_sz * num_cnt; sge_bytes = sge_sz * num_cnt;
frame_count = (sge_bytes / MEGAMFI_FRAME_SIZE) + frame_count = (sge_bytes / MEGAMFI_FRAME_SIZE) +
((sge_bytes % MEGAMFI_FRAME_SIZE) ? 1 : 0) ; ((sge_bytes % MEGAMFI_FRAME_SIZE) ? 1 : 0) ;
} }
/* Main frame */ /* Main frame */
frame_count +=1; frame_count += 1;
if (frame_count > 7) if (frame_count > 7)
frame_count = 8; frame_count = 8;
...@@ -1459,7 +1473,7 @@ megasas_dump_pending_frames(struct megasas_instance *instance) ...@@ -1459,7 +1473,7 @@ megasas_dump_pending_frames(struct megasas_instance *instance)
dev_err(&instance->pdev->dev, "[%d]: Pending OS cmds in FW : \n",instance->host->host_no); dev_err(&instance->pdev->dev, "[%d]: Pending OS cmds in FW : \n",instance->host->host_no);
for (i = 0; i < max_cmd; i++) { for (i = 0; i < max_cmd; i++) {
cmd = instance->cmd_list[i]; cmd = instance->cmd_list[i];
if(!cmd->scmd) if (!cmd->scmd)
continue; continue;
dev_err(&instance->pdev->dev, "[%d]: Frame addr :0x%08lx : ",instance->host->host_no,(unsigned long)cmd->frame_phys_addr); dev_err(&instance->pdev->dev, "[%d]: Frame addr :0x%08lx : ",instance->host->host_no,(unsigned long)cmd->frame_phys_addr);
if (megasas_cmd_type(cmd->scmd) == READ_WRITE_LDIO) { if (megasas_cmd_type(cmd->scmd) == READ_WRITE_LDIO) {
...@@ -1471,8 +1485,7 @@ megasas_dump_pending_frames(struct megasas_instance *instance) ...@@ -1471,8 +1485,7 @@ megasas_dump_pending_frames(struct megasas_instance *instance)
instance->host->host_no, cmd->frame_count, ldio->cmd, ldio->target_id, instance->host->host_no, cmd->frame_count, ldio->cmd, ldio->target_id,
le32_to_cpu(ldio->start_lba_lo), le32_to_cpu(ldio->start_lba_hi), le32_to_cpu(ldio->start_lba_lo), le32_to_cpu(ldio->start_lba_hi),
le32_to_cpu(ldio->sense_buf_phys_addr_lo), sgcount); le32_to_cpu(ldio->sense_buf_phys_addr_lo), sgcount);
} } else {
else {
pthru = (struct megasas_pthru_frame *) cmd->frame; pthru = (struct megasas_pthru_frame *) cmd->frame;
mfi_sgl = &pthru->sgl; mfi_sgl = &pthru->sgl;
sgcount = pthru->sge_count; sgcount = pthru->sge_count;
...@@ -1482,8 +1495,8 @@ megasas_dump_pending_frames(struct megasas_instance *instance) ...@@ -1482,8 +1495,8 @@ megasas_dump_pending_frames(struct megasas_instance *instance)
pthru->lun, pthru->cdb_len, le32_to_cpu(pthru->data_xfer_len), pthru->lun, pthru->cdb_len, le32_to_cpu(pthru->data_xfer_len),
le32_to_cpu(pthru->sense_buf_phys_addr_lo), sgcount); le32_to_cpu(pthru->sense_buf_phys_addr_lo), sgcount);
} }
if(megasas_dbg_lvl & MEGASAS_DBG_LVL){ if (megasas_dbg_lvl & MEGASAS_DBG_LVL) {
for (n = 0; n < sgcount; n++){ for (n = 0; n < sgcount; n++) {
if (IS_DMA64) if (IS_DMA64)
dev_err(&instance->pdev->dev, "sgl len : 0x%x, sgl addr : 0x%llx\n", dev_err(&instance->pdev->dev, "sgl len : 0x%x, sgl addr : 0x%llx\n",
le32_to_cpu(mfi_sgl->sge64[n].length), le32_to_cpu(mfi_sgl->sge64[n].length),
...@@ -1500,10 +1513,9 @@ megasas_dump_pending_frames(struct megasas_instance *instance) ...@@ -1500,10 +1513,9 @@ megasas_dump_pending_frames(struct megasas_instance *instance)
cmd = instance->cmd_list[i]; cmd = instance->cmd_list[i];
if(cmd->sync_cmd == 1){ if (cmd->sync_cmd == 1)
dev_err(&instance->pdev->dev, "0x%08lx : ", (unsigned long)cmd->frame_phys_addr); dev_err(&instance->pdev->dev, "0x%08lx : ", (unsigned long)cmd->frame_phys_addr);
} }
}
dev_err(&instance->pdev->dev, "[%d]: Dumping Done\n\n",instance->host->host_no); dev_err(&instance->pdev->dev, "[%d]: Dumping Done\n\n",instance->host->host_no);
} }
...@@ -1662,6 +1674,7 @@ static int megasas_slave_alloc(struct scsi_device *sdev) ...@@ -1662,6 +1674,7 @@ static int megasas_slave_alloc(struct scsi_device *sdev)
{ {
u16 pd_index = 0; u16 pd_index = 0;
struct megasas_instance *instance ; struct megasas_instance *instance ;
instance = megasas_lookup_instance(sdev->host->host_no); instance = megasas_lookup_instance(sdev->host->host_no);
if (sdev->channel < MEGASAS_MAX_PD_CHANNELS) { if (sdev->channel < MEGASAS_MAX_PD_CHANNELS) {
/* /*
...@@ -1727,8 +1740,7 @@ void megaraid_sas_kill_hba(struct megasas_instance *instance) ...@@ -1727,8 +1740,7 @@ void megaraid_sas_kill_hba(struct megasas_instance *instance)
(instance->pdev->device == PCI_DEVICE_ID_LSI_PLASMA) || (instance->pdev->device == PCI_DEVICE_ID_LSI_PLASMA) ||
(instance->pdev->device == PCI_DEVICE_ID_LSI_INVADER) || (instance->pdev->device == PCI_DEVICE_ID_LSI_INVADER) ||
(instance->pdev->device == PCI_DEVICE_ID_LSI_FURY)) { (instance->pdev->device == PCI_DEVICE_ID_LSI_FURY)) {
writel(MFI_STOP_ADP, writel(MFI_STOP_ADP, &instance->reg_set->doorbell);
&instance->reg_set->doorbell);
/* Flush */ /* Flush */
readl(&instance->reg_set->doorbell); readl(&instance->reg_set->doorbell);
if (instance->mpio && instance->requestorId) if (instance->mpio && instance->requestorId)
...@@ -1782,7 +1794,7 @@ static void megasas_complete_cmd_dpc(unsigned long instance_addr) ...@@ -1782,7 +1794,7 @@ static void megasas_complete_cmd_dpc(unsigned long instance_addr)
unsigned long flags; unsigned long flags;
/* If we have already declared adapter dead, donot complete cmds */ /* If we have already declared adapter dead, donot complete cmds */
if (instance->adprecovery == MEGASAS_HW_CRITICAL_ERROR ) if (instance->adprecovery == MEGASAS_HW_CRITICAL_ERROR)
return; return;
spin_lock_irqsave(&instance->completion_lock, flags); spin_lock_irqsave(&instance->completion_lock, flags);
...@@ -2324,7 +2336,6 @@ static int megasas_wait_for_outstanding(struct megasas_instance *instance) ...@@ -2324,7 +2336,6 @@ static int megasas_wait_for_outstanding(struct megasas_instance *instance)
} }
for (i = 0; i < resetwaittime; i++) { for (i = 0; i < resetwaittime; i++) {
int outstanding = atomic_read(&instance->fw_outstanding); int outstanding = atomic_read(&instance->fw_outstanding);
if (!outstanding) if (!outstanding)
...@@ -2363,10 +2374,8 @@ static int megasas_wait_for_outstanding(struct megasas_instance *instance) ...@@ -2363,10 +2374,8 @@ static int megasas_wait_for_outstanding(struct megasas_instance *instance)
i++; i++;
} while (i <= 3); } while (i <= 3);
if (atomic_read(&instance->fw_outstanding) && if (atomic_read(&instance->fw_outstanding) && !kill_adapter_flag) {
!kill_adapter_flag) {
if (instance->disableOnlineCtrlReset == 0) { if (instance->disableOnlineCtrlReset == 0) {
megasas_do_ocr(instance); megasas_do_ocr(instance);
/* wait for 5 secs to let FW finish the pending cmds */ /* wait for 5 secs to let FW finish the pending cmds */
...@@ -2478,14 +2487,10 @@ blk_eh_timer_return megasas_reset_timer(struct scsi_cmnd *scmd) ...@@ -2478,14 +2487,10 @@ blk_eh_timer_return megasas_reset_timer(struct scsi_cmnd *scmd)
*/ */
static int megasas_reset_device(struct scsi_cmnd *scmd) static int megasas_reset_device(struct scsi_cmnd *scmd)
{ {
int ret;
/* /*
* First wait for all commands to complete * First wait for all commands to complete
*/ */
ret = megasas_generic_reset(scmd); return megasas_generic_reset(scmd);
return ret;
} }
/** /**
...@@ -2495,6 +2500,7 @@ static int megasas_reset_bus_host(struct scsi_cmnd *scmd) ...@@ -2495,6 +2500,7 @@ static int megasas_reset_bus_host(struct scsi_cmnd *scmd)
{ {
int ret; int ret;
struct megasas_instance *instance; struct megasas_instance *instance;
instance = (struct megasas_instance *)scmd->device->host->hostdata; instance = (struct megasas_instance *)scmd->device->host->hostdata;
/* /*
...@@ -2526,6 +2532,7 @@ megasas_bios_param(struct scsi_device *sdev, struct block_device *bdev, ...@@ -2526,6 +2532,7 @@ megasas_bios_param(struct scsi_device *sdev, struct block_device *bdev,
int sectors; int sectors;
sector_t cylinders; sector_t cylinders;
unsigned long tmp; unsigned long tmp;
/* Default heads (64) & sectors (32) */ /* Default heads (64) & sectors (32) */
heads = 64; heads = 64;
sectors = 32; sectors = 32;
...@@ -2572,6 +2579,7 @@ static void ...@@ -2572,6 +2579,7 @@ static void
megasas_service_aen(struct megasas_instance *instance, struct megasas_cmd *cmd) megasas_service_aen(struct megasas_instance *instance, struct megasas_cmd *cmd)
{ {
unsigned long flags; unsigned long flags;
/* /*
* Don't signal app if it is just an aborted previously registered aen * Don't signal app if it is just an aborted previously registered aen
*/ */
...@@ -2592,6 +2600,7 @@ megasas_service_aen(struct megasas_instance *instance, struct megasas_cmd *cmd) ...@@ -2592,6 +2600,7 @@ megasas_service_aen(struct megasas_instance *instance, struct megasas_cmd *cmd)
if ((instance->unload == 0) && if ((instance->unload == 0) &&
((instance->issuepend_done == 1))) { ((instance->issuepend_done == 1))) {
struct megasas_aen_event *ev; struct megasas_aen_event *ev;
ev = kzalloc(sizeof(*ev), GFP_ATOMIC); ev = kzalloc(sizeof(*ev), GFP_ATOMIC);
if (!ev) { if (!ev) {
dev_err(&instance->pdev->dev, "megasas_service_aen: out of memory\n"); dev_err(&instance->pdev->dev, "megasas_service_aen: out of memory\n");
...@@ -2651,8 +2660,7 @@ megasas_fw_crash_buffer_show(struct device *cdev, ...@@ -2651,8 +2660,7 @@ megasas_fw_crash_buffer_show(struct device *cdev,
buff_addr = (unsigned long) buf; buff_addr = (unsigned long) buf;
if (buff_offset > if (buff_offset > (instance->fw_crash_buffer_size * dmachunk)) {
(instance->fw_crash_buffer_size * dmachunk)) {
dev_err(&instance->pdev->dev, dev_err(&instance->pdev->dev,
"Firmware crash dump offset is out of range\n"); "Firmware crash dump offset is out of range\n");
spin_unlock_irqrestore(&instance->crashdump_lock, flags); spin_unlock_irqrestore(&instance->crashdump_lock, flags);
...@@ -2724,6 +2732,7 @@ megasas_fw_crash_state_show(struct device *cdev, ...@@ -2724,6 +2732,7 @@ megasas_fw_crash_state_show(struct device *cdev,
struct Scsi_Host *shost = class_to_shost(cdev); struct Scsi_Host *shost = class_to_shost(cdev);
struct megasas_instance *instance = struct megasas_instance *instance =
(struct megasas_instance *) shost->hostdata; (struct megasas_instance *) shost->hostdata;
return snprintf(buf, PAGE_SIZE, "%d\n", instance->fw_crash_state); return snprintf(buf, PAGE_SIZE, "%d\n", instance->fw_crash_state);
} }
...@@ -2808,8 +2817,6 @@ megasas_complete_abort(struct megasas_instance *instance, ...@@ -2808,8 +2817,6 @@ megasas_complete_abort(struct megasas_instance *instance,
cmd->cmd_status_drv = 0; cmd->cmd_status_drv = 0;
wake_up(&instance->abort_cmd_wait_q); wake_up(&instance->abort_cmd_wait_q);
} }
return;
} }
/** /**
...@@ -3052,7 +3059,7 @@ megasas_issue_pending_cmds_again(struct megasas_instance *instance) ...@@ -3052,7 +3059,7 @@ megasas_issue_pending_cmds_again(struct megasas_instance *instance)
"issue it again.\n", cmd); "issue it again.\n", cmd);
cmd->cmd_status_drv = MFI_STAT_INVALID_STATUS; cmd->cmd_status_drv = MFI_STAT_INVALID_STATUS;
instance->instancet->fire_cmd(instance, instance->instancet->fire_cmd(instance,
cmd->frame_phys_addr , cmd->frame_phys_addr,
0, instance->reg_set); 0, instance->reg_set);
} else if (cmd->scmd) { } else if (cmd->scmd) {
dev_notice(&instance->pdev->dev, "%p scsi cmd [%02x]" dev_notice(&instance->pdev->dev, "%p scsi cmd [%02x]"
...@@ -3155,7 +3162,7 @@ process_fw_state_change_wq(struct work_struct *work) ...@@ -3155,7 +3162,7 @@ process_fw_state_change_wq(struct work_struct *work)
atomic_set(&instance->fw_reset_no_pci_access, 1); atomic_set(&instance->fw_reset_no_pci_access, 1);
instance->instancet->adp_reset(instance, instance->reg_set); instance->instancet->adp_reset(instance, instance->reg_set);
atomic_set(&instance->fw_reset_no_pci_access, 0 ); atomic_set(&instance->fw_reset_no_pci_access, 0);
dev_notice(&instance->pdev->dev, "FW restarted successfully," dev_notice(&instance->pdev->dev, "FW restarted successfully,"
"initiating next stage...\n"); "initiating next stage...\n");
...@@ -3163,7 +3170,7 @@ process_fw_state_change_wq(struct work_struct *work) ...@@ -3163,7 +3170,7 @@ process_fw_state_change_wq(struct work_struct *work)
dev_notice(&instance->pdev->dev, "HBA recovery state machine," dev_notice(&instance->pdev->dev, "HBA recovery state machine,"
"state 2 starting...\n"); "state 2 starting...\n");
/*waitting for about 20 second before start the second init*/ /* waiting for about 20 second before start the second init */
for (wait = 0; wait < 30; wait++) { for (wait = 0; wait < 30; wait++) {
msleep(1000); msleep(1000);
} }
...@@ -3196,7 +3203,6 @@ process_fw_state_change_wq(struct work_struct *work) ...@@ -3196,7 +3203,6 @@ process_fw_state_change_wq(struct work_struct *work)
megasas_issue_pending_cmds_again(instance); megasas_issue_pending_cmds_again(instance);
instance->issuepend_done = 1; instance->issuepend_done = 1;
} }
return ;
} }
/** /**
...@@ -3566,9 +3572,8 @@ static int megasas_create_frame_pool(struct megasas_instance *instance) ...@@ -3566,9 +3572,8 @@ static int megasas_create_frame_pool(struct megasas_instance *instance)
sge_sz = (IS_DMA64) ? sizeof(struct megasas_sge64) : sge_sz = (IS_DMA64) ? sizeof(struct megasas_sge64) :
sizeof(struct megasas_sge32); sizeof(struct megasas_sge32);
if (instance->flag_ieee) { if (instance->flag_ieee)
sge_sz = sizeof(struct megasas_sge_skinny); sge_sz = sizeof(struct megasas_sge_skinny);
}
/* /*
* For MFI controllers. * For MFI controllers.
...@@ -3652,6 +3657,7 @@ static int megasas_create_frame_pool(struct megasas_instance *instance) ...@@ -3652,6 +3657,7 @@ static int megasas_create_frame_pool(struct megasas_instance *instance)
void megasas_free_cmds(struct megasas_instance *instance) void megasas_free_cmds(struct megasas_instance *instance)
{ {
int i; int i;
/* First free the MFI frame pool */ /* First free the MFI frame pool */
megasas_teardown_frame_pool(instance); megasas_teardown_frame_pool(instance);
...@@ -3812,7 +3818,7 @@ megasas_get_pd_list(struct megasas_instance *instance) ...@@ -3812,7 +3818,7 @@ megasas_get_pd_list(struct megasas_instance *instance)
pd_addr = ci->addr; pd_addr = ci->addr;
if ( ret == 0 && if (ret == 0 &&
(le32_to_cpu(ci->count) < (le32_to_cpu(ci->count) <
(MEGASAS_MAX_PD_CHANNELS * MEGASAS_MAX_DEV_PER_CHANNEL))) { (MEGASAS_MAX_PD_CHANNELS * MEGASAS_MAX_DEV_PER_CHANNEL))) {
...@@ -4063,7 +4069,6 @@ static void megasas_update_ext_vd_details(struct megasas_instance *instance) ...@@ -4063,7 +4069,6 @@ static void megasas_update_ext_vd_details(struct megasas_instance *instance)
fusion->current_map_sz = new_map_sz; fusion->current_map_sz = new_map_sz;
else else
fusion->current_map_sz = old_map_sz; fusion->current_map_sz = old_map_sz;
} }
/** /**
...@@ -4210,9 +4215,7 @@ static int ...@@ -4210,9 +4215,7 @@ static int
megasas_issue_init_mfi(struct megasas_instance *instance) megasas_issue_init_mfi(struct megasas_instance *instance)
{ {
__le32 context; __le32 context;
struct megasas_cmd *cmd; struct megasas_cmd *cmd;
struct megasas_init_frame *init_frame; struct megasas_init_frame *init_frame;
struct megasas_init_queue_info *initq_info; struct megasas_init_queue_info *initq_info;
dma_addr_t init_frame_h; dma_addr_t init_frame_h;
...@@ -4653,8 +4656,7 @@ static int megasas_init_fw(struct megasas_instance *instance) ...@@ -4653,8 +4656,7 @@ static int megasas_init_fw(struct megasas_instance *instance)
/** for passthrough /** for passthrough
* the following function will get the PD LIST. * the following function will get the PD LIST.
*/ */
memset(instance->pd_list, 0,
memset(instance->pd_list, 0 ,
(MEGASAS_MAX_PD * sizeof(struct megasas_pd_list))); (MEGASAS_MAX_PD * sizeof(struct megasas_pd_list)));
if (megasas_get_pd_list(instance) < 0) { if (megasas_get_pd_list(instance) < 0) {
dev_err(&instance->pdev->dev, "failed to get PD list\n"); dev_err(&instance->pdev->dev, "failed to get PD list\n");
...@@ -4682,7 +4684,7 @@ static int megasas_init_fw(struct megasas_instance *instance) ...@@ -4682,7 +4684,7 @@ static int megasas_init_fw(struct megasas_instance *instance)
le16_to_cpu(ctrl_info->max_strips_per_io); le16_to_cpu(ctrl_info->max_strips_per_io);
max_sectors_2 = le32_to_cpu(ctrl_info->max_request_size); max_sectors_2 = le32_to_cpu(ctrl_info->max_request_size);
tmp_sectors = min_t(u32, max_sectors_1 , max_sectors_2); tmp_sectors = min_t(u32, max_sectors_1, max_sectors_2);
instance->disableOnlineCtrlReset = instance->disableOnlineCtrlReset =
ctrl_info->properties.OnOffProperties.disableOnlineCtrlReset; ctrl_info->properties.OnOffProperties.disableOnlineCtrlReset;
...@@ -5122,7 +5124,7 @@ static int ...@@ -5122,7 +5124,7 @@ static int
megasas_set_dma_mask(struct pci_dev *pdev) megasas_set_dma_mask(struct pci_dev *pdev)
{ {
/* /*
* All our contollers are capable of performing 64-bit DMA * All our controllers are capable of performing 64-bit DMA
*/ */
if (IS_DMA64) { if (IS_DMA64) {
if (pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) != 0) { if (pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) != 0) {
...@@ -5208,7 +5210,7 @@ static int megasas_probe_one(struct pci_dev *pdev, ...@@ -5208,7 +5210,7 @@ static int megasas_probe_one(struct pci_dev *pdev,
instance = (struct megasas_instance *)host->hostdata; instance = (struct megasas_instance *)host->hostdata;
memset(instance, 0, sizeof(*instance)); memset(instance, 0, sizeof(*instance));
atomic_set( &instance->fw_reset_no_pci_access, 0 ); atomic_set(&instance->fw_reset_no_pci_access, 0);
instance->pdev = pdev; instance->pdev = pdev;
switch (instance->pdev->device) { switch (instance->pdev->device) {
...@@ -5405,8 +5407,8 @@ static int megasas_probe_one(struct pci_dev *pdev, ...@@ -5405,8 +5407,8 @@ static int megasas_probe_one(struct pci_dev *pdev,
return 0; return 0;
fail_start_aen: fail_start_aen:
fail_io_attach: fail_io_attach:
megasas_mgmt_info.count--; megasas_mgmt_info.count--;
megasas_mgmt_info.instance[megasas_mgmt_info.max_index] = NULL; megasas_mgmt_info.instance[megasas_mgmt_info.max_index] = NULL;
megasas_mgmt_info.max_index--; megasas_mgmt_info.max_index--;
...@@ -5424,7 +5426,7 @@ static int megasas_probe_one(struct pci_dev *pdev, ...@@ -5424,7 +5426,7 @@ static int megasas_probe_one(struct pci_dev *pdev,
if (instance->msix_vectors) if (instance->msix_vectors)
pci_disable_msix(instance->pdev); pci_disable_msix(instance->pdev);
fail_init_mfi: fail_init_mfi:
fail_alloc_dma_buf: fail_alloc_dma_buf:
if (instance->evt_detail) if (instance->evt_detail)
pci_free_consistent(pdev, sizeof(struct megasas_evt_detail), pci_free_consistent(pdev, sizeof(struct megasas_evt_detail),
instance->evt_detail, instance->evt_detail,
...@@ -5438,8 +5440,8 @@ static int megasas_probe_one(struct pci_dev *pdev, ...@@ -5438,8 +5440,8 @@ static int megasas_probe_one(struct pci_dev *pdev,
instance->consumer_h); instance->consumer_h);
scsi_host_put(host); scsi_host_put(host);
fail_alloc_instance: fail_alloc_instance:
fail_set_dma_mask: fail_set_dma_mask:
pci_disable_device(pdev); pci_disable_device(pdev);
return -ENODEV; return -ENODEV;
...@@ -5481,8 +5483,6 @@ static void megasas_flush_cache(struct megasas_instance *instance) ...@@ -5481,8 +5483,6 @@ static void megasas_flush_cache(struct megasas_instance *instance)
" from %s\n", __func__); " from %s\n", __func__);
megasas_return_cmd(instance, cmd); megasas_return_cmd(instance, cmd);
return;
} }
/** /**
...@@ -5528,8 +5528,6 @@ static void megasas_shutdown_controller(struct megasas_instance *instance, ...@@ -5528,8 +5528,6 @@ static void megasas_shutdown_controller(struct megasas_instance *instance,
"from %s\n", __func__); "from %s\n", __func__);
megasas_return_cmd(instance, cmd); megasas_return_cmd(instance, cmd);
return;
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
...@@ -5835,8 +5833,6 @@ static void megasas_detach_one(struct pci_dev *pdev) ...@@ -5835,8 +5833,6 @@ static void megasas_detach_one(struct pci_dev *pdev)
scsi_host_put(host); scsi_host_put(host);
pci_disable_device(pdev); pci_disable_device(pdev);
return;
} }
/** /**
...@@ -5905,11 +5901,11 @@ static unsigned int megasas_mgmt_poll(struct file *file, poll_table *wait) ...@@ -5905,11 +5901,11 @@ static unsigned int megasas_mgmt_poll(struct file *file, poll_table *wait)
{ {
unsigned int mask; unsigned int mask;
unsigned long flags; unsigned long flags;
poll_wait(file, &megasas_poll_wait, wait); poll_wait(file, &megasas_poll_wait, wait);
spin_lock_irqsave(&poll_aen_lock, flags); spin_lock_irqsave(&poll_aen_lock, flags);
if (megasas_poll_wait_aen) if (megasas_poll_wait_aen)
mask = (POLLIN | POLLRDNORM); mask = (POLLIN | POLLRDNORM);
else else
mask = 0; mask = 0;
megasas_poll_wait_aen = 0; megasas_poll_wait_aen = 0;
...@@ -5923,8 +5919,7 @@ static unsigned int megasas_mgmt_poll(struct file *file, poll_table *wait) ...@@ -5923,8 +5919,7 @@ static unsigned int megasas_mgmt_poll(struct file *file, poll_table *wait)
* @cmd: MFI command frame * @cmd: MFI command frame
*/ */
static int megasas_set_crash_dump_params_ioctl( static int megasas_set_crash_dump_params_ioctl(struct megasas_cmd *cmd)
struct megasas_cmd *cmd)
{ {
struct megasas_instance *local_instance; struct megasas_instance *local_instance;
int i, error = 0; int i, error = 0;
...@@ -6120,7 +6115,7 @@ megasas_mgmt_fw_ioctl(struct megasas_instance *instance, ...@@ -6120,7 +6115,7 @@ megasas_mgmt_fw_ioctl(struct megasas_instance *instance,
error = -EFAULT; error = -EFAULT;
} }
out: out:
if (sense) { if (sense) {
dma_free_coherent(&instance->pdev->dev, ioc->sense_len, dma_free_coherent(&instance->pdev->dev, ioc->sense_len,
sense, sense_handle); sense, sense_handle);
...@@ -6220,10 +6215,10 @@ static int megasas_mgmt_ioctl_fw(struct file *file, unsigned long arg) ...@@ -6220,10 +6215,10 @@ static int megasas_mgmt_ioctl_fw(struct file *file, unsigned long arg)
spin_unlock_irqrestore(&instance->hba_lock, flags); spin_unlock_irqrestore(&instance->hba_lock, flags);
error = megasas_mgmt_fw_ioctl(instance, user_ioc, ioc); error = megasas_mgmt_fw_ioctl(instance, user_ioc, ioc);
out_up: out_up:
up(&instance->ioctl_sem); up(&instance->ioctl_sem);
out_kfree_ioc: out_kfree_ioc:
kfree(ioc); kfree(ioc);
return error; return error;
} }
...@@ -6458,7 +6453,8 @@ static ssize_t ...@@ -6458,7 +6453,8 @@ static ssize_t
megasas_sysfs_set_dbg_lvl(struct device_driver *dd, const char *buf, size_t count) megasas_sysfs_set_dbg_lvl(struct device_driver *dd, const char *buf, size_t count)
{ {
int retval = count; int retval = count;
if(sscanf(buf,"%u",&megasas_dbg_lvl)<1){
if (sscanf(buf, "%u", &megasas_dbg_lvl) < 1) {
printk(KERN_ERR "megasas: could not set dbg_lvl\n"); printk(KERN_ERR "megasas: could not set dbg_lvl\n");
retval = -EINVAL; retval = -EINVAL;
} }
...@@ -6520,14 +6516,12 @@ megasas_aen_polling(struct work_struct *work) ...@@ -6520,14 +6516,12 @@ megasas_aen_polling(struct work_struct *work)
pd_index = pd_index =
(i * MEGASAS_MAX_DEV_PER_CHANNEL) + j; (i * MEGASAS_MAX_DEV_PER_CHANNEL) + j;
sdev1 = sdev1 = scsi_device_lookup(host, i, j, 0);
scsi_device_lookup(host, i, j, 0);
if (instance->pd_list[pd_index].driveState if (instance->pd_list[pd_index].driveState
== MR_PD_STATE_SYSTEM) { == MR_PD_STATE_SYSTEM) {
if (!sdev1) { if (!sdev1)
scsi_add_device(host, i, j, 0); scsi_add_device(host, i, j, 0);
}
if (sdev1) if (sdev1)
scsi_device_put(sdev1); scsi_device_put(sdev1);
...@@ -6548,14 +6542,12 @@ megasas_aen_polling(struct work_struct *work) ...@@ -6548,14 +6542,12 @@ megasas_aen_polling(struct work_struct *work)
pd_index = pd_index =
(i * MEGASAS_MAX_DEV_PER_CHANNEL) + j; (i * MEGASAS_MAX_DEV_PER_CHANNEL) + j;
sdev1 = sdev1 = scsi_device_lookup(host, i, j, 0);
scsi_device_lookup(host, i, j, 0);
if (instance->pd_list[pd_index].driveState if (instance->pd_list[pd_index].driveState
== MR_PD_STATE_SYSTEM) { == MR_PD_STATE_SYSTEM) {
if (sdev1) { if (sdev1)
scsi_device_put(sdev1); scsi_device_put(sdev1);
}
} else { } else {
if (sdev1) { if (sdev1) {
scsi_remove_device(sdev1); scsi_remove_device(sdev1);
...@@ -6701,7 +6693,7 @@ megasas_aen_polling(struct work_struct *work) ...@@ -6701,7 +6693,7 @@ megasas_aen_polling(struct work_struct *work)
} }
} }
if ( instance->aen_cmd != NULL ) { if (instance->aen_cmd != NULL) {
kfree(ev); kfree(ev);
return ; return ;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment