mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: James Smart <james.smart@broadcom.com>
To: Fuqian Huang <huangfq.daxian@gmail.com>
Cc: Dick Kennedy <dick.kennedy@broadcom.com>,
	"James E . J . Bottomley" <jejb@linux.ibm.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] scsi: lpfc: use spin_lock_irqsave instead of spin_lock_irq in IRQ context
Date: Fri, 16 Aug 2019 11:29:08 -0700	[thread overview]
Message-ID: <2cc6df9c-50d2-651c-9534-8a91e8e30bd8@broadcom.com> (raw)
In-Reply-To: <20190812083134.7033-1-huangfq.daxian@gmail.com>

On 8/12/2019 1:31 AM, Fuqian Huang wrote:
> As spin_unlock_irq will enable interrupts.
> Function lpfc_findnode_rpi is called from
>      lpfc_sli_abts_err_handler (./drivers/scsi/lpfc/lpfc_sli.c)
>   <- lpfc_sli_async_event_handler
>   <- lpfc_sli_process_unsol_iocb
>   <- lpfc_sli_handle_fast_ring_event
>   <- lpfc_sli_fp_intr_handler
>   <- lpfc_sli_intr_handler
>   and lpfc_sli_intr_handler is an interrupt handler.
> Interrupts are enabled in interrupt handler.
> Use spin_lock_irqsave/spin_unlock_irqrestore instead of spin_(un)lock_irq
> in IRQ context to avoid this.
>
> Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com>
> ---
>   drivers/scsi/lpfc/lpfc_hbadisc.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c
> index 28ecaa7fc715..cf02c352b324 100644
> --- a/drivers/scsi/lpfc/lpfc_hbadisc.c
> +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c
> @@ -6065,10 +6065,11 @@ lpfc_findnode_rpi(struct lpfc_vport *vport, uint16_t rpi)
>   {
>   	struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
>   	struct lpfc_nodelist *ndlp;
> +	unsigned long flags;
>   
> -	spin_lock_irq(shost->host_lock);
> +	spin_lock_irqsave(shost->host_lock, flags);
>   	ndlp = __lpfc_findnode_rpi(vport, rpi);
> -	spin_unlock_irq(shost->host_lock);
> +	spin_unlock_irqrestore(shost->host_lock, flags);
>   	return ndlp;
>   }
>   

Thank you.

Reviewed-by: James Smart <james.smart@broadcom.com>

-- james

      reply	other threads:[~2019-08-16 18:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-12  8:31 Fuqian Huang
2019-08-16 18:29 ` James Smart [this message]

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=2cc6df9c-50d2-651c-9534-8a91e8e30bd8@broadcom.com \
    --to=james.smart@broadcom.com \
    --cc=dick.kennedy@broadcom.com \
    --cc=huangfq.daxian@gmail.com \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /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

all inboxes | Powered by JetHome®