Commit f9464393 authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://gkernel.bkbits.net/libata-2.6

into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents d6786c00 54899e21
......@@ -389,7 +389,7 @@ static void piix_sata_phy_reset(struct ata_port *ap)
static void piix_set_piomode (struct ata_port *ap, struct ata_device *adev)
{
unsigned int pio = adev->pio_mode;
unsigned int pio = adev->pio_mode - XFER_PIO_0;
struct pci_dev *dev = ap->host_set->pdev;
unsigned int is_slave = (adev->devno != 0);
unsigned int master_port= ap->port_no ? 0x42 : 0x40;
......
......@@ -1836,7 +1836,7 @@ static void ata_fill_sg(struct ata_queued_cmd *qc)
idx = 0;
for (nelem = qc->n_elem; nelem; nelem--,sg++) {
u32 addr, boundary;
u32 addr, offset;
u32 sg_len, len;
/* determine if physical DMA addr spans 64K boundary.
......@@ -1847,10 +1847,10 @@ static void ata_fill_sg(struct ata_queued_cmd *qc)
sg_len = sg_dma_len(sg);
while (sg_len) {
boundary = (addr & ~0xffff) + (0xffff + 1);
offset = addr & 0xffff;
len = sg_len;
if ((addr + sg_len) > boundary)
len = boundary - addr;
if ((offset + sg_len) > 0x10000)
len = 0x10000 - offset;
ap->prd[idx].addr = cpu_to_le32(addr);
ap->prd[idx].flags_len = cpu_to_le32(len & 0xffff);
......
......@@ -20,6 +20,10 @@
* If you do not delete the provisions above, a recipient may use your
* version of this file under either the OSL or the GPL.
*
* 0.03
* - Fixed a bug where the hotplug handlers for non-CK804/MCP04 were using
* mmio_base, which is only set for the CK804/MCP04 case.
*
* 0.02
* - Added support for CK804 SATA controller.
*
......@@ -40,7 +44,7 @@
#include <linux/libata.h>
#define DRV_NAME "sata_nv"
#define DRV_VERSION "0.02"
#define DRV_VERSION "0.03"
#define NV_PORTS 2
#define NV_PIO_MASK 0x1f
......@@ -422,33 +426,33 @@ static void nv_enable_hotplug(struct ata_probe_ent *probe_ent)
u8 intr_mask;
outb(NV_INT_STATUS_HOTPLUG,
(unsigned long)probe_ent->mmio_base + NV_INT_STATUS);
probe_ent->port[0].scr_addr + NV_INT_STATUS);
intr_mask = inb((unsigned long)probe_ent->mmio_base + NV_INT_ENABLE);
intr_mask = inb(probe_ent->port[0].scr_addr + NV_INT_ENABLE);
intr_mask |= NV_INT_ENABLE_HOTPLUG;
outb(intr_mask, (unsigned long)probe_ent->mmio_base + NV_INT_ENABLE);
outb(intr_mask, probe_ent->port[0].scr_addr + NV_INT_ENABLE);
}
static void nv_disable_hotplug(struct ata_host_set *host_set)
{
u8 intr_mask;
intr_mask = inb((unsigned long)host_set->mmio_base + NV_INT_ENABLE);
intr_mask = inb(host_set->ports[0]->ioaddr.scr_addr + NV_INT_ENABLE);
intr_mask &= ~(NV_INT_ENABLE_HOTPLUG);
outb(intr_mask, (unsigned long)host_set->mmio_base + NV_INT_ENABLE);
outb(intr_mask, host_set->ports[0]->ioaddr.scr_addr + NV_INT_ENABLE);
}
static void nv_check_hotplug(struct ata_host_set *host_set)
{
u8 intr_status;
intr_status = inb((unsigned long)host_set->mmio_base + NV_INT_STATUS);
intr_status = inb(host_set->ports[0]->ioaddr.scr_addr + NV_INT_STATUS);
// Clear interrupt status.
outb(0xff, (unsigned long)host_set->mmio_base + NV_INT_STATUS);
outb(0xff, host_set->ports[0]->ioaddr.scr_addr + NV_INT_STATUS);
if (intr_status & NV_INT_STATUS_HOTPLUG) {
if (intr_status & NV_INT_STATUS_PDEV_ADDED)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment