]>
Commit | Line | Data |
---|---|---|
00e5a55c BS |
1 | From: David Altobelli <david.altobelli@hp.com> |
2 | Subject: [PATCH] hpilo open/close fix | |
3 | References: bnc#466517 | |
4 | ||
5 | Fix to hpilo module, patch against 2.6.28. | |
6 | The device can take a while to respond to an open/close request, so increase | |
7 | the time kernel will wait for response (1 ms to 10ms). | |
8 | Also, properly clean up a channel on a failed open, by calling the | |
9 | channel close routine. Just freeing the memory isn't sufficient, the device | |
10 | needs to be informed that the channel is no longer open, and the device | |
11 | memory cleared of references to freed dma buffer. | |
12 | ||
13 | Please CC me on any replies. | |
14 | ||
15 | Signed-off-by: David Altobelli <david.altobelli@hp.com> | |
16 | Acked-by: Jeff Mahoney <jeffm@suse.com> | |
17 | --- | |
18 | ||
19 | drivers/misc/hpilo.c | 8 ++++---- | |
20 | drivers/misc/hpilo.h | 2 ++ | |
21 | 2 files changed, 6 insertions(+), 4 deletions(-) | |
22 | ||
23 | --- a/drivers/misc/hpilo.c | |
24 | +++ b/drivers/misc/hpilo.c | |
25 | @@ -207,7 +207,7 @@ static void ilo_ccb_close(struct pci_dev | |
26 | &device_ccb->recv_ctrl); | |
27 | ||
28 | /* give iLO some time to process stop request */ | |
29 | - for (retries = 1000; retries > 0; retries--) { | |
30 | + for (retries = MAX_WAIT; retries > 0; retries--) { | |
31 | doorbell_set(driver_ccb); | |
32 | udelay(1); | |
33 | if (!(ioread32(&device_ccb->send_ctrl) & (1 << CTRL_BITPOS_A)) | |
34 | @@ -309,7 +309,7 @@ static int ilo_ccb_open(struct ilo_hwinf | |
35 | doorbell_clr(driver_ccb); | |
36 | ||
37 | /* make sure iLO is really handling requests */ | |
38 | - for (i = 1000; i > 0; i--) { | |
39 | + for (i = MAX_WAIT; i > 0; i--) { | |
40 | if (ilo_pkt_dequeue(hw, driver_ccb, SENDQ, &pkt_id, NULL, NULL)) | |
41 | break; | |
42 | udelay(1); | |
43 | @@ -326,7 +326,7 @@ static int ilo_ccb_open(struct ilo_hwinf | |
44 | ||
45 | return 0; | |
46 | free: | |
47 | - pci_free_consistent(pdev, data->dma_size, data->dma_va, data->dma_pa); | |
48 | + ilo_ccb_close(pdev, data); | |
49 | out: | |
50 | return error; | |
51 | } | |
52 | @@ -759,7 +759,7 @@ static void __exit ilo_exit(void) | |
53 | class_destroy(ilo_class); | |
54 | } | |
55 | ||
56 | -MODULE_VERSION("0.05"); | |
57 | +MODULE_VERSION("0.06"); | |
58 | MODULE_ALIAS(ILO_NAME); | |
59 | MODULE_DESCRIPTION(ILO_NAME); | |
60 | MODULE_AUTHOR("David Altobelli <david.altobelli@hp.com>"); | |
61 | --- a/drivers/misc/hpilo.h | |
62 | +++ b/drivers/misc/hpilo.h | |
63 | @@ -19,6 +19,8 @@ | |
64 | #define MAX_ILO_DEV 1 | |
65 | /* max number of files */ | |
66 | #define MAX_OPEN (MAX_CCB * MAX_ILO_DEV) | |
67 | +/* spin counter for open/close delay */ | |
68 | +#define MAX_WAIT 10000 | |
69 | ||
70 | /* | |
71 | * Per device, used to track global memory allocations. |