Re: [PATCH 2.6.11-rc2 12/29] ide: add ide_hwgroup_t.polling

2005-02-03 Thread Bartlomiej Zolnierkiewicz
On Wed, 2 Feb 2005 11:55:38 +0900, Tejun Heo <[EMAIL PROTECTED]> wrote:
> > 12_ide_hwgroup_t_polling.patch
> >
> >   ide_hwgroup_t.polling field added.  0 in poll_timeout field
> >   used to indicate inactive polling but because 0 is a valid
> >   jiffy value, though slim, there's a chance that something
> >   weird can happen.
> 
> Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>

applied
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.11-rc2 12/29] ide: add ide_hwgroup_t.polling

2005-02-03 Thread Bartlomiej Zolnierkiewicz
On Wed, 2 Feb 2005 11:55:38 +0900, Tejun Heo [EMAIL PROTECTED] wrote:
  12_ide_hwgroup_t_polling.patch
 
ide_hwgroup_t.polling field added.  0 in poll_timeout field
used to indicate inactive polling but because 0 is a valid
jiffy value, though slim, there's a chance that something
weird can happen.
 
 Signed-off-by: Tejun Heo [EMAIL PROTECTED]

applied
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.11-rc2 12/29] ide: add ide_hwgroup_t.polling

2005-02-02 Thread Bartlomiej Zolnierkiewicz
On Wed, 2 Feb 2005 11:55:38 +0900, Tejun Heo <[EMAIL PROTECTED]> wrote:
> > 12_ide_hwgroup_t_polling.patch
> >
> >   ide_hwgroup_t.polling field added.  0 in poll_timeout field
> >   used to indicate inactive polling but because 0 is a valid
> >   jiffy value, though slim, there's a chance that something
> >   weird can happen.

Is there really a possibility of something weird?

I'm not claiming that I like this way of coding but poll_timeout
is assigned either to '0' or to 'jiffies + WAIT_WORSTCASE'.

Bartlomiej
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.11-rc2 12/29] ide: add ide_hwgroup_t.polling

2005-02-02 Thread Bartlomiej Zolnierkiewicz
On Wed, 2 Feb 2005 11:55:38 +0900, Tejun Heo [EMAIL PROTECTED] wrote:
  12_ide_hwgroup_t_polling.patch
 
ide_hwgroup_t.polling field added.  0 in poll_timeout field
used to indicate inactive polling but because 0 is a valid
jiffy value, though slim, there's a chance that something
weird can happen.

Is there really a possibility of something weird?

I'm not claiming that I like this way of coding but poll_timeout
is assigned either to '0' or to 'jiffies + WAIT_WORSTCASE'.

Bartlomiej
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.11-rc2 12/29] ide: add ide_hwgroup_t.polling

2005-02-01 Thread Tejun Heo
> 12_ide_hwgroup_t_polling.patch
> 
>   ide_hwgroup_t.polling field added.  0 in poll_timeout field
>   used to indicate inactive polling but because 0 is a valid
>   jiffy value, though slim, there's a chance that something
>   weird can happen.


Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>


Index: linux-ide-export/drivers/ide/ide-io.c
===
--- linux-ide-export.orig/drivers/ide/ide-io.c  2005-02-02 10:28:04.260354336 
+0900
+++ linux-ide-export/drivers/ide/ide-io.c   2005-02-02 10:28:04.465321080 
+0900
@@ -1314,7 +1314,7 @@ void ide_timer_expiry (unsigned long dat
/* local CPU only,
 * as if we were handling an interrupt */
local_irq_disable();
-   if (hwgroup->poll_timeout != 0) {
+   if (hwgroup->polling) {
startstop = handler(drive);
} else if (drive_is_ready(drive)) {
if (drive->waiting_for_dma)
@@ -1442,8 +1442,7 @@ irqreturn_t ide_intr (int irq, void *dev
return IRQ_NONE;
}
 
-   if ((handler = hwgroup->handler) == NULL ||
-   hwgroup->poll_timeout != 0) {
+   if ((handler = hwgroup->handler) == NULL || hwgroup->polling) {
/*
 * Not expecting an interrupt from this drive.
 * That means this could be:
Index: linux-ide-export/drivers/ide/ide-iops.c
===
--- linux-ide-export.orig/drivers/ide/ide-iops.c2005-02-02 
10:27:15.612247109 +0900
+++ linux-ide-export/drivers/ide/ide-iops.c 2005-02-02 10:28:04.466320918 
+0900
@@ -1028,14 +1028,14 @@ static ide_startstop_t atapi_reset_pollf
return ide_started;
}
/* end of polling */
-   hwgroup->poll_timeout = 0;
+   hwgroup->polling = 0;
printk("%s: ATAPI reset timed-out, status=0x%02x\n",
drive->name, stat);
/* do it the old fashioned way */
return do_reset1(drive, 1);
}
/* done polling */
-   hwgroup->poll_timeout = 0;
+   hwgroup->polling = 0;
return ide_stopped;
 }
 
@@ -1095,7 +1095,7 @@ static ide_startstop_t reset_pollfunc (i
printk("\n");
}
}
-   hwgroup->poll_timeout = 0;  /* done polling */
+   hwgroup->polling = 0;   /* done polling */
return ide_stopped;
 }
 
@@ -1170,6 +1170,7 @@ static ide_startstop_t do_reset1 (ide_dr
udelay (20);
hwif->OUTB(WIN_SRST, IDE_COMMAND_REG);
hwgroup->poll_timeout = jiffies + WAIT_WORSTCASE;
+   hwgroup->polling = 1;
__ide_set_handler(drive, _reset_pollfunc, HZ/20, NULL);
spin_unlock_irqrestore(_lock, flags);
return ide_started;
@@ -1210,6 +1211,7 @@ static ide_startstop_t do_reset1 (ide_dr
/* more than enough time */
udelay(10);
hwgroup->poll_timeout = jiffies + WAIT_WORSTCASE;
+   hwgroup->polling = 1;
__ide_set_handler(drive, _pollfunc, HZ/20, NULL);
 
/*
Index: linux-ide-export/drivers/ide/pci/siimage.c
===
--- linux-ide-export.orig/drivers/ide/pci/siimage.c 2005-02-02 
10:27:15.612247109 +0900
+++ linux-ide-export/drivers/ide/pci/siimage.c  2005-02-02 10:28:04.466320918 
+0900
@@ -590,7 +590,7 @@ static int siimage_reset_poll (ide_drive
if ((hwif->INL(SATA_STATUS_REG) & 0x03) != 0x03) {
printk(KERN_WARNING "%s: reset phy dead, 
status=0x%08x\n",
hwif->name, hwif->INL(SATA_STATUS_REG));
-   HWGROUP(drive)->poll_timeout = 0;
+   HWGROUP(drive)->polling = 0;
return ide_started;
}
return 0;
Index: linux-ide-export/include/linux/ide.h
===
--- linux-ide-export.orig/include/linux/ide.h   2005-02-02 10:28:04.261354174 
+0900
+++ linux-ide-export/include/linux/ide.h2005-02-02 10:28:04.467320756 
+0900
@@ -938,7 +938,9 @@ typedef struct hwgroup_s {
/* BOOL: protects all fields below */
volatile int busy;
/* BOOL: wake us up on timer expiry */
-   int sleeping;
+   int sleeping: 1;
+   /* BOOL: polling active & poll_timeout field valid */
+   int polling : 1;
/* current drive */
ide_drive_t *drive;
/* ptr to current hwif in linked-list */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More 

Re: [PATCH 2.6.11-rc2 12/29] ide: add ide_hwgroup_t.polling

2005-02-01 Thread Tejun Heo
 12_ide_hwgroup_t_polling.patch
 
   ide_hwgroup_t.polling field added.  0 in poll_timeout field
   used to indicate inactive polling but because 0 is a valid
   jiffy value, though slim, there's a chance that something
   weird can happen.


Signed-off-by: Tejun Heo [EMAIL PROTECTED]


Index: linux-ide-export/drivers/ide/ide-io.c
===
--- linux-ide-export.orig/drivers/ide/ide-io.c  2005-02-02 10:28:04.260354336 
+0900
+++ linux-ide-export/drivers/ide/ide-io.c   2005-02-02 10:28:04.465321080 
+0900
@@ -1314,7 +1314,7 @@ void ide_timer_expiry (unsigned long dat
/* local CPU only,
 * as if we were handling an interrupt */
local_irq_disable();
-   if (hwgroup-poll_timeout != 0) {
+   if (hwgroup-polling) {
startstop = handler(drive);
} else if (drive_is_ready(drive)) {
if (drive-waiting_for_dma)
@@ -1442,8 +1442,7 @@ irqreturn_t ide_intr (int irq, void *dev
return IRQ_NONE;
}
 
-   if ((handler = hwgroup-handler) == NULL ||
-   hwgroup-poll_timeout != 0) {
+   if ((handler = hwgroup-handler) == NULL || hwgroup-polling) {
/*
 * Not expecting an interrupt from this drive.
 * That means this could be:
Index: linux-ide-export/drivers/ide/ide-iops.c
===
--- linux-ide-export.orig/drivers/ide/ide-iops.c2005-02-02 
10:27:15.612247109 +0900
+++ linux-ide-export/drivers/ide/ide-iops.c 2005-02-02 10:28:04.466320918 
+0900
@@ -1028,14 +1028,14 @@ static ide_startstop_t atapi_reset_pollf
return ide_started;
}
/* end of polling */
-   hwgroup-poll_timeout = 0;
+   hwgroup-polling = 0;
printk(%s: ATAPI reset timed-out, status=0x%02x\n,
drive-name, stat);
/* do it the old fashioned way */
return do_reset1(drive, 1);
}
/* done polling */
-   hwgroup-poll_timeout = 0;
+   hwgroup-polling = 0;
return ide_stopped;
 }
 
@@ -1095,7 +1095,7 @@ static ide_startstop_t reset_pollfunc (i
printk(\n);
}
}
-   hwgroup-poll_timeout = 0;  /* done polling */
+   hwgroup-polling = 0;   /* done polling */
return ide_stopped;
 }
 
@@ -1170,6 +1170,7 @@ static ide_startstop_t do_reset1 (ide_dr
udelay (20);
hwif-OUTB(WIN_SRST, IDE_COMMAND_REG);
hwgroup-poll_timeout = jiffies + WAIT_WORSTCASE;
+   hwgroup-polling = 1;
__ide_set_handler(drive, atapi_reset_pollfunc, HZ/20, NULL);
spin_unlock_irqrestore(ide_lock, flags);
return ide_started;
@@ -1210,6 +1211,7 @@ static ide_startstop_t do_reset1 (ide_dr
/* more than enough time */
udelay(10);
hwgroup-poll_timeout = jiffies + WAIT_WORSTCASE;
+   hwgroup-polling = 1;
__ide_set_handler(drive, reset_pollfunc, HZ/20, NULL);
 
/*
Index: linux-ide-export/drivers/ide/pci/siimage.c
===
--- linux-ide-export.orig/drivers/ide/pci/siimage.c 2005-02-02 
10:27:15.612247109 +0900
+++ linux-ide-export/drivers/ide/pci/siimage.c  2005-02-02 10:28:04.466320918 
+0900
@@ -590,7 +590,7 @@ static int siimage_reset_poll (ide_drive
if ((hwif-INL(SATA_STATUS_REG)  0x03) != 0x03) {
printk(KERN_WARNING %s: reset phy dead, 
status=0x%08x\n,
hwif-name, hwif-INL(SATA_STATUS_REG));
-   HWGROUP(drive)-poll_timeout = 0;
+   HWGROUP(drive)-polling = 0;
return ide_started;
}
return 0;
Index: linux-ide-export/include/linux/ide.h
===
--- linux-ide-export.orig/include/linux/ide.h   2005-02-02 10:28:04.261354174 
+0900
+++ linux-ide-export/include/linux/ide.h2005-02-02 10:28:04.467320756 
+0900
@@ -938,7 +938,9 @@ typedef struct hwgroup_s {
/* BOOL: protects all fields below */
volatile int busy;
/* BOOL: wake us up on timer expiry */
-   int sleeping;
+   int sleeping: 1;
+   /* BOOL: polling active  poll_timeout field valid */
+   int polling : 1;
/* current drive */
ide_drive_t *drive;
/* ptr to current hwif in linked-list */
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at