[ofa-general] [PATCH] mthca memfree init sg list

Pete Wyckoff pw at osc.edu
Wed Feb 13 15:58:02 PST 2008


nab at linux-iscsi.org wrote on Wed, 13 Feb 2008 14:49 -0800:
> On Tue, 2008-02-12 at 16:38 -0500, Pete Wyckoff wrote:
> > Properly initialize the SG list in the user_db_table in mthca memfree.
> > Without this, and when compiling with CONFIG_DEBUG_SG, a BUG will occur
> > during create_cq.  The call to sg_set_page() in mthca_map_user_db()
> > will find that the scatterlist magic was not initialized.
> > 
> > Signed-off-by: Pete Wyckoff <pw at osc.edu>
> > ---
> >  drivers/infiniband/hw/mthca/mthca_memfree.c |    1 +
> >  1 files changed, 1 insertions(+), 0 deletions(-)
> > 
> > diff --git a/drivers/infiniband/hw/mthca/mthca_memfree.c b/drivers/infiniband/hw/mthca/mthca_memfree.c
> > index 1f4d27d..252db08 100644
> > --- a/drivers/infiniband/hw/mthca/mthca_memfree.c
> > +++ b/drivers/infiniband/hw/mthca/mthca_memfree.c
> > @@ -542,6 +542,7 @@ struct mthca_user_db_table *mthca_init_user_db_tab(struct mthca_dev *dev)
> >  	for (i = 0; i < npages; ++i) {
> >  		db_tab->page[i].refcount = 0;
> >  		db_tab->page[i].uvirt    = 0;
> > +		sg_init_table(&db_tab->page[i].mem, 1);
> >  	}
> >  
> >  	return db_tab;
> 
> Should these scatterlist initializations include the new sg_mark_end()
> usage by default as well..?

No.  sg_init_table() does this.

		-- Pete



More information about the general mailing list