From: Guenter Roeck <linux@roeck-us.net>
To: Thomas Abraham <thomas.abraham@linaro.org>
Cc: spi-devel-general@lists.sourceforge.net,
linux-samsung-soc@vger.kernel.org,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
Grant Likely <grant.likely@secretlab.ca>,
Ben Dooks <ben-linux@fluff.org>,
Kukjin Kim <kgene.kim@samsung.com>
Subject: Re: Unbalanced calls to spi_master_get in coldfire-qspi and s3c64xx SPI master drivers
Date: Thu, 16 Aug 2012 06:48:15 -0700 [thread overview]
Message-ID: <20120816134815.GA15977@roeck-us.net> (raw)
In-Reply-To: <CAJuYYwRKVOh91xmeD=FpShzJskwv5LhioUG88F=9vMysOBq4Kw@mail.gmail.com>
On Thu, Aug 16, 2012 at 02:27:49PM +0530, Thomas Abraham wrote:
> On 14 August 2012 03:14, Guenter Roeck <linux@roeck-us.net> wrote:
> > Hi all,
> >
> > looking through SPI master drivers, I noticed that the following drivers call
> > spi_master_get() in their suspend and resume functions. Yet, there is no
> > matching call to spi_master_put(), meaning the reference count will increase
> > with each suspend/resume cycle.
> > spi-coldfire-qspi.c
> > spi-s3c64xx.c
> > Other SPI master drivers also support suspend and resume, but do not call
> > spi_master_get() in the suspend/resume functions. The spi-pl022 driver calls
> > spi_master_suspend() and spi_master_resume() like the above, but does not
> > call spi_master_get() either.
> >
> > This leads me to believe that the above drivers will hang on unload after a
> > suspend/resume cycle due to the extra references.
> >
> > Can someone please have a look and confirm if my understanding is correct ?
> > If so I'll send a set of patches to fix the problems.
>
> For spi-s3c64xx.c, yes it does seem that the spi_master_get() and
> spi_master_put() calls are not balanced. The probable change could be
>
> - struct spi_master *master = spi_master_get(dev_get_drvdata(dev));
> + struct spi_master *master = dev_get_drvdata(dev);
>
Yes, that is what I thought.
Thanks,
Guenter
prev parent reply other threads:[~2012-08-16 13:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-13 21:44 Unbalanced calls to spi_master_get in coldfire-qspi and s3c64xx SPI master drivers Guenter Roeck
2012-08-16 8:57 ` Thomas Abraham
2012-08-16 13:48 ` Guenter Roeck [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=20120816134815.GA15977@roeck-us.net \
--to=linux@roeck-us.net \
--cc=ben-linux@fluff.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=grant.likely@secretlab.ca \
--cc=kgene.kim@samsung.com \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=spi-devel-general@lists.sourceforge.net \
--cc=thomas.abraham@linaro.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 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).