From: Alexander Stein <alexander.stein@systec-electronic.com>
To: Han Xu <xhnjupt@gmail.com>
Cc: Cory Tusar <cory.tusar@pid1solutions.com>,
"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
Brian Norris <computersforpeace@gmail.com>,
David Woodhouse <dwmw2@infradead.org>,
Han Xu <han.xu@freescale.com>
Subject: Re: [PATCH 1/1] mtd: fsl-quadspi: Add mutex for accessing different SPI-NOR devices
Date: Thu, 23 Jul 2015 17:41:34 +0200 [thread overview]
Message-ID: <2755588.WRnIZEyBVY@ws-stein> (raw)
In-Reply-To: <CA+EcR22gNx4J_tiZ8kfO2uybKn=jWByhZW7mz=vATQjV2pVypg@mail.gmail.com>
Hi Han,
On Thursday 23 July 2015 10:31:05, Han Xu wrote:
> I think it is the same patch
>
> http://patchwork.ozlabs.org/patch/429631/
Yep. They are more or less the same. I didn't know about this.
I lack the include though, which seems the right thing to do.
But I see a problem in your case:
> @@ -751,6 +753,8 @@ static int fsl_qspi_prep(struct spi_nor *nor, enum
spi_nor_ops ops)
> struct fsl_qspi *q = nor->priv;
> int ret;
>
> + mutex_lock(&q->lock);
> +
> ret = clk_enable(q->clk_en);
> if (ret)
> return ret;
I see a problem here. If one of those clk_enable fails, you return with the
mutex still being locked. That's why I lock/unlock the mutex the last/first in
prepare/unprepare.
Best regards,
Alexander
--
Dipl.-Inf. Alexander Stein
SYS TEC electronic GmbH
alexander.stein@systec-electronic.com
Legal and Commercial Address:
Am Windrad 2
08468 Heinsdorfergrund
Germany
Office: +49 (0) 3765 38600-0
Fax: +49 (0) 3765 38600-4100
Managing Directors:
Director Technology/CEO: Dipl.-Phys. Siegmar Schmidt;
Director Commercial Affairs/COO: Dipl. Ing. (FH) Armin von Collrepp
Commercial Registry:
Amtsgericht Chemnitz, HRB 28082; USt.-Id Nr. DE150534010
next prev parent reply other threads:[~2015-07-23 15:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-16 14:13 [PATCH 1/1] mtd: fsl-quadspi: Add mutex for accessing different SPI-NOR devices Alexander Stein
2015-07-16 17:29 ` Cory Tusar
2015-07-20 6:50 ` Alexander Stein
2015-07-23 15:31 ` Han Xu
2015-07-23 15:41 ` Alexander Stein [this message]
2015-07-23 15:48 ` Han Xu
2015-07-23 16:00 ` Alexander Stein
2015-07-24 20:05 ` Brian Norris
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=2755588.WRnIZEyBVY@ws-stein \
--to=alexander.stein@systec-electronic.com \
--cc=computersforpeace@gmail.com \
--cc=cory.tusar@pid1solutions.com \
--cc=dwmw2@infradead.org \
--cc=han.xu@freescale.com \
--cc=linux-mtd@lists.infradead.org \
--cc=xhnjupt@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