Hi, kbuild test robot <lkp@xxxxxxxxx> writes: > [auto build test ERROR on usb/usb-testing] > [also build test ERROR on v4.6-rc4 next-20160421] > [if your patch is applied to the wrong git tree, please drop us a note to help improving the system] > > url: https://github.com/0day-ci/linux/commits/Felipe-Balbi/usb-xhci-get-rid-of-xhci_plat_type_is/20160422-162823 > base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing > config: mips-allyesconfig (attached as .config) > reproduce: > wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross > chmod +x ~/bin/make.cross > # save the attached .config to linux build tree > make.cross ARCH=mips > > All errors (new ones prefixed by >>): > > drivers/usb/host/xhci-rcar.c: In function 'xhci_rcar_is_gen3': >>> drivers/usb/host/xhci-rcar.c:94:62: error: expected expression before ')' token > return of_device_is_compatible(node, "renesas,xhci-r8a7795",) || > ^ >>> drivers/usb/host/xhci-rcar.c:94:9: error: too many arguments to function 'of_device_is_compatible' > return of_device_is_compatible(node, "renesas,xhci-r8a7795",) || > ^ > In file included from drivers/usb/host/xhci-rcar.c:14:0: > include/linux/of.h:308:12: note: declared here > extern int of_device_is_compatible(const struct device_node *device, > ^ > > vim +94 drivers/usb/host/xhci-rcar.c > > 88 } > 89 > 90 static int xhci_rcar_is_gen3(struct device *dev) > 91 { > 92 struct device_node *node = dev->of_node; > 93 > > 94 return of_device_is_compatible(node, "renesas,xhci-r8a7795",) || argh, this didn't build with x86, my bad. Should've checked. Here's v4 of this patch: From d9238fac29524eae5007f7ed12ef6e71341f66d8 Mon Sep 17 00:00:00 2001 From: Felipe Balbi <felipe.balbi@xxxxxxxxxxxxxxx> Date: Tue, 29 Mar 2016 12:48:44 +0300 Subject: [PATCH] usb: host: xhci: rcar: retire use of xhci_plat_type_is() We're preparing to remove xhci_plat_type_is() in favor of a better approach where we define function pointers ahead of time. This will let us make assumptions about which platforms we're running on and which platform-specific functions we should call. Acked-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@xxxxxxxxxxx> Signed-off-by: Felipe Balbi <felipe.balbi@xxxxxxxxxxxxxxx> --- drivers/usb/host/xhci-rcar.c | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci-rcar.c b/drivers/usb/host/xhci-rcar.c index 623100e9385e..0e4535e632ec 100644 --- a/drivers/usb/host/xhci-rcar.c +++ b/drivers/usb/host/xhci-rcar.c @@ -11,6 +11,7 @@ #include <linux/firmware.h> #include <linux/module.h> #include <linux/platform_device.h> +#include <linux/of.h> #include <linux/usb/phy.h> #include "xhci.h" @@ -76,6 +77,24 @@ static void xhci_rcar_start_gen2(struct usb_hcd *hcd) writel(RCAR_USB3_TX_POL_VAL, hcd->regs + RCAR_USB3_TX_POL); } +static int xhci_rcar_is_gen2(struct device *dev) +{ + struct device_node *node = dev->of_node; + + return of_device_is_compatible(node, "renesas,xhci-r8a7790") || + of_device_is_compatible(node, "renesas,xhci-r8a7791") || + of_device_is_compatible(node, "renesas,xhci-r8a7793") || + of_device_is_compatible(node, "renensas,rcar-gen2-xhci"); +} + +static int xhci_rcar_is_gen3(struct device *dev) +{ + struct device_node *node = dev->of_node; + + return of_device_is_compatible(node, "renesas,xhci-r8a7795") || + of_device_is_compatible(node, "renesas,rcar-gen3-xhci"); +} + void xhci_rcar_start(struct usb_hcd *hcd) { u32 temp; @@ -85,7 +104,7 @@ void xhci_rcar_start(struct usb_hcd *hcd) temp = readl(hcd->regs + RCAR_USB3_INT_ENA); temp |= RCAR_USB3_INT_ENA_VAL; writel(temp, hcd->regs + RCAR_USB3_INT_ENA); - if (xhci_plat_type_is(hcd, XHCI_PLAT_TYPE_RENESAS_RCAR_GEN2)) + if (xhci_rcar_is_gen2(hcd->self.controller)) xhci_rcar_start_gen2(hcd); } } @@ -156,9 +175,22 @@ static int xhci_rcar_download_firmware(struct usb_hcd *hcd) /* This function needs to initialize a "phy" of usb before */ int xhci_rcar_init_quirk(struct usb_hcd *hcd) { + struct xhci_hcd *xhci = hcd_to_xhci(hcd); + /* If hcd->regs is NULL, we don't just call the following function */ if (!hcd->regs) return 0; + /* + * On R-Car Gen2 and Gen3, the AC64 bit (bit 0) of HCCPARAMS1 is set + * to 1. However, these SoCs don't support 64-bit address memory + * pointers. So, this driver clears the AC64 bit of xhci->hcc_params + * to call dma_set_coherent_mask(dev, DMA_BIT_MASK(32)) in + * xhci_gen_setup(). + */ + if (xhci_rcar_is_gen2(hcd->self.controller) || + xhci_rcar_is_gen3(hcd->self.controller)) + xhci->quirks |= XHCI_NO_64BIT_SUPPORT; + return xhci_rcar_download_firmware(hcd); } -- 2.8.1 -- balbi
Attachment:
signature.asc
Description: PGP signature