| .. | .. |
|---|
| 601 | 601 | put_unaligned_le32(COMMAND_TYPE_6, &cmd_pkt->entry_type); |
|---|
| 602 | 602 | |
|---|
| 603 | 603 | /* No data transfer */ |
|---|
| 604 | | - if (!scsi_bufflen(cmd) || cmd->sc_data_direction == DMA_NONE) { |
|---|
| 604 | + if (!scsi_bufflen(cmd) || cmd->sc_data_direction == DMA_NONE || |
|---|
| 605 | + tot_dsds == 0) { |
|---|
| 605 | 606 | cmd_pkt->byte_count = cpu_to_le32(0); |
|---|
| 606 | 607 | return 0; |
|---|
| 607 | 608 | } |
|---|
| .. | .. |
|---|
| 1643 | 1644 | goto queuing_error; |
|---|
| 1644 | 1645 | |
|---|
| 1645 | 1646 | if (req->cnt < (req_cnt + 2)) { |
|---|
| 1646 | | - cnt = IS_SHADOW_REG_CAPABLE(ha) ? *req->out_ptr : |
|---|
| 1647 | | - rd_reg_dword_relaxed(req->req_q_out); |
|---|
| 1647 | + if (IS_SHADOW_REG_CAPABLE(ha)) { |
|---|
| 1648 | + cnt = *req->out_ptr; |
|---|
| 1649 | + } else { |
|---|
| 1650 | + cnt = rd_reg_dword_relaxed(req->req_q_out); |
|---|
| 1651 | + if (qla2x00_check_reg16_for_disconnect(vha, cnt)) |
|---|
| 1652 | + goto queuing_error; |
|---|
| 1653 | + } |
|---|
| 1654 | + |
|---|
| 1648 | 1655 | if (req->ring_index < cnt) |
|---|
| 1649 | 1656 | req->cnt = cnt - req->ring_index; |
|---|
| 1650 | 1657 | else |
|---|
| .. | .. |
|---|
| 1835 | 1842 | goto queuing_error; |
|---|
| 1836 | 1843 | |
|---|
| 1837 | 1844 | if (req->cnt < (req_cnt + 2)) { |
|---|
| 1838 | | - cnt = IS_SHADOW_REG_CAPABLE(ha) ? *req->out_ptr : |
|---|
| 1839 | | - rd_reg_dword_relaxed(req->req_q_out); |
|---|
| 1845 | + if (IS_SHADOW_REG_CAPABLE(ha)) { |
|---|
| 1846 | + cnt = *req->out_ptr; |
|---|
| 1847 | + } else { |
|---|
| 1848 | + cnt = rd_reg_dword_relaxed(req->req_q_out); |
|---|
| 1849 | + if (qla2x00_check_reg16_for_disconnect(vha, cnt)) |
|---|
| 1850 | + goto queuing_error; |
|---|
| 1851 | + } |
|---|
| 1840 | 1852 | if (req->ring_index < cnt) |
|---|
| 1841 | 1853 | req->cnt = cnt - req->ring_index; |
|---|
| 1842 | 1854 | else |
|---|
| .. | .. |
|---|
| 1910 | 1922 | |
|---|
| 1911 | 1923 | qla_put_iocbs(sp->qpair, &sp->iores); |
|---|
| 1912 | 1924 | spin_unlock_irqrestore(&ha->hardware_lock, flags); |
|---|
| 1925 | + |
|---|
| 1913 | 1926 | return QLA_FUNCTION_FAILED; |
|---|
| 1914 | 1927 | } |
|---|
| 1915 | 1928 | |
|---|
| .. | .. |
|---|
| 1977 | 1990 | goto queuing_error; |
|---|
| 1978 | 1991 | |
|---|
| 1979 | 1992 | if (req->cnt < (req_cnt + 2)) { |
|---|
| 1980 | | - cnt = IS_SHADOW_REG_CAPABLE(ha) ? *req->out_ptr : |
|---|
| 1981 | | - rd_reg_dword_relaxed(req->req_q_out); |
|---|
| 1993 | + if (IS_SHADOW_REG_CAPABLE(ha)) { |
|---|
| 1994 | + cnt = *req->out_ptr; |
|---|
| 1995 | + } else { |
|---|
| 1996 | + cnt = rd_reg_dword_relaxed(req->req_q_out); |
|---|
| 1997 | + if (qla2x00_check_reg16_for_disconnect(vha, cnt)) |
|---|
| 1998 | + goto queuing_error; |
|---|
| 1999 | + } |
|---|
| 2000 | + |
|---|
| 1982 | 2001 | if (req->ring_index < cnt) |
|---|
| 1983 | 2002 | req->cnt = cnt - req->ring_index; |
|---|
| 1984 | 2003 | else |
|---|
| .. | .. |
|---|
| 2184 | 2203 | goto queuing_error; |
|---|
| 2185 | 2204 | |
|---|
| 2186 | 2205 | if (req->cnt < (req_cnt + 2)) { |
|---|
| 2187 | | - cnt = IS_SHADOW_REG_CAPABLE(ha) ? *req->out_ptr : |
|---|
| 2188 | | - rd_reg_dword_relaxed(req->req_q_out); |
|---|
| 2206 | + if (IS_SHADOW_REG_CAPABLE(ha)) { |
|---|
| 2207 | + cnt = *req->out_ptr; |
|---|
| 2208 | + } else { |
|---|
| 2209 | + cnt = rd_reg_dword_relaxed(req->req_q_out); |
|---|
| 2210 | + if (qla2x00_check_reg16_for_disconnect(vha, cnt)) |
|---|
| 2211 | + goto queuing_error; |
|---|
| 2212 | + } |
|---|
| 2213 | + |
|---|
| 2189 | 2214 | if (req->ring_index < cnt) |
|---|
| 2190 | 2215 | req->cnt = cnt - req->ring_index; |
|---|
| 2191 | 2216 | else |
|---|
| .. | .. |
|---|
| 2262 | 2287 | |
|---|
| 2263 | 2288 | qla_put_iocbs(sp->qpair, &sp->iores); |
|---|
| 2264 | 2289 | spin_unlock_irqrestore(&qpair->qp_lock, flags); |
|---|
| 2290 | + |
|---|
| 2265 | 2291 | return QLA_FUNCTION_FAILED; |
|---|
| 2266 | 2292 | } |
|---|
| 2267 | 2293 | |
|---|
| .. | .. |
|---|
| 2305 | 2331 | else |
|---|
| 2306 | 2332 | cnt = qla2x00_debounce_register( |
|---|
| 2307 | 2333 | ISP_REQ_Q_OUT(ha, ®->isp)); |
|---|
| 2334 | + |
|---|
| 2335 | + if (!qpair->use_shadow_reg && cnt == ISP_REG16_DISCONNECT) { |
|---|
| 2336 | + qla_schedule_eeh_work(vha); |
|---|
| 2337 | + return NULL; |
|---|
| 2338 | + } |
|---|
| 2308 | 2339 | |
|---|
| 2309 | 2340 | if (req->ring_index < cnt) |
|---|
| 2310 | 2341 | req->cnt = cnt - req->ring_index; |
|---|
| .. | .. |
|---|
| 3710 | 3741 | void *pkt; |
|---|
| 3711 | 3742 | unsigned long flags; |
|---|
| 3712 | 3743 | |
|---|
| 3744 | + if (vha->hw->flags.eeh_busy) |
|---|
| 3745 | + return -EIO; |
|---|
| 3746 | + |
|---|
| 3713 | 3747 | spin_lock_irqsave(qp->qp_lock_ptr, flags); |
|---|
| 3714 | 3748 | pkt = __qla2x00_alloc_iocbs(sp->qpair, sp); |
|---|
| 3715 | 3749 | if (!pkt) { |
|---|
| 3716 | | - rval = EAGAIN; |
|---|
| 3750 | + rval = -EAGAIN; |
|---|
| 3717 | 3751 | ql_log(ql_log_warn, vha, 0x700c, |
|---|
| 3718 | 3752 | "qla2x00_alloc_iocbs failed.\n"); |
|---|
| 3719 | 3753 | goto done; |
|---|
| .. | .. |
|---|
| 3927 | 3961 | |
|---|
| 3928 | 3962 | /* Check for room on request queue. */ |
|---|
| 3929 | 3963 | if (req->cnt < req_cnt + 2) { |
|---|
| 3930 | | - cnt = IS_SHADOW_REG_CAPABLE(ha) ? *req->out_ptr : |
|---|
| 3931 | | - rd_reg_dword_relaxed(req->req_q_out); |
|---|
| 3964 | + if (IS_SHADOW_REG_CAPABLE(ha)) { |
|---|
| 3965 | + cnt = *req->out_ptr; |
|---|
| 3966 | + } else { |
|---|
| 3967 | + cnt = rd_reg_dword_relaxed(req->req_q_out); |
|---|
| 3968 | + if (qla2x00_check_reg16_for_disconnect(vha, cnt)) |
|---|
| 3969 | + goto queuing_error; |
|---|
| 3970 | + } |
|---|
| 3971 | + |
|---|
| 3932 | 3972 | if (req->ring_index < cnt) |
|---|
| 3933 | 3973 | req->cnt = cnt - req->ring_index; |
|---|
| 3934 | 3974 | else |
|---|
| .. | .. |
|---|
| 3967 | 4007 | qla2x00_start_iocbs(vha, req); |
|---|
| 3968 | 4008 | queuing_error: |
|---|
| 3969 | 4009 | spin_unlock_irqrestore(&ha->hardware_lock, flags); |
|---|
| 4010 | + |
|---|
| 3970 | 4011 | return rval; |
|---|
| 3971 | 4012 | } |
|---|