diff options
author | David Altobelli <david.altobelli@hp.com> | 2009-02-04 18:11:58 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-02-05 15:56:46 -0500 |
commit | c073b2db006ba9370be1eecc36a1be1d9ce31310 (patch) | |
tree | 6aed14266d19840b943d9e14c4bdeb3830296ec9 /drivers/misc | |
parent | 58763a297405024d23d8f1d0bba3e6603660c4b6 (diff) |
hpilo: open/close fix
The device can take a while to respond to an open/close request, so
increase the time kernel will wait for response (1 ms to 10ms).
Also, properly clean up a channel on a failed open, by calling the channel
close routine. Just freeing the memory isn't sufficient, the device needs
to be informed that the channel is no longer open, and the device memory
cleared of references to freed dma buffer.
Signed-off-by: David Altobelli <david.altobelli@hp.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/hpilo.c | 6 | ||||
-rw-r--r-- | drivers/misc/hpilo.h | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/drivers/misc/hpilo.c b/drivers/misc/hpilo.c index 10c421b73eaf..f26667a7abf7 100644 --- a/drivers/misc/hpilo.c +++ b/drivers/misc/hpilo.c | |||
@@ -207,7 +207,7 @@ static void ilo_ccb_close(struct pci_dev *pdev, struct ccb_data *data) | |||
207 | &device_ccb->recv_ctrl); | 207 | &device_ccb->recv_ctrl); |
208 | 208 | ||
209 | /* give iLO some time to process stop request */ | 209 | /* give iLO some time to process stop request */ |
210 | for (retries = 1000; 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(1); |
213 | if (!(ioread32(&device_ccb->send_ctrl) & (1 << CTRL_BITPOS_A)) | 213 | if (!(ioread32(&device_ccb->send_ctrl) & (1 << CTRL_BITPOS_A)) |
@@ -309,7 +309,7 @@ static int ilo_ccb_open(struct ilo_hwinfo *hw, struct ccb_data *data, int slot) | |||
309 | doorbell_clr(driver_ccb); | 309 | doorbell_clr(driver_ccb); |
310 | 310 | ||
311 | /* make sure iLO is really handling requests */ | 311 | /* make sure iLO is really handling requests */ |
312 | for (i = 1000; 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(1); |
@@ -326,7 +326,7 @@ static int ilo_ccb_open(struct ilo_hwinfo *hw, struct ccb_data *data, int slot) | |||
326 | 326 | ||
327 | return 0; | 327 | return 0; |
328 | free: | 328 | free: |
329 | pci_free_consistent(pdev, data->dma_size, data->dma_va, data->dma_pa); | 329 | ilo_ccb_close(pdev, data); |
330 | out: | 330 | out: |
331 | return error; | 331 | return error; |
332 | } | 332 | } |
diff --git a/drivers/misc/hpilo.h b/drivers/misc/hpilo.h index a281207696c1..b64a20ef07e3 100644 --- a/drivers/misc/hpilo.h +++ b/drivers/misc/hpilo.h | |||
@@ -19,6 +19,8 @@ | |||
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 | /* spin counter for open/close delay */ | ||
23 | #define MAX_WAIT 10000 | ||
22 | 24 | ||
23 | /* | 25 | /* |
24 | * Per device, used to track global memory allocations. | 26 | * Per device, used to track global memory allocations. |