Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (76 commits)
  ide: use proper printk() KERN_* levels in ide-probe.c
  ide: fix for EATA SCSI HBA in ATA emulating mode
  ide: remove stale comments from drivers/ide/Makefile
  ide: enable local IRQs in all handlers for TASKFILE_NO_DATA data phase
  ide-scsi: remove kmalloced struct request
  ht6560b: remove old history
  ht6560b: update email address
  ide-cd: fix oops when using growisofs
  gayle: release resources on ide_host_add() failure
  palm_bk3710: add UltraDMA/100 support
  ide: trivial sparse annotations
  ide: ide-tape.c sparse annotations and unaligned access removal
  ide: drop 'name' parameter from ->init_chipset method
  ide: prefix messages from IDE PCI host drivers by driver name
  it821x: remove DECLARE_ITE_DEV() macro
  it8213: remove DECLARE_ITE_DEV() macro
  ide: include PCI device name in messages from IDE PCI host drivers
  ide: remove <asm/ide.h> for some archs
  ide-generic: remove ide_default_{io_base,irq}() inlines (take 3)
  ide-generic: is no longer needed on ppc32
  ...
  • Loading branch information
Linus Torvalds committed Jul 24, 2008
2 parents 1481b91 + 1b8ebad commit b5684b8
Show file tree
Hide file tree
Showing 71 changed files with 1,397 additions and 1,474 deletions.
2 changes: 1 addition & 1 deletion drivers/ide/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ comment "IDE chipset support/bugfixes"

config IDE_GENERIC
tristate "generic/default IDE chipset support"
depends on ALPHA || X86 || IA64 || M32R || MIPS || PPC32
depends on ALPHA || X86 || IA64 || M32R || MIPS
help
If unsure, say N.

Expand Down
9 changes: 1 addition & 8 deletions drivers/ide/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
#
# Makefile for the kernel ata, atapi, and ide block device drivers.
#
# 12 September 2000, Bartlomiej Zolnierkiewicz <bkz@linux-ide.org>
# Rewritten to use lists instead of if-statements.
#
# Note : at this point, these files are compiled on all systems.
# In the future, some of these should be built conditionally.
#
# link order is important here
#

EXTRA_CFLAGS += -Idrivers/ide

Expand Down
6 changes: 6 additions & 0 deletions drivers/ide/arm/icside.c
Original file line number Diff line number Diff line change
Expand Up @@ -710,8 +710,14 @@ static int __init icside_init(void)
return ecard_register_driver(&icside_driver);
}

static void __exit icside_exit(void);
{
ecard_unregister_driver(&icside_driver);
}

MODULE_AUTHOR("Russell King <rmk@arm.linux.org.uk>");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("ICS IDE driver");

module_init(icside_init);
module_exit(icside_exit);
9 changes: 6 additions & 3 deletions drivers/ide/arm/palm_bk3710.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ static const struct palm_bk3710_udmatiming palm_bk3710_udmatimings[6] = {
{100, 120}, /* UDMA Mode 2 */
{100, 90}, /* UDMA Mode 3 */
{100, 60}, /* UDMA Mode 4 */
{85, 40}, /* UDMA Mode 5 */
};

static void palm_bk3710_setudmamode(void __iomem *base, unsigned int dev,
Expand Down Expand Up @@ -334,12 +335,11 @@ static const struct ide_port_ops palm_bk3710_ports_ops = {
.cable_detect = palm_bk3710_cable_detect,
};

static const struct ide_port_info __devinitdata palm_bk3710_port_info = {
static struct ide_port_info __devinitdata palm_bk3710_port_info = {
.init_dma = palm_bk3710_init_dma,
.port_ops = &palm_bk3710_ports_ops,
.host_flags = IDE_HFLAG_MMIO,
.pio_mask = ATA_PIO4,
.udma_mask = ATA_UDMA4, /* (input clk 99MHz) */
.mwdma_mask = ATA_MWDMA2,
};

Expand All @@ -352,7 +352,7 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev)
int i, rc;
hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL };

clk = clk_get(NULL, "IDECLK");
clk = clk_get(&pdev->dev, "IDECLK");
if (IS_ERR(clk))
return -ENODEV;

Expand Down Expand Up @@ -392,6 +392,9 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev)
hw.irq = irq->start;
hw.chipset = ide_palm3710;

palm_bk3710_port_info.udma_mask = rate < 100000000 ? ATA_UDMA4 :
ATA_UDMA5;

