From: anarsoul@gmail.com (Vasily Khoruzhick)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] pxa2xx_spi: Fix race condition in stop_queue()
Date: Fri, 1 Apr 2011 13:03:59 +0300 [thread overview]
Message-ID: <201104011303.59668.anarsoul@gmail.com> (raw)
In-Reply-To: <AANLkTikyrfYn02yg3S9_4vBGfon+BNHbPiQkaHaq_Xaq@mail.gmail.com>
On Friday 01 April 2011 10:26:37 Eric Miao wrote:
> On Mon, Mar 14, 2011 at 6:27 AM, Vasily Khoruzhick <anarsoul@gmail.com>
wrote:
> > There's a race condition in stop_queue(),
> > if drv_data->queue is empty, but drv_data->busy is still set
> > (or opposite situation) stop_queue will return -EBUSY.
> > So fix loop condition to check that both drv_data->queue is empty
> > and drv_data->busy is not set.
>
> I think this is a good catch if the queue could be stopped only when
> 1) queue is empty AND 2) transfer is not in progress.
It has check later (under while):
if (!list_empty(&drv_data->queue) || drv_data->busy)
status = -EBUSY;
And I'm hitting it on Z2 when I'm trying to enter suspend - it fails, because
spi driver refuses to enter suspend.
> There are several other places you might need to change accordingly,
> e.g. spi_bfin5xx.c
I can make a patch for other drivers, but I can't test it - I have no
appropriate boards, and even toolchain.
Regards
Vasily
next prev parent reply other threads:[~2011-04-01 10:03 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-13 22:27 [PATCH] pxa2xx_spi: Fix race condition in stop_queue() Vasily Khoruzhick
2011-03-31 21:02 ` Vasily Khoruzhick
2011-04-01 7:26 ` Eric Miao
2011-04-01 10:03 ` Vasily Khoruzhick [this message]
2011-04-04 17:35 ` Mike Frysinger
2011-04-04 17:47 ` Vasily Khoruzhick
2011-04-05 3:21 ` Eric Miao
2011-04-06 14:46 ` Vasily Khoruzhick
[not found] ` <201104061746.44134.anarsoul-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2011-04-06 14:49 ` [PATCH] spi: " Vasily Khoruzhick
2011-04-06 14:49 ` Vasily Khoruzhick
[not found] ` <1302101355-31187-1-git-send-email-anarsoul-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2011-04-07 6:01 ` Eric Miao
2011-04-07 6:01 ` Eric Miao
2011-04-07 6:12 ` Mike Frysinger
2011-04-07 6:12 ` Mike Frysinger
2011-04-07 18:18 ` Grant Likely
2011-04-07 18:18 ` Grant Likely
2011-04-07 4:58 ` [PATCH] pxa2xx_spi: " Mike Frysinger
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=201104011303.59668.anarsoul@gmail.com \
--to=anarsoul@gmail.com \
--cc=linux-arm-kernel@lists.infradead.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.