public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Ondrej Zary <linux@rainbow-software.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: aha1542: rework locking
Date: Tue, 21 Apr 2015 12:39:40 +0200	[thread overview]
Message-ID: <201504211239.40423.linux@rainbow-software.org> (raw)
In-Reply-To: <20150421092603.GC12098@mwanda>

On Tuesday 21 April 2015, Dan Carpenter wrote:
> Hello Ondrej Zary,
> 
> The patch 1b0224b0ec60: "aha1542: rework locking" from Feb 6, 2015,
> leads to the following static checker warning:
> 
> 	drivers/scsi/aha1542.c:448 aha1542_queuecommand()
> 	error: scheduling with locks held: 'spin_lock:host_lock'
> 
> drivers/scsi/aha1542.c
>    400          /* Use the outgoing mailboxes in a round-robin fashion, because this
>    401             is how the host adapter will scan for them */
>    402  
>    403          spin_lock_irqsave(sh->host_lock, flags);
>                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> Holding lock.
> 
>    404          mbo = aha1542->aha1542_last_mbo_used + 1;
>    405          if (mbo >= AHA1542_MAILBOXES)
>    406                  mbo = 0;
>    407  
> 
> [ snip ]
> 
>    442          if (bufflen) {
>    443                  struct scatterlist *sg;
>    444                  struct chain *cptr;
>    445                  int i, sg_count = scsi_sg_count(cmd);
>    446  
>    447                  ccb[mbo].op = 2;        /* SCSI Initiator Command  w/scatter-gather */
>    448                  cmd->host_scribble = kmalloc(sizeof(*cptr)*sg_count,
>    449                                                           GFP_KERNEL | GFP_DMA);
>                                                                  ^^^^^^^^^^
> Sleeping allocation.

Thanks, I missed that as it was already wrong before (since at least when
DEF_SCSI_QCMD was introduced). And it worked despite that.

Should I just change that to GFP_ATOMIC?

-- 
Ondrej Zary

  reply	other threads:[~2015-04-21 10:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-21  9:26 aha1542: rework locking Dan Carpenter
2015-04-21 10:39 ` Ondrej Zary [this message]
2015-04-21 11:41   ` Dan Carpenter

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=201504211239.40423.linux@rainbow-software.org \
    --to=linux@rainbow-software.org \
    --cc=dan.carpenter@oracle.com \
    --cc=linux-scsi@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