* [PATCH 00/15] weekly IDE updates
@ 2009-02-01 17:49 Bartlomiej Zolnierkiewicz
2009-02-01 17:49 ` [PATCH 01/15] ide: include <asm/ide.h> only when needed Bartlomiej Zolnierkiewicz
` (14 more replies)
0 siblings, 15 replies; 32+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-02-01 17:49 UTC (permalink / raw)
To: linux-ide; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel
The weekly IDE updates on top of pata-2.6 tree... [ What else did you expect? ]
Fix some minor bugs (memleak on device probing failure and incorrect error
message on multi-PIO write failure), limit proliferation of <asm/ide.h>, allow
host drivers to specify IRQ flags that they want and do a few cleanups...
diffstat:
drivers/ide/buddha.c | 1
drivers/ide/delkin_cb.c | 1
drivers/ide/dtc2278.c | 3 -
drivers/ide/falconide.c | 1
drivers/ide/gayle.c | 1
drivers/ide/ide-4drives.c | 3 -
drivers/ide/ide-cs.c | 1
drivers/ide/ide-disk.c | 3 -
drivers/ide/ide-disk_proc.c | 4 +
drivers/ide/ide-eh.c | 11 ++++-
drivers/ide/ide-floppy.c | 2
drivers/ide/ide-h8300.c | 4 -
drivers/ide/ide-io-std.c | 13 ++++--
drivers/ide/ide-io.c | 95 +++++++++++++-------------------------------
drivers/ide/ide-park.c | 2
drivers/ide/ide-pm.c | 9 +++-
drivers/ide/ide-probe.c | 56 +++++++++----------------
drivers/ide/ide-tape.c | 2
drivers/ide/ide-taskfile.c | 56 ++++++++++++++-----------
drivers/ide/macide.c | 1
drivers/ide/ns87415.c | 2
drivers/ide/q40ide.c | 1
drivers/ide/scc_pata.c | 28 +++++-------
drivers/ide/setup-pci.c | 4 +
drivers/ide/sgiioc4.c | 1
drivers/ide/tx4938ide.c | 6 +-
drivers/ide/tx4939ide.c | 6 +-
include/linux/ide.h | 93 ++++++++++++++++++++++---------------------
28 files changed, 202 insertions(+), 208 deletions(-)
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 01/15] ide: include <asm/ide.h> only when needed
2009-02-01 17:49 [PATCH 00/15] weekly IDE updates Bartlomiej Zolnierkiewicz
@ 2009-02-01 17:49 ` Bartlomiej Zolnierkiewicz
2009-02-02 7:49 ` Geert Uytterhoeven
2009-02-02 18:53 ` Jaswinder Singh Rajput
2009-02-01 17:49 ` [PATCH 02/15] scc_pata: remove DECLARE_SCC_DEV() macro Bartlomiej Zolnierkiewicz
` (13 subsequent siblings)
14 siblings, 2 replies; 32+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-02-01 17:49 UTC (permalink / raw)
To: linux-ide; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] ide: include <asm/ide.h> only when needed
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/ide-io-std.c | 7 +++++++
drivers/ide/tx4938ide.c | 2 ++
drivers/ide/tx4939ide.c | 2 ++
include/linux/ide.h | 7 -------
4 files changed, 11 insertions(+), 7 deletions(-)
Index: b/drivers/ide/ide-io-std.c
===================================================================
--- a/drivers/ide/ide-io-std.c
+++ b/drivers/ide/ide-io-std.c
@@ -2,6 +2,13 @@
#include <linux/kernel.h>
#include <linux/ide.h>
+#if defined(CONFIG_ARM) || defined(CONFIG_M68K) || defined(CONFIG_MIPS) || \
+ defined(CONFIG_PARISC) || defined(CONFIG_PPC) || defined(CONFIG_SPARC)
+#include <asm/ide.h>
+#else
+#include <asm-generic/ide_iops.h>
+#endif
+
/*
* Conventional PIO operations for ATA devices
*/
Index: b/drivers/ide/tx4938ide.c
===================================================================
--- a/drivers/ide/tx4938ide.c
+++ b/drivers/ide/tx4938ide.c
@@ -15,6 +15,8 @@
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/io.h>
+
+#include <asm/ide.h>
#include <asm/txx9/tx4938.h>
static void tx4938ide_tune_ebusc(unsigned int ebus_ch,
Index: b/drivers/ide/tx4939ide.c
===================================================================
--- a/drivers/ide/tx4939ide.c
+++ b/drivers/ide/tx4939ide.c
@@ -18,6 +18,8 @@
#include <linux/io.h>
#include <linux/scatterlist.h>
+#include <asm/ide.h>
+
#define MODNAME "tx4939ide"
/* ATA Shadow Registers (8-bit except for Data which is 16-bit) */
Index: b/include/linux/ide.h
===================================================================
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -193,13 +193,6 @@ static inline void ide_std_init_ports(hw
hw->io_ports.ctl_addr = ctl_addr;
}
-#if defined(CONFIG_ARM) || defined(CONFIG_M68K) || defined(CONFIG_MIPS) || \
- defined(CONFIG_PARISC) || defined(CONFIG_PPC) || defined(CONFIG_SPARC)
-#include <asm/ide.h>
-#else
-#include <asm-generic/ide_iops.h>
-#endif
-
#define MAX_HWIFS 10
/*
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 02/15] scc_pata: remove DECLARE_SCC_DEV() macro
2009-02-01 17:49 [PATCH 00/15] weekly IDE updates Bartlomiej Zolnierkiewicz
2009-02-01 17:49 ` [PATCH 01/15] ide: include <asm/ide.h> only when needed Bartlomiej Zolnierkiewicz
@ 2009-02-01 17:49 ` Bartlomiej Zolnierkiewicz
2009-02-01 18:49 ` Sergei Shtylyov
2009-02-02 16:45 ` Daniel K.
2009-02-01 17:49 ` [PATCH 03/15] ide: fix memleak on failure in probe_for_drive() Bartlomiej Zolnierkiewicz
` (12 subsequent siblings)
14 siblings, 2 replies; 32+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-02-01 17:49 UTC (permalink / raw)
To: linux-ide; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] scc_pata: remove DECLARE_SCC_DEV() macro
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/scc_pata.c | 23 +++++++++--------------
1 file changed, 9 insertions(+), 14 deletions(-)
Index: b/drivers/ide/scc_pata.c
===================================================================
--- a/drivers/ide/scc_pata.c
+++ b/drivers/ide/scc_pata.c
@@ -882,21 +882,16 @@ static const struct ide_dma_ops scc_dma_
.dma_sff_read_status = scc_dma_sff_read_status,
};
-#define DECLARE_SCC_DEV(name_str) \
- { \
- .name = name_str, \
- .init_iops = init_iops_scc, \
- .init_dma = scc_init_dma, \
- .init_hwif = init_hwif_scc, \
- .tp_ops = &scc_tp_ops, \
- .port_ops = &scc_port_ops, \
- .dma_ops = &scc_dma_ops, \
- .host_flags = IDE_HFLAG_SINGLE, \
- .pio_mask = ATA_PIO4, \
- }
-
static const struct ide_port_info scc_chipsets[] __devinitdata = {
- /* 0 */ DECLARE_SCC_DEV("sccIDE"),
+ .name = "sccIDE",
+ .init_iops = init_iops_scc,
+ .init_dma = scc_init_dma,
+ .init_hwif = init_hwif_scc,
+ .tp_ops = &scc_tp_ops,
+ .port_ops = &scc_port_ops,
+ .dma_ops = &scc_dma_ops,
+ .host_flags = IDE_HFLAG_SINGLE,
+ .pio_mask = ATA_PIO4,
};
/**
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 03/15] ide: fix memleak on failure in probe_for_drive()
2009-02-01 17:49 [PATCH 00/15] weekly IDE updates Bartlomiej Zolnierkiewicz
2009-02-01 17:49 ` [PATCH 01/15] ide: include <asm/ide.h> only when needed Bartlomiej Zolnierkiewicz
2009-02-01 17:49 ` [PATCH 02/15] scc_pata: remove DECLARE_SCC_DEV() macro Bartlomiej Zolnierkiewicz
@ 2009-02-01 17:49 ` Bartlomiej Zolnierkiewicz
2009-02-01 17:49 ` [PATCH 04/15] ide: fix error message in pre_task_out_intr() Bartlomiej Zolnierkiewicz
` (11 subsequent siblings)
14 siblings, 0 replies; 32+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-02-01 17:49 UTC (permalink / raw)
To: linux-ide; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] ide: fix memleak on failure in probe_for_drive()
Always free drive->id in probe_for_drive() if device is not present.
While at it:
- remove dead IDE_DFLAG_DEAD flag
- remove superfluous IDE_DFLAG_PRESENT check
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/ide-probe.c | 22 +++++++++-------------
include/linux/ide.h | 2 --
2 files changed, 9 insertions(+), 15 deletions(-)
Index: b/drivers/ide/ide-probe.c
===================================================================
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -228,15 +228,9 @@ static void do_identify(ide_drive_t *dri
m[ATA_ID_PROD_LEN - 1] = '\0';
if (strstr(m, "E X A B Y T E N E S T"))
- goto err_misc;
-
- drive->dev_flags |= IDE_DFLAG_PRESENT;
- drive->dev_flags &= ~IDE_DFLAG_DEAD;
-
- return;
-err_misc:
- kfree(id);
- drive->dev_flags &= ~IDE_DFLAG_PRESENT;
+ drive->dev_flags &= ~IDE_DFLAG_PRESENT;
+ else
+ drive->dev_flags |= IDE_DFLAG_PRESENT;
}
/**
@@ -505,8 +499,7 @@ static u8 probe_for_drive(ide_drive_t *d
}
if ((drive->dev_flags & IDE_DFLAG_PRESENT) == 0)
- /* drive not found */
- return 0;
+ goto out_free;
/* identification failed? */
if ((drive->dev_flags & IDE_DFLAG_ID_READ) == 0) {
@@ -530,7 +523,7 @@ static u8 probe_for_drive(ide_drive_t *d
}
if ((drive->dev_flags & IDE_DFLAG_PRESENT) == 0)
- return 0;
+ goto out_free;
/* The drive wasn't being helpful. Add generic info only */
if ((drive->dev_flags & IDE_DFLAG_ID_READ) == 0) {
@@ -543,7 +536,10 @@ static u8 probe_for_drive(ide_drive_t *d
ide_disk_init_mult_count(drive);
}
- return !!(drive->dev_flags & IDE_DFLAG_PRESENT);
+ return 1;
+out_free:
+ kfree(drive->id);
+ return 0;
}
static void hwif_release_dev(struct device *dev)
Index: b/include/linux/ide.h
===================================================================
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -494,8 +494,6 @@ enum {
IDE_DFLAG_NICE1 = (1 << 5),
/* device is physically present */
IDE_DFLAG_PRESENT = (1 << 6),
- /* device ejected hint */
- IDE_DFLAG_DEAD = (1 << 7),
/* id read from device (synthetic if not set) */
IDE_DFLAG_ID_READ = (1 << 8),
IDE_DFLAG_NOPROBE = (1 << 9),
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 04/15] ide: fix error message in pre_task_out_intr()
2009-02-01 17:49 [PATCH 00/15] weekly IDE updates Bartlomiej Zolnierkiewicz
` (2 preceding siblings ...)
2009-02-01 17:49 ` [PATCH 03/15] ide: fix memleak on failure in probe_for_drive() Bartlomiej Zolnierkiewicz
@ 2009-02-01 17:49 ` Bartlomiej Zolnierkiewicz
2009-02-01 17:49 ` [PATCH 05/15] ide: allow host drivers to specify IRQ flags Bartlomiej Zolnierkiewicz
` (10 subsequent siblings)
14 siblings, 0 replies; 32+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-02-01 17:49 UTC (permalink / raw)
To: linux-ide; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] ide: fix error message in pre_task_out_intr()
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/ide-taskfile.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Index: b/drivers/ide/ide-taskfile.c
===================================================================
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -419,12 +419,14 @@ static ide_startstop_t task_out_intr (id
static ide_startstop_t pre_task_out_intr(ide_drive_t *drive, struct request *rq)
{
+ ide_hwif_t *hwif = drive->hwif;
ide_startstop_t startstop;
if (ide_wait_stat(&startstop, drive, ATA_DRQ,
drive->bad_wstat, WAIT_DRQ)) {
printk(KERN_ERR "%s: no DRQ after issuing %sWRITE%s\n",
- drive->name, drive->hwif->data_phase ? "MULT" : "",
+ drive->name,
+ hwif->data_phase == TASKFILE_MULTI_OUT ? "MULT" : "",
(drive->dev_flags & IDE_DFLAG_LBA48) ? "_EXT" : "");
return startstop;
}
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 05/15] ide: allow host drivers to specify IRQ flags
2009-02-01 17:49 [PATCH 00/15] weekly IDE updates Bartlomiej Zolnierkiewicz
` (3 preceding siblings ...)
2009-02-01 17:49 ` [PATCH 04/15] ide: fix error message in pre_task_out_intr() Bartlomiej Zolnierkiewicz
@ 2009-02-01 17:49 ` Bartlomiej Zolnierkiewicz
2009-02-01 17:49 ` [PATCH 06/15] ide: remove now superfluous check from ide_host_register() Bartlomiej Zolnierkiewicz
` (9 subsequent siblings)
14 siblings, 0 replies; 32+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-02-01 17:49 UTC (permalink / raw)
To: linux-ide; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] ide: allow host drivers to specify IRQ flags
* Add ->irq_flags field to struct ide_port_info and struct ide_host.
* Update host drivers and IDE PCI code to use ->irq_flags field.
* Convert init_irq() and ide_intr() to use host->irq_flags.
This fixes handling of shared IRQs for non-PCI hosts
and removes ugly ifdeffery from core IDE code.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/buddha.c | 1 +
drivers/ide/delkin_cb.c | 1 +
drivers/ide/falconide.c | 1 +
drivers/ide/gayle.c | 1 +
drivers/ide/ide-cs.c | 1 +
drivers/ide/ide-io.c | 15 ++++-----------
drivers/ide/ide-probe.c | 9 +--------
drivers/ide/macide.c | 1 +
drivers/ide/q40ide.c | 1 +
drivers/ide/scc_pata.c | 1 +
drivers/ide/setup-pci.c | 4 ++++
drivers/ide/sgiioc4.c | 1 +
include/linux/ide.h | 6 ++++++
13 files changed, 24 insertions(+), 19 deletions(-)
Index: b/drivers/ide/buddha.c
===================================================================
--- a/drivers/ide/buddha.c
+++ b/drivers/ide/buddha.c
@@ -145,6 +145,7 @@ static void __init buddha_setup_ports(hw
static const struct ide_port_info buddha_port_info = {
.host_flags = IDE_HFLAG_MMIO | IDE_HFLAG_NO_DMA,
+ .irq_flags = IRQF_SHARED,
};
/*
Index: b/drivers/ide/delkin_cb.c
===================================================================
--- a/drivers/ide/delkin_cb.c
+++ b/drivers/ide/delkin_cb.c
@@ -66,6 +66,7 @@ static const struct ide_port_info delkin
.port_ops = &delkin_cb_port_ops,
.host_flags = IDE_HFLAG_IO_32BIT | IDE_HFLAG_UNMASK_IRQS |
IDE_HFLAG_NO_DMA,
+ .irq_flags = IRQF_SHARED,
.init_chipset = delkin_cb_init_chipset,
};
Index: b/drivers/ide/falconide.c
===================================================================
--- a/drivers/ide/falconide.c
+++ b/drivers/ide/falconide.c
@@ -105,6 +105,7 @@ static const struct ide_port_info falcon
.tp_ops = &falconide_tp_ops,
.host_flags = IDE_HFLAG_MMIO | IDE_HFLAG_SERIALIZE |
IDE_HFLAG_NO_DMA,
+ .irq_flags = IRQF_SHARED,
};
static void __init falconide_setup_ports(hw_regs_t *hw)
Index: b/drivers/ide/gayle.c
===================================================================
--- a/drivers/ide/gayle.c
+++ b/drivers/ide/gayle.c
@@ -120,6 +120,7 @@ static void __init gayle_setup_ports(hw_
static const struct ide_port_info gayle_port_info = {
.host_flags = IDE_HFLAG_MMIO | IDE_HFLAG_SERIALIZE |
IDE_HFLAG_NO_DMA,
+ .irq_flags = IRQF_SHARED,
};
/*
Index: b/drivers/ide/ide-cs.c
===================================================================
--- a/drivers/ide/ide-cs.c
+++ b/drivers/ide/ide-cs.c
@@ -154,6 +154,7 @@ static const struct ide_port_ops idecs_p
static const struct ide_port_info idecs_port_info = {
.port_ops = &idecs_port_ops,
.host_flags = IDE_HFLAG_NO_DMA,
+ .irq_flags = IRQF_SHARED,
};
static struct ide_host *idecs_register(unsigned long io, unsigned long ctl,
Index: b/drivers/ide/ide-io.c
===================================================================
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -841,6 +841,7 @@ static void unexpected_intr(int irq, ide
irqreturn_t ide_intr (int irq, void *dev_id)
{
ide_hwif_t *hwif = (ide_hwif_t *)dev_id;
+ struct ide_host *host = hwif->host;
ide_drive_t *uninitialized_var(drive);
ide_handler_t *handler;
unsigned long flags;
@@ -848,8 +849,8 @@ irqreturn_t ide_intr (int irq, void *dev
irqreturn_t irq_ret = IRQ_NONE;
int plug_device = 0;
- if (hwif->host->host_flags & IDE_HFLAG_SERIALIZE) {
- if (hwif != hwif->host->cur_port)
+ if (host->host_flags & IDE_HFLAG_SERIALIZE) {
+ if (hwif != host->cur_port)
goto out_early;
}
@@ -872,27 +873,19 @@ irqreturn_t ide_intr (int irq, void *dev
*
* For PCI, we cannot tell the difference,
* so in that case we just ignore it and hope it goes away.
- *
- * FIXME: unexpected_intr should be hwif-> then we can
- * remove all the ifdef PCI crap
*/
-#ifdef CONFIG_BLK_DEV_IDEPCI
- if (hwif->chipset != ide_pci)
-#endif /* CONFIG_BLK_DEV_IDEPCI */
- {
+ if ((host->irq_flags & IRQF_SHARED) == 0) {
/*
* Probably not a shared PCI interrupt,
* so we can safely try to do something about it:
*/
unexpected_intr(irq, hwif);
-#ifdef CONFIG_BLK_DEV_IDEPCI
} else {
/*
* Whack the status register, just in case
* we have a leftover pending IRQ.
*/
(void)hwif->tp_ops->read_status(hwif);
-#endif /* CONFIG_BLK_DEV_IDEPCI */
}
goto out;
}
Index: b/drivers/ide/ide-probe.c
===================================================================
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -837,14 +837,7 @@ static int ide_port_setup_devices(ide_hw
static int init_irq (ide_hwif_t *hwif)
{
struct ide_io_ports *io_ports = &hwif->io_ports;
- int sa = 0;
-
-#if defined(__mc68000__)
- sa = IRQF_SHARED;
-#endif /* __mc68000__ */
-
- if (hwif->chipset == ide_pci)
- sa = IRQF_SHARED;
+ int sa = hwif->host->irq_flags;
if (io_ports->ctl_addr)
hwif->tp_ops->set_irq(hwif, 1);
Index: b/drivers/ide/macide.c
===================================================================
--- a/drivers/ide/macide.c
+++ b/drivers/ide/macide.c
@@ -82,6 +82,7 @@ static void __init macide_setup_ports(hw
static const struct ide_port_info macide_port_info = {
.host_flags = IDE_HFLAG_MMIO | IDE_HFLAG_NO_DMA,
+ .irq_flags = IRQF_SHARED,
};
static const char *mac_ide_name[] =
Index: b/drivers/ide/q40ide.c
===================================================================
--- a/drivers/ide/q40ide.c
+++ b/drivers/ide/q40ide.c
@@ -112,6 +112,7 @@ static const struct ide_tp_ops q40ide_tp
static const struct ide_port_info q40ide_port_info = {
.tp_ops = &q40ide_tp_ops,
.host_flags = IDE_HFLAG_MMIO | IDE_HFLAG_NO_DMA,
+ .irq_flags = IRQF_SHARED,
};
/*
Index: b/drivers/ide/scc_pata.c
===================================================================
--- a/drivers/ide/scc_pata.c
+++ b/drivers/ide/scc_pata.c
@@ -891,6 +891,7 @@ static const struct ide_port_info scc_ch
.port_ops = &scc_port_ops,
.dma_ops = &scc_dma_ops,
.host_flags = IDE_HFLAG_SINGLE,
+ .irq_flags = IRQF_SHARED,
.pio_mask = ATA_PIO4,
};
Index: b/drivers/ide/setup-pci.c
===================================================================
--- a/drivers/ide/setup-pci.c
+++ b/drivers/ide/setup-pci.c
@@ -558,6 +558,8 @@ int ide_pci_init_one(struct pci_dev *dev
host->host_priv = priv;
+ host->irq_flags = IRQF_SHARED;
+
pci_set_drvdata(dev, host);
ret = do_ide_setup_pci_device(dev, d, 1);
@@ -606,6 +608,8 @@ int ide_pci_init_two(struct pci_dev *dev
host->host_priv = priv;
+ host->irq_flags = IRQF_SHARED;
+
pci_set_drvdata(pdev[0], host);
pci_set_drvdata(pdev[1], host);
Index: b/drivers/ide/sgiioc4.c
===================================================================
--- a/drivers/ide/sgiioc4.c
+++ b/drivers/ide/sgiioc4.c
@@ -557,6 +557,7 @@ static const struct ide_port_info sgiioc
.port_ops = &sgiioc4_port_ops,
.dma_ops = &sgiioc4_dma_ops,
.host_flags = IDE_HFLAG_MMIO,
+ .irq_flags = IRQF_SHARED,
.mwdma_mask = ATA_MWDMA2_ONLY,
};
Index: b/include/linux/ide.h
===================================================================
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -836,6 +836,9 @@ struct ide_host {
void (*release_lock)(void);
unsigned long host_flags;
+
+ int irq_flags;
+
void *host_priv;
ide_hwif_t *cur_port; /* for hosts requiring serialization */
@@ -1368,6 +1371,9 @@ struct ide_port_info {
u16 max_sectors; /* if < than the default one */
u32 host_flags;
+
+ int irq_flags;
+
u8 pio_mask;
u8 swdma_mask;
u8 mwdma_mask;
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 06/15] ide: remove now superfluous check from ide_host_register()
2009-02-01 17:49 [PATCH 00/15] weekly IDE updates Bartlomiej Zolnierkiewicz
` (4 preceding siblings ...)
2009-02-01 17:49 ` [PATCH 05/15] ide: allow host drivers to specify IRQ flags Bartlomiej Zolnierkiewicz
@ 2009-02-01 17:49 ` Bartlomiej Zolnierkiewicz
2009-02-01 17:49 ` [PATCH 07/15] ide: add IDE_HFLAG_DTC2278 host flag Bartlomiej Zolnierkiewicz
` (8 subsequent siblings)
14 siblings, 0 replies; 32+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-02-01 17:49 UTC (permalink / raw)
To: linux-ide; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] ide: remove now superfluous check from ide_host_register()
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/ide-probe.c | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
Index: b/drivers/ide/ide-probe.c
===================================================================
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -1333,20 +1333,15 @@ int ide_host_register(struct ide_host *h
ide_init_port_hw(hwif, hws[i]);
ide_port_apply_params(hwif);
- if (d == NULL) {
- mate = NULL;
- } else {
- if ((i & 1) && mate) {
- hwif->mate = mate;
- mate->mate = hwif;
- }
-
- mate = (i & 1) ? NULL : hwif;
-
- ide_init_port(hwif, i & 1, d);
- ide_port_cable_detect(hwif);
+ if ((i & 1) && mate) {
+ hwif->mate = mate;
+ mate->mate = hwif;
}
+ mate = (i & 1) ? NULL : hwif;
+
+ ide_init_port(hwif, i & 1, d);
+ ide_port_cable_detect(hwif);
ide_port_init_devices(hwif);
}
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 07/15] ide: add IDE_HFLAG_DTC2278 host flag
2009-02-01 17:49 [PATCH 00/15] weekly IDE updates Bartlomiej Zolnierkiewicz
` (5 preceding siblings ...)
2009-02-01 17:49 ` [PATCH 06/15] ide: remove now superfluous check from ide_host_register() Bartlomiej Zolnierkiewicz
@ 2009-02-01 17:49 ` Bartlomiej Zolnierkiewicz
2009-02-01 17:50 ` [PATCH 08/15] ide: add IDE_HFLAG_4DRIVES " Bartlomiej Zolnierkiewicz
` (7 subsequent siblings)
14 siblings, 0 replies; 32+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-02-01 17:49 UTC (permalink / raw)
To: linux-ide; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] ide: add IDE_HFLAG_DTC2278 host flag
Add IDE_HFLAG_DTC2278 host flag and use it instead of ide_dtc2278
chipset type in ide_init_port().
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/dtc2278.c | 3 ++-
drivers/ide/ide-probe.c | 2 +-
include/linux/ide.h | 2 ++
3 files changed, 5 insertions(+), 2 deletions(-)
Index: b/drivers/ide/dtc2278.c
===================================================================
--- a/drivers/ide/dtc2278.c
+++ b/drivers/ide/dtc2278.c
@@ -100,7 +100,8 @@ static const struct ide_port_info dtc227
IDE_HFLAG_IO_32BIT |
/* disallow ->io_32bit changes */
IDE_HFLAG_NO_IO_32BIT |
- IDE_HFLAG_NO_DMA,
+ IDE_HFLAG_NO_DMA |
+ IDE_HFLAG_DTC2278,
.pio_mask = ATA_PIO4,
};
Index: b/drivers/ide/ide-probe.c
===================================================================
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -1056,7 +1056,7 @@ static void ide_init_port(ide_hwif_t *hw
hwif->tp_ops = d->tp_ops;
/* ->set_pio_mode for DTC2278 is currently limited to port 0 */
- if (hwif->chipset != ide_dtc2278 || hwif->channel == 0)
+ if ((hwif->host_flags & IDE_HFLAG_DTC2278) == 0 || hwif->channel == 0)
hwif->port_ops = d->port_ops;
hwif->swdma_mask = d->swdma_mask;
Index: b/include/linux/ide.h
===================================================================
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1322,6 +1322,8 @@ enum {
IDE_HFLAG_ERROR_STOPS_FIFO = (1 << 19),
/* serialize ports */
IDE_HFLAG_SERIALIZE = (1 << 20),
+ /* host is DTC2278 */
+ IDE_HFLAG_DTC2278 = (1 << 21),
/* host is TRM290 */
IDE_HFLAG_TRM290 = (1 << 23),
/* use 32-bit I/O ops */
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 08/15] ide: add IDE_HFLAG_4DRIVES host flag
2009-02-01 17:49 [PATCH 00/15] weekly IDE updates Bartlomiej Zolnierkiewicz
` (6 preceding siblings ...)
2009-02-01 17:49 ` [PATCH 07/15] ide: add IDE_HFLAG_DTC2278 host flag Bartlomiej Zolnierkiewicz
@ 2009-02-01 17:50 ` Bartlomiej Zolnierkiewicz
2009-02-01 17:50 ` [PATCH 09/15] ide: add "flagged" taskfile flags to struct ide_taskfile Bartlomiej Zolnierkiewicz
` (6 subsequent siblings)
14 siblings, 0 replies; 32+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-02-01 17:50 UTC (permalink / raw)
To: linux-ide; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] ide: add IDE_HFLAG_4DRIVES host flag
Add IDE_HFLAG_4DRIVES host flag and use it instead of ide_4drives
chipset type in ide_init_port().
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/ide-4drives.c | 3 ++-
drivers/ide/ide-probe.c | 4 ++--
include/linux/ide.h | 2 ++
3 files changed, 6 insertions(+), 3 deletions(-)
Index: b/drivers/ide/ide-4drives.c
===================================================================
--- a/drivers/ide/ide-4drives.c
+++ b/drivers/ide/ide-4drives.c
@@ -23,7 +23,8 @@ static const struct ide_port_ops ide_4dr
static const struct ide_port_info ide_4drives_port_info = {
.port_ops = &ide_4drives_port_ops,
- .host_flags = IDE_HFLAG_SERIALIZE | IDE_HFLAG_NO_DMA,
+ .host_flags = IDE_HFLAG_SERIALIZE | IDE_HFLAG_NO_DMA |
+ IDE_HFLAG_4DRIVES,
};
static int __init ide_4drives_init(void)
Index: b/drivers/ide/ide-probe.c
===================================================================
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -1352,8 +1352,8 @@ int ide_host_register(struct ide_host *h
if (ide_probe_port(hwif) == 0)
hwif->present = 1;
- if (hwif->chipset != ide_4drives || !hwif->mate ||
- !hwif->mate->present)
+ if ((hwif->host_flags & IDE_HFLAG_4DRIVES) == 0 ||
+ hwif->mate == NULL || hwif->mate->present == 0)
ide_register_port(hwif);
if (hwif->present)
Index: b/include/linux/ide.h
===================================================================
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1324,6 +1324,8 @@ enum {
IDE_HFLAG_SERIALIZE = (1 << 20),
/* host is DTC2278 */
IDE_HFLAG_DTC2278 = (1 << 21),
+ /* 4 devices on a single set of I/O ports */
+ IDE_HFLAG_4DRIVES = (1 << 22),
/* host is TRM290 */
IDE_HFLAG_TRM290 = (1 << 23),
/* use 32-bit I/O ops */
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 09/15] ide: add "flagged" taskfile flags to struct ide_taskfile
2009-02-01 17:49 [PATCH 00/15] weekly IDE updates Bartlomiej Zolnierkiewicz
` (7 preceding siblings ...)
2009-02-01 17:50 ` [PATCH 08/15] ide: add IDE_HFLAG_4DRIVES " Bartlomiej Zolnierkiewicz
@ 2009-02-01 17:50 ` Bartlomiej Zolnierkiewicz
2009-02-06 6:04 ` Stephen Rothwell
2009-02-01 17:50 ` [PATCH 10/15] ide: complete power step in ide_complete_pm_request() Bartlomiej Zolnierkiewicz
` (5 subsequent siblings)
14 siblings, 1 reply; 32+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-02-01 17:50 UTC (permalink / raw)
To: linux-ide; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] ide: add "flagged" taskfile flags to struct ide_taskfile
* Add ->ftf_flags field to struct ide_taskfile
and convert flags for TASKFILE ioctl to use it.
* Rename "flagged" taskfile flags:
- IDE_TFLAG_FLAGGED -> IDE_FTFLAG_FLAGGED
- IDE_TFLAG_FLAGGED_SET_IN_FLAGS -> IDE_FTFLAG_SET_IN_FLAGS
- IDE_TFLAG_{OUT,IN}_DATA -> IDE_FTFLAG_{OUT,IN}_DATA
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/ide-h8300.c | 4 +-
drivers/ide/ide-io-std.c | 6 ++--
drivers/ide/ide-taskfile.c | 12 ++++----
drivers/ide/ns87415.c | 2 -
drivers/ide/scc_pata.c | 4 +-
drivers/ide/tx4938ide.c | 4 +-
drivers/ide/tx4939ide.c | 4 +-
include/linux/ide.h | 66 +++++++++++++++++++++++----------------------
8 files changed, 53 insertions(+), 49 deletions(-)
Index: b/drivers/ide/ide-h8300.c
===================================================================
--- a/drivers/ide/ide-h8300.c
+++ b/drivers/ide/ide-h8300.c
@@ -54,7 +54,7 @@ static void h8300_tf_load(ide_drive_t *d
if (task->tf_flags & IDE_TFLAG_FLAGGED)
HIHI = 0xFF;
- if (task->tf_flags & IDE_TFLAG_OUT_DATA)
+ if (task->ftf_flags & IDE_FTFLAG_OUT_DATA)
mm_outw((tf->hob_data << 8) | tf->data, io_ports->data_addr);
if (task->tf_flags & IDE_TFLAG_OUT_HOB_FEATURE)
@@ -90,7 +90,7 @@ static void h8300_tf_read(ide_drive_t *d
struct ide_io_ports *io_ports = &hwif->io_ports;
struct ide_taskfile *tf = &task->tf;
- if (task->tf_flags & IDE_TFLAG_IN_DATA) {
+ if (task->ftf_flags & IDE_FTFLAG_IN_DATA) {
u16 data = mm_inw(io_ports->data_addr);
tf->data = data & 0xff;
Index: b/drivers/ide/ide-io-std.c
===================================================================
--- a/drivers/ide/ide-io-std.c
+++ b/drivers/ide/ide-io-std.c
@@ -96,10 +96,10 @@ void ide_tf_load(ide_drive_t *drive, ide
else
tf_outb = ide_outb;
- if (task->tf_flags & IDE_TFLAG_FLAGGED)
+ if (task->ftf_flags & IDE_FTFLAG_FLAGGED)
HIHI = 0xFF;
- if (task->tf_flags & IDE_TFLAG_OUT_DATA) {
+ if (task->ftf_flags & IDE_FTFLAG_OUT_DATA) {
u16 data = (tf->hob_data << 8) | tf->data;
if (mmio)
@@ -153,7 +153,7 @@ void ide_tf_read(ide_drive_t *drive, ide
tf_inb = ide_inb;
}
- if (task->tf_flags & IDE_TFLAG_IN_DATA) {
+ if (task->ftf_flags & IDE_FTFLAG_IN_DATA) {
u16 data;
if (mmio)
Index: b/drivers/ide/ide-taskfile.c
===================================================================
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -73,8 +73,8 @@ ide_startstop_t do_rw_taskfile (ide_driv
}
}
- if (task->tf_flags & IDE_TFLAG_FLAGGED)
- task->tf_flags |= IDE_TFLAG_FLAGGED_SET_IN_FLAGS;
+ if (task->ftf_flags & IDE_FTFLAG_FLAGGED)
+ task->ftf_flags |= IDE_FTFLAG_SET_IN_FLAGS;
memcpy(&hwif->task, task, sizeof(*task));
@@ -551,10 +551,10 @@ int ide_taskfile_ioctl (ide_drive_t *dri
args.tf_flags |= (IDE_TFLAG_LBA48 | IDE_TFLAG_IN_HOB);
if (req_task->out_flags.all) {
- args.tf_flags |= IDE_TFLAG_FLAGGED;
+ args.ftf_flags |= IDE_FTFLAG_FLAGGED;
if (req_task->out_flags.b.data)
- args.tf_flags |= IDE_TFLAG_OUT_DATA;
+ args.ftf_flags |= IDE_FTFLAG_OUT_DATA;
if (req_task->out_flags.b.nsector_hob)
args.tf_flags |= IDE_TFLAG_OUT_HOB_NSECT;
@@ -582,7 +582,7 @@ int ide_taskfile_ioctl (ide_drive_t *dri
}
if (req_task->in_flags.b.data)
- args.tf_flags |= IDE_TFLAG_IN_DATA;
+ args.ftf_flags |= IDE_FTFLAG_IN_DATA;
switch(req_task->data_phase) {
case TASKFILE_MULTI_OUT:
@@ -647,7 +647,7 @@ int ide_taskfile_ioctl (ide_drive_t *dri
memcpy(req_task->hob_ports, &args.tf_array[0], HDIO_DRIVE_HOB_HDR_SIZE - 2);
memcpy(req_task->io_ports, &args.tf_array[6], HDIO_DRIVE_TASK_HDR_SIZE);
- if ((args.tf_flags & IDE_TFLAG_FLAGGED_SET_IN_FLAGS) &&
+ if ((args.ftf_flags & IDE_FTFLAG_SET_IN_FLAGS) &&
req_task->in_flags.all == 0) {
req_task->in_flags.all = IDE_TASKFILE_STD_IN_FLAGS;
if (drive->dev_flags & IDE_DFLAG_LBA48)
Index: b/drivers/ide/ns87415.c
===================================================================
--- a/drivers/ide/ns87415.c
+++ b/drivers/ide/ns87415.c
@@ -66,7 +66,7 @@ static void superio_tf_read(ide_drive_t
struct ide_io_ports *io_ports = &drive->hwif->io_ports;
struct ide_taskfile *tf = &task->tf;
- if (task->tf_flags & IDE_TFLAG_IN_DATA) {
+ if (task->ftf_flags & IDE_FTFLAG_IN_DATA) {
u16 data = inw(io_ports->data_addr);
tf->data = data & 0xff;
Index: b/drivers/ide/scc_pata.c
===================================================================
--- a/drivers/ide/scc_pata.c
+++ b/drivers/ide/scc_pata.c
@@ -675,7 +675,7 @@ static void scc_tf_load(ide_drive_t *dri
if (task->tf_flags & IDE_TFLAG_FLAGGED)
HIHI = 0xFF;
- if (task->tf_flags & IDE_TFLAG_OUT_DATA)
+ if (task->ftf_flags & IDE_FTFLAG_OUT_DATA)
out_be32((void *)io_ports->data_addr,
(tf->hob_data << 8) | tf->data);
@@ -711,7 +711,7 @@ static void scc_tf_read(ide_drive_t *dri
struct ide_io_ports *io_ports = &drive->hwif->io_ports;
struct ide_taskfile *tf = &task->tf;
- if (task->tf_flags & IDE_TFLAG_IN_DATA) {
+ if (task->ftf_flags & IDE_FTFLAG_IN_DATA) {
u16 data = (u16)in_be32((void *)io_ports->data_addr);
tf->data = data & 0xff;
Index: b/drivers/ide/tx4938ide.c
===================================================================
--- a/drivers/ide/tx4938ide.c
+++ b/drivers/ide/tx4938ide.c
@@ -92,7 +92,7 @@ static void tx4938ide_tf_load(ide_drive_
if (task->tf_flags & IDE_TFLAG_FLAGGED)
HIHI = 0xFF;
- if (task->tf_flags & IDE_TFLAG_OUT_DATA) {
+ if (task->ftf_flags & IDE_FTFLAG_OUT_DATA) {
u16 data = (tf->hob_data << 8) | tf->data;
/* no endian swap */
@@ -132,7 +132,7 @@ static void tx4938ide_tf_read(ide_drive_
struct ide_io_ports *io_ports = &hwif->io_ports;
struct ide_taskfile *tf = &task->tf;
- if (task->tf_flags & IDE_TFLAG_IN_DATA) {
+ if (task->ftf_flags & IDE_FTFLAG_IN_DATA) {
u16 data;
/* no endian swap */
Index: b/drivers/ide/tx4939ide.c
===================================================================
--- a/drivers/ide/tx4939ide.c
+++ b/drivers/ide/tx4939ide.c
@@ -477,7 +477,7 @@ static void tx4939ide_tf_load(ide_drive_
if (task->tf_flags & IDE_TFLAG_FLAGGED)
HIHI = 0xFF;
- if (task->tf_flags & IDE_TFLAG_OUT_DATA) {
+ if (task->ftf_flags & IDE_FTFLAG_OUT_DATA) {
u16 data = (tf->hob_data << 8) | tf->data;
/* no endian swap */
@@ -519,7 +519,7 @@ static void tx4939ide_tf_read(ide_drive_
struct ide_io_ports *io_ports = &hwif->io_ports;
struct ide_taskfile *tf = &task->tf;
- if (task->tf_flags & IDE_TFLAG_IN_DATA) {
+ if (task->ftf_flags & IDE_FTFLAG_IN_DATA) {
u16 data;
/* no endian swap */
Index: b/include/linux/ide.h
===================================================================
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -234,56 +234,52 @@ typedef enum {
enum {
IDE_TFLAG_LBA48 = (1 << 0),
- IDE_TFLAG_FLAGGED = (1 << 2),
- IDE_TFLAG_OUT_DATA = (1 << 3),
- IDE_TFLAG_OUT_HOB_FEATURE = (1 << 4),
- IDE_TFLAG_OUT_HOB_NSECT = (1 << 5),
- IDE_TFLAG_OUT_HOB_LBAL = (1 << 6),
- IDE_TFLAG_OUT_HOB_LBAM = (1 << 7),
- IDE_TFLAG_OUT_HOB_LBAH = (1 << 8),
+ IDE_TFLAG_OUT_HOB_FEATURE = (1 << 1),
+ IDE_TFLAG_OUT_HOB_NSECT = (1 << 2),
+ IDE_TFLAG_OUT_HOB_LBAL = (1 << 3),
+ IDE_TFLAG_OUT_HOB_LBAM = (1 << 4),
+ IDE_TFLAG_OUT_HOB_LBAH = (1 << 5),
IDE_TFLAG_OUT_HOB = IDE_TFLAG_OUT_HOB_FEATURE |
IDE_TFLAG_OUT_HOB_NSECT |
IDE_TFLAG_OUT_HOB_LBAL |
IDE_TFLAG_OUT_HOB_LBAM |
IDE_TFLAG_OUT_HOB_LBAH,
- IDE_TFLAG_OUT_FEATURE = (1 << 9),
- IDE_TFLAG_OUT_NSECT = (1 << 10),
- IDE_TFLAG_OUT_LBAL = (1 << 11),
- IDE_TFLAG_OUT_LBAM = (1 << 12),
- IDE_TFLAG_OUT_LBAH = (1 << 13),
+ IDE_TFLAG_OUT_FEATURE = (1 << 6),
+ IDE_TFLAG_OUT_NSECT = (1 << 7),
+ IDE_TFLAG_OUT_LBAL = (1 << 8),
+ IDE_TFLAG_OUT_LBAM = (1 << 9),
+ IDE_TFLAG_OUT_LBAH = (1 << 10),
IDE_TFLAG_OUT_TF = IDE_TFLAG_OUT_FEATURE |
IDE_TFLAG_OUT_NSECT |
IDE_TFLAG_OUT_LBAL |
IDE_TFLAG_OUT_LBAM |
IDE_TFLAG_OUT_LBAH,
- IDE_TFLAG_OUT_DEVICE = (1 << 14),
- IDE_TFLAG_WRITE = (1 << 15),
- IDE_TFLAG_FLAGGED_SET_IN_FLAGS = (1 << 16),
- IDE_TFLAG_IN_DATA = (1 << 17),
- IDE_TFLAG_CUSTOM_HANDLER = (1 << 18),
- IDE_TFLAG_DMA_PIO_FALLBACK = (1 << 19),
- IDE_TFLAG_IN_HOB_FEATURE = (1 << 20),
- IDE_TFLAG_IN_HOB_NSECT = (1 << 21),
- IDE_TFLAG_IN_HOB_LBAL = (1 << 22),
- IDE_TFLAG_IN_HOB_LBAM = (1 << 23),
- IDE_TFLAG_IN_HOB_LBAH = (1 << 24),
+ IDE_TFLAG_OUT_DEVICE = (1 << 11),
+ IDE_TFLAG_WRITE = (1 << 12),
+ IDE_TFLAG_CUSTOM_HANDLER = (1 << 13),
+ IDE_TFLAG_DMA_PIO_FALLBACK = (1 << 14),
+ IDE_TFLAG_IN_HOB_FEATURE = (1 << 15),
+ IDE_TFLAG_IN_HOB_NSECT = (1 << 16),
+ IDE_TFLAG_IN_HOB_LBAL = (1 << 17),
+ IDE_TFLAG_IN_HOB_LBAM = (1 << 18),
+ IDE_TFLAG_IN_HOB_LBAH = (1 << 19),
IDE_TFLAG_IN_HOB_LBA = IDE_TFLAG_IN_HOB_LBAL |
IDE_TFLAG_IN_HOB_LBAM |
IDE_TFLAG_IN_HOB_LBAH,
IDE_TFLAG_IN_HOB = IDE_TFLAG_IN_HOB_FEATURE |
IDE_TFLAG_IN_HOB_NSECT |
IDE_TFLAG_IN_HOB_LBA,
- IDE_TFLAG_IN_FEATURE = (1 << 1),
- IDE_TFLAG_IN_NSECT = (1 << 25),
- IDE_TFLAG_IN_LBAL = (1 << 26),
- IDE_TFLAG_IN_LBAM = (1 << 27),
- IDE_TFLAG_IN_LBAH = (1 << 28),
+ IDE_TFLAG_IN_FEATURE = (1 << 20),
+ IDE_TFLAG_IN_NSECT = (1 << 21),
+ IDE_TFLAG_IN_LBAL = (1 << 22),
+ IDE_TFLAG_IN_LBAM = (1 << 23),
+ IDE_TFLAG_IN_LBAH = (1 << 24),
IDE_TFLAG_IN_LBA = IDE_TFLAG_IN_LBAL |
IDE_TFLAG_IN_LBAM |
IDE_TFLAG_IN_LBAH,
IDE_TFLAG_IN_TF = IDE_TFLAG_IN_NSECT |
IDE_TFLAG_IN_LBA,
- IDE_TFLAG_IN_DEVICE = (1 << 29),
+ IDE_TFLAG_IN_DEVICE = (1 << 25),
IDE_TFLAG_HOB = IDE_TFLAG_OUT_HOB |
IDE_TFLAG_IN_HOB,
IDE_TFLAG_TF = IDE_TFLAG_OUT_TF |
@@ -291,9 +287,16 @@ enum {
IDE_TFLAG_DEVICE = IDE_TFLAG_OUT_DEVICE |
IDE_TFLAG_IN_DEVICE,
/* force 16-bit I/O operations */
- IDE_TFLAG_IO_16BIT = (1 << 30),
+ IDE_TFLAG_IO_16BIT = (1 << 26),
/* ide_task_t was allocated using kmalloc() */
- IDE_TFLAG_DYN = (1 << 31),
+ IDE_TFLAG_DYN = (1 << 27),
+};
+
+enum {
+ IDE_FTFLAG_FLAGGED = (1 << 0),
+ IDE_FTFLAG_SET_IN_FLAGS = (1 << 1),
+ IDE_FTFLAG_OUT_DATA = (1 << 2),
+ IDE_FTFLAG_IN_DATA = (1 << 3),
};
struct ide_taskfile {
@@ -330,6 +333,7 @@ typedef struct ide_task_s {
struct ide_taskfile tf;
u8 tf_array[14];
};
+ u8 ftf_flags; /* for TASKFILE ioctl */
u32 tf_flags;
int data_phase;
struct request *rq; /* copy of request */
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 10/15] ide: complete power step in ide_complete_pm_request()
2009-02-01 17:49 [PATCH 00/15] weekly IDE updates Bartlomiej Zolnierkiewicz
` (8 preceding siblings ...)
2009-02-01 17:50 ` [PATCH 09/15] ide: add "flagged" taskfile flags to struct ide_taskfile Bartlomiej Zolnierkiewicz
@ 2009-02-01 17:50 ` Bartlomiej Zolnierkiewicz
2009-02-01 17:50 ` [PATCH 11/15] ide: factor out completion of taskfile from ide_end_drive_cmd() Bartlomiej Zolnierkiewicz
` (4 subsequent siblings)
14 siblings, 0 replies; 32+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-02-01 17:50 UTC (permalink / raw)
To: linux-ide; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] ide: complete power step in ide_complete_pm_request()
* Complete power step in ide_complete_pm_request().
* Rename ide_complete_pm_request() to ide_complete_pm_rq().
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/ide-io.c | 8 ++------
drivers/ide/ide-pm.c | 9 +++++++--
include/linux/ide.h | 2 +-
3 files changed, 10 insertions(+), 9 deletions(-)
Index: b/drivers/ide/ide-io.c
===================================================================
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -178,11 +178,7 @@ void ide_end_drive_cmd (ide_drive_t *dri
kfree(task);
}
} else if (blk_pm_request(rq)) {
- struct request_pm_state *pm = rq->data;
-
- ide_complete_power_step(drive, rq);
- if (pm->pm_step == IDE_PM_COMPLETED)
- ide_complete_pm_request(drive, rq);
+ ide_complete_pm_rq(drive, rq);
return;
}
@@ -438,7 +434,7 @@ static ide_startstop_t start_request (id
startstop = ide_start_power_step(drive, rq);
if (startstop == ide_stopped &&
pm->pm_step == IDE_PM_COMPLETED)
- ide_complete_pm_request(drive, rq);
+ ide_complete_pm_rq(drive, rq);
return startstop;
} else if (!rq->rq_disk && blk_special_request(rq))
/*
Index: b/drivers/ide/ide-pm.c
===================================================================
--- a/drivers/ide/ide-pm.c
+++ b/drivers/ide/ide-pm.c
@@ -169,18 +169,23 @@ out_do_tf:
}
/**
- * ide_complete_pm_request - end the current Power Management request
+ * ide_complete_pm_rq - end the current Power Management request
* @drive: target drive
* @rq: request
*
* This function cleans up the current PM request and stops the queue
* if necessary.
*/
-void ide_complete_pm_request(ide_drive_t *drive, struct request *rq)
+void ide_complete_pm_rq(ide_drive_t *drive, struct request *rq)
{
struct request_queue *q = drive->queue;
+ struct request_pm_state *pm = rq->data;
unsigned long flags;
+ ide_complete_power_step(drive, rq);
+ if (pm->pm_step != IDE_PM_COMPLETED)
+ return;
+
#ifdef DEBUG_PM
printk("%s: completing PM request, %s\n", drive->name,
blk_pm_suspend_request(rq) ? "suspend" : "resume");
Index: b/include/linux/ide.h
===================================================================
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1078,7 +1078,7 @@ int generic_ide_resume(struct device *);
void ide_complete_power_step(ide_drive_t *, struct request *);
ide_startstop_t ide_start_power_step(ide_drive_t *, struct request *);
-void ide_complete_pm_request(ide_drive_t *, struct request *);
+void ide_complete_pm_rq(ide_drive_t *, struct request *);
void ide_check_pm_state(ide_drive_t *, struct request *);
/*
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 11/15] ide: factor out completion of taskfile from ide_end_drive_cmd()
2009-02-01 17:49 [PATCH 00/15] weekly IDE updates Bartlomiej Zolnierkiewicz
` (9 preceding siblings ...)
2009-02-01 17:50 ` [PATCH 10/15] ide: complete power step in ide_complete_pm_request() Bartlomiej Zolnierkiewicz
@ 2009-02-01 17:50 ` Bartlomiej Zolnierkiewicz
2009-02-01 17:50 ` [PATCH 12/15] ide: move request type specific code from ide_end_drive_cmd() to callers Bartlomiej Zolnierkiewicz
` (3 subsequent siblings)
14 siblings, 0 replies; 32+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-02-01 17:50 UTC (permalink / raw)
To: linux-ide; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] ide: factor out completion of taskfile from ide_end_drive_cmd()
Factor out completion of taskfile from ide_end_drive_cmd()
to ide_complete_task().
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/ide-io.c | 27 ++++++++++++++++-----------
1 file changed, 16 insertions(+), 11 deletions(-)
Index: b/drivers/ide/ide-io.c
===================================================================
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -144,6 +144,20 @@ int ide_end_dequeued_request(ide_drive_t
}
EXPORT_SYMBOL_GPL(ide_end_dequeued_request);
+static void ide_complete_task(ide_drive_t *drive, ide_task_t *task,
+ u8 stat, u8 err)
+{
+ struct ide_taskfile *tf = &task->tf;
+
+ tf->error = err;
+ tf->status = stat;
+
+ drive->hwif->tp_ops->tf_read(drive, task);
+
+ if (task->tf_flags & IDE_TFLAG_DYN)
+ kfree(task);
+}
+
/**
* ide_end_drive_cmd - end an explicit drive command
* @drive: command
@@ -166,17 +180,8 @@ void ide_end_drive_cmd (ide_drive_t *dri
if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) {
ide_task_t *task = (ide_task_t *)rq->special;
- if (task) {
- struct ide_taskfile *tf = &task->tf;
-
- tf->error = err;
- tf->status = stat;
-
- drive->hwif->tp_ops->tf_read(drive, task);
-
- if (task->tf_flags & IDE_TFLAG_DYN)
- kfree(task);
- }
+ if (task)
+ ide_complete_task(drive, task, stat, err);
} else if (blk_pm_request(rq)) {
ide_complete_pm_rq(drive, rq);
return;
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 12/15] ide: move request type specific code from ide_end_drive_cmd() to callers
2009-02-01 17:49 [PATCH 00/15] weekly IDE updates Bartlomiej Zolnierkiewicz
` (10 preceding siblings ...)
2009-02-01 17:50 ` [PATCH 11/15] ide: factor out completion of taskfile from ide_end_drive_cmd() Bartlomiej Zolnierkiewicz
@ 2009-02-01 17:50 ` Bartlomiej Zolnierkiewicz
2009-02-01 17:50 ` [PATCH 13/15] ide: no need to read Status and Error registers for "empty" taskfile requests Bartlomiej Zolnierkiewicz
` (2 subsequent siblings)
14 siblings, 0 replies; 32+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-02-01 17:50 UTC (permalink / raw)
To: linux-ide; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] ide: move request type specific code from ide_end_drive_cmd() to callers
* Move request type specific code from ide_end_drive_cmd() to callers.
* Remove stale ide_end_drive_cmd() documentation and drop no longer
used 'stat' argument. Then rename the function to ide_complete_rq().
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/ide-eh.c | 11 ++++++++++-
drivers/ide/ide-floppy.c | 2 +-
drivers/ide/ide-io.c | 36 ++++++------------------------------
drivers/ide/ide-tape.c | 2 +-
drivers/ide/ide-taskfile.c | 22 +++++++++++++++-------
include/linux/ide.h | 3 ++-
6 files changed, 35 insertions(+), 41 deletions(-)
Index: b/drivers/ide/ide-eh.c
===================================================================
--- a/drivers/ide/ide-eh.c
+++ b/drivers/ide/ide-eh.c
@@ -124,7 +124,16 @@ ide_startstop_t ide_error(ide_drive_t *d
/* retry only "normal" I/O: */
if (!blk_fs_request(rq)) {
rq->errors = 1;
- ide_end_drive_cmd(drive, stat, err);
+ if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) {
+ ide_task_t *task = rq->special;
+
+ if (task)
+ ide_complete_task(drive, task, stat, err);
+ } else if (blk_pm_request(rq)) {
+ ide_complete_pm_rq(drive, rq);
+ return ide_stopped;
+ }
+ ide_complete_rq(drive, err);
return ide_stopped;
}
Index: b/drivers/ide/ide-floppy.c
===================================================================
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -101,7 +101,7 @@ static int ide_floppy_end_request(ide_dr
}
rq->errors = error;
/* fixme: need to move this local also */
- ide_end_drive_cmd(drive, 0, 0);
+ ide_complete_rq(drive, 0);
return 0;
}
Index: b/drivers/ide/ide-io.c
===================================================================
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -144,8 +144,7 @@ int ide_end_dequeued_request(ide_drive_t
}
EXPORT_SYMBOL_GPL(ide_end_dequeued_request);
-static void ide_complete_task(ide_drive_t *drive, ide_task_t *task,
- u8 stat, u8 err)
+void ide_complete_task(ide_drive_t *drive, ide_task_t *task, u8 stat, u8 err)
{
struct ide_taskfile *tf = &task->tf;
@@ -158,35 +157,11 @@ static void ide_complete_task(ide_drive_
kfree(task);
}
-/**
- * ide_end_drive_cmd - end an explicit drive command
- * @drive: command
- * @stat: status bits
- * @err: error bits
- *
- * Clean up after success/failure of an explicit drive command.
- * These get thrown onto the queue so they are synchronized with
- * real I/O operations on the drive.
- *
- * In LBA48 mode we have to read the register set twice to get
- * all the extra information out.
- */
-
-void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err)
+void ide_complete_rq(ide_drive_t *drive, u8 err)
{
ide_hwif_t *hwif = drive->hwif;
struct request *rq = hwif->rq;
- if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) {
- ide_task_t *task = (ide_task_t *)rq->special;
-
- if (task)
- ide_complete_task(drive, task, stat, err);
- } else if (blk_pm_request(rq)) {
- ide_complete_pm_rq(drive, rq);
- return;
- }
-
hwif->rq = NULL;
rq->errors = err;
@@ -195,7 +170,7 @@ void ide_end_drive_cmd (ide_drive_t *dri
blk_rq_bytes(rq))))
BUG();
}
-EXPORT_SYMBOL(ide_end_drive_cmd);
+EXPORT_SYMBOL(ide_complete_rq);
void ide_kill_rq(ide_drive_t *drive, struct request *rq)
{
@@ -358,8 +333,9 @@ static ide_startstop_t execute_drive_cmd
#ifdef DEBUG
printk("%s: DRIVE_CMD (null)\n", drive->name);
#endif
- ide_end_drive_cmd(drive, hwif->tp_ops->read_status(hwif),
- ide_read_error(drive));
+ (void)hwif->tp_ops->read_status(hwif);
+
+ ide_complete_rq(drive, ide_read_error(drive));
return ide_stopped;
}
Index: b/drivers/ide/ide-tape.c
===================================================================
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -502,7 +502,7 @@ static int idetape_end_request(ide_drive
spin_lock_irqsave(&tape->lock, flags);
- ide_end_drive_cmd(drive, 0, 0);
+ ide_complete_rq(drive, 0);
spin_unlock_irqrestore(&tape->lock, flags);
return 0;
Index: b/drivers/ide/ide-taskfile.c
===================================================================
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -147,12 +147,9 @@ static ide_startstop_t task_no_data_intr
}
}
return ide_error(drive, "task_no_data_intr", stat);
- /* calls ide_end_drive_cmd */
}
- if (!custom)
- ide_end_drive_cmd(drive, stat, ide_read_error(drive));
- else if (tf->command == ATA_CMD_IDLEIMMEDIATE) {
+ if (custom && tf->command == ATA_CMD_IDLEIMMEDIATE) {
hwif->tp_ops->tf_read(drive, task);
if (tf->lbal != 0xc4) {
printk(KERN_ERR "%s: head unload failed!\n",
@@ -160,10 +157,18 @@ static ide_startstop_t task_no_data_intr
ide_tf_dump(drive->name, tf);
} else
drive->dev_flags |= IDE_DFLAG_PARKED;
- ide_end_drive_cmd(drive, stat, ide_read_error(drive));
- } else if (tf->command == ATA_CMD_SET_MULTI)
+ } else if (custom && tf->command == ATA_CMD_SET_MULTI)
drive->mult_count = drive->mult_req;
+ if (custom == 0 || tf->command == ATA_CMD_IDLEIMMEDIATE) {
+ struct request *rq = hwif->rq;
+ u8 err = ide_read_error(drive);
+
+ if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE)
+ ide_complete_task(drive, task, stat, err);
+ ide_complete_rq(drive, err);
+ }
+
return ide_stopped;
}
@@ -321,9 +326,12 @@ static ide_startstop_t task_error(ide_dr
void task_end_request(ide_drive_t *drive, struct request *rq, u8 stat)
{
if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) {
+ ide_task_t *task = rq->special;
u8 err = ide_read_error(drive);
- ide_end_drive_cmd(drive, stat, err);
+ if (task)
+ ide_complete_task(drive, task, stat, err);
+ ide_complete_rq(drive, err);
return;
}
Index: b/include/linux/ide.h
===================================================================
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1155,7 +1155,8 @@ extern ide_startstop_t ide_do_reset (ide
extern int ide_devset_execute(ide_drive_t *drive,
const struct ide_devset *setting, int arg);
-extern void ide_end_drive_cmd(ide_drive_t *, u8, u8);
+void ide_complete_task(ide_drive_t *, ide_task_t *, u8, u8);
+void ide_complete_rq(ide_drive_t *, u8);
void ide_tf_dump(const char *, struct ide_taskfile *);
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 13/15] ide: no need to read Status and Error registers for "empty" taskfile requests
2009-02-01 17:49 [PATCH 00/15] weekly IDE updates Bartlomiej Zolnierkiewicz
` (11 preceding siblings ...)
2009-02-01 17:50 ` [PATCH 12/15] ide: move request type specific code from ide_end_drive_cmd() to callers Bartlomiej Zolnierkiewicz
@ 2009-02-01 17:50 ` Bartlomiej Zolnierkiewicz
2009-02-01 17:50 ` [PATCH 14/15] ide: remove ->data_phase field from ide_hwif_t Bartlomiej Zolnierkiewicz
2009-02-01 17:50 ` [PATCH 15/15] ide: move smart_enable() call out from get_smart_data() Bartlomiej Zolnierkiewicz
14 siblings, 0 replies; 32+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-02-01 17:50 UTC (permalink / raw)
To: linux-ide; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] ide: no need to read Status and Error registers for "empty" taskfile requests
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/ide-io.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
Index: b/drivers/ide/ide-io.c
===================================================================
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -333,9 +333,7 @@ static ide_startstop_t execute_drive_cmd
#ifdef DEBUG
printk("%s: DRIVE_CMD (null)\n", drive->name);
#endif
- (void)hwif->tp_ops->read_status(hwif);
-
- ide_complete_rq(drive, ide_read_error(drive));
+ ide_complete_rq(drive, 0);
return ide_stopped;
}
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 14/15] ide: remove ->data_phase field from ide_hwif_t
2009-02-01 17:49 [PATCH 00/15] weekly IDE updates Bartlomiej Zolnierkiewicz
` (12 preceding siblings ...)
2009-02-01 17:50 ` [PATCH 13/15] ide: no need to read Status and Error registers for "empty" taskfile requests Bartlomiej Zolnierkiewicz
@ 2009-02-01 17:50 ` Bartlomiej Zolnierkiewicz
2009-02-01 17:50 ` [PATCH 15/15] ide: move smart_enable() call out from get_smart_data() Bartlomiej Zolnierkiewicz
14 siblings, 0 replies; 32+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-02-01 17:50 UTC (permalink / raw)
To: linux-ide; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] ide: remove ->data_phase field from ide_hwif_t
* Always use hwif->task->data_phase and remove ->data_phase
field from ide_hwif_t.
* Remove superfluous REQ_TYPE_ATA_TASKFILE check from
ide_pio_datablock() while at it.
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/ide-disk.c | 3 ---
drivers/ide/ide-io.c | 5 +----
drivers/ide/ide-park.c | 2 +-
drivers/ide/ide-taskfile.c | 18 ++++++++----------
include/linux/ide.h | 3 ---
5 files changed, 10 insertions(+), 21 deletions(-)
Index: b/drivers/ide/ide-disk.c
===================================================================
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -160,8 +160,6 @@ static ide_startstop_t __ide_do_rw_disk(
task.tf_flags |= IDE_TFLAG_WRITE;
ide_tf_set_cmd(drive, &task, dma);
- if (!dma)
- hwif->data_phase = task.data_phase;
task.rq = rq;
rc = do_rw_taskfile(drive, &task);
@@ -170,7 +168,6 @@ static ide_startstop_t __ide_do_rw_disk(
/* fallback to PIO */
task.tf_flags |= IDE_TFLAG_DMA_PIO_FALLBACK;
ide_tf_set_cmd(drive, &task, 0);
- hwif->data_phase = task.data_phase;
ide_init_sg_cmd(drive, rq);
rc = do_rw_taskfile(drive, &task);
}
Index: b/drivers/ide/ide-io.c
===================================================================
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -306,13 +306,10 @@ EXPORT_SYMBOL_GPL(ide_init_sg_cmd);
static ide_startstop_t execute_drive_cmd (ide_drive_t *drive,
struct request *rq)
{
- ide_hwif_t *hwif = drive->hwif;
ide_task_t *task = rq->special;
if (task) {
- hwif->data_phase = task->data_phase;
-
- switch (hwif->data_phase) {
+ switch (task->data_phase) {
case TASKFILE_MULTI_OUT:
case TASKFILE_OUT:
case TASKFILE_MULTI_IN:
Index: b/drivers/ide/ide-park.c
===================================================================
--- a/drivers/ide/ide-park.c
+++ b/drivers/ide/ide-park.c
@@ -81,7 +81,7 @@ ide_startstop_t ide_do_park_unpark(ide_d
task.tf_flags |= IDE_TFLAG_TF | IDE_TFLAG_DEVICE;
task.rq = rq;
- drive->hwif->data_phase = task.data_phase = TASKFILE_NO_DATA;
+ task.data_phase = TASKFILE_NO_DATA;
return do_rw_taskfile(drive, &task);
}
Index: b/drivers/ide/ide-taskfile.c
===================================================================
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -261,21 +261,18 @@ static void ide_pio_multi(ide_drive_t *d
static void ide_pio_datablock(ide_drive_t *drive, struct request *rq,
unsigned int write)
{
+ ide_task_t *task = &drive->hwif->task;
u8 saved_io_32bit = drive->io_32bit;
if (rq->bio) /* fs request */
rq->errors = 0;
- if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) {
- ide_task_t *task = rq->special;
-
- if (task->tf_flags & IDE_TFLAG_IO_16BIT)
- drive->io_32bit = 0;
- }
+ if (task->tf_flags & IDE_TFLAG_IO_16BIT)
+ drive->io_32bit = 0;
touch_softlockup_watchdog();
- switch (drive->hwif->data_phase) {
+ switch (task->data_phase) {
case TASKFILE_MULTI_IN:
case TASKFILE_MULTI_OUT:
ide_pio_multi(drive, rq, write);
@@ -293,9 +290,10 @@ static ide_startstop_t task_error(ide_dr
{
if (rq->bio) {
ide_hwif_t *hwif = drive->hwif;
+ ide_task_t *task = &hwif->task;
int sectors = hwif->nsect - hwif->nleft;
- switch (hwif->data_phase) {
+ switch (task->data_phase) {
case TASKFILE_IN:
if (hwif->nleft)
break;
@@ -427,14 +425,14 @@ static ide_startstop_t task_out_intr (id
static ide_startstop_t pre_task_out_intr(ide_drive_t *drive, struct request *rq)
{
- ide_hwif_t *hwif = drive->hwif;
+ ide_task_t *task = &drive->hwif->task;
ide_startstop_t startstop;
if (ide_wait_stat(&startstop, drive, ATA_DRQ,
drive->bad_wstat, WAIT_DRQ)) {
printk(KERN_ERR "%s: no DRQ after issuing %sWRITE%s\n",
drive->name,
- hwif->data_phase == TASKFILE_MULTI_OUT ? "MULT" : "",
+ task->data_phase == TASKFILE_MULTI_OUT ? "MULT" : "",
(drive->dev_flags & IDE_DFLAG_LBA48) ? "_EXT" : "");
return startstop;
}
Index: b/include/linux/ide.h
===================================================================
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -767,9 +767,6 @@ typedef struct hwif_s {
int sg_nents; /* Current number of entries in it */
int sg_dma_direction; /* dma transfer direction */
- /* data phase of the active command (currently only valid for PIO/DMA) */
- int data_phase;
-
struct ide_task_s task; /* current command */
unsigned int nsect;
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 15/15] ide: move smart_enable() call out from get_smart_data()
2009-02-01 17:49 [PATCH 00/15] weekly IDE updates Bartlomiej Zolnierkiewicz
` (13 preceding siblings ...)
2009-02-01 17:50 ` [PATCH 14/15] ide: remove ->data_phase field from ide_hwif_t Bartlomiej Zolnierkiewicz
@ 2009-02-01 17:50 ` Bartlomiej Zolnierkiewicz
14 siblings, 0 replies; 32+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-02-01 17:50 UTC (permalink / raw)
To: linux-ide; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] ide: move smart_enable() call out from get_smart_data()
Move smart_enable() call out from get_smart_data() to
proc_idedisk_read_smart().
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/ide-disk_proc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Index: b/drivers/ide/ide-disk_proc.c
===================================================================
--- a/drivers/ide/ide-disk_proc.c
+++ b/drivers/ide/ide-disk_proc.c
@@ -31,7 +31,7 @@ static int get_smart_data(ide_drive_t *d
tf->command = ATA_CMD_SMART;
args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE;
args.data_phase = TASKFILE_IN;
- (void) smart_enable(drive);
+
return ide_raw_taskfile(drive, &args, buf, 1);
}
@@ -67,6 +67,8 @@ static int proc_idedisk_read_smart(char
ide_drive_t *drive = (ide_drive_t *)data;
int len = 0, i = 0;
+ (void)smart_enable(drive);
+
if (get_smart_data(drive, page, sub_cmd) == 0) {
unsigned short *val = (unsigned short *) page;
char *out = (char *)val + SECTOR_SIZE;
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 02/15] scc_pata: remove DECLARE_SCC_DEV() macro
2009-02-01 17:49 ` [PATCH 02/15] scc_pata: remove DECLARE_SCC_DEV() macro Bartlomiej Zolnierkiewicz
@ 2009-02-01 18:49 ` Sergei Shtylyov
2009-02-02 16:45 ` Daniel K.
1 sibling, 0 replies; 32+ messages in thread
From: Sergei Shtylyov @ 2009-02-01 18:49 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz; +Cc: linux-ide, linux-kernel
Bartlomiej Zolnierkiewicz wrote:
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Down with the copy & paste programming! :-)
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
MBR, Sergei
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 01/15] ide: include <asm/ide.h> only when needed
2009-02-01 17:49 ` [PATCH 01/15] ide: include <asm/ide.h> only when needed Bartlomiej Zolnierkiewicz
@ 2009-02-02 7:49 ` Geert Uytterhoeven
2009-02-02 18:27 ` Bartlomiej Zolnierkiewicz
2009-02-02 18:53 ` Jaswinder Singh Rajput
1 sibling, 1 reply; 32+ messages in thread
From: Geert Uytterhoeven @ 2009-02-02 7:49 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz; +Cc: linux-ide, linux-kernel
On Sun, 1 Feb 2009, Bartlomiej Zolnierkiewicz wrote:
> From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> Subject: [PATCH] ide: include <asm/ide.h> only when needed
>
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> ---
> drivers/ide/ide-io-std.c | 7 +++++++
> drivers/ide/tx4938ide.c | 2 ++
> drivers/ide/tx4939ide.c | 2 ++
> include/linux/ide.h | 7 -------
> 4 files changed, 11 insertions(+), 7 deletions(-)
>
> Index: b/drivers/ide/ide-io-std.c
> ===================================================================
> --- a/drivers/ide/ide-io-std.c
> +++ b/drivers/ide/ide-io-std.c
> @@ -2,6 +2,13 @@
> #include <linux/kernel.h>
> #include <linux/ide.h>
>
> +#if defined(CONFIG_ARM) || defined(CONFIG_M68K) || defined(CONFIG_MIPS) || \
> + defined(CONFIG_PARISC) || defined(CONFIG_PPC) || defined(CONFIG_SPARC)
> +#include <asm/ide.h>
> +#else
> +#include <asm-generic/ide_iops.h>
> +#endif
> +
> /*
> * Conventional PIO operations for ATA devices
> */
> Index: b/drivers/ide/tx4938ide.c
> ===================================================================
> --- a/drivers/ide/tx4938ide.c
> +++ b/drivers/ide/tx4938ide.c
> @@ -15,6 +15,8 @@
> #include <linux/init.h>
> #include <linux/platform_device.h>
> #include <linux/io.h>
> +
> +#include <asm/ide.h>
Did you try checkpatch.pl?
[...]
> Index: b/include/linux/ide.h
> ===================================================================
> --- a/include/linux/ide.h
> +++ b/include/linux/ide.h
> @@ -193,13 +193,6 @@ static inline void ide_std_init_ports(hw
> hw->io_ports.ctl_addr = ctl_addr;
> }
>
> -#if defined(CONFIG_ARM) || defined(CONFIG_M68K) || defined(CONFIG_MIPS) || \
> - defined(CONFIG_PARISC) || defined(CONFIG_PPC) || defined(CONFIG_SPARC)
> -#include <asm/ide.h>
> -#else
> -#include <asm-generic/ide_iops.h>
> -#endif
> -
> #define MAX_HWIFS 10
>
> /*
As checkpatch.pl complains about any include of asm/*.h where the corresponding
linux/*.h exists, this `fix' is incompatible with it.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 02/15] scc_pata: remove DECLARE_SCC_DEV() macro
2009-02-01 17:49 ` [PATCH 02/15] scc_pata: remove DECLARE_SCC_DEV() macro Bartlomiej Zolnierkiewicz
2009-02-01 18:49 ` Sergei Shtylyov
@ 2009-02-02 16:45 ` Daniel K.
2009-02-02 18:26 ` Bartlomiej Zolnierkiewicz
1 sibling, 1 reply; 32+ messages in thread
From: Daniel K. @ 2009-02-02 16:45 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz; +Cc: linux-ide, linux-kernel
Bartlomiej Zolnierkiewicz wrote:
> Index: b/drivers/ide/scc_pata.c
> ===================================================================
> --- a/drivers/ide/scc_pata.c
> +++ b/drivers/ide/scc_pata.c
> @@ -882,21 +882,16 @@ static const struct ide_dma_ops scc_dma_
> .dma_sff_read_status = scc_dma_sff_read_status,
> };
>
> -#define DECLARE_SCC_DEV(name_str) \
> - { \
> - .name = name_str, \
> - .init_iops = init_iops_scc, \
> - .init_dma = scc_init_dma, \
> - .init_hwif = init_hwif_scc, \
> - .tp_ops = &scc_tp_ops, \
> - .port_ops = &scc_port_ops, \
> - .dma_ops = &scc_dma_ops, \
> - .host_flags = IDE_HFLAG_SINGLE, \
> - .pio_mask = ATA_PIO4, \
> - }
> -
> static const struct ide_port_info scc_chipsets[] __devinitdata = {
> - /* 0 */ DECLARE_SCC_DEV("sccIDE"),
> + .name = "sccIDE",
> + .init_iops = init_iops_scc,
> + .init_dma = scc_init_dma,
> + .init_hwif = init_hwif_scc,
> + .tp_ops = &scc_tp_ops,
> + .port_ops = &scc_port_ops,
> + .dma_ops = &scc_dma_ops,
> + .host_flags = IDE_HFLAG_SINGLE,
> + .pio_mask = ATA_PIO4,
> };
>
> /**
You're a few braces short here, aren't you?
The braces in the #define, didn't get carried over in the change.
Daniel K.
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 02/15] scc_pata: remove DECLARE_SCC_DEV() macro
2009-02-02 16:45 ` Daniel K.
@ 2009-02-02 18:26 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 32+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-02-02 18:26 UTC (permalink / raw)
To: Daniel K.; +Cc: linux-ide, linux-kernel
On Monday 02 February 2009, Daniel K. wrote:
> Bartlomiej Zolnierkiewicz wrote:
> > Index: b/drivers/ide/scc_pata.c
> > ===================================================================
> > --- a/drivers/ide/scc_pata.c
> > +++ b/drivers/ide/scc_pata.c
> > @@ -882,21 +882,16 @@ static const struct ide_dma_ops scc_dma_
> > .dma_sff_read_status = scc_dma_sff_read_status,
> > };
> >
> > -#define DECLARE_SCC_DEV(name_str) \
> > - { \
> > - .name = name_str, \
> > - .init_iops = init_iops_scc, \
> > - .init_dma = scc_init_dma, \
> > - .init_hwif = init_hwif_scc, \
> > - .tp_ops = &scc_tp_ops, \
> > - .port_ops = &scc_port_ops, \
> > - .dma_ops = &scc_dma_ops, \
> > - .host_flags = IDE_HFLAG_SINGLE, \
> > - .pio_mask = ATA_PIO4, \
> > - }
> > -
> > static const struct ide_port_info scc_chipsets[] __devinitdata = {
> > - /* 0 */ DECLARE_SCC_DEV("sccIDE"),
> > + .name = "sccIDE",
> > + .init_iops = init_iops_scc,
> > + .init_dma = scc_init_dma,
> > + .init_hwif = init_hwif_scc,
> > + .tp_ops = &scc_tp_ops,
> > + .port_ops = &scc_port_ops,
> > + .dma_ops = &scc_dma_ops,
> > + .host_flags = IDE_HFLAG_SINGLE,
> > + .pio_mask = ATA_PIO4,
> > };
> >
> > /**
>
> You're a few braces short here, aren't you?
Good catch, thanks!
> The braces in the #define, didn't get carried over in the change.
Actually we may simplify the whole thing while at it.
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] scc_pata: remove DECLARE_SCC_DEV() macro (v2)
v2:
scc_chipsets[] -> scc_chipset fix (spotted by Daniel K.).
Cc: "Daniel K." <daniel@cluded.net>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/scc_pata.c | 27 +++++++++++----------------
1 file changed, 11 insertions(+), 16 deletions(-)
Index: b/drivers/ide/scc_pata.c
===================================================================
--- a/drivers/ide/scc_pata.c
+++ b/drivers/ide/scc_pata.c
@@ -882,21 +882,16 @@ static const struct ide_dma_ops scc_dma_
.dma_sff_read_status = scc_dma_sff_read_status,
};
-#define DECLARE_SCC_DEV(name_str) \
- { \
- .name = name_str, \
- .init_iops = init_iops_scc, \
- .init_dma = scc_init_dma, \
- .init_hwif = init_hwif_scc, \
- .tp_ops = &scc_tp_ops, \
- .port_ops = &scc_port_ops, \
- .dma_ops = &scc_dma_ops, \
- .host_flags = IDE_HFLAG_SINGLE, \
- .pio_mask = ATA_PIO4, \
- }
-
-static const struct ide_port_info scc_chipsets[] __devinitdata = {
- /* 0 */ DECLARE_SCC_DEV("sccIDE"),
+static const struct ide_port_info scc_chipset __devinitdata = {
+ .name = "sccIDE",
+ .init_iops = init_iops_scc,
+ .init_dma = scc_init_dma,
+ .init_hwif = init_hwif_scc,
+ .tp_ops = &scc_tp_ops,
+ .port_ops = &scc_port_ops,
+ .dma_ops = &scc_dma_ops,
+ .host_flags = IDE_HFLAG_SINGLE,
+ .pio_mask = ATA_PIO4,
};
/**
@@ -910,7 +905,7 @@ static const struct ide_port_info scc_ch
static int __devinit scc_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
- return init_setup_scc(dev, &scc_chipsets[id->driver_data]);
+ return init_setup_scc(dev, &scc_chipset);
}
/**
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 01/15] ide: include <asm/ide.h> only when needed
2009-02-02 7:49 ` Geert Uytterhoeven
@ 2009-02-02 18:27 ` Bartlomiej Zolnierkiewicz
2009-02-04 14:20 ` Atsushi Nemoto
0 siblings, 1 reply; 32+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-02-02 18:27 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: linux-ide, linux-kernel, Andy Whitcroft
On Monday 02 February 2009, Geert Uytterhoeven wrote:
> On Sun, 1 Feb 2009, Bartlomiej Zolnierkiewicz wrote:
> > From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> > Subject: [PATCH] ide: include <asm/ide.h> only when needed
> >
> > Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> > ---
> > drivers/ide/ide-io-std.c | 7 +++++++
> > drivers/ide/tx4938ide.c | 2 ++
> > drivers/ide/tx4939ide.c | 2 ++
> > include/linux/ide.h | 7 -------
> > 4 files changed, 11 insertions(+), 7 deletions(-)
> >
> > Index: b/drivers/ide/ide-io-std.c
> > ===================================================================
> > --- a/drivers/ide/ide-io-std.c
> > +++ b/drivers/ide/ide-io-std.c
> > @@ -2,6 +2,13 @@
> > #include <linux/kernel.h>
> > #include <linux/ide.h>
> >
> > +#if defined(CONFIG_ARM) || defined(CONFIG_M68K) || defined(CONFIG_MIPS) || \
> > + defined(CONFIG_PARISC) || defined(CONFIG_PPC) || defined(CONFIG_SPARC)
> > +#include <asm/ide.h>
> > +#else
> > +#include <asm-generic/ide_iops.h>
> > +#endif
> > +
> > /*
> > * Conventional PIO operations for ATA devices
> > */
> > Index: b/drivers/ide/tx4938ide.c
> > ===================================================================
> > --- a/drivers/ide/tx4938ide.c
> > +++ b/drivers/ide/tx4938ide.c
> > @@ -15,6 +15,8 @@
> > #include <linux/init.h>
> > #include <linux/platform_device.h>
> > #include <linux/io.h>
> > +
> > +#include <asm/ide.h>
>
> Did you try checkpatch.pl?
Sure.
This driver uses stuff from <asm-mips/ide.h>.
[ I guess I could put '-mips' there to silence warnings on tx493{8,9}.c,
however I don't know of the way to get rid of ide-io-std.c's one... ]
> [...]
>
> > Index: b/include/linux/ide.h
> > ===================================================================
> > --- a/include/linux/ide.h
> > +++ b/include/linux/ide.h
> > @@ -193,13 +193,6 @@ static inline void ide_std_init_ports(hw
> > hw->io_ports.ctl_addr = ctl_addr;
> > }
> >
> > -#if defined(CONFIG_ARM) || defined(CONFIG_M68K) || defined(CONFIG_MIPS) || \
> > - defined(CONFIG_PARISC) || defined(CONFIG_PPC) || defined(CONFIG_SPARC)
> > -#include <asm/ide.h>
> > -#else
> > -#include <asm-generic/ide_iops.h>
> > -#endif
> > -
> > #define MAX_HWIFS 10
> >
> > /*
>
> As checkpatch.pl complains about any include of asm/*.h where the corresponding
> linux/*.h exists, this `fix' is incompatible with it.
checkpatch.pl gives false positives when it comes to some asm/*.h usages
This fix is such example -- it makes <asm/ide.h> pulled in only when really
needed (ide-io-std.c and tx493{8,9}.c) instead of being pulled in indirectly
by every file including <linux/ide.h>.
[ Long-term we want <asm/ide.h> removed but this is not possible yet so
I'm trying to limit its scope in the meantime... ]
Thanks,
Bart
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 01/15] ide: include <asm/ide.h> only when needed
2009-02-01 17:49 ` [PATCH 01/15] ide: include <asm/ide.h> only when needed Bartlomiej Zolnierkiewicz
2009-02-02 7:49 ` Geert Uytterhoeven
@ 2009-02-02 18:53 ` Jaswinder Singh Rajput
1 sibling, 0 replies; 32+ messages in thread
From: Jaswinder Singh Rajput @ 2009-02-02 18:53 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz; +Cc: linux-ide, linux-kernel
On Sun, 2009-02-01 at 18:49 +0100, Bartlomiej Zolnierkiewicz wrote:
> From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> Subject: [PATCH] ide: include <asm/ide.h> only when needed
>
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> ---
> drivers/ide/ide-io-std.c | 7 +++++++
> drivers/ide/tx4938ide.c | 2 ++
> drivers/ide/tx4939ide.c | 2 ++
> include/linux/ide.h | 7 -------
> 4 files changed, 11 insertions(+), 7 deletions(-)
>
> Index: b/include/linux/ide.h
> ===================================================================
> --- a/include/linux/ide.h
> +++ b/include/linux/ide.h
> @@ -193,13 +193,6 @@ static inline void ide_std_init_ports(hw
> hw->io_ports.ctl_addr = ctl_addr;
> }
>
> -#if defined(CONFIG_ARM) || defined(CONFIG_M68K) || defined(CONFIG_MIPS) || \
> - defined(CONFIG_PARISC) || defined(CONFIG_PPC) || defined(CONFIG_SPARC)
> -#include <asm/ide.h>
> -#else
> -#include <asm-generic/ide_iops.h>
> -#endif
> -
> #define MAX_HWIFS 10
>
What is the point of removing <asm/ide.h> from <linux/ide.h>
--
JSR
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 01/15] ide: include <asm/ide.h> only when needed
2009-02-02 18:27 ` Bartlomiej Zolnierkiewicz
@ 2009-02-04 14:20 ` Atsushi Nemoto
2009-02-05 21:14 ` Bartlomiej Zolnierkiewicz
0 siblings, 1 reply; 32+ messages in thread
From: Atsushi Nemoto @ 2009-02-04 14:20 UTC (permalink / raw)
To: bzolnier; +Cc: geert, linux-ide, linux-kernel, apw
On Mon, 2 Feb 2009 19:27:25 +0100, Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> wrote:
> > > +#include <asm/ide.h>
> >
> > Did you try checkpatch.pl?
>
> Sure.
>
> This driver uses stuff from <asm-mips/ide.h>.
>
> [ I guess I could put '-mips' there to silence warnings on tx493{8,9}.c,
> however I don't know of the way to get rid of ide-io-std.c's one... ]
BTW, tx4939ide_{in,out}put_data_swap and
tx4939ide_{in,out}put_data_swap do exactly same thing.
If byte-swapped version of ide_{in,out}put_data() were available by
ide core, they can be used instead. The byte-swapped version of
default_tp_ops would much helps such queer big-endian platforms. Is
it worth to bloat ide core? ;-)
---
Atsushi Nemoto
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 01/15] ide: include <asm/ide.h> only when needed
2009-02-04 14:20 ` Atsushi Nemoto
@ 2009-02-05 21:14 ` Bartlomiej Zolnierkiewicz
2009-02-05 23:58 ` Sergei Shtylyov
0 siblings, 1 reply; 32+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-02-05 21:14 UTC (permalink / raw)
To: Atsushi Nemoto; +Cc: geert, linux-ide, linux-kernel, apw
On Wednesday 04 February 2009, Atsushi Nemoto wrote:
> On Mon, 2 Feb 2009 19:27:25 +0100, Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> wrote:
> > > > +#include <asm/ide.h>
> > >
> > > Did you try checkpatch.pl?
> >
> > Sure.
> >
> > This driver uses stuff from <asm-mips/ide.h>.
> >
> > [ I guess I could put '-mips' there to silence warnings on tx493{8,9}.c,
> > however I don't know of the way to get rid of ide-io-std.c's one... ]
>
> BTW, tx4939ide_{in,out}put_data_swap and
> tx4939ide_{in,out}put_data_swap do exactly same thing.
>
> If byte-swapped version of ide_{in,out}put_data() were available by
> ide core, they can be used instead. The byte-swapped version of
> default_tp_ops would much helps such queer big-endian platforms. Is
> it worth to bloat ide core? ;-)
Seems to be a good idea and it may also help some other host drivers
(ide-h8300.c?).
Thanks,
Bart
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 01/15] ide: include <asm/ide.h> only when needed
2009-02-05 21:14 ` Bartlomiej Zolnierkiewicz
@ 2009-02-05 23:58 ` Sergei Shtylyov
2009-02-06 16:21 ` Bartlomiej Zolnierkiewicz
0 siblings, 1 reply; 32+ messages in thread
From: Sergei Shtylyov @ 2009-02-05 23:58 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz
Cc: Atsushi Nemoto, geert, linux-ide, linux-kernel, apw
Hello.
Bartlomiej Zolnierkiewicz wrote:
>>>>> +#include <asm/ide.h>
>>>>>
>>>> Did you try checkpatch.pl?
>>>>
>>> Sure.
>>>
>>> This driver uses stuff from <asm-mips/ide.h>.
>>>
>>> [ I guess I could put '-mips' there to silence warnings on tx493{8,9}.c,
>>> however I don't know of the way to get rid of ide-io-std.c's one... ]
>>>
>> BTW, tx4939ide_{in,out}put_data_swap and
>> tx4939ide_{in,out}put_data_swap do exactly same thing.
>>
>> If byte-swapped version of ide_{in,out}put_data() were available by
>> ide core, they can be used instead. The byte-swapped version of
>> default_tp_ops would much helps such queer big-endian platforms. Is
>> it worth to bloat ide core? ;-)
>>
>
> Seems to be a good idea and it may also help some other host drivers
> (ide-h8300.c?).
>
I'm not sure we need to carry the extra little used code just to help
some exotic driver.
> Thanks,
> Bart
MBR, Sergei
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 09/15] ide: add "flagged" taskfile flags to struct ide_taskfile
2009-02-01 17:50 ` [PATCH 09/15] ide: add "flagged" taskfile flags to struct ide_taskfile Bartlomiej Zolnierkiewicz
@ 2009-02-06 6:04 ` Stephen Rothwell
2009-02-08 11:38 ` Bartlomiej Zolnierkiewicz
0 siblings, 1 reply; 32+ messages in thread
From: Stephen Rothwell @ 2009-02-06 6:04 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz; +Cc: linux-ide, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 656 bytes --]
Hi Bart,
On Sun, 01 Feb 2009 18:50:12 +0100 Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> wrote:
>
> From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> Subject: [PATCH] ide: add "flagged" taskfile flags to struct ide_taskfile
>
> * Add ->ftf_flags field to struct ide_taskfile
> and convert flags for TASKFILE ioctl to use it.
>
> * Rename "flagged" taskfile flags:
> - IDE_TFLAG_FLAGGED -> IDE_FTFLAG_FLAGGED
There were several places where this transformation did not take place as
shown by today's linux-next build.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 01/15] ide: include <asm/ide.h> only when needed
2009-02-05 23:58 ` Sergei Shtylyov
@ 2009-02-06 16:21 ` Bartlomiej Zolnierkiewicz
2009-02-06 22:03 ` Sergei Shtylyov
0 siblings, 1 reply; 32+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-02-06 16:21 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: Atsushi Nemoto, geert, linux-ide, linux-kernel, apw
Hi,
On Friday 06 February 2009, Sergei Shtylyov wrote:
> Hello.
>
> Bartlomiej Zolnierkiewicz wrote:
>
> >>>>> +#include <asm/ide.h>
> >>>>>
> >>>> Did you try checkpatch.pl?
> >>>>
> >>> Sure.
> >>>
> >>> This driver uses stuff from <asm-mips/ide.h>.
> >>>
> >>> [ I guess I could put '-mips' there to silence warnings on tx493{8,9}.c,
> >>> however I don't know of the way to get rid of ide-io-std.c's one... ]
> >>>
> >> BTW, tx4939ide_{in,out}put_data_swap and
> >> tx4939ide_{in,out}put_data_swap do exactly same thing.
> >>
> >> If byte-swapped version of ide_{in,out}put_data() were available by
> >> ide core, they can be used instead. The byte-swapped version of
> >> default_tp_ops would much helps such queer big-endian platforms. Is
> >> it worth to bloat ide core? ;-)
> >>
> >
> > Seems to be a good idea and it may also help some other host drivers
> > (ide-h8300.c?).
> >
>
> I'm not sure we need to carry the extra little used code just to help
> some exotic driver.
It doesn't seem like we would need to carry any extra extra code for host
drivers that don't need it because we have flexible Kconfig language to take
care of such cases, i.e.
...
config CONFIG_IDE_BE_IO
bool
...
config BLK_DEV_IDE_TX4938
tristate "TX4938 internal IDE support"
depends on SOC_TX4938
select IDE_TIMINGS
select IDE_BE_IO
...
Thus having be_tp_ops would decrease code duplication [ I now also see that
m68k host drivers would benefit from it. I haven't noticed it before because
readw()/writew() are redefined in <asm-m68k/ide.h> ] and decrease total IDE
subsystem maintainance costs.
Thanks,
Bart
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 01/15] ide: include <asm/ide.h> only when needed
2009-02-06 16:21 ` Bartlomiej Zolnierkiewicz
@ 2009-02-06 22:03 ` Sergei Shtylyov
2009-02-07 15:35 ` Atsushi Nemoto
0 siblings, 1 reply; 32+ messages in thread
From: Sergei Shtylyov @ 2009-02-06 22:03 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz
Cc: Atsushi Nemoto, geert, linux-ide, linux-kernel, apw
Bartlomiej Zolnierkiewicz wrote:
>>Hello.
>>Bartlomiej Zolnierkiewicz wrote:
>>>>>>>+#include <asm/ide.h>
>>>>>>Did you try checkpatch.pl?
>>>>>Sure.
>>>>>This driver uses stuff from <asm-mips/ide.h>.
>>>>>[ I guess I could put '-mips' there to silence warnings on tx493{8,9}.c,
>>>>> however I don't know of the way to get rid of ide-io-std.c's one... ]
>>>>BTW, tx4939ide_{in,out}put_data_swap and
>>>>tx4939ide_{in,out}put_data_swap do exactly same thing.
>>>>If byte-swapped version of ide_{in,out}put_data() were available by
>>>>ide core, they can be used instead. The byte-swapped version of
>>>>default_tp_ops would much helps such queer big-endian platforms. Is
>>>>it worth to bloat ide core? ;-)
>>>Seems to be a good idea and it may also help some other host drivers
>>>(ide-h8300.c?).
>> I'm not sure we need to carry the extra little used code just to help
>>some exotic driver.
> It doesn't seem like we would need to carry any extra extra code for host
> drivers that don't need it because we have flexible Kconfig language to take
> care of such cases, i.e.
> ...
> config CONFIG_IDE_BE_IO
> bool
If it was that simple... Normally the BE case gets handled automagically
(moreover, there is MIPS option that additionally controls I/O and memory
space byte swapping). The case we have to address for TX493x is actually where
the usual magic fails (or actually the code just doesn't want to use that
option). So this doesn't look like a good name to me...
> Thanks,
> Bart
WBR, Sergei
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 01/15] ide: include <asm/ide.h> only when needed
2009-02-06 22:03 ` Sergei Shtylyov
@ 2009-02-07 15:35 ` Atsushi Nemoto
2009-02-07 23:37 ` Sergei Shtylyov
0 siblings, 1 reply; 32+ messages in thread
From: Atsushi Nemoto @ 2009-02-07 15:35 UTC (permalink / raw)
To: sshtylyov; +Cc: bzolnier, geert, linux-ide, linux-kernel, apw
On Sat, 07 Feb 2009 01:03:59 +0300, Sergei Shtylyov <sshtylyov@ru.mvista.com> wrote:
> > config CONFIG_IDE_BE_IO
> > bool
>
> If it was that simple... Normally the BE case gets handled automagically
> (moreover, there is MIPS option that additionally controls I/O and memory
> space byte swapping). The case we have to address for TX493x is actually where
> the usual magic fails (or actually the code just doesn't want to use that
> option). So this doesn't look like a good name to me...
Well, for TX493x (MIPS), we have CONFIG_SWAP_IO_SPACE for big endian
and it works fine for PCI-IDE host controllers. For SoC internal
controllers, no swapping is needed for both endian, thus custom tp_ops
is needed only for big endian.
So ... IDE_BE_IO looks actually not best name for this case. It is
IDE_RAW_IO or something. But IDE_RAW_IO might not fit for other
cases. IDE_SWAPPED_IO? Any other good name?
---
Atsushi Nemoto
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 01/15] ide: include <asm/ide.h> only when needed
2009-02-07 15:35 ` Atsushi Nemoto
@ 2009-02-07 23:37 ` Sergei Shtylyov
0 siblings, 0 replies; 32+ messages in thread
From: Sergei Shtylyov @ 2009-02-07 23:37 UTC (permalink / raw)
To: Atsushi Nemoto; +Cc: bzolnier, geert, linux-ide, linux-kernel, apw
Hello.
Atsushi Nemoto wrote:
>>> config CONFIG_IDE_BE_IO
>>> bool
>>>
>> If it was that simple... Normally the BE case gets handled automagically
>> (moreover, there is MIPS option that additionally controls I/O and memory
>> space byte swapping). The case we have to address for TX493x is actually where
>> the usual magic fails (or actually the code just doesn't want to use that
>> option). So this doesn't look like a good name to me...
>>
>
> Well, for TX493x (MIPS), we have CONFIG_SWAP_IO_SPACE for big endian
> and it works fine for PCI-IDE host controllers. For SoC internal
> controllers, no swapping is needed for both endian, thus custom tp_ops
> is needed only for big endian.
>
Yeah, SoCs *typically* can handle different endianness for the
integrated devices in a transparent way. TX4939 didn't do that
consistently still, and that's where the MIPS address swizzling macros
could have helped but Atsushi chose to reserve their usage only to the
external bus accesses. I however don't think that TX4938 case should
have been handled the same way as TX4939 since in this case the
controller is *not* SoC integrated device and the IDE registers are
situated on the chip's external bus with their mapping is actually board
specific, if I don't mistake (I don't have the datasheet at hand).
> So ... IDE_BE_IO looks actually not best name for this case. It is
> IDE_RAW_IO or something.
Yes, I was going to suggest exactly that.
> But IDE_RAW_IO might not fit for other cases. IDE_SWAPPED_IO?
I'd prefer IDE_RAW_IO because it can be swapped when using the
standard accessors as well. Frankly speaking, I'm not sure why ide-h8300
needs its own accessors while this arch's io.h has an abundance of
swapping and not swapping accessors already defined...
> Any other good name?
>
I'm still not convinced that it's really worth the trouble...
> ---
> Atsushi Nemoto
>
MBR, Sergei
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 09/15] ide: add "flagged" taskfile flags to struct ide_taskfile
2009-02-06 6:04 ` Stephen Rothwell
@ 2009-02-08 11:38 ` Bartlomiej Zolnierkiewicz
2009-03-04 18:32 ` Sergei Shtylyov
0 siblings, 1 reply; 32+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-02-08 11:38 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: linux-ide, linux-kernel
Hi,
On Friday 06 February 2009, Stephen Rothwell wrote:
> Hi Bart,
>
> On Sun, 01 Feb 2009 18:50:12 +0100 Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> wrote:
> >
> > From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> > Subject: [PATCH] ide: add "flagged" taskfile flags to struct ide_taskfile
> >
> > * Add ->ftf_flags field to struct ide_taskfile
> > and convert flags for TASKFILE ioctl to use it.
> >
> > * Rename "flagged" taskfile flags:
> > - IDE_TFLAG_FLAGGED -> IDE_FTFLAG_FLAGGED
>
> There were several places where this transformation did not take place as
> shown by today's linux-next build.
Thanks, it is now fixed with v2 of the patch, interdiff below:
...
v2:
* Remember to fully update ide-h8300.c, scc_pata.c and tx493{8,9}ide.c
(thanks to Stephen Rothwell for noticing).
There should be no functional changes caused by this patch.
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
...
diff -u b/drivers/ide/ide-h8300.c b/drivers/ide/ide-h8300.c
--- b/drivers/ide/ide-h8300.c
+++ b/drivers/ide/ide-h8300.c
@@ -51,7 +51,7 @@
struct ide_taskfile *tf = &task->tf;
u8 HIHI = (task->tf_flags & IDE_TFLAG_LBA48) ? 0xE0 : 0xEF;
- if (task->tf_flags & IDE_TFLAG_FLAGGED)
+ if (task->ftf_flags & IDE_FTFLAG_FLAGGED)
HIHI = 0xFF;
if (task->ftf_flags & IDE_FTFLAG_OUT_DATA)
diff -u b/drivers/ide/scc_pata.c b/drivers/ide/scc_pata.c
--- b/drivers/ide/scc_pata.c
+++ b/drivers/ide/scc_pata.c
@@ -672,7 +672,7 @@
struct ide_taskfile *tf = &task->tf;
u8 HIHI = (task->tf_flags & IDE_TFLAG_LBA48) ? 0xE0 : 0xEF;
- if (task->tf_flags & IDE_TFLAG_FLAGGED)
+ if (task->ftf_flags & IDE_FTFLAG_FLAGGED)
HIHI = 0xFF;
if (task->ftf_flags & IDE_FTFLAG_OUT_DATA)
diff -u b/drivers/ide/tx4938ide.c b/drivers/ide/tx4938ide.c
--- b/drivers/ide/tx4938ide.c
+++ b/drivers/ide/tx4938ide.c
@@ -89,7 +89,7 @@
struct ide_taskfile *tf = &task->tf;
u8 HIHI = task->tf_flags & IDE_TFLAG_LBA48 ? 0xE0 : 0xEF;
- if (task->tf_flags & IDE_TFLAG_FLAGGED)
+ if (task->ftf_flags & IDE_FTFLAG_FLAGGED)
HIHI = 0xFF;
if (task->ftf_flags & IDE_FTFLAG_OUT_DATA) {
diff -u b/drivers/ide/tx4939ide.c b/drivers/ide/tx4939ide.c
--- b/drivers/ide/tx4939ide.c
+++ b/drivers/ide/tx4939ide.c
@@ -474,7 +474,7 @@
struct ide_taskfile *tf = &task->tf;
u8 HIHI = task->tf_flags & IDE_TFLAG_LBA48 ? 0xE0 : 0xEF;
- if (task->tf_flags & IDE_TFLAG_FLAGGED)
+ if (task->ftf_flags & IDE_FTFLAG_FLAGGED)
HIHI = 0xFF;
if (task->ftf_flags & IDE_FTFLAG_OUT_DATA) {
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 09/15] ide: add "flagged" taskfile flags to struct ide_taskfile
2009-02-08 11:38 ` Bartlomiej Zolnierkiewicz
@ 2009-03-04 18:32 ` Sergei Shtylyov
0 siblings, 0 replies; 32+ messages in thread
From: Sergei Shtylyov @ 2009-03-04 18:32 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz; +Cc: Stephen Rothwell, linux-ide, linux-kernel
Bartlomiej Zolnierkiewicz wrote:
>>>From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
>>>Subject: [PATCH] ide: add "flagged" taskfile flags to struct ide_taskfile
>>>* Add ->ftf_flags field to struct ide_taskfile
>>> and convert flags for TASKFILE ioctl to use it.
>>>* Rename "flagged" taskfile flags:
>>> - IDE_TFLAG_FLAGGED -> IDE_FTFLAG_FLAGGED
>>There were several places where this transformation did not take place as
>>shown by today's linux-next build.
> Thanks, it is now fixed with v2 of the patch, interdiff below:
> ...
> v2:
> * Remember to fully update ide-h8300.c, scc_pata.c and tx493{8,9}ide.c
> (thanks to Stephen Rothwell for noticing).
> There should be no functional changes caused by this patch.
> Cc: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
MBR, Sergei
^ permalink raw reply [flat|nested] 32+ messages in thread
end of thread, other threads:[~2009-03-04 18:32 UTC | newest]
Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-01 17:49 [PATCH 00/15] weekly IDE updates Bartlomiej Zolnierkiewicz
2009-02-01 17:49 ` [PATCH 01/15] ide: include <asm/ide.h> only when needed Bartlomiej Zolnierkiewicz
2009-02-02 7:49 ` Geert Uytterhoeven
2009-02-02 18:27 ` Bartlomiej Zolnierkiewicz
2009-02-04 14:20 ` Atsushi Nemoto
2009-02-05 21:14 ` Bartlomiej Zolnierkiewicz
2009-02-05 23:58 ` Sergei Shtylyov
2009-02-06 16:21 ` Bartlomiej Zolnierkiewicz
2009-02-06 22:03 ` Sergei Shtylyov
2009-02-07 15:35 ` Atsushi Nemoto
2009-02-07 23:37 ` Sergei Shtylyov
2009-02-02 18:53 ` Jaswinder Singh Rajput
2009-02-01 17:49 ` [PATCH 02/15] scc_pata: remove DECLARE_SCC_DEV() macro Bartlomiej Zolnierkiewicz
2009-02-01 18:49 ` Sergei Shtylyov
2009-02-02 16:45 ` Daniel K.
2009-02-02 18:26 ` Bartlomiej Zolnierkiewicz
2009-02-01 17:49 ` [PATCH 03/15] ide: fix memleak on failure in probe_for_drive() Bartlomiej Zolnierkiewicz
2009-02-01 17:49 ` [PATCH 04/15] ide: fix error message in pre_task_out_intr() Bartlomiej Zolnierkiewicz
2009-02-01 17:49 ` [PATCH 05/15] ide: allow host drivers to specify IRQ flags Bartlomiej Zolnierkiewicz
2009-02-01 17:49 ` [PATCH 06/15] ide: remove now superfluous check from ide_host_register() Bartlomiej Zolnierkiewicz
2009-02-01 17:49 ` [PATCH 07/15] ide: add IDE_HFLAG_DTC2278 host flag Bartlomiej Zolnierkiewicz
2009-02-01 17:50 ` [PATCH 08/15] ide: add IDE_HFLAG_4DRIVES " Bartlomiej Zolnierkiewicz
2009-02-01 17:50 ` [PATCH 09/15] ide: add "flagged" taskfile flags to struct ide_taskfile Bartlomiej Zolnierkiewicz
2009-02-06 6:04 ` Stephen Rothwell
2009-02-08 11:38 ` Bartlomiej Zolnierkiewicz
2009-03-04 18:32 ` Sergei Shtylyov
2009-02-01 17:50 ` [PATCH 10/15] ide: complete power step in ide_complete_pm_request() Bartlomiej Zolnierkiewicz
2009-02-01 17:50 ` [PATCH 11/15] ide: factor out completion of taskfile from ide_end_drive_cmd() Bartlomiej Zolnierkiewicz
2009-02-01 17:50 ` [PATCH 12/15] ide: move request type specific code from ide_end_drive_cmd() to callers Bartlomiej Zolnierkiewicz
2009-02-01 17:50 ` [PATCH 13/15] ide: no need to read Status and Error registers for "empty" taskfile requests Bartlomiej Zolnierkiewicz
2009-02-01 17:50 ` [PATCH 14/15] ide: remove ->data_phase field from ide_hwif_t Bartlomiej Zolnierkiewicz
2009-02-01 17:50 ` [PATCH 15/15] ide: move smart_enable() call out from get_smart_data() Bartlomiej Zolnierkiewicz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).