lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAwP0s3xkqUGnGvojfpyQq97qUmKCqY3BD4RyK1_uuX=pNy91g@mail.gmail.com>
Date:	Wed, 3 Jul 2013 17:12:25 +0200
From:	Javier Martinez Canillas <martinez.javier@...il.com>
To:	Luciano Coelho <coelho@...com>
Cc:	linux-wireless@...r.kernel.org, tony@...mide.com, nsekhar@...com,
	mturquette@...aro.org, mark.rutland@....com, balbi@...com,
	grant.likely@...aro.org, rob.herring@...xeda.com,
	devicetree-discuss@...ts.ozlabs.org, linux-doc@...r.kernel.org,
	linux-kernel@...r.kernel.org, linux-omap@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org, nm@...com
Subject: Re: [PATCH v3 2/8] wlcore: set irq_flags in the board files instead
 of hiding behind a quirk

On Wed, Jul 3, 2013 at 4:15 PM, Luciano Coelho <coelho@...com> wrote:
> On Wed, 2013-07-03 at 17:03 +0300, Luciano Coelho wrote:
>> The platform_quirk element in the platform data was used to change the
>> way the IRQ is triggered.  When set, the EDGE_IRQ quirk would change
>> the irqflags used and treat edge trigger differently from the rest.
>>
>> Instead of hiding this irq flag setting behind the quirk, have the
>> board files set the flags during initialization.  This will be more
>> meaningful than driver-specific quirks when we switch to DT.
>>
>> Additionally, fix missing gpio_request() calls in the boarding files
>> (so that setting the flags actually works).
>>
>> Cc: Tony Lindgren <tony@...mide.com>
>> Cc: Sekhar Nori <nsekhar@...com>
>> Signed-off-by: Luciano Coelho <coelho@...com>
>> ---
>
> [...]
>
>> @@ -5928,16 +5927,21 @@ static void wlcore_nvs_cb(const struct firmware *fw, void *context)
>>       wlcore_adjust_conf(wl);
>>
>>       wl->irq = platform_get_irq(pdev, 0);
>> -     wl->platform_quirks = pdata->platform_quirks;
>>       wl->if_ops = pdev_data->if_ops;
>>
>> -     if (wl->platform_quirks & WL12XX_PLATFORM_QUIRK_EDGE_IRQ)
>> -             irqflags = IRQF_TRIGGER_RISING;
>> -     else
>> -             irqflags = IRQF_TRIGGER_HIGH | IRQF_ONESHOT;
>> +     irq_data = irq_get_irq_data(wl->irq);
>> +     if (!irq_data) {
>> +             wl1271_error("couldn't get irq data for irq %d\n", wl->irq);
>> +             ret = -EINVAL;
>> +             goto out_free_nvs;
>> +     }
>> +
>> +     wl->irq_flags = irqd_get_trigger_type(irq_data);
>
> BTW, there seems to be a patch on its way to make reading the flags
> easier (ie. no need to get the irq_data first):
>
> http://mid.gmane.org/1367945288-5625-1-git-send-email-javier@dowhile0.org
>
> I'm not sure if this is going to be taken in, but if it does, it would
> be nice to change the code here to use the new irq_get_trigger_type()
> function.
>
> --
> Luca.
>

Hi Luca

That patch has been already merged in Linus tree as commit 1f6236bf
("genirq: Add irq_get_trigger_type() to get IRQ flags").

So yes, it would be better if you can use irq_get_trigger_type()
instead calling irq_get_irq_data() + irqd_get_trigger_type().

Best regards,
Javier
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