linux-i3c.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Pitre <nico@fluxnic.net>
To: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: devicetree@vger.kernel.org,
	Rajeev Huralikoppi <rajeev.huralikoppi@silvaco.com>,
	linux-kernel@vger.kernel.org, npitre@baylibre.com,
	Rob Herring <robh+dt@kernel.org>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Boris Brezillon <boris.brezillon@collabora.com>,
	linux-i3c@lists.infradead.org,
	Conor Culhane <conor.culhane@silvaco.com>
Subject: Re: [PATCH 3/4] i3c: master: svc: Add Silvaco I3C master driver
Date: Mon, 3 Aug 2020 16:20:11 -0400 (EDT)	[thread overview]
Message-ID: <nycvar.YSQ.7.77.849.2008031546570.1112668@knanqh.ubzr> (raw)
In-Reply-To: <20200709080159.2178-3-miquel.raynal@bootlin.com>

On Thu, 9 Jul 2020, Miquel Raynal wrote:

> Add support for Silvaco I3C dual-role IP. The master role is supported
> in SDR mode only. I2C transfers have not been tested but are shared
> because they are so close to the I3C transfers in terms of registers
> configuration.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>

I'm worried by constructs like these:

> +static int svc_i3c_master_handle_ibi(struct svc_i3c_master *master,
> +				     struct i3c_dev_desc *dev)
> +{
> +	struct svc_i3c_i2c_dev_data *data = i3c_dev_get_master_data(dev);
> +	struct i3c_ibi_slot *slot;
> +	unsigned int count;
> +	u32 mdatactrl;
> +	u8 *buf;
> +	int ret;
> +	u32 reg;
> +
> +	spin_lock(&master->ibi.lock);
> +
> +	slot = i3c_generic_ibi_get_free_slot(data->ibi_pool);
> +	if (!slot) {
> +		ret = -ENOSPC;
> +		goto unlock;
> +	}
> +
> +	slot->len = 0;
> +	buf = slot->data;
> +
> +	ret = readl_poll_timeout(master->regs + SVC_I3C_MSTATUS, reg,
> +				 reg & SVC_I3C_MINT_RXPEND, 0, 1000);

Here you're in atomic context due to the lock, and 
readl_poll_timeout(() is built using usleep() which may ... sleep.

Also, is it actually possible for execution to reach this point if 
SVC_I3C_MINT_RXPEND is not set?

The rest looks reasonable to me.


Nicolas

-- 
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

  parent reply	other threads:[~2020-08-05  8:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-09  8:01 [PATCH 1/4] dt-bindings: Add vendor prefix for Silvaco Miquel Raynal
2020-07-09  8:01 ` [PATCH 2/4] dt-bindings: i3c: Describe Silvaco master binding Miquel Raynal
2020-07-09 17:04   ` Rob Herring
2020-07-09  8:01 ` [PATCH 3/4] i3c: master: svc: Add Silvaco I3C master driver Miquel Raynal
2020-07-09 10:02   ` kernel test robot
2020-07-09 12:58   ` kernel test robot
2020-08-03 20:20   ` Nicolas Pitre [this message]
     [not found]     ` <BN6PR16MB1762D6CE430AB08B7A2BE5FCF14A0@BN6PR16MB1762.namprd16.prod.outlook.com>
2020-08-05 15:13       ` Nicolas Pitre
2020-08-05 15:22         ` Miquel Raynal
2020-07-09  8:01 ` [PATCH 4/4] MAINTAINERS: Add Silvaco I3C master Miquel Raynal
2020-07-20 22:23 ` [PATCH 1/4] dt-bindings: Add vendor prefix for Silvaco Rob Herring

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=nycvar.YSQ.7.77.849.2008031546570.1112668@knanqh.ubzr \
    --to=nico@fluxnic.net \
    --cc=boris.brezillon@collabora.com \
    --cc=conor.culhane@silvaco.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-i3c@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=npitre@baylibre.com \
    --cc=rajeev.huralikoppi@silvaco.com \
    --cc=robh+dt@kernel.org \
    --cc=thomas.petazzoni@bootlin.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;
as well as URLs for NNTP newsgroup(s).