From: Lourdes Pedrajas <lu@pplo.net>
To: Stefano Brivio <sbrivio@redhat.com>
Cc: outreachy-kernel@googlegroups.com, gregkh@linuxfoundation.org,
matthias.bgg@gmail.com
Subject: Re: [Outreachy kernel] [PATCH] staging: mt7621-dma: mtk-hsdma: make a variable non-volatile
Date: Thu, 12 Mar 2020 20:43:29 +0100 [thread overview]
Message-ID: <20200312194329.GC6485@supernova> (raw)
In-Reply-To: <20200312133112.4f61c60b@elisabeth>
On Thu, Mar 12, 2020 at 01:29:52PM +0100, Greg KH wrote:
> On Thu, Mar 12, 2020 at 01:15:48PM +0100, Lourdes Pedrajas wrote:
> > Change variable declaration volatile unsigned long chan_issued to
> > unsigned long chan_issued
>
> Are you sure this is correct? Usually a change like this also requires
> some kind of lock somewhere to ensure things work properly (not that it
> is not working properly today...)
>
> But it's not always as simple as just removing 'volatile', otherwise
> that would have been done already.
>
> Please do more work to determine if this is a safe change or not and
> write it all up in the changelog.
>
> thanks,
>
> greg k-h
On Thu, Mar 12, 2020 at 01:31:12PM +0100, Stefano Brivio wrote:
> On Thu, 12 Mar 2020 13:15:48 +0100
> Lourdes Pedrajas <lu@pplo.net> wrote:
>
> > Change variable declaration volatile unsigned long chan_issued to
> > unsigned long chan_issued
> >
> > Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst
>
> This needs some more details. From that same guide:
>
> Patches to remove volatile variables are generally welcome - as
> long as they come with a justification which shows that the
> concurrency issues have been properly thought through.
>
> so, here you need to investigate what that "volatile" was supposed to
> achieve, if it is achieved by other means, if some form of locking is
> needed instead, if we end up in one of the "exception" cases also
> listed in that guide.
>
> --
> Stefano
>
Indeed, both of you are right. Thank you for pointing me in the right
direction! However, as someone who is new in programming, I find I lack the
knowledge needed to tackle concurrency and locks. Nevertheless, I will do some
research to learn a bit to see if it can be done in a reasonable amount of
time. Sorry :(
Lourdes
next prev parent reply other threads:[~2020-03-12 19:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-12 12:15 [PATCH] staging: mt7621-dma: mtk-hsdma: make a variable non-volatile Lourdes Pedrajas
2020-03-12 12:29 ` Greg KH
2020-03-12 12:31 ` [Outreachy kernel] " Stefano Brivio
2020-03-12 19:43 ` Lourdes Pedrajas [this message]
2020-03-12 20:43 ` Greg KH
2020-03-12 20:57 ` Lourdes Pedrajas
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=20200312194329.GC6485@supernova \
--to=lu@pplo.net \
--cc=gregkh@linuxfoundation.org \
--cc=matthias.bgg@gmail.com \
--cc=outreachy-kernel@googlegroups.com \
--cc=sbrivio@redhat.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.