From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ig0-f180.google.com ([209.85.213.180]:32998 "EHLO mail-ig0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751992AbcCAQ7C (ORCPT ); Tue, 1 Mar 2016 11:59:02 -0500 Date: Tue, 1 Mar 2016 10:58:45 -0600 From: Michael Welling To: gregkh@linuxfoundation.org Cc: broonie@kernel.org, joe@iachieved.it, stable@vger.kernel.org, stable-commits@vger.kernel.org Subject: Re: Patch "spi: omap2-mcspi: Prevent duplicate gpio_request" has been added to the 4.4-stable tree Message-ID: <20160301165845.GA10446@deathstar> References: <145681421486243@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <145681421486243@kroah.com> Sender: stable-owner@vger.kernel.org List-ID: On Tue, Mar 01, 2016 at 08:15:27AM +0000, gregkh@linuxfoundation.org wrote: > > This is a note to let you know that I've just added the patch titled > > spi: omap2-mcspi: Prevent duplicate gpio_request > > to the 4.4-stable tree which can be found at: > http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary > Thanks Greg. > The filename of the patch is: > spi-omap2-mcspi-prevent-duplicate-gpio_request.patch > and it can be found in the queue-4.4 subdirectory. > > If you, or anyone else, feels it should not be added to the stable tree, > please let know about it. > > > From 2f538c017e1a8620d19553931199c6d6a6d31bb2 Mon Sep 17 00:00:00 2001 > From: Michael Welling > Date: Mon, 30 Nov 2015 09:02:39 -0600 > Subject: spi: omap2-mcspi: Prevent duplicate gpio_request > > From: Michael Welling > > commit 2f538c017e1a8620d19553931199c6d6a6d31bb2 upstream. > > Occasionally the setup function will be called multiple times. Only request > the gpio the first time otherwise -EBUSY will occur on subsequent calls to > setup. > > Reported-by: Joseph Bell > > Signed-off-by: Michael Welling > Signed-off-by: Mark Brown > Signed-off-by: Greg Kroah-Hartman > > --- > drivers/spi/spi-omap2-mcspi.c | 19 ++++++++++--------- > 1 file changed, 10 insertions(+), 9 deletions(-) > > --- a/drivers/spi/spi-omap2-mcspi.c > +++ b/drivers/spi/spi-omap2-mcspi.c > @@ -1024,6 +1024,16 @@ static int omap2_mcspi_setup(struct spi_ > spi->controller_state = cs; > /* Link this to context save list */ > list_add_tail(&cs->node, &ctx->cs); > + > + if (gpio_is_valid(spi->cs_gpio)) { > + ret = gpio_request(spi->cs_gpio, dev_name(&spi->dev)); > + if (ret) { > + dev_err(&spi->dev, "failed to request gpio\n"); > + return ret; > + } > + gpio_direction_output(spi->cs_gpio, > + !(spi->mode & SPI_CS_HIGH)); > + } > } > > if (!mcspi_dma->dma_rx || !mcspi_dma->dma_tx) { > @@ -1032,15 +1042,6 @@ static int omap2_mcspi_setup(struct spi_ > return ret; > } > > - if (gpio_is_valid(spi->cs_gpio)) { > - ret = gpio_request(spi->cs_gpio, dev_name(&spi->dev)); > - if (ret) { > - dev_err(&spi->dev, "failed to request gpio\n"); > - return ret; > - } > - gpio_direction_output(spi->cs_gpio, !(spi->mode & SPI_CS_HIGH)); > - } > - > ret = pm_runtime_get_sync(mcspi->dev); > if (ret < 0) > return ret; > > > Patches currently in stable-queue which might be from mwelling@ieee.org are > > queue-4.4/spi-omap2-mcspi-prevent-duplicate-gpio_request.patch