Re: [PATCH v11 10/34] scsi: Have scsi-ml retry sd_spinup_disk errors

Martin Wilck
2023-09-15T21:24:19Z

On Fri, 2023-09-15 at 15:58 -0500, Mike Christie wrote:
> On 9/15/23 3:46 PM, Martin Wilck wrote:
> > >  sd_spinup_disk(struct scsi_disk *sdkp)
> > >  {
> > > -       unsigned char cmd[10];
> > > +       static const u8 cmd[10] = { TEST_UNIT_READY };
> > >         unsigned long spintime_expire = 0;
> > > -       int retries, spintime;
> > > +       int spintime, sense_valid = 0;
> > >         unsigned int the_result;
> > >         struct scsi_sense_hdr sshdr;
> > > +       struct scsi_failure failures[] = {
> > > +               /* Fail immediately for Medium Not Present */
> > > +               {
> > > +                       .sense = UNIT_ATTENTION,
> > > +                       .asc = 0x3A,
> > Shouldn't you set .ascq = SCMD_FAILURE_ASCQ_ANY here, and below as
> > well?
>
> You're right. Will fix all those cases.

I also noted that you don't treat .ascq = 0 consistently, e.g. in
07/34, where you set it for the NOT_READY case but not for others. It's
not wrong to omit it, but for code clarity it might be good to set it
explicitly.

Thanks,
Martin