rc = ide_host_add(&palm_bk3710_port_info, hws, NULL);
if (rc)
goto out;
Expand Down
6 changes: 6 additions & 0 deletions drivers/ide/arm/rapide.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,13 @@ static int __init rapide_init(void)
return ecard_register_driver(&rapide_driver);
}

static void __exit rapide_exit(void)
{
ecard_unregister_driver(&rapide_driver);
}

MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Yellowstone RAPIDE driver");

module_init(rapide_init);
module_exit(rapide_exit);
39 changes: 31 additions & 8 deletions drivers/ide/ide-cd.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,29 @@ static DEFINE_MUTEX(idecd_ref_mutex);
#define ide_cd_g(disk) \
container_of((disk)->private_data, struct cdrom_info, driver)

static void ide_cd_release(struct kref *);

static struct cdrom_info *ide_cd_get(struct gendisk *disk)
{
struct cdrom_info *cd = NULL;

mutex_lock(&idecd_ref_mutex);
cd = ide_cd_g(disk);
if (cd)
if (cd) {
kref_get(&cd->kref);
if (ide_device_get(cd->drive)) {
kref_put(&cd->kref, ide_cd_release);
cd = NULL;
}
}
mutex_unlock(&idecd_ref_mutex);
return cd;
}

static void ide_cd_release(struct kref *);

