public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Richard Weinberger <richard@nod.at>
To: Harald Geyer <harald@ccbib.org>
Cc: linus.walleij@linaro.org, linux-gpio@vger.kernel.org,
	javier.martinez@collabora.co.uk, acourbot@nvidia.com,
	swarren@nvidia.com, jic23@kernel.org, knaack.h@gmx.de,
	lars@metafoo.de, pmeerw@pmeerw.net, linux-iio@vger.kernel.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: iio: dht11 broken
Date: Mon, 01 Dec 2014 11:59:50 +0100	[thread overview]
Message-ID: <547C4A26.3070108@nod.at> (raw)
In-Reply-To: <E1XvOXs-00014Z-6F@stardust.g4.wien.funkfeuer.at>

Hi!

Am 01.12.2014 um 11:49 schrieb Harald Geyer:
> Hi Richard!
> 
> Richard Weinberger writes:
>> Staring with 3.12 gpiolib refuses to set an GPIO used as IRQ into output mode.
>> see commit d468bf9e (gpio: add API to be strict about GPIO IRQ usage)
>> The dht driver does this and is therefore not functional.
>> As the dht11 driver got merged in 3.13 there is a high chance that it
>> never worked.
> 
> Well, I'm developing on mxs and there it works on 3.13 and 3.14 at least.
> (I have it in production using 3.14.18 ATM.)
>  
>> Harald, are you aware of this issue?
> 
> I got one report about this issue, but couldn't reproduce it yet and
> the reporter didn't agree to quoting his messages to kernel mailing lists,
> so this has been rather low priority on my todo list. Next plan is to
> see if I can reproduce the issue on sunxi (A10).

Not all gpio drivers use the new IRQ lock stuff.

> However anybody able to reproduce this and willing to test patches, would
> of course push this up on my todo list.
> 
> Any input from gpiolib people about what the proper fix would be in
> their opinion, of course is appreciated. I don't think the dht11 driver
> is doing anything unreasonable per se, so maybe they can clarify how
> the API is intended to be used?

Your driver sets up a GPIO as IRQ and then you switch the mode to output
to enable the DHT sensor.
This is not an API issue, it is an design issue.
I'm not a hardware expert but AFAIK setting an IRQ pin into output mode can
lead to undefined behavior.

Thanks,
//richard

  reply	other threads:[~2014-12-01 11:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-30 16:23 iio: dht11 broken Richard Weinberger
2014-12-01 10:49 ` Harald Geyer
2014-12-01 10:59   ` Richard Weinberger [this message]
2014-12-01 14:08     ` Linus Walleij
2014-12-01 14:18       ` Richard Weinberger

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=547C4A26.3070108@nod.at \
    --to=richard@nod.at \
    --cc=acourbot@nvidia.com \
    --cc=harald@ccbib.org \
    --cc=javier.martinez@collabora.co.uk \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --cc=swarren@nvidia.com \
    /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