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-next>] [day] [month] [year] [list]
Date:	Mon, 27 Jan 2014 15:01:12 +0800
From:	Barry Song <21cnbao@...il.com>
To:	Linus Walleij <linus.walleij@...aro.org>,
	LKML <linux-kernel@...r.kernel.org>, linux-gpio@...r.kernel.org,
	Binghua Duan <Binghua.Duan@....com>
Cc:	Rongjun Ying <rongjun.ying@....com>, guoying.zhang@....com,
	DL-SHA-WorkGroupLinux <workgroup.linux@....com>
Subject: Re: [PATCH] pinctrl: sirf: lock IRQs when starting them

2014-01-16 Barry Song <21cnbao@...il.com>:
>
>> From: Linus Walleij [linus.walleij@...aro.org]
>> Sent: Wednesday, January 15, 2014 17:10
>> To: linux-kernel@...r.kernel.org; Barry Song
>> Cc: linux-gpio@...r.kernel.org; Linus Walleij
>> Subject: [PATCH] pinctrl: sirf: lock IRQs when starting them
>>
>> This uses the new API for tagging GPIO lines as in use by
>> IRQs. This enforces a few semantic checks on how the underlying
>> GPIO line is used.
>>
>> Also assign the gpio_chip.dev pointer to be used for error
>> messages.
>>
>> Cc: Barry Song <Baohua.Song@....com>
>> Signed-off-by: Linus Walleij <linus.walleij@...aro.org>

Hi Linus,
i read the patch "gpio: add API to be strict about GPIO IRQ usage"
again, it seems by checking if (test_bit(FLAG_USED_AS_IRQ,
&desc->flags)), we do be able to stop users setting irqline to output.
but my concern is actually that: when users use request_irq to get the
irq line from gpio, in that case, gpio_request() probably will not be
called at all, who will fix the availability of this pin if it is
muxed with other functionality except gpio?

for example, in case pin0 can be gpio0 and spi0, if we
request_irq(gpio0) without calling gpio_request(gpio0), and the other
people can still request the pin0 for spi0 since we didn't mark the
pin was used by irq or gpio yet.

but if gpio_request() is called, in it, pinctrl_request_gpio() is
called as well, which will mark the pin as not-free. so do you think
we need to call pinctrl_request_gpio() in startup() of irqline as
well? but this might be buggy again since people might call
gpio_request() before calling request_irq().

>
>> ---
>>  drivers/pinctrl/sirf/pinctrl-sirf.c | 23 +++++++++++++++++++++++
>>  1 file changed, 23 insertions(+)
>>

-barry
--
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