From: David Altobelli <david.altobelli@hp.com>
To: linux-kernel@vger.kernel.org
Cc: gregkh@suse.de, david.altobelli@hp.com
Subject: [PATCH] hpilo open/close fix
Date: Mon, 12 Jan 2009 13:18:37 -0700 [thread overview]
Message-ID: <20090112201837.GA19499@ldl.fc.hp.com> (raw)
Fix to hpilo module, patch against 2.6.28.
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.
Please CC me on any replies.
Signed-off-by: David Altobelli <david.altobelli@hp.com>
---
--- drivers/misc/hpilo.c.orig 2009-01-12 10:03:33.000000000 -0600
+++ drivers/misc/hpilo.c 2009-01-12 14:03:40.000000000 -0600
@@ -207,7 +207,7 @@ static void ilo_ccb_close(struct pci_dev
&device_ccb->recv_ctrl);
/* give iLO some time to process stop request */
- for (retries = 1000; retries > 0; retries--) {
+ for (retries = MAX_WAIT; retries > 0; retries--) {
doorbell_set(driver_ccb);
udelay(1);
if (!(ioread32(&device_ccb->send_ctrl) & (1 << CTRL_BITPOS_A))
@@ -309,7 +309,7 @@ static int ilo_ccb_open(struct ilo_hwinf
doorbell_clr(driver_ccb);
/* make sure iLO is really handling requests */
- for (i = 1000; i > 0; i--) {
+ for (i = MAX_WAIT; i > 0; i--) {
if (ilo_pkt_dequeue(hw, driver_ccb, SENDQ, &pkt_id, NULL, NULL))
break;
udelay(1);
@@ -326,7 +326,7 @@ static int ilo_ccb_open(struct ilo_hwinf
return 0;
free:
- pci_free_consistent(pdev, data->dma_size, data->dma_va, data->dma_pa);
+ ilo_ccb_close(pdev, data);
out:
return error;
}
--- drivers/misc/hpilo.h.orig 2009-01-12 13:49:11.000000000 -0600
+++ drivers/misc/hpilo.h 2009-01-12 13:56:33.000000000 -0600
@@ -19,6 +19,8 @@
#define MAX_ILO_DEV 1
/* max number of files */
#define MAX_OPEN (MAX_CCB * MAX_ILO_DEV)
+/* spin counter for open/close delay */
+#define MAX_WAIT 10000
/*
* Per device, used to track global memory allocations.
next reply other threads:[~2009-01-12 20:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-12 20:18 David Altobelli [this message]
2009-01-21 17:41 ` [PATCH] hpilo open/close fix Greg KH
2009-01-21 19:05 ` Altobelli, David
2009-01-21 19:13 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090112201837.GA19499@ldl.fc.hp.com \
--to=david.altobelli@hp.com \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox