Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Apr 2015 13:34:42 +0200
From:      Svatopluk Kraus <onwahe@gmail.com>
To:        freebsd-current@freebsd.org
Subject:   [patch] fix add_bounce_page() for BUS_DMA_KEEP_PG_OFFSET
Message-ID:  <CAFHCsPVgYHL0OyMnn1b2DcNiQO-20k1aDvJNvFjwU21YxB29Cw@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
--001a113ec1f248a1f0051476c854
Content-Type: text/plain; charset=UTF-8

The add_bounce_page() can be called from _bus_dmamap_load_phys().
Client virtual address is zero (not valid) in that case. So, client
physical address must be used to get an offset when
BUS_DMA_KEEP_PG_OFFSET flag is set. Note that client physical address
is always valid.

Svatopluk Kraus

--001a113ec1f248a1f0051476c854
Content-Type: text/plain; charset=US-ASCII; name="add_bounce_page.diff"
Content-Disposition: attachment; filename="add_bounce_page.diff"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_i8vijyvi0

ZGlmZiAtLWdpdCBhL3N5cy9hcm0vYXJtL2J1c2RtYV9tYWNoZGVwLXY2LmMgYi9zeXMvYXJtL2Fy
bS9idXNkbWFfbWFjaGRlcC12Ni5jCmluZGV4IGVkNTAxYzUuLjcyMzZjNWEgMTAwNjQ0Ci0tLSBh
L3N5cy9hcm0vYXJtL2J1c2RtYV9tYWNoZGVwLXY2LmMKKysrIGIvc3lzL2FybS9hcm0vYnVzZG1h
X21hY2hkZXAtdjYuYwpAQCAtMTY4NSw4ICsxNjg1LDggQEAgYWRkX2JvdW5jZV9wYWdlKGJ1c19k
bWFfdGFnX3QgZG1hdCwgYnVzX2RtYW1hcF90IG1hcCwgdm1fb2Zmc2V0X3QgdmFkZHIsCiAKIAlp
ZiAoZG1hdC0+ZmxhZ3MgJiBCVVNfRE1BX0tFRVBfUEdfT0ZGU0VUKSB7CiAJCS8qIFBhZ2Ugb2Zm
c2V0IG5lZWRzIHRvIGJlIHByZXNlcnZlZC4gKi8KLQkJYnBhZ2UtPnZhZGRyIHw9IHZ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KLQkJYnBhZ2UtPmJ1c2FkZHIgfD0gdmFkZHIgJiBQQUdFX01BU0s7CisJCWJwYWdlLT52YWRk
ciB8PSBhZGRyICYgUEFHRV9NQVNLOworCQlicGFnZS0+YnVzYWRkciB8PSBhZGRyICYgUEFHRV9N
QVNLOwogCX0KIAlicGFnZS0+ZGF0YXZhZGRyID0gdmFkZHI7CiAJYnBhZ2UtPmRhdGFhZGRyID0g
YWRkcjsK
--001a113ec1f248a1f0051476c854--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFHCsPVgYHL0OyMnn1b2DcNiQO-20k1aDvJNvFjwU21YxB29Cw>