linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robherring2@gmail.com>
To: Jingoo Han <jingoohan1@gmail.com>
Cc: Grant Likely <grant.likely@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	Liviu Dudau <liviu.dudau@arm.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>
Subject: Re: [PATCH] of/address: use atomic allocation in pci_register_io_range()
Date: Tue, 23 Jun 2015 10:29:30 -0500	[thread overview]
Message-ID: <CAL_JsqJcVuQpCxmmNwMzRu1Ypxdnaijroz7va5CuevJe_M2r+A@mail.gmail.com> (raw)
In-Reply-To: <000301d0a910$09d9bd60$1d8d3820$@com>

On Wed, Jun 17, 2015 at 10:12 AM, Jingoo Han <jingoohan1@gmail.com> wrote:
> When kzalloc() is called under spin_lock(), GFP_ATOMIC should be
> used to avoid sleeping allocation.
> The call tree is:
>   of_pci_range_to_resource()
>     --> pci_register_io_range() <-- takes spin_lock(&io_range_lock);
>        --> kzalloc()
>
> Signed-off-by: Jingoo Han <jingoohan1@gmail.com>

Applied. Thanks.

Rob

> ---
>  drivers/of/address.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/of/address.c b/drivers/of/address.c
> index 78a7dcb..65c3289 100644
> --- a/drivers/of/address.c
> +++ b/drivers/of/address.c
> @@ -712,7 +712,7 @@ int __weak pci_register_io_range(phys_addr_t addr, resource_size_t size)
>         }
>
>         /* add the range to the list */
> -       range = kzalloc(sizeof(*range), GFP_KERNEL);
> +       range = kzalloc(sizeof(*range), GFP_ATOMIC);
>         if (!range) {
>                 err = -ENOMEM;
>                 goto end_register;
> --
> 1.9.1
>
>

      reply	other threads:[~2015-06-23 15:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-17 15:12 [PATCH] of/address: use atomic allocation in pci_register_io_range() Jingoo Han
2015-06-23 15:29 ` Rob Herring [this message]

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=CAL_JsqJcVuQpCxmmNwMzRu1Ypxdnaijroz7va5CuevJe_M2r+A@mail.gmail.com \
    --to=robherring2@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=devicetree@vger.kernel.org \
    --cc=grant.likely@linaro.org \
    --cc=jingoohan1@gmail.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=liviu.dudau@arm.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;
as well as URLs for NNTP newsgroup(s).