From: David Miller <davem@davemloft.net>
To: vaishali.thakkar@oracle.com
Cc: andrianov@ispras.ru, mugunthanvnm@ti.com, a@unstable.cc,
felipe.balbi@linux.intel.com, fw@strlen.de,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
ldv-project@linuxtesting.org
Subject: Re: [PATCH] smc91c92_cs : add a spinlock to avoid race condition
Date: Thu, 18 Aug 2016 23:00:55 -0700 (PDT) [thread overview]
Message-ID: <20160818.230055.1587442048794416891.davem@davemloft.net> (raw)
In-Reply-To: <57B68DFC.4070204@oracle.com>
From: Vaishali Thakkar <vaishali.thakkar@oracle.com>
Date: Fri, 19 Aug 2016 10:11:32 +0530
>
>
> On Friday 19 August 2016 09:37 AM, David Miller wrote:
>> From: Pavel Andrianov <andrianov@ispras.ru>
>> Date: Tue, 16 Aug 2016 16:39:06 +0300
>>
>>> smc_reset may be executed in parallel with timer function media_check.
>>> To avoid data race in smc_set_xcvr a spinlock was added.
>>>
>>> Found by Linux Driver Verification project (linuxtesting.org).
>>>
>>> Signed-off-by: Pavel Andrianov <andrianov@ispras.ru>
>>
>> This is not sufficient.
>>
>> You have to block basically the entire function, because both
>> smc_reset and media_check program the bank selection so could
>> corrupt eachother's register accesses.
>
> Hmm, but then there is a use of udelay as well. Would it be still
> fine to acquire a spinlock on whole function?
I don't know, but what I'm telling you is that you have to execute
register programming these two functions do atomically so that the
bank selection doesn't check get changed midstream.
prev parent reply other threads:[~2016-08-19 6:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-16 13:39 [PATCH] smc91c92_cs : add a spinlock to avoid race condition Pavel Andrianov
2016-08-19 4:07 ` David Miller
2016-08-19 4:41 ` Vaishali Thakkar
2016-08-19 6:00 ` David Miller [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=20160818.230055.1587442048794416891.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=a@unstable.cc \
--cc=andrianov@ispras.ru \
--cc=felipe.balbi@linux.intel.com \
--cc=fw@strlen.de \
--cc=ldv-project@linuxtesting.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mugunthanvnm@ti.com \
--cc=netdev@vger.kernel.org \
--cc=vaishali.thakkar@oracle.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).