linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: linux-ide@vger.kernel.org
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 07/22] ide: add IDE_HFLAG_NO_{IO32_BIT,UNMASK_IRQS} host flags
Date: Thu, 17 Jan 2008 00:26:55 +0100	[thread overview]
Message-ID: <20080116232655.9166.55635.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20080116232556.9166.13457.sendpatchset@localhost.localdomain>

* Use the same bit for IDE_HFLAG_CS5520 and IDE_HFLAG_VDMA host flags
  (both are used only by cs5520 host driver currently).

* Add IDE_HFLAG_NO_IO32_BIT host flag and use it instead of ->no_io_32bit
  ide_hwif_t field.

* Add IDE_HFLAG_NO_UNMASK_IRQS host flag, then convert dtc2278 and rz1000
  host drivers to use it.

There should be no functionality changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
 drivers/ide/ide-probe.c       |    4 +++-
 drivers/ide/legacy/dtc2278.c  |   10 +++-------
 drivers/ide/mips/au1xxx-ide.c |    3 +--
 drivers/ide/pci/rz1000.c      |    3 +--
 include/linux/ide.h           |   13 ++++++++-----
 5 files changed, 16 insertions(+), 17 deletions(-)

Index: b/drivers/ide/ide-probe.c
===================================================================
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -822,7 +822,7 @@ static void ide_port_tune_devices(ide_hw
 	for (unit = 0; unit < MAX_DRIVES; ++unit) {
 		ide_drive_t *drive = &hwif->drives[unit];
 
-		if (hwif->no_io_32bit)
+		if (hwif->host_flags & IDE_HFLAG_NO_IO_32BIT)
 			drive->no_io_32bit = 1;
 		else
 			drive->no_io_32bit = drive->id->dword_io ? 1 : 0;
@@ -1300,6 +1300,8 @@ static void ide_port_init_devices(ide_hw
 			drive->io_32bit = 1;
 		if (hwif->host_flags & IDE_HFLAG_UNMASK_IRQS)
 			drive->unmask = 1;
+		if (hwif->host_flags & IDE_HFLAG_NO_UNMASK_IRQS)
+			drive->no_unmask = 1;
 		if ((hwif->host_flags & IDE_HFLAG_NO_AUTOTUNE) == 0)
 			drive->autotune = 1;
 	}
Index: b/drivers/ide/legacy/dtc2278.c
===================================================================
--- a/drivers/ide/legacy/dtc2278.c
+++ b/drivers/ide/legacy/dtc2278.c
@@ -89,7 +89,10 @@ static void dtc2278_set_pio_mode(ide_dri
 static const struct ide_port_info dtc2278_port_info __initdata = {
 	.chipset		= ide_dtc2278,
 	.host_flags		= IDE_HFLAG_SERIALIZE |
+				  IDE_HFLAG_NO_UNMASK_IRQS |
 				  IDE_HFLAG_IO_32BIT |
+				  /* disallow ->io_32bit changes */
+				  IDE_HFLAG_NO_IO_32BIT |
 				  IDE_HFLAG_NO_DMA |
 				  IDE_HFLAG_NO_AUTOTUNE,
 	.pio_mask		= ATA_PIO4,
@@ -125,14 +128,7 @@ static int __init dtc2278_probe(void)
 #endif
 	local_irq_restore(flags);
 
-	hwif->no_io_32bit = 1;	/* disallow ->io_32bit changes */
 	hwif->set_pio_mode = &dtc2278_set_pio_mode;
-	hwif->drives[0].no_unmask = 1;
-	hwif->drives[1].no_unmask = 1;
-
-	mate->no_io_32bit = 1;
-	mate->drives[0].no_unmask = 1;
-	mate->drives[1].no_unmask = 1;
 
 	ide_device_add(idx, &dtc2278_port_info);
 
Index: b/drivers/ide/mips/au1xxx-ide.c
===================================================================
--- a/drivers/ide/mips/au1xxx-ide.c
+++ b/drivers/ide/mips/au1xxx-ide.c
@@ -551,6 +551,7 @@ static void auide_setup_ports(hw_regs_t 
 static const struct ide_port_info au1xxx_port_info = {
 	.host_flags		= IDE_HFLAG_POST_SET_MODE |
 				  IDE_HFLAG_NO_DMA | /* no SFF-style DMA */
+				  IDE_HFLAG_NO_IO_32BIT |
 				  IDE_HFLAG_UNMASK_IRQS,
 	.pio_mask		= ATA_PIO4,
 #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
@@ -649,8 +650,6 @@ static int au_ide_probe(struct device *d
 	hwif->select_data               = 0;    /* no chipset-specific code */
 	hwif->config_data               = 0;    /* no chipset-specific code */
 
-	hwif->no_io_32bit		= 1;
-
 	auide_hwif.hwif                 = hwif;
 	hwif->hwif_data                 = &auide_hwif;
 
Index: b/drivers/ide/pci/rz1000.c
===================================================================
--- a/drivers/ide/pci/rz1000.c
+++ b/drivers/ide/pci/rz1000.c
@@ -33,8 +33,7 @@ static void __devinit init_hwif_rz1000 (
 	} else {
 		if (hwif->mate)
 			hwif->mate->serialized = hwif->serialized = 1;
-		hwif->drives[0].no_unmask = 1;
-		hwif->drives[1].no_unmask = 1;
+		hwif->host_flags |= IDE_HFLAG_NO_UNMASK_IRQS;
 		printk(KERN_INFO "%s: serialized, disabled unmasking "
 			"(buggy RZ1000/RZ1001)\n", hwif->name);
 	}
Index: b/include/linux/ide.h
===================================================================
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -607,7 +607,6 @@ typedef struct hwif_s {
 	unsigned	reset      : 1;	/* reset after probe */
 	unsigned	auto_poll  : 1; /* supports nop auto-poll */
 	unsigned	sg_mapped  : 1;	/* sg_table and sg_nents are ready */
-	unsigned	no_io_32bit : 1; /* 1 = can not do 32-bit IO ops */
 	unsigned	mmio       : 1; /* host uses MMIO */
 
 	struct device	gendev;
@@ -1068,7 +1067,7 @@ enum {
 	IDE_HFLAG_NO_SET_MODE		= (1 << 9),
 	/* trust BIOS for programming chipset/device for DMA */
 	IDE_HFLAG_TRUST_BIOS_FOR_DMA	= (1 << 10),
-	/* host uses VDMA */
+	/* host uses VDMA (tied with IDE_HFLAG_CS5520 for now) */
 	IDE_HFLAG_VDMA			= (1 << 11),
 	/* ATAPI DMA is unsupported */
 	IDE_HFLAG_NO_ATAPI_DMA		= (1 << 12),
@@ -1078,8 +1077,10 @@ enum {
 	IDE_HFLAG_NO_DMA		= (1 << 14),
 	/* check if host is PCI IDE device before allowing DMA */
 	IDE_HFLAG_NO_AUTODMA		= (1 << 15),
+	/* don't autotune PIO */
+	IDE_HFLAG_NO_AUTOTUNE		= (1 << 16),
 	/* host is CS5510/CS5520 */
-	IDE_HFLAG_CS5520		= (1 << 16),
+	IDE_HFLAG_CS5520		= IDE_HFLAG_VDMA,
 	/* no LBA48 */
 	IDE_HFLAG_NO_LBA48		= (1 << 17),
 	/* no LBA48 DMA */
@@ -1105,8 +1106,10 @@ enum {
 	IDE_HFLAG_CLEAR_SIMPLEX		= (1 << 28),
 	/* DSC overlap is unsupported */
 	IDE_HFLAG_NO_DSC		= (1 << 29),
-	/* don't autotune PIO */
-	IDE_HFLAG_NO_AUTOTUNE		= (1 << 30),
+	/* never use 32-bit I/O ops */
+	IDE_HFLAG_NO_IO_32BIT		= (1 << 30),
+	/* never unmask IRQs */
+	IDE_HFLAG_NO_UNMASK_IRQS	= (1 << 31),
 };
 
 #ifdef CONFIG_BLK_DEV_OFFBOARD

  parent reply	other threads:[~2008-01-16 23:14 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-16 23:25 [PATCH 00/22] ide: even more IDE probing code rework Bartlomiej Zolnierkiewicz
2008-01-16 23:26 ` [PATCH 01/22] ide: remove redundant hwif->present check from ide_register_hw() Bartlomiej Zolnierkiewicz
2008-01-16 23:26 ` [PATCH 02/22] ide: remove redundant init_hwif_default() call " Bartlomiej Zolnierkiewicz
2008-01-16 23:26 ` [PATCH 03/22] ide: add 'init_default' and 'restore' arguments to ide_unregister() Bartlomiej Zolnierkiewicz
2008-01-16 23:26 ` [PATCH 04/22] ide: add ide_deprecated_find_port() helper Bartlomiej Zolnierkiewicz
2008-05-21 14:29   ` Sergei Shtylyov
2008-05-27 18:36     ` Bartlomiej Zolnierkiewicz
2008-01-16 23:26 ` [PATCH 05/22] ide: fix ide_unregister() usage in host drivers Bartlomiej Zolnierkiewicz
2008-01-16 23:26 ` [PATCH 06/22] ide: factor out code initializing devices from ide_init_port() Bartlomiej Zolnierkiewicz
2008-01-16 23:26 ` Bartlomiej Zolnierkiewicz [this message]
2008-01-16 23:27 ` [PATCH 08/22] ide: add ->init_port_devs method to ide_hwif_t Bartlomiej Zolnierkiewicz
2008-01-16 23:27 ` [PATCH 09/22] ide: remove incorrect init_gendisk() comment Bartlomiej Zolnierkiewicz
2008-01-16 23:27 ` [PATCH 10/22] ide: skip not present devices in init_gendisk() Bartlomiej Zolnierkiewicz
2008-01-16 23:27 ` [PATCH 11/22] ide: move blk_register_region() call out from init_gendisk() Bartlomiej Zolnierkiewicz
2008-01-16 23:27 ` [PATCH 12/22] ide: call init_gendisk() after ide_acpi_init() Bartlomiej Zolnierkiewicz
2008-01-16 23:27 ` [PATCH 13/22] ide: merge init_gendisk() into hwif_register_devices() Bartlomiej Zolnierkiewicz
2008-01-16 23:27 ` [PATCH 14/22] ide: move hwif->rqsize init from ide_init_queue() to init_irq() Bartlomiej Zolnierkiewicz
2008-01-16 23:27 ` [PATCH 15/22] ide: factor out adding drive to hwgroup from init_irq() Bartlomiej Zolnierkiewicz
2008-01-16 23:27 ` [PATCH 16/22] ide: factor out devices setup " Bartlomiej Zolnierkiewicz
2008-01-16 23:28 ` [PATCH 17/22] ide: move ide_acpi_init() call to ide_device_add_all() Bartlomiej Zolnierkiewicz
2008-01-16 23:28 ` [PATCH 18/22] ide-acpi: remove needless exports Bartlomiej Zolnierkiewicz
2008-01-16 23:28 ` [PATCH 19/22] ide-acpi: remove dead code from do_drive_get_GTF() Bartlomiej Zolnierkiewicz
2008-01-16 23:28 ` [PATCH 20/22] ide: factor out devices setup from ide_acpi_init() Bartlomiej Zolnierkiewicz
2008-01-16 23:28 ` [PATCH 21/22] ide: move hwif->present check out from ide_proc_register_port() Bartlomiej Zolnierkiewicz
2008-01-16 23:28 ` [PATCH 22/22] ide: move create_proc_ide_drives() call to ide_device_add_all() Bartlomiej Zolnierkiewicz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080116232655.9166.55635.sendpatchset@localhost.localdomain \
    --to=bzolnier@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).