Re: barebox for iMX8MMini crashes while usb_rescan for USB type A

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Albert,

On Mon, Jan 13, 2020 at 07:54:54AM +0000, Albert, Elmar wrote:
> Hello everybody,
> 
> I'm working on a customer board based on an iMX8MMini using Barebox
> based on version 2019.05.0. We have problems to bring-up the USB with
> type A connector,
> we are not using type C as on the NXP EVK.
> 
> I added the iMX8MMini to the drivers/usb/imx/imx-usb-misc.c completely
> separated from the already implementation for the iMX7D.
> 
> When starting an usb_rescan using the usb command, barebox crashes with
> an exception. I updated the usb driver to version 2019.12.0, but get the
> same behaviour,
> it crashes with an exception:
> 
> DABT (current EL) exception (ESR 0x96000061) at 0x000000005ff4005c

The problem seems to be here that memset is called on non aligned memory
that is allocated with dma_alloc_coherent(). On ARM64 we have memset
implemented like this:

void *memset(void *dst, int c, __kernel_size_t size)
{
        if (likely(get_cr() & CR_M))
                return __arch_memset(dst, c, size);

        return __default_memset(dst, c, size);
}

As you found out __arch_memset() crashes in your case. The test
get_cr() & CR_M isn't quite correct here. We must test here how the page
is mapped, not if the MMU is enabled. This test might be too expensive
here, so that it's probably better to introduce and use memset_io here
which doesn't try this optimization.

Andrey, as you introduced this code, do you have any ideas to share what
we want to do here?

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux