From: Agustin Vega-Frias <agustinv@codeaurora.org>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org,
linux-arm Mailing List <linux-arm-kernel@lists.infradead.org>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Len Brown <lenb@kernel.org>, Thomas Gleixner <tglx@linutronix.de>,
Jason Cooper <jason@lakedaemon.net>,
Marc Zyngier <marc.zyngier@arm.com>,
Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
Timur Tabi <timur@codeaurora.org>,
Christopher Covington <cov@codeaurora.org>,
Andy Gross <agross@codeaurora.org>,
harba@codeaurora.org, Jon Masters <jcm@redhat.com>,
msalter@redhat.com, mlangsdo@redhat.com,
Al Stone <ahs3@redhat.com>,
astone@redhat.com, Graeme Gregory <graeme.gregory@linaro.org>,
guohanjun@huawei.com, charles.garcia-tobin@arm.com
Subject: Re: [PATCH V10 2/3] ACPI: Add support for ResourceSource/IRQ domain mapping
Date: Thu, 19 Jan 2017 10:40:42 -0500 [thread overview]
Message-ID: <c5e197e8bf26429ae488f49e47760302@codeaurora.org> (raw)
In-Reply-To: <CAHp75Vem=mCOGVoOpCJFYHcO17mJ9gexsQxa0Pjf4Lbt3hibRA@mail.gmail.com>
Hi Andy,
On 2017-01-18 14:45, Andy Shevchenko wrote:
> On Wed, Jan 18, 2017 at 9:04 PM, Agustin Vega-Frias
> <agustinv@codeaurora.org> wrote:
>
> [...]
>
>
>> + */
>> +static struct fwnode_handle *
>> +acpi_get_irq_source_fwhandle(const struct acpi_resource_source
>> *source)
>> +{
>> + struct fwnode_handle *result;
>> + struct acpi_device *device;
>> + acpi_handle handle;
>> + acpi_status status;
>> +
>> + if (!source->string_length)
>> + return acpi_gsi_domain_id;
>> +
>> + status = acpi_get_handle(NULL, source->string_ptr, &handle);
>> + if (ACPI_FAILURE(status)) {
>
>> + pr_warn("Could not find handle for %s\n",
>> source->string_ptr);
>> + return NULL;
>> + }
>> +
>> + device = acpi_bus_get_acpi_device(handle);
>> + if (!device) {
>> + pr_warn("Could not get device for %s\n",
>> source->string_ptr);
>
> I'm not sure both messages have a value.
I'll probably just drop the explicit pr_warns and just use WARN_ON on
the if condition. Is that a reasonable alternative in your view?
>
>> + return NULL;
>> + }
>
>
> [...]
>
>> + */
>> +static int acpi_irq_parse_one(acpi_handle handle, unsigned int index,
>> + struct irq_fwspec *fwspec, unsigned long
>> *flags)
>> +{
>> + struct acpi_irq_parse_one_ctx ctx = { -EINVAL, index, flags,
>> fwspec };
>> + acpi_status status;
>> +
>> + status = acpi_walk_resources(handle, METHOD_NAME__CRS,
>> + acpi_irq_parse_one_cb, &ctx);
>
>> + if (ACPI_FAILURE(status))
>> + return -EINVAL;
>
> Shouldn't you have the same in rc? Would be redundant.
>
Good point, since we always return -EINVAL on failure we can skip
the check since rc will only be updated on success.
>> + return ctx.rc;
>> +}
>> +
>
> [...]
>
>> + domain = irq_find_matching_fwnode(fwspec.fwnode,
>> DOMAIN_BUS_ANY);
>> + if (!domain)
>> + return -EPROBE_DEFER;
>
> Hmm... Could it be other issues here?
I'll comment on this on Lorenzo's reply.
>
>> +
>> + rc = irq_create_fwspec_mapping(&fwspec);
>> + if (rc <= 0)
>> + return -EINVAL;
>> +
>
>> + res->start = rc;
>> + res->end = rc;
>> + res->flags = flags;
>
> Perhaps struct resource *r should be a parameter to
> acpi_irq_parse_one().
I'll comment on this on Lorenzo's reply.
>
>> +
>> + return 0;
>> +}
>> +EXPORT_SYMBOL_GPL(acpi_irq_get);
>> +
>> +/**
>> * acpi_set_irq_model - Setup the GSI irqdomain information
>> * @model: the value assigned to acpi_irq_model
>> * @fwnode: the irq_domain identifier for mapping and looking up
I'll address the other issues on V11.
Thanks for your thorough review,
Agustin
>
> --
> With Best Regards,
> Andy Shevchenko
--
Qualcomm Datacenter Technologies, Inc. on behalf of the Qualcomm
Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a
Linux Foundation Collaborative Project.
next prev parent reply other threads:[~2017-01-19 15:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-18 19:04 [PATCH V10 2/3] ACPI: Add support for ResourceSource/IRQ domain mapping Agustin Vega-Frias
2017-01-18 19:45 ` Andy Shevchenko
2017-01-19 12:36 ` Lorenzo Pieralisi
2017-01-19 16:14 ` Agustin Vega-Frias
2017-01-19 15:40 ` Agustin Vega-Frias [this message]
-- strict thread matches above, loose matches on Subject: below --
2017-01-18 16:46 [PATCH V10 0/3] irqchip: qcom: Add IRQ combiner driver Agustin Vega-Frias
2017-01-18 16:46 ` [PATCH V10 2/3] ACPI: Add support for ResourceSource/IRQ domain mapping Agustin Vega-Frias
2017-01-18 18:00 ` Andy Shevchenko
2017-01-18 19:02 ` Agustin Vega-Frias
2017-01-31 22:10 ` Rafael J. Wysocki
2017-02-02 22:38 ` Agustin Vega-Frias
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=c5e197e8bf26429ae488f49e47760302@codeaurora.org \
--to=agustinv@codeaurora.org \
--cc=agross@codeaurora.org \
--cc=ahs3@redhat.com \
--cc=andy.shevchenko@gmail.com \
--cc=astone@redhat.com \
--cc=charles.garcia-tobin@arm.com \
--cc=cov@codeaurora.org \
--cc=graeme.gregory@linaro.org \
--cc=guohanjun@huawei.com \
--cc=harba@codeaurora.org \
--cc=jason@lakedaemon.net \
--cc=jcm@redhat.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=marc.zyngier@arm.com \
--cc=mlangsdo@redhat.com \
--cc=msalter@redhat.com \
--cc=rjw@rjwysocki.net \
--cc=tglx@linutronix.de \
--cc=timur@codeaurora.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