[SCSI] ipr: fix a register read to use the correct address for 64 bit adapters
authorWayne Boyer <wayneb@linux.vnet.ibm.com>
Mon, 10 May 2010 16:14:07 +0000 (09:14 -0700)
committerJames Bottomley <James.Bottomley@suse.de>
Mon, 24 May 2010 16:11:05 +0000 (11:11 -0500)
Fix ipr_reset_enable_ioa() to read the correct IOA to host interrupt register
address for 64 bit adapters.  We need to read the lower 32 bits, not the upper
32 bits.

Also change the write of the 64 bit mask value to a single writeq instead
of two writel calls.

Finally, use the correct u8 type for the type field in the ipr_resource_entry
structure.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/ipr.c
drivers/scsi/ipr.h

index 8c2f4c4041c1a3c0e7baf39aed880bc31e534199..2f280d08fcc60d94cc3a3ffd433ba96d6c74bfb4 100644 (file)
@@ -7187,13 +7187,14 @@ static int ipr_reset_enable_ioa(struct ipr_cmnd *ipr_cmd)
 {
        struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg;
        volatile u32 int_reg;
+       volatile u64 maskval;
 
        ENTER;
        ipr_cmd->job_step = ipr_ioafp_identify_hrrq;
        ipr_init_ioa_mem(ioa_cfg);
 
        ioa_cfg->allow_interrupts = 1;
-       int_reg = readl(ioa_cfg->regs.sense_interrupt_reg);
+       int_reg = readl(ioa_cfg->regs.sense_interrupt_reg32);
 
        if (int_reg & IPR_PCII_IOA_TRANS_TO_OPER) {
                writel((IPR_PCII_ERROR_INTERRUPTS | IPR_PCII_HRRQ_UPDATED),
@@ -7205,9 +7206,12 @@ static int ipr_reset_enable_ioa(struct ipr_cmnd *ipr_cmd)
        /* Enable destructive diagnostics on IOA */
        writel(ioa_cfg->doorbell, ioa_cfg->regs.set_uproc_interrupt_reg32);
 
-       writel(IPR_PCII_OPER_INTERRUPTS, ioa_cfg->regs.clr_interrupt_mask_reg32);
-       if (ioa_cfg->sis64)
-               writel(IPR_PCII_IPL_STAGE_CHANGE, ioa_cfg->regs.clr_interrupt_mask_reg);
+       if (ioa_cfg->sis64) {
+               maskval = IPR_PCII_IPL_STAGE_CHANGE;
+               maskval = (maskval << 32) | IPR_PCII_OPER_INTERRUPTS;
+               writeq(maskval, ioa_cfg->regs.clr_interrupt_mask_reg);
+       } else
+               writel(IPR_PCII_OPER_INTERRUPTS, ioa_cfg->regs.clr_interrupt_mask_reg32);
 
        int_reg = readl(ioa_cfg->regs.sense_interrupt_mask_reg);
 
index f8a17d88db8431663f884974e71c416faa62c668..9ecd2259eb398dcc0f1e88746df8555dca09e80d 100644 (file)
@@ -1201,7 +1201,7 @@ struct ipr_resource_entry {
        u8 flags;
        __be16 res_flags;
 
-       __be32 type;
+       u8 type;
 
        u8 qmodel;
        struct ipr_std_inq_data std_inq_data;