All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: Cristian Ciocaltea <cristian.ciocaltea@gmail.com>
Cc: "Rob Herring" <robh+dt@kernel.org>,
	"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
	"Sebastian Reichel" <sre@kernel.org>,
	"Mark Brown" <broonie@kernel.org>,
	"Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org>,
	"Liam Girdwood" <lgirdwood@gmail.com>,
	"Andreas Färber" <afaerber@suse.de>,
	linux-actions@lists.infradead.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-input@vger.kernel.org,
	linux-pm@vger.kernel.org
Subject: Re: [PATCH v3 3/7] mfd: Add MFD driver for ATC260x PMICs
Date: Fri, 18 Dec 2020 13:21:39 +0000	[thread overview]
Message-ID: <20201218132139.GR207743@dell> (raw)
In-Reply-To: <20201217231731.GA104305@BV030612LT>

On Fri, 18 Dec 2020, Cristian Ciocaltea wrote:

> Hi Lee,
> 
> Thank you for the detailed review!
> 
> I will prepare a new revision, but there are still a couple of open
> points..

Could you please snip your replies, leaving only the open points.

Scrolling through lots of empty quotes or "done" comments is quite
time consuming.  Thanks.

[...]

> > > +	/*
> > > +	 * Using regmap within an atomic context (e.g. accessing a PMIC when
> > > +	 * powering system down) is normally allowed only if the regmap type
> > > +	 * is MMIO and the regcache type is either REGCACHE_NONE or
> > > +	 * REGCACHE_FLAT. For slow buses like I2C and SPI, the regmap is
> > > +	 * internally protected by a mutex which is acquired non-atomically.
> > > +	 *
> > > +	 * Let's improve this by using a customized locking scheme inspired
> > > +	 * from I2C atomic transfer. See i2c_in_atomic_xfer_mode() for a
> > > +	 * starting point.
> > > +	 */
> > > +	if (system_state > SYSTEM_RUNNING && irqs_disabled())
> > 
> > Were does system_state come from?
> 
> It is declared in 'include/linux/kernel.h':
> 
> extern enum system_states {
> 	SYSTEM_BOOTING,
> 	SYSTEM_SCHEDULING,
> 	SYSTEM_RUNNING,
> 	SYSTEM_HALT,
> 	SYSTEM_POWER_OFF,
> 	SYSTEM_RESTART,
> 	SYSTEM_SUSPEND,
> } system_state;
> 
> The definition is in 'init/main.c':
> 
> enum system_states system_state __read_mostly;
> EXPORT_SYMBOL(system_state);

Ah, it's a system wide thing.  No problem.

[...]

> > > +	ret = regmap_read(atc260x->regmap, atc260x->rev_reg, &chip_rev);
> > > +	if (ret) {
> > > +		dev_err(dev, "Failed to get chip revision\n");
> > > +		return ret;
> > > +	}
> > > +
> > > +	if (chip_rev < 0 || chip_rev > 31) {
> > > +		dev_err(dev, "Unknown chip revision: %d\n", ret);
> > > +		return -EINVAL;
> > > +	}
> > 
> > This still seems limiting.
> 
> This is based on the vendor implementation. Unfortunately I don't have
> access to a data sheet or any other source of information about the
> management of the chip revisions.

So which versions does this driver work with?  All 32?

[...]

> > > +const struct of_device_id atc260x_i2c_of_match[] = {
> > > +	{ .compatible = "actions,atc2603c", .data = (void *)ATC2603C },
> > > +	{ .compatible = "actions,atc2609a", .data = (void *)ATC2609A },
> > > +	{ /* sentinel */ }
> > 
> > I think you can drop the (void *) casts.
> 
> Without the cast, I get the following compiler warning:
> 
> drivers/mfd/atc260x-i2c.c:46:46: warning: initialization of ‘const void *’
> from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
>   { .compatible = "actions,atc2603c", .data = ATC2603C },

Perhaps I'm getting confused with addresses of things.  Never mind.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

  reply	other threads:[~2020-12-18 13:22 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-06  1:27 [PATCH v3 0/7] Add initial support for ATC260x PMICs Cristian Ciocaltea
2020-12-06  1:27 ` [PATCH v3 1/7] dt-bindings: input: Add reset-time-sec common property Cristian Ciocaltea
2020-12-10  3:37   ` Rob Herring
2020-12-10  9:13     ` Cristian Ciocaltea
2020-12-11  3:16       ` Rob Herring
2020-12-10  4:06   ` Manivannan Sadhasivam
2020-12-10  9:25     ` Cristian Ciocaltea
2020-12-06  1:27 ` [PATCH v3 2/7] dt-bindings: mfd: Add Actions Semi ATC260x PMIC binding Cristian Ciocaltea
2020-12-11  3:17   ` Rob Herring
2020-12-11 14:17     ` Cristian Ciocaltea
2020-12-06  1:27 ` [PATCH v3 3/7] mfd: Add MFD driver for ATC260x PMICs Cristian Ciocaltea
2020-12-16 10:10   ` Lee Jones
2020-12-17 23:17     ` Cristian Ciocaltea
2020-12-18 13:21       ` Lee Jones [this message]
2020-12-18 16:07         ` Cristian Ciocaltea
2020-12-21  8:10           ` Lee Jones
2020-12-21 11:57             ` Cristian Ciocaltea
2020-12-21 12:18               ` Linus Walleij
2020-12-21 13:44                 ` Cristian Ciocaltea
2020-12-06  1:27 ` [PATCH v3 4/7] regulator: Add regulator " Cristian Ciocaltea
2020-12-07 13:30   ` Mark Brown
2020-12-07 22:54     ` Cristian Ciocaltea
2020-12-06  1:27 ` [PATCH v3 5/7] power: reset: Add poweroff " Cristian Ciocaltea
2020-12-06  1:27 ` [PATCH v3 6/7] input: atc260x: Add onkey " Cristian Ciocaltea
2020-12-06  3:13   ` Dmitry Torokhov
2020-12-06 13:44     ` Cristian Ciocaltea
2020-12-06  1:27 ` [PATCH v3 7/7] MAINTAINERS: Add entry for ATC260x PMIC Cristian Ciocaltea

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=20201218132139.GR207743@dell \
    --to=lee.jones@linaro.org \
    --cc=afaerber@suse.de \
    --cc=broonie@kernel.org \
    --cc=cristian.ciocaltea@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-actions@lists.infradead.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=robh+dt@kernel.org \
    --cc=sre@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 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.