diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-11-18 13:26:35 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-11-18 13:26:35 -0500 |
commit | 5e30c089e58dcf158b227909be848574f5a06fe9 (patch) | |
tree | c11d2b5cef57909953a8c9324bf105632477c0ac /drivers | |
parent | f4a75d2eb7b1e2206094b901be09adb31ba63681 (diff) | |
parent | 29448ec129c5c9c7ece2ef28c72a0dafd70c8af2 (diff) |
Merge tag 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev
Pull libata fixes from Jeff Garzik:
"If you were going to shoot me for not sending these earlier, you would
be right. -rc6 beat me by ~2 hours it seems, and they really should
have gone out long before that.
These have been in libata-dev.git for a day or so (unfortunately
linux-next is on vacation). The main one is #1, with the others being
minor bits. #1 has multiple tested-by, and can be considered a
regression fix IMO.
1) Fix ACPI oops:
https://bugzilla.kernel.org/show_bug.cgi?id=48211
2) Temporary WARN_ONCE() debugging patch for further ACPI debugging.
The code already oopses here, and so this merely gives slightly
better info. Related to
https://bugzilla.kernel.org/show_bug.cgi?id=49151
which has been bisected down to a patch that _exposes_ a latest
bug, but said bisection target does not actually appear to be the
root cause itself.
3) sata_svw: fix longstanding error recovery bug, which was
preventing kdump, by adding missing DMA-start bit check. Core
code was already checking DMA-start, but ancillary, less-used
routines were not. Fixed.
4) sata_highbank: fix minor __init/__devinit warning
5) Fix minor warning, if CONFIG_PM is set, but CONFIG_PM_SLEEP is not
set
6) pata_arasan: proper functioning requires clock setting"
* tag 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
[libata] PM callbacks should be conditionally compiled on CONFIG_PM_SLEEP
sata_svw: check DMA start bit before reset
libata debugging: Warn when unable to find timing descriptor based on xfer_mode
sata_highbank: mark ahci_highbank_probe as __devinit
pata_arasan: Initialize cf clock to 166MHz
libata-acpi: Fix NULL ptr derference in ata_acpi_dev_handle
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ata/ahci_platform.c | 2 | ||||
-rw-r--r-- | drivers/ata/libata-acpi.c | 11 | ||||
-rw-r--r-- | drivers/ata/libata-core.c | 4 | ||||
-rw-r--r-- | drivers/ata/pata_arasan_cf.c | 8 | ||||
-rw-r--r-- | drivers/ata/sata_highbank.c | 4 | ||||
-rw-r--r-- | drivers/ata/sata_svw.c | 35 |
6 files changed, 57 insertions, 7 deletions
diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c index b1ae48054dc5..b7078afddb74 100644 --- a/drivers/ata/ahci_platform.c +++ b/drivers/ata/ahci_platform.c | |||
@@ -238,7 +238,7 @@ static int __devexit ahci_remove(struct platform_device *pdev) | |||
238 | return 0; | 238 | return 0; |
239 | } | 239 | } |
240 | 240 | ||
241 | #ifdef CONFIG_PM | 241 | #ifdef CONFIG_PM_SLEEP |
242 | static int ahci_suspend(struct device *dev) | 242 | static int ahci_suspend(struct device *dev) |
243 | { | 243 | { |
244 | struct ahci_platform_data *pdata = dev_get_platdata(dev); | 244 | struct ahci_platform_data *pdata = dev_get_platdata(dev); |
diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c index fd9ecf74e631..5b0ba3f20edc 100644 --- a/drivers/ata/libata-acpi.c +++ b/drivers/ata/libata-acpi.c | |||
@@ -1105,10 +1105,15 @@ static int ata_acpi_bind_device(struct ata_port *ap, struct scsi_device *sdev, | |||
1105 | struct acpi_device *acpi_dev; | 1105 | struct acpi_device *acpi_dev; |
1106 | struct acpi_device_power_state *states; | 1106 | struct acpi_device_power_state *states; |
1107 | 1107 | ||
1108 | if (ap->flags & ATA_FLAG_ACPI_SATA) | 1108 | if (ap->flags & ATA_FLAG_ACPI_SATA) { |
1109 | ata_dev = &ap->link.device[sdev->channel]; | 1109 | if (!sata_pmp_attached(ap)) |
1110 | else | 1110 | ata_dev = &ap->link.device[sdev->id]; |
1111 | else | ||
1112 | ata_dev = &ap->pmp_link[sdev->channel].device[sdev->id]; | ||
1113 | } | ||
1114 | else { | ||
1111 | ata_dev = &ap->link.device[sdev->id]; | 1115 | ata_dev = &ap->link.device[sdev->id]; |
1116 | } | ||
1112 | 1117 | ||
1113 | *handle = ata_dev_acpi_handle(ata_dev); | 1118 | *handle = ata_dev_acpi_handle(ata_dev); |
1114 | 1119 | ||
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 3cc7096cfda7..f46fbd3bd3fb 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -2942,6 +2942,10 @@ const struct ata_timing *ata_timing_find_mode(u8 xfer_mode) | |||
2942 | 2942 | ||
2943 | if (xfer_mode == t->mode) | 2943 | if (xfer_mode == t->mode) |
2944 | return t; | 2944 | return t; |
2945 | |||
2946 | WARN_ONCE(true, "%s: unable to find timing for xfer_mode 0x%x\n", | ||
2947 | __func__, xfer_mode); | ||
2948 | |||
2945 | return NULL; | 2949 | return NULL; |
2946 | } | 2950 | } |
2947 | 2951 | ||
diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c index 26201ebef3ca..371fd2c698b7 100644 --- a/drivers/ata/pata_arasan_cf.c +++ b/drivers/ata/pata_arasan_cf.c | |||
@@ -317,6 +317,12 @@ static int cf_init(struct arasan_cf_dev *acdev) | |||
317 | return ret; | 317 | return ret; |
318 | } | 318 | } |
319 | 319 | ||
320 | ret = clk_set_rate(acdev->clk, 166000000); | ||
321 | if (ret) { | ||
322 | dev_warn(acdev->host->dev, "clock set rate failed"); | ||
323 | return ret; | ||
324 | } | ||
325 | |||
320 | spin_lock_irqsave(&acdev->host->lock, flags); | 326 | spin_lock_irqsave(&acdev->host->lock, flags); |
321 | /* configure CF interface clock */ | 327 | /* configure CF interface clock */ |
322 | writel((pdata->cf_if_clk <= CF_IF_CLK_200M) ? pdata->cf_if_clk : | 328 | writel((pdata->cf_if_clk <= CF_IF_CLK_200M) ? pdata->cf_if_clk : |
@@ -908,7 +914,7 @@ static int __devexit arasan_cf_remove(struct platform_device *pdev) | |||
908 | return 0; | 914 | return 0; |
909 | } | 915 | } |
910 | 916 | ||
911 | #ifdef CONFIG_PM | 917 | #ifdef CONFIG_PM_SLEEP |
912 | static int arasan_cf_suspend(struct device *dev) | 918 | static int arasan_cf_suspend(struct device *dev) |
913 | { | 919 | { |
914 | struct ata_host *host = dev_get_drvdata(dev); | 920 | struct ata_host *host = dev_get_drvdata(dev); |
diff --git a/drivers/ata/sata_highbank.c b/drivers/ata/sata_highbank.c index 0d7c4c2cd26f..400bf1c3e982 100644 --- a/drivers/ata/sata_highbank.c +++ b/drivers/ata/sata_highbank.c | |||
@@ -260,7 +260,7 @@ static const struct of_device_id ahci_of_match[] = { | |||
260 | }; | 260 | }; |
261 | MODULE_DEVICE_TABLE(of, ahci_of_match); | 261 | MODULE_DEVICE_TABLE(of, ahci_of_match); |
262 | 262 | ||
263 | static int __init ahci_highbank_probe(struct platform_device *pdev) | 263 | static int __devinit ahci_highbank_probe(struct platform_device *pdev) |
264 | { | 264 | { |
265 | struct device *dev = &pdev->dev; | 265 | struct device *dev = &pdev->dev; |
266 | struct ahci_host_priv *hpriv; | 266 | struct ahci_host_priv *hpriv; |
@@ -378,7 +378,7 @@ static int __devexit ahci_highbank_remove(struct platform_device *pdev) | |||
378 | return 0; | 378 | return 0; |
379 | } | 379 | } |
380 | 380 | ||
381 | #ifdef CONFIG_PM | 381 | #ifdef CONFIG_PM_SLEEP |
382 | static int ahci_highbank_suspend(struct device *dev) | 382 | static int ahci_highbank_suspend(struct device *dev) |
383 | { | 383 | { |
384 | struct ata_host *host = dev_get_drvdata(dev); | 384 | struct ata_host *host = dev_get_drvdata(dev); |
diff --git a/drivers/ata/sata_svw.c b/drivers/ata/sata_svw.c index 44a4256533e1..08608de87e4e 100644 --- a/drivers/ata/sata_svw.c +++ b/drivers/ata/sata_svw.c | |||
@@ -142,6 +142,39 @@ static int k2_sata_scr_write(struct ata_link *link, | |||
142 | return 0; | 142 | return 0; |
143 | } | 143 | } |
144 | 144 | ||
145 | static int k2_sata_softreset(struct ata_link *link, | ||
146 | unsigned int *class, unsigned long deadline) | ||
147 | { | ||
148 | u8 dmactl; | ||
149 | void __iomem *mmio = link->ap->ioaddr.bmdma_addr; | ||
150 | |||
151 | dmactl = readb(mmio + ATA_DMA_CMD); | ||
152 | |||
153 | /* Clear the start bit */ | ||
154 | if (dmactl & ATA_DMA_START) { | ||
155 | dmactl &= ~ATA_DMA_START; | ||
156 | writeb(dmactl, mmio + ATA_DMA_CMD); | ||
157 | } | ||
158 | |||
159 | return ata_sff_softreset(link, class, deadline); | ||
160 | } | ||
161 | |||
162 | static int k2_sata_hardreset(struct ata_link *link, | ||
163 | unsigned int *class, unsigned long deadline) | ||
164 | { | ||
165 | u8 dmactl; | ||
166 | void __iomem *mmio = link->ap->ioaddr.bmdma_addr; | ||
167 | |||
168 | dmactl = readb(mmio + ATA_DMA_CMD); | ||
169 | |||
170 | /* Clear the start bit */ | ||
171 | if (dmactl & ATA_DMA_START) { | ||
172 | dmactl &= ~ATA_DMA_START; | ||
173 | writeb(dmactl, mmio + ATA_DMA_CMD); | ||
174 | } | ||
175 | |||
176 | return sata_sff_hardreset(link, class, deadline); | ||
177 | } | ||
145 | 178 | ||
146 | static void k2_sata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf) | 179 | static void k2_sata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf) |
147 | { | 180 | { |
@@ -346,6 +379,8 @@ static struct scsi_host_template k2_sata_sht = { | |||
346 | 379 | ||
347 | static struct ata_port_operations k2_sata_ops = { | 380 | static struct ata_port_operations k2_sata_ops = { |
348 | .inherits = &ata_bmdma_port_ops, | 381 | .inherits = &ata_bmdma_port_ops, |
382 | .softreset = k2_sata_softreset, | ||
383 | .hardreset = k2_sata_hardreset, | ||
349 | .sff_tf_load = k2_sata_tf_load, | 384 | .sff_tf_load = k2_sata_tf_load, |
350 | .sff_tf_read = k2_sata_tf_read, | 385 | .sff_tf_read = k2_sata_tf_read, |
351 | .sff_check_status = k2_stat_check_status, | 386 | .sff_check_status = k2_stat_check_status, |