public inbox for linux-input@vger.kernel.org
 help / color / mirror / Atom feed
From: Armin Wolf <W_Armin@gmx.de>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: o2g.org.ru@gmail.com, hdegoede@redhat.com,
	ilpo.jarvinen@linux.intel.com, corentin.chary@gmail.com,
	luke@ljones.dev, mjg59@srcf.ucam.org, pali@kernel.org,
	eric.piel@tremplin-utc.net, jlee@suse.com,
	kenneth.t.chan@gmail.com, coproscefalo@gmail.com,
	linux-input@vger.kernel.org, platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org, josh@joshuagrisham.com
Subject: Re: [PATCH] Input: i8042 - Add support for platform filter contexts
Date: Tue, 17 Dec 2024 01:43:36 +0100	[thread overview]
Message-ID: <07920e80-831e-4e2c-932e-9a5a8fe2bd3f@gmx.de> (raw)
In-Reply-To: <Z2BhjwkkysKsmhVT@google.com>

Am 16.12.24 um 18:21 schrieb Dmitry Torokhov:

> Hi Armin,
>
> On Mon, Dec 16, 2024 at 12:36:28AM +0100, Armin Wolf wrote:
>> Currently the platform filter cannot access any driver-specific state
>> which forces drivers installing a i8042 filter to have at least some
>> kind of global pointer for their filter.
>>
>> This however might cause issues should such a driver probe multiple
>> devices. Fix this by allowing callers of i8042_install_filter() to
>> submit a context pointer which is then passed to the i8042 filter.
> Right now i8042 supports only one instance of a filter, so the driver
> probing several devices will have to sort out the ownership of the
> filter anyways.
>
> Unless you plan on supporting multiple filters I do not see the need of
> storing the context in i8042. And if you decide to add support for
> multiple filters I would need to better understand the use case.
>
> Thanks.
>
I am well aware that the i8042 driver currently supports only a single platform filter.

The reason for introducing a context pointer is that otherwise drivers registering a i8042 filter
would need to provide such a global pointer for their filter themself, together with the necessary
locking since those driver can (theoretically) be instantiated multiple times.

With this patch the i8042 driver takes care of that so those driver can finally get rid of global
data structures which will break as soon as the driver is instantiated multiple times.

Additionally this new API will allow us to add support for multiple handlers later should the need
arise.

Thanks,
Armin Wolf


      reply	other threads:[~2024-12-17  0:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-15 23:36 [PATCH] Input: i8042 - Add support for platform filter contexts Armin Wolf
2024-12-16 15:37 ` Ilpo Järvinen
2024-12-16 17:21 ` Dmitry Torokhov
2024-12-17  0:43   ` Armin Wolf [this message]

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=07920e80-831e-4e2c-932e-9a5a8fe2bd3f@gmx.de \
    --to=w_armin@gmx.de \
    --cc=coproscefalo@gmail.com \
    --cc=corentin.chary@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=eric.piel@tremplin-utc.net \
    --cc=hdegoede@redhat.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jlee@suse.com \
    --cc=josh@joshuagrisham.com \
    --cc=kenneth.t.chan@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luke@ljones.dev \
    --cc=mjg59@srcf.ucam.org \
    --cc=o2g.org.ru@gmail.com \
    --cc=pali@kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    /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