Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bfc20c2a authored by Jack Pham's avatar Jack Pham
Browse files

usb: msm_otg: Support LPAE systems



Targets having large physical address extension support
enabled (CONFIG_ARM_LPAE) have phys_addr_t and dma_addr_t
defined as 64-bit types. When printing messages with these
addresses the format string needs to use '%pa' instead of
'%x' and pass the physical address by reference. This patch
addresses these in the USB 2.0 OTG, host, and gadget controller
drivers.

Also extend coherent dma_mask from 32-bits to 64-bits to match
that of dma_mask.  This fixes the following runtime error when
booting on LPAE systems:

	msm_hsusb msm_hsusb: coherent DMA mask 0xffffffff is smaller
	than system GFP_DMA mask 0xffffffffffffffff

Change-Id: I1a45b62dd51f6d3f54b43cf657f5b4e5c2a7620f
Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
parent dc3f6933
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -1110,8 +1110,8 @@ static void dbg_usb_op_fail(u8 addr, const char *name,
		list_for_each(ptr, &mep->qh.queue) {
			req = list_entry(ptr, struct ci13xxx_req, queue);
			scnprintf(msg, sizeof(msg),
					"%08X:%08X:%08X\n",
					req->dma, req->ptr->next,
					"%pa:%08X:%08X\n",
					&req->dma, req->ptr->next,
					req->ptr->token);
			dbg_print(addr, "REQ", 0, msg);
			scnprintf(msg, sizeof(msg), "%08X:%d\n",
@@ -1598,8 +1598,8 @@ static ssize_t print_dtds(struct device *dev,
	list_for_each(ptr, &mEp->qh.queue) {
		req = list_entry(ptr, struct ci13xxx_req, queue);

		pr_info("\treq:%08x next:%08x token:%08x page0:%08x status:%d\n",
				req->dma, req->ptr->next, req->ptr->token,
		pr_info("\treq:%pa next:%08x token:%08x page0:%08x status:%d\n",
				&req->dma, req->ptr->next, req->ptr->token,
				req->ptr->page[0], req->req.status);
	}
done:
@@ -1901,8 +1901,8 @@ static void ep_prime_timer_func(unsigned long data)
				mep->qh.ptr->td.next, mep->qh.ptr->td.token);
		list_for_each(ptr, &mep->qh.queue) {
			req = list_entry(ptr, struct ci13xxx_req, queue);
			pr_info("\treq:%08xnext:%08xtkn:%08xpage0:%08xsts:%d\n",
					req->dma, req->ptr->next,
			pr_info("\treq:%pa:%08xtkn:%08xpage0:%08xsts:%d\n",
					&req->dma, req->ptr->next,
					req->ptr->token, req->ptr->page[0],
					req->req.status);
		}
+1 −1
Original line number Diff line number Diff line
@@ -94,7 +94,7 @@ static int ehci_msm_probe(struct platform_device *pdev)
	if (!pdev->dev.dma_mask)
		pdev->dev.dma_mask = &msm_ehci_dma_mask;
	if (!pdev->dev.coherent_dma_mask)
		pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
		pdev->dev.coherent_dma_mask = DMA_BIT_MASK(64);

	hcd = usb_create_hcd(&ehci_msm_hc_driver, &pdev->dev,
			     dev_name(&pdev->dev));
+1 −1
Original line number Diff line number Diff line
@@ -3884,7 +3884,7 @@ static struct platform_device *msm_otg_add_pdev(
		goto error;
	}

	pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
	pdev->dev.coherent_dma_mask = DMA_BIT_MASK(64);
	pdev->dev.dma_mask = &msm_otg_dma_mask;

	if (num) {