Skip to contentSkip to conversation

libata: scsi error handling, lk 2.6.14-rc1

PATCH In review Douglas Gilbert 3 participants 5 messages Sep 19, 2005 – Oct 4, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libata: scsi error handling, lk 2.6.14-rc1

Jeff,
This is a retransmission (and resync against lk 2.6.14-rc1) of a patch that I sent on 2005/8/28 . I haven't seen a reply.

If it has be applied, then my following patch ("[PATCH] libata: ATA Information VPD page, lk 2.6.14-rc1") should apply.

This patch adds more general error processing, typically for problems (or an early finish) detected while a SCSI command is being processed prior to an ATA command being executed.

Changelog:
- add extern ata_scsi_set_sense() to build SCSI sense data and corresponding status
- this allows removal of extern ata_scsi_badcmd() and static inline ata_bad_scsiop() and ata_bad_cdb()
- change "xlat" functions in libata-scsi so they are responsible for SCSI status and sense data when they return 1. This allows GOOD status or a specialized error to be set.
- set DRIVER_SENSE when SAM_STAT_CHECK_CONDITION is flagged in scsi_cmnd::result
- yield an error for mode sense requests for saved

    values [sat-r05]

- change recent rw_zero_length patch to do nothing (yield GOOD status) when transfer_length==0 for 10 and 16 byte READ and WRITE commands (SBC-2).

Doug Gilbert

drivers/scsi/libata.h2614rc1err renamed from drivers/scsi/libata.h +2 -10
@@ -76,18 +76,10 @@
 extern void ata_scsi_badcmd(struct scsi_cmnd *cmd,
 			    void (*done)(struct scsi_cmnd *),
 			    u8 asc, u8 ascq);
+extern void ata_scsi_set_sense(struct scsi_cmnd *cmd,
+			       u8 sk, u8 asc, u8 ascq);
 extern void ata_scsi_rbuf_fill(struct ata_scsi_args *args,
                         unsigned int (*actor) (struct ata_scsi_args *args,
                                            u8 *rbuf, unsigned int buflen));
 
-static inline void ata_bad_scsiop(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
-{
-	ata_scsi_badcmd(cmd, done, 0x20, 0x00);
-}
-
-static inline void ata_bad_cdb(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
-{
-	ata_scsi_badcmd(cmd, done, 0x24, 0x00);
-}
-
 #endif /* __LIBATA_H__ */
drivers/scsi/libata-scsi.c2614rc1err renamed from drivers/scsi/libata-scsi.c +145 -67

429 lines not on this page · raw message

#1 lore raw
Quoted 25 lines · Douglas Gilbert

Jeff,
This is a retransmission (and resync against lk 2.6.14-rc1) of a patch that I sent on 2005/8/28 . I haven't seen a reply.

If it has be applied, then my following patch ("[PATCH] libata: ATA Information VPD page, lk 2.6.14-rc1") should apply.

This patch adds more general error processing, typically for problems (or an early finish) detected while a SCSI command is being processed prior to an ATA command being executed.

Changelog:
- add extern ata_scsi_set_sense() to build SCSI sense data and corresponding status
- this allows removal of extern ata_scsi_badcmd() and static inline ata_bad_scsiop() and ata_bad_cdb()
- change "xlat" functions in libata-scsi so they are responsible for SCSI status and sense data when they return 1. This allows GOOD status or a specialized error to be set.
- set DRIVER_SENSE when SAM_STAT_CHECK_CONDITION is flagged in scsi_cmnd::result
- yield an error for mode sense requests for saved

Quoted 4 lines
    values [sat-r05]

- change recent rw_zero_length patch to do nothing (yield GOOD status) when transfer_length==0 for 10 and 16 byte READ and WRITE commands (SBC-2).

Hi Doug,

In March I got a bunch of patches in this same area into libata-dev; I'm not sure where they sit now (definitely not in 2.6.14-rc). Jeff would probably know.

See start of thread:
http://lkml.org/lkml/2005/3/17/157

So there would be conflicts if my stuff went forward--a lot of the changes are similar. I think the best bet would be to find the tree with my patches and for you to look at it and find problems that you solved in this patch that I didn't address.

BR

#2 lore raw
Quoted 6 lines · Brett Russ

In March I got a bunch of patches in this same area into libata-dev; I'm not sure where they sit now (definitely not in 2.6.14-rc). Jeff would probably know.

See start of thread:
http://lkml.org/lkml/2005/3/17/157

So there would be conflicts if my stuff went forward--a lot of the changes are similar. I think the best bet would be to find the tree with my patches and for you to look at it and find problems that you solved in this patch that I didn't address.

Embarrassingly, I'm afraid they have probably disappeared into the dust of my SATA patch archive. I completely forget the issues with your patches that caused me to not apply them immediately :(

Jeff

#3 lore raw
Quoted 1 line · Jeff Garzik

Embarrassingly, I'm afraid they have probably disappeared into the dust of my SATA patch archive. I completely forget the issues with your patches that caused me to not apply them immediately :(

Don't be embarrassed; you did apply them:

http://lkml.org/lkml/2005/3/24/331

So if we believe that message, the only job is to find out where they live. :-)

BR

#4 lore raw
Quoted 11 lines · Brett Russ
Quoted 1 line · Jeff Garzik

Embarrassingly, I'm afraid they have probably disappeared into the dust of my SATA patch archive. I completely forget the issues with your patches that caused me to not apply them immediately :(

Don't be embarrassed; you did apply them:

http://lkml.org/lkml/2005/3/24/331

So if we believe that message, the only job is to find out where they live. :-)

I can't find them, so it looks like they need resending :(

Wait a few days, for me to review Doug's patches, and see if anything is left to do after that.

Jeff