linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Dinh Nguyen <dinguyen@kernel.org>
To: Linus Walleij <linus.walleij@linaro.org>,
	Philipp Zabel <p.zabel@pengutronix.de>
Cc: "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
	<devicetree@vger.kernel.org>,
	Daniel Thompson <daniel.thompson@linaro.org>,
	Tony Luck <tony.luck@intel.com>,
	Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>,
	Kees Cook <keescook@chromium.org>, Rob Herring <robh@kernel.org>,
	Anton Vorontsov <anton@enomsg.org>,
	Russell King <linux@armlinux.org.uk>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Colin Cross <ccross@android.com>,
	Frank Rowand <frowand.list@gmail.com>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>
Subject: Re: [RESEND PATCHv4 1/1] drivers/amba: add reset control to amba bus probe
Date: Fri, 23 Aug 2019 10:42:49 -0500	[thread overview]
Message-ID: <e7e986a2-762e-674b-608b-5ee5b013935b@kernel.org> (raw)
In-Reply-To: <CACRpkdasbXuqUkO3NjMGBU_ePEBT23BS1eP-bigB0_g494LgvQ@mail.gmail.com>



On 8/23/19 4:19 AM, Linus Walleij wrote:
> On Tue, Aug 20, 2019 at 4:58 PM Dinh Nguyen <dinguyen@kernel.org> wrote:
> 
>> @@ -401,6 +402,26 @@ static int amba_device_try_add(struct amba_device *dev, struct resource *parent)
>>         ret = amba_get_enable_pclk(dev);
>>         if (ret == 0) {
>>                 u32 pid, cid;
>> +               int count;
>> +               struct reset_control *rstc;
>> +
>> +               /*
>> +                * Find reset control(s) of the amba bus and de-assert them.
>> +                */
>> +               count = reset_control_get_count(&dev->dev);
>> +               while (count > 0) {
>> +                       rstc = of_reset_control_get_shared_by_index(dev->dev.of_node, count - 1);
>> +                       if (IS_ERR(rstc)) {
>> +                               if (PTR_ERR(rstc) == -EPROBE_DEFER)
>> +                                       ret = -EPROBE_DEFER;
>> +                               else
>> +                                       dev_err(&dev->dev, "Can't get amba reset!\n");
>> +                               break;
>> +                       }
>> +                       reset_control_deassert(rstc);
>> +                       reset_control_put(rstc);
>> +                       count--;
>> +               }
> 
> I'm not normally a footprint person, but the looks of the stubs in
> <linux/reset.h> makes me suspicious whether this will have zero impact
> in size on platforms without reset controllers.
> 
> Can you just ls -al on the kernel without CONFIG_RESET_CONTROLLER
> before and after this patch and ascertain that it has zero footprint effect?

Thanks for the review. I checked it, and indeed, it does have a zero
footprint effect.

> 
> If it doesn't I'd sure like to break this into its own function and
> stick a if (!IS_ENABLED(CONFIG_RESET_CONTROLLER)) return 0;
> in there to make sure the compiler drops it.
> 
> Also it'd be nice to get Philipp's ACK on the semantics, though they
> look correct to me.
> 

Dinh

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-08-23 15:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-20 14:58 [RESEND PATCHv4 0/1] drivers/amba: add reset control to amba Dinh Nguyen
2019-08-20 14:58 ` [RESEND PATCHv4 1/1] drivers/amba: add reset control to amba bus probe Dinh Nguyen
2019-08-23  9:19   ` Linus Walleij
2019-08-23 15:42     ` Dinh Nguyen [this message]
2019-08-26  8:57       ` Philipp Zabel
2019-08-26 15:27         ` Dinh Nguyen

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=e7e986a2-762e-674b-608b-5ee5b013935b@kernel.org \
    --to=dinguyen@kernel.org \
    --cc=anton@enomsg.org \
    --cc=ccross@android.com \
    --cc=daniel.thompson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=keescook@chromium.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=p.zabel@pengutronix.de \
    --cc=robh@kernel.org \
    --cc=tony.luck@intel.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).