linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ide: Allow IDE interface to specify its not capable of 32-bit operations
@ 2006-02-14 16:22 Kumar Gala
  2006-02-14 16:50 ` Alan Cox
  0 siblings, 1 reply; 5+ messages in thread
From: Kumar Gala @ 2006-02-14 16:22 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz, Andrew Morton; +Cc: linux-ide, linux-kernel

In some embedded systems the IDE hardware interface may only support 16-bit
or smaller accesses.  Allow the interface to specify if this is the case
and don't allow the drive or user to override the setting.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Acked-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

---
commit 1680d879c98c1680df6f331b486c1985103f379a
tree 4931bdac07f175bd3a6d417d37ccf1297b25ea02
parent 0a585bec4ddbef76ed4036388085c694ddd34494
author Kumar Gala <galak@kernel.crashing.org> Tue, 14 Feb 2006 10:29:58 -0600
committer Kumar Gala <galak@kernel.crashing.org> Tue, 14 Feb 2006 10:29:58 -0600

 drivers/ide/ide-disk.c  |    2 --
 drivers/ide/ide-probe.c |    9 +++++++++
 include/linux/ide.h     |    1 +
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index 09086b8..359f659 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -977,8 +977,6 @@ static void idedisk_setup (ide_drive_t *
 		ide_dma_verbose(drive);
 	printk("\n");
 
-	drive->no_io_32bit = id->dword_io ? 1 : 0;
-
 	/* write cache enabled? */
 	if ((id->csfo & 1) || (id->cfs_enable_1 & (1 << 5)))
 		drive->wcache = 1;
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 427d1c2..1b7b4c5 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -858,6 +858,15 @@ static void probe_hwif(ide_hwif_t *hwif)
 			}
 		}
 	}
+
+	for (unit = 0; unit < MAX_DRIVES; ++unit) {
+		ide_drive_t *drive = &hwif->drives[unit];
+
+		if (hwif->no_io_32bit)
+			drive->no_io_32bit = 1;
+		else
+			drive->no_io_32bit = drive->id->dword_io ? 1 : 0;
+	}
 }
 
 static int hwif_init(ide_hwif_t *hwif);
diff --git a/include/linux/ide.h b/include/linux/ide.h
index a7fc4cc..8d2db41 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -792,6 +792,7 @@ typedef struct hwif_s {
 	unsigned	no_dsc     : 1;	/* 0 default, 1 dsc_overlap disabled */
 	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 */
 
 	struct device	gendev;
 	struct completion gendev_rel_comp; /* To deal with device release() */


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] ide: Allow IDE interface to specify its not capable of 32-bit operations
  2006-02-14 16:22 [PATCH] ide: Allow IDE interface to specify its not capable of 32-bit operations Kumar Gala
@ 2006-02-14 16:50 ` Alan Cox
  2006-02-14 17:00   ` Bartlomiej Zolnierkiewicz
  0 siblings, 1 reply; 5+ messages in thread
From: Alan Cox @ 2006-02-14 16:50 UTC (permalink / raw)
  To: Kumar Gala
  Cc: Bartlomiej Zolnierkiewicz, Andrew Morton, linux-ide, linux-kernel

On Maw, 2006-02-14 at 10:22 -0600, Kumar Gala wrote:
> In some embedded systems the IDE hardware interface may only support 16-bit
> or smaller accesses.  Allow the interface to specify if this is the case
> and don't allow the drive or user to override the setting.

The "no_io_32bit" is just a dead leftover. It has no effect at all
anyway so this patch is a bit pointless.



Do a grep over the code for no_io_32bit and you will see its essentially
a private variable in the CMD640 driver.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ide: Allow IDE interface to specify its not capable of 32-bit operations
  2006-02-14 16:50 ` Alan Cox
@ 2006-02-14 17:00   ` Bartlomiej Zolnierkiewicz
  2006-02-14 17:53     ` Alan Cox
  0 siblings, 1 reply; 5+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2006-02-14 17:00 UTC (permalink / raw)
  To: Alan Cox; +Cc: Kumar Gala, Andrew Morton, linux-ide, linux-kernel

On 2/14/06, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> On Maw, 2006-02-14 at 10:22 -0600, Kumar Gala wrote:
> > In some embedded systems the IDE hardware interface may only support 16-bit
> > or smaller accesses.  Allow the interface to specify if this is the case
> > and don't allow the drive or user to override the setting.
>
> The "no_io_32bit" is just a dead leftover. It has no effect at all
> anyway so this patch is a bit pointless.
>
> Do a grep over the code for no_io_32bit and you will see its essentially
> a private variable in the CMD640 driver.

Please grep ide.c for "no_io_32bit".  Thank you.

Bartlomiej

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ide: Allow IDE interface to specify its not capable of 32-bit operations
  2006-02-14 17:00   ` Bartlomiej Zolnierkiewicz
@ 2006-02-14 17:53     ` Alan Cox
  2006-02-14 18:59       ` Bartlomiej Zolnierkiewicz
  0 siblings, 1 reply; 5+ messages in thread
From: Alan Cox @ 2006-02-14 17:53 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz
  Cc: Kumar Gala, Andrew Morton, linux-ide, linux-kernel

On Maw, 2006-02-14 at 18:00 +0100, Bartlomiej Zolnierkiewicz wrote:
> > Do a grep over the code for no_io_32bit and you will see its essentially
> > a private variable in the CMD640 driver.
> 
> Please grep ide.c for "no_io_32bit".  Thank you.

Ok I take it back its merely broken and pointless code rather than do
nothing.

Alan


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ide: Allow IDE interface to specify its not capable of 32-bit operations
  2006-02-14 17:53     ` Alan Cox
@ 2006-02-14 18:59       ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 5+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2006-02-14 18:59 UTC (permalink / raw)
  To: Alan Cox; +Cc: Kumar Gala, Andrew Morton, linux-ide, linux-kernel

On 2/14/06, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> On Maw, 2006-02-14 at 18:00 +0100, Bartlomiej Zolnierkiewicz wrote:
> > > Do a grep over the code for no_io_32bit and you will see its essentially
> > > a private variable in the CMD640 driver.
> >
> > Please grep ide.c for "no_io_32bit".  Thank you.
>
> Ok I take it back its merely broken and pointless code rather than do
> nothing.

You are welcomed to fix what you think is broken/pointless.

OTOH Kumar's patch is perfectly fine.

Thank you,
Bartlomiej

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-02-14 18:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-14 16:22 [PATCH] ide: Allow IDE interface to specify its not capable of 32-bit operations Kumar Gala
2006-02-14 16:50 ` Alan Cox
2006-02-14 17:00   ` Bartlomiej Zolnierkiewicz
2006-02-14 17:53     ` Alan Cox
2006-02-14 18:59       ` 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).