> On Aug 10, 2015, at 6:52 PM, Daniel Axtens <d...@axtens.net> wrote:
> 
>> @@ -487,11 +515,27 @@ static int cxlflash_eh_host_reset_handler(struct 
>> scsi_cmnd *scp)
>>               get_unaligned_be32(&((u32 *)scp->cmnd)[2]),
>>               get_unaligned_be32(&((u32 *)scp->cmnd)[3]));
>> 
>> -    rcr = cxlflash_afu_reset(cfg);
>> -    if (rcr == 0)
>> -            rc = SUCCESS;
>> -    else
>> +    switch (cfg->state) {
>> +    case STATE_NORMAL:
>> +            cfg->state = STATE_LIMBO;
>> +            scsi_block_requests(cfg->host);
>> +
>> +            rcr = cxlflash_afu_reset(cfg);
>> +            if (!rcr)
>> +                    rc = FAILED;
> 
> I think you want:
> 
>       if (rcr) {
>               rc = FAILED;
>               break;
>       }
> 
> cxlflash_afu_reset returns 0 on success, so I think you want to drop the
> negation, and also I think if it fails you want to break out and not set
> STATE_NORMAL. Is that right?

Good catch!

Both of these were an oversight on my part and are now fixed. They’ll be
included with v5.

> 
> Once you fix that, or explain to me why I'm wrong:
> Reviewed-by: Daniel Axtens <d...@axtens.net>

Thanks.

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to