lkml.org 
[lkml]   [2019]   [Dec]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] ata: ahci: Add shutdown handler
Date
An issue found while doing kexec on Annapurna Labs SoC: an AXI read
error occur due to an access from the interrupt handler of AHCI to the
AHCI controller.
This patch make sure that the interrupts are disabled for the controller
while doing kexec.

The shutdown handler is called during system shutdown to disable host
controller DMA and interrupts in order to avoid potentially corrupting
or otherwise interfering with a new kernel being started with kexec.

Signed-off-by: Hanna Hawa <hhhawa@amazon.com>
---
drivers/ata/ahci.c | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 05c2b32dcc4d..34ddc259343a 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -80,6 +80,7 @@ enum board_ids {

static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);
static void ahci_remove_one(struct pci_dev *dev);
+static void ahci_shutdown(struct pci_dev *dev);
static int ahci_vt8251_hardreset(struct ata_link *link, unsigned int *class,
unsigned long deadline);
static int ahci_avn_hardreset(struct ata_link *link, unsigned int *class,
@@ -593,6 +594,7 @@ static struct pci_driver ahci_pci_driver = {
.id_table = ahci_pci_tbl,
.probe = ahci_init_one,
.remove = ahci_remove_one,
+ .shutdown = ahci_shutdown,
.driver = {
.pm = &ahci_pci_pm_ops,
},
@@ -1870,6 +1872,13 @@ static void ahci_remove_one(struct pci_dev *pdev)
ata_pci_remove_one(pdev);
}

+static void ahci_shutdown(struct pci_dev *pdev)
+{
+ struct ata_host *host = pci_get_drvdata(pdev);
+
+ ahci_common_shutdown(host);
+}
+
module_pci_driver(ahci_pci_driver);

MODULE_AUTHOR("Jeff Garzik");
--
2.17.1
\
 
 \ /
  Last update: 2019-12-09 17:35    [W:0.053 / U:3.728 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site