lkml.org 
[lkml]   [2015]   [Dec]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH v2 31/72] ncr5380: Fix !REQ timeout in do_abort()
    NCR5380_poll_politely() never returns -1. That means do_abort() can fail
    to handle a timeout after waiting for the target to negate REQ. Fix this
    and cleanup other NCR5380_poll_politely() call sites.

    Signed-off-by: Finn Thain <fthain@telegraphics.com.au>

    ---
    drivers/scsi/NCR5380.c | 10 +++++-----
    1 file changed, 5 insertions(+), 5 deletions(-)

    Index: linux/drivers/scsi/NCR5380.c
    ===================================================================
    --- linux.orig/drivers/scsi/NCR5380.c 2015-12-06 12:30:18.000000000 +1100
    +++ linux/drivers/scsi/NCR5380.c 2015-12-06 12:30:19.000000000 +1100
    @@ -1266,7 +1266,7 @@ static int NCR5380_select(struct Scsi_Ho
    err = NCR5380_poll_politely(instance, STATUS_REG, SR_REQ, SR_REQ, HZ);
    spin_lock_irq(instance->host_lock);

    - if(err) {
    + if (err < 0) {
    printk(KERN_ERR "scsi%d: timeout at NCR5380.c:%d\n", instance->host_no, __LINE__);
    NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);
    return -1;
    @@ -1485,8 +1485,7 @@ static int do_abort(struct Scsi_Host *in
    */

    rc = NCR5380_poll_politely(instance, STATUS_REG, SR_REQ, SR_REQ, 60 * HZ);
    -
    - if(rc < 0)
    + if (rc < 0)
    return -1;

    tmp = (unsigned char)rc;
    @@ -1497,7 +1496,7 @@ static int do_abort(struct Scsi_Host *in
    NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_ATN | ICR_ASSERT_ACK);
    rc = NCR5380_poll_politely(instance, STATUS_REG, SR_REQ, 0, 3 * HZ);
    NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_ATN);
    - if(rc == -1)
    + if (rc < 0)
    return -1;
    }
    tmp = ABORT;
    @@ -2194,7 +2193,8 @@ static void NCR5380_reselect(struct Scsi
    * FIXME: timeout needed and fail to work queeu
    */

    - if(NCR5380_poll_politely(instance, STATUS_REG, SR_REQ, SR_REQ, 2*HZ))
    + if (NCR5380_poll_politely(instance,
    + STATUS_REG, SR_REQ, SR_REQ, 2 * HZ) < 0)
    abort = 1;

    len = 1;



    \
     
     \ /
      Last update: 2015-12-06 05:21    [W:2.143 / U:0.100 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site