Linux Media Controller development
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: narmstrong@baylibre.com
Cc: linux-media@vger.kernel.org
Subject: [bug report] media: platform: meson: Add Amlogic Meson G12A AO CEC Controller driver
Date: Wed, 8 May 2019 10:30:39 +0300	[thread overview]
Message-ID: <20190508073039.GA12832@mwanda> (raw)

Hello Neil Armstrong,

The patch b7778c46683c: "media: platform: meson: Add Amlogic Meson
G12A AO CEC Controller driver" from Apr 12, 2019, leads to the
following static checker warning:

	drivers/media/platform/meson/ao-cec-g12a.c:377 meson_ao_cec_g12a_read()
	error: scheduling with locks held: 'spin_lock:cec_reg_lock'

drivers/media/platform/meson/ao-cec-g12a.c
   363  static int meson_ao_cec_g12a_read(void *context, unsigned int addr,
   364                                    unsigned int *data)
   365  {
   366          struct meson_ao_cec_g12a_device *ao_cec = context;
   367          u32 reg = FIELD_PREP(CECB_RW_ADDR, addr);
   368          unsigned long flags;
   369          int ret = 0;
   370  
   371          spin_lock_irqsave(&ao_cec->cec_reg_lock, flags);
                ^^^^^^^^^^^^^^^^^
Atomic context.

   372  
   373          ret = regmap_write(ao_cec->regmap, CECB_RW_REG, reg);
   374          if (ret)
   375                  goto read_out;
   376  
   377          ret = regmap_read_poll_timeout(ao_cec->regmap, CECB_RW_REG, reg,
   378                                         !(reg & CECB_RW_BUS_BUSY),
   379                                         5, 1000);
                                               ^
It sleeps for 5 usecs.

   380          if (ret)
   381                  goto read_out;
   382  
   383          ret = regmap_read(ao_cec->regmap, CECB_RW_REG, &reg);
   384  
   385          *data = FIELD_GET(CECB_RW_RD_DATA, reg);
   386  
   387  read_out:
   388          spin_unlock_irqrestore(&ao_cec->cec_reg_lock, flags);
   389  
   390          return ret;
   391  }

regards,
dan carpenter

                 reply	other threads:[~2019-05-08  7:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20190508073039.GA12832@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=linux-media@vger.kernel.org \
    --cc=narmstrong@baylibre.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