Skip to contentSkip to conversation

via82cxxx: fix cable warning message

PATCH In review Bartlomiej Zolnierkiewicz 2 participants 15 messages Jan 6, 2009 – Jan 22, 2009 libata

lore
Share & tools
lore
#0 lore raw

PATCH 1/9 via82cxxx: fix cable warning message

From: Bartlomiej Zolnierkiewicz <[email protected]>
Subject: [PATCH] via82cxxx: fix cable warning message

Remove reference to the removed old-style kernel parameter.

---
minor fixes/cleanups for pata-2.6 tree

 drivers/ide/via82cxxx.c |    2 --
 1 file changed, 2 deletions(-)
drivers/ide/via82cxxx.c +0 -2
Index: b/drivers/ide/via82cxxx.c
===================================================================
@@ -432,8 +432,6 @@ static int __devinit via_init_one(struct
 	if (via_clock < 20000 || via_clock > 50000) {
 		printk(KERN_WARNING DRV_NAME ": User given PCI clock speed "
 			"impossible (%d), using 33 MHz instead.\n", via_clock);
-		printk(KERN_WARNING DRV_NAME ": Use ide0=ata66 if you want "
-			"to assume 80-wire cable.\n");
 		via_clock = 33333;
 	}
 
#1 lore raw

PATCH 2/9 sl82c105: remove dead code

From: Bartlomiej Zolnierkiewicz <[email protected]>
Subject: [PATCH] sl82c105: remove dead code

CONFIG_LOPEC and CONFIG_SANDPOINT config options are gone.

---
 drivers/ide/sl82c105.c |    4 ----
 1 file changed, 4 deletions(-)
drivers/ide/sl82c105.c +0 -4
Index: b/drivers/ide/sl82c105.c
===================================================================
@@ -310,10 +310,6 @@ static const struct ide_port_info sl82c1
 	.dma_ops	= &sl82c105_dma_ops,
 	.host_flags	= IDE_HFLAG_IO_32BIT |
 			  IDE_HFLAG_UNMASK_IRQS |
-/* FIXME: check for Compatibility mode in generic IDE PCI code */
-#if defined(CONFIG_LOPEC) || defined(CONFIG_SANDPOINT)
-			  IDE_HFLAG_FORCE_LEGACY_IRQS |
-#endif
 			  IDE_HFLAG_SERIALIZE_DMA |
 			  IDE_HFLAG_NO_AUTODMA,
 	.pio_mask	= ATA_PIO5,
Acked-by on v1 2/9
#2 lore raw

Re: [PATCH 2/9] sl82c105: remove dead code

Hello.

Quoted 2 lines · Bartlomiej Zolnierkiewicz

CONFIG_LOPEC and CONFIG_SANDPOINT config options are gone.

So these are gone with arch/ppc/?
That's a pity -- MV has spent a lot of efforts on porting the latter
to arch/powerpc/ but somehow it haven't got merged upstream. My patches ot this driver were actually due to it being used on Sandpoint. :-)

Quoted 1 line

MBR, Sergei

#3 lore raw

Re: [PATCH 2/9] sl82c105: remove dead code

Quoted 8 lines · Sergei Shtylyov

Hello.

Quoted 2 lines · Bartlomiej Zolnierkiewicz

CONFIG_LOPEC and CONFIG_SANDPOINT config options are gone.

So these are gone with arch/ppc/?

Yep.

Quoted 3 lines

That's a pity -- MV has spent a lot of efforts on porting the latter
to arch/powerpc/ but somehow it haven't got merged upstream. My patches ot this driver were actually due to it being used on Sandpoint. :-)

Heh, and I cleaned ppc IDE hooks just before these platforms were removed (that's how these ifdefs got into sl82c105.c). :-)

Thanks,
Bart

#4 lore raw

PATCH 4/9 ide: fix IDE_DFLAG_NO_IO_32BIT handling

In reply to Bartlomiej Zolnierkiewicz

From: Bartlomiej Zolnierkiewicz <[email protected]>
Subject: [PATCH] ide: fix IDE_DFLAG_NO_IO_32BIT handling

* IDE_DFLAG_NO_IO_32BIT may be set by cmd640's ->init_dev method so don't clear it in ide_port_tune_devices() (+ no need to do it).

* Move IDE_DFLAG_NO_IO_32BIT handling to ide_port_init_devices().

---
 drivers/ide/ide-probe.c |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/ide/ide-probe.c +2 -7
Index: b/drivers/ide/ide-probe.c
===================================================================
@@ -847,13 +847,6 @@ static void ide_port_tune_devices(ide_hw
 				ide_set_dma(drive);
 		}
 	}
-
-	ide_port_for_each_dev(i, drive, hwif) {
-		if (hwif->host_flags & IDE_HFLAG_NO_IO_32BIT)
-			drive->dev_flags |= IDE_DFLAG_NO_IO_32BIT;
-		else
-			drive->dev_flags &= ~IDE_DFLAG_NO_IO_32BIT;
-	}
 }
 
 /*
@@ -1186,6 +1179,8 @@ static void ide_port_init_devices(ide_hw
 
 		if (hwif->host_flags & IDE_HFLAG_IO_32BIT)
 			drive->io_32bit = 1;
+		if (hwif->host_flags & IDE_HFLAG_NO_IO_32BIT)
+			drive->dev_flags |= IDE_DFLAG_NO_IO_32BIT;
 		if (hwif->host_flags & IDE_HFLAG_UNMASK_IRQS)
 			drive->dev_flags |= IDE_DFLAG_UNMASK;
 		if (hwif->host_flags & IDE_HFLAG_NO_UNMASK_IRQS)
#5 lore raw

PATCH 5/9 ide: move ide_pktcmd_tf_load() to ide-atapi.c

In reply to Bartlomiej Zolnierkiewicz

From: Bartlomiej Zolnierkiewicz <[email protected]>
Subject: [PATCH] ide: move ide_pktcmd_tf_load() to ide-atapi.c

Then make it static and remove 'dma' argument.

---
 drivers/ide/ide-atapi.c |   21 ++++++++++++++++++++-
 drivers/ide/ide-io.c    |   20 --------------------
 include/linux/ide.h     |    2 --
 3 files changed, 20 insertions(+), 23 deletions(-)
drivers/ide/ide-atapi.c +20 -1
Index: b/drivers/ide/ide-atapi.c
===================================================================
@@ -444,6 +444,25 @@ next_irq:
 	return ide_started;
 }
 
+static void ide_pktcmd_tf_load(ide_drive_t *drive, u32 tf_flags, u16 bcount)
+{
+	ide_hwif_t *hwif = drive->hwif;
+	ide_task_t task;
+	u8 dma = drive->dma;
+
+	memset(&task, 0, sizeof(task));
+	task.tf_flags = IDE_TFLAG_OUT_LBAH | IDE_TFLAG_OUT_LBAM |
+			IDE_TFLAG_OUT_FEATURE | tf_flags;
+	task.tf.feature = dma;		/* Use PIO/DMA */
+	task.tf.lbam    = bcount & 0xff;
+	task.tf.lbah    = (bcount >> 8) & 0xff;
+
+	ide_tf_dump(drive->name, &task.tf);
+	hwif->tp_ops->set_irq(hwif, 1);
+	SELECT_MASK(drive, 0);
+	hwif->tp_ops->tf_load(drive, &task);
+}
+
 static u8 ide_read_ireason(ide_drive_t *drive)
 {
 	ide_task_t task;
@@ -617,7 +636,7 @@ ide_startstop_t ide_issue_pc(ide_drive_t
 						       : WAIT_TAPE_CMD;
 	}
 
-	ide_pktcmd_tf_load(drive, tf_flags, bcount, drive->dma);
+	ide_pktcmd_tf_load(drive, tf_flags, bcount);
 
 	/* Issue the packet command */
 	if (drive->atapi_flags & IDE_AFLAG_DRQ_INTERRUPT) {
drivers/ide/ide-io.c +0 -20
Index: b/drivers/ide/ide-io.c
===================================================================
@@ -1188,26 +1188,6 @@ void ide_do_drive_cmd(ide_drive_t *drive
 }
 EXPORT_SYMBOL(ide_do_drive_cmd);
 
-void ide_pktcmd_tf_load(ide_drive_t *drive, u32 tf_flags, u16 bcount, u8 dma)
-{
-	ide_hwif_t *hwif = drive->hwif;
-	ide_task_t task;
-
-	memset(&task, 0, sizeof(task));
-	task.tf_flags = IDE_TFLAG_OUT_LBAH | IDE_TFLAG_OUT_LBAM |
-			IDE_TFLAG_OUT_FEATURE | tf_flags;
-	task.tf.feature = dma;		/* Use PIO/DMA */
-	task.tf.lbam    = bcount & 0xff;
-	task.tf.lbah    = (bcount >> 8) & 0xff;
-
-	ide_tf_dump(drive->name, &task.tf);
-	hwif->tp_ops->set_irq(hwif, 1);
-	SELECT_MASK(drive, 0);
-	hwif->tp_ops->tf_load(drive, &task);
-}
-
-EXPORT_SYMBOL_GPL(ide_pktcmd_tf_load);
-
 void ide_pad_transfer(ide_drive_t *drive, int write, int len)
 {
 	ide_hwif_t *hwif = drive->hwif;
include/linux/ide.h +0 -2
Index: b/include/linux/ide.h
===================================================================
@@ -1200,8 +1200,6 @@ void ide_read_bcount_and_ireason(ide_dri
 
 extern int drive_is_ready(ide_drive_t *);
 
-void ide_pktcmd_tf_load(ide_drive_t *, u32, u16, u8);
-
 int ide_check_atapi_device(ide_drive_t *, const char *);
 
 void ide_init_pc(struct ide_atapi_pc *);
#7 lore raw

PATCH 6/9 ide: no need to touch local IRQs in ide_probe_port()

In reply to Bartlomiej Zolnierkiewicz

From: Bartlomiej Zolnierkiewicz <[email protected]>
Subject: [PATCH] ide: no need to touch local IRQs in ide_probe_port()

Remove superfluous local_irq_{save,enable_in_hardirq,restore}() combo.

---
 drivers/ide/ide-probe.c |    6 ------
 1 file changed, 6 deletions(-)
drivers/ide/ide-probe.c +0 -6
Index: b/drivers/ide/ide-probe.c
===================================================================
@@ -778,7 +778,6 @@ EXPORT_SYMBOL_GPL(ide_undecoded_slave);
 static int ide_probe_port(ide_hwif_t *hwif)
 {
 	ide_drive_t *drive;
-	unsigned long flags;
 	unsigned int irqd;
 	int i, rc = -ENODEV;
 
@@ -796,9 +795,6 @@ static int ide_probe_port(ide_hwif_t *hw
 	if (irqd)
 		disable_irq(hwif->irq);
 
-	local_irq_save(flags);
-	local_irq_enable_in_hardirq();
-
 	if (ide_port_wait_ready(hwif) == -EBUSY)
 		printk(KERN_DEBUG "%s: Wait for ready failed before probe !\n", hwif->name);
 
@@ -812,8 +808,6 @@ static int ide_probe_port(ide_hwif_t *hw
 			rc = 0;
 	}
 
-	local_irq_restore(flags);
-
 	/*
 	 * Use cached IRQ number. It might be (and is...) changed by probe
 	 * code above
#8 lore raw

PATCH 7/9 ide: move ->rqsize init from init_irq() to ide_init_port()

In reply to Bartlomiej Zolnierkiewicz

From: Bartlomiej Zolnierkiewicz <[email protected]>
Subject: [PATCH] ide: move ->rqsize init from init_irq() to ide_init_port()

---
 drivers/ide/ide-probe.c |   15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)
drivers/ide/ide-probe.c +7 -8
Index: b/drivers/ide/ide-probe.c
===================================================================
@@ -958,14 +958,6 @@ static int init_irq (ide_hwif_t *hwif)
 	if (request_irq(hwif->irq, &ide_intr, sa, hwif->name, hwif))
 		goto out_up;
 
-	if (!hwif->rqsize) {
-		if ((hwif->host_flags & IDE_HFLAG_NO_LBA48) ||
-		    (hwif->host_flags & IDE_HFLAG_NO_LBA48_DMA))
-			hwif->rqsize = 256;
-		else
-			hwif->rqsize = 65536;
-	}
-
 #if !defined(__mc68000__)
 	printk(KERN_INFO "%s at 0x%03lx-0x%03lx,0x%03lx on irq %d", hwif->name,
 		io_ports->data_addr, io_ports->status_addr,
@@ -1242,6 +1234,13 @@ static void ide_init_port(ide_hwif_t *hw
 
 	if (d->max_sectors)
 		hwif->rqsize = d->max_sectors;
+	else {
+		if ((hwif->host_flags & IDE_HFLAG_NO_LBA48) ||
+		    (hwif->host_flags & IDE_HFLAG_NO_LBA48_DMA))
+			hwif->rqsize = 256;
+		else
+			hwif->rqsize = 65536;
+	}
 
 	/* call chipset specific routine for each enabled port */
 	if (d->init_hwif)
#9 lore raw

Re: [PATCH 7/9] ide: move ->rqsize init from init_irq() to ide_init_port()

Hello.

Quoted 8 lines · Bartlomiej Zolnierkiewicz

Index: b/drivers/ide/ide-probe.c
===================================================================

drivers/ide/ide-probe.c +0 -0

[...]

drivers/ide/ide-probe.c static void ide_init_port(ide_hwif_t *hw · line 1240

Quoted 8 lines
drivers/ide/ide-probe.c +3 -0
@@ -1242,6 +1234,13 @@ static void ide_init_port(ide_hwif_t *hw
 
 	if (d->max_sectors)
 		hwif->rqsize = d->max_sectors;
+	else {
+		if ((hwif->host_flags & IDE_HFLAG_NO_LBA48) ||
+		    (hwif->host_flags & IDE_HFLAG_NO_LBA48_DMA))
 

Er, why not:

		if (hwif->host_flags &
		    (IDE_HFLAG_NO_LBA48 | IDE_HFLAG_NO_LBA48_DMA))

MBR, Sergei

#10 lore raw

Re: [PATCH 7/9] ide: move ->rqsize init from init_irq() to ide_init_port()

Quoted 15 lines · Sergei Shtylyov

Hello.

Quoted 8 lines · Bartlomiej Zolnierkiewicz

Index: b/drivers/ide/ide-probe.c
===================================================================

drivers/ide/ide-probe.c +0 -0

[...]

Quoted 2 lines
drivers/ide/ide-probe.c +0 -0
@@ -1242,6 +1234,13 @@ static void ide_init_port(ide_hwif_t *hw
 
Quoted 11 lines

drivers/ide/ide-probe.c static void ide_init_port(ide_hwif_t *hw · line 1244

Quoted 6 lines
drivers/ide/ide-probe.c +3 -0
 	if (d->max_sectors)
 		hwif->rqsize = d->max_sectors;
+	else {
+		if ((hwif->host_flags & IDE_HFLAG_NO_LBA48) ||
+		    (hwif->host_flags & IDE_HFLAG_NO_LBA48_DMA))
 
   Er, why not:

		if (hwif->host_flags &
		    (IDE_HFLAG_NO_LBA48 | IDE_HFLAG_NO_LBA48_DMA))

IMO it is harder to read

#11 lore raw

Re: [PATCH 7/9] ide: move ->rqsize init from init_irq() to ide_init_port()

Hi,

Quoted 25 lines · Bartlomiej Zolnierkiewicz
Quoted 24 lines · Sergei Shtylyov

Hello.

Quoted 8 lines · Bartlomiej Zolnierkiewicz

Index: b/drivers/ide/ide-probe.c
===================================================================

drivers/ide/ide-probe.c +0 -0

[...]

drivers/ide/ide-probe.c static void ide_init_port(ide_hwif_t *hw · line 1240

Quoted 8 lines
drivers/ide/ide-probe.c +3 -0
@@ -1242,6 +1234,13 @@ static void ide_init_port(ide_hwif_t *hw
 
 	if (d->max_sectors)
 		hwif->rqsize = d->max_sectors;
+	else {
+		if ((hwif->host_flags & IDE_HFLAG_NO_LBA48) ||
+		    (hwif->host_flags & IDE_HFLAG_NO_LBA48_DMA))
 

Er, why not:

Quoted 4 lines
Quoted 2 lines
		if (hwif->host_flags &
		    (IDE_HFLAG_NO_LBA48 | IDE_HFLAG_NO_LBA48_DMA))

IMO it is harder to read

Sigh, why we were focused on subtle CodingStyle preferences we missed the real issue...

This patch depends on fact that all host drivers use struct ide_port_info which is not true yet (icside, buddha, ide_arm, ide-generic, ide-pnp and macide still needs to be updated). I dropped it from pata-2.6 for now...

Thanks,
Bart

#12 lore raw

PATCH 8/9 ide: move ->lock and ->timer init from init_irq() to ide_init_port_data()

In reply to Bartlomiej Zolnierkiewicz

From: Bartlomiej Zolnierkiewicz <[email protected]>
Subject: [PATCH] ide: move ->lock and ->timer init from init_irq() to ide_init_port_data()

---
 drivers/ide/ide-probe.c |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/ide/ide-probe.c +6 -5
Index: b/drivers/ide/ide-probe.c
===================================================================
@@ -939,11 +939,6 @@ static int init_irq (ide_hwif_t *hwif)
 	int sa = 0;
 
 	mutex_lock(&ide_cfg_mtx);
-	spin_lock_init(&hwif->lock);
-
-	init_timer(&hwif->timer);
-	hwif->timer.function = &ide_timer_expiry;
-	hwif->timer.data = (unsigned long)hwif;
 
 #if defined(__mc68000__)
 	sa = IRQF_SHARED;
@@ -1299,6 +1294,12 @@ static void ide_init_port_data(ide_hwif_
 	hwif->name[2]	= 'e';
 	hwif->name[3]	= '0' + index;
 
+	spin_lock_init(&hwif->lock);
+
+	init_timer(&hwif->timer);
+	hwif->timer.function = &ide_timer_expiry;
+	hwif->timer.data = (unsigned long)hwif;
+
 	init_completion(&hwif->gendev_rel_comp);
 
 	hwif->tp_ops = &default_tp_ops;
#13 lore raw

PATCH 9/9 ide: init_irq() doesn't need to hold ide_cfg_mtx

In reply to Bartlomiej Zolnierkiewicz

From: Bartlomiej Zolnierkiewicz <[email protected]>
Subject: [PATCH] ide: init_irq() doesn't need to hold ide_cfg_mtx

---
 drivers/ide/ide-probe.c |    4 ----
 1 file changed, 4 deletions(-)
drivers/ide/ide-probe.c +0 -4
Index: b/drivers/ide/ide-probe.c
===================================================================
@@ -938,8 +938,6 @@ static int init_irq (ide_hwif_t *hwif)
 	struct ide_io_ports *io_ports = &hwif->io_ports;
 	int sa = 0;
 
-	mutex_lock(&ide_cfg_mtx);
-
 #if defined(__mc68000__)
 	sa = IRQF_SHARED;
 #endif /* __mc68000__ */
@@ -965,10 +963,8 @@ static int init_irq (ide_hwif_t *hwif)
 		printk(KERN_CONT " (serialized)");
 	printk(KERN_CONT "\n");
 
-	mutex_unlock(&ide_cfg_mtx);
 	return 0;
 out_up:
-	mutex_unlock(&ide_cfg_mtx);
 	return 1;
 }