Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Jul 2021 16:13:32 +0200
From:      Gary Jennejohn <gljennjohn@gmail.com>
To:        Sha Faisal via freebsd-hackers <freebsd-hackers@FreeBSD.org>
Cc:        sfaisal@juniper.net, Justin Hibbits <jhibbits@juniper.net>, Kumara N Babu <bkumara@juniper.net>, Vikram M Gadagkar <vikramg@juniper.net>
Subject:   Re: Generic-xhci driver issue and changes for 64-but physical memory space
Message-ID:  <20210729141332.08d62f21@ernst.home>
In-Reply-To: <1A9919BF-4D07-4D71-B795-D6CFF6CD0FF1@juniper.net>
References:  <5A15D0DF-6D41-4F17-B07A-D5A061057644@juniper.net> <30397365-BC3C-41C4-BF55-0D13778EF0A8@juniper.net> <1A9919BF-4D07-4D71-B795-D6CFF6CD0FF1@juniper.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 29 Jul 2021 11:20:13 +0000
Sha Faisal via freebsd-hackers <freebsd-hackers@FreeBSD.org> wrote:

> Mailing to freebsd-hackers, after adding my email id to subscriber list.
> Please assist with the below query.
> 
> Regards
> Faisal
> 
> From: Sha Faisal <sfaisal@juniper.net>
> Date: Thursday, 29 July 2021 at 12:19 AM
> To: "hackers@freebsd.org" <hackers@freebsd.org>
> Cc: Justin Hibbits <jhibbits@juniper.net>, Kumara N Babu <bkumara@juniper.net>, Vikram M Gadagkar <vikramg@juniper.net>
> Subject: Generic-xhci driver issue and changes for 64-but physical memory space
> 
> Hello FreeBSD-hackers
> 
> Inn one of our new platforms we have physical RAM placed above the 4GB mark.
> And the eUSB device is capable of doing 64-bit DMA.
> 
> The USBPHY uses the generic-xhci driver and when we were bringing-up we hit the issue below and the code panics
> 
> xhci0: <Marvell Integrated USB 3.0 controller> mem 0x10243000-0x10243fff irq 15 on simplebus1
> xhci0: 64 bytes context size, 32-bit DMA
> panic: vm_wait in early boot
> 
> I modified the below function call , and the usb driver is up and it works fine. Please suggest if this change is fine and can be incorporated.
> 
> 
> #define IS_DMA_32B      1
> 
> #define IS_DMA_64B      0
> 
> 
> err = xhci_init(sc, dev, IS_DMA_64B);
> 

As a locally maintained patch this would be acceptable.  But I greatly
doubt that this change would make it into the source tree as written.

Since the generic-xhci driver knows basically nothing about the hardware
it takes the conservative approach of always using 32-bit DMA.

Strangely enough, the code in xhci.c, which tries to determine the DMA
size by reading a register in the controller, thinks that this
controller only supports 32-bit DMA.

If I were the maintainer of this code the only way I would allow this
change would be if it used the pci register values unique to this
controller to set the dma32 flag in xhci_init() to 0 and otherwise
keep the default value of 1.

-- 
Gary Jennejohn



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