PERFORCE change 152649 for review - busdma problem

Hans Petter Selasky hselasky at c2i.net
Fri Nov 14 08:42:53 PST 2008


Hi,

On Friday 14 November 2008, Alexander Motin wrote:
> Hi.
>
> Hans Petter Selasky wrote:
> > I am going to revert this patch and suggest a new one. I am not sure how
> > to best implement it, but will it be Ok if I make the offset adjustment
> > only for alignment <= 1 byte ?
>
> Alignment <= 1 byte means no (any possible) alignment. So busdma may use
> any physical address within permitted range. Adding strict requirement
> that this address should be aligned withing page same as logical address
> will IMHO be too restrictive and as I understand will lead to additional
> physical memory consumption.

No, it won't.

>
> I am not very understand the problem and how are you going to manage it.
> As I understand, the problem is that you can specify offset for
> non-first scatter/gather segment only as page address. Is it correct? 

Yes.

> So 
> which in-page offset used for that segments? If zero, you should just
> specify busdma to align all segments to the page boundary. 

The thing is, you cannot specify how many bytes are on the first page which 
can take a full physical address. It is assumed that after the page offset 
wraps to zero a new page begins.

Example:

xxx: means data

Virtual memory:
  PG0  PG1
| xxx|xxx |

In busdma bounce buffer:

  PG0  PG1
|xxx |xxx |

You see there is a hole just before PG1, and it is impossible to tell the USB 
hardware to skip this hole.

> If it should 
> be the same as after the last sent data, then I can hardly imagine how
> are you going to manage this to implement real scatter/gather for
> misaligned data.
>
> > Is there any documentation or specification that needs to be updated?
>
> Sorry, I am not a busdma expert, I was just digging it several times
> while working on some drivers.

Thanks for your comment about alignment! I didn't see that in the first place.

--HPS


More information about the p4-projects mailing list