[Bug 196081] [PATCH] ARM: sunxi: Add driver for the MMC/SD host found in the Allwinner A10 SoC

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sun Mar 29 19:05:51 UTC 2015


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196081

--- Comment #7 from Martin Galvan <omgalvan.86 at gmail.com> ---
(In reply to Pratik Singhal from comment #6)
I looked at the patch you sent. Did you actually test this on the
board with CURRENT? The reason I'm asking is that I don't think that
patch could work as intended.

You're doing:

do {
    reg_value = a10_mmc_read_4(sc, A10_MMC_GLOBAL_CONTROL_REG);
} while ((!reg_value & A10_MMC_HARDWARE_RESET_BITS) && (--time_left));

Do you realize the ! is zeroing reg_value before it gets AND-ed with
A10_MMC_HARDWARE_RESET_BITS? I think what you wanted to do was:

!(reg_value & A10_MMC_HARDWARE_RESET_BITS)

Now, I don't remember every detail of how the host worked, but I
recall I had to wait while the hardware reset bits were set on the
global control reg; it would be safe to proceed only after those bits
were cleared. I think the hardware automatically clears those bits
after the reset is finished. I may be wrong, though.

The problem Bas reported sounds to me like a NULL pointer being
dereferenced somewhere, or something like that. I think that may be
the cause because we'd always get a translation fault when doing
something like that, while waiting forever would usually just cause
the system to hang.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-arm mailing list