From: Rahul Rameshbabu <rrameshbabu@nvidia.com>
To: Jiri Kosina <jikos@kernel.org>
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/1] HID: shield: Initial driver implementation with Thunderstrike support
Date: Fri, 14 Apr 2023 00:09:32 -0700 [thread overview]
Message-ID: <87a5zbhrdf.fsf@nvidia.com> (raw)
In-Reply-To: <nycvar.YFH.7.76.2304131705350.29760@cbobk.fhfr.pm> (Jiri Kosina's message of "Thu, 13 Apr 2023 17:07:00 +0200 (CEST)")
Hi Jiri,
Thanks for the feedback.
On Thu, 13 Apr, 2023 17:07:00 +0200 Jiri Kosina <jikos@kernel.org> wrote:
> On Mon, 10 Apr 2023, Rahul Rameshbabu wrote:
>
>> Supports the Thunderstrike (SHIELD 2017) controller. Implements support for
>> the Thunderstrike HOSTCMD firmware interface. Adds sysfs attributes about a
>> SHIELD device and introduces haptics support for controllers.
>>
>> Signed-off-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
>
> Thanks a lot for submitting the driver. I have one minor question:
>
> [ ... snip ... ]
>> +thunderstrike_update_haptics(struct thunderstrike *ts,
>> + struct thunderstrike_hostcmd_haptics *motors)
>> +{
>> + unsigned long flags;
>> +
>> + spin_lock_irqsave(&ts->haptics_update_lock, flags);
>> + ts->haptics_val = *motors;
>> + spin_unlock_irqrestore(&ts->haptics_update_lock, flags);
>
> Do we really have to disable interrupts when taking haptics_update_lock?
> Is it ever being taken from interrupt context?
The reason why I disable interrupts is because I call
thunderstrike_update_haptics from the play_effect callback I pass to
input_ff_create_memless. From there, it is used in ml_effect_timer
drivers/input/ff-memless.c, which is a timer interrupt context so we
should disable interrupts when taking haptics_update_lock.
static void ml_effect_timer(struct timer_list *t)
{
struct ml_device *ml = from_timer(ml, t, timer);
struct input_dev *dev = ml->dev;
unsigned long flags;
pr_debug("timer: updating effects\n");
spin_lock_irqsave(&dev->event_lock, flags);
ml_play_effects(ml);
spin_unlock_irqrestore(&dev->event_lock, flags);
}
Let me know if this seems off.
>
> Thanks,
-- Rahul Rameshbabu
next prev parent reply other threads:[~2023-04-14 7:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-10 17:08 [PATCH v2 0/1] HID: shield Rahul Rameshbabu
2023-04-10 17:08 ` [PATCH v2 1/1] HID: shield: Initial driver implementation with Thunderstrike support Rahul Rameshbabu
2023-04-13 15:07 ` Jiri Kosina
2023-04-14 7:09 ` Rahul Rameshbabu [this message]
2023-04-14 14:12 ` Jiri Kosina
2023-04-13 15:16 ` Benjamin Tissoires
2023-04-14 6:47 ` Rahul Rameshbabu
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=87a5zbhrdf.fsf@nvidia.com \
--to=rrameshbabu@nvidia.com \
--cc=benjamin.tissoires@redhat.com \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@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 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.