aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/cs5536.c1
-rw-r--r--drivers/ide/hpt366.c14
-rw-r--r--drivers/ide/ide-cd.c11
-rw-r--r--drivers/ide/ide-gd.c17
-rw-r--r--drivers/ide/ide-io.c11
-rw-r--r--drivers/ide/palm_bk3710.c93
-rw-r--r--drivers/ide/pmac.c2
7 files changed, 68 insertions, 81 deletions
diff --git a/drivers/ide/cs5536.c b/drivers/ide/cs5536.c
index 353a35bbba6..0332a95eefd 100644
--- a/drivers/ide/cs5536.c
+++ b/drivers/ide/cs5536.c
@@ -236,6 +236,7 @@ static const struct ide_dma_ops cs5536_dma_ops = {
236 .dma_test_irq = ide_dma_test_irq, 236 .dma_test_irq = ide_dma_test_irq,
237 .dma_lost_irq = ide_dma_lost_irq, 237 .dma_lost_irq = ide_dma_lost_irq,
238 .dma_timer_expiry = ide_dma_sff_timer_expiry, 238 .dma_timer_expiry = ide_dma_sff_timer_expiry,
239 .dma_sff_read_status = ide_dma_sff_read_status,
239}; 240};
240 241
241static const struct ide_port_info cs5536_info = { 242static const struct ide_port_info cs5536_info = {
diff --git a/drivers/ide/hpt366.c b/drivers/ide/hpt366.c
index a0eb87f5913..0feb66c720e 100644
--- a/drivers/ide/hpt366.c
+++ b/drivers/ide/hpt366.c
@@ -3,7 +3,7 @@
3 * Portions Copyright (C) 2001 Sun Microsystems, Inc. 3 * Portions Copyright (C) 2001 Sun Microsystems, Inc.
4 * Portions Copyright (C) 2003 Red Hat Inc 4 * Portions Copyright (C) 2003 Red Hat Inc
5 * Portions Copyright (C) 2007 Bartlomiej Zolnierkiewicz 5 * Portions Copyright (C) 2007 Bartlomiej Zolnierkiewicz
6 * Portions Copyright (C) 2005-2008 MontaVista Software, Inc. 6 * Portions Copyright (C) 2005-2009 MontaVista Software, Inc.
7 * 7 *
8 * Thanks to HighPoint Technologies for their assistance, and hardware. 8 * Thanks to HighPoint Technologies for their assistance, and hardware.
9 * Special Thanks to Jon Burchmore in SanDiego for the deep pockets, his 9 * Special Thanks to Jon Burchmore in SanDiego for the deep pockets, his
@@ -114,6 +114,8 @@
114 * the register setting lists into the table indexed by the clock selected 114 * the register setting lists into the table indexed by the clock selected
115 * - set the correct hwif->ultra_mask for each individual chip 115 * - set the correct hwif->ultra_mask for each individual chip
116 * - add Ultra and MW DMA mode filtering for the HPT37[24] based SATA cards 116 * - add Ultra and MW DMA mode filtering for the HPT37[24] based SATA cards
117 * - stop resetting HPT370's state machine before each DMA transfer as that has
118 * caused more harm than good
117 * Sergei Shtylyov, <sshtylyov@ru.mvista.com> or <source@mvista.com> 119 * Sergei Shtylyov, <sshtylyov@ru.mvista.com> or <source@mvista.com>
118 */ 120 */
119 121
@@ -133,7 +135,7 @@
133#define DRV_NAME "hpt366" 135#define DRV_NAME "hpt366"
134 136
135/* various tuning parameters */ 137/* various tuning parameters */
136#define HPT_RESET_STATE_ENGINE 138#undef HPT_RESET_STATE_ENGINE
137#undef HPT_DELAY_INTERRUPT 139#undef HPT_DELAY_INTERRUPT
138 140
139static const char *quirk_drives[] = { 141static const char *quirk_drives[] = {
@@ -808,7 +810,7 @@ static void hpt370_irq_timeout(ide_drive_t *drive)
808 /* get DMA command mode */ 810 /* get DMA command mode */
809 dma_cmd = inb(hwif->dma_base + ATA_DMA_CMD); 811 dma_cmd = inb(hwif->dma_base + ATA_DMA_CMD);
810 /* stop DMA */ 812 /* stop DMA */
811 outb(dma_cmd & ~0x1, hwif->dma_base + ATA_DMA_CMD); 813 outb(dma_cmd & ~ATA_DMA_START, hwif->dma_base + ATA_DMA_CMD);
812 hpt370_clear_engine(drive); 814 hpt370_clear_engine(drive);
813} 815}
814 816
@@ -825,11 +827,11 @@ static int hpt370_dma_end(ide_drive_t *drive)
825 ide_hwif_t *hwif = drive->hwif; 827 ide_hwif_t *hwif = drive->hwif;
826 u8 dma_stat = inb(hwif->dma_base + ATA_DMA_STATUS); 828 u8 dma_stat = inb(hwif->dma_base + ATA_DMA_STATUS);
827 829
828 if (dma_stat & 0x01) { 830 if (dma_stat & ATA_DMA_ACTIVE) {
829 /* wait a little */ 831 /* wait a little */
830 udelay(20); 832 udelay(20);
831 dma_stat = inb(hwif->dma_base + ATA_DMA_STATUS); 833 dma_stat = inb(hwif->dma_base + ATA_DMA_STATUS);
832 if (dma_stat & 0x01) 834 if (dma_stat & ATA_DMA_ACTIVE)
833 hpt370_irq_timeout(drive); 835 hpt370_irq_timeout(drive);
834 } 836 }
835 return ide_dma_end(drive); 837 return ide_dma_end(drive);
@@ -851,7 +853,7 @@ static int hpt374_dma_test_irq(ide_drive_t *drive)
851 853
852 dma_stat = inb(hwif->dma_base + ATA_DMA_STATUS); 854 dma_stat = inb(hwif->dma_base + ATA_DMA_STATUS);
853 /* return 1 if INTR asserted */ 855 /* return 1 if INTR asserted */
854 if (dma_stat & 4) 856 if (dma_stat & ATA_DMA_INTR)
855 return 1; 857 return 1;
856 858
857 return 0; 859 return 0;
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 3aec19d1fdf..925eb9e245d 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -312,7 +312,6 @@ static int cdrom_decode_status(ide_drive_t *drive, u8 stat)
312 ide_hwif_t *hwif = drive->hwif; 312 ide_hwif_t *hwif = drive->hwif;
313 struct request *rq = hwif->rq; 313 struct request *rq = hwif->rq;
314 int err, sense_key, do_end_request = 0; 314 int err, sense_key, do_end_request = 0;
315 u8 quiet = rq->cmd_flags & REQ_QUIET;
316 315
317 /* get the IDE error register */ 316 /* get the IDE error register */
318 err = ide_read_error(drive); 317 err = ide_read_error(drive);
@@ -347,7 +346,7 @@ static int cdrom_decode_status(ide_drive_t *drive, u8 stat)
347 } else { 346 } else {
348 cdrom_saw_media_change(drive); 347 cdrom_saw_media_change(drive);
349 348
350 if (blk_fs_request(rq) && !quiet) 349 if (blk_fs_request(rq) && !blk_rq_quiet(rq))
351 printk(KERN_ERR PFX "%s: tray open\n", 350 printk(KERN_ERR PFX "%s: tray open\n",
352 drive->name); 351 drive->name);
353 } 352 }
@@ -382,7 +381,7 @@ static int cdrom_decode_status(ide_drive_t *drive, u8 stat)
382 * No point in retrying after an illegal request or data 381 * No point in retrying after an illegal request or data
383 * protect error. 382 * protect error.
384 */ 383 */
385 if (!quiet) 384 if (!blk_rq_quiet(rq))
386 ide_dump_status(drive, "command error", stat); 385 ide_dump_status(drive, "command error", stat);
387 do_end_request = 1; 386 do_end_request = 1;
388 break; 387 break;
@@ -391,14 +390,14 @@ static int cdrom_decode_status(ide_drive_t *drive, u8 stat)
391 * No point in re-trying a zillion times on a bad sector. 390 * No point in re-trying a zillion times on a bad sector.
392 * If we got here the error is not correctable. 391 * If we got here the error is not correctable.
393 */ 392 */
394 if (!quiet) 393 if (!blk_rq_quiet(rq))
395 ide_dump_status(drive, "media error " 394 ide_dump_status(drive, "media error "
396 "(bad sector)", stat); 395 "(bad sector)", stat);
397 do_end_request = 1; 396 do_end_request = 1;
398 break; 397 break;
399 case BLANK_CHECK: 398 case BLANK_CHECK:
400 /* disk appears blank? */ 399 /* disk appears blank? */
401 if (!quiet) 400 if (!blk_rq_quiet(rq))
402 ide_dump_status(drive, "media error (blank)", 401 ide_dump_status(drive, "media error (blank)",
403 stat); 402 stat);
404 do_end_request = 1; 403 do_end_request = 1;
@@ -609,7 +608,7 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
609 struct request *rq = hwif->rq; 608 struct request *rq = hwif->rq;
610 ide_expiry_t *expiry = NULL; 609 ide_expiry_t *expiry = NULL;
611 int dma_error = 0, dma, thislen, uptodate = 0; 610 int dma_error = 0, dma, thislen, uptodate = 0;
612 int write = (rq_data_dir(rq) == WRITE) ? 1 : 0, rc, nsectors; 611 int write = (rq_data_dir(rq) == WRITE) ? 1 : 0, rc = 0, nsectors;
613 int sense = blk_sense_request(rq); 612 int sense = blk_sense_request(rq);
614 unsigned int timeout; 613 unsigned int timeout;
615 u16 len; 614 u16 len;
diff --git a/drivers/ide/ide-gd.c b/drivers/ide/ide-gd.c
index 1aebdf1a4f5..4b6b71e2cdf 100644
--- a/drivers/ide/ide-gd.c
+++ b/drivers/ide/ide-gd.c
@@ -7,6 +7,7 @@
7#include <linux/mutex.h> 7#include <linux/mutex.h>
8#include <linux/ide.h> 8#include <linux/ide.h>
9#include <linux/hdreg.h> 9#include <linux/hdreg.h>
10#include <linux/dmi.h>
10 11
11#if !defined(CONFIG_DEBUG_BLOCK_EXT_DEVT) 12#if !defined(CONFIG_DEBUG_BLOCK_EXT_DEVT)
12#define IDE_DISK_MINORS (1 << PARTN_BITS) 13#define IDE_DISK_MINORS (1 << PARTN_BITS)
@@ -99,6 +100,19 @@ static void ide_gd_resume(ide_drive_t *drive)
99 (void)drive->disk_ops->get_capacity(drive); 100 (void)drive->disk_ops->get_capacity(drive);
100} 101}
101 102
103static const struct dmi_system_id ide_coldreboot_table[] = {
104 {
105 /* Acer TravelMate 66x cuts power during reboot */
106 .ident = "Acer TravelMate 660",
107 .matches = {
108 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
109 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 660"),
110 },
111 },
112
113 { } /* terminate list */
114};
115
102static void ide_gd_shutdown(ide_drive_t *drive) 116static void ide_gd_shutdown(ide_drive_t *drive)
103{ 117{
104#ifdef CONFIG_ALPHA 118#ifdef CONFIG_ALPHA
@@ -115,7 +129,8 @@ static void ide_gd_shutdown(ide_drive_t *drive)
115 the disk to expire its write cache. */ 129 the disk to expire its write cache. */
116 if (system_state != SYSTEM_POWER_OFF) { 130 if (system_state != SYSTEM_POWER_OFF) {
117#else 131#else
118 if (system_state == SYSTEM_RESTART) { 132 if (system_state == SYSTEM_RESTART &&
133 !dmi_check_system(ide_coldreboot_table)) {
119#endif 134#endif
120 drive->disk_ops->flush(drive); 135 drive->disk_ops->flush(drive);
121 return; 136 return;
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 2ae02b8d7f8..35dc38d3b2c 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -102,11 +102,14 @@ void ide_complete_cmd(ide_drive_t *drive, struct ide_cmd *cmd, u8 stat, u8 err)
102 drive->dev_flags |= IDE_DFLAG_PARKED; 102 drive->dev_flags |= IDE_DFLAG_PARKED;
103 } 103 }
104 104
105 if (rq && rq->cmd_type == REQ_TYPE_ATA_TASKFILE) 105 if (rq && rq->cmd_type == REQ_TYPE_ATA_TASKFILE) {
106 memcpy(rq->special, cmd, sizeof(*cmd)); 106 struct ide_cmd *orig_cmd = rq->special;
107 107
108 if (cmd->tf_flags & IDE_TFLAG_DYN) 108 if (cmd->tf_flags & IDE_TFLAG_DYN)
109 kfree(cmd); 109 kfree(orig_cmd);
110 else
111 memcpy(orig_cmd, cmd, sizeof(*cmd));
112 }
110} 113}
111 114
112/* obsolete, blk_rq_bytes() should be used instead */ 115/* obsolete, blk_rq_bytes() should be used instead */
diff --git a/drivers/ide/palm_bk3710.c b/drivers/ide/palm_bk3710.c
index c7acca0b873..09d813d313f 100644
--- a/drivers/ide/palm_bk3710.c
+++ b/drivers/ide/palm_bk3710.c
@@ -39,27 +39,12 @@
39/* Primary Control Offset */ 39/* Primary Control Offset */
40#define IDE_PALM_ATA_PRI_CTL_OFFSET 0x3F6 40#define IDE_PALM_ATA_PRI_CTL_OFFSET 0x3F6
41 41
42/*
43 * PalmChip 3710 IDE Controller UDMA timing structure Definition
44 */
45struct palm_bk3710_udmatiming {
46 unsigned int rptime; /* Ready to pause time */
47 unsigned int cycletime; /* Cycle Time */
48};
49
50#define BK3710_BMICP 0x00 42#define BK3710_BMICP 0x00
51#define BK3710_BMISP 0x02 43#define BK3710_BMISP 0x02
52#define BK3710_BMIDTP 0x04 44#define BK3710_BMIDTP 0x04
53#define BK3710_BMICS 0x08
54#define BK3710_BMISS 0x0A
55#define BK3710_BMIDTS 0x0C
56#define BK3710_IDETIMP 0x40 45#define BK3710_IDETIMP 0x40
57#define BK3710_IDETIMS 0x42
58#define BK3710_SIDETIM 0x44
59#define BK3710_SLEWCTL 0x45
60#define BK3710_IDESTATUS 0x47 46#define BK3710_IDESTATUS 0x47
61#define BK3710_UDMACTL 0x48 47#define BK3710_UDMACTL 0x48
62#define BK3710_UDMATIM 0x4A
63#define BK3710_MISCCTL 0x50 48#define BK3710_MISCCTL 0x50
64#define BK3710_REGSTB 0x54 49#define BK3710_REGSTB 0x54
65#define BK3710_REGRCVR 0x58 50#define BK3710_REGRCVR 0x58
@@ -71,17 +56,22 @@ struct palm_bk3710_udmatiming {
71#define BK3710_UDMATRP 0x70 56#define BK3710_UDMATRP 0x70
72#define BK3710_UDMAENV 0x74 57#define BK3710_UDMAENV 0x74
73#define BK3710_IORDYTMP 0x78 58#define BK3710_IORDYTMP 0x78
74#define BK3710_IORDYTMS 0x7C
75 59
76static unsigned ideclk_period; /* in nanoseconds */ 60static unsigned ideclk_period; /* in nanoseconds */
77 61
62struct palm_bk3710_udmatiming {
63 unsigned int rptime; /* tRP -- Ready to pause time (nsec) */
64 unsigned int cycletime; /* tCYCTYP2/2 -- avg Cycle Time (nsec) */
65 /* tENV is always a minimum of 20 nsec */
66};
67
78static const struct palm_bk3710_udmatiming palm_bk3710_udmatimings[6] = { 68static const struct palm_bk3710_udmatiming palm_bk3710_udmatimings[6] = {
79 {160, 240}, /* UDMA Mode 0 */ 69 { 160, 240 / 2 }, /* UDMA Mode 0 */
80 {125, 160}, /* UDMA Mode 1 */ 70 { 125, 160 / 2 }, /* UDMA Mode 1 */
81 {100, 120}, /* UDMA Mode 2 */ 71 { 100, 120 / 2 }, /* UDMA Mode 2 */
82 {100, 90}, /* UDMA Mode 3 */ 72 { 100, 90 / 2 }, /* UDMA Mode 3 */
83 {100, 60}, /* UDMA Mode 4 */ 73 { 100, 60 / 2 }, /* UDMA Mode 4 */
84 {85, 40}, /* UDMA Mode 5 */ 74 { 85, 40 / 2 }, /* UDMA Mode 5 */
85}; 75};
86 76
87static void palm_bk3710_setudmamode(void __iomem *base, unsigned int dev, 77static void palm_bk3710_setudmamode(void __iomem *base, unsigned int dev,
@@ -98,11 +88,6 @@ static void palm_bk3710_setudmamode(void __iomem *base, unsigned int dev,
98 trp = DIV_ROUND_UP(palm_bk3710_udmatimings[mode].rptime, 88 trp = DIV_ROUND_UP(palm_bk3710_udmatimings[mode].rptime,
99 ideclk_period) - 1; 89 ideclk_period) - 1;
100 90
101 /* udmatim Register */
102 val16 = readw(base + BK3710_UDMATIM) & (dev ? 0xFF0F : 0xFFF0);
103 val16 |= (mode << (dev ? 4 : 0));
104 writew(val16, base + BK3710_UDMATIM);
105
106 /* udmastb Ultra DMA Access Strobe Width */ 91 /* udmastb Ultra DMA Access Strobe Width */
107 val32 = readl(base + BK3710_UDMASTB) & (0xFF << (dev ? 0 : 8)); 92 val32 = readl(base + BK3710_UDMASTB) & (0xFF << (dev ? 0 : 8));
108 val32 |= (t0 << (dev ? 8 : 0)); 93 val32 |= (t0 << (dev ? 8 : 0));
@@ -163,10 +148,11 @@ static void palm_bk3710_setpiomode(void __iomem *base, ide_drive_t *mate,
163 u32 val32; 148 u32 val32;
164 struct ide_timing *t; 149 struct ide_timing *t;
165 150
151 t = ide_timing_find_mode(XFER_PIO_0 + mode);
152
166 /* PIO Data Setup */ 153 /* PIO Data Setup */
167 t0 = DIV_ROUND_UP(cycletime, ideclk_period); 154 t0 = DIV_ROUND_UP(cycletime, ideclk_period);
168 t2 = DIV_ROUND_UP(ide_timing_find_mode(XFER_PIO_0 + mode)->active, 155 t2 = DIV_ROUND_UP(t->active, ideclk_period);
169 ideclk_period);
170 156
171 t2i = t0 - t2 - 1; 157 t2i = t0 - t2 - 1;
172 t2 -= 1; 158 t2 -= 1;
@@ -187,7 +173,6 @@ static void palm_bk3710_setpiomode(void __iomem *base, ide_drive_t *mate,
187 } 173 }
188 174
189 /* TASKFILE Setup */ 175 /* TASKFILE Setup */
190 t = ide_timing_find_mode(XFER_PIO_0 + mode);
191 t0 = DIV_ROUND_UP(t->cyc8b, ideclk_period); 176 t0 = DIV_ROUND_UP(t->cyc8b, ideclk_period);
192 t2 = DIV_ROUND_UP(t->act8b, ideclk_period); 177 t2 = DIV_ROUND_UP(t->act8b, ideclk_period);
193 178
@@ -236,42 +221,23 @@ static void palm_bk3710_set_pio_mode(ide_drive_t *drive, u8 pio)
236static void __devinit palm_bk3710_chipinit(void __iomem *base) 221static void __devinit palm_bk3710_chipinit(void __iomem *base)
237{ 222{
238 /* 223 /*
239 * enable the reset_en of ATA controller so that when ata signals 224 * REVISIT: the ATA reset signal needs to be managed through a
240 * are brought out, by writing into device config. at that 225 * GPIO, which means it should come from platform_data. Until
241 * time por_n signal should not be 'Z' and have a stable value. 226 * we get and use such information, we have to trust that things
227 * have been reset before we get here.
242 */ 228 */
243 writel(0x0300, base + BK3710_MISCCTL);
244
245 /* wait for some time and deassert the reset of ATA Device. */
246 mdelay(100);
247
248 /* Deassert the Reset */
249 writel(0x0200, base + BK3710_MISCCTL);
250 229
251 /* 230 /*
252 * Program the IDETIMP Register Value based on the following assumptions 231 * Program the IDETIMP Register Value based on the following assumptions
253 * 232 *
254 * (ATA_IDETIMP_IDEEN , ENABLE ) | 233 * (ATA_IDETIMP_IDEEN , ENABLE ) |
255 * (ATA_IDETIMP_SLVTIMEN , DISABLE) |
256 * (ATA_IDETIMP_RDYSMPL , 70NS) |
257 * (ATA_IDETIMP_RDYRCVRY , 50NS) |
258 * (ATA_IDETIMP_DMAFTIM1 , PIOCOMP) |
259 * (ATA_IDETIMP_PREPOST1 , DISABLE) | 234 * (ATA_IDETIMP_PREPOST1 , DISABLE) |
260 * (ATA_IDETIMP_RDYSEN1 , DISABLE) |
261 * (ATA_IDETIMP_PIOFTIM1 , DISABLE) |
262 * (ATA_IDETIMP_DMAFTIM0 , PIOCOMP) |
263 * (ATA_IDETIMP_PREPOST0 , DISABLE) | 235 * (ATA_IDETIMP_PREPOST0 , DISABLE) |
264 * (ATA_IDETIMP_RDYSEN0 , DISABLE) | 236 *
265 * (ATA_IDETIMP_PIOFTIM0 , DISABLE) 237 * DM6446 silicon rev 2.1 and earlier have no observed net benefit
266 */ 238 * from enabling prefetch/postwrite.
267 writew(0xB388, base + BK3710_IDETIMP);
268
269 /*
270 * Configure SIDETIM Register
271 * (ATA_SIDETIM_RDYSMPS1 ,120NS ) |
272 * (ATA_SIDETIM_RDYRCYS1 ,120NS )
273 */ 239 */
274 writeb(0, base + BK3710_SIDETIM); 240 writew(BIT(15), base + BK3710_IDETIMP);
275 241
276 /* 242 /*
277 * UDMACTL Ultra-ATA DMA Control 243 * UDMACTL Ultra-ATA DMA Control
@@ -283,11 +249,11 @@ static void __devinit palm_bk3710_chipinit(void __iomem *base)
283 249
284 /* 250 /*
285 * MISCCTL Miscellaneous Conrol Register 251 * MISCCTL Miscellaneous Conrol Register
286 * (ATA_MISCCTL_RSTMODEP , 1) | 252 * (ATA_MISCCTL_HWNHLD1P , 1 cycle)
287 * (ATA_MISCCTL_RESETP , 0) | 253 * (ATA_MISCCTL_HWNHLD0P , 1 cycle)
288 * (ATA_MISCCTL_TIMORIDE , 1) 254 * (ATA_MISCCTL_TIMORIDE , 1)
289 */ 255 */
290 writel(0x201, base + BK3710_MISCCTL); 256 writel(0x001, base + BK3710_MISCCTL);
291 257
292 /* 258 /*
293 * IORDYTMP IORDY Timer for Primary Register 259 * IORDYTMP IORDY Timer for Primary Register
@@ -357,10 +323,9 @@ static int __init palm_bk3710_probe(struct platform_device *pdev)
357 323
358 clk_enable(clk); 324 clk_enable(clk);
359 rate = clk_get_rate(clk); 325 rate = clk_get_rate(clk);
360 ideclk_period = 1000000000UL / rate;
361 326
362 /* Register the IDE interface with Linux ATA Interface */ 327 /* NOTE: round *down* to meet minimum timings; we count in clocks */
363 memset(&hw, 0, sizeof(hw)); 328 ideclk_period = 1000000000UL / rate;
364 329
365 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 330 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
366 if (mem == NULL) { 331 if (mem == NULL) {
@@ -390,6 +355,7 @@ static int __init palm_bk3710_probe(struct platform_device *pdev)
390 /* Configure the Palm Chip controller */ 355 /* Configure the Palm Chip controller */
391 palm_bk3710_chipinit(base); 356 palm_bk3710_chipinit(base);
392 357
358 memset(&hw, 0, sizeof(hw));
393 for (i = 0; i < IDE_NR_PORTS - 2; i++) 359 for (i = 0; i < IDE_NR_PORTS - 2; i++)
394 hw.io_ports_array[i] = (unsigned long) 360 hw.io_ports_array[i] = (unsigned long)
395 (base + IDE_PALM_ATA_PRI_REG_OFFSET + i); 361 (base + IDE_PALM_ATA_PRI_REG_OFFSET + i);
@@ -402,6 +368,7 @@ static int __init palm_bk3710_probe(struct platform_device *pdev)
402 palm_bk3710_port_info.udma_mask = rate < 100000000 ? ATA_UDMA4 : 368 palm_bk3710_port_info.udma_mask = rate < 100000000 ? ATA_UDMA4 :
403 ATA_UDMA5; 369 ATA_UDMA5;
404 370
371 /* Register the IDE interface with Linux */
405 rc = ide_host_add(&palm_bk3710_port_info, hws, NULL); 372 rc = ide_host_add(&palm_bk3710_port_info, hws, NULL);
406 if (rc) 373 if (rc)
407 goto out; 374 goto out;
diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c
index 052b9bf1f8f..f76e4e6b408 100644
--- a/drivers/ide/pmac.c
+++ b/drivers/ide/pmac.c
@@ -1682,7 +1682,7 @@ static int __devinit pmac_ide_init_dma(ide_hwif_t *hwif,
1682 * The +2 is +1 for the stop command and +1 to allow for 1682 * The +2 is +1 for the stop command and +1 to allow for
1683 * aligning the start address to a multiple of 16 bytes. 1683 * aligning the start address to a multiple of 16 bytes.
1684 */ 1684 */
1685 pmif->dma_table_cpu = (struct dbdma_cmd*)pci_alloc_consistent( 1685 pmif->dma_table_cpu = pci_alloc_consistent(
1686 dev, 1686 dev,
1687 (MAX_DCMDS + 2) * sizeof(struct dbdma_cmd), 1687 (MAX_DCMDS + 2) * sizeof(struct dbdma_cmd),
1688 &hwif->dmatable_dma); 1688 &hwif->dmatable_dma);