* [PATCH] pata_rdc: parallel scanning needs an extra locking
@ 2011-10-13 14:06 Bartlomiej Zolnierkiewicz
2011-10-13 15:49 ` Alan Cox
0 siblings, 1 reply; 4+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2011-10-13 14:06 UTC (permalink / raw)
To: Jeff Garzik; +Cc: linux-ide, linux-kernel
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] pata_rdc: parallel scanning needs an extra locking
This is similar change as commit 60c3be3 ("ata_piix: parallel scanning
on PATA needs an extra locking") for ata_piix host driver.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ata/pata_rdc.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
Index: b/drivers/ata/pata_rdc.c
===================================================================
--- a/drivers/ata/pata_rdc.c
+++ b/drivers/ata/pata_rdc.c
@@ -86,6 +86,8 @@ static int rdc_pata_prereset(struct ata_
return ata_sff_prereset(link, deadline);
}
+static DEFINE_SPINLOCK(rdc_lock);
+
/**
* rdc_set_piomode - Initialize host controller PATA PIO timings
* @ap: Port whose timings we are configuring
@@ -101,6 +103,7 @@ static void rdc_set_piomode(struct ata_p
{
unsigned int pio = adev->pio_mode - XFER_PIO_0;
struct pci_dev *dev = to_pci_dev(ap->host->dev);
+ unsigned long flags;
unsigned int is_slave = (adev->devno != 0);
unsigned int master_port= ap->port_no ? 0x42 : 0x40;
unsigned int slave_port = 0x44;
@@ -124,6 +127,8 @@ static void rdc_set_piomode(struct ata_p
if (adev->class == ATA_DEV_ATA)
control |= 4; /* PPE enable */
+ spin_lock_irqsave(&rdc_lock, flags);
+
/* PIO configuration clears DTE unconditionally. It will be
* programmed in set_dmamode which is guaranteed to be called
* after set_piomode if any DMA mode is available.
@@ -161,6 +166,8 @@ static void rdc_set_piomode(struct ata_p
pci_read_config_byte(dev, 0x48, &udma_enable);
udma_enable &= ~(1 << (2 * ap->port_no + adev->devno));
pci_write_config_byte(dev, 0x48, udma_enable);
+
+ spin_unlock_irqrestore(&rdc_lock, flags);
}
/**
@@ -177,6 +184,7 @@ static void rdc_set_piomode(struct ata_p
static void rdc_set_dmamode(struct ata_port *ap, struct ata_device *adev)
{
struct pci_dev *dev = to_pci_dev(ap->host->dev);
+ unsigned long flags;
u8 master_port = ap->port_no ? 0x42 : 0x40;
u16 master_data;
u8 speed = adev->dma_mode;
@@ -190,6 +198,8 @@ static void rdc_set_dmamode(struct ata_p
{ 2, 1 },
{ 2, 3 }, };
+ spin_lock_irqsave(&rdc_lock, flags);
+
pci_read_config_word(dev, master_port, &master_data);
pci_read_config_byte(dev, 0x48, &udma_enable);
@@ -271,6 +281,8 @@ static void rdc_set_dmamode(struct ata_p
pci_write_config_word(dev, master_port, master_data);
}
pci_write_config_byte(dev, 0x48, udma_enable);
+
+ spin_unlock_irqrestore(&rdc_lock, flags);
}
static struct ata_port_operations rdc_pata_ops = {
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] pata_rdc: parallel scanning needs an extra locking
2011-10-13 14:06 [PATCH] pata_rdc: parallel scanning needs an extra locking Bartlomiej Zolnierkiewicz
@ 2011-10-13 15:49 ` Alan Cox
2011-10-13 16:08 ` Bartlomiej Zolnierkiewicz
0 siblings, 1 reply; 4+ messages in thread
From: Alan Cox @ 2011-10-13 15:49 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz; +Cc: Jeff Garzik, linux-ide, linux-kernel
On Thu, 13 Oct 2011 16:06:04 +0200
Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> wrote:
> From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> Subject: [PATCH] pata_rdc: parallel scanning needs an extra locking
>
> This is similar change as commit 60c3be3 ("ata_piix: parallel scanning
> on PATA needs an extra locking") for ata_piix host driver.
Again has anyone verified with the vendor that the RDC can support
parallel scanning ?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] pata_rdc: parallel scanning needs an extra locking
2011-10-13 15:49 ` Alan Cox
@ 2011-10-13 16:08 ` Bartlomiej Zolnierkiewicz
2011-10-13 19:11 ` Alan Cox
0 siblings, 1 reply; 4+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2011-10-13 16:08 UTC (permalink / raw)
To: Alan Cox; +Cc: Jeff Garzik, linux-ide, linux-kernel
Alan Cox wrote:
> On Thu, 13 Oct 2011 16:06:04 +0200
> Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> wrote:
>
> > From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> > Subject: [PATCH] pata_rdc: parallel scanning needs an extra locking
> >
> > This is similar change as commit 60c3be3 ("ata_piix: parallel scanning
> > on PATA needs an extra locking") for ata_piix host driver.
>
> Again has anyone verified with the vendor that the RDC can support
> parallel scanning ?
Upstream has always used it:
commit 6b406782ad0408f9cb480c2e1b543d194e8206d0
Author: Alan Cox <alan@linux.intel.com>
Date: Wed Jun 24 18:29:44 2009 +0100
[libata] Add pata_rdc driver for RDC ATA devices
From: Alan Cox <alan@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
...
+
+ host->flags |= ATA_HOST_PARALLEL_SCAN;
+
...
My patch only adds needed locking.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] pata_rdc: parallel scanning needs an extra locking
2011-10-13 16:08 ` Bartlomiej Zolnierkiewicz
@ 2011-10-13 19:11 ` Alan Cox
0 siblings, 0 replies; 4+ messages in thread
From: Alan Cox @ 2011-10-13 19:11 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz; +Cc: Jeff Garzik, linux-ide, linux-kernel
On Thu, 13 Oct 2011 18:08:31 +0200
Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> wrote:
> Alan Cox wrote:
>
> > On Thu, 13 Oct 2011 16:06:04 +0200
> > Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> wrote:
> >
> > > From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> > > Subject: [PATCH] pata_rdc: parallel scanning needs an extra locking
> > >
> > > This is similar change as commit 60c3be3 ("ata_piix: parallel scanning
> > > on PATA needs an extra locking") for ata_piix host driver.
> >
> > Again has anyone verified with the vendor that the RDC can support
> > parallel scanning ?
>
> Upstream has always used it:
Fair enough as nobody has complained.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-10-13 19:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-13 14:06 [PATCH] pata_rdc: parallel scanning needs an extra locking Bartlomiej Zolnierkiewicz
2011-10-13 15:49 ` Alan Cox
2011-10-13 16:08 ` Bartlomiej Zolnierkiewicz
2011-10-13 19:11 ` Alan Cox
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).