All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Mike Marciniszyn
	<mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] IB/hfi1: Fix hard lockup due to not using save/restore spin lock
Date: Wed, 1 Jun 2016 18:44:40 +0300	[thread overview]
Message-ID: <20160601154440.GH7477@leon.nu> (raw)
In-Reply-To: <20160601143812.26872.85826.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 2165 bytes --]

On Wed, Jun 01, 2016 at 10:38:12AM -0400, Mike Marciniszyn wrote:
> Upstream commit 7049de65c9e5 into 4.6.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Is it part of the commit message?

> 
> Commit b9b06cb6feda
> ("IB/hfi1: Fix missing lock/unlock in verbs drain callback")
> added a spin lock.
> 
> Unfortunately, the new lock code can be called from a base
> level interrupt state, and an interrupt that can get stacked
> will attempt to get the same lock.
> 
> Fix by using the flag save/restore spin lock variation.
> 
> Reviewed-by: Sebastian Sanchez <sebastian.sanchez-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Signed-off-by: Mike Marciniszyn <mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Signed-off-by: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Signed-off-by: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> ---
>  drivers/staging/rdma/hfi1/qp.c |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/rdma/hfi1/qp.c b/drivers/staging/rdma/hfi1/qp.c
> index dc9119e..0401955 100644
> --- a/drivers/staging/rdma/hfi1/qp.c
> +++ b/drivers/staging/rdma/hfi1/qp.c
> @@ -512,6 +512,7 @@ static void iowait_wakeup(struct iowait *wait, int reason)
>  static void iowait_sdma_drained(struct iowait *wait)
>  {
>  	struct rvt_qp *qp = iowait_to_qp(wait);
> +	unsigned long flags;
>  
>  	/*
>  	 * This happens when the send engine notes
> @@ -519,12 +520,12 @@ static void iowait_sdma_drained(struct iowait *wait)
>  	 * do the flush work until that QP's
>  	 * sdma work has finished.
>  	 */
> -	spin_lock(&qp->s_lock);
> +	spin_lock_irqsave(&qp->s_lock, flags);
>  	if (qp->s_flags & RVT_S_WAIT_DMA) {
>  		qp->s_flags &= ~RVT_S_WAIT_DMA;
>  		hfi1_schedule_send(qp);
>  	}
> -	spin_unlock(&qp->s_lock);
> +	spin_unlock_irqrestore(&qp->s_lock, flags);
>  }
>  
>  /**
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Leon Romanovsky <leon@kernel.org>
To: Mike Marciniszyn <mike.marciniszyn@intel.com>
Cc: stable@vger.kernel.org, linux-rdma@vger.kernel.org
Subject: Re: [PATCH] IB/hfi1: Fix hard lockup due to not using save/restore spin lock
Date: Wed, 1 Jun 2016 18:44:40 +0300	[thread overview]
Message-ID: <20160601154440.GH7477@leon.nu> (raw)
In-Reply-To: <20160601143812.26872.85826.stgit@phlsvslse11.ph.intel.com>

[-- Attachment #1: Type: text/plain, Size: 2022 bytes --]

On Wed, Jun 01, 2016 at 10:38:12AM -0400, Mike Marciniszyn wrote:
> Upstream commit 7049de65c9e5 into 4.6.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Is it part of the commit message?

> 
> Commit b9b06cb6feda
> ("IB/hfi1: Fix missing lock/unlock in verbs drain callback")
> added a spin lock.
> 
> Unfortunately, the new lock code can be called from a base
> level interrupt state, and an interrupt that can get stacked
> will attempt to get the same lock.
> 
> Fix by using the flag save/restore spin lock variation.
> 
> Reviewed-by: Sebastian Sanchez <sebastian.sanchez@intel.com>
> Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
> Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
> Signed-off-by: Doug Ledford <dledford@redhat.com>
> ---
>  drivers/staging/rdma/hfi1/qp.c |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/rdma/hfi1/qp.c b/drivers/staging/rdma/hfi1/qp.c
> index dc9119e..0401955 100644
> --- a/drivers/staging/rdma/hfi1/qp.c
> +++ b/drivers/staging/rdma/hfi1/qp.c
> @@ -512,6 +512,7 @@ static void iowait_wakeup(struct iowait *wait, int reason)
>  static void iowait_sdma_drained(struct iowait *wait)
>  {
>  	struct rvt_qp *qp = iowait_to_qp(wait);
> +	unsigned long flags;
>  
>  	/*
>  	 * This happens when the send engine notes
> @@ -519,12 +520,12 @@ static void iowait_sdma_drained(struct iowait *wait)
>  	 * do the flush work until that QP's
>  	 * sdma work has finished.
>  	 */
> -	spin_lock(&qp->s_lock);
> +	spin_lock_irqsave(&qp->s_lock, flags);
>  	if (qp->s_flags & RVT_S_WAIT_DMA) {
>  		qp->s_flags &= ~RVT_S_WAIT_DMA;
>  		hfi1_schedule_send(qp);
>  	}
> -	spin_unlock(&qp->s_lock);
> +	spin_unlock_irqrestore(&qp->s_lock, flags);
>  }
>  
>  /**
> 
> --
> 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

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  parent reply	other threads:[~2016-06-01 15:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-01 14:38 [PATCH] IB/hfi1: Fix hard lockup due to not using save/restore spin lock Mike Marciniszyn
2016-06-01 14:38 ` Mike Marciniszyn
     [not found] ` <20160601143812.26872.85826.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org>
2016-06-01 15:44   ` Leon Romanovsky [this message]
2016-06-01 15:44     ` Leon Romanovsky
2016-06-01 16:14     ` Greg KH
2016-06-01 16:47       ` Leon Romanovsky
2016-06-01 16:50         ` Marciniszyn, Mike
2016-06-01 16:25     ` Marciniszyn, Mike

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=20160601154440.GH7477@leon.nu \
    --to=leon-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.