diff options
author | David Altobelli <david.altobelli@hp.com> | 2009-03-31 18:23:53 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-01 11:59:18 -0400 |
commit | 891f7d73ea30f925596b90bcf21020bfc5d90f3f (patch) | |
tree | ee2cf87038f657ead8e6df62acaa47f9805f0215 | |
parent | 63cd885426872254e82dac2d9e13ea4f720c21dc (diff) |
hpilo: reduce frequency of IO operations
Change hpilo open and close logic to spin for 10usec between checking device,
rather than every usec.
Because the loop is coded to take up to 10ms, it seemed prudent to
increase the interval between polling the device, to reduce the load on
the system and allow more other work to happen.
Signed-off-by: David Altobelli <david.altobelli@hp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/misc/hpilo.c | 6 | ||||
-rw-r--r-- | drivers/misc/hpilo.h | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/drivers/misc/hpilo.c b/drivers/misc/hpilo.c index cf991850f01b..880ccf39e23b 100644 --- a/drivers/misc/hpilo.c +++ b/drivers/misc/hpilo.c | |||
@@ -209,7 +209,7 @@ static void ilo_ccb_close(struct pci_dev *pdev, struct ccb_data *data) | |||
209 | /* give iLO some time to process stop request */ | 209 | /* give iLO some time to process stop request */ |
210 | for (retries = MAX_WAIT; retries > 0; retries--) { | 210 | for (retries = MAX_WAIT; retries > 0; retries--) { |
211 | doorbell_set(driver_ccb); | 211 | doorbell_set(driver_ccb); |
212 | udelay(1); | 212 | udelay(WAIT_TIME); |
213 | if (!(ioread32(&device_ccb->send_ctrl) & (1 << CTRL_BITPOS_A)) | 213 | if (!(ioread32(&device_ccb->send_ctrl) & (1 << CTRL_BITPOS_A)) |
214 | && | 214 | && |
215 | !(ioread32(&device_ccb->recv_ctrl) & (1 << CTRL_BITPOS_A))) | 215 | !(ioread32(&device_ccb->recv_ctrl) & (1 << CTRL_BITPOS_A))) |
@@ -312,7 +312,7 @@ static int ilo_ccb_open(struct ilo_hwinfo *hw, struct ccb_data *data, int slot) | |||
312 | for (i = MAX_WAIT; i > 0; i--) { | 312 | for (i = MAX_WAIT; i > 0; i--) { |
313 | if (ilo_pkt_dequeue(hw, driver_ccb, SENDQ, &pkt_id, NULL, NULL)) | 313 | if (ilo_pkt_dequeue(hw, driver_ccb, SENDQ, &pkt_id, NULL, NULL)) |
314 | break; | 314 | break; |
315 | udelay(1); | 315 | udelay(WAIT_TIME); |
316 | } | 316 | } |
317 | 317 | ||
318 | if (i) { | 318 | if (i) { |
@@ -759,7 +759,7 @@ static void __exit ilo_exit(void) | |||
759 | class_destroy(ilo_class); | 759 | class_destroy(ilo_class); |
760 | } | 760 | } |
761 | 761 | ||
762 | MODULE_VERSION("1.0"); | 762 | MODULE_VERSION("1.1"); |
763 | MODULE_ALIAS(ILO_NAME); | 763 | MODULE_ALIAS(ILO_NAME); |
764 | MODULE_DESCRIPTION(ILO_NAME); | 764 | MODULE_DESCRIPTION(ILO_NAME); |
765 | MODULE_AUTHOR("David Altobelli <david.altobelli@hp.com>"); | 765 | MODULE_AUTHOR("David Altobelli <david.altobelli@hp.com>"); |
diff --git a/drivers/misc/hpilo.h b/drivers/misc/hpilo.h index b64a20ef07e3..03a14c82aad9 100644 --- a/drivers/misc/hpilo.h +++ b/drivers/misc/hpilo.h | |||
@@ -19,8 +19,12 @@ | |||
19 | #define MAX_ILO_DEV 1 | 19 | #define MAX_ILO_DEV 1 |
20 | /* max number of files */ | 20 | /* max number of files */ |
21 | #define MAX_OPEN (MAX_CCB * MAX_ILO_DEV) | 21 | #define MAX_OPEN (MAX_CCB * MAX_ILO_DEV) |
22 | /* total wait time in usec */ | ||
23 | #define MAX_WAIT_TIME 10000 | ||
24 | /* per spin wait time in usec */ | ||
25 | #define WAIT_TIME 10 | ||
22 | /* spin counter for open/close delay */ | 26 | /* spin counter for open/close delay */ |
23 | #define MAX_WAIT 10000 | 27 | #define MAX_WAIT (MAX_WAIT_TIME / WAIT_TIME) |
24 | 28 | ||
25 | /* | 29 | /* |
26 | * Per device, used to track global memory allocations. | 30 | * Per device, used to track global memory allocations. |