From: Nam Cao <namcaov@gmail.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: forest@alittletooquiet.net, philipp.g.hortmann@gmail.com,
linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev
Subject: Re: [PATCH] staging: vt6655: replace spin_lock_irqsave with spin_lock
Date: Thu, 15 Sep 2022 19:14:10 +0200 [thread overview]
Message-ID: <CA+sZ8B8ogeKhNwvLtj3hSkTUg8AED45unEYP7GCGYuLq8Do8vg@mail.gmail.com> (raw)
In-Reply-To: <YyLmEpJBG7fPZ8iN@kroah.com>
On Thu, Sep 15, 2022 at 10:44 AM Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Wed, Sep 14, 2022 at 10:00:17AM +0200, Nam Cao wrote:
> > In vt6655 driver, there is a single interrupt handler: vnt_interrupt(),
> > and it does not take the spinlock. The interrupt handler only schedules
> > a workqueue, and the spinlock is taken in this workqueue. Thus, there is
> > no need to use spin_lock_irqsave, as the spinlock is never taken by an
> > interrupt. Replace spin_lock_irqsave (and spin_unlock_irqsave) with
> > spin_lock (and spin_unlock).
>
> What is the speed difference before and after this change? And how are
> interrupts properly handled anymore in this driver if you took away the
> lock that was being accessed in the irq?
My understanding is that no lock is accessed in the irq in this driver. But
it seems like I am wrong. Sorry for sending a buggy patch, I may follow-up with
this later when I figure out what I did wrong.
Best regards,
Nam.
prev parent reply other threads:[~2022-09-15 17:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-14 8:00 [PATCH] staging: vt6655: replace spin_lock_irqsave with spin_lock Nam Cao
2022-09-14 18:55 ` Philipp Hortmann
2022-09-15 17:10 ` Nam Cao
2022-09-15 8:45 ` Greg KH
2022-09-15 17:14 ` Nam Cao [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=CA+sZ8B8ogeKhNwvLtj3hSkTUg8AED45unEYP7GCGYuLq8Do8vg@mail.gmail.com \
--to=namcaov@gmail.com \
--cc=forest@alittletooquiet.net \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=philipp.g.hortmann@gmail.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;
as well as URLs for NNTP newsgroup(s).