All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gregory CLEMENT <gregory.clement@bootlin.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Kamel BOUHARA <kamel.bouhara@bootlin.com>
Cc: Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Henrik Rydberg <rydberg@bitmath.org>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org,
	Marco Felsch <m.felsch@pengutronix.de>,
	Jeff LaBundy <jeff@labundy.com>,
	catalin.popescu@leica-geosystems.com,
	mark.satterthwaite@touchnetix.com,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	bsp-development.geo@leica-geosystems.com
Subject: Re: [PATCH v13 3/3] Input: Add TouchNetix axiom i2c touchscreen driver
Date: Fri, 07 Jun 2024 09:23:36 +0200	[thread overview]
Message-ID: <87bk4dfc7b.fsf@BLaptop.bootlin.com> (raw)
In-Reply-To: <ZmIq9jmkZtEaGw19@google.com>

Hello Dmitry,

> On Wed, Jun 05, 2024 at 03:48:20PM +0200, Kamel BOUHARA wrote:
>> [...]
>> 
>> > > > +
>> > > > +	error = devm_request_threaded_irq(dev, client->irq, NULL,
>> > > > +					  axiom_irq, IRQF_ONESHOT, dev_name(dev), ts);
>> > > > +	if (error) {
>> > > > +		dev_info(dev, "Request irq failed, falling back to polling mode");
>> > > 
>> > > I do not think you should fall back to polling mode if you fail to get
>> > > interrupt. If it was not specified (client->irq) then I can see that
>> > > we
>> > > might want to fall back, but if the system configured for using
>> > > interrupt and you can not get it you should bail out.
>> > > 
>> > 
>> > Yes, clear, the polling mode can be decorrelated to the irq not provided
>> > case.
>> 
>> Just to make sure I understood, is this what you propose ?
>> 
>> if (client->irq) {
>>         error = devm_request_threaded_irq(...)
>>         if (error) {
>> 		dev_warn(dev, "failed to request IRQ\n");
>> 		client->irq = 0;
>>          }
>> }
>> 
>> if(!client->irq) {
>>     // setup polling stuff
>>     ...
>> }
>
> No, if you fail to acquire interrupt that was described in ACPI/DT it
> should be treated as an error, like this:
>
> 	if (client->irq) {
> 		error = devm_request_threaded_irq(...)
> 		if (error)
> 			return dev_err_probe(...);
> 	} else {
> 		.. set up polling ..
> 	}
>
> This also makes sure that if interrupt controller is not ready and
> requests probe deferral we will not end up with device in polling
> mode.

In the case of probe deferral, I see the benefit of treating it as an
error. However, in the other case, I find it better to fall back to
polling mode with a big error message than just exiting in error. As a
user, I think we prefer having a degraded feature over not having the
feature at all.

So what about something like:

	if (client->irq) {
		error = devm_request_threaded_irq(...)
		if (error == -EPROBE_DEFER)
			return dev_err_probe(...);
		dev_warn("Big error message");
                client->irq = 0;
	}
	if (!client->irq) {
		.. set up polling ..
	}

Gregory

>
> Thanks.
>
> -- 
> Dmitry

  reply	other threads:[~2024-06-07  7:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-03 15:39 [PATCH v13 0/3] Input: Add TouchNetix axiom touchscreen driver Kamel Bouhara
2024-06-03 15:39 ` [PATCH v13 1/3] dt-bindings: vendor-prefixes: Add TouchNetix AS Kamel Bouhara
2024-06-03 15:39 ` [PATCH v13 2/3] dt-bindings: input: Add TouchNetix axiom touchscreen Kamel Bouhara
2024-06-03 15:39 ` [PATCH v13 3/3] Input: Add TouchNetix axiom i2c touchscreen driver Kamel Bouhara
2024-06-04  0:02   ` Dmitry Torokhov
2024-06-05 12:47     ` Kamel Bouhara
2024-06-05 13:48       ` Kamel BOUHARA
2024-06-06 21:32         ` Dmitry Torokhov
2024-06-07  7:23           ` Gregory CLEMENT [this message]
2024-06-07 17:05             ` Dmitry Torokhov
2024-06-14 16:02           ` Kamel BOUHARA

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=87bk4dfc7b.fsf@BLaptop.bootlin.com \
    --to=gregory.clement@bootlin.com \
    --cc=bsp-development.geo@leica-geosystems.com \
    --cc=catalin.popescu@leica-geosystems.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jeff@labundy.com \
    --cc=kamel.bouhara@bootlin.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.felsch@pengutronix.de \
    --cc=mark.satterthwaite@touchnetix.com \
    --cc=robh+dt@kernel.org \
    --cc=rydberg@bitmath.org \
    --cc=thomas.petazzoni@bootlin.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.