* [PATCH] sata_svw: check DMA start bit before reset
@ 2012-10-29 23:00 David Milburn
2012-11-16 4:55 ` Jeff Garzik
0 siblings, 1 reply; 2+ messages in thread
From: David Milburn @ 2012-10-29 23:00 UTC (permalink / raw)
To: jgarzik; +Cc: linux-ide, benh, caiqian
If kdump is triggered with pending IO, controller may not respond causing
kdump to fail.
http://marc.info/?l=linux-ide&m=133032255424658&w=2
During error recovery ata_do_dev_read_id never completes due hang
in mmio_insw.
ata_do_dev_read_id
ata_sff_data_xfer
ioread16_rep
mmio_insw
if DMA start bit is cleared before reset, PIO command is successful
and kdump succeeds.
Signed-off-by: David Milburn <dmilburn@redhat.com>
---
drivers/ata/sata_svw.c | 35 +++++++++++++++++++++++++++++++++++
1 files changed, 35 insertions(+), 0 deletions(-)
diff --git a/drivers/ata/sata_svw.c b/drivers/ata/sata_svw.c
index 44a4256..08608de 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,
return 0;
}
+static int k2_sata_softreset(struct ata_link *link,
+ unsigned int *class, unsigned long deadline)
+{
+ u8 dmactl;
+ void __iomem *mmio = link->ap->ioaddr.bmdma_addr;
+
+ dmactl = readb(mmio + ATA_DMA_CMD);
+
+ /* Clear the start bit */
+ if (dmactl & ATA_DMA_START) {
+ dmactl &= ~ATA_DMA_START;
+ writeb(dmactl, mmio + ATA_DMA_CMD);
+ }
+
+ return ata_sff_softreset(link, class, deadline);
+}
+
+static int k2_sata_hardreset(struct ata_link *link,
+ unsigned int *class, unsigned long deadline)
+{
+ u8 dmactl;
+ void __iomem *mmio = link->ap->ioaddr.bmdma_addr;
+
+ dmactl = readb(mmio + ATA_DMA_CMD);
+
+ /* Clear the start bit */
+ if (dmactl & ATA_DMA_START) {
+ dmactl &= ~ATA_DMA_START;
+ writeb(dmactl, mmio + ATA_DMA_CMD);
+ }
+
+ return sata_sff_hardreset(link, class, deadline);
+}
static void k2_sata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf)
{
@@ -346,6 +379,8 @@ static 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,
.sff_tf_load = k2_sata_tf_load,
.sff_tf_read = k2_sata_tf_read,
.sff_check_status = k2_stat_check_status,
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] sata_svw: check DMA start bit before reset
2012-10-29 23:00 [PATCH] sata_svw: check DMA start bit before reset David Milburn
@ 2012-11-16 4:55 ` Jeff Garzik
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2012-11-16 4:55 UTC (permalink / raw)
To: David Milburn; +Cc: linux-ide, benh, caiqian
On 10/29/2012 07:00 PM, David Milburn wrote:
> If kdump is triggered with pending IO, controller may not respond causing
> kdump to fail.
>
> http://marc.info/?l=linux-ide&m=133032255424658&w=2
>
> During error recovery ata_do_dev_read_id never completes due hang
> in mmio_insw.
>
> ata_do_dev_read_id
> ata_sff_data_xfer
> ioread16_rep
> mmio_insw
>
> if DMA start bit is cleared before reset, PIO command is successful
> and kdump succeeds.
>
> Signed-off-by: David Milburn <dmilburn@redhat.com>
> ---
> drivers/ata/sata_svw.c | 35 +++++++++++++++++++++++++++++++++++
> 1 files changed, 35 insertions(+), 0 deletions(-)
applied
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-11-16 4:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-29 23:00 [PATCH] sata_svw: check DMA start bit before reset David Milburn
2012-11-16 4:55 ` Jeff Garzik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).