[openib-general] [PATCH 3 of 4] IB/mthca: fix non-cache-coherent CPUs with memfree

Roland Dreier rdreier at cisco.com
Wed Feb 14 07:34:50 PST 2007


 > > I don't see anything that ever bumps chunk->nsg if we're allocating a
 > > coherent region and we end up needing more than one allocation to do
 > > it.
 > 
 > Yes but this is intentional.

 > No, I think the code is fine and this patch will break things:
 > chunk->nsg is needed only for non-coherent memory to call pci_unmap_sg:

what about this code in mthca_memfree.h?

	static inline void mthca_icm_next(struct mthca_icm_iter *iter)
	{
		if (++iter->page_idx >= iter->chunk->nsg) {

the call to pci_unmap_sg you're worried about is in
mthca_free_icm_pages(), which can't be called for coherent memory
anyway, so I don't see a problem with that.

So I think my patch is correct and needed.

 - R.




More information about the general mailing list