From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Yoshihiro Kaneko <ykaneko0929@gmail.com>, linux-mmc@vger.kernel.org
Cc: Chris Ball <chris@printf.net>,
Ulf Hansson <ulf.hansson@linaro.org>,
Simon Horman <horms@verge.net.au>,
Magnus Damm <magnus.damm@gmail.com>,
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
linux-sh@vger.kernel.org
Subject: Re: [PATCH/RFC] mmc: sh_mmcif: Add exclusion between cmd and interrupt
Date: Sun, 15 Feb 2015 19:02:07 +0300 [thread overview]
Message-ID: <54E0C2FF.3040401@cogentembedded.com> (raw)
In-Reply-To: <1424011607-3682-1-git-send-email-ykaneko0929@gmail.com>
Hello.
On 02/15/2015 05:46 PM, Yoshihiro Kaneko wrote:
> From: Kouichi Tomita <kouichi.tomita.yn@renesas.com>
> A command end interrupt should not be processed between command issue
> and setting of wait_for flag. It expects already the flag to be set.
> Therefore the exclusive control was added.
> Signed-off-by: Kouichi Tomita <kouichi.tomita.yn@renesas.com>
> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
> ---
> This patch is based on next branch of Chris Ball's mmc tree.
> drivers/mmc/host/sh_mmcif.c | 11 ++++++++++-
> 1 file changed, 10 insertions(+), 1 deletion(-)
> diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
> index 7d9d6a3..e5d0b42 100644
> --- a/drivers/mmc/host/sh_mmcif.c
> +++ b/drivers/mmc/host/sh_mmcif.c
[...]
> @@ -1171,6 +1174,12 @@ static irqreturn_t sh_mmcif_irqt(int irq, void *dev_id)
> struct sh_mmcif_host *host = dev_id;
> struct mmc_request *mrq;
> bool wait = false;
> + unsigned long flags;
> + int wait_work;
> +
> + spin_lock_irqsave(&host->lock, flags);
> + wait_work = host->wait_for;
> + spin_unlock_irqrestore(&host->lock, flags);
Locking don't seem to have much sense here, as the read is already atomic.
WBR, Sergei
WARNING: multiple messages have this Message-ID (diff)
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Yoshihiro Kaneko <ykaneko0929@gmail.com>, linux-mmc@vger.kernel.org
Cc: Chris Ball <chris@printf.net>,
Ulf Hansson <ulf.hansson@linaro.org>,
Simon Horman <horms@verge.net.au>,
Magnus Damm <magnus.damm@gmail.com>,
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
linux-sh@vger.kernel.org
Subject: Re: [PATCH/RFC] mmc: sh_mmcif: Add exclusion between cmd and interrupt
Date: Sun, 15 Feb 2015 16:02:07 +0000 [thread overview]
Message-ID: <54E0C2FF.3040401@cogentembedded.com> (raw)
In-Reply-To: <1424011607-3682-1-git-send-email-ykaneko0929@gmail.com>
Hello.
On 02/15/2015 05:46 PM, Yoshihiro Kaneko wrote:
> From: Kouichi Tomita <kouichi.tomita.yn@renesas.com>
> A command end interrupt should not be processed between command issue
> and setting of wait_for flag. It expects already the flag to be set.
> Therefore the exclusive control was added.
> Signed-off-by: Kouichi Tomita <kouichi.tomita.yn@renesas.com>
> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
> ---
> This patch is based on next branch of Chris Ball's mmc tree.
> drivers/mmc/host/sh_mmcif.c | 11 ++++++++++-
> 1 file changed, 10 insertions(+), 1 deletion(-)
> diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
> index 7d9d6a3..e5d0b42 100644
> --- a/drivers/mmc/host/sh_mmcif.c
> +++ b/drivers/mmc/host/sh_mmcif.c
[...]
> @@ -1171,6 +1174,12 @@ static irqreturn_t sh_mmcif_irqt(int irq, void *dev_id)
> struct sh_mmcif_host *host = dev_id;
> struct mmc_request *mrq;
> bool wait = false;
> + unsigned long flags;
> + int wait_work;
> +
> + spin_lock_irqsave(&host->lock, flags);
> + wait_work = host->wait_for;
> + spin_unlock_irqrestore(&host->lock, flags);
Locking don't seem to have much sense here, as the read is already atomic.
WBR, Sergei
next prev parent reply other threads:[~2015-02-15 16:02 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-15 14:46 [PATCH/RFC] mmc: sh_mmcif: Add exclusion between cmd and interrupt Yoshihiro Kaneko
2015-02-15 14:46 ` Yoshihiro Kaneko
2015-02-15 16:02 ` Sergei Shtylyov [this message]
2015-02-15 16:02 ` Sergei Shtylyov
2015-02-25 13:21 ` Yoshihiro Kaneko
2015-02-25 13:21 ` Yoshihiro Kaneko
2015-03-02 0:22 ` Simon Horman
2015-03-02 0:22 ` Simon Horman
2015-03-05 14:54 ` Ulf Hansson
2015-03-05 14:54 ` Ulf Hansson
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=54E0C2FF.3040401@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=chris@printf.net \
--cc=horms@verge.net.au \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=ulf.hansson@linaro.org \
--cc=ykaneko0929@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 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.