From: Tony Lindgren <tony@atomide.com> To: "G, Manjunath Kondaiah" <manjugk@ti.com> Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Kevin Hilman <khilman@deeprootsystems.com>, Santosh Shilimkar <santosh.shilimkar@ti.com>, Benoit Cousson <b-cousson@ti.com> Subject: Re: [PATCH v5 09/14] OMAP: DMA: Convert DMA library into platform driver Date: Thu, 2 Dec 2010 10:44:19 -0800 [thread overview] Message-ID: <20101202184419.GR17222@atomide.com> (raw) In-Reply-To: <1290603110-14119-10-git-send-email-manjugk@ti.com> * G, Manjunath Kondaiah <manjugk@ti.com> [101124 04:42]: > Convert DMA library into DMA platform driver and make use of > platform data provided by hwmod data base for OMAP2+ onwards. > > For OMAP1 processors, the DMA driver in mach-omap uses resource > structures for getting platform data. And has never been tested.. <snip> > static int __init omap1_system_dma_init(void) > { > struct omap_system_dma_plat_info *p; > + struct omap_dma_dev_attr *d; > struct platform_device *pdev; > int ret; > > @@ -153,22 +295,74 @@ static int __init omap1_system_dma_init(void) > goto exit_device_put; > } > > + d = p->dma_attr; This fails on omap1 as d is not allocated. Please merge the following fix. Tony From: Tony Lindgren <tony@atomide.com> Date: Thu, 2 Dec 2010 10:02:08 -0800 Subject: [PATCH] Fix dma init for omap1 Fix dma init for omap1 Signed-off-by: Tony Lindgren <tony@atomide.com> --- a/arch/arm/mach-omap1/dma.c +++ b/arch/arm/mach-omap1/dma.c @@ -295,13 +295,20 @@ static int __init omap1_system_dma_init(void) goto exit_device_put; } - d = p->dma_attr; + d = kzalloc(sizeof(struct omap_dma_dev_attr), GFP_KERNEL); + if (!d) { + dev_err(&pdev->dev, "%s: Unable to allocate 'd' for %s\n", + __func__, pdev->name); + ret = -ENOMEM; + goto exit_release_p; + } + d->chan = kzalloc(sizeof(struct omap_dma_lch) * (d->lch_count), GFP_KERNEL); if (!d->chan) { dev_err(&pdev->dev, "%s: Memory allocation failed" "for d->chan!!!\n", __func__); - goto exit_release_p; + goto exit_release_d; } /* Valid attributes for omap1 plus processors */ @@ -328,6 +335,8 @@ static int __init omap1_system_dma_init(void) d->chan_count = 9; } + p->dma_attr = d; + dma_base = (void __iomem *)res[0].start; p->show_dma_caps = omap1_show_dma_caps; @@ -361,6 +370,8 @@ static int __init omap1_system_dma_init(void) exit_release_chan: kfree(d->chan); +exit_release_d: + kfree(d); exit_release_p: kfree(p); exit_device_put:
WARNING: multiple messages have this Message-ID (diff)
From: tony@atomide.com (Tony Lindgren) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v5 09/14] OMAP: DMA: Convert DMA library into platform driver Date: Thu, 2 Dec 2010 10:44:19 -0800 [thread overview] Message-ID: <20101202184419.GR17222@atomide.com> (raw) In-Reply-To: <1290603110-14119-10-git-send-email-manjugk@ti.com> * G, Manjunath Kondaiah <manjugk@ti.com> [101124 04:42]: > Convert DMA library into DMA platform driver and make use of > platform data provided by hwmod data base for OMAP2+ onwards. > > For OMAP1 processors, the DMA driver in mach-omap uses resource > structures for getting platform data. And has never been tested.. <snip> > static int __init omap1_system_dma_init(void) > { > struct omap_system_dma_plat_info *p; > + struct omap_dma_dev_attr *d; > struct platform_device *pdev; > int ret; > > @@ -153,22 +295,74 @@ static int __init omap1_system_dma_init(void) > goto exit_device_put; > } > > + d = p->dma_attr; This fails on omap1 as d is not allocated. Please merge the following fix. Tony From: Tony Lindgren <tony@atomide.com> Date: Thu, 2 Dec 2010 10:02:08 -0800 Subject: [PATCH] Fix dma init for omap1 Fix dma init for omap1 Signed-off-by: Tony Lindgren <tony@atomide.com> --- a/arch/arm/mach-omap1/dma.c +++ b/arch/arm/mach-omap1/dma.c @@ -295,13 +295,20 @@ static int __init omap1_system_dma_init(void) goto exit_device_put; } - d = p->dma_attr; + d = kzalloc(sizeof(struct omap_dma_dev_attr), GFP_KERNEL); + if (!d) { + dev_err(&pdev->dev, "%s: Unable to allocate 'd' for %s\n", + __func__, pdev->name); + ret = -ENOMEM; + goto exit_release_p; + } + d->chan = kzalloc(sizeof(struct omap_dma_lch) * (d->lch_count), GFP_KERNEL); if (!d->chan) { dev_err(&pdev->dev, "%s: Memory allocation failed" "for d->chan!!!\n", __func__); - goto exit_release_p; + goto exit_release_d; } /* Valid attributes for omap1 plus processors */ @@ -328,6 +335,8 @@ static int __init omap1_system_dma_init(void) d->chan_count = 9; } + p->dma_attr = d; + dma_base = (void __iomem *)res[0].start; p->show_dma_caps = omap1_show_dma_caps; @@ -361,6 +370,8 @@ static int __init omap1_system_dma_init(void) exit_release_chan: kfree(d->chan); +exit_release_d: + kfree(d); exit_release_p: kfree(p); exit_device_put:
next prev parent reply other threads:[~2010-12-02 18:44 UTC|newest] Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top 2010-11-24 12:51 [PATCH v5 00/14] OMAP: DMA: hwmod and DMA as platform device G, Manjunath Kondaiah 2010-11-24 12:51 ` [PATCH v5 01/14] OMAP: DMA: Replace read/write macros with functions G, Manjunath Kondaiah 2010-11-24 12:51 ` [PATCH v5 02/14] OMAP: DMA: Introduce errata handling feature G, Manjunath Kondaiah 2010-11-24 12:51 ` [PATCH v5 03/14] OMAP2420: hwmod data: add system DMA G, Manjunath Kondaiah 2010-11-24 12:51 ` [PATCH v5 04/14] OMAP2430: " G, Manjunath Kondaiah 2010-11-24 12:51 ` [PATCH v5 05/14] OMAP3: " G, Manjunath Kondaiah 2010-11-24 12:51 ` [PATCH v5 06/14] OMAP4: " G, Manjunath Kondaiah 2010-11-24 12:51 ` [PATCH v5 07/14] OMAP1: DMA: Implement in platform device model G, Manjunath Kondaiah 2010-11-24 12:51 ` [PATCH v5 08/14] OMAP2+: DMA: hwmod: Device registration G, Manjunath Kondaiah 2010-11-24 12:51 ` [PATCH v5 09/14] OMAP: DMA: Convert DMA library into platform driver G, Manjunath Kondaiah 2010-12-02 18:44 ` Tony Lindgren [this message] 2010-12-02 18:44 ` Tony Lindgren 2010-12-02 18:46 ` Tony Lindgren 2010-12-02 18:46 ` Tony Lindgren 2010-12-02 18:49 ` Tony Lindgren 2010-12-02 18:49 ` Tony Lindgren 2010-12-02 20:04 ` G, Manjunath Kondaiah 2010-12-02 20:04 ` G, Manjunath Kondaiah 2010-12-02 20:52 ` Tony Lindgren 2010-12-02 20:52 ` Tony Lindgren 2010-12-03 16:43 ` G, Manjunath Kondaiah 2010-12-03 16:43 ` G, Manjunath Kondaiah 2010-12-03 23:24 ` Tony Lindgren 2010-12-03 23:24 ` Tony Lindgren 2011-01-13 11:20 ` G, Manjunath Kondaiah 2011-01-13 11:20 ` G, Manjunath Kondaiah 2011-01-19 19:04 ` Tony Lindgren 2011-01-19 19:04 ` Tony Lindgren 2010-11-24 12:51 ` [PATCH v5 10/14] OMAP: DMA: Use DMA device attributes G, Manjunath Kondaiah 2010-12-02 17:07 ` Tony Lindgren 2010-12-02 17:07 ` Tony Lindgren 2010-12-02 17:32 ` G, Manjunath Kondaiah 2010-12-02 17:32 ` G, Manjunath Kondaiah 2010-11-24 12:51 ` [PATCH v5 11/14] OMAP2+: DMA: descriptor autoloading feature G, Manjunath Kondaiah 2010-11-24 12:51 ` [PATCH v5 12/14] OMAP3630: DMA: Add work around for erratum i557 G, Manjunath Kondaiah 2010-11-24 12:51 ` [PATCH v5 13/14] OMAP2+: DMA: Replace sysconfig register access with API's G, Manjunath Kondaiah 2010-11-24 12:51 ` [PATCH v5 14/14] OMAP: PM: DMA: Enable runtime pm G, Manjunath Kondaiah [not found] ` <20101125112811.GA27574@GLPP-machine> 2010-12-01 19:04 ` [PATCH v5 00/14] OMAP: DMA: hwmod and DMA as platform device G, Manjunath Kondaiah 2010-12-01 19:04 ` G, Manjunath Kondaiah 2010-12-02 2:37 ` Tony Lindgren 2010-12-02 2:37 ` Tony Lindgren
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=20101202184419.GR17222@atomide.com \ --to=tony@atomide.com \ --cc=b-cousson@ti.com \ --cc=khilman@deeprootsystems.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-omap@vger.kernel.org \ --cc=manjugk@ti.com \ --cc=santosh.shilimkar@ti.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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.