diff mbox

IB/qib: Prevent driver hang with unprogrammed boards

Message ID 20110411134517.3720.3633.stgit@kop-dev-sles11-04.qlogic.org (mailing list archive)
State Accepted
Headers show

Commit Message

Mike Marciniszyn April 11, 2011, 1:45 p.m. UTC
From: Mitko Haralanov <mitko@qlogic.com>

The time limit test now correctly checks the against
current jiffies to avoid the hang.

Signed-off-by: Mitko Haralanov <mitko@qlogic.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@qlogic.com>
---
 drivers/infiniband/hw/qib/qib_iba7322.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Roland Dreier April 11, 2011, 8:24 p.m. UTC | #1
On Mon, Apr 11, 2011 at 6:45 AM, Mike Marciniszyn
<mike.marciniszyn@qlogic.com> wrote:
> -              !time_after64(tstart, tstart + msecs_to_jiffies(500))) {
> +              !time_after64(get_jiffies_64(),
> +                       tstart + msecs_to_jiffies(500))) {

By the way, is there any need to use 64-bit jiffies stuff here?

Couldn't this be more cleanly written with just time_is_before_jiffies()?
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Mike Marciniszyn April 11, 2011, 8:29 p.m. UTC | #2
I saw that, but wanted to replicate the patch as we authored it internally.

I agree that 32 bit jiffies (given the 500ms timeout), would be sufficient and that the time_is_before_jiffies() macro would be a better solution.

I will work with Mitko to get a revision with your suggestions.

Mike


-----Original Message-----
From: Roland Dreier [mailto:roland@purestorage.com]
Sent: Monday, April 11, 2011 4:25 PM
To: Mike Marciniszyn
Cc: linux-rdma@vger.kernel.org
Subject: Re: [PATCH] IB/qib: Prevent driver hang with unprogrammed boards

On Mon, Apr 11, 2011 at 6:45 AM, Mike Marciniszyn
<mike.marciniszyn@qlogic.com> wrote:
> -              !time_after64(tstart, tstart + msecs_to_jiffies(500))) {
> +              !time_after64(get_jiffies_64(),
> +                       tstart + msecs_to_jiffies(500))) {

By the way, is there any need to use 64-bit jiffies stuff here?

Couldn't this be more cleanly written with just time_is_before_jiffies()?


This message and any attached documents contain information from QLogic Corporation or its wholly-owned subsidiaries that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Mike Marciniszyn April 12, 2011, 4:58 p.m. UTC | #3
I would like to keep the patch as is for now, since the Serdes code is using the 64 bit jiffies consistently throughout.  The fix solves a real issue (modprobe hang) with boards that haven't been QA'ed properly.

Is there a reason to avoid the 64 bit jiffies stuff that should cause us to look at a more global effort beyond the scope of this patch?

Mike

-----Original Message-----
From: Roland Dreier [mailto:roland@purestorage.com]
Sent: Monday, April 11, 2011 4:25 PM
To: Mike Marciniszyn
Cc: linux-rdma@vger.kernel.org
Subject: Re: [PATCH] IB/qib: Prevent driver hang with unprogrammed boards

On Mon, Apr 11, 2011 at 6:45 AM, Mike Marciniszyn
<mike.marciniszyn@qlogic.com> wrote:
> -              !time_after64(tstart, tstart + msecs_to_jiffies(500))) {
> +              !time_after64(get_jiffies_64(),
> +                       tstart + msecs_to_jiffies(500))) {

By the way, is there any need to use 64-bit jiffies stuff here?

Couldn't this be more cleanly written with just time_is_before_jiffies()?


This message and any attached documents contain information from QLogic Corporation or its wholly-owned subsidiaries that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/infiniband/hw/qib/qib_iba7322.c b/drivers/infiniband/hw/qib/qib_iba7322.c
index 4df08b8..30bbea2 100644
--- a/drivers/infiniband/hw/qib/qib_iba7322.c
+++ b/drivers/infiniband/hw/qib/qib_iba7322.c
@@ -7545,7 +7545,8 @@  static int serdes_7322_init_new(struct qib_pportdata *ppd)
 	ibsd_wr_allchans(ppd, 4, (1 << 10), BMASK(10, 10));
 	tstart = get_jiffies_64();
 	while (chan_done &&
-	       !time_after64(tstart, tstart + msecs_to_jiffies(500))) {
+	       !time_after64(get_jiffies_64(),
+			tstart + msecs_to_jiffies(500))) {
 		msleep(20);
 		for (chan = 0; chan < SERDES_CHANS; ++chan) {
 			rxcaldone = ahb_mod(ppd->dd, IBSD(ppd->hw_pidx),