From: b.brezillon@overkiz•com (boris brezillon)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH] at91: ohci: fixed broken sanity check
Date: Tue, 31 Dec 2013 18:25:40 +0100 [thread overview]
Message-ID: <52C2FE14.1020806@overkiz.com> (raw)
In-Reply-To: <1388507624-10636-1-git-send-email-jjhiblot@traphandler.com>
Hello Jean-Jacques,
On 31/12/2013 17:33, jjhiblot at traphandler.com wrote:
> From: jean-jacques hiblot <jean-jacques.hiblot@jdsu•com>
>
> The test (pdev->resource[1].flags != IORESOURCE_IRQ) is broken because the flags
> value may contain not only the information IORESSOURCE_IRQ but also the IRQ type
> (IORESOURCE_IRQ_HIGHLEVEL for example).
>
This is already fixed: we moved to platform_get_irq and
platform_get_ressource instead of directly accessing platform
resource table.
See http://lists.openwall.net/linux-kernel/2013/12/08/128.
This solves both the problem you're reporting and another problem when
resources are in a different order (nothing guarantees the resources
order when using DT).
Best Regards,
Boris
> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@traphandler•com>
> ---
> drivers/usb/host/ohci-at91.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
> index 418444e..df9c8a4 100644
> --- a/drivers/usb/host/ohci-at91.c
> +++ b/drivers/usb/host/ohci-at91.c
> @@ -142,8 +142,8 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver,
> return -ENODEV;
> }
>
> - if ((pdev->resource[0].flags != IORESOURCE_MEM)
> - || (pdev->resource[1].flags != IORESOURCE_IRQ)) {
> + if (!(pdev->resource[0].flags & IORESOURCE_MEM)
> + || !(pdev->resource[1].flags & IORESOURCE_IRQ)) {
> pr_debug("hcd probe: invalid resource type\n");
> return -ENODEV;
> }
>
prev parent reply other threads:[~2013-12-31 17:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-31 16:33 [PATCH] at91: ohci: fixed broken sanity check jjhiblot at traphandler.com
2013-12-31 17:25 ` boris brezillon [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=52C2FE14.1020806@overkiz.com \
--to=b.brezillon@overkiz$(echo .)com \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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