From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Eric Miao <eric.y.miao@gmail.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
Grant Likely <grant.likely@secretlab.ca>,
Linus Walleij <linus.walleij@linaro.org>,
Russell King <linux@arm.linux.org.uk>,
Haojian Zhuang <haojian.zhuang@gmail.com>,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
chao.bi@intel.com,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Subject: Re: [PATCH 01/11] spi/pxa2xx: allow building on a 64-bit kernel
Date: Tue, 8 Jan 2013 12:29:01 +0200 [thread overview]
Message-ID: <20130108102901.GG13897@intel.com> (raw)
In-Reply-To: <CAMPhdO9j_-zZUAfZ-u_tdB6C6iSzTVRtN9_at4Obe9wgTA8p4g@mail.gmail.com>
On Tue, Jan 08, 2013 at 11:27:45AM +0800, Eric Miao wrote:
> On Mon, Jan 7, 2013 at 6:44 PM, Mika Westerberg
> <mika.westerberg@linux.intel.com> wrote:
> > In addition fix following warnings seen when compiling 64-bit:
> >
> > drivers/spi/spi-pxa2xx.c: In function ‘map_dma_buffers’: drivers/spi/spi-pxa2xx.c:384:7: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
> > drivers/spi/spi-pxa2xx.c:384:40: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
> > drivers/spi/spi-pxa2xx.c: In function ‘pxa2xx_spi_probe’:
> > drivers/spi/spi-pxa2xx.c:1572:34: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
> > drivers/spi/spi-pxa2xx.c:1572:34: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
> > drivers/spi/spi-pxa2xx.c:1572:34: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
> > drivers/spi/spi-pxa2xx.c:1572:27: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
> >
> > Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> > ---
> > drivers/spi/Kconfig | 4 ++--
> > drivers/spi/spi-pxa2xx.c | 5 ++---
> > 2 files changed, 4 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
> > index 2e188e1..a90393d 100644
> > --- a/drivers/spi/Kconfig
> > +++ b/drivers/spi/Kconfig
> > @@ -299,7 +299,7 @@ config SPI_PPC4xx
> >
> > config SPI_PXA2XX
> > tristate "PXA2xx SSP SPI master"
> > - depends on (ARCH_PXA || (X86_32 && PCI)) && EXPERIMENTAL
> > + depends on ARCH_PXA || PCI
> > select PXA_SSP if ARCH_PXA
> > help
> > This enables using a PXA2xx or Sodaville SSP port as a SPI master
> > @@ -307,7 +307,7 @@ config SPI_PXA2XX
> > additional documentation can be found a Documentation/spi/pxa2xx.
> >
> > config SPI_PXA2XX_PCI
> > - def_bool SPI_PXA2XX && X86_32 && PCI
> > + def_tristate SPI_PXA2XX && PCI
> >
>
> Generally looks good to me, I think we could split the changes to
>
> * Kconfig (adding 64-bit support or removing restrictions of X86_32
> for the driver)
> * and to spi-pxa2xx.c (mostly to handle the alignment warnings)
OK.
>
> > config SPI_RSPI
> > tristate "Renesas RSPI controller"
> > diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
> > index 5c8c4f5..7fac65d 100644
> > --- a/drivers/spi/spi-pxa2xx.c
> > +++ b/drivers/spi/spi-pxa2xx.c
> > @@ -47,7 +47,7 @@ MODULE_ALIAS("platform:pxa2xx-spi");
> >
> > #define DMA_INT_MASK (DCSR_ENDINTR | DCSR_STARTINTR | DCSR_BUSERR)
> > #define RESET_DMA_CHANNEL (DCSR_NODESC | DMA_INT_MASK)
> > -#define IS_DMA_ALIGNED(x) ((((u32)(x)) & 0x07) == 0)
> > +#define IS_DMA_ALIGNED(x) IS_ALIGNED((unsigned long)x, DMA_ALIGNMENT)
>
> OK.
>
> > #define MAX_DMA_LEN 8191
> > #define DMA_ALIGNMENT 8
> >
> > @@ -1569,8 +1569,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
> > master->transfer = transfer;
> >
> > drv_data->ssp_type = ssp->type;
> > - drv_data->null_dma_buf = (u32 *)ALIGN((u32)(drv_data +
> > - sizeof(struct driver_data)), 8);
> > + drv_data->null_dma_buf = (u32 *)PTR_ALIGN(drv_data + 1, 8);
>
> Hmm... the original code seems to have big problem and interestingly no
> one has reported the issue, possibly due to null_dma_buf being seldomly
> used.
>
> However, it's still a bit obscure to have 'drv_data + 1', 'drv_data[1]' might
> be a bit better for readability.
>
> And it'll be better to have DMA_ALIGNTMENT here instead of a hard-coded
> constant '8'.
> u
Sure, I'll change that.
Thanks for your comments.
next prev parent reply other threads:[~2013-01-08 10:25 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-07 10:44 [PATCH 00/11] spi/pxa2xx: add Intel Lynxpoint SPI controller support Mika Westerberg
2013-01-07 10:44 ` [PATCH 01/11] spi/pxa2xx: allow building on a 64-bit kernel Mika Westerberg
2013-01-08 3:27 ` Eric Miao
2013-01-08 10:29 ` Mika Westerberg [this message]
2013-01-07 10:44 ` [PATCH 02/11] spi/pxa2xx: convert to the pump message infrastructure Mika Westerberg
2013-01-17 9:26 ` Linus Walleij
2013-01-07 10:44 ` [PATCH 03/11] spi/pxa2xx-pci: switch to use pcim_* interfaces Mika Westerberg
2013-01-08 10:59 ` Mark Brown
2013-01-07 10:44 ` [PATCH 04/11] spi/pxa2xx: embed the ssp_device to platform data Mika Westerberg
2013-01-07 10:44 ` [PATCH 05/11] spi/pxa2xx: make clock rate configurable from " Mika Westerberg
2013-01-08 11:02 ` Mark Brown
2013-01-08 12:41 ` Mika Westerberg
2013-01-08 13:10 ` Mark Brown
2013-01-08 21:33 ` Rafael J. Wysocki
2013-01-09 10:51 ` Mika Westerberg
2013-01-09 21:52 ` Rafael J. Wysocki
2013-01-10 10:00 ` Mika Westerberg
2013-01-09 12:25 ` Mark Brown
2013-01-09 22:07 ` Rafael J. Wysocki
2013-01-10 9:58 ` Mika Westerberg
2013-01-10 12:38 ` Mika Westerberg
2013-01-10 12:54 ` Rafael J. Wysocki
2013-01-10 12:51 ` Mark Brown
2013-01-10 13:07 ` Mika Westerberg
2013-01-10 13:23 ` Rafael J. Wysocki
2013-01-10 13:33 ` Mika Westerberg
2013-01-10 13:18 ` Rafael J. Wysocki
2013-01-10 13:33 ` Mark Brown
2013-01-10 13:58 ` Mika Westerberg
2013-01-10 21:56 ` Rafael J. Wysocki
2013-01-11 10:59 ` Mark Brown
2013-01-10 13:08 ` Mika Westerberg
2013-01-08 21:37 ` Rafael J. Wysocki
2013-01-07 10:44 ` [PATCH 06/11] spi/pxa2xx: use the private DMA API only when CONFIG_ARCH_PXA is set Mika Westerberg
2013-01-17 9:36 ` Linus Walleij
2013-01-17 10:00 ` Mika Westerberg
2013-01-07 10:44 ` [PATCH 07/11] spi/pxa2xx: add support for DMA engine Mika Westerberg
2013-01-17 9:48 ` Linus Walleij
2013-01-17 10:39 ` Mika Westerberg
2013-01-07 10:44 ` [PATCH 08/11] spi/pxa2xx: add support for runtime PM Mika Westerberg
2013-01-07 10:44 ` [PATCH 09/11] spi/pxa2xx: add support for SPI_LOOP Mika Westerberg
2013-01-07 10:44 ` [PATCH 10/11] spi/pxa2xx: add support for Intel Low Power Subsystem SPI Mika Westerberg
2013-01-07 10:44 ` [PATCH 11/11] spi/pxa2xx: add support for Lynxpoint SPI controllers Mika Westerberg
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=20130108102901.GG13897@intel.com \
--to=mika.westerberg@linux.intel.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=chao.bi@intel.com \
--cc=eric.y.miao@gmail.com \
--cc=grant.likely@secretlab.ca \
--cc=haojian.zhuang@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=rafael.j.wysocki@intel.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;
as well as URLs for NNTP newsgroup(s).