public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: Add missing sg_init_table() call
@ 2007-11-22 19:32 Haavard Skinnemoen
  2007-11-23  9:18 ` Jens Axboe
  2007-11-27  5:29 ` Andrew Morton
  0 siblings, 2 replies; 7+ messages in thread
From: Haavard Skinnemoen @ 2007-11-22 19:32 UTC (permalink / raw)
  To: Pierre Ossman; +Cc: LKML, Haavard Skinnemoen

mmc_init_queue only initializes the scatterlists with sg_init_table()
when using a bounce buffer. This leads to a BUG() when CONFIG_DEBUG_SG
is set.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
---
 drivers/mmc/card/queue.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c
index 1b9c9b6..30cd13b 100644
--- a/drivers/mmc/card/queue.c
+++ b/drivers/mmc/card/queue.c
@@ -180,12 +180,13 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock
 		blk_queue_max_hw_segments(mq->queue, host->max_hw_segs);
 		blk_queue_max_segment_size(mq->queue, host->max_seg_size);
 
-		mq->sg = kzalloc(sizeof(struct scatterlist) *
+		mq->sg = kmalloc(sizeof(struct scatterlist) *
 			host->max_phys_segs, GFP_KERNEL);
 		if (!mq->sg) {
 			ret = -ENOMEM;
 			goto cleanup_queue;
 		}
+		sg_init_table(mq->sg, host->max_phys_segs);
 	}
 
 	init_MUTEX(&mq->thread_sem);
-- 
1.5.3.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] mmc: Add missing sg_init_table() call
  2007-11-22 19:32 [PATCH] mmc: Add missing sg_init_table() call Haavard Skinnemoen
@ 2007-11-23  9:18 ` Jens Axboe
  2007-11-27  5:29 ` Andrew Morton
  1 sibling, 0 replies; 7+ messages in thread
From: Jens Axboe @ 2007-11-23  9:18 UTC (permalink / raw)
  To: Haavard Skinnemoen; +Cc: Pierre Ossman, LKML

On Thu, Nov 22 2007, Haavard Skinnemoen wrote:
> mmc_init_queue only initializes the scatterlists with sg_init_table()
> when using a bounce buffer. This leads to a BUG() when CONFIG_DEBUG_SG
> is set.
> 
> Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
> ---
>  drivers/mmc/card/queue.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c
> index 1b9c9b6..30cd13b 100644
> --- a/drivers/mmc/card/queue.c
> +++ b/drivers/mmc/card/queue.c
> @@ -180,12 +180,13 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock
>  		blk_queue_max_hw_segments(mq->queue, host->max_hw_segs);
>  		blk_queue_max_segment_size(mq->queue, host->max_seg_size);
>  
> -		mq->sg = kzalloc(sizeof(struct scatterlist) *
> +		mq->sg = kmalloc(sizeof(struct scatterlist) *
>  			host->max_phys_segs, GFP_KERNEL);
>  		if (!mq->sg) {
>  			ret = -ENOMEM;
>  			goto cleanup_queue;
>  		}
> +		sg_init_table(mq->sg, host->max_phys_segs);
>  	}
>  
>  	init_MUTEX(&mq->thread_sem);

Applied

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] mmc: Add missing sg_init_table() call
  2007-11-22 19:32 [PATCH] mmc: Add missing sg_init_table() call Haavard Skinnemoen
  2007-11-23  9:18 ` Jens Axboe
@ 2007-11-27  5:29 ` Andrew Morton
  2007-11-27  5:57   ` Pierre Ossman
  2007-11-27  9:11   ` Haavard Skinnemoen
  1 sibling, 2 replies; 7+ messages in thread
From: Andrew Morton @ 2007-11-27  5:29 UTC (permalink / raw)
  To: Haavard Skinnemoen; +Cc: Pierre Ossman, LKML, Rafael J. Wysocki

On Thu, 22 Nov 2007 20:32:51 +0100 Haavard Skinnemoen <hskinnemoen@atmel.com> wrote:

> mmc_init_queue only initializes the scatterlists with sg_init_table()
> when using a bounce buffer. This leads to a BUG() when CONFIG_DEBUG_SG
> is set.
> 

I assume that 2.6.23 is not afflicted in this way?

> ---
>  drivers/mmc/card/queue.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c
> index 1b9c9b6..30cd13b 100644
> --- a/drivers/mmc/card/queue.c
> +++ b/drivers/mmc/card/queue.c
> @@ -180,12 +180,13 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock
>  		blk_queue_max_hw_segments(mq->queue, host->max_hw_segs);
>  		blk_queue_max_segment_size(mq->queue, host->max_seg_size);
>  
> -		mq->sg = kzalloc(sizeof(struct scatterlist) *
> +		mq->sg = kmalloc(sizeof(struct scatterlist) *
>  			host->max_phys_segs, GFP_KERNEL);
>  		if (!mq->sg) {
>  			ret = -ENOMEM;
>  			goto cleanup_queue;
>  		}
> +		sg_init_table(mq->sg, host->max_phys_segs);
>  	}
>  
>  	init_MUTEX(&mq->thread_sem);

Pierre, I can queue this up but if you merge it into your tree I shall drop
it and shall lose track of it.  So it's then all down to you to remember to
get the fix into 2.6.24.

(Except this particular bug looks like a post-2.6.23 regression, so I can cc
the Rafael which never forgets, so it will then get tracked all the way into
Linus's tree)


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] mmc: Add missing sg_init_table() call
  2007-11-27  5:29 ` Andrew Morton
@ 2007-11-27  5:57   ` Pierre Ossman
  2007-11-27  8:54     ` Jens Axboe
  2007-11-27  9:11   ` Haavard Skinnemoen
  1 sibling, 1 reply; 7+ messages in thread
