From: Grant Likely <grant.likely@secretlab.ca>
To: Jeff Harris <jeff_harris@kentrox.com>
Cc: spi-devel-general@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] spi: Fix WARN when removing spi-fsl-spi module
Date: Fri, 23 Sep 2011 17:29:36 -0600 [thread overview]
Message-ID: <20110923232936.GI24631@ponder.secretlab.ca> (raw)
In-Reply-To: <1316792976-28498-1-git-send-email-jeff_harris@kentrox.com>
On Fri, Sep 23, 2011 at 11:49:36AM -0400, Jeff Harris wrote:
> If CPM mode is not used, the fsl_dummy_rx variable is never allocated. When
> the cleanup attempts to free it, the reference count is zero and a WARN is
> generated. The same CPM mode check used in the initialize is applied to the
> free as well.
>
> Tested on 2.6.33 with the previous spi_mpc8xxx driver. The renamed
> spi-fsl-spi driver looks to have the same problem.
>
> Signed-off-by: Jeff Harris <jeff_harris@kentrox.com>
Merged, thanks.
g.
> ---
> drivers/spi/spi-fsl-spi.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/spi/spi-fsl-spi.c b/drivers/spi/spi-fsl-spi.c
> index d240755..24cacff 100644
> --- a/drivers/spi/spi-fsl-spi.c
> +++ b/drivers/spi/spi-fsl-spi.c
> @@ -825,6 +825,9 @@ static void fsl_spi_cpm_free(struct mpc8xxx_spi *mspi)
> {
> struct device *dev = mspi->dev;
>
> + if (!(mspi->flags & SPI_CPM_MODE))
> + return;
> +
> dma_unmap_single(dev, mspi->dma_dummy_rx, SPI_MRBLR, DMA_FROM_DEVICE);
> dma_unmap_single(dev, mspi->dma_dummy_tx, PAGE_SIZE, DMA_TO_DEVICE);
> cpm_muram_free(cpm_muram_offset(mspi->tx_bd));
> --
> 1.7.0.5
>
prev parent reply other threads:[~2011-09-23 23:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-23 15:49 [PATCH] spi: Fix WARN when removing spi-fsl-spi module Jeff Harris
2011-09-23 23:29 ` Grant Likely [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=20110923232936.GI24631@ponder.secretlab.ca \
--to=grant.likely@secretlab.ca \
--cc=jeff_harris@kentrox.com \
--cc=linux-kernel@vger.kernel.org \
--cc=spi-devel-general@lists.sourceforge.net \
/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).