Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1554704

blk_queue_bounce_limit() broken for mask=0xffffffff on 64bit archs

From Nikita Yushchenko <nikita.yoush@cogentembedded.com>
Newsgroups linux.kernel
Subject blk_queue_bounce_limit() broken for mask=0xffffffff on 64bit archs
Date 2017-01-09 21:50 +0100
Message-ID <sXP3b-qJ-27@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Hi

There is a use cases when architecture is 64-bit but hardware supports
only DMA to lower 4G of address space. E.g. NVMe device on RCar PCIe host.

For such cases, it looks proper to call blk_queue_bounce_limit() with
mask set to 0xffffffff - thus making block layer to use bounce buffers
for any addresses beyond 4G.  To support that, architecture provides
GFP_DMA zone that covers exactly low 4G on arm64.

However setting this limit does not work:

  if (b_pfn < (min_t(u64, 0xffffffffUL, BLK_BOUNCE_HIGH) >> PAGE_SHIFT))
      dma = 1;

When mask is 0xffffffff that condition is false

  q->limits.bounce_pfn = max(max_low_pfn, b_pfn);

this line is executed and replaces any limit with end of memory (on
64bit arch all memory is low).


Not sure how to fix this properly. Any hints?

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

blk_queue_bounce_limit() broken for mask=0xffffffff on 64bit archs Nikita Yushchenko <nikita.yoush@cogentembedded.com> - 2017-01-09 21:50 +0100
  Re: blk_queue_bounce_limit() broken for mask=0xffffffff on 64bit  archs Christoph Hellwig <hch@infradead.org> - 2017-01-09 22:10 +0100
  Re: blk_queue_bounce_limit() broken for mask=0xffffffff on 64bit archs Ming Lei <tom.leiming@gmail.com> - 2017-01-13 07:10 +0100
    Re: blk_queue_bounce_limit() broken for mask=0xffffffff on 64bit  archs Nikita Yushchenko <nikita.yoush@cogentembedded.com> - 2017-01-13 07:20 +0100

csiph-web