From: Pierre Ossman @ 2007-11-27  5:57 UTC (permalink / raw)
  To: Andrew Morton, Jens Axboe; +Cc: Haavard Skinnemoen, LKML, Rafael J. Wysocki

On Mon, 26 Nov 2007 21:29:55 -0800
Andrew Morton <akpm@linux-foundation.org> wrote:

> 
> Pierre, I can queue this up but if you merge it into your tree I shall drop
> it and shall lose track of it.  So it's then all down to you to remember to
> get the fix into 2.6.24.
> 
> (Except this particular bug looks like a post-2.6.23 regression, so I can cc
> the Rafael which never forgets, so it will then get tracked all the way into
> Linus's tree)
> 

Jens said he applied it, so I figured the issue was handled. Jens, what happened to it?

Rgds
-- 
     -- Pierre Ossman

  Linux kernel, MMC maintainer        http://www.kernel.org
  PulseAudio, core developer          http://pulseaudio.org
  rdesktop, core developer          http://www.rdesktop.org

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] mmc: Add missing sg_init_table() call
  2007-11-27  5:57   ` Pierre Ossman
@ 2007-11-27  8:54     ` Jens Axboe
  2007-11-27 17:27       ` Rafael J. Wysocki
  0 siblings, 1 reply; 7+ messages in thread
From: Jens Axboe @ 2007-11-27  8:54 UTC (permalink / raw)
  To: Pierre Ossman; +Cc: Andrew Morton, Haavard Skinnemoen, LKML, Rafael J. Wysocki

On Tue, Nov 27 2007, Pierre Ossman wrote:
> On Mon, 26 Nov 2007 21:29:55 -0800
> Andrew Morton <akpm@linux-foundation.org> wrote:
> 
> > 
> > Pierre, I can queue this up but if you merge it into your tree I shall drop
> > it and shall lose track of it.  So it's then all down to you to remember to
> > get the fix into 2.6.24.
> > 
> > (Except this particular bug looks like a post-2.6.23 regression, so I can cc
> > the Rafael which never forgets, so it will then get tracked all the way into
> > Linus's tree)
> > 
> 
> Jens said he applied it, so I figured the issue was handled. Jens,
> what happened to it?

It's in my for-linus branch, it was applied when I wrote that reply. So
it's going upstream, the pull request has been sent to Linus.

My error here was not updating the for-akpm branch that Andrew pulls, so
he doesn't notice the patch. That is also updated now.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] mmc: Add missing sg_init_table() call
  2007-11-27  5:29 ` Andrew Morton
  2007-11-27  5:57   ` Pierre Ossman
@ 2007-11-27  9:11   ` Haavard Skinnemoen
  1 sibling, 0 replies; 7+ messages in thread
From: Haavard Skinnemoen @ 2007-11-27  9:11 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Pierre Ossman, LKML, Rafael J. Wysocki

On Mon, 26 Nov 2007 21:29:55 -0800
Andrew Morton <akpm@linux-foundation.org> wrote:

> On Thu, 22 Nov 2007 20:32:51 +0100 Haavard Skinnemoen <hskinnemoen@atmel.com> wrote:
> 
> > mmc_init_queue only initializes the scatterlists with sg_init_table()
> > when using a bounce buffer. This leads to a BUG() when CONFIG_DEBUG_SG
> > is set.
> >   
> 
> I assume that 2.6.23 is not afflicted in this way?

Yes, the sg_init_table() interface and CONFIG_DEBUG_SG were both added
after 2.6.23. Before that, there was no need to do anything special to
initialize a scatterlist array apart from zeroing it.

Haavard

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] mmc: Add missing sg_init_table() call
  2007-11-27  8:54     ` Jens Axboe
@ 2007-11-27 17:27       ` Rafael J. Wysocki
  0 siblings, 0 replies; 7+ messages in thread
From: Rafael J. Wysocki @ 2007-11-27 17:27 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Pierre Ossman, Andrew Morton, Haavard Skinnemoen, LKML

On Tuesday, 27 of November 2007, Jens Axboe wrote:
> On Tue, Nov 27 2007, Pierre Ossman wrote:
> > On Mon, 26 Nov 2007 21:29:55 -0800
> > Andrew Morton <akpm@linux-foundation.org> wrote:
> > 
> > > 
> > > Pierre, I can queue this up but if you merge it into your tree I shall drop
> > > it and shall lose track of it.  So it's then all down to you to remember to
> > > get the fix into 2.6.24.
> > > 
> > > (Except this particular bug looks like a post-2.6.23 regression, so I can cc
> > > the Rafael which never forgets, so it will then get tracked all the way into
> > > Linus's tree)
> > > 
> > 
> > Jens said he applied it, so I figured the issue was handled. Jens,
> > what happened to it?
> 
> It's in my for-linus branch, it was applied when I wrote that reply. So
> it's going upstream, the pull request has been sent to Linus.
> 
> My error here was not updating the for-akpm branch that Andrew pulls, so
> he doesn't notice the patch. That is also updated now.

OK, so I'm not going to list it.

Thanks,
Rafael

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-11-27 17:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-22 19:32 [PATCH] mmc: Add missing sg_init_table() call Haavard Skinnemoen
2007-11-23  9:18 ` Jens Axboe
2007-11-27  5:29 ` Andrew Morton
2007-11-27  5:57   ` Pierre Ossman
2007-11-27  8:54     ` Jens Axboe
2007-11-27 17:27       ` Rafael J. Wysocki
2007-11-27  9:11   ` Haavard Skinnemoen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox