FAILED: patch "[PATCH] ata: sata_inic162x: remove dangerous broken driver" failed to apply to 6.12-stable tree
Subsystems (2)
Sasha Levin
maintainerThe patch below does not apply to the 6.12-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.12.y
git checkout FETCH_HEAD
git cherry-pick -x 96fdeb7e3fd8d937f8351ed90824c9d904e590a1
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '[email protected]' --subject-prefix 'PATCH 6.12.y' 'HEAD^..'
Thanks,
Sasha
------------------ original commit in Linus's tree ------------------
From 96fdeb7e3fd8d937f8351ed90824c9d904e590a1 Mon Sep 17 00:00:00 2001
From: Ethan Nelson-Moore <[email protected]>
Date: Mon, 14 Sep 2026 18:47:09 -0700
Subject: [PATCH] ata: sata_inic162x: remove dangerous broken driver
The sata_inic162x driver was labeled as "very experimental" in commit bb9696192826 ("libata: make it clear that sata_inic162x is experimental") due to data corruption issues, but not marked as broken. Since then, no changes have been made to it that could fix these issues. Since the driver was not marked as broken, and the message about potential data corruption is only visible in the code and dmesg, it is possible that someone could enable the driver without realizing its potential for data corruption. Remove the driver to protect users' data.
--- drivers/ata/Kconfig | 7 - drivers/ata/Makefile | 1 - drivers/ata/sata_inic162x.c | 903 ------------------------------------ 3 files changed, 911 deletions(-) delete mode 100644 drivers/ata/sata_inic162x.c
drivers/ata/Kconfig +0 -7
@@ -328,13 +328,6 @@ config SATA_AHCI_SEATTLE If unsure, say N -config SATA_INIC162X - tristate "Initio 162x SATA support (Very Experimental)" - depends on PCI - select SATA_HOST - help - This option enables support for Initio 162x Serial ATA. - config SATA_ACARD_AHCI tristate "ACard AHCI variant (ATP 8620)" depends on PCI
drivers/ata/Makefile +0 -1
@@ -11,7 +11,6 @@ obj-$(CONFIG_SATA_AHCI_SEATTLE) += ahci_seattle.o libahci.o libahci_platform.o obj-$(CONFIG_SATA_AHCI_PLATFORM) += ahci_platform.o libahci.o libahci_platform.o obj-$(CONFIG_SATA_FSL) += sata_fsl.o obj-$(CONFIG_SATA_GEMINI) += sata_gemini.o -obj-$(CONFIG_SATA_INIC162X) += sata_inic162x.o obj-$(CONFIG_SATA_SIL24) += sata_sil24.o obj-$(CONFIG_SATA_DWC) += sata_dwc_460ex.o obj-$(CONFIG_SATA_HIGHBANK) += sata_highbank.o libahci.o
drivers/ata/sata_inic162x.c deleted +0 -903
903 lines not on this page · raw message
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 1/5 ata: libata-eh: Rename and make ata_set_mode() static
From: Damien Le Moal <[email protected]>
[ Upstream commit 6ba4d05c1425fe220d95395b4485443ce895bb95 ]
The function ata_set_mode() is defined and used only in libata-eh.c. Make this function static and rename it ata_eh_set_mode() to make it clear where its definition is.
No functional changes.
Stable-dep-of: 96fdeb7e3fd8 ("ata: sata_inic162x: remove dangerous broken driver")
--- drivers/ata/libata-eh.c | 9 +++++---- drivers/ata/libata.h | 1 - 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/ata/libata-eh.c +5 -4
@@ -3248,12 +3248,12 @@ static int ata_eh_revalidate_and_attach(struct ata_link *link, }/** -* ata_set_mode - Program timings and issue SET FEATURES - XFER +* ata_eh_set_mode - Program timings and issue SET FEATURES - XFER * @link: link on which timings will be programmed * @r_failed_dev: out parameter for failed device * * Set ATA device disk transfer mode (PIO3, UDMA6, etc.). If -* ata_set_mode() fails, pointer to the failing device is +* ata_eh_set_mode() fails, pointer to the failing device is * returned in @r_failed_dev. * * LOCKING:
@@ -3262,7 +3262,8 @@ static int ata_eh_revalidate_and_attach(struct ata_link *link,* RETURNS: * 0 on success, negative errno otherwise */ -int ata_set_mode (struct ata_link *link,struct ata_device **r_failed_dev) +static int ata_eh_set_mode (struct ata_link *link, +struct ata_device **r_failed_dev) {struct ata_port *ap = link->ap;struct ata_device *dev;
@@ -3900,7 +3901,7 @@ int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset,/* configure transfer mode if necessary */ if (ehc->i.flags &ATA_EHI_SETMODE ) { - rc =ata_set_mode (link, &dev); + rc =ata_eh_set_mode (link, &dev);if (rc) goto rest_fail; ehc->i.flags &= ~ATA_EHI_SETMODE ;
drivers/ata/libata.h +0 -1
@@ -199,7 +199,6 @@ extern void ata_eh_report(struct ata_port *ap);extern int ata_eh_reset (struct ata_link *link,int classify,ata_prereset_fn_t prereset,ata_reset_fn_t softreset,ata_reset_fn_t hardreset,ata_postreset_fn_t postreset); -extern int ata_set_mode (struct ata_link *link,struct ata_device **r_failed_dev); extern int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset, ata_reset_fn_t softreset, ata_reset_fn_t hardreset, ata_postreset_fn_t postreset,
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 2/5 ata: libata-eh: Remove ata_do_eh()
From: Damien Le Moal <[email protected]>
[ Upstream commit df6f9a918ea856fc288b9001b0414c5be136d7d0 ]
The only reason for ata_do_eh() to exist is that the two caller sites, ata_std_error_handler() and ata_sff_error_handler() may pass it a NULL hardreset operation so that the built-in (generic) hardreset operation for a driver is ignored if the adapter SCR access is not available.
However, ata_std_error_handler() and ata_sff_error_handler() modifications of the hardreset port operation can easily be combined as they are mutually exclusive. That is, a driver using sata_std_hardreset() as its hardreset operation cannot use sata_sff_hardreset() and vice-versa.
With this observation, ata_do_eh() can be removed and its code moved to ata_std_error_handler(). The condition used to ignore the built-in hardreset port operation is modified to be the one that was used in ata_sff_error_handler(). This requires defining a stub for the function sata_sff_hardreset() to avoid compilation errors when CONFIG_ATA_SFF is not enabled. Furthermore, instead of modifying the local hardreset operation definition, set the ATA_LFLAG_NO_HRST link flag to prevent the use of built-in hardreset methods for ports without a valid scr_read function. This flag is checked in ata_eh_reset() and if set, the hardreset method is ignored.
This change simplifies ata_sff_error_handler() as this function now only needs to call ata_std_error_handler().
No functional changes.
Stable-dep-of: 96fdeb7e3fd8 ("ata: sata_inic162x: remove dangerous broken driver")
--- drivers/ata/libata-eh.c | 48 ++++++++++++---------------------------- drivers/ata/libata-sff.c | 10 +-------- include/linux/libata.h | 9 +++++--- 3 files changed, 21 insertions(+), 46 deletions(-)
drivers/ata/libata-eh.c +14 -34
@@ -4040,59 +4040,39 @@ void ata_eh_finish(struct ata_port *ap) }/** -* ata_do_eh - do standard error handling +* ata_std_error_handler - standard error handler * @ap: host port to handle error for * -* @prereset: prereset method (can be NULL) -* @softreset: softreset method (can be NULL) -* @hardreset: hardreset method (can be NULL) -* @postreset: postreset method (can be NULL) -* * Perform standard error handling sequence. * * LOCKING: * Kernel thread context (may sleep). */ -void ata_do_eh (struct ata_port *ap,ata_prereset_fn_t prereset, -ata_reset_fn_t softreset,ata_reset_fn_t hardreset, -ata_postreset_fn_t postreset) +void ata_std_error_handler (struct ata_port *ap) { -struct ata_device *dev; +struct ata_port_operations *ops = ap->ops; +struct ata_link *link = &ap->link;int rc; +/* Ignore built-in hardresets if SCR access is not available */ +if ((ops->hardreset == sata_std_hardreset || + ops->hardreset == sata_sff_hardreset) && !sata_scr_valid (link)) + link->flags |=ATA_LFLAG_NO_HRST ; +ata_eh_autopsy (ap);ata_eh_report (ap); - rc =ata_eh_recover (ap, prereset, softreset, hardreset, postreset, -NULL ); + rc =ata_eh_recover (ap, ops->prereset, ops->softreset, + ops->hardreset, ops->postreset,NULL );if (rc) { -ata_for_each_dev (dev, &ap->link,ALL ) +struct ata_device *dev; + +ata_for_each_dev (dev, link,ALL )ata_dev_disable (dev); }ata_eh_finish (ap); } - -/** -* ata_std_error_handler - standard error handler -* @ap: host port to handle error for -* -* Standard error handler -* -* LOCKING: -* Kernel thread context (may sleep). -*/ -void ata_std_error_handler (struct ata_port *ap) -{ -struct ata_port_operations *ops = ap->ops; -ata_reset_fn_t hardreset = ops->hardreset; - -/* ignore built-in hardreset if SCR access is not available */ -if (hardreset == sata_std_hardreset && !sata_scr_valid (&ap->link)) - hardreset =NULL ; - -ata_do_eh (ap, ops->prereset, ops->softreset, hardreset, ops->postreset); -}EXPORT_SYMBOL_GPL (ata_std_error_handler);#ifdef CONFIG_PM
drivers/ata/libata-sff.c +1 -9
@@ -2054,8 +2054,6 @@ EXPORT_SYMBOL_GPL(ata_sff_drain_fifo);*/ void ata_sff_error_handler (struct ata_port *ap) { -ata_reset_fn_t softreset = ap->ops->softreset; -ata_reset_fn_t hardreset = ap->ops->hardreset;struct ata_queued_cmd *qc;unsigned long flags;
@@ -2077,13 +2075,7 @@ void ata_sff_error_handler(struct ata_port *ap)spin_unlock_irqrestore (ap->lock, flags); -/* ignore built-in hardresets if SCR access is not available */ -if ((hardreset == sata_std_hardreset || - hardreset == sata_sff_hardreset) && !sata_scr_valid (&ap->link)) - hardreset =NULL ; - -ata_do_eh (ap, ap->ops->prereset, softreset, hardreset, - ap->ops->postreset); +ata_std_error_handler (ap); }EXPORT_SYMBOL_GPL (ata_sff_error_handler);
include/linux/libata.h +6 -3
@@ -1418,9 +1418,6 @@ extern void ata_eh_thaw_port(struct ata_port *ap);extern void ata_eh_qc_complete (struct ata_queued_cmd *qc);extern void ata_eh_qc_retry (struct ata_queued_cmd *qc); -extern void ata_do_eh (struct ata_port *ap,ata_prereset_fn_t prereset, -ata_reset_fn_t softreset,ata_reset_fn_t hardreset, -ata_postreset_fn_t postreset);extern void ata_std_error_handler (struct ata_port *ap);extern void ata_std_sched_eh (struct ata_port *ap);extern void ata_std_end_eh (struct ata_port *ap);
@@ -2153,6 +2150,12 @@ static inline u8 ata_wait_idle(struct ata_port *ap)return status; } +#else /* CONFIG_ATA_SFF */ +static inline int sata_sff_hardreset (struct ata_link *link,unsigned int *class, +unsigned long deadline) +{ +return -EOPNOTSUPP ; +}#endif /* CONFIG_ATA_SFF */ #endif /* __LINUX_LIBATA_H__ */
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 3/5 ata: libata-eh: Simplify reset operation management
In reply to Sasha LevinFrom: Damien Le Moal <[email protected]>
[ Upstream commit a4daf088a77323154514eb1f8626bbdf9329cfd4 ]
Introduce struct ata_reset_operations to aggregate in a single structure the definitions of the 4 reset methods (prereset, softreset, hardreset and postreset) for a port. This new structure is used in struct ata_port to define the reset methods for a regular port (reset field) and for a port-multiplier port (pmp_reset field). A pointer to either of these fields replaces the 4 reset method arguments passed to ata_eh_recover() and ata_eh_reset().
The definition of the reset methods for all drivers is changed to use the reset and pmp_reset fields in struct ata_port_operations.
A large number of files is modifed, but no functional changes are introduced.
Stable-dep-of: 96fdeb7e3fd8 ("ata: sata_inic162x: remove dangerous broken driver")
--- drivers/ata/ahci.c | 6 ++--- drivers/ata/ahci_da850.c | 6 ++--- drivers/ata/ahci_dm816.c | 2 +- drivers/ata/ahci_imx.c | 13 ++++++----- drivers/ata/ahci_qoriq.c | 4 ++-- drivers/ata/ahci_xgene.c | 8 +++---- drivers/ata/ata_piix.c | 4 ++-- drivers/ata/libahci.c | 10 ++++----- drivers/ata/libata-core.c | 4 ++-- drivers/ata/libata-eh.c | 29 +++++++++++-------------- drivers/ata/libata-pmp.c | 26 ++++++++-------------- drivers/ata/libata-sata.c | 2 +- drivers/ata/libata-sff.c | 8 +++---- drivers/ata/libata.h | 8 +++---- drivers/ata/pata_acpi.c | 2 +- drivers/ata/pata_ali.c | 10 ++++----- drivers/ata/pata_amd.c | 4 ++-- drivers/ata/pata_artop.c | 4 ++-- drivers/ata/pata_atiixp.c | 2 +- drivers/ata/pata_efar.c | 2 +- drivers/ata/pata_ep93xx.c | 4 ++-- drivers/ata/pata_hpt366.c | 2 +- drivers/ata/pata_hpt37x.c | 4 ++-- drivers/ata/pata_hpt3x2n.c | 2 +- drivers/ata/pata_icside.c | 2 +- drivers/ata/pata_it8213.c | 2 +- drivers/ata/pata_jmicron.c | 2 +- drivers/ata/pata_marvell.c | 2 +- drivers/ata/pata_mpiix.c | 2 +- drivers/ata/pata_ns87410.c | 2 +- drivers/ata/pata_octeon_cf.c | 2 +- drivers/ata/pata_oldpiix.c | 2 +- drivers/ata/pata_opti.c | 2 +- drivers/ata/pata_optidma.c | 2 +- drivers/ata/pata_parport/pata_parport.c | 4 ++-- drivers/ata/pata_pdc2027x.c | 2 +- drivers/ata/pata_rdc.c | 2 +- drivers/ata/pata_sis.c | 2 +- drivers/ata/pata_sl82c105.c | 2 +- drivers/ata/pata_triflex.c | 2 +- drivers/ata/pata_via.c | 2 +- drivers/ata/pdc_adma.c | 2 +- drivers/ata/sata_dwc_460ex.c | 2 +- drivers/ata/sata_fsl.c | 6 ++--- drivers/ata/sata_highbank.c | 2 +- drivers/ata/sata_inic162x.c | 2 +- drivers/ata/sata_mv.c | 10 ++++----- drivers/ata/sata_nv.c | 2 +- drivers/ata/sata_promise.c | 4 ++-- drivers/ata/sata_qstor.c | 4 ++-- drivers/ata/sata_rcar.c | 2 +- drivers/ata/sata_sil24.c | 8 +++---- drivers/ata/sata_svw.c | 4 ++-- drivers/ata/sata_sx4.c | 2 +- drivers/ata/sata_uli.c | 2 +- drivers/ata/sata_via.c | 4 ++-- drivers/scsi/libsas/sas_ata.c | 4 ++-- include/linux/libata.h | 17 ++++++++------- 58 files changed, 134 insertions(+), 145 deletions(-)
drivers/ata/ahci.c +3 -3
@@ -111,17 +111,17 @@ static const struct scsi_host_template ahci_sht = {static struct ata_port_operations ahci_vt8251_ops = { .inherits = &ahci_ops, - .hardreset = ahci_vt8251_hardreset, + .reset.hardreset = ahci_vt8251_hardreset, };static struct ata_port_operations ahci_p5wdh_ops = { .inherits = &ahci_ops, - .hardreset = ahci_p5wdh_hardreset, + .reset.hardreset = ahci_p5wdh_hardreset, };static struct ata_port_operations ahci_avn_ops = { .inherits = &ahci_ops, - .hardreset = ahci_avn_hardreset, + .reset.hardreset = ahci_avn_hardreset, };static const struct ata_port_info ahci_port_info[] = {
drivers/ata/ahci_da850.c +3 -3
@@ -137,13 +137,13 @@ static int ahci_da850_hardreset(struct ata_link *link,static struct ata_port_operations ahci_da850_port_ops = { .inherits = &ahci_platform_ops, - .softreset = ahci_da850_softreset, + .reset.softreset = ahci_da850_softreset,/* * No need to override .pmp_softreset - it's only used for actual * PMP-enabled ports. */ - .hardreset = ahci_da850_hardreset, - .pmp_hardreset = ahci_da850_hardreset, + .reset.hardreset = ahci_da850_hardreset, + .pmp_reset.hardreset = ahci_da850_hardreset, };static const struct ata_port_info ahci_da850_port_info = {
drivers/ata/ahci_dm816.c +1 -1
@@ -124,7 +124,7 @@ static int ahci_dm816_softreset(struct ata_link *link,static struct ata_port_operations ahci_dm816_port_ops = { .inherits = &ahci_platform_ops, - .softreset = ahci_dm816_softreset, + .reset.softreset = ahci_dm816_softreset, };static const struct ata_port_info ahci_dm816_port_info = {
drivers/ata/ahci_imx.c +7 -6
@@ -642,18 +642,19 @@ static int ahci_imx_softreset(struct ata_link *link, unsigned int *class,int ret;if (imxpriv->type ==AHCI_IMX53 ) - ret = ahci_pmp_retry_srst_ops.softreset (link, class, deadline); + ret = ahci_pmp_retry_srst_ops.reset.softreset (link, class, + deadline);else - ret = ahci_ops.softreset (link, class, deadline); + ret = ahci_ops.reset.softreset (link, class, deadline);return ret; }static struct ata_port_operations ahci_imx_ops = { - .inherits = &ahci_ops, - .host_stop = ahci_imx_host_stop, - .error_handler = ahci_imx_error_handler, - .softreset = ahci_imx_softreset, + .inherits = &ahci_ops, + .host_stop = ahci_imx_host_stop, + .error_handler = ahci_imx_error_handler, + .reset.softreset = ahci_imx_softreset, };static const struct ata_port_info ahci_imx_port_info = {
drivers/ata/ahci_qoriq.c +2 -2
@@ -146,8 +146,8 @@ static int ahci_qoriq_hardreset(struct ata_link *link, unsigned int *class, }static struct ata_port_operations ahci_qoriq_ops = { - .inherits = &ahci_ops, - .hardreset = ahci_qoriq_hardreset, + .inherits = &ahci_ops, + .reset.hardreset = ahci_qoriq_hardreset, };static const struct ata_port_info ahci_qoriq_port_info = {
drivers/ata/ahci_xgene.c +4 -4
@@ -613,11 +613,11 @@ static irqreturn_t xgene_ahci_irq_intr(int irq, void *dev_instance)static struct ata_port_operations xgene_ahci_v1_ops = { .inherits = &ahci_ops, .host_stop = xgene_ahci_host_stop, - .hardreset = xgene_ahci_hardreset, + .reset.hardreset = xgene_ahci_hardreset, + .reset.softreset = xgene_ahci_softreset, + .pmp_reset.softreset = xgene_ahci_pmp_softreset, .read_id = xgene_ahci_read_id, .qc_issue = xgene_ahci_qc_issue, - .softreset = xgene_ahci_softreset, - .pmp_softreset = xgene_ahci_pmp_softreset };static const struct ata_port_info xgene_ahci_v1_port_info = {
@@ -630,7 +630,7 @@ static const struct ata_port_info xgene_ahci_v1_port_info = {static struct ata_port_operations xgene_ahci_v2_ops = { .inherits = &ahci_ops, .host_stop = xgene_ahci_host_stop, - .hardreset = xgene_ahci_hardreset, + .reset.hardreset = xgene_ahci_hardreset, .read_id = xgene_ahci_read_id, };
drivers/ata/ata_piix.c +2 -2
@@ -1074,7 +1074,7 @@ static struct ata_port_operations piix_pata_ops = { .cable_detect = ata_cable_40wire, .set_piomode = piix_set_piomode, .set_dmamode = piix_set_dmamode, - .prereset = piix_pata_prereset, + .reset.prereset = piix_pata_prereset, };static struct ata_port_operations piix_vmw_ops = {
@@ -1103,7 +1103,7 @@ static const struct scsi_host_template piix_sidpr_sht = {static struct ata_port_operations piix_sidpr_sata_ops = { .inherits = &piix_sata_ops, - .hardreset = sata_std_hardreset, + .reset.hardreset = sata_std_hardreset, .scr_read = piix_sidpr_scr_read, .scr_write = piix_sidpr_scr_write, .set_lpm = piix_sidpr_set_lpm,
drivers/ata/libahci.c +5 -5
@@ -163,10 +163,10 @@ struct ata_port_operations ahci_ops = { .freeze = ahci_freeze, .thaw = ahci_thaw, - .softreset = ahci_softreset, - .hardreset = ahci_hardreset, - .postreset = ahci_postreset, - .pmp_softreset = ahci_softreset, + .reset.softreset = ahci_softreset, + .reset.hardreset = ahci_hardreset, + .reset.postreset = ahci_postreset, + .pmp_reset.softreset = ahci_softreset, .error_handler = ahci_error_handler, .post_internal_cmd = ahci_post_internal_cmd, .dev_config = ahci_dev_config,
@@ -193,7 +193,7 @@ EXPORT_SYMBOL_GPL(ahci_ops);struct ata_port_operations ahci_pmp_retry_srst_ops = { .inherits = &ahci_ops, - .softreset = ahci_pmp_retry_softreset, + .reset.softreset = ahci_pmp_retry_softreset, };EXPORT_SYMBOL_GPL (ahci_pmp_retry_srst_ops);
drivers/ata/libata-core.c +2 -2
@@ -65,8 +65,8 @@#include "libata-transport.h" const struct ata_port_operations ata_base_port_ops = { - .prereset = ata_std_prereset, - .postreset = ata_std_postreset, + .reset.prereset = ata_std_prereset, + .reset.postreset = ata_std_postreset, .error_handler = ata_std_error_handler, .sched_eh = ata_std_sched_eh, .end_eh = ata_std_end_eh,
drivers/ata/libata-eh.c +13 -16
@@ -2633,13 +2633,16 @@ static int ata_eh_followup_srst_needed(struct ata_link *link, int rc) }int ata_eh_reset (struct ata_link *link,int classify, -ata_prereset_fn_t prereset,ata_reset_fn_t softreset, -ata_reset_fn_t hardreset,ata_postreset_fn_t postreset) +struct ata_reset_operations *reset_ops) {struct ata_port *ap = link->ap;struct ata_link *slave = ap->slave_link;struct ata_eh_context *ehc = &link->eh_context;struct ata_eh_context *sehc = slave ? &slave->eh_context :NULL ; +ata_reset_fn_t hardreset = reset_ops->hardreset; +ata_reset_fn_t softreset = reset_ops->softreset; +ata_prereset_fn_t prereset = reset_ops->prereset; +ata_postreset_fn_t postreset = reset_ops->postreset;unsigned int *classes = ehc->classes;unsigned int lflags = link->flags;int verbose = !(ehc->i.flags &ATA_EHI_QUIET );
@@ -3730,10 +3733,7 @@ static int ata_eh_handle_dev_fail(struct ata_device *dev, int err)/** * ata_eh_recover - recover host port after error * @ap: host port to recover -* @prereset: prereset method (can be NULL) -* @softreset: softreset method (can be NULL) -* @hardreset: hardreset method (can be NULL) -* @postreset: postreset method (can be NULL) +* @reset_ops: The set of reset operations to use * @r_failed_link: out parameter for failed link * * This is the alpha and omega, eum and yang, heart and soul of
@@ -3749,9 +3749,7 @@ static int ata_eh_handle_dev_fail(struct ata_device *dev, int err)* RETURNS: * 0 on success, -errno on failure. */ -int ata_eh_recover (struct ata_port *ap,ata_prereset_fn_t prereset, -ata_reset_fn_t softreset,ata_reset_fn_t hardreset, -ata_postreset_fn_t postreset, +int ata_eh_recover (struct ata_port *ap,struct ata_reset_operations *reset_ops,struct ata_link **r_failed_link) {struct ata_link *link;
@@ -3819,8 +3817,7 @@ int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset,if (!(ehc->i.action &ATA_EH_RESET ))continue ; - rc =ata_eh_reset (link,ata_link_nr_vacant (link), - prereset, softreset, hardreset, postreset); + rc =ata_eh_reset (link,ata_link_nr_vacant (link), reset_ops);if (rc) {ata_link_err (link,"reset failed, giving up\n" ); goto out;
@@ -4050,20 +4047,20 @@ void ata_eh_finish(struct ata_port *ap)*/ void ata_std_error_handler (struct ata_port *ap) { -struct ata_port_operations *ops = ap->ops; +struct ata_reset_operations *reset_ops = &ap->ops->reset;struct ata_link *link = &ap->link;int rc;/* Ignore built-in hardresets if SCR access is not available */ -if ((ops->hardreset == sata_std_hardreset || - ops->hardreset == sata_sff_hardreset) && !sata_scr_valid (link)) +if ((reset_ops->hardreset == sata_std_hardreset || + reset_ops->hardreset == sata_sff_hardreset) && + !sata_scr_valid (link)) link->flags |=ATA_LFLAG_NO_HRST ;ata_eh_autopsy (ap);ata_eh_report (ap); - rc =ata_eh_recover (ap, ops->prereset, ops->softreset, - ops->hardreset, ops->postreset,NULL ); + rc =ata_eh_recover (ap, reset_ops,NULL );if (rc) {struct ata_device *dev;
drivers/ata/libata-pmp.c +9 -17
@@ -15,9 +15,9 @@const struct ata_port_operations sata_pmp_port_ops = { .inherits = &sata_port_ops, - .pmp_prereset = ata_std_prereset, - .pmp_hardreset = sata_std_hardreset, - .pmp_postreset = ata_std_postreset, + .pmp_reset.prereset = ata_std_prereset, + .pmp_reset.hardreset = sata_std_hardreset, + .pmp_reset.postreset = ata_std_postreset, .error_handler = sata_pmp_error_handler, };
@@ -760,10 +760,7 @@ static int sata_pmp_revalidate_quick(struct ata_device *dev)/** * sata_pmp_eh_recover_pmp - recover PMP * @ap: ATA port PMP is attached to -* @prereset: prereset method (can be NULL) -* @softreset: softreset method -* @hardreset: hardreset method -* @postreset: postreset method (can be NULL) +* @reset_ops: The set of reset operations to use * * Recover PMP attached to @ap. Recovery procedure is somewhat * similar to that of ata_eh_recover() except that reset should
@@ -777,8 +774,7 @@ static int sata_pmp_revalidate_quick(struct ata_device *dev)* 0 on success, -errno on failure. */ static int sata_pmp_eh_recover_pmp (struct ata_port *ap, -ata_prereset_fn_t prereset,ata_reset_fn_t softreset, -ata_reset_fn_t hardreset,ata_postreset_fn_t postreset) +struct ata_reset_operations *reset_ops) {struct ata_link *link = &ap->link;struct ata_eh_context *ehc = &link->eh_context;
@@ -800,8 +796,7 @@ static int sata_pmp_eh_recover_pmp(struct ata_port *ap,struct ata_link *tlink;/* reset */ - rc =ata_eh_reset (link,0 , prereset, softreset, hardreset, - postreset); + rc =ata_eh_reset (link,0 , reset_ops);if (rc) {ata_link_err (link,"failed to reset PMP, giving up\n" ); goto fail;
@@ -965,8 +960,7 @@ static int sata_pmp_eh_recover(struct ata_port *ap) retry:/* PMP attached? */ if (!sata_pmp_attached (ap)) { - rc =ata_eh_recover (ap, ops->prereset, ops->softreset, - ops->hardreset, ops->postreset,NULL ); + rc =ata_eh_recover (ap, &ops->reset,NULL );if (rc) {ata_for_each_dev (dev, &ap->link,ALL )ata_dev_disable (dev);
@@ -984,8 +978,7 @@ static int sata_pmp_eh_recover(struct ata_port *ap) }/* recover pmp */ - rc =sata_pmp_eh_recover_pmp (ap, ops->prereset, ops->softreset, - ops->hardreset, ops->postreset); + rc =sata_pmp_eh_recover_pmp (ap, &ops->reset);if (rc) goto pmp_fail;
@@ -1011,8 +1004,7 @@ static int sata_pmp_eh_recover(struct ata_port *ap) goto pmp_fail;/* recover links */ - rc =ata_eh_recover (ap, ops->pmp_prereset, ops->pmp_softreset, - ops->pmp_hardreset, ops->pmp_postreset, &link); + rc =ata_eh_recover (ap, &ops->pmp_reset, &link);if (rc) goto link_fail;
drivers/ata/libata-sata.c +1 -1
@@ -1735,6 +1735,6 @@ const struct ata_port_operations sata_port_ops = { .inherits = &ata_base_port_ops, .qc_defer = ata_std_qc_defer, - .hardreset = sata_std_hardreset, + .reset.hardreset = sata_std_hardreset, };EXPORT_SYMBOL_GPL (sata_port_ops);
drivers/ata/libata-sff.c +4 -4
@@ -31,10 +31,10 @@ const struct ata_port_operations ata_sff_port_ops = { .freeze = ata_sff_freeze, .thaw = ata_sff_thaw, - .prereset = ata_sff_prereset, - .softreset = ata_sff_softreset, - .hardreset = sata_sff_hardreset, - .postreset = ata_sff_postreset, + .reset.prereset = ata_sff_prereset, + .reset.softreset = ata_sff_softreset, + .reset.hardreset = sata_sff_hardreset, + .reset.postreset = ata_sff_postreset, .error_handler = ata_sff_error_handler, .sff_dev_select = ata_sff_dev_select,
drivers/ata/libata.h +3 -5
@@ -197,11 +197,9 @@ extern void ata_eh_autopsy(struct ata_port *ap);const char *ata_get_cmd_name (u8 command);extern void ata_eh_report (struct ata_port *ap);extern int ata_eh_reset (struct ata_link *link,int classify, -ata_prereset_fn_t prereset,ata_reset_fn_t softreset, -ata_reset_fn_t hardreset,ata_postreset_fn_t postreset); -extern int ata_eh_recover (struct ata_port *ap,ata_prereset_fn_t prereset, -ata_reset_fn_t softreset,ata_reset_fn_t hardreset, -ata_postreset_fn_t postreset, +struct ata_reset_operations *reset_ops); +extern int ata_eh_recover (struct ata_port *ap, +struct ata_reset_operations *reset_ops,struct ata_link **r_failed_disk);extern void ata_eh_finish (struct ata_port *ap); extern int ata_ering_map(struct ata_ering *ering,
drivers/ata/pata_acpi.c +1 -1
@@ -216,7 +216,7 @@ static struct ata_port_operations pacpi_ops = { .mode_filter = pacpi_mode_filter, .set_piomode = pacpi_set_piomode, .set_dmamode = pacpi_set_dmamode, - .prereset = pacpi_pre_reset, + .reset.prereset = pacpi_pre_reset, .port_start = pacpi_port_start, };
drivers/ata/pata_ali.c +5 -5
@@ -392,11 +392,11 @@ static struct ata_port_operations ali_20_port_ops = {* Port operations for DMA capable ALi with cable detect */ static struct ata_port_operations ali_c2_port_ops = { - .inherits = &ali_dma_base_ops, - .check_atapi_dma = ali_check_atapi_dma, - .cable_detect = ali_c2_cable_detect, - .dev_config = ali_lock_sectors, - .postreset = ali_c2_c3_postreset, + .inherits = &ali_dma_base_ops, + .check_atapi_dma = ali_check_atapi_dma, + .cable_detect = ali_c2_cable_detect, + .dev_config = ali_lock_sectors, + .reset.postreset = ali_c2_c3_postreset, };/*
drivers/ata/pata_amd.c +2 -2
@@ -394,7 +394,7 @@ static const struct scsi_host_template amd_sht = {static const struct ata_port_operations amd_base_port_ops = { .inherits = &ata_bmdma32_port_ops, - .prereset = amd_pre_reset, + .reset.prereset = amd_pre_reset, };static struct ata_port_operations amd33_port_ops = {
@@ -429,7 +429,7 @@ static const struct ata_port_operations nv_base_port_ops = { .inherits = &ata_bmdma_port_ops, .cable_detect = ata_cable_ignore, .mode_filter = nv_mode_filter, - .prereset = nv_pre_reset, + .reset.prereset = nv_pre_reset, .host_stop = nv_host_stop, };
drivers/ata/pata_artop.c +2 -2
@@ -301,7 +301,7 @@ static struct ata_port_operations artop6210_ops = { .cable_detect = ata_cable_40wire, .set_piomode = artop6210_set_piomode, .set_dmamode = artop6210_set_dmamode, - .prereset = artop62x0_pre_reset, + .reset.prereset = artop62x0_pre_reset, .qc_defer = artop6210_qc_defer, };
@@ -310,7 +310,7 @@ static struct ata_port_operations artop6260_ops = { .cable_detect = artop6260_cable_detect, .set_piomode = artop6260_set_piomode, .set_dmamode = artop6260_set_dmamode, - .prereset = artop62x0_pre_reset, + .reset.prereset = artop62x0_pre_reset, };static void atp8xx_fixup (struct pci_dev *pdev)
drivers/ata/pata_atiixp.c +1 -1
@@ -264,7 +264,7 @@ static struct ata_port_operations atiixp_port_ops = { .bmdma_start = atiixp_bmdma_start, .bmdma_stop = atiixp_bmdma_stop, - .prereset = atiixp_prereset, + .reset.prereset = atiixp_prereset, .cable_detect = atiixp_cable_detect, .set_piomode = atiixp_set_piomode, .set_dmamode = atiixp_set_dmamode,
drivers/ata/pata_efar.c +1 -1
@@ -243,7 +243,7 @@ static struct ata_port_operations efar_ops = { .cable_detect = efar_cable_detect, .set_piomode = efar_set_piomode, .set_dmamode = efar_set_dmamode, - .prereset = efar_pre_reset, + .reset.prereset = efar_pre_reset, };
drivers/ata/pata_ep93xx.c +2 -2
@@ -891,8 +891,8 @@ static const struct scsi_host_template ep93xx_pata_sht = {static struct ata_port_operations ep93xx_pata_port_ops = { .inherits = &ata_bmdma_port_ops, - .softreset = ep93xx_pata_softreset, - .hardreset =ATA_OP_NULL , + .reset.softreset = ep93xx_pata_softreset, + .reset.hardreset =ATA_OP_NULL , .sff_dev_select = ep93xx_pata_dev_select, .sff_set_devctl = ep93xx_pata_set_devctl,
drivers/ata/pata_hpt366.c +1 -1
@@ -322,7 +322,7 @@ static const struct scsi_host_template hpt36x_sht = {static struct ata_port_operations hpt366_port_ops = { .inherits = &ata_bmdma_port_ops, - .prereset = hpt366_prereset, + .reset.prereset = hpt366_prereset, .cable_detect = hpt36x_cable_detect, .mode_filter = hpt366_filter, .set_piomode = hpt366_set_piomode,
drivers/ata/pata_hpt37x.c +2 -2
@@ -543,7 +543,7 @@ static struct ata_port_operations hpt370_port_ops = { .cable_detect = hpt37x_cable_detect, .set_piomode = hpt37x_set_piomode, .set_dmamode = hpt37x_set_dmamode, - .prereset = hpt37x_pre_reset, + .reset.prereset = hpt37x_pre_reset, };/*
@@ -567,7 +567,7 @@ static struct ata_port_operations hpt302_port_ops = { .cable_detect = hpt37x_cable_detect, .set_piomode = hpt37x_set_piomode, .set_dmamode = hpt37x_set_dmamode, - .prereset = hpt37x_pre_reset, + .reset.prereset = hpt37x_pre_reset, };/*
drivers/ata/pata_hpt3x2n.c +1 -1
@@ -356,7 +356,7 @@ static struct ata_port_operations hpt3xxn_port_ops = { .cable_detect = hpt3x2n_cable_detect, .set_piomode = hpt3x2n_set_piomode, .set_dmamode = hpt3x2n_set_dmamode, - .prereset = hpt3x2n_pre_reset, + .reset.prereset = hpt3x2n_pre_reset, };/*
drivers/ata/pata_icside.c +1 -1
@@ -336,7 +336,7 @@ static struct ata_port_operations pata_icside_port_ops = { .cable_detect = ata_cable_40wire, .set_dmamode = pata_icside_set_dmamode, - .postreset = pata_icside_postreset, + .reset.postreset = pata_icside_postreset, .port_start = ATA_OP_NULL, /* don't need PRD table */ };
drivers/ata/pata_it8213.c +1 -1
@@ -238,7 +238,7 @@ static struct ata_port_operations it8213_ops = { .cable_detect = it8213_cable_detect, .set_piomode = it8213_set_piomode, .set_dmamode = it8213_set_dmamode, - .prereset = it8213_pre_reset, + .reset.prereset = it8213_pre_reset, };
drivers/ata/pata_jmicron.c +1 -1
@@ -113,7 +113,7 @@ static const struct scsi_host_template jmicron_sht = {static struct ata_port_operations jmicron_ops = { .inherits = &ata_bmdma_port_ops, - .prereset = jmicron_pre_reset, + .reset.prereset = jmicron_pre_reset, };
drivers/ata/pata_marvell.c +1 -1
@@ -99,7 +99,7 @@ static const struct scsi_host_template marvell_sht = {static struct ata_port_operations marvell_ops = { .inherits = &ata_bmdma_port_ops, .cable_detect = marvell_cable_detect, - .prereset = marvell_pre_reset, + .reset.prereset = marvell_pre_reset, };
drivers/ata/pata_mpiix.c +1 -1
@@ -145,7 +145,7 @@ static struct ata_port_operations mpiix_port_ops = { .qc_issue = mpiix_qc_issue, .cable_detect = ata_cable_40wire, .set_piomode = mpiix_set_piomode, - .prereset = mpiix_pre_reset, + .reset.prereset = mpiix_pre_reset, .sff_data_xfer = ata_sff_data_xfer32, };
drivers/ata/pata_ns87410.c +1 -1
@@ -123,7 +123,7 @@ static struct ata_port_operations ns87410_port_ops = { .qc_issue = ns87410_qc_issue, .cable_detect = ata_cable_40wire, .set_piomode = ns87410_set_piomode, - .prereset = ns87410_pre_reset, + .reset.prereset = ns87410_pre_reset, };static int ns87410_init_one (struct pci_dev *dev,const struct pci_device_id *id)
drivers/ata/pata_octeon_cf.c +1 -1
@@ -942,7 +942,7 @@ static int octeon_cf_probe(struct platform_device *pdev)/* 16 bit but not True IDE */ base = cs0 +0x800 ; octeon_cf_ops.sff_data_xfer = octeon_cf_data_xfer16; - octeon_cf_ops.softreset = octeon_cf_softreset16; + octeon_cf_ops.reset.softreset = octeon_cf_softreset16; octeon_cf_ops.sff_check_status = octeon_cf_check_status16; octeon_cf_ops.sff_tf_read = octeon_cf_tf_read16; octeon_cf_ops.sff_tf_load = octeon_cf_tf_load16;
drivers/ata/pata_oldpiix.c +1 -1
@@ -214,7 +214,7 @@ static struct ata_port_operations oldpiix_pata_ops = { .cable_detect = ata_cable_40wire, .set_piomode = oldpiix_set_piomode, .set_dmamode = oldpiix_set_dmamode, - .prereset = oldpiix_pre_reset, + .reset.prereset = oldpiix_pre_reset, };
drivers/ata/pata_opti.c +1 -1
@@ -156,7 +156,7 @@ static struct ata_port_operations opti_port_ops = { .inherits = &ata_sff_port_ops, .cable_detect = ata_cable_40wire, .set_piomode = opti_set_piomode, - .prereset = opti_pre_reset, + .reset.prereset = opti_pre_reset, };static int opti_init_one (struct pci_dev *dev,const struct pci_device_id *id)
drivers/ata/pata_optidma.c +1 -1
@@ -344,7 +344,7 @@ static struct ata_port_operations optidma_port_ops = { .set_piomode = optidma_set_pio_mode, .set_dmamode = optidma_set_dma_mode, .set_mode = optidma_set_mode, - .prereset = optidma_pre_reset, + .reset.prereset = optidma_pre_reset, };static struct ata_port_operations optiplus_port_ops = {
drivers/ata/pata_parport/pata_parport.c +2 -2
@@ -321,8 +321,8 @@ static void pata_parport_drain_fifo(struct ata_queued_cmd *qc)static struct ata_port_operations pata_parport_port_ops = { .inherits = &ata_sff_port_ops, - .softreset = pata_parport_softreset, - .hardreset =NULL , + .reset.softreset = pata_parport_softreset, + .reset.hardreset =NULL , .sff_dev_select = pata_parport_dev_select, .sff_set_devctl = pata_parport_set_devctl,
drivers/ata/pata_pdc2027x.c +1 -1
@@ -130,7 +130,7 @@ static struct ata_port_operations pdc2027x_pata100_ops = { .inherits = &ata_bmdma_port_ops, .check_atapi_dma = pdc2027x_check_atapi_dma, .cable_detect = pdc2027x_cable_detect, - .prereset = pdc2027x_prereset, + .reset.prereset = pdc2027x_prereset, };static struct ata_port_operations pdc2027x_pata133_ops = {
drivers/ata/pata_rdc.c +1 -1
@@ -276,7 +276,7 @@ static struct ata_port_operations rdc_pata_ops = { .cable_detect = rdc_pata_cable_detect, .set_piomode = rdc_set_piomode, .set_dmamode = rdc_set_dmamode, - .prereset = rdc_pata_prereset, + .reset.prereset = rdc_pata_prereset, };static const struct ata_port_info rdc_port_info = {
drivers/ata/pata_sis.c +1 -1
@@ -552,7 +552,7 @@ static struct ata_port_operations sis_133_for_sata_ops = {static struct ata_port_operations sis_base_ops = { .inherits = &ata_bmdma_port_ops, - .prereset = sis_pre_reset, + .reset.prereset = sis_pre_reset, };static struct ata_port_operations sis_133_ops = {
drivers/ata/pata_sl82c105.c +1 -1
@@ -248,7 +248,7 @@ static struct ata_port_operations sl82c105_port_ops = { .bmdma_stop = sl82c105_bmdma_stop, .cable_detect = ata_cable_40wire, .set_piomode = sl82c105_set_piomode, - .prereset = sl82c105_pre_reset, + .reset.prereset = sl82c105_pre_reset, .sff_irq_check = sl82c105_sff_irq_check, };
drivers/ata/pata_triflex.c +1 -1
@@ -170,7 +170,7 @@ static struct ata_port_operations triflex_port_ops = { .bmdma_stop = triflex_bmdma_stop, .cable_detect = ata_cable_40wire, .set_piomode = triflex_set_piomode, - .prereset = triflex_prereset, + .reset.prereset = triflex_prereset, };static int triflex_init_one (struct pci_dev *dev,const struct pci_device_id *id)
drivers/ata/pata_via.c +1 -1
@@ -451,7 +451,7 @@ static struct ata_port_operations via_port_ops = { .cable_detect = via_cable_detect, .set_piomode = via_set_piomode, .set_dmamode = via_set_dmamode, - .prereset = via_pre_reset, + .reset.prereset = via_pre_reset, .sff_tf_load = via_tf_load, .port_start = via_port_start, .mode_filter = via_mode_filter,
drivers/ata/pdc_adma.c +1 -1
@@ -140,7 +140,7 @@ static struct ata_port_operations adma_ata_ops = { .freeze = adma_freeze, .thaw = adma_thaw, - .prereset = adma_prereset, + .reset.prereset = adma_prereset, .port_start = adma_port_start, .port_stop = adma_port_stop,
drivers/ata/sata_dwc_460ex.c +1 -1
@@ -1087,7 +1087,7 @@ static struct ata_port_operations sata_dwc_ops = { .inherits = &ata_sff_port_ops, .error_handler = sata_dwc_error_handler, - .hardreset = sata_dwc_hardreset, + .reset.hardreset = sata_dwc_hardreset, .qc_issue = sata_dwc_qc_issue,
drivers/ata/sata_fsl.c +3 -3
@@ -1395,9 +1395,9 @@ static struct ata_port_operations sata_fsl_ops = { .freeze = sata_fsl_freeze, .thaw = sata_fsl_thaw, - .softreset = sata_fsl_softreset, - .hardreset = sata_fsl_hardreset, - .pmp_softreset = sata_fsl_softreset, + .reset.softreset = sata_fsl_softreset, + .reset.hardreset = sata_fsl_hardreset, + .pmp_reset.softreset = sata_fsl_softreset, .error_handler = sata_fsl_error_handler, .post_internal_cmd = sata_fsl_post_internal_cmd,
drivers/ata/sata_highbank.c +1 -1
@@ -428,7 +428,7 @@ static int ahci_highbank_hardreset(struct ata_link *link, unsigned int *class,static struct ata_port_operations ahci_highbank_ops = { .inherits = &ahci_ops, - .hardreset = ahci_highbank_hardreset, + .reset.hardreset = ahci_highbank_hardreset, .transmit_led_message = ecx_transmit_led_message, };
drivers/ata/sata_inic162x.c +1 -1
@@ -730,7 +730,7 @@ static struct ata_port_operations inic_port_ops = { .freeze = inic_freeze, .thaw = inic_thaw, - .hardreset = inic_hardreset, + .reset.hardreset = inic_hardreset, .error_handler = inic_error_handler, .post_internal_cmd = inic_post_internal_cmd,
drivers/ata/sata_mv.c +5 -5
@@ -687,7 +687,7 @@ static struct ata_port_operations mv5_ops = { .freeze = mv_eh_freeze, .thaw = mv_eh_thaw, - .hardreset = mv_hardreset, + .reset.hardreset = mv_hardreset, .scr_read = mv5_scr_read, .scr_write = mv5_scr_write,
@@ -709,10 +709,10 @@ static struct ata_port_operations mv6_ops = { .freeze = mv_eh_freeze, .thaw = mv_eh_thaw, - .hardreset = mv_hardreset, - .softreset = mv_softreset, - .pmp_hardreset = mv_pmp_hardreset, - .pmp_softreset = mv_softreset, + .reset.hardreset = mv_hardreset, + .reset.softreset = mv_softreset, + .pmp_reset.hardreset = mv_pmp_hardreset, + .pmp_reset.softreset = mv_softreset, .error_handler = mv_pmp_error_handler, .scr_read = mv_scr_read,
drivers/ata/sata_nv.c +1 -1
@@ -462,7 +462,7 @@ static struct ata_port_operations nv_generic_ops = { .lost_interrupt = ATA_OP_NULL, .scr_read = nv_scr_read, .scr_write = nv_scr_write, - .hardreset = nv_hardreset, + .reset.hardreset = nv_hardreset, };static struct ata_port_operations nv_nf2_ops = {
drivers/ata/sata_promise.c +2 -2
@@ -188,7 +188,7 @@ static struct ata_port_operations pdc_sata_ops = { .scr_read = pdc_sata_scr_read, .scr_write = pdc_sata_scr_write, .port_start = pdc_sata_port_start, - .hardreset = pdc_sata_hardreset, + .reset.hardreset = pdc_sata_hardreset, };/* First-generation chips need a more restrictive ->check_atapi_dma op,
@@ -206,7 +206,7 @@ static struct ata_port_operations pdc_pata_ops = { .freeze = pdc_freeze, .thaw = pdc_thaw, .port_start = pdc_common_port_start, - .softreset = pdc_pata_softreset, + .reset.softreset = pdc_pata_softreset, };static const struct ata_port_info pdc_port_info[] = {
drivers/ata/sata_qstor.c +2 -2
@@ -123,8 +123,8 @@ static struct ata_port_operations qs_ata_ops = { .freeze = qs_freeze, .thaw = qs_thaw, - .prereset = qs_prereset, - .softreset = ATA_OP_NULL, + .reset.prereset = qs_prereset, + .reset.softreset = ATA_OP_NULL, .error_handler = qs_error_handler, .lost_interrupt = ATA_OP_NULL,
drivers/ata/sata_rcar.c +1 -1
@@ -624,7 +624,7 @@ static struct ata_port_operations sata_rcar_port_ops = { .freeze = sata_rcar_freeze, .thaw = sata_rcar_thaw, - .softreset = sata_rcar_softreset, + .reset.softreset = sata_rcar_softreset, .scr_read = sata_rcar_scr_read, .scr_write = sata_rcar_scr_write,
drivers/ata/sata_sil24.c +4 -4
@@ -394,10 +394,10 @@ static struct ata_port_operations sil24_ops = { .freeze = sil24_freeze, .thaw = sil24_thaw, - .softreset = sil24_softreset, - .hardreset = sil24_hardreset, - .pmp_softreset = sil24_softreset, - .pmp_hardreset = sil24_pmp_hardreset, + .reset.softreset = sil24_softreset, + .reset.hardreset = sil24_hardreset, + .pmp_reset.softreset = sil24_softreset, + .pmp_reset.hardreset = sil24_pmp_hardreset, .error_handler = sil24_error_handler, .post_internal_cmd = sil24_post_internal_cmd, .dev_config = sil24_dev_config,
drivers/ata/sata_svw.c +2 -2
@@ -340,8 +340,8 @@ static const struct scsi_host_template k2_sata_sht = {static struct ata_port_operations k2_sata_ops = { .inherits = &ata_bmdma_port_ops, - .softreset = k2_sata_softreset, - .hardreset = k2_sata_hardreset, + .reset.softreset = k2_sata_softreset, + .reset.hardreset = k2_sata_hardreset, .sff_tf_load = k2_sata_tf_load, .sff_tf_read = k2_sata_tf_read, .sff_check_status = k2_stat_check_status,
drivers/ata/sata_sx4.c +1 -1
@@ -241,7 +241,7 @@ static struct ata_port_operations pdc_20621_ops = { .freeze = pdc_freeze, .thaw = pdc_thaw, - .softreset = pdc_softreset, + .reset.softreset = pdc_softreset, .error_handler = pdc_error_handler, .lost_interrupt = ATA_OP_NULL, .post_internal_cmd = pdc_post_internal_cmd,
drivers/ata/sata_uli.c +1 -1
@@ -67,7 +67,7 @@ static struct ata_port_operations uli_ops = { .inherits = &ata_bmdma_port_ops, .scr_read = uli_scr_read, .scr_write = uli_scr_write, - .hardreset = ATA_OP_NULL, + .reset.hardreset = ATA_OP_NULL, };static const struct ata_port_info uli_port_info = {
drivers/ata/sata_via.c +2 -2
@@ -119,7 +119,7 @@ static struct ata_port_operations svia_base_ops = {static struct ata_port_operations vt6420_sata_ops = { .inherits = &svia_base_ops, .freeze = svia_noop_freeze, - .prereset = vt6420_prereset, + .reset.prereset = vt6420_prereset, .bmdma_start = vt6420_bmdma_start, };
@@ -139,7 +139,7 @@ static struct ata_port_operations vt6421_sata_ops = {static struct ata_port_operations vt8251_ops = { .inherits = &svia_base_ops, - .hardreset = sata_std_hardreset, + .reset.hardreset = sata_std_hardreset, .scr_read = vt8251_scr_read, .scr_write = vt8251_scr_write, };
drivers/scsi/libsas/sas_ata.c +2 -2
@@ -559,8 +559,8 @@ static int sas_ata_prereset(struct ata_link *link, unsigned long deadline) }static struct ata_port_operations sas_sata_ops = { - .prereset = sas_ata_prereset, - .hardreset = sas_ata_hard_reset, + .reset.prereset = sas_ata_prereset, + .reset.hardreset = sas_ata_hard_reset, .error_handler = ata_std_error_handler, .post_internal_cmd = sas_ata_post_internal, .qc_defer = ata_std_qc_defer,
include/linux/libata.h +9 -8
@@ -947,6 +947,13 @@ struct ata_port {*/ #define ATA_OP_NULL (void *)(unsigned long)(-ENOENT) +struct ata_reset_operations { +ata_prereset_fn_t prereset; +ata_reset_fn_t softreset; +ata_reset_fn_t hardreset; +ata_postreset_fn_t postreset; +}; +struct ata_port_operations {/* * Command execution
@@ -973,14 +980,8 @@ struct ata_port_operations {void (*freeze)(struct ata_port *ap);void (*thaw)(struct ata_port *ap); -ata_prereset_fn_t prereset; -ata_reset_fn_t softreset; -ata_reset_fn_t hardreset; -ata_postreset_fn_t postreset; -ata_prereset_fn_t pmp_prereset; -ata_reset_fn_t pmp_softreset; -ata_reset_fn_t pmp_hardreset; -ata_postreset_fn_t pmp_postreset; +struct ata_reset_operations reset; +struct ata_reset_operations pmp_reset;void (*error_handler)(struct ata_port *ap);void (*lost_interrupt)(struct ata_port *ap);void (*post_internal_cmd)(struct ata_queued_cmd *qc);
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 4/5 ata: libata: Add an argument to ata_eh_reset()
In reply to Sasha LevinFrom: Bart Van Assche <[email protected]>
[ Upstream commit 4b3c2ca268b0a66093793466e02d8566d642f19c ]
Pass the ATA port pointer as first argument to ata_eh_reset(). No functionality has been changed. This patch prepares for enabling lock context analysis. Without this patch, lockdep_assert_held() statements would have to be added before each ata_eh_reset() call because the compiler doesn't know that ap->link.p == ap. See also ata_link_init().
Stable-dep-of: 96fdeb7e3fd8 ("ata: sata_inic162x: remove dangerous broken driver")
--- drivers/ata/libata-eh.c | 6 +++--- drivers/ata/libata-pmp.c | 2 +- drivers/ata/libata.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-)
drivers/ata/libata-eh.c +3 -3
@@ -2632,10 +2632,9 @@ static int ata_eh_followup_srst_needed(struct ata_link *link, int rc)return 0 ; } -int ata_eh_reset (struct ata_link *link,int classify, +int ata_eh_reset (struct ata_port *ap,struct ata_link *link,int classify,struct ata_reset_operations *reset_ops) { -struct ata_port *ap = link->ap;struct ata_link *slave = ap->slave_link;struct ata_eh_context *ehc = &link->eh_context;struct ata_eh_context *sehc = slave ? &slave->eh_context :NULL ;
@@ -3817,7 +3816,8 @@ int ata_eh_recover(struct ata_port *ap, struct ata_reset_operations *reset_ops,if (!(ehc->i.action &ATA_EH_RESET ))continue ; - rc =ata_eh_reset (link,ata_link_nr_vacant (link), reset_ops); + rc =ata_eh_reset (ap, link,ata_link_nr_vacant (link), + reset_ops);if (rc) {ata_link_err (link,"reset failed, giving up\n" ); goto out;
drivers/ata/libata-pmp.c +1 -1
@@ -796,7 +796,7 @@ static int sata_pmp_eh_recover_pmp(struct ata_port *ap,struct ata_link *tlink;/* reset */ - rc =ata_eh_reset (link,0 , reset_ops); + rc =ata_eh_reset (ap, link,0 , reset_ops);if (rc) {ata_link_err (link,"failed to reset PMP, giving up\n" ); goto fail;
drivers/ata/libata.h +2 -2
@@ -196,8 +196,8 @@ extern void ata_eh_done(struct ata_link *link, struct ata_device *dev,extern void ata_eh_autopsy (struct ata_port *ap);const char *ata_get_cmd_name (u8 command);extern void ata_eh_report (struct ata_port *ap); -extern int ata_eh_reset (struct ata_link *link,int classify, -struct ata_reset_operations *reset_ops); +extern int ata_eh_reset (struct ata_port *ap,struct ata_link *link, +int classify,struct ata_reset_operations *reset_ops);extern int ata_eh_recover (struct ata_port *ap,struct ata_reset_operations *reset_ops,struct ata_link **r_failed_disk);
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 5/5 ata: sata_inic162x: remove dangerous broken driver
In reply to Sasha LevinFrom: Ethan Nelson-Moore <[email protected]>
[ Upstream commit 96fdeb7e3fd8d937f8351ed90824c9d904e590a1 ]
The sata_inic162x driver was labeled as "very experimental" in commit bb9696192826 ("libata: make it clear that sata_inic162x is experimental") due to data corruption issues, but not marked as broken. Since then, no changes have been made to it that could fix these issues. Since the driver was not marked as broken, and the message about potential data corruption is only visible in the code and dmesg, it is possible that someone could enable the driver without realizing its potential for data corruption. Remove the driver to protect users' data.
--- drivers/ata/Kconfig | 7 - drivers/ata/Makefile | 1 - drivers/ata/sata_inic162x.c | 902 ------------------------------------ 3 files changed, 910 deletions(-) delete mode 100644 drivers/ata/sata_inic162x.c
drivers/ata/Kconfig +0 -7
@@ -329,13 +329,6 @@ config SATA_AHCI_SEATTLE If unsure, say N -config SATA_INIC162X - tristate "Initio 162x SATA support (Very Experimental)" - depends on PCI - select SATA_HOST - help - This option enables support for Initio 162x Serial ATA. - config SATA_ACARD_AHCI tristate "ACard AHCI variant (ATP 8620)" depends on PCI
drivers/ata/Makefile +0 -1
@@ -9,7 +9,6 @@ obj-$(CONFIG_SATA_AHCI_SEATTLE) += ahci_seattle.o libahci.o libahci_platform.o obj-$(CONFIG_SATA_AHCI_PLATFORM) += ahci_platform.o libahci.o libahci_platform.o obj-$(CONFIG_SATA_FSL) += sata_fsl.o obj-$(CONFIG_SATA_GEMINI) += sata_gemini.o -obj-$(CONFIG_SATA_INIC162X) += sata_inic162x.o obj-$(CONFIG_SATA_SIL24) += sata_sil24.o obj-$(CONFIG_SATA_DWC) += sata_dwc_460ex.o obj-$(CONFIG_SATA_HIGHBANK) += sata_highbank.o libahci.o
drivers/ata/sata_inic162x.c deleted +0 -902
902 lines not on this page · raw message
Signature · 1 line
2.53.0