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: <20180328091941.GB13942@piout.net>
Date:   Wed, 28 Mar 2018 11:19:41 +0200
From:   Alexandre Belloni <alexandre.belloni@...e-electrons.com>
To:     Sean Wang <sean.wang@...iatek.com>
Cc:     robh+dt@...nel.org, mark.rutland@....com, sre@...nel.org,
        lee.jones@...aro.org, a.zummo@...ertech.it,
        eddie.huang@...iatek.com, devicetree@...r.kernel.org,
        linux-rtc@...r.kernel.org, linux-pm@...r.kernel.org,
        linux-mediatek@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 02/16] dt-bindings: rtc: mediatek: add bindings for
 PMIC RTC

On 28/03/2018 at 11:53:17 +0800, Sean Wang wrote:
> On Tue, 2018-03-27 at 17:18 +0200, Alexandre Belloni wrote:
> > On 25/03/2018 at 03:36:28 +0800, Sean Wang wrote:
> > > just reply both replies in the same mail
> > > 
> > > 1.) the power-off device is a part of rtc, use the same registers rtc
> > > has and thus it is put as child nodes under the node rtc to reflect the
> > > reality of characteristics the rtc has.
> > > 
> > > Or am I wrong for a certain aspect in these opinions?
> > > 
> > 
> > My point is that it is also part of the PMIC so it may as well be
> > registers from the mfd driver which already registers a bunch of devices
> > instead of doing unusual stuff from the rtc driver.
> > 
> > mt6397_rtc->regmap is mt6397_chip->regmap anyway. You have the added
> > benefit that if the RTC driver probe fails for some reason, you may
> > still be able to probe the reset driver.
> > 
> > I don't tink there is any benefit having it as a child of the rtc
> > device.
> > 
> 
> 
> really thanks! it's an optional solution I thought it 's fine and worth
> doing
> 
> but so far I cannot fully make sure of whether mfd can accept two
> devices holding overlay IORESOURCE_MEM.
> 

There is no overlay because you are using a regmap which handles
concurrency for you.

What your patch is doing is:

struct mt6397_rtc *rtc = dev_get_drvdata(pdev->dev.parent);

then you use rtc->regmap

But in the rtc driver, you have:

struct mt6397_chip *mt6397_chip = dev_get_drvdata(pdev->dev.parent);
struct mt6397_rtc *rtc;

rtc->regmap = mt6397_chip->regmap;

So there is no benefit from being the child of the rtc, you could just
do the following in your reset driver:

struct mt6397_chip *mt6397_chip = dev_get_drvdata(pdev->dev.parent);

and then use mt6397_chip->regmap.


-- 
Alexandre Belloni, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