summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2022-12-13 10:54:19 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2022-12-13 10:54:19 -0800
commit8ecd28b7a3a4c43a875a8840851f72468a2ca1d7 (patch)
tree6716a7cfbf737e48dbc3a2875973e31f64d9de98 /include
parentce8a79d5601aab94c02ed4539c48e8605422ac94 (diff)
parentf07788079f515ca4a681c5f595bdad19cfbd7b1d (diff)
downloadlinux-8ecd28b7a3a4c43a875a8840851f72468a2ca1d7.tar.bz2
Merge tag 'ata-6.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata
Pull ata updates from Damien Le Moal: "The ususal set of driver fixes and improvements as well as several patches improving libata core in preparation of the introduction of the support for the command duration limits feature. In more details: - Define the missing COMPLETED sense key in scsi header (me) - Several patches to improve libata handling of the status of completed commands and the retry and sense data reported to the scsi layer for failed commands. In particular, this widen the support for NCQ autosense to all drives that support this feature instead of restricting this feature use to ZAC drives only (Niklas) - Cleanup of the pata_mpc52xx and sata_dwc_460ex drivers to remove the use of the deprecated NO_IRQ macro (Christophe) - Fix build dedependency on OF vs use of the of_match_ptr() macro to avoid build errors with the sata_gemini and pata_ftide010 drivers (me) - Some libata cleanups using the new helper function ata_port_is_frozen() (Niklas) - Improve internal command handling by not retrying commands that failed with a timeout (Niklas) - Remove code for several unused libata helper functions (from Niklas) - Remove the palmchip pata_bk3710 driver. A couple of other driver removal should come in through the arm tree pull request (from Arnd) - Remove unused variable and function in the sata_dwc_460ex driver and libata-sff code (Colin and Sergey) - Minor cleanup of the pata_ep93xx driver platform code (from Minghao) - Remove the unnecessary linux/msi.h include from the ahci driver (Thomas) - Changes to libata enum constants definitions to avoid warnings with gcc-13 (Arnd)" * tag 'ata-6.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata: (24 commits) ata: ahci: fix enum constants for gcc-13 ata: libata: fix commands incorrectly not getting retried during NCQ error ata: ahci: Remove linux/msi.h include ata: sata_dwc_460ex: Check !irq instead of irq == NO_IRQ ata: pata_ep93xx: use devm_platform_get_and_ioremap_resource() ata: libata-sff: kill unused ata_sff_busy_sleep() ata: sata_dwc_460ex: remove variable num_processed ata: remove palmchip pata_bk3710 driver ata: remove unused helper ata_id_flush_ext_enabled() ata: remove unused helper ata_id_flush_enabled() ata: remove unused helper ata_id_lba48_enabled() ata: libata-core: do not retry reading the log on timeout scsi: libsas: make use of ata_port_is_frozen() helper ata: make use of ata_port_is_frozen() helper ata: add ata_port_is_frozen() helper ata: pata_ftide010: Remove build dependency on OF ata: sata_gemini: Remove dependency on OF for compile tests ata: pata_mpc52xx: Replace NO_IRQ with 0 ata: libahci: read correct status and error field for NCQ commands ata: libata: fetch sense data for ATA devices supporting sense reporting ...
Diffstat (limited to 'include')
-rw-r--r--include/linux/ata.h31
-rw-r--r--include/linux/libata.h7
-rw-r--r--include/scsi/scsi_proto.h4
3 files changed, 7 insertions, 35 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h
index e3050e153a71..0c18499f60b6 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -615,15 +615,6 @@ static inline bool ata_id_has_flush(const u16 *id)
return id[ATA_ID_COMMAND_SET_2] & (1 << 12);
}
-static inline bool ata_id_flush_enabled(const u16 *id)
-{
- if (ata_id_has_flush(id) == 0)
- return false;
- if ((id[ATA_ID_CSF_DEFAULT] & 0xC000) != 0x4000)
- return false;
- return id[ATA_ID_CFS_ENABLE_2] & (1 << 12);
-}
-
static inline bool ata_id_has_flush_ext(const u16 *id)
{
if ((id[ATA_ID_COMMAND_SET_2] & 0xC000) != 0x4000)
@@ -631,19 +622,6 @@ static inline bool ata_id_has_flush_ext(const u16 *id)
return id[ATA_ID_COMMAND_SET_2] & (1 << 13);
}
-static inline bool ata_id_flush_ext_enabled(const u16 *id)
-{
- if (ata_id_has_flush_ext(id) == 0)
- return false;
- if ((id[ATA_ID_CSF_DEFAULT] & 0xC000) != 0x4000)
- return false;
- /*
- * some Maxtor disks have bit 13 defined incorrectly
- * so check bit 10 too
- */
- return (id[ATA_ID_CFS_ENABLE_2] & 0x2400) == 0x2400;
-}
-
static inline u32 ata_id_logical_sector_size(const u16 *id)
{
/* T13/1699-D Revision 6a, Sep 6, 2008. Page 128.
@@ -698,15 +676,6 @@ static inline bool ata_id_has_lba48(const u16 *id)
return id[ATA_ID_COMMAND_SET_2] & (1 << 10);
}
-static inline bool ata_id_lba48_enabled(const u16 *id)
-{
- if (ata_id_has_lba48(id) == 0)
- return false;
- if ((id[ATA_ID_CSF_DEFAULT] & 0xC000) != 0x4000)
- return false;
- return id[ATA_ID_CFS_ENABLE_2] & (1 << 10);
-}
-
static inline bool ata_id_hpa_enabled(const u16 *id)
{
/* Yes children, word 83 valid bits cover word 82 data */
diff --git a/include/linux/libata.h b/include/linux/libata.h
index fe990176e6ee..c9149ebe7423 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -1043,6 +1043,11 @@ static inline int ata_port_is_dummy(struct ata_port *ap)
return ap->ops == &ata_dummy_port_ops;
}
+static inline bool ata_port_is_frozen(const struct ata_port *ap)
+{
+ return ap->pflags & ATA_PFLAG_FROZEN;
+}
+
extern int ata_std_prereset(struct ata_link *link, unsigned long deadline);
extern int ata_wait_after_reset(struct ata_link *link, unsigned long deadline,
int (*check_ready)(struct ata_link *link));
@@ -1913,8 +1918,6 @@ extern void ata_sff_dev_select(struct ata_port *ap, unsigned int device);
extern u8 ata_sff_check_status(struct ata_port *ap);
extern void ata_sff_pause(struct ata_port *ap);
extern void ata_sff_dma_pause(struct ata_port *ap);
-extern int ata_sff_busy_sleep(struct ata_port *ap,
- unsigned long timeout_pat, unsigned long timeout);
extern int ata_sff_wait_ready(struct ata_link *link, unsigned long deadline);
extern void ata_sff_tf_load(struct ata_port *ap, const struct ata_taskfile *tf);
extern void ata_sff_tf_read(struct ata_port *ap, struct ata_taskfile *tf);
diff --git a/include/scsi/scsi_proto.h b/include/scsi/scsi_proto.h
index c03e35fc382c..919ed4137f9a 100644
--- a/include/scsi/scsi_proto.h
+++ b/include/scsi/scsi_proto.h
@@ -205,10 +205,10 @@ enum sam_status {
};
#define STATUS_MASK 0xfe
+
/*
* SENSE KEYS
*/
-
#define NO_SENSE 0x00
#define RECOVERED_ERROR 0x01
#define NOT_READY 0x02
@@ -223,7 +223,7 @@ enum sam_status {
#define ABORTED_COMMAND 0x0b
#define VOLUME_OVERFLOW 0x0d
#define MISCOMPARE 0x0e
-
+#define COMPLETED 0x0f
/*
* DEVICE TYPES