These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / scsi / qla2xxx / qla_tmpl.c
index 962cb89..c3e6225 100644 (file)
@@ -137,39 +137,39 @@ qla27xx_insertbuf(void *mem, ulong size, void *buf, ulong *len)
 }
 
 static inline void
-qla27xx_read8(void *window, void *buf, ulong *len)
+qla27xx_read8(void __iomem *window, void *buf, ulong *len)
 {
        uint8_t value = ~0;
 
        if (buf) {
-               value = RD_REG_BYTE((__iomem void *)window);
+               value = RD_REG_BYTE(window);
        }
        qla27xx_insert32(value, buf, len);
 }
 
 static inline void
-qla27xx_read16(void *window, void *buf, ulong *len)
+qla27xx_read16(void __iomem *window, void *buf, ulong *len)
 {
        uint16_t value = ~0;
 
        if (buf) {
-               value = RD_REG_WORD((__iomem void *)window);
+               value = RD_REG_WORD(window);
        }
        qla27xx_insert32(value, buf, len);
 }
 
 static inline void
-qla27xx_read32(void *window, void *buf, ulong *len)
+qla27xx_read32(void __iomem *window, void *buf, ulong *len)
 {
        uint32_t value = ~0;
 
        if (buf) {
-               value = RD_REG_DWORD((__iomem void *)window);
+               value = RD_REG_DWORD(window);
        }
        qla27xx_insert32(value, buf, len);
 }
 
-static inline void (*qla27xx_read_vector(uint width))(void *, void *, ulong *)
+static inline void (*qla27xx_read_vector(uint width))(void __iomem*, void *, ulong *)
 {
        return
            (width == 1) ? qla27xx_read8 :
@@ -181,7 +181,7 @@ static inline void
 qla27xx_read_reg(__iomem struct device_reg_24xx *reg,
        uint offset, void *buf, ulong *len)
 {
-       void *window = (void *)reg + offset;
+       void __iomem *window = (void __iomem *)reg + offset;
 
        qla27xx_read32(window, buf, len);
 }
@@ -202,8 +202,8 @@ qla27xx_read_window(__iomem struct device_reg_24xx *reg,
        uint32_t addr, uint offset, uint count, uint width, void *buf,
        ulong *len)
 {
-       void *window = (void *)reg + offset;
-       void (*readn)(void *, void *, ulong *) = qla27xx_read_vector(width);
+       void __iomem *window = (void __iomem *)reg + offset;
+       void (*readn)(void __iomem*, void *, ulong *) = qla27xx_read_vector(width);
 
        qla27xx_write_reg(reg, IOBASE_ADDR, addr, buf);
        while (count--) {
@@ -395,6 +395,10 @@ qla27xx_fwdt_entry_t263(struct scsi_qla_host *vha,
        if (ent->t263.queue_type == T263_QUEUE_TYPE_REQ) {
                for (i = 0; i < vha->hw->max_req_queues; i++) {
                        struct req_que *req = vha->hw->req_q_map[i];
+
+                       if (!test_bit(i, vha->hw->req_qid_map))
+                               continue;
+
                        if (req || !buf) {
                                length = req ?
                                    req->length : REQUEST_ENTRY_CNT_24XX;
@@ -408,6 +412,10 @@ qla27xx_fwdt_entry_t263(struct scsi_qla_host *vha,
        } else if (ent->t263.queue_type == T263_QUEUE_TYPE_RSP) {
                for (i = 0; i < vha->hw->max_rsp_queues; i++) {
                        struct rsp_que *rsp = vha->hw->rsp_q_map[i];
+
+                       if (!test_bit(i, vha->hw->rsp_qid_map))
+                               continue;
+
                        if (rsp || !buf) {
                                length = rsp ?
                                    rsp->length : RESPONSE_ENTRY_CNT_MQ;
@@ -634,6 +642,10 @@ qla27xx_fwdt_entry_t274(struct scsi_qla_host *vha,
        if (ent->t274.queue_type == T274_QUEUE_TYPE_REQ_SHAD) {
                for (i = 0; i < vha->hw->max_req_queues; i++) {
                        struct req_que *req = vha->hw->req_q_map[i];
+
+                       if (!test_bit(i, vha->hw->req_qid_map))
+                               continue;
+
                        if (req || !buf) {
                                qla27xx_insert16(i, buf, len);
                                qla27xx_insert16(1, buf, len);
@@ -645,6 +657,10 @@ qla27xx_fwdt_entry_t274(struct scsi_qla_host *vha,
        } else if (ent->t274.queue_type == T274_QUEUE_TYPE_RSP_SHAD) {
                for (i = 0; i < vha->hw->max_rsp_queues; i++) {
                        struct rsp_que *rsp = vha->hw->rsp_q_map[i];
+
+                       if (!test_bit(i, vha->hw->rsp_qid_map))
+                               continue;
+
                        if (rsp || !buf) {
                                qla27xx_insert16(i, buf, len);
                                qla27xx_insert16(1, buf, len);
@@ -805,9 +821,8 @@ static void
 qla27xx_driver_info(struct qla27xx_fwdt_template *tmp)
 {
        uint8_t v[] = { 0, 0, 0, 0, 0, 0 };
-       int rval = 0;
 
-       rval = sscanf(qla2x00_version_str, "%hhu.%hhu.%hhu.%hhu.%hhu.%hhu",
+       sscanf(qla2x00_version_str, "%hhu.%hhu.%hhu.%hhu.%hhu.%hhu",
            v+0, v+1, v+2, v+3, v+4, v+5);
 
        tmp->driver_info[0] = v[3] << 24 | v[2] << 16 | v[1] << 8 | v[0];
@@ -940,8 +955,10 @@ qla27xx_fwdump(scsi_qla_host_t *vha, int hardware_locked)
 {
        ulong flags = 0;
 
+#ifndef __CHECKER__
        if (!hardware_locked)
                spin_lock_irqsave(&vha->hw->hardware_lock, flags);
+#endif
 
        if (!vha->hw->fw_dump)
                ql_log(ql_log_warn, vha, 0xd01e, "fwdump buffer missing.\n");
@@ -954,6 +971,8 @@ qla27xx_fwdump(scsi_qla_host_t *vha, int hardware_locked)
        else
                qla27xx_execute_fwdt_template(vha);
 
+#ifndef __CHECKER__
        if (!hardware_locked)
                spin_unlock_irqrestore(&vha->hw->hardware_lock, flags);
+#endif
 }