Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 131779
b: refs/heads/master
c: 6b1ff03
h: refs/heads/master
i:
  131777: d7cd33d
  131775: efc987e
v: v3
  • Loading branch information
Kyle McMartin authored and Tony Luck committed Feb 25, 2009
1 parent 5b9d682 commit 7492793
Show file tree
Hide file tree
Showing 19 changed files with 108 additions and 180 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c4eb1bf63f3dc03611b79d6dd260dfa70c5e72f9
refs/heads/master: 6b1ff036d4cde7834ef2f9dbea5747adaaac24e0
6 changes: 2 additions & 4 deletions trunk/Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -868,10 +868,8 @@ and is between 256 and 4096 characters. It is defined in the file
icn= [HW,ISDN]
Format: <io>[,<membase>[,<icn_id>[,<icn_id2>]]]

ide-core.nodma= [HW] (E)IDE subsystem
Format: =0.0 to prevent dma on hda, =0.1 hdb =1.0 hdc
.vlb_clock .pci_clock .noflush .noprobe .nowerr .cdrom
.chs .ignore_cable are additional options
ide= [HW] (E)IDE subsystem
Format: ide=nodma or ide=doubler
See Documentation/ide/ide.txt.

idebus= [HW] (E)IDE subsystem - VLB/PCI bus speed
Expand Down
11 changes: 11 additions & 0 deletions trunk/arch/ia64/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,17 @@ config DMAR
and include PCI device scope covered by these DMA
remapping devices.

config DMAR_DEFAULT_ON
def_bool y
prompt "Enable DMA Remapping Devices by default"
depends on DMAR
help
Selecting this option will enable a DMAR device at boot time if
one is found. If this option is not selected, DMAR support can
be enabled by passing intel_iommu=on to the kernel. It is
recommended you say N here while the DMAR code remains
experimental.

endmenu

endif
Expand Down
76 changes: 17 additions & 59 deletions trunk/drivers/ata/pata_amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <linux/libata.h>

#define DRV_NAME "pata_amd"
#define DRV_VERSION "0.4.1"
#define DRV_VERSION "0.3.11"

/**
* timing_setup - shared timing computation and load
Expand Down Expand Up @@ -145,13 +145,6 @@ static int amd_pre_reset(struct ata_link *link, unsigned long deadline)
return ata_sff_prereset(link, deadline);
}

/**
* amd_cable_detect - report cable type
* @ap: port
*
* AMD controller/BIOS setups record the cable type in word 0x42
*/

static int amd_cable_detect(struct ata_port *ap)
{
static const u32 bitmask[2] = {0x03, 0x0C};
Expand All @@ -164,40 +157,6 @@ static int amd_cable_detect(struct ata_port *ap)
return ATA_CBL_PATA40;
}

/**
* amd_fifo_setup - set the PIO FIFO for ATA/ATAPI
* @ap: ATA interface
* @adev: ATA device
*
* Set the PCI fifo for this device according to the devices present
* on the bus at this point in time. We need to turn the post write buffer
* off for ATAPI devices as we may need to issue a word sized write to the
* device as the final I/O
*/

static void amd_fifo_setup(struct ata_port *ap)
{
struct ata_device *adev;
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
static const u8 fifobit[2] = { 0xC0, 0x30};
u8 fifo = fifobit[ap->port_no];
u8 r;


ata_for_each_dev(adev, &ap->link, ENABLED) {
if (adev->class == ATA_DEV_ATAPI)
fifo = 0;
}
if (pdev->device == PCI_DEVICE_ID_AMD_VIPER_7411) /* FIFO is broken */
fifo = 0;

/* On the later chips the read prefetch bits become no-op bits */
pci_read_config_byte(pdev, 0x41, &r);
r &= ~fifobit[ap->port_no];
r |= fifo;
pci_write_config_byte(pdev, 0x41, r);
}

