CONFIG_PREEMPT and High Resolution Timers problem

2009-04-04 Thread Vijay Nikam
Hello All,
I have mpc8313erdb eval board with Linux-2.6.20 running on it.
Recently I had a problem, I wrote a driver and from I am sending
notification to user space application using fasync driver method
(SIGIO signal). In user space applicaion process I have used
posix-timers (timer_create and timer_settime), the timer is set for
10ms. But in actual I checked on oscilloscope the expiration of timer
or signal event generation varies between 10ms - 13ms. In kerenl
driver when the interrupt occurs I am making a gpio pin high and on
the signal event when timer expires I am making another gpio pin high,
and the time between these measured varies between 10ms - 13ms i.e. it
means the timer frequency is 250Hz, which was set by default for
powerpc. So to achieve close to precise of 10ms I set the timer
frequency to 1000Hz and then I got the resolution of 10ms -10.8ms.
I would like to ask is the right approach of changing Timer Frequency
to 1000Hz from 250Hz ? ? ?
Because while searching some information regarding this I learned
about High-Res Timers. In linux-2.6.20 x86 has this feature enabled
rather you can enable it but not for powerpc arch, Right ? ? ? If yes
then is there any way to add CONFIG_HIGH_RES_TIMERS feature to
linux-2.6.20, any patch available ? ? ?  otherwise what could be the
option ? ? ?

In Linux by default Preemption is not enabled, CONFIG_PREEMPT_NONE=y
so I tried to enabled CONFIG_PREEMPT=y but when I boot the board with
preemption enabled I got the scheduling with atomic error (please
check the log below, thanks). I tried to debug and find some info but
no luck. Could anyone please explain the reason for it and how I can
fix it ? ? ?

Kindly please acknowledge ... thank you ...

Kind Regards,
Vijay Nikam

### Start #
NET: Registered protocol family 1
NET: Registered protocol family 17
BUG: scheduling while atomic: swapper/0x0001/1
Call Trace:
[C07F5D50] [C0008938]  (unreliable)
[C07F5D80] [C02933CC]
[C07F5DD0] [C029472C]
[C07F5E10] [C0201AF0]
[C07F5E50] [C0201E08]
[C07F5E90] [C01FEE14]
[C07F5EB0] [C0202018]
[C07F5F30] [C0017490]
[C07F5F50] [C02FB4B0]
[C07F5F90] [C0003960]
[C07F5FF0] [C0010C74]
BUG: scheduling while atomic: swapper/0x0001/1
## END 
## Start 
BUG: scheduling while atomic: jffs2_gcd_mtd4/0x0004/719
Call Trace:
[C05BDBE0] [C0008938]  (unreliable)
[C05BDC10] [C02933CC]
[C05BDC60] [C029472C]
[C05BDCA0] [C01D9F14]
[C05BDCE0] [C01D5424]
[C05BDD40] [C01D74D4]
[C05BDD70] [C01C9330]
[C05BDD80] [C0127F88]
[C05BDDB0] [C011F26C]
[C05BDE20] [C0120320]
[C05BDE90] [C012327C]
--- Exception: 1[C05BDF50] [C0125F0C]  (unreliable)
[C05BDFF0] [C0010C74]
 END 
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] fsl-diu-fb: Pass the proper device for dma mapping routines

2009-04-04 Thread Anton Vorontsov
The driver should pass a device that specifies internal DMA ops, but
currently NULL pointers are passed, and thus following bug pops up:

  Freescale DIU driver
  [ cut here ]
  kernel BUG at arch/powerpc/include/asm/dma-mapping.h:237!
  Oops: Exception in kernel mode, sig: 5 [#1]
  ...
  NIP [c01658b4] allocate_buf+0x0/0x8
  LR [c0306554] fsl_diu_probe+0x2b4/0x518
  Call Trace:
  [df02be10] [c030638c] fsl_diu_probe+0xec/0x518 (unreliable)
  [df02be60] [c020cdec] of_platform_device_probe+0x5c/0x84
  [df02be80] [c018f5d0] really_probe+0x78/0x1a0
  [df02bea0] [c018f7c0] __driver_attach+0xa4/0xa8
  [df02bec0] [c018ea00] bus_for_each_dev+0x60/0x9c
  [df02bef0] [c018f414] driver_attach+0x24/0x34
  [df02bf00] [c018f168] bus_add_driver+0x12c/0x1cc
  [df02bf20] [c018fbdc] driver_register+0x6c/0x110
  [df02bf30] [c020ccb4] of_register_driver+0x54/0x70
  [df02bf40] [c03d0a50] fsl_diu_init+0x70/0xa4
  ...

This patch fixes the issue.

Signed-off-by: Anton Vorontsov 
---
 drivers/video/fsl-diu-fb.c |   34 +-
 1 files changed, 21 insertions(+), 13 deletions(-)

diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c
index fb51197..f153c58 100644
--- a/drivers/video/fsl-diu-fb.c
+++ b/drivers/video/fsl-diu-fb.c
@@ -1352,14 +1352,15 @@ static int fsl_diu_resume(struct of_device *ofdev)
 #endif /* CONFIG_PM */
 
 /* Align to 64-bit(8-byte), 32-byte, etc. */
-static int allocate_buf(struct diu_addr *buf, u32 size, u32 bytes_align)
+static int allocate_buf(struct device *dev, struct diu_addr *buf, u32 size,
+   u32 bytes_align)
 {
u32 offset, ssize;
u32 mask;
dma_addr_t paddr = 0;
 
ssize = size + bytes_align;
-   buf->vaddr = dma_alloc_coherent(NULL, ssize, &paddr, GFP_DMA |
+   buf->vaddr = dma_alloc_coherent(dev, ssize, &paddr, GFP_DMA |
 __GFP_ZERO);
if (!buf->vaddr)
return -ENOMEM;
@@ -1376,9 +1377,10 @@ static int allocate_buf(struct diu_addr *buf, u32 size, 
u32 bytes_align)
return 0;
 }
 
-static void free_buf(struct diu_addr *buf, u32 size, u32 bytes_align)
+static void free_buf(struct device *dev, struct diu_addr *buf, u32 size,
+u32 bytes_align)
 {
-   dma_free_coherent(NULL, size + bytes_align,
+   dma_free_coherent(dev, size + bytes_align,
buf->vaddr, (buf->paddr - buf->offset));
return;
 }
@@ -1476,17 +1478,19 @@ static int __devinit fsl_diu_probe(struct of_device 
*ofdev,
machine_data->monitor_port = monitor_port;
 
/* Area descriptor memory pool aligns to 64-bit boundary */
-   if (allocate_buf(&pool.ad, sizeof(struct diu_ad) * FSL_AOI_NUM, 8))
+   if (allocate_buf(&ofdev->dev, &pool.ad,
+sizeof(struct diu_ad) * FSL_AOI_NUM, 8))
return -ENOMEM;
 
/* Get memory for Gamma Table  - 32-byte aligned memory */
-   if (allocate_buf(&pool.gamma, 768, 32)) {
+   if (allocate_buf(&ofdev->dev, &pool.gamma, 768, 32)) {
ret = -ENOMEM;
goto error;
}
 
/* For performance, cursor bitmap buffer aligns to 32-byte boundary */
-   if (allocate_buf(&pool.cursor, MAX_CURS * MAX_CURS * 2, 32)) {
+   if (allocate_buf(&ofdev->dev, &pool.cursor, MAX_CURS * MAX_CURS * 2,
+32)) {
ret = -ENOMEM;
goto error;
}
@@ -1554,11 +1558,13 @@ error:
i > 0; i--)
uninstall_fb(machine_data->fsl_diu_info[i - 1]);
if (pool.ad.vaddr)
-   free_buf(&pool.ad, sizeof(struct diu_ad) * FSL_AOI_NUM, 8);
+   free_buf(&ofdev->dev, &pool.ad,
+sizeof(struct diu_ad) * FSL_AOI_NUM, 8);
if (pool.gamma.vaddr)
-   free_buf(&pool.gamma, 768, 32);
+   free_buf(&ofdev->dev, &pool.gamma, 768, 32);
if (pool.cursor.vaddr)
-   free_buf(&pool.cursor, MAX_CURS * MAX_CURS * 2, 32);
+   free_buf(&ofdev->dev, &pool.cursor, MAX_CURS * MAX_CURS * 2,
+32);
if (machine_data->dummy_aoi_virt)
fsl_diu_free(machine_data->dummy_aoi_virt, 64);
iounmap(dr.diu_reg);
@@ -1584,11 +1590,13 @@ static int fsl_diu_remove(struct of_device *ofdev)
for (i = ARRAY_SIZE(machine_data->fsl_diu_info); i > 0; i--)
uninstall_fb(machine_data->fsl_diu_info[i - 1]);
if (pool.ad.vaddr)
-   free_buf(&pool.ad, sizeof(struct diu_ad) * FSL_AOI_NUM, 8);
+   free_buf(&ofdev->dev, &pool.ad,
+sizeof(struct diu_ad) * FSL_AOI_NUM, 8);
if (pool.gamma.vaddr)
-   free_buf(&pool.gamma, 768, 32);
+   free_buf(&ofdev->dev, &pool.gamma, 768, 32);
if (pool.cursor.vaddr)
-   free_buf(&pool.cur

[PATCH] ASoC: fsl_dma: Pass the proper device for dma mapping routines

2009-04-04 Thread Anton Vorontsov
The driver should pass a device that specifies internal DMA ops, but
substream->pcm is just a logical device, and thus doesn't have arch-
specific dma callbacks, therefore following bug appears:

  Freescale Synchronous Serial Interface (SSI) ASoC Driver
  [ cut here ]
  kernel BUG at arch/powerpc/include/asm/dma-mapping.h:237!
  Oops: Exception in kernel mode, sig: 5 [#1]
  ...
  NIP [c02259c4] snd_malloc_dev_pages+0x58/0xac
  LR [c0225c74] snd_dma_alloc_pages+0xf8/0x108
  Call Trace:
  [df02bde0] [df02be2c] 0xdf02be2c (unreliable)
  [df02bdf0] [c0225c74] snd_dma_alloc_pages+0xf8/0x108
  [df02be10] [c023a100] fsl_dma_new+0x68/0x124
  [df02be20] [c02342ac] soc_new_pcm+0x1bc/0x234
  [df02bea0] [c02343dc] snd_soc_new_pcms+0xb8/0x148
  [df02bed0] [c023824c] cs4270_probe+0x34/0x124
  [df02bef0] [c0232fe8] snd_soc_instantiate_card+0x1a4/0x2f4
  [df02bf20] [c0233164] snd_soc_instantiate_cards+0x2c/0x68
  [df02bf30] [c0234704] snd_soc_register_platform+0x60/0x80
  [df02bf50] [c03d5664] fsl_soc_platform_init+0x18/0x28
  ...

This patch fixes the issue by using card's device instead.

Signed-off-by: Anton Vorontsov 
---
 sound/soc/fsl/fsl_dma.c |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/sound/soc/fsl/fsl_dma.c b/sound/soc/fsl/fsl_dma.c
index b3eb857..835e43c 100644
--- a/sound/soc/fsl/fsl_dma.c
+++ b/sound/soc/fsl/fsl_dma.c
@@ -300,7 +300,7 @@ static int fsl_dma_new(struct snd_card *card, struct 
snd_soc_dai *dai,
if (!card->dev->coherent_dma_mask)
card->dev->coherent_dma_mask = fsl_dma_dmamask;
 
-   ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, pcm->dev,
+   ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, card->dev,
fsl_dma_hardware.buffer_bytes_max,
&pcm->streams[0].substream->dma_buffer);
if (ret) {
@@ -310,7 +310,7 @@ static int fsl_dma_new(struct snd_card *card, struct 
snd_soc_dai *dai,
return -ENOMEM;
}
 
-   ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, pcm->dev,
+   ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, card->dev,
fsl_dma_hardware.buffer_bytes_max,
&pcm->streams[1].substream->dma_buffer);
if (ret) {
@@ -418,7 +418,7 @@ static int fsl_dma_open(struct snd_pcm_substream *substream)
return -EBUSY;
}
 
-   dma_private = dma_alloc_coherent(substream->pcm->dev,
+   dma_private = dma_alloc_coherent(substream->pcm->card->dev,
sizeof(struct fsl_dma_private), &ld_buf_phys, GFP_KERNEL);
if (!dma_private) {
dev_err(substream->pcm->card->dev,
@@ -445,7 +445,7 @@ static int fsl_dma_open(struct snd_pcm_substream *substream)
dev_err(substream->pcm->card->dev,
"can't register ISR for IRQ %u (ret=%i)\n",
dma_private->irq, ret);
-   dma_free_coherent(substream->pcm->dev,
+   dma_free_coherent(substream->pcm->card->dev,
sizeof(struct fsl_dma_private),
dma_private, dma_private->ld_buf_phys);
return ret;
@@ -761,13 +761,13 @@ static int fsl_dma_close(struct snd_pcm_substream 
*substream)
free_irq(dma_private->irq, dma_private);
 
if (dma_private->ld_buf_phys) {
-   dma_unmap_single(substream->pcm->dev,
+   dma_unmap_single(substream->pcm->card->dev,
dma_private->ld_buf_phys,
sizeof(dma_private->link), DMA_TO_DEVICE);
}
 
/* Deallocate the fsl_dma_private structure */
-   dma_free_coherent(substream->pcm->dev,
+   dma_free_coherent(substream->pcm->card->dev,
sizeof(struct fsl_dma_private),
dma_private, dma_private->ld_buf_phys);
substream->runtime->private_data = NULL;
-- 
1.5.6.5
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 1/3] spi_mpc83xx: Handles other Freescale processors

2009-04-04 Thread Anton Vorontsov
With this patch we'll able to select spi_mpc83xx driver on the MPC86xx
platforms. Let the driver depend on FSL_SOC, so we don't have to worry
about Kconfig anymore.

Also remove the "experimental" dependency, the driver has been tested
to work on a various hardware, and surely not experimental anymore.

Signed-off-by: Anton Vorontsov 
---
 drivers/spi/Kconfig |   14 ++
 1 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index 83a185d..3c1845c 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -140,16 +140,14 @@ config SPI_MPC52xx_PSC
  Controller in master SPI mode.
 
 config SPI_MPC83xx
-   tristate "Freescale MPC83xx/QUICC Engine SPI controller"
-   depends on (PPC_83xx || QUICC_ENGINE) && EXPERIMENTAL
+   tristate "Freescale MPC8xxx SPI controller"
+   depends on FSL_SOC
help
- This enables using the Freescale MPC83xx and QUICC Engine SPI
- controllers in master mode.
+ This enables using the Freescale MPC8xxx SPI controllers in master
+ mode.
 
- Note, this driver uniquely supports the SPI controller on the MPC83xx
- family of PowerPC processors, plus processors with QUICC Engine
- technology. This driver uses a simple set of shift registers for data
- (opposed to the CPM based descriptor model).
+ This driver uses a simple set of shift registers for data (opposed
+ to the CPM based descriptor model).
 
 config SPI_OMAP_UWIRE
tristate "OMAP1 MicroWire"
-- 
1.5.6.5

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 2/3] spi_mpc83xx: Quieten down the "Requested speed is too low" message

2009-04-04 Thread Anton Vorontsov
When a platform is running at high frequencies it's not always
possible to scale-down a frequency to a requested value, and using
mmc_spi driver this leads to the following printk flood during card
polling:

  ...
  mmc_spi spi32766.0: Requested speed is too low: 40 Hz. Will use
  520828 Hz instead.
  mmc_spi spi32766.0: Requested speed is too low: 40 Hz. Will use
  520828 Hz instead.
  ...

Fix this by using WARN_ONCE(), it's better than the flood, and also
better than turning dev_err() into dev_dbg(), since we actually want
to warn that some things may not work correctly.

Signed-off-by: Anton Vorontsov 
---
 drivers/spi/spi_mpc83xx.c |   11 ++-
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/spi/spi_mpc83xx.c b/drivers/spi/spi_mpc83xx.c
index f4573a9..08b49d2 100644
--- a/drivers/spi/spi_mpc83xx.c
+++ b/drivers/spi/spi_mpc83xx.c
@@ -14,6 +14,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -275,12 +276,12 @@ int mpc83xx_spi_setup_transfer(struct spi_device *spi, 
struct spi_transfer *t)
if ((mpc83xx_spi->spibrg / hz) > 64) {
cs->hw_mode |= SPMODE_DIV16;
pm = mpc83xx_spi->spibrg / (hz * 64);
-   if (pm > 16) {
-   dev_err(&spi->dev, "Requested speed is too "
-   "low: %d Hz. Will use %d Hz instead.\n",
-   hz, mpc83xx_spi->spibrg / 1024);
+
+   WARN_ONCE(pm > 16, "%s: Requested speed is too low: %d Hz. "
+ "Will use %d Hz instead.\n", dev_name(&spi->dev),
+ hz, mpc83xx_spi->spibrg / 1024);
+   if (pm > 16)
pm = 16;
-   }
} else
pm = mpc83xx_spi->spibrg / (hz * 4);
if (pm)
-- 
1.5.6.5

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 3/3] powerpc/86xx: Add MMC SPI support for MPC8610HPCD boards

2009-04-04 Thread Anton Vorontsov
This patch adds spi and mmc-spi-slot nodes, plus a gpio-controller
for PIXIS' sdcsr bank that is used for managing SPI chip-select and
for reading card's states.

Note that spi-max-frequency is lowered since at high frequencies SD
cards don't work reliably (there is some problem with the chip select
line, it's probably quite slow because it's routed via PIXIS).

Previously there was a work around: we didn't use chip-select line
at all, but some cards don't like that, so we'd better use the low
frequency.

Signed-off-by: Anton Vorontsov 
---
 arch/powerpc/boot/dts/mpc8610_hpcd.dts |   32 
 arch/powerpc/platforms/86xx/mpc8610_hpcd.c |4 +++
 2 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/boot/dts/mpc8610_hpcd.dts 
b/arch/powerpc/boot/dts/mpc8610_hpcd.dts
index 1bd3ebe..a18fa5c 100644
--- a/arch/powerpc/boot/dts/mpc8610_hpcd.dts
+++ b/arch/powerpc/boot/dts/mpc8610_hpcd.dts
@@ -100,8 +100,18 @@
};
 
board-cont...@3,0 {
+   #address-cells = <1>;
+   #size-cells = <1>;
compatible = "fsl,fpga-pixis";
reg = <3 0 0x20>;
+   ranges = <0 3 0 0x20>;
+
+   sdcsr_pio: gpio-control...@a {
+   #gpio-cells = <2>;
+   compatible = "fsl,fpga-pixis-gpio-bank";
+   reg = <0xa 1>;
+   gpio-controller;
+   };
};
};
 
@@ -164,6 +174,28 @@
interrupt-parent = <&mpic>;
};
 
+   s...@7000 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   compatible = "fsl,mpc8610-spi", "fsl,spi";
+   reg = <0x7000 0x40>;
+   cell-index = <0>;
+   interrupts = <59 2>;
+   interrupt-parent = <&mpic>;
+   mode = "cpu";
+   gpios = <&sdcsr_pio 7 0>;
+
+   mmc-s...@0 {
+   compatible = "fsl,mpc8610hpcd-mmc-slot",
+"mmc-spi-slot";
+   reg = <0>;
+   gpios = <&sdcsr_pio 0 1   /* nCD */
+&sdcsr_pio 1 0>; /*  WP */
+   voltage-ranges = <3300 3300>;
+   spi-max-frequency = <600>;
+   };
+   };
+
disp...@2c000 {
compatible = "fsl,diu";
reg = <0x2c000 100>;
diff --git a/arch/powerpc/platforms/86xx/mpc8610_hpcd.c 
b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
index 3f49a6f..ce64572 100644
--- a/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
+++ b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
@@ -38,6 +38,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "mpc86xx.h"
 
@@ -52,6 +53,9 @@ static struct of_device_id __initdata mpc8610_ids[] = {
 
 static int __init mpc8610_declare_of_platform_devices(void)
 {
+   /* Firstly, register PIXIS GPIOs. */
+   simple_gpiochip_init("fsl,fpga-pixis-gpio-bank");
+
/* Without this call, the SSI device driver won't get probed. */
of_platform_bus_probe(NULL, mpc8610_ids, NULL);
 
-- 
1.5.6.5
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 3/3] powerpc/86xx: Add MMC SPI support for MPC8610HPCD boards

2009-04-04 Thread H. Peter Anvin
Anton Vorontsov wrote:
> This patch adds spi and mmc-spi-slot nodes, plus a gpio-controller
> for PIXIS' sdcsr bank that is used for managing SPI chip-select and
> for reading card's states.
> 
> Note that spi-max-frequency is lowered since at high frequencies SD
> cards don't work reliably (there is some problem with the chip select
> line, it's probably quite slow because it's routed via PIXIS).
> 
> Previously there was a work around: we didn't use chip-select line
> at all, but some cards don't like that, so we'd better use the low
> frequency.
> 
> Signed-off-by: Anton Vorontsov 

I have to admit being somewhat confused.  The CS# line is pulled low and
stays low for the duration of a command, so it shouldn't affect the SPI
frequency, only the delay between commands.

You're saying "some cards don't like not using the CS# line" ... in
particular, I know there are hardware devices which toggle the clock at
low frequency (< 400 kHz) for a while (I think the minimum is 88 clocks
or so) and then permanently assert the CS# line before giving the
starting CMD0.  Even so, the CMD0 is supposed to be sent at < 400 kHz
since the card will still be in open drain mode at that point.

Does that disagree with your observations?  If so, I'd be really
interested to find out what you have seen in more detail, as it adds to
the understanding of MMC/SD cards in the field.

-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] ASoC: fsl_dma: Pass the proper device for dma mapping routines

2009-04-04 Thread Grant Likely
Becky & Kumar,

Considering these fixups, would it be advisable for the dma functions
to climb up the dev->parent linkage when dma_ops are NULL?

g.

On Sat, Apr 4, 2009 at 12:33 PM, Anton Vorontsov
 wrote:
> The driver should pass a device that specifies internal DMA ops, but
> substream->pcm is just a logical device, and thus doesn't have arch-
> specific dma callbacks, therefore following bug appears:
>
>  Freescale Synchronous Serial Interface (SSI) ASoC Driver
>  [ cut here ]
>  kernel BUG at arch/powerpc/include/asm/dma-mapping.h:237!
>  Oops: Exception in kernel mode, sig: 5 [#1]
>  ...
>  NIP [c02259c4] snd_malloc_dev_pages+0x58/0xac
>  LR [c0225c74] snd_dma_alloc_pages+0xf8/0x108
>  Call Trace:
>  [df02bde0] [df02be2c] 0xdf02be2c (unreliable)
>  [df02bdf0] [c0225c74] snd_dma_alloc_pages+0xf8/0x108
>  [df02be10] [c023a100] fsl_dma_new+0x68/0x124
>  [df02be20] [c02342ac] soc_new_pcm+0x1bc/0x234
>  [df02bea0] [c02343dc] snd_soc_new_pcms+0xb8/0x148
>  [df02bed0] [c023824c] cs4270_probe+0x34/0x124
>  [df02bef0] [c0232fe8] snd_soc_instantiate_card+0x1a4/0x2f4
>  [df02bf20] [c0233164] snd_soc_instantiate_cards+0x2c/0x68
>  [df02bf30] [c0234704] snd_soc_register_platform+0x60/0x80
>  [df02bf50] [c03d5664] fsl_soc_platform_init+0x18/0x28
>  ...
>
> This patch fixes the issue by using card's device instead.
>
> Signed-off-by: Anton Vorontsov 
> ---
>  sound/soc/fsl/fsl_dma.c |   12 ++--
>  1 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/sound/soc/fsl/fsl_dma.c b/sound/soc/fsl/fsl_dma.c
> index b3eb857..835e43c 100644
> --- a/sound/soc/fsl/fsl_dma.c
> +++ b/sound/soc/fsl/fsl_dma.c
> @@ -300,7 +300,7 @@ static int fsl_dma_new(struct snd_card *card, struct 
> snd_soc_dai *dai,
>        if (!card->dev->coherent_dma_mask)
>                card->dev->coherent_dma_mask = fsl_dma_dmamask;
>
> -       ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, pcm->dev,
> +       ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, card->dev,
>                fsl_dma_hardware.buffer_bytes_max,
>                &pcm->streams[0].substream->dma_buffer);
>        if (ret) {
> @@ -310,7 +310,7 @@ static int fsl_dma_new(struct snd_card *card, struct 
> snd_soc_dai *dai,
>                return -ENOMEM;
>        }
>
> -       ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, pcm->dev,
> +       ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, card->dev,
>                fsl_dma_hardware.buffer_bytes_max,
>                &pcm->streams[1].substream->dma_buffer);
>        if (ret) {
> @@ -418,7 +418,7 @@ static int fsl_dma_open(struct snd_pcm_substream 
> *substream)
>                return -EBUSY;
>        }
>
> -       dma_private = dma_alloc_coherent(substream->pcm->dev,
> +       dma_private = dma_alloc_coherent(substream->pcm->card->dev,
>                sizeof(struct fsl_dma_private), &ld_buf_phys, GFP_KERNEL);
>        if (!dma_private) {
>                dev_err(substream->pcm->card->dev,
> @@ -445,7 +445,7 @@ static int fsl_dma_open(struct snd_pcm_substream 
> *substream)
>                dev_err(substream->pcm->card->dev,
>                        "can't register ISR for IRQ %u (ret=%i)\n",
>                        dma_private->irq, ret);
> -               dma_free_coherent(substream->pcm->dev,
> +               dma_free_coherent(substream->pcm->card->dev,
>                        sizeof(struct fsl_dma_private),
>                        dma_private, dma_private->ld_buf_phys);
>                return ret;
> @@ -761,13 +761,13 @@ static int fsl_dma_close(struct snd_pcm_substream 
> *substream)
>                        free_irq(dma_private->irq, dma_private);
>
>                if (dma_private->ld_buf_phys) {
> -                       dma_unmap_single(substream->pcm->dev,
> +                       dma_unmap_single(substream->pcm->card->dev,
>                                dma_private->ld_buf_phys,
>                                sizeof(dma_private->link), DMA_TO_DEVICE);
>                }
>
>                /* Deallocate the fsl_dma_private structure */
> -               dma_free_coherent(substream->pcm->dev,
> +               dma_free_coherent(substream->pcm->card->dev,
>                        sizeof(struct fsl_dma_private),
>                        dma_private, dma_private->ld_buf_phys);
>                substream->runtime->private_data = NULL;
> --
> 1.5.6.5
> ___
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
>



-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev