All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vinod.koul@intel.com>
To: "Jürg Billeter" <j@bitron.ch>
Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
	Simon Horman <horms+renesas@verge.net.au>,
	Magnus Damm <damm+renesas@opensource.se>,
	Phil Edworthy <phil.edworthy@renesas.com>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	linux-kernel@vger.kernel.org, linux-sh@vger.kernel.org,
	dmaengine@vger.kernel.org
Subject: Re: [PATCH] dmaengine: rcar-dmac: Handle hardware descriptor allocation failure
Date: Mon, 08 Dec 2014 11:48:37 +0000	[thread overview]
Message-ID: <20141208113637.GG16827@intel.com> (raw)
In-Reply-To: <1416924617-15939-1-git-send-email-j@bitron.ch>

On Tue, Nov 25, 2014 at 03:10:17PM +0100, Jürg Billeter wrote:
> If the atomic DMA coherent pool is too small, disable use of hardware
> descriptor lists instead of crashing the system:
> 
> ERROR: 256 KiB atomic DMA coherent pool is too small!
> Please increase it with coherent_pool= kernel parameter!
> 
> Unable to handle kernel NULL pointer dereference at virtual address 00000004
> Internal error: Oops: a07 [#1] PREEMPT SMP ARM
> 
> PC is at rcar_dmac_chan_reinit+0x3c/0x160
> LR is at _raw_spin_lock_irqsave+0x18/0x5c
> 
> [<802132c0>] (rcar_dmac_chan_reinit) from [<80214818>] (rcar_dmac_isr_error+0x84/0xa0)
> [<80214818>] (rcar_dmac_isr_error) from [<80060484>] (handle_irq_event_percpu+0x50/0x150)
> [<80060484>] (handle_irq_event_percpu) from [<800605c0>] (handle_irq_event+0x3c/0x5c)
> [<800605c0>] (handle_irq_event) from [<8006350c>] (handle_fasteoi_irq+0xb8/0x198)
> [<8006350c>] (handle_fasteoi_irq) from [<8005fdb0>] (generic_handle_irq+0x20/0x30)
> [<8005fdb0>] (generic_handle_irq) from [<8000fcd0>] (handle_IRQ+0x50/0xc4)
> [<8000fcd0>] (handle_IRQ) from [<800092cc>] (gic_handle_irq+0x28/0x5c)
> [<800092cc>] (gic_handle_irq) from [<80012700>] (__irq_svc+0x40/0x70)
> 
> Kernel panic - not syncing: Fatal exception in interrupt

Can you please rebase this on my next, this fails to apply for me

Thanks
-- 
~Vinod
> 
> Signed-off-by: Jürg Billeter <j@bitron.ch>
> ---
>  drivers/dma/sh/rcar-dmac.c | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c
> index f8f70eb..f18b1b6 100644
> --- a/drivers/dma/sh/rcar-dmac.c
> +++ b/drivers/dma/sh/rcar-dmac.c
> @@ -679,8 +679,8 @@ static void rcar_dmac_realloc_hwdesc(struct rcar_dmac_chan *chan,
>  	desc->hwdescs.size = size;
>  }
>  
> -static void rcar_dmac_fill_hwdesc(struct rcar_dmac_chan *chan,
> -				  struct rcar_dmac_desc *desc)
> +static int rcar_dmac_fill_hwdesc(struct rcar_dmac_chan *chan,
> +				 struct rcar_dmac_desc *desc)
>  {
>  	struct rcar_dmac_xfer_chunk *chunk;
>  	struct rcar_dmac_hw_desc *hwdesc;
> @@ -689,7 +689,7 @@ static void rcar_dmac_fill_hwdesc(struct rcar_dmac_chan *chan,
>  
>  	hwdesc = desc->hwdescs.mem;
>  	if (!hwdesc)
> -		return;
> +		return -ENOMEM;
>  
>  	list_for_each_entry(chunk, &desc->chunks, node) {
>  		hwdesc->sar = chunk->src_addr;
> @@ -697,6 +697,8 @@ static void rcar_dmac_fill_hwdesc(struct rcar_dmac_chan *chan,
>  		hwdesc->tcr = chunk->size >> desc->xfer_shift;
>  		hwdesc++;
>  	}
> +
> +	return 0;
>  }
>  
>  /* -----------------------------------------------------------------------------
> @@ -933,8 +935,10 @@ rcar_dmac_chan_prep_sg(struct rcar_dmac_chan *chan, struct scatterlist *sgl,
>  	 * additional complexity remains to be investigated.
>  	 */
>  	desc->hwdescs.use = !highmem && nchunks > 1;
> -	if (desc->hwdescs.use)
> -		rcar_dmac_fill_hwdesc(chan, desc);
> +	if (desc->hwdescs.use) {
> +		if (rcar_dmac_fill_hwdesc(chan, desc) < 0)
> +			desc->hwdescs.use = false;
> +	}
>  
>  	return &desc->async_tx;
>  }
> -- 
> 2.1.3
> 

-- 

WARNING: multiple messages have this Message-ID (diff)
From: Vinod Koul <vinod.koul@intel.com>
To: "Jürg Billeter" <j@bitron.ch>
Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
	Simon Horman <horms+renesas@verge.net.au>,
	Magnus Damm <damm+renesas@opensource.se>,
	Phil Edworthy <phil.edworthy@renesas.com>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	linux-kernel@vger.kernel.org, linux-sh@vger.kernel.org,
	dmaengine@vger.kernel.org
Subject: Re: [PATCH] dmaengine: rcar-dmac: Handle hardware descriptor allocation failure
Date: Mon, 8 Dec 2014 17:06:37 +0530	[thread overview]
Message-ID: <20141208113637.GG16827@intel.com> (raw)
In-Reply-To: <1416924617-15939-1-git-send-email-j@bitron.ch>

On Tue, Nov 25, 2014 at 03:10:17PM +0100, Jürg Billeter wrote:
> If the atomic DMA coherent pool is too small, disable use of hardware
> descriptor lists instead of crashing the system:
> 
> ERROR: 256 KiB atomic DMA coherent pool is too small!
> Please increase it with coherent_pool= kernel parameter!
> 
> Unable to handle kernel NULL pointer dereference at virtual address 00000004
> Internal error: Oops: a07 [#1] PREEMPT SMP ARM
> 
> PC is at rcar_dmac_chan_reinit+0x3c/0x160
> LR is at _raw_spin_lock_irqsave+0x18/0x5c
> 
> [<802132c0>] (rcar_dmac_chan_reinit) from [<80214818>] (rcar_dmac_isr_error+0x84/0xa0)
> [<80214818>] (rcar_dmac_isr_error) from [<80060484>] (handle_irq_event_percpu+0x50/0x150)
> [<80060484>] (handle_irq_event_percpu) from [<800605c0>] (handle_irq_event+0x3c/0x5c)
> [<800605c0>] (handle_irq_event) from [<8006350c>] (handle_fasteoi_irq+0xb8/0x198)
> [<8006350c>] (handle_fasteoi_irq) from [<8005fdb0>] (generic_handle_irq+0x20/0x30)
> [<8005fdb0>] (generic_handle_irq) from [<8000fcd0>] (handle_IRQ+0x50/0xc4)
> [<8000fcd0>] (handle_IRQ) from [<800092cc>] (gic_handle_irq+0x28/0x5c)
> [<800092cc>] (gic_handle_irq) from [<80012700>] (__irq_svc+0x40/0x70)
> 
> Kernel panic - not syncing: Fatal exception in interrupt

Can you please rebase this on my next, this fails to apply for me

Thanks
-- 
~Vinod
> 
> Signed-off-by: Jürg Billeter <j@bitron.ch>
> ---
>  drivers/dma/sh/rcar-dmac.c | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c
> index f8f70eb..f18b1b6 100644
> --- a/drivers/dma/sh/rcar-dmac.c
> +++ b/drivers/dma/sh/rcar-dmac.c
> @@ -679,8 +679,8 @@ static void rcar_dmac_realloc_hwdesc(struct rcar_dmac_chan *chan,
>  	desc->hwdescs.size = size;
>  }
>  
> -static void rcar_dmac_fill_hwdesc(struct rcar_dmac_chan *chan,
> -				  struct rcar_dmac_desc *desc)
> +static int rcar_dmac_fill_hwdesc(struct rcar_dmac_chan *chan,
> +				 struct rcar_dmac_desc *desc)
>  {
>  	struct rcar_dmac_xfer_chunk *chunk;
>  	struct rcar_dmac_hw_desc *hwdesc;
> @@ -689,7 +689,7 @@ static void rcar_dmac_fill_hwdesc(struct rcar_dmac_chan *chan,
>  
>  	hwdesc = desc->hwdescs.mem;
>  	if (!hwdesc)
> -		return;
> +		return -ENOMEM;
>  
>  	list_for_each_entry(chunk, &desc->chunks, node) {
>  		hwdesc->sar = chunk->src_addr;
> @@ -697,6 +697,8 @@ static void rcar_dmac_fill_hwdesc(struct rcar_dmac_chan *chan,
>  		hwdesc->tcr = chunk->size >> desc->xfer_shift;
>  		hwdesc++;
>  	}
> +
> +	return 0;
>  }
>  
>  /* -----------------------------------------------------------------------------
> @@ -933,8 +935,10 @@ rcar_dmac_chan_prep_sg(struct rcar_dmac_chan *chan, struct scatterlist *sgl,
>  	 * additional complexity remains to be investigated.
>  	 */
>  	desc->hwdescs.use = !highmem && nchunks > 1;
> -	if (desc->hwdescs.use)
> -		rcar_dmac_fill_hwdesc(chan, desc);
> +	if (desc->hwdescs.use) {
> +		if (rcar_dmac_fill_hwdesc(chan, desc) < 0)
> +			desc->hwdescs.use = false;
> +	}
>  
>  	return &desc->async_tx;
>  }
> -- 
> 2.1.3
> 

-- 

  parent reply	other threads:[~2014-12-08 11:48 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-25 14:10 [PATCH] dmaengine: rcar-dmac: Handle hardware descriptor allocation failure Jürg Billeter
2014-11-25 14:10 ` Jürg Billeter
2014-11-27  0:07 ` Laurent Pinchart
2014-11-27  0:07   ` Laurent Pinchart
2014-12-08 11:36 ` Vinod Koul [this message]
2014-12-08 11:48   ` Vinod Koul
2014-12-08 16:50   ` Jürg Billeter
2014-12-08 16:50     ` Jürg Billeter
2014-12-08 17:19     ` Vinod Koul
2014-12-08 17:31       ` Vinod Koul
2014-12-08 17:40       ` Laurent Pinchart
2014-12-08 17:40         ` Laurent Pinchart
2014-12-08 17:50         ` Vinod Koul
2014-12-08 17:50           ` Vinod Koul
2014-12-09  6:39           ` Vinod Koul
2014-12-09  6:51             ` Vinod Koul
2014-12-10 16:09             ` Laurent Pinchart
2014-12-10 16:09               ` Laurent Pinchart
2014-12-11  1:16               ` Kuninori Morimoto
2014-12-12 19:41                 ` Laurent Pinchart
2014-12-12 19:41                   ` Laurent Pinchart
2014-12-15  6:38                   ` Vinod Koul
2014-12-15  6:50                     ` Vinod Koul
2014-12-15 20:04                     ` Laurent Pinchart
2014-12-15 20:04                       ` Laurent Pinchart
2014-12-16  7:04                       ` Vinod Koul
2014-12-16  7:16                         ` Vinod Koul
2014-12-16 23:57                         ` Laurent Pinchart
2014-12-16 23:57                           ` Laurent Pinchart
2014-12-17 12:54                           ` Vinod Koul
2014-12-17 12:54                             ` Vinod Koul
2014-12-22 15:02                             ` Vinod Koul
2014-12-22 15:14                               ` Vinod Koul
2014-12-23  9:14                               ` Laurent Pinchart
2014-12-23  9:14                                 ` Laurent Pinchart

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=20141208113637.GG16827@intel.com \
    --to=vinod.koul@intel.com \
    --cc=damm+renesas@opensource.se \
    --cc=dmaengine@vger.kernel.org \
    --cc=horms+renesas@verge.net.au \
    --cc=j@bitron.ch \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=phil.edworthy@renesas.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 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.