Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

David Altobelli and committed by
Linus Torvalds
891f7d73 63cd8854

+8 -4
+3 -3
drivers/misc/hpilo.c
··· 209 209 /* give iLO some time to process stop request */ 210 210 for (retries = MAX_WAIT; retries > 0; retries--) { 211 211 doorbell_set(driver_ccb); 212 - udelay(1); 212 + udelay(WAIT_TIME); 213 213 if (!(ioread32(&device_ccb->send_ctrl) & (1 << CTRL_BITPOS_A)) 214 214 && 215 215 !(ioread32(&device_ccb->recv_ctrl) & (1 << CTRL_BITPOS_A))) ··· 312 312 for (i = MAX_WAIT; i > 0; i--) { 313 313 if (ilo_pkt_dequeue(hw, driver_ccb, SENDQ, &pkt_id, NULL, NULL)) 314 314 break; 315 - udelay(1); 315 + udelay(WAIT_TIME); 316 316 } 317 317 318 318 if (i) { ··· 759 759 class_destroy(ilo_class); 760 760 } 761 761 762 - MODULE_VERSION("1.0"); 762 + MODULE_VERSION("1.1"); 763 763 MODULE_ALIAS(ILO_NAME); 764 764 MODULE_DESCRIPTION(ILO_NAME); 765 765 MODULE_AUTHOR("David Altobelli <david.altobelli@hp.com>");
+5 -1
drivers/misc/hpilo.h
··· 19 19 #define MAX_ILO_DEV 1 20 20 /* max number of files */ 21 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 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 30 * Per device, used to track global memory allocations.