/**
* amd33_set_piomode - set initial PIO mode data
* @ap: ATA interface
Expand All @@ -208,25 +167,21 @@ static void amd_fifo_setup(struct ata_port *ap)

static void amd33_set_piomode(struct ata_port *ap, struct ata_device *adev)
{
amd_fifo_setup(ap);
timing_setup(ap, adev, 0x40, adev->pio_mode, 1);
}

static void amd66_set_piomode(struct ata_port *ap, struct ata_device *adev)
{
amd_fifo_setup(ap);
timing_setup(ap, adev, 0x40, adev->pio_mode, 2);
}

static void amd100_set_piomode(struct ata_port *ap, struct ata_device *adev)
{
amd_fifo_setup(ap);
timing_setup(ap, adev, 0x40, adev->pio_mode, 3);
}

static void amd133_set_piomode(struct ata_port *ap, struct ata_device *adev)
{
amd_fifo_setup(ap);
timing_setup(ap, adev, 0x40, adev->pio_mode, 4);
}

Expand Down Expand Up @@ -442,16 +397,6 @@ static struct ata_port_operations nv133_port_ops = {
.set_dmamode = nv133_set_dmamode,
};

static void amd_clear_fifo(struct pci_dev *pdev)
{
u8 fifo;
/* Disable the FIFO, the FIFO logic will re-enable it as
appropriate */
pci_read_config_byte(pdev, 0x41, &fifo);
fifo &= 0x0F;
pci_write_config_byte(pdev, 0x41, fifo);
}

static int amd_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
{
static const struct ata_port_info info[10] = {
Expand Down Expand Up @@ -558,8 +503,14 @@ static int amd_init_one(struct pci_dev *pdev, const struct pci_device_id *id)

if (type < 3)
ata_pci_bmdma_clear_simplex(pdev);
if (pdev->vendor == PCI_VENDOR_ID_AMD)
amd_clear_fifo(pdev);

/* Check for AMD7411 */
if (type == 3)
/* FIFO is broken */
pci_write_config_byte(pdev, 0x41, fifo & 0x0F);
else
pci_write_config_byte(pdev, 0x41, fifo | 0xF0);

/* Cable detection on Nvidia chips doesn't work too well,
* cache BIOS programmed UDMA mode.
*/
Expand All @@ -585,11 +536,18 @@ static int amd_reinit_one(struct pci_dev *pdev)
return rc;

if (pdev->vendor == PCI_VENDOR_ID_AMD) {
amd_clear_fifo(pdev);
u8 fifo;
pci_read_config_byte(pdev, 0x41, &fifo);
if (pdev->device == PCI_DEVICE_ID_AMD_VIPER_7411)
/* FIFO is broken */
pci_write_config_byte(pdev, 0x41, fifo & 0x0F);
else
pci_write_config_byte(pdev, 0x41, fifo | 0xF0);
if (pdev->device == PCI_DEVICE_ID_AMD_VIPER_7409 ||
pdev->device == PCI_DEVICE_ID_AMD_COBRA_7401)
ata_pci_bmdma_clear_simplex(pdev);
}

ata_host_resume(host);
return 0;
}
Expand Down
3 changes: 0 additions & 3 deletions trunk/drivers/ata/pata_it821x.c
Original file line number Diff line number Diff line change
Expand Up @@ -557,9 +557,6 @@ static unsigned int it821x_read_id(struct ata_device *adev,
id[83] |= 0x4400; /* Word 83 is valid and LBA48 */
id[86] |= 0x0400; /* LBA48 on */
id[ATA_ID_MAJOR_VER] |= 0x1F;
/* Clear the serial number because it's different each boot
which breaks validation on resume */
memset(&id[ATA_ID_SERNO], 0x20, ATA_ID_SERNO_LEN);
}
return err_mask;
}
Expand Down
7 changes: 3 additions & 4 deletions trunk/drivers/ata/pata_legacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,9 @@ static void pdc20230_set_piomode(struct ata_port *ap, struct ata_device *adev)
static unsigned int pdc_data_xfer_vlb(struct ata_device *dev,
unsigned char *buf, unsigned int buflen, int rw)
{
int slop = buflen & 3;
/* 32bit I/O capable *and* we need to write a whole number of dwords */
if (ata_id_has_dword_io(dev->id) && (slop == 0 || slop == 3)) {
if (ata_id_has_dword_io(dev->id)) {
struct ata_port *ap = dev->link->ap;
int slop = buflen & 3;
unsigned long flags;

local_irq_save(flags);
Expand Down Expand Up @@ -736,7 +735,7 @@ static unsigned int vlb32_data_xfer(struct ata_device *adev, unsigned char *buf,
struct ata_port *ap = adev->link->ap;
int slop = buflen & 3;

if (ata_id_has_dword_io(adev->id) && (slop == 0 || slop == 3)) {
if (ata_id_has_dword_io(adev->id)) {
if (rw == WRITE)
iowrite32_rep(ap->ioaddr.data_addr, buf, buflen >> 2);
else
Expand Down
20 changes: 11 additions & 9 deletions trunk/drivers/ata/sata_mv.c
Original file line number Diff line number Diff line change
Expand Up @@ -3114,17 +3114,19 @@ static int mv_init_host(struct ata_host *host, unsigned int board_idx)
writelfl(0, hc_mmio + HC_IRQ_CAUSE_OFS);
}

/* Clear any currently outstanding host interrupt conditions */
writelfl(0, mmio + hpriv->irq_cause_ofs);
if (!IS_SOC(hpriv)) {
/* Clear any currently outstanding host interrupt conditions */
writelfl(0, mmio + hpriv->irq_cause_ofs);

/* and unmask interrupt generation for host regs */
writelfl(hpriv->unmask_all_irqs, mmio + hpriv->irq_mask_ofs);
/* and unmask interrupt generation for host regs */
writelfl(hpriv->unmask_all_irqs, mmio + hpriv->irq_mask_ofs);

/*
* enable only global host interrupts for now.
* The per-port interrupts get done later as ports are set up.
*/
mv_set_main_irq_mask(host, 0, PCI_ERR);
/*
* enable only global host interrupts for now.
* The per-port interrupts get done later as ports are set up.
*/
mv_set_main_irq_mask(host, 0, PCI_ERR);
}
done:
return rc;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/ide/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ menuconfig IDE
SMART parameters from disk drives.

To compile this driver as a module, choose M here: the
module will be called ide-core.ko.
module will be called ide.

For further information, please read <file:Documentation/ide/ide.txt>.

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/ide/amd74xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ static unsigned int init_chipset_amd74xx(struct pci_dev *dev)
* Check for broken FIFO support.
*/
if (dev->vendor == PCI_VENDOR_ID_AMD &&
dev->device == PCI_DEVICE_ID_AMD_VIPER_7411)
dev->vendor == PCI_DEVICE_ID_AMD_VIPER_7411)
t &= 0x0f;
else
t |= 0xf0;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/ide/atiixp.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static void atiixp_set_pio_mode(ide_drive_t *drive, const u8 pio)
{
struct pci_dev *dev = to_pci_dev(drive->hwif->dev);
unsigned long flags;
int timing_shift = (drive->dn ^ 1) * 8;
int timing_shift = (drive->dn & 2) ? 16 : 0 + (drive->dn & 1) ? 0 : 8;
u32 pio_timing_data;
u16 pio_mode_data;

Expand Down Expand Up @@ -85,7 +85,7 @@ static void atiixp_set_dma_mode(ide_drive_t *drive, const u8 speed)
{
struct pci_dev *dev = to_pci_dev(drive->hwif->dev);
unsigned long flags;
int timing_shift = (drive->dn ^ 1) * 8;
int timing_shift = (drive->dn & 2) ? 16 : 0 + (drive->dn & 1) ? 0 : 8;
u32 tmp32;
u16 tmp16;
u16 udma_ctl = 0;
Expand Down
35 changes: 9 additions & 26 deletions trunk/drivers/ide/ide-cd.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

static DEFINE_MUTEX(idecd_ref_mutex);

static void ide_cd_release(struct device *);
static void ide_cd_release(struct kref *);

static struct cdrom_info *ide_cd_get(struct gendisk *disk)
{
Expand All @@ -67,7 +67,7 @@ static struct cdrom_info *ide_cd_get(struct gendisk *disk)
if (ide_device_get(cd->drive))
cd = NULL;
else
get_device(&cd->dev);
kref_get(&cd->kref);

}
mutex_unlock(&idecd_ref_mutex);
Expand All @@ -79,7 +79,7 @@ static void ide_cd_put(struct cdrom_info *cd)
ide_drive_t *drive = cd->drive;

mutex_lock(&idecd_ref_mutex);
put_device(&cd->dev);
kref_put(&cd->kref, ide_cd_release);
ide_device_put(drive);
mutex_unlock(&idecd_ref_mutex);
}
Expand Down Expand Up @@ -194,14 +194,6 @@ static void cdrom_analyze_sense_data(ide_drive_t *drive,
bio_sectors = max(bio_sectors(failed_command->bio), 4U);
sector &= ~(bio_sectors - 1);

/*
* The SCSI specification allows for the value
* returned by READ CAPACITY to be up to 75 2K
* sectors past the last readable block.
* Therefore, if we hit a medium error within the
* last 75 2K sectors, we decrease the saved size
* value.
*/
if (sector < get_capacity(info->disk) &&
drive->probed_capacity - sector < 4 * 75)
set_capacity(info->disk, sector);
Expand Down Expand Up @@ -1798,17 +1790,15 @@ static void ide_cd_remove(ide_drive_t *drive)
ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__);

ide_proc_unregister_driver(drive, info->driver);
device_del(&info->dev);

del_gendisk(info->disk);

mutex_lock(&idecd_ref_mutex);
put_device(&info->dev);
mutex_unlock(&idecd_ref_mutex);
ide_cd_put(info);
}

static void ide_cd_release(struct device *dev)
static void ide_cd_release(struct kref *kref)
{
struct cdrom_info *info = to_ide_drv(dev, cdrom_info);
struct cdrom_info *info = to_ide_drv(kref, cdrom_info);
struct cdrom_device_info *devinfo = &info->devinfo;
ide_drive_t *drive = info->drive;
struct gendisk *g = info->disk;
Expand Down Expand Up @@ -2007,12 +1997,7 @@ static int ide_cd_probe(ide_drive_t *drive)

ide_init_disk(g, drive);

info->dev.parent = &drive->gendev;
info->dev.release = ide_cd_release;
dev_set_name(&info->dev, dev_name(&drive->gendev));

if (device_register(&info->dev))
goto out_free_disk;
kref_init(&info->kref);

info->drive = drive;
info->driver = &ide_cdrom_driver;
Expand All @@ -2026,7 +2011,7 @@ static int ide_cd_probe(ide_drive_t *drive)
g->driverfs_dev = &drive->gendev;
g->flags = GENHD_FL_CD | GENHD_FL_REMOVABLE;
if (ide_cdrom_setup(drive)) {
put_device(&info->dev);
ide_cd_release(&info->kref);
goto failed;
}

Expand All @@ -2036,8 +2021,6 @@ static int ide_cd_probe(ide_drive_t *drive)
add_disk(g);
return 0;

out_free_disk:
put_disk(g);
out_free_cd:
kfree(info);
failed:
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/ide/ide-cd.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ struct cdrom_info {
ide_drive_t *drive;
struct ide_driver *driver;
struct gendisk *disk;
struct device dev;
struct kref kref;

/* Buffer for table of contents. NULL if we haven't allocated
a TOC buffer for this device yet. */
Expand Down
Loading

0 comments on commit 7492793

Please sign in to comment.