From: Stafford Horne <shorne@gmail.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Joel Stanley <joel@jms.id.au>, Rob Herring <robh+dt@kernel.org>,
Philipp Zabel <philipp.zabel@gmail.com>,
Mykola Kostenok <c_mykolak@mellanox.com>,
Jaghathiswari Rankappagounder Natarajan <jaghu@google.com>,
devicetree@vger.kernel.org, linux-hwmon@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hwmon: (aspeed-pwm-tacho) Deassert reset in probe
Date: Wed, 1 Nov 2017 11:04:33 +0900 [thread overview]
Message-ID: <20171101020433.GF29237@lianli.shorne-pla.net> (raw)
In-Reply-To: <d70eef8b-385e-4591-17b4-6fde3907df0f@roeck-us.net>
On Tue, Oct 31, 2017 at 06:53:15PM -0700, Guenter Roeck wrote:
> On 10/31/2017 06:34 PM, Joel Stanley wrote:
> > The ASPEED SoC must deassert a reset in order to use the PWM/tach
> > peripheral.
> >
> > The device tree bindings are updated to document the resets phandle, and
> > the example is updated to match what is expected for both the reset and
> > clock phandle. Note that the bindings should have always had the reset
> > controller, as the hardware is unusable without it.
> >
> > Signed-off-by: Joel Stanley <joel@jms.id.au>
>
> Presumably the driver is being used. This change makes it incompatible with
> existing users. This is unacceptable; after all, it is possible that the
> device is taken out of reset by ROMMON or BIOS.
>
> On top of that, the reset controller code is quite strict and issues a
> backtrace if CONFIG_RESET_CONTROLLER is not enabled. Yet, there is no
> dependency added on RESET_CONTROLLER. You might want to consider making
> the new control optional and using devm_reset_control_get_optional_exclusive().
>
> The DT change should be a separate patch.
>
> More comments below.
[..]
> > return PTR_ERR_OR_ZERO(hwmon);
> > }
> > +static int aspeed_pwm_tacho_remove(struct platform_device *pdev)
> > +{
> > + struct aspeed_pwm_tacho_data *priv = platform_get_drvdata(pdev);
> > +
> > + reset_control_deassert(priv->rst);
>
> This seems to be quite pointless. Also, did you test this code ?
>
> > +
> > + return 0;
> > +}
> > +
> > static const struct of_device_id of_pwm_tacho_match_table[] = {
> > { .compatible = "aspeed,ast2400-pwm-tacho", },
> > { .compatible = "aspeed,ast2500-pwm-tacho", },
> > @@ -969,6 +989,7 @@ MODULE_DEVICE_TABLE(of, of_pwm_tacho_match_table);
> > static struct platform_driver aspeed_pwm_tacho_driver = {
> > .probe = aspeed_pwm_tacho_probe,
> > + .probe = aspeed_pwm_tacho_remove,
Also, this cant be right (should be .remove)?
> > .driver = {
> > .name = "aspeed_pwm_tacho",
> > .of_match_table = of_pwm_tacho_match_table,
> >
>
next prev parent reply other threads:[~2017-11-01 2:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-01 1:34 Joel Stanley
2017-11-01 1:53 ` Guenter Roeck
2017-11-01 2:04 ` Stafford Horne [this message]
2017-11-01 2:14 ` Guenter Roeck
2017-11-01 6:59 ` Joel Stanley
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=20171101020433.GF29237@lianli.shorne-pla.net \
--to=shorne@gmail.com \
--cc=c_mykolak@mellanox.com \
--cc=devicetree@vger.kernel.org \
--cc=jaghu@google.com \
--cc=joel@jms.id.au \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=philipp.zabel@gmail.com \
--cc=robh+dt@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®