Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Oct 2020 00:26:05 -0700
From:      Mark Millard <marklmi@yahoo.com>
To:        freebsd-arm <freebsd-arm@freebsd.org>
Subject:   Adding a "-1" into https://reviews.freebsd.org/D25219 's code looks to make uefi/ACPI handle USB3 SSD reliably
Message-ID:  <5F1CF0D1-9FA2-48B9-984B-6A2B98CB87E9@yahoo.com>
References:  <5F1CF0D1-9FA2-48B9-984B-6A2B98CB87E9.ref@yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
https://reviews.freebsd.org/D25219 has (in part)

> +	if (bus_dma_tag_create(NULL, 1, 0,
> +		limits.lowaddr, BUS_SPACE_MAXADDR, NULL, NULL,

Based on sysctl hw.busdma output and testing a change for the =
u-boot/DTB/fdt code context that worked in testing so far, I've tried =
using limits.lowaddr-1 in the above ACPI handling code instead.

It has worked so far.

So both existing implementations have the same basic
problem as far as I can tell: limits.lowaddr too large
by one, so identifying the wrong page.



What sysctl showed me was the likes of (before
changes that lead to lack of zone2 for u-boot/dtb/fdt):

. . .
hw.busdma.zone2.lowaddr: 0x3c000fff
. . .
hw.busdma.zone1.lowaddr: 0x3fffffff
. . .
hw.busdma.zone0.lowaddr: 0xffffffff
. . .

So I've guessed that lowaddr should identify the
end page of the possibly-use-it-directly region,
not the first do-not-use-it-directly page. If I've
guessed wrong, at most it would bounce one page
that it could avoid bouncing. But, if I guessed
correct, it might bounce a page that it should
instead of not doing so. Thus the "-1" addition.

For reference, after the first duplicate-and-diff test
for uefi/ACPI:

# sysctl hw.busdma
hw.busdma.zone0.alignment: 4096
hw.busdma.zone0.lowaddr: 0xbfffffff
hw.busdma.zone0.total_deferred: 0
hw.busdma.zone0.total_bounced: 762568
hw.busdma.zone0.active_bpages: 12
hw.busdma.zone0.reserved_bpages: 0
hw.busdma.zone0.free_bpages: 824
hw.busdma.zone0.total_bpages: 836
hw.busdma.total_bpages: 836

I'll note that "total_bounced" need not be the
a page count: it is incremented by 1 after
the loop for a bounce, not inside the loop.
Lots of pages of data were bounced.

=3D=3D=3D
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5F1CF0D1-9FA2-48B9-984B-6A2B98CB87E9>