static void ide_cd_put(struct cdrom_info *cd)
{
mutex_lock(&idecd_ref_mutex);
ide_device_put(cd->drive);
kref_put(&cd->kref, ide_cd_release);
mutex_unlock(&idecd_ref_mutex);
}
Expand Down Expand Up @@ -1305,13 +1311,30 @@ static int cdrom_read_capacity(ide_drive_t *drive, unsigned long *capacity,

stat = ide_cd_queue_pc(drive, cmd, 0, &capbuf, &len, sense, 0,
REQ_QUIET);
if (stat == 0) {
*capacity = 1 + be32_to_cpu(capbuf.lba);
*sectors_per_frame =
be32_to_cpu(capbuf.blocklen) >> SECTOR_BITS;
if (stat)
return stat;

/*
* Sanity check the given block size
*/
switch (capbuf.blocklen) {
case __constant_cpu_to_be32(512):
case __constant_cpu_to_be32(1024):
case __constant_cpu_to_be32(2048):
case __constant_cpu_to_be32(4096):
break;
default:
printk(KERN_ERR "%s: weird block size %u\n",
drive->name, capbuf.blocklen);
printk(KERN_ERR "%s: default to 2kb block size\n",
drive->name);
capbuf.blocklen = __constant_cpu_to_be32(2048);
break;
}

return stat;
*capacity = 1 + be32_to_cpu(capbuf.lba);
*sectors_per_frame = be32_to_cpu(capbuf.blocklen) >> SECTOR_BITS;
return 0;
}

static int cdrom_read_tocentry(ide_drive_t *drive, int trackno, int msf_flag,
Expand Down
12 changes: 9 additions & 3 deletions drivers/ide/ide-disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,23 +56,29 @@ static DEFINE_MUTEX(idedisk_ref_mutex);
#define ide_disk_g(disk) \
container_of((disk)->private_data, struct ide_disk_obj, driver)

static void ide_disk_release(struct kref *);

static struct ide_disk_obj *ide_disk_get(struct gendisk *disk)
{
struct ide_disk_obj *idkp = NULL;

mutex_lock(&idedisk_ref_mutex);
idkp = ide_disk_g(disk);
if (idkp)
if (idkp) {
kref_get(&idkp->kref);
if (ide_device_get(idkp->drive)) {
kref_put(&idkp->kref, ide_disk_release);
idkp = NULL;
}
}
mutex_unlock(&idedisk_ref_mutex);
return idkp;
}

static void ide_disk_release(struct kref *);

static void ide_disk_put(struct ide_disk_obj *idkp)
{
mutex_lock(&idedisk_ref_mutex);
ide_device_put(idkp->drive);
kref_put(&idkp->kref, ide_disk_release);
mutex_unlock(&idedisk_ref_mutex);
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/ide/ide-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ EXPORT_SYMBOL_GPL(ide_build_sglist);
int ide_build_dmatable (ide_drive_t *drive, struct request *rq)
{
ide_hwif_t *hwif = HWIF(drive);
unsigned int *table = hwif->dmatable_cpu;
__le32 *table = (__le32 *)hwif->dmatable_cpu;
unsigned int is_trm290 = (hwif->chipset == ide_trm290) ? 1 : 0;
unsigned int count = 0;
int i;
Expand Down
12 changes: 9 additions & 3 deletions drivers/ide/ide-floppy.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,23 +158,29 @@ static DEFINE_MUTEX(idefloppy_ref_mutex);
#define ide_floppy_g(disk) \
container_of((disk)->private_data, struct ide_floppy_obj, driver)

static void idefloppy_cleanup_obj(struct kref *);

static struct ide_floppy_obj *ide_floppy_get(struct gendisk *disk)
{
struct ide_floppy_obj *floppy = NULL;

mutex_lock(&idefloppy_ref_mutex);
floppy = ide_floppy_g(disk);
if (floppy)
if (floppy) {
kref_get(&floppy->kref);
if (ide_device_get(floppy->drive)) {
kref_put(&floppy->kref, idefloppy_cleanup_obj);
floppy = NULL;
}
}
mutex_unlock(&idefloppy_ref_mutex);
return floppy;
}

static void idefloppy_cleanup_obj(struct kref *);

static void ide_floppy_put(struct ide_floppy_obj *floppy)
{
mutex_lock(&idefloppy_ref_mutex);
ide_device_put(floppy->drive);
kref_put(&floppy->kref, idefloppy_cleanup_obj);
mutex_unlock(&idefloppy_ref_mutex);
}
Expand Down
36 changes: 33 additions & 3 deletions drivers/ide/ide-generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
#include <linux/module.h>
#include <linux/ide.h>

/* FIXME: convert m32r to use ide_platform host driver */
#ifdef CONFIG_M32R
#include <asm/m32r.h>
#endif

#define DRV_NAME "ide_generic"

static int probe_mask = 0x03;
Expand Down Expand Up @@ -80,18 +85,39 @@ static int __init ide_generic_sysfs_init(void)
return 0;
}

#if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_MAPPI2) \
|| defined(CONFIG_PLAT_OPSPUT)
static const u16 legacy_bases[] = { 0x1f0 };
static const int legacy_irqs[] = { PLD_IRQ_CFIREQ };
#elif defined(CONFIG_PLAT_MAPPI3)
static const u16 legacy_bases[] = { 0x1f0, 0x170 };
static const int legacy_irqs[] = { PLD_IRQ_CFIREQ, PLD_IRQ_IDEIREQ };
#elif defined(CONFIG_ALPHA)
static const u16 legacy_bases[] = { 0x1f0, 0x170, 0x1e8, 0x168 };
static const int legacy_irqs[] = { 14, 15, 11, 10 };
#else
static const u16 legacy_bases[] = { 0x1f0, 0x170, 0x1e8, 0x168, 0x1e0, 0x160 };
static const int legacy_irqs[] = { 14, 15, 11, 10, 8, 12 };
#endif

static int __init ide_generic_init(void)
{
hw_regs_t hw[MAX_HWIFS], *hws[MAX_HWIFS];
struct ide_host *host;
unsigned long io_addr;
int i, rc;

#ifdef CONFIG_MIPS
if (!ide_probe_legacy())
return -ENODEV;
#endif
printk(KERN_INFO DRV_NAME ": please use \"probe_mask=0x3f\" module "
"parameter for probing all legacy ISA IDE ports\n");

for (i = 0; i < MAX_HWIFS; i++) {
io_addr = ide_default_io_base(i);
memset(hws, 0, sizeof(hw_regs_t *) * MAX_HWIFS);

for (i = 0; i < ARRAY_SIZE(legacy_bases); i++) {
io_addr = legacy_bases[i];

hws[i] = NULL;

Expand All @@ -113,7 +139,11 @@ static int __init ide_generic_init(void)

memset(&hw[i], 0, sizeof(hw[i]));
ide_std_init_ports(&hw[i], io_addr, io_addr + 0x206);
hw[i].irq = ide_default_irq(io_addr);
#ifdef CONFIG_IA64
hw[i].irq = isa_irq_to_vector(legacy_irqs[i]);
#else
hw[i].irq = legacy_irqs[i];
#endif
hw[i].chipset = ide_generic;

hws[i] = &hw[i];
Expand Down
6 changes: 2 additions & 4 deletions drivers/ide/ide-iops.c
Original file line number Diff line number Diff line change
Expand Up @@ -510,10 +510,8 @@ void ide_fixstring (u8 *s, const int bytecount, const int byteswap)

if (byteswap) {
/* convert from big-endian to host byte order */
for (p = end ; p != s;) {
unsigned short *pp = (unsigned short *) (p -= 2);
*pp = ntohs(*pp);
}
for (p = end ; p != s;)
be16_to_cpus((u16 *)(p -= 2));
}
/* strip leading blanks */
while (s != end && *s == ' ')
Expand Down
Loading

0 comments on commit b5684b8

Please sign in to comment.