lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20141008045812.734a24db@ultegra>
Date:	Wed, 8 Oct 2014 04:58:12 -0700
From:	Jacob Pan <jacob.jun.pan@...ux.intel.com>
To:	Linus Walleij <linus.walleij@...aro.org>
Cc:	Lee Jones <lee.jones@...aro.org>, Aaron Lu <aaron.lu@...el.com>,
	Alexandre Courbot <gnurou@...il.com>,
	Samuel Ortiz <sameo@...ux.intel.com>,
	Arnd Bergmann <arnd@...db.de>,
	"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
	"linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Lejun Zhu <lejun.zhu@...el.com>,
	Radivoje Jovanovic <radivoje.jovanovic@...el.com>,
	Daniel Glöckner <dg@...ix.com>,
	ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
	"Rafael J. Wysocki" <rjw@...ysocki.net>,
	Mark Brown <broonie@...aro.org>
Subject: Re: [PATCH 2/2] PMIC / opregion: support PMIC customized operation
 region for CrystalCove

On Wed, 8 Oct 2014 11:16:11 +0200
Linus Walleij <linus.walleij@...aro.org> wrote:

> On Wed, Oct 8, 2014 at 10:05 AM, Lee Jones <lee.jones@...aro.org>
> wrote:
> 
> > With the influx of new same-chip devices, I think the MFD subsystem
> > is fast becoming overloaded.  I think all of the PMIC handling
> > should in fact either live in Regulators or have its own subsystem.
> 
> You have a valid point, and it's been raised before that MFD risk
> being a dumping ground of the same kind that drivers/misc used to be
> (is?).
> 
> PMIC (Power Management Integrated Circuit) is often not even a
> correct name for the thing if it contains things like audio amplifiers
> USB PHY intrerfaces or LED boosters as some do.
> 
> MSIC (Mixed-Signal Integrated Circuit) is the correct name for
> silicon that is created as a one-stop shop for anything combining
> digital and analog constructions, often in a higher micron node
> (not as densely integrated) as a digital IC (the latter referred to
> as SoCs, "baseband", "CPU" and whatnot).
> 
> If they shall live in MFD the driver there should (IMHO) just be
> an exchange station, multiplexing messages and spawning
> MFD cells into platform devices for respective *real* subsystem,
> various misc stuff should not be allowed to be shoehorned
> into MFD just because there is no other place to put it.
> 
I agree since in most cases there are not much common code to
consolidate among cell drivers. MFD is convenient as an exchange
station as you pointed out but the same time, drivers can create their
own platform devices without MFD. Perhaps we can add a set of MFD
internal APIs for PMIC for the things are common, e.g.
- regmap
- irq chip

> This driver clearly does not qualify, look:
> 
ACPI is kind of special since it is already an abstraction of the HW
making it easy to consolidate code. Perhaps that is why Aaron provides
the kind of callbacks for each PMIC.
> > +static int intel_crc_pmic_update_power(struct regmap *regmap,
> > +                                    struct pmic_pwr_reg *preg,
> > bool on) +{
> > +     int data;
> > +
> > +     if (regmap_read(regmap, preg->reg, &data))
> > +             return -EIO;
> > +
> > +     if (on) {
> > +             data |= PWR_SOURCE_SELECT | BIT(preg->bit);
> > +     } else {
> > +             data &= ~BIT(preg->bit);
> > +             data |= PWR_SOURCE_SELECT;
> > +     }
> > +
> > +     if (regmap_write(regmap, preg->reg, data))
> > +             return -EIO;
> > +     return 0;
> > +}
> 
> Selecting power source? Isn't that something and MFD cell
> spawned driver in either drivers/regulator or drivers/power should
> be doing?
> 
The difference in this case is that opregion handler driver does not
need the interfaces provided by sys/class/power_supply, or regulator
etc. By moving them away from the opregion common code, you would need
to export the APIs. I think we can have opregion code under
drivers/acpi?
> I know I have sinned in this regard in the past. But let's move
> forward with defining what this subsystem should *REALLY*
> be.
> 

> Yours,
> Linus Walleij

[Jacob Pan]
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