linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 13/15] ide: remove hwif->intrproc
@ 2007-10-30 23:55 Bartlomiej Zolnierkiewicz
  2007-10-31 21:15 ` Sergei Shtylyov
  0 siblings, 1 reply; 6+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2007-10-30 23:55 UTC (permalink / raw)
  To: linux-ide; +Cc: Sergei Shtylyov


Given that:

* hpt366.c::hpt3xx_intrproc() is the only user of hwif->intrproc

* hpt366.c::hpt3xx_quirkproc() sets drive->quirk_list to 1 for quirky drives
  which is a value unique to hpt366 host driver

we can remove hwif->intproc and just check for drive->quirk_list == 1
in ide_do_request().

Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
Handling of quirky drives (problems with nIEN) by hpt366 and pdc202xx_*
looks suspicious...  are the problems really dependent on the host type
(thus hwif->quirkproc and ->quirk_list == 1/2)?  Shouldn't we just handle
quirky drives in the same way in the core IDE code regardless of the host
driver being used (of course using hwif->maskproc where needed)?

 drivers/ide/ide-io.c      |    9 +++++----
 drivers/ide/pci/hpt366.c  |   10 ----------
 drivers/ide/pci/sgiioc4.c |    1 -
 include/linux/ide.h       |    2 --
 4 files changed, 5 insertions(+), 17 deletions(-)

Index: b/drivers/ide/ide-io.c
===================================================================
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -1198,10 +1198,11 @@ static void ide_do_request (ide_hwgroup_
 		if (hwgroup->hwif->sharing_irq &&
 		    hwif != hwgroup->hwif &&
 		    hwif->io_ports[IDE_CONTROL_OFFSET]) {
-			/* set nIEN for previous hwif */
-			if (hwif->intrproc)
-				hwif->intrproc(drive);
-			else
+			/*
+			 * set nIEN for previous hwif, drives in the
+			 * quirk_list may not like intr setups/cleanups
+			 */
+			if (drive->quirk_list != 1)
 				hwif->OUTB(drive->ctl | 2, IDE_CONTROL_REG);
 		}
 		hwgroup->hwif = hwif;
Index: b/drivers/ide/pci/hpt366.c
===================================================================
--- a/drivers/ide/pci/hpt366.c
+++ b/drivers/ide/pci/hpt366.c
@@ -687,15 +687,6 @@ static int hpt3xx_quirkproc(ide_drive_t 
 	return 0;
 }
 
-static void hpt3xx_intrproc(ide_drive_t *drive)
-{
-	if (drive->quirk_list)
-		return;
-
-	/* drives in the quirk_list may not like intr setups/cleanups */
-	outb(drive->ctl | 2, IDE_CONTROL_REG);
-}
-
 static void hpt3xx_maskproc(ide_drive_t *drive, int mask)
 {
 	ide_hwif_t *hwif	= HWIF(drive);
@@ -1253,7 +1244,6 @@ static void __devinit init_hwif_hpt366(i
 	hwif->set_pio_mode	= &hpt3xx_set_pio_mode;
 	hwif->set_dma_mode	= &hpt3xx_set_mode;
 	hwif->quirkproc		= &hpt3xx_quirkproc;
-	hwif->intrproc		= &hpt3xx_intrproc;
 	hwif->maskproc		= &hpt3xx_maskproc;
 	hwif->busproc		= &hpt3xx_busproc;
 
Index: b/drivers/ide/pci/sgiioc4.c
===================================================================
--- a/drivers/ide/pci/sgiioc4.c
+++ b/drivers/ide/pci/sgiioc4.c
@@ -582,7 +582,6 @@ ide_init_sgiioc4(ide_hwif_t * hwif)
 	hwif->pre_reset = NULL;	/* No HBA specific pre_set needed */
 	hwif->resetproc = &sgiioc4_resetproc;/* Reset DMA engine,
 						clear interrupts */
-	hwif->intrproc = NULL;	/* Enable or Disable interrupt from drive */
 	hwif->maskproc = &sgiioc4_maskproc;	/* Mask on/off NIEN register */
 	hwif->quirkproc = NULL;
 	hwif->busproc = NULL;
Index: b/include/linux/ide.h
===================================================================
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -524,8 +524,6 @@ typedef struct hwif_s {
 	void	(*pre_reset)(ide_drive_t *);
 	/* routine to reset controller after a disk reset */
 	void	(*resetproc)(ide_drive_t *);
-	/* special interrupt handling for shared pci interrupts */
-	void	(*intrproc)(ide_drive_t *);
 	/* special host masking for drive selection */
 	void	(*maskproc)(ide_drive_t *, int);
 	/* check host's drive quirk list */

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

* Re: [PATCH 13/15] ide: remove hwif->intrproc
  2007-10-30 23:55 [PATCH 13/15] ide: remove hwif->intrproc Bartlomiej Zolnierkiewicz
@ 2007-10-31 21:15 ` Sergei Shtylyov
  2007-11-08  0:51   ` Mark Lord
  0 siblings, 1 reply; 6+ messages in thread
From: Sergei Shtylyov @ 2007-10-31 21:15 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: linux-ide

Hello.

Bartlomiej Zolnierkiewicz wrote:

> Given that:

> * hpt366.c::hpt3xx_intrproc() is the only user of hwif->intrproc

> * hpt366.c::hpt3xx_quirkproc() sets drive->quirk_list to 1 for quirky drives
>   which is a value unique to hpt366 host driver

> we can remove hwif->intproc and just check for drive->quirk_list == 1
> in ide_do_request().

> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

> ---
> Handling of quirky drives (problems with nIEN) by hpt366 and pdc202xx_*
> looks suspicious...  are the problems really dependent on the host type
> (thus hwif->quirkproc and ->quirk_list == 1/2)?  Shouldn't we just handle
> quirky drives in the same way in the core IDE code regardless of the host
> driver being used (of course using hwif->maskproc where needed)?

    Indeed...

MBR, Sergei

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

* Re: [PATCH 13/15] ide: remove hwif->intrproc
  2007-10-31 21:15 ` Sergei Shtylyov
@ 2007-11-08  0:51   ` Mark Lord
  2007-11-08  2:43     ` Tejun Heo
  0 siblings, 1 reply; 6+ messages in thread
From: Mark Lord @ 2007-11-08  0:51 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: Bartlomiej Zolnierkiewicz, linux-ide, Alan Cox, Tejun Heo,
	Albert Lee

> Bartlomiej Zolnierkiewicz wrote:
> 
>> * hpt366.c::hpt3xx_intrproc() is the only user of hwif->intrproc
..

Speaking of which..

I believe I have a small PCI card here with an HPT366 chip on it.
Does anyone there want it before I throw it away?

-ml

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

* Re: [PATCH 13/15] ide: remove hwif->intrproc
  2007-11-08  0:51   ` Mark Lord
@ 2007-11-08  2:43     ` Tejun Heo
  2007-11-08 10:39       ` Alan Cox
  0 siblings, 1 reply; 6+ messages in thread
From: Tejun Heo @ 2007-11-08  2:43 UTC (permalink / raw)
  To: Mark Lord
  Cc: Sergei Shtylyov, Bartlomiej Zolnierkiewicz, linux-ide, Alan Cox,
	Albert Lee

Mark Lord wrote:
>> Bartlomiej Zolnierkiewicz wrote:
>>
>>> * hpt366.c::hpt3xx_intrproc() is the only user of hwif->intrproc
> ..
> 
> Speaking of which..
> 
> I believe I have a small PCI card here with an HPT366 chip on it.
> Does anyone there want it before I throw it away?

I already have a 372.  It should be almost the same, right?

-- 
tejun

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

* Re: [PATCH 13/15] ide: remove hwif->intrproc
  2007-11-08  2:43     ` Tejun Heo
@ 2007-11-08 10:39       ` Alan Cox
  2007-11-08 11:08         ` Tejun Heo
  0 siblings, 1 reply; 6+ messages in thread
From: Alan Cox @ 2007-11-08 10:39 UTC (permalink / raw)
  To: Tejun Heo
  Cc: Mark Lord, Sergei Shtylyov, Bartlomiej Zolnierkiewicz, linux-ide,
	Alan Cox, Albert Lee

On Thu, Nov 08, 2007 at 11:43:45AM +0900, Tejun Heo wrote:
> > I believe I have a small PCI card here with an HPT366 chip on it.
> > Does anyone there want it before I throw it away?
> 
> I already have a 372.  It should be almost the same, right?

They are not very similar no. HPT37x is a progression from the 366
but quite different


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

* Re: [PATCH 13/15] ide: remove hwif->intrproc
  2007-11-08 10:39       ` Alan Cox
@ 2007-11-08 11:08         ` Tejun Heo
  0 siblings, 0 replies; 6+ messages in thread
From: Tejun Heo @ 2007-11-08 11:08 UTC (permalink / raw)
  To: Alan Cox
  Cc: Mark Lord, Sergei Shtylyov, Bartlomiej Zolnierkiewicz, linux-ide,
	Albert Lee

Alan Cox wrote:
> On Thu, Nov 08, 2007 at 11:43:45AM +0900, Tejun Heo wrote:
>>> I believe I have a small PCI card here with an HPT366 chip on it.
>>> Does anyone there want it before I throw it away?
>> I already have a 372.  It should be almost the same, right?
> 
> They are not very similar no. HPT37x is a progression from the 366
> but quite different

Alright, then, if no one else wants it, please send it to me.  I can pay
for the shipping via paypal. :-)

-- 
tejun

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

end of thread, other threads:[~2007-11-08 11:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-30 23:55 [PATCH 13/15] ide: remove hwif->intrproc Bartlomiej Zolnierkiewicz
2007-10-31 21:15 ` Sergei Shtylyov
2007-11-08  0:51   ` Mark Lord
2007-11-08  2:43     ` Tejun Heo
2007-11-08 10:39       ` Alan Cox
2007-11-08 11:08         ` Tejun Heo

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).