> @@ -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?

Once you fix that, or explain to me why I'm wrong:
Reviewed-by: Daniel Axtens <[email protected]>

-- 
Regards,
Daniel

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to