Skip to content

Commit 891f7d7

Browse files
David Altobellitorvalds
authored andcommitted
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>
1 parent 63cd885 commit 891f7d7

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

‎drivers/misc/hpilo.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ static void ilo_ccb_close(struct pci_dev *pdev, struct ccb_data *data)
209209
/* give iLO some time to process stop request */
210210
for (retries = MAX_WAIT; retries > 0; retries--) {
211211
doorbell_set(driver_ccb);
212-
udelay(1);
212+
udelay(WAIT_TIME);
213213
if (!(ioread32(&device_ccb->send_ctrl) & (1 << CTRL_BITPOS_A))
214214
&&
215215
!(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)
312312
for (i = MAX_WAIT; i > 0; i--) {
313313
if (ilo_pkt_dequeue(hw, driver_ccb, SENDQ, &pkt_id, NULL, NULL))
314314
break;
315-
udelay(1);
315+
udelay(WAIT_TIME);
316316
}
317317

318318
if (i) {
@@ -759,7 +759,7 @@ static void __exit ilo_exit(void)
759759
class_destroy(ilo_class);
760760
}
761761

762-
MODULE_VERSION("1.0");
762+
MODULE_VERSION("1.1");
763763
MODULE_ALIAS(ILO_NAME);
764764
MODULE_DESCRIPTION(ILO_NAME);
765765
MODULE_AUTHOR("David Altobelli <david.altobelli@hp.com>");

‎drivers/misc/hpilo.h‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@
1919
#define MAX_ILO_DEV 1
2020
/* max number of files */
2121
#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
2226
/* spin counter for open/close delay */
23-
#define MAX_WAIT 10000
27+
#define MAX_WAIT (MAX_WAIT_TIME / WAIT_TIME)
2428

2529
/*
2630
* Per device, used to track global memory allocations.

0 commit comments

Comments
 (0)