Skip to content

Commit 0384066

Browse files
committed
Merge tag 'libata-5.6-2020-02-05' of git://git.kernel.dk/linux-block
Pull libata updates from Jens Axboe: - Add a Sandisk CF card to supported pata_pcmcia list (Christian) - Move pata_arasan_cf away from legacy API (Peter) - Ensure ahci DMA/ints are shut down on shutdown (Prabhakar) * tag 'libata-5.6-2020-02-05' of git://git.kernel.dk/linux-block: ata: pata_arasan_cf: Use dma_request_chan() instead dma_request_slave_channel() ata: ahci: Add shutdown to freeze hardware resources of ahci pata_pcmia: add SanDisk High (>8G) CF card to supported list
2 parents 4c7d00c + 7991901 commit 0384066

File tree

5 files changed

+34
-2
lines changed

5 files changed

+34
-2
lines changed

drivers/ata/ahci.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ enum board_ids {
8181

8282
static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);
8383
static void ahci_remove_one(struct pci_dev *dev);
84+
static void ahci_shutdown_one(struct pci_dev *dev);
8485
static int ahci_vt8251_hardreset(struct ata_link *link, unsigned int *class,
8586
unsigned long deadline);
8687
static int ahci_avn_hardreset(struct ata_link *link, unsigned int *class,
@@ -606,6 +607,7 @@ static struct pci_driver ahci_pci_driver = {
606607
.id_table = ahci_pci_tbl,
607608
.probe = ahci_init_one,
608609
.remove = ahci_remove_one,
610+
.shutdown = ahci_shutdown_one,
609611
.driver = {
610612
.pm = &ahci_pci_pm_ops,
611613
},
@@ -1877,6 +1879,11 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
18771879
return 0;
18781880
}
18791881

1882+
static void ahci_shutdown_one(struct pci_dev *pdev)
1883+
{
1884+
ata_pci_shutdown_one(pdev);
1885+
}
1886+
18801887
static void ahci_remove_one(struct pci_dev *pdev)
18811888
{
18821889
pm_runtime_get_noresume(&pdev->dev);

drivers/ata/libata-core.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6767,6 +6767,26 @@ void ata_pci_remove_one(struct pci_dev *pdev)
67676767
ata_host_detach(host);
67686768
}
67696769

6770+
void ata_pci_shutdown_one(struct pci_dev *pdev)
6771+
{
6772+
struct ata_host *host = pci_get_drvdata(pdev);
6773+
int i;
6774+
6775+
for (i = 0; i < host->n_ports; i++) {
6776+
struct ata_port *ap = host->ports[i];
6777+
6778+
ap->pflags |= ATA_PFLAG_FROZEN;
6779+
6780+
/* Disable port interrupts */
6781+
if (ap->ops->freeze)
6782+
ap->ops->freeze(ap);
6783+
6784+
/* Stop the port DMA engines */
6785+
if (ap->ops->port_stop)
6786+
ap->ops->port_stop(ap);
6787+
}
6788+
}
6789+
67706790
/* move to PCI subsystem */
67716791
int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bits)
67726792
{
@@ -7387,6 +7407,7 @@ EXPORT_SYMBOL_GPL(ata_timing_cycle2mode);
73877407

73887408
#ifdef CONFIG_PCI
73897409
EXPORT_SYMBOL_GPL(pci_test_config_bits);
7410+
EXPORT_SYMBOL_GPL(ata_pci_shutdown_one);
73907411
EXPORT_SYMBOL_GPL(ata_pci_remove_one);
73917412
#ifdef CONFIG_PM
73927413
EXPORT_SYMBOL_GPL(ata_pci_device_do_suspend);

drivers/ata/pata_arasan_cf.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,9 +526,10 @@ static void data_xfer(struct work_struct *work)
526526

527527
/* request dma channels */
528528
/* dma_request_channel may sleep, so calling from process context */
529-
acdev->dma_chan = dma_request_slave_channel(acdev->host->dev, "data");
530-
if (!acdev->dma_chan) {
529+
acdev->dma_chan = dma_request_chan(acdev->host->dev, "data");
530+
if (IS_ERR(acdev->dma_chan)) {
531531
dev_err(acdev->host->dev, "Unable to get dma_chan\n");
532+
acdev->dma_chan = NULL;
532533
goto chan_request_fail;
533534
}
534535

@@ -539,6 +540,7 @@ static void data_xfer(struct work_struct *work)
539540
}
540541

541542
dma_release_channel(acdev->dma_chan);
543+
acdev->dma_chan = NULL;
542544

543545
/* data xferred successfully */
544546
if (!ret) {

drivers/ata/pata_pcmcia.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ static const struct pcmcia_device_id pcmcia_devices[] = {
309309
PCMCIA_DEVICE_MANF_CARD(0x0098, 0x0000), /* Toshiba */
310310
PCMCIA_DEVICE_MANF_CARD(0x00a4, 0x002d),
311311
PCMCIA_DEVICE_MANF_CARD(0x00ce, 0x0000), /* Samsung */
312+
PCMCIA_DEVICE_MANF_CARD(0x00f1, 0x0101), /* SanDisk High (>8G) CFA */
312313
PCMCIA_DEVICE_MANF_CARD(0x0319, 0x0000), /* Hitachi */
313314
PCMCIA_DEVICE_MANF_CARD(0x2080, 0x0001),
314315
PCMCIA_DEVICE_MANF_CARD(0x4e01, 0x0100), /* Viking CFA */

include/linux/libata.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,6 +1226,7 @@ struct pci_bits {
12261226
};
12271227

12281228
extern int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bits);
1229+
extern void ata_pci_shutdown_one(struct pci_dev *pdev);
12291230
extern void ata_pci_remove_one(struct pci_dev *pdev);
12301231

12311232
#ifdef CONFIG_PM

0 commit comments

Comments
 (0)