From fb5ab0df406b12130418cd430940f68df5eb8d32 Mon Sep 17 00:00:00 2001 From: Christian Schoffit Date: Wed, 13 Sep 2023 14:46:28 +0200 Subject: [PATCH] Restore LED trigers for each ATA port indicating disk activity Signed-off-by: Christian Schoffit --- ...=> 91-01-libata-add-ledtrig-support.patch} | 65 ++++++++----------- ...> 91-02-Enable-ATA-port-LED-trigger.patch} | 0 2 files changed, 26 insertions(+), 39 deletions(-) rename patch/kernel/archive/mvebu-6.1/{91-01-libata-add-ledtrig-support.patch.disable => 91-01-libata-add-ledtrig-support.patch} (64%) rename patch/kernel/archive/mvebu-6.1/{91-02-Enable-ATA-port-LED-trigger.patch.disabled => 91-02-Enable-ATA-port-LED-trigger.patch} (100%) diff --git a/patch/kernel/archive/mvebu-6.1/91-01-libata-add-ledtrig-support.patch.disable b/patch/kernel/archive/mvebu-6.1/91-01-libata-add-ledtrig-support.patch similarity index 64% rename from patch/kernel/archive/mvebu-6.1/91-01-libata-add-ledtrig-support.patch.disable rename to patch/kernel/archive/mvebu-6.1/91-01-libata-add-ledtrig-support.patch index a52e712d8..60ac19a2c 100644 --- a/patch/kernel/archive/mvebu-6.1/91-01-libata-add-ledtrig-support.patch.disable +++ b/patch/kernel/archive/mvebu-6.1/91-01-libata-add-ledtrig-support.patch @@ -1,25 +1,7 @@ -From: Daniel Golle -Subject: libata: add ledtrig support - -This adds a LED trigger for each ATA port indicating disk activity. - -As this is needed only on specific platforms (NAS SoCs and such), -these platforms should define ARCH_WANTS_LIBATA_LEDS if there -are boards with LED(s) intended to indicate ATA disk activity and -need the OS to take care of that. -In that way, if not selected, LED trigger support not will be -included in libata-core and both, codepaths and structures remain -untouched. - -Signed-off-by: Daniel Golle ---- - drivers/ata/Kconfig | 16 ++++++++++++++++ - drivers/ata/libata-core.c | 41 +++++++++++++++++++++++++++++++++++++++++ - include/linux/libata.h | 9 +++++++++ - 3 files changed, 66 insertions(+) - ---- a/drivers/ata/Kconfig -+++ b/drivers/ata/Kconfig +Index: 6.1__mvebu__armhf/drivers/ata/Kconfig +=================================================================== +--- 6.1__mvebu__armhf.orig/drivers/ata/Kconfig ++++ 6.1__mvebu__armhf/drivers/ata/Kconfig @@ -67,6 +67,22 @@ config ATA_FORCE If unsure, say Y. @@ -43,9 +25,11 @@ Signed-off-by: Daniel Golle config ATA_ACPI bool "ATA ACPI Support" depends on ACPI ---- a/drivers/ata/libata-core.c -+++ b/drivers/ata/libata-core.c -@@ -650,6 +650,19 @@ u64 ata_tf_read_block(const struct ata_t +Index: 6.1__mvebu__armhf/drivers/ata/libata-core.c +=================================================================== +--- 6.1__mvebu__armhf.orig/drivers/ata/libata-core.c ++++ 6.1__mvebu__armhf/drivers/ata/libata-core.c +@@ -663,6 +663,19 @@ u64 ata_tf_read_block(const struct ata_t return block; } @@ -64,18 +48,19 @@ Signed-off-by: Daniel Golle + /** * ata_build_rw_tf - Build ATA taskfile for given read/write request - * @tf: Target ATA taskfile -@@ -4513,6 +4526,9 @@ struct ata_queued_cmd *ata_qc_new_init(s - if (tag < 0) - return NULL; - } + * @qc: Metadata associated with the taskfile to build +@@ -4813,6 +4826,10 @@ void ata_qc_issue(struct ata_queued_cmd + struct ata_link *link = qc->dev->link; + u8 prot = qc->tf.protocol; + +#ifdef CONFIG_ATA_LEDS + ata_led_act(ap); +#endif - - qc = __ata_qc_from_tag(ap, tag); - qc->tag = qc->hw_tag = tag; -@@ -5291,6 +5307,9 @@ struct ata_port *ata_port_alloc(struct a ++ + /* Make sure only one non-NCQ command is outstanding. The + * check is skipped for old EH because it reuses active qc to + * request ATAPI sense. +@@ -5328,6 +5345,9 @@ struct ata_port *ata_port_alloc(struct a ap->stats.unhandled_irq = 1; ap->stats.idle_irq = 1; #endif @@ -85,7 +70,7 @@ Signed-off-by: Daniel Golle ata_sff_port_init(ap); return ap; -@@ -5326,6 +5345,12 @@ static void ata_host_release(struct kref +@@ -5363,6 +5383,12 @@ static void ata_host_release(struct kref kfree(ap->pmp_link); kfree(ap->slave_link); @@ -98,7 +83,7 @@ Signed-off-by: Daniel Golle kfree(ap); host->ports[i] = NULL; } -@@ -5732,7 +5757,23 @@ int ata_host_register(struct ata_host *h +@@ -5765,7 +5791,23 @@ int ata_host_register(struct ata_host *h host->ports[i]->print_id = atomic_inc_return(&ata_print_id); host->ports[i]->local_port_no = i + 1; } @@ -122,8 +107,10 @@ Signed-off-by: Daniel Golle /* Create associated sysfs transport objects */ for (i = 0; i < host->n_ports; i++) { rc = ata_tport_add(host->dev,host->ports[i]); ---- a/include/linux/libata.h -+++ b/include/linux/libata.h +Index: 6.1__mvebu__armhf/include/linux/libata.h +=================================================================== +--- 6.1__mvebu__armhf.orig/include/linux/libata.h ++++ 6.1__mvebu__armhf/include/linux/libata.h @@ -23,6 +23,9 @@ #include #include @@ -134,7 +121,7 @@ Signed-off-by: Daniel Golle /* * Define if arch has non-standard setup. This is a _PCI_ standard -@@ -882,6 +885,12 @@ struct ata_port { +@@ -857,6 +860,12 @@ struct ata_port { #ifdef CONFIG_ATA_ACPI struct ata_acpi_gtm __acpi_init_gtm; /* use ata_acpi_init_gtm() */ #endif diff --git a/patch/kernel/archive/mvebu-6.1/91-02-Enable-ATA-port-LED-trigger.patch.disabled b/patch/kernel/archive/mvebu-6.1/91-02-Enable-ATA-port-LED-trigger.patch similarity index 100% rename from patch/kernel/archive/mvebu-6.1/91-02-Enable-ATA-port-LED-trigger.patch.disabled rename to patch/kernel/archive/mvebu-6.1/91-02-Enable-ATA-port-LED-trigger.patch