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] [day] [month] [year] [list]
Date:	Thu, 06 Dec 2012 08:28:02 +0100
From:	Wolfgang Grandegger <wg@...ndegger.com>
To:	Roland Stigge <stigge@...com.de>
CC:	gregkh@...uxfoundation.org, grant.likely@...retlab.ca,
	linus.walleij@...aro.org, linux-kernel@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org, w.sang@...gutronix.de,
	jbe@...gutronix.de, plagnioj@...osoft.com, highguy@...il.com,
	broonie@...nsource.wolfsonmicro.com, daniel-gl@....net,
	rmallon@...il.com, tru@...k-microwave.de, sr@...x.de
Subject: Re: [PATCH 3/6 v9] gpio: Add userland device interface to block GPIO

On 12/05/2012 11:20 PM, Roland Stigge wrote:
> Hi Wolfgang,
> 
> On 05/12/12 20:01, Wolfgang Grandegger wrote:
>>> +	for (i = 0; i < block->ngpio; i++) {
>>> +		status = gpio_request(block->gpio[i], "gpioblock dev");
>>
>> You could use the name of the GPIO block.
> 
> OK.
> 
>>> +		if (status)
>>> +			goto err1;
>>> +
>>> +		irq = gpio_to_irq(block->gpio[i]);
>>> +		if (irq >= 0 &&
>>> +		    !test_bit(FLAG_IS_OUT, &gpio_desc[block->gpio[i]].flags) &&
>>> +		    !gpio_block_is_irq_duplicate(block, i)) {
>>> +			status = request_irq(irq, gpio_block_irq_handler,
>>> +					     IRQF_TRIGGER_FALLING,
>>> +					     block->name, block);
>>> +			if (status)
>>> +				goto err2;
>>> +
>>> +			block->irq_controlled = true;
>>> +		}
>>> +	}
>>
>> There is no need to request IRQs if "O_NONBLOCK" is specified.
> 
> Sure? Regarding this, I found: "The poll() function shall not be
> affected by the O_NONBLOCK flag." [1]

Ah, didn't know that.

>> I observed that the read returns once immediately (without blocking)
>> after reboot. I did not look into that yet.
> 
> Didn't happen to me. Can you tell how this can be reproduced?

I think there is an interrupt pending for some reason. It might not be
the case with your setup.

Feel free to add my:

"Tested by: Wolfgang Grandegger <wg@...ndegger.com>".

Will do some more tests when time permits, especially with mixed GPIO
input and output.

Wolfgang.

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