Re: [PATCH v6] xhci : AMD Promontory USB disable port support

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

 



Hi Joe,

[auto build test WARNING on usb/usb-testing]
[also build test WARNING on v4.14-rc2]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Joe-Lee/xhci-AMD-Promontory-USB-disable-port-support/20170925-212427
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
config: x86_64-randconfig-x011-201739 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All warnings (new ones prefixed by >>):

   In file included from include/asm-generic/bug.h:4:0,
                    from arch/x86/include/asm/bug.h:81,
                    from include/linux/bug.h:4,
                    from include/linux/mmdebug.h:4,
                    from include/linux/gfp.h:4,
                    from include/linux/slab.h:14,
                    from drivers/usb//host/xhci-hub.c:24:
   drivers/usb//host/xhci-hub.c: In function 'xhci_bus_suspend':
   drivers/usb//host/xhci-hub.c:1511:9: error: implicit declaration of function 'usb_amd_pt_check_port' [-Werror=implicit-function-declaration]
        if (usb_amd_pt_check_port(hcd->self.controller,
            ^
   include/linux/compiler.h:156:30: note: in definition of macro '__trace_if'
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
                                 ^~~~
>> drivers/usb//host/xhci-hub.c:1511:5: note: in expansion of macro 'if'
        if (usb_amd_pt_check_port(hcd->self.controller,
        ^~
   cc1: some warnings being treated as errors

vim +/if +1511 drivers/usb//host/xhci-hub.c

  1451	
  1452	int xhci_bus_suspend(struct usb_hcd *hcd)
  1453	{
  1454		struct xhci_hcd	*xhci = hcd_to_xhci(hcd);
  1455		int max_ports, port_index;
  1456		__le32 __iomem **port_array;
  1457		struct xhci_bus_state *bus_state;
  1458		unsigned long flags;
  1459	
  1460		max_ports = xhci_get_ports(hcd, &port_array);
  1461		bus_state = &xhci->bus_state[hcd_index(hcd)];
  1462	
  1463		spin_lock_irqsave(&xhci->lock, flags);
  1464	
  1465		if (hcd->self.root_hub->do_remote_wakeup) {
  1466			if (bus_state->resuming_ports ||	/* USB2 */
  1467			    bus_state->port_remote_wakeup) {	/* USB3 */
  1468				spin_unlock_irqrestore(&xhci->lock, flags);
  1469				xhci_dbg(xhci, "suspend failed because a port is resuming\n");
  1470				return -EBUSY;
  1471			}
  1472		}
  1473	
  1474		port_index = max_ports;
  1475		bus_state->bus_suspended = 0;
  1476		while (port_index--) {
  1477			/* suspend the port if the port is not suspended */
  1478			u32 t1, t2;
  1479			int slot_id;
  1480	
  1481			t1 = readl(port_array[port_index]);
  1482			t2 = xhci_port_state_to_neutral(t1);
  1483	
  1484			if ((t1 & PORT_PE) && !(t1 & PORT_PLS_MASK)) {
  1485				xhci_dbg(xhci, "port %d not suspended\n", port_index);
  1486				slot_id = xhci_find_slot_id_by_port(hcd, xhci,
  1487						port_index + 1);
  1488				if (slot_id) {
  1489					spin_unlock_irqrestore(&xhci->lock, flags);
  1490					xhci_stop_device(xhci, slot_id, 1);
  1491					spin_lock_irqsave(&xhci->lock, flags);
  1492				}
  1493				t2 &= ~PORT_PLS_MASK;
  1494				t2 |= PORT_LINK_STROBE | XDEV_U3;
  1495				set_bit(port_index, &bus_state->bus_suspended);
  1496			}
  1497			/* USB core sets remote wake mask for USB 3.0 hubs,
  1498			 * including the USB 3.0 roothub, but only if CONFIG_PM
  1499			 * is enabled, so also enable remote wake here.
  1500			 */
  1501			if (hcd->self.root_hub->do_remote_wakeup) {
  1502				if (t1 & PORT_CONNECT) {
  1503					t2 |= PORT_WKOC_E | PORT_WKDISC_E;
  1504					t2 &= ~PORT_WKCONN_E;
  1505				} else {
  1506					t2 |= PORT_WKOC_E | PORT_WKCONN_E;
  1507					t2 &= ~PORT_WKDISC_E;
  1508				}
  1509				if ((xhci->quirks & XHCI_U2_DISABLE_WAKE) &&
  1510				(hcd->speed < HCD_USB3)) {
> 1511					if (usb_amd_pt_check_port(hcd->self.controller,
  1512									port_index))
  1513						t2 &= ~PORT_WAKE_BITS;
  1514				}
  1515			} else
  1516				t2 &= ~PORT_WAKE_BITS;
  1517	
  1518			t1 = xhci_port_state_to_neutral(t1);
  1519			if (t1 != t2)
  1520				writel(t2, port_array[port_index]);
  1521		}
  1522		hcd->state = HC_STATE_SUSPENDED;
  1523		bus_state->next_statechange = jiffies + msecs_to_jiffies(10);
  1524		spin_unlock_irqrestore(&xhci->lock, flags);
  1525		return 0;
  1526	}
  1527	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux