[PATCH -next] USB: gadget: udc: Add missing platform_device_put() on error in bdc_pci_probe()

2018-01-23 Thread Wei Yongjun
Add the missing platform_device_put() before return from bdc_pci_probe()
in the platform_device_add_resources() error handling case.

Fixes: efed421a94e6 ("usb: gadget: Add UDC driver for Broadcom USB3.0 device 
controller IP BDC")
Signed-off-by: Wei Yongjun 
---
 drivers/usb/gadget/udc/bdc/bdc_pci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/gadget/udc/bdc/bdc_pci.c 
b/drivers/usb/gadget/udc/bdc/bdc_pci.c
index 1e940f0..6dbc489 100644
--- a/drivers/usb/gadget/udc/bdc/bdc_pci.c
+++ b/drivers/usb/gadget/udc/bdc/bdc_pci.c
@@ -77,6 +77,7 @@ static int bdc_pci_probe(struct pci_dev *pci, const struct 
pci_device_id *id)
if (ret) {
dev_err(&pci->dev,
"couldn't add resources to bdc device\n");
+   platform_device_put(bdc);
return ret;
}

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/6] USB: move many drivers to use DEVICE_ATTR_RO

2018-01-23 Thread Greg Kroah-Hartman
Instead of "open coding" a DEVICE_ATTR() define, use the
DEVICE_ATTR_RO() macro instead, which does everything properly instead.

This does require a few static functions to be renamed to work properly,
but thanks to a script from Joe Perches, this was easily done.

Reported-by: Joe Perches 
Cc: Matthieu CASTET 
Cc: Stanislaw Gruszka 
Cc: Oliver Neukum 
Cc: Pete Zaitcev 
Cc: Felipe Balbi 
Cc: Alan Stern 
Signed-off-by: Greg Kroah-Hartman 
---
 drivers/usb/atm/ueagle-atm.c  |  8 
 drivers/usb/class/cdc-acm.c   | 12 ++--
 drivers/usb/class/usblp.c |  4 ++--
 drivers/usb/phy/phy-tahvo.c   |  4 ++--
 drivers/usb/phy/phy-twl6030-usb.c |  4 ++--
 drivers/usb/storage/sierra_ms.c   |  4 ++--
 6 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/drivers/usb/atm/ueagle-atm.c b/drivers/usb/atm/ueagle-atm.c
index adc06609219f..58967769d2ec 100644
--- a/drivers/usb/atm/ueagle-atm.c
+++ b/drivers/usb/atm/ueagle-atm.c
@@ -2315,7 +2315,7 @@ static ssize_t stat_status_store(struct device *dev, 
struct device_attribute *at
 
 static DEVICE_ATTR_RW(stat_status);
 
-static ssize_t read_human_status(struct device *dev,
+static ssize_t stat_human_status_show(struct device *dev,
struct device_attribute *attr, char *buf)
 {
int ret = -ENODEV;
@@ -2376,9 +2376,9 @@ static ssize_t read_human_status(struct device *dev,
return ret;
 }
 
-static DEVICE_ATTR(stat_human_status, S_IRUGO, read_human_status, NULL);
+static DEVICE_ATTR_RO(stat_human_status);
 
-static ssize_t read_delin(struct device *dev, struct device_attribute *attr,
+static ssize_t stat_delin_show(struct device *dev, struct device_attribute 
*attr,
char *buf)
 {
int ret = -ENODEV;
@@ -2408,7 +2408,7 @@ static ssize_t read_delin(struct device *dev, struct 
device_attribute *attr,
return ret;
 }
 
-static DEVICE_ATTR(stat_delin, S_IRUGO, read_delin, NULL);
+static DEVICE_ATTR_RO(stat_delin);
 
 #define UEA_ATTR(name, reset)  \
\
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 18bbe3fedb8b..06b3b54a0e68 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -235,7 +235,7 @@ static int acm_start_wb(struct acm *acm, struct acm_wb *wb)
 /*
  * attributes exported through sysfs
  */
-static ssize_t show_caps
+static ssize_t bmCapabilities_show
 (struct device *dev, struct device_attribute *attr, char *buf)
 {
struct usb_interface *intf = to_usb_interface(dev);
@@ -243,9 +243,9 @@ static ssize_t show_caps
 
return sprintf(buf, "%d", acm->ctrl_caps);
 }
-static DEVICE_ATTR(bmCapabilities, S_IRUGO, show_caps, NULL);
+static DEVICE_ATTR_RO(bmCapabilities);
 
-static ssize_t show_country_codes
+static ssize_t wCountryCodes_show
 (struct device *dev, struct device_attribute *attr, char *buf)
 {
struct usb_interface *intf = to_usb_interface(dev);
@@ -255,9 +255,9 @@ static ssize_t show_country_codes
return acm->country_code_size;
 }
 
-static DEVICE_ATTR(wCountryCodes, S_IRUGO, show_country_codes, NULL);
+static DEVICE_ATTR_RO(wCountryCodes);
 
-static ssize_t show_country_rel_date
+static ssize_t iCountryCodeRelDate_show
 (struct device *dev, struct device_attribute *attr, char *buf)
 {
struct usb_interface *intf = to_usb_interface(dev);
@@ -266,7 +266,7 @@ static ssize_t show_country_rel_date
return sprintf(buf, "%d", acm->country_rel_date);
 }
 
-static DEVICE_ATTR(iCountryCodeRelDate, S_IRUGO, show_country_rel_date, NULL);
+static DEVICE_ATTR_RO(iCountryCodeRelDate);
 /*
  * Interrupt handlers for various ACM device responses
  */
diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c
index c454885ef4a0..ca1d0ede41b5 100644
--- a/drivers/usb/class/usblp.c
+++ b/drivers/usb/class/usblp.c
@@ -1066,7 +1066,7 @@ static struct usb_class_driver usblp_class = {
.minor_base =   USBLP_MINOR_BASE,
 };
 
-static ssize_t usblp_show_ieee1284_id(struct device *dev, struct 
device_attribute *attr, char *buf)
+static ssize_t ieee1284_id_show(struct device *dev, struct device_attribute 
*attr, char *buf)
 {
struct usb_interface *intf = to_usb_interface(dev);
struct usblp *usblp = usb_get_intfdata(intf);
@@ -1078,7 +1078,7 @@ static ssize_t usblp_show_ieee1284_id(struct device *dev, 
struct device_attribut
return sprintf(buf, "%s", usblp->device_id_string+2);
 }
 
-static DEVICE_ATTR(ieee1284_id, S_IRUGO, usblp_show_ieee1284_id, NULL);
+static DEVICE_ATTR_RO(ieee1284_id);
 
 static int usblp_probe(struct usb_interface *intf,
   const struct usb_device_id *id)
diff --git a/drivers/usb/phy/phy-tahvo.c b/drivers/usb/phy/phy-tahvo.c
index 7f7c5c82420d..0981abc3d1ad 100644
--- a/drivers/usb/phy/phy-tahvo.c
+++ b/drivers/usb/phy/phy-tahvo.c
@@ -59,13 +59,13 @@ static const unsigned int tahvo_cable[] = {
EXTCON_NONE,
 };
 

[PATCH 1/6] USB: move many drivers to use DEVICE_ATTR_RW

2018-01-23 Thread Greg Kroah-Hartman
Instead of "open coding" a DEVICE_ATTR() define, use the
DEVICE_ATTR_RW() macro instead, which does everything properly instead.

This does require a few static functions to be renamed to work properly,
but thanks to a script from Joe Perches, this was easily done.

Reported-by: Joe Perches 
Cc: Matthieu CASTET 
Cc: Stanislaw Gruszka 
Cc: Peter Chen 
Cc: Alan Stern 
Cc: Mathias Nyman 
Cc: Bin Liu 
Cc: Felipe Balbi 
Signed-off-by: Greg Kroah-Hartman 
---
 drivers/usb/atm/ueagle-atm.c  |  6 +++---
 drivers/usb/chipidea/core.c   |  6 +++---
 drivers/usb/chipidea/otg_fsm.c| 19 +--
 drivers/usb/host/ehci-sysfs.c | 12 ++--
 drivers/usb/host/fotg210-hcd.c|  7 +++
 drivers/usb/host/xhci-dbgcap.c|  2 +-
 drivers/usb/misc/cypress_cy7c63.c | 12 ++--
 drivers/usb/misc/trancevibrator.c |  6 +++---
 drivers/usb/misc/usbsevseg.c  | 18 +-
 drivers/usb/musb/musb_core.c  | 12 ++--
 drivers/usb/phy/phy-mv-usb.c  | 14 ++
 drivers/usb/phy/phy-tahvo.c   |  2 +-
 12 files changed, 56 insertions(+), 60 deletions(-)

diff --git a/drivers/usb/atm/ueagle-atm.c b/drivers/usb/atm/ueagle-atm.c
index ab75690044bb..adc06609219f 100644
--- a/drivers/usb/atm/ueagle-atm.c
+++ b/drivers/usb/atm/ueagle-atm.c
@@ -2280,7 +2280,7 @@ static struct uea_softc *dev_to_uea(struct device *dev)
return usbatm->driver_data;
 }
 
-static ssize_t read_status(struct device *dev, struct device_attribute *attr,
+static ssize_t stat_status_show(struct device *dev, struct device_attribute 
*attr,
char *buf)
 {
int ret = -ENODEV;
@@ -2296,7 +2296,7 @@ static ssize_t read_status(struct device *dev, struct 
device_attribute *attr,
return ret;
 }
 
-static ssize_t reboot(struct device *dev, struct device_attribute *attr,
+static ssize_t stat_status_store(struct device *dev, struct device_attribute 
*attr,
const char *buf, size_t count)
 {
int ret = -ENODEV;
@@ -2313,7 +2313,7 @@ static ssize_t reboot(struct device *dev, struct 
device_attribute *attr,
return ret;
 }
 
-static DEVICE_ATTR(stat_status, S_IWUSR | S_IRUGO, read_status, reboot);
+static DEVICE_ATTR_RW(stat_status);
 
 static ssize_t read_human_status(struct device *dev,
struct device_attribute *attr, char *buf)
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
index dd2dd9391bb7..33ae87fa3ff3 100644
--- a/drivers/usb/chipidea/core.c
+++ b/drivers/usb/chipidea/core.c
@@ -835,7 +835,7 @@ static void ci_get_otg_capable(struct ci_hdrc *ci)
}
 }
 
-static ssize_t ci_role_show(struct device *dev, struct device_attribute *attr,
+static ssize_t role_show(struct device *dev, struct device_attribute *attr,
  char *buf)
 {
struct ci_hdrc *ci = dev_get_drvdata(dev);
@@ -846,7 +846,7 @@ static ssize_t ci_role_show(struct device *dev, struct 
device_attribute *attr,
return 0;
 }
 
-static ssize_t ci_role_store(struct device *dev,
+static ssize_t role_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t n)
 {
struct ci_hdrc *ci = dev_get_drvdata(dev);
@@ -877,7 +877,7 @@ static ssize_t ci_role_store(struct device *dev,
 
return (ret == 0) ? n : ret;
 }
-static DEVICE_ATTR(role, 0644, ci_role_show, ci_role_store);
+static DEVICE_ATTR_RW(role);
 
 static struct attribute *ci_attrs[] = {
&dev_attr_role.attr,
diff --git a/drivers/usb/chipidea/otg_fsm.c b/drivers/usb/chipidea/otg_fsm.c
index 9e2d300060bc..d076cfa22fdf 100644
--- a/drivers/usb/chipidea/otg_fsm.c
+++ b/drivers/usb/chipidea/otg_fsm.c
@@ -29,7 +29,7 @@
 
 /* Add for otg: interact with user space app */
 static ssize_t
-get_a_bus_req(struct device *dev, struct device_attribute *attr, char *buf)
+a_bus_req_show(struct device *dev, struct device_attribute *attr, char *buf)
 {
char*next;
unsignedsize, t;
@@ -45,7 +45,7 @@ get_a_bus_req(struct device *dev, struct device_attribute 
*attr, char *buf)
 }
 
 static ssize_t
-set_a_bus_req(struct device *dev, struct device_attribute *attr,
+a_bus_req_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
 {
struct ci_hdrc *ci = dev_get_drvdata(dev);
@@ -75,10 +75,10 @@ set_a_bus_req(struct device *dev, struct device_attribute 
*attr,
 
return count;
 }
-static DEVICE_ATTR(a_bus_req, S_IRUGO | S_IWUSR, get_a_bus_req, set_a_bus_req);
+static DEVICE_ATTR_RW(a_bus_req);
 
 static ssize_t
-get_a_bus_drop(struct device *dev, struct device_attribute *attr, char *buf)
+a_bus_drop_show(struct device *dev, struct device_attribute *attr, char *buf)
 {
char*next;
unsignedsize, t;
@@ -94,7 +94,7 @@ get_a_bus_drop(struct device *dev, struct device_attribute 
*attr, char *buf)
 }
 
 static ssize_t
-set_a_bus_drop(struct device *dev, struct

[PATCH 3/6] USB: move many drivers to use DEVICE_ATTR_WO

2018-01-23 Thread Greg Kroah-Hartman
Instead of "open coding" a DEVICE_ATTR() define, use the
DEVICE_ATTR_WO() macro instead, which does everything properly instead.

This does require a few static functions to be renamed to work properly,
but thanks to a script from Joe Perches, this was easily done.

Reported-by: Joe Perches 
Cc: Peter Chen 
Cc: Felipe Balbi 
Cc: Johan Hovold 
Cc: Valentina Manea 
Cc: Shuah Khan 
Signed-off-by: Greg Kroah-Hartman 
---
 drivers/usb/chipidea/otg_fsm.c | 4 ++--
 drivers/usb/gadget/udc/core.c  | 8 
 drivers/usb/phy/phy-mv-usb.c   | 4 ++--
 drivers/usb/serial/ftdi_sio.c  | 4 ++--
 drivers/usb/usbip/stub_dev.c   | 4 ++--
 drivers/usb/usbip/vhci_sysfs.c | 8 
 drivers/usb/usbip/vudc_sysfs.c | 4 ++--
 7 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/drivers/usb/chipidea/otg_fsm.c b/drivers/usb/chipidea/otg_fsm.c
index d076cfa22fdf..6ed4b00dba96 100644
--- a/drivers/usb/chipidea/otg_fsm.c
+++ b/drivers/usb/chipidea/otg_fsm.c
@@ -162,7 +162,7 @@ b_bus_req_store(struct device *dev, struct device_attribute 
*attr,
 static DEVICE_ATTR_RW(b_bus_req);
 
 static ssize_t
-set_a_clr_err(struct device *dev, struct device_attribute *attr,
+a_clr_err_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
 {
struct ci_hdrc  *ci = dev_get_drvdata(dev);
@@ -179,7 +179,7 @@ set_a_clr_err(struct device *dev, struct device_attribute 
*attr,
 
return count;
 }
-static DEVICE_ATTR(a_clr_err, S_IWUSR, NULL, set_a_clr_err);
+static DEVICE_ATTR_WO(a_clr_err);
 
 static struct attribute *inputs_attrs[] = {
&dev_attr_a_bus_req.attr,
diff --git a/drivers/usb/gadget/udc/core.c b/drivers/usb/gadget/udc/core.c
index ac0541529499..859d5b11ba4c 100644
--- a/drivers/usb/gadget/udc/core.c
+++ b/drivers/usb/gadget/udc/core.c
@@ -1417,7 +1417,7 @@ EXPORT_SYMBOL_GPL(usb_gadget_unregister_driver);
 
 /* - */
 
-static ssize_t usb_udc_srp_store(struct device *dev,
+static ssize_t srp_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t n)
 {
struct usb_udc  *udc = container_of(dev, struct usb_udc, dev);
@@ -1427,9 +1427,9 @@ static ssize_t usb_udc_srp_store(struct device *dev,
 
return n;
 }
-static DEVICE_ATTR(srp, S_IWUSR, NULL, usb_udc_srp_store);
+static DEVICE_ATTR_WO(srp);
 
-static ssize_t usb_udc_softconn_store(struct device *dev,
+static ssize_t soft_connect_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t n)
 {
struct usb_udc  *udc = container_of(dev, struct usb_udc, dev);
@@ -1453,7 +1453,7 @@ static ssize_t usb_udc_softconn_store(struct device *dev,
 
return n;
 }
-static DEVICE_ATTR(soft_connect, S_IWUSR, NULL, usb_udc_softconn_store);
+static DEVICE_ATTR_WO(soft_connect);
 
 static ssize_t state_show(struct device *dev, struct device_attribute *attr,
  char *buf)
diff --git a/drivers/usb/phy/phy-mv-usb.c b/drivers/usb/phy/phy-mv-usb.c
index 49a4dd88c301..cfd9add10bf4 100644
--- a/drivers/usb/phy/phy-mv-usb.c
+++ b/drivers/usb/phy/phy-mv-usb.c
@@ -562,7 +562,7 @@ a_bus_req_store(struct device *dev, struct device_attribute 
*attr,
 static DEVICE_ATTR_RW(a_bus_req);
 
 static ssize_t
-set_a_clr_err(struct device *dev, struct device_attribute *attr,
+a_clr_err_store(struct device *dev, struct device_attribute *attr,
  const char *buf, size_t count)
 {
struct mv_otg *mvotg = dev_get_drvdata(dev);
@@ -586,7 +586,7 @@ set_a_clr_err(struct device *dev, struct device_attribute 
*attr,
return count;
 }
 
-static DEVICE_ATTR(a_clr_err, S_IWUSR, NULL, set_a_clr_err);
+static DEVICE_ATTR_WO(a_clr_err);
 
 static ssize_t
 a_bus_drop_show(struct device *dev, struct device_attribute *attr,
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index fc68952c994a..f58c4ff6b387 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -1691,7 +1691,7 @@ static DEVICE_ATTR_RW(latency_timer);
 
 /* Write an event character directly to the FTDI register.  The ASCII
value is in the low 8 bits, with the enable bit in the 9th bit. */
-static ssize_t store_event_char(struct device *dev,
+static ssize_t event_char_store(struct device *dev,
struct device_attribute *attr, const char *valbuf, size_t count)
 {
struct usb_serial_port *port = to_usb_serial_port(dev);
@@ -1718,7 +1718,7 @@ static ssize_t store_event_char(struct device *dev,
 
return count;
 }
-static DEVICE_ATTR(event_char, S_IWUSR, NULL, store_event_char);
+static DEVICE_ATTR_WO(event_char);
 
 static int create_sysfs_attrs(struct usb_serial_port *port)
 {
diff --git a/drivers/usb/usbip/stub_dev.c b/drivers/usb/usbip/stub_dev.c
index e31a6f204397..49e552472c3f 100644
--- a/drivers/usb/usbip/stub_dev.c
+++ b/drivers/usb/usbip/stub_dev.c
@@ -39,7 +39,

[PATCH 4/6] USB: atm: fix up some remaining DEVICE_ATTR() usage

2018-01-23 Thread Greg Kroah-Hartman
There's no need to have DEVICE_ATTR() in these crazy macros, so use the
proper DEVICE_ATTR_*() versions intead.

Cc: Matthieu CASTET 
Cc: Stanislaw Gruszka 
Signed-off-by: Greg Kroah-Hartman 
---
 drivers/usb/atm/cxacru.c | 18 --
 drivers/usb/atm/ueagle-atm.c |  4 ++--
 2 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/drivers/usb/atm/cxacru.c b/drivers/usb/atm/cxacru.c
index 8af797252af2..e57a2be8754a 100644
--- a/drivers/usb/atm/cxacru.c
+++ b/drivers/usb/atm/cxacru.c
@@ -196,18 +196,16 @@ static void cxacru_poll_status(struct work_struct *work);
 
 /* Card info exported through sysfs */
 #define CXACRU__ATTR_INIT(_name) \
-static DEVICE_ATTR(_name, S_IRUGO, cxacru_sysfs_show_##_name, NULL)
+static DEVICE_ATTR_RO(_name)
 
 #define CXACRU_CMD_INIT(_name) \
-static DEVICE_ATTR(_name, S_IWUSR | S_IRUGO, \
-   cxacru_sysfs_show_##_name, cxacru_sysfs_store_##_name)
+static DEVICE_ATTR_RW(_name)
 
 #define CXACRU_SET_INIT(_name) \
-static DEVICE_ATTR(_name, S_IWUSR, \
-   NULL, cxacru_sysfs_store_##_name)
+static DEVICE_ATTR_WO(_name)
 
 #define CXACRU_ATTR_INIT(_value, _type, _name) \
-static ssize_t cxacru_sysfs_show_##_name(struct device *dev, \
+static ssize_t _name##_show(struct device *dev, \
struct device_attribute *attr, char *buf) \
 { \
struct cxacru_data *instance = to_usbatm_driver_data(\
@@ -302,7 +300,7 @@ static ssize_t cxacru_sysfs_showattr_MODU(u32 value, char 
*buf)
  * MAC_ADDRESS_LOW  = 0x33221100
  * Where 00-55 are bytes 0-5 of the MAC.
  */
-static ssize_t cxacru_sysfs_show_mac_address(struct device *dev,
+static ssize_t mac_address_show(struct device *dev,
struct device_attribute *attr, char *buf)
 {
struct cxacru_data *instance = to_usbatm_driver_data(
@@ -315,7 +313,7 @@ static ssize_t cxacru_sysfs_show_mac_address(struct device 
*dev,
instance->usbatm->atm_dev->esi);
 }
 
-static ssize_t cxacru_sysfs_show_adsl_state(struct device *dev,
+static ssize_t adsl_state_show(struct device *dev,
struct device_attribute *attr, char *buf)
 {
static char *str[] = { "running", "stopped" };
@@ -332,7 +330,7 @@ static ssize_t cxacru_sysfs_show_adsl_state(struct device 
*dev,
return snprintf(buf, PAGE_SIZE, "%s\n", str[value]);
 }
 
-static ssize_t cxacru_sysfs_store_adsl_state(struct device *dev,
+static ssize_t adsl_state_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
 {
struct cxacru_data *instance = to_usbatm_driver_data(
@@ -435,7 +433,7 @@ static ssize_t cxacru_sysfs_store_adsl_state(struct device 
*dev,
 
 /* CM_REQUEST_CARD_DATA_GET times out, so no show attribute */
 
-static ssize_t cxacru_sysfs_store_adsl_config(struct device *dev,
+static ssize_t adsl_config_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
 {
struct cxacru_data *instance = to_usbatm_driver_data(
diff --git a/drivers/usb/atm/ueagle-atm.c b/drivers/usb/atm/ueagle-atm.c
index 58967769d2ec..2754b4ce7136 100644
--- a/drivers/usb/atm/ueagle-atm.c
+++ b/drivers/usb/atm/ueagle-atm.c
@@ -2412,7 +2412,7 @@ static DEVICE_ATTR_RO(stat_delin);
 
 #define UEA_ATTR(name, reset)  \
\
-static ssize_t read_##name(struct device *dev, \
+static ssize_t stat_##name##_show(struct device *dev,  \
struct device_attribute *attr, char *buf)   \
 {  \
int ret = -ENODEV;  \
@@ -2430,7 +2430,7 @@ out:  
\
return ret; \
 }  \
\
-static DEVICE_ATTR(stat_##name, S_IRUGO, read_##name, NULL)
+static DEVICE_ATTR_RO(stat_##name)
 
 UEA_ATTR(mflags, 1);
 UEA_ATTR(vidcpe, 0);
-- 
2.16.1

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 6/6] USB: misc: fix up some remaining DEVICE_ATTR() usages

2018-01-23 Thread Greg Kroah-Hartman
For all of these, a simple DEVICE_ATTR_*() macro should be used instead,
so convert the drivers to use them.

Signed-off-by: Greg Kroah-Hartman 
---
 drivers/usb/misc/cytherm.c   | 45 +---
 drivers/usb/misc/usbsevseg.c |  6 +++---
 2 files changed, 16 insertions(+), 35 deletions(-)

diff --git a/drivers/usb/misc/cytherm.c b/drivers/usb/misc/cytherm.c
index 66be86077292..8b15ab5e1450 100644
--- a/drivers/usb/misc/cytherm.c
+++ b/drivers/usb/misc/cytherm.c
@@ -78,7 +78,7 @@ static int vendor_command(struct usb_device *dev, unsigned 
char request,
 #define BRIGHTNESS 0x2c /* RAM location for brightness value */
 #define BRIGHTNESS_SEM 0x2b /* RAM location for brightness semaphore */
 
-static ssize_t show_brightness(struct device *dev, struct device_attribute 
*attr, char *buf)
+static ssize_t brightness_show(struct device *dev, struct device_attribute 
*attr, char *buf)
 {
struct usb_interface *intf = to_usb_interface(dev);
struct usb_cytherm *cytherm = usb_get_intfdata(intf); 
@@ -86,7 +86,7 @@ static ssize_t show_brightness(struct device *dev, struct 
device_attribute *attr
return sprintf(buf, "%i", cytherm->brightness);
 }
 
-static ssize_t set_brightness(struct device *dev, struct device_attribute 
*attr, const char *buf,
+static ssize_t brightness_store(struct device *dev, struct device_attribute 
*attr, const char *buf,
  size_t count)
 {
struct usb_interface *intf = to_usb_interface(dev);
@@ -121,15 +121,13 @@ static ssize_t set_brightness(struct device *dev, struct 
device_attribute *attr,

return count;
 }
-
-static DEVICE_ATTR(brightness, S_IRUGO | S_IWUSR | S_IWGRP, 
-  show_brightness, set_brightness);
+static DEVICE_ATTR_RW(brightness);
 
 
 #define TEMP 0x33 /* RAM location for temperature */
 #define SIGN 0x34 /* RAM location for temperature sign */
 
-static ssize_t show_temp(struct device *dev, struct device_attribute *attr, 
char *buf)
+static ssize_t temp_show(struct device *dev, struct device_attribute *attr, 
char *buf)
 {
 
struct usb_interface *intf = to_usb_interface(dev);
@@ -161,19 +159,12 @@ static ssize_t show_temp(struct device *dev, struct 
device_attribute *attr, char
return sprintf(buf, "%c%i.%i", sign ? '-' : '+', temp >> 1,
   5*(temp - ((temp >> 1) << 1)));
 }
-
-
-static ssize_t set_temp(struct device *dev, struct device_attribute *attr, 
const char *buf, size_t count)
-{
-   return count;
-}
-
-static DEVICE_ATTR(temp, S_IRUGO, show_temp, set_temp);
+static DEVICE_ATTR_RO(temp);
 
 
 #define BUTTON 0x7a
 
-static ssize_t show_button(struct device *dev, struct device_attribute *attr, 
char *buf)
+static ssize_t button_show(struct device *dev, struct device_attribute *attr, 
char *buf)
 {
 
struct usb_interface *intf = to_usb_interface(dev);
@@ -200,17 +191,10 @@ static ssize_t show_button(struct device *dev, struct 
device_attribute *attr, ch
else
return sprintf(buf, "0");
 }
+static DEVICE_ATTR_RO(button);
 
 
-static ssize_t set_button(struct device *dev, struct device_attribute *attr, 
const char *buf, size_t count)
-{
-   return count;
-}
-
-static DEVICE_ATTR(button, S_IRUGO, show_button, set_button);
-
-
-static ssize_t show_port0(struct device *dev, struct device_attribute *attr, 
char *buf)
+static ssize_t port0_show(struct device *dev, struct device_attribute *attr, 
char *buf)
 {
struct usb_interface *intf = to_usb_interface(dev);
struct usb_cytherm *cytherm = usb_get_intfdata(intf);
@@ -234,7 +218,7 @@ static ssize_t show_port0(struct device *dev, struct 
device_attribute *attr, cha
 }
 
 
-static ssize_t set_port0(struct device *dev, struct device_attribute *attr, 
const char *buf, size_t count)
+static ssize_t port0_store(struct device *dev, struct device_attribute *attr, 
const char *buf, size_t count)
 {
struct usb_interface *intf = to_usb_interface(dev);
struct usb_cytherm *cytherm = usb_get_intfdata(intf);
@@ -263,10 +247,9 @@ static ssize_t set_port0(struct device *dev, struct 
device_attribute *attr, cons
 
return count;
 }
+static DEVICE_ATTR_RW(port0);
 
-static DEVICE_ATTR(port0, S_IRUGO | S_IWUSR | S_IWGRP, show_port0, set_port0);
-
-static ssize_t show_port1(struct device *dev, struct device_attribute *attr, 
char *buf)
+static ssize_t port1_show(struct device *dev, struct device_attribute *attr, 
char *buf)
 {
struct usb_interface *intf = to_usb_interface(dev);
struct usb_cytherm *cytherm = usb_get_intfdata(intf);
@@ -290,7 +273,7 @@ static ssize_t show_port1(struct device *dev, struct 
device_attribute *attr, cha
 }
 
 
-static ssize_t set_port1(struct device *dev, struct device_attribute *attr, 
const char *buf, size_t count)
+static ssize_t port1_store(struct device *dev, struct device_attribute *attr, 
const char *buf, size_t count)
 {
struct usb_interface *intf = to_us

[PATCH 5/6] USB: musb: fix up one odd DEVICE_ATTR() usage

2018-01-23 Thread Greg Kroah-Hartman
It really should be DEVICE_ATTR_WO(), no need to "open code" it.

Cc: Bin Liu 
Signed-off-by: Greg Kroah-Hartman 
---
 drivers/usb/musb/musb_core.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index f4f2693608e6..968bf1e8b0fe 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -1778,8 +1778,7 @@ static DEVICE_ATTR_RW(vbus);
 /* Gadget drivers can't know that a host is connected so they might want
  * to start SRP, but users can.  This allows userspace to trigger SRP.
  */
-static ssize_t
-musb_srp_store(struct device *dev, struct device_attribute *attr,
+static ssize_t srp_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t n)
 {
struct musb *musb = dev_to_musb(dev);
@@ -1796,7 +1795,7 @@ musb_srp_store(struct device *dev, struct 
device_attribute *attr,
 
return n;
 }
-static DEVICE_ATTR(srp, 0644, NULL, musb_srp_store);
+static DEVICE_ATTR_WO(srp);
 
 static struct attribute *musb_attributes[] = {
&dev_attr_mode.attr,
-- 
2.16.1

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/6] USB: move many drivers to use DEVICE_ATTR_RW

2018-01-23 Thread Felipe Balbi

Hi,

Greg Kroah-Hartman  writes:
> Instead of "open coding" a DEVICE_ATTR() define, use the
> DEVICE_ATTR_RW() macro instead, which does everything properly instead.
>
> This does require a few static functions to be renamed to work properly,
> but thanks to a script from Joe Perches, this was easily done.
>
> Reported-by: Joe Perches 
> Cc: Matthieu CASTET 
> Cc: Stanislaw Gruszka 
> Cc: Peter Chen 
> Cc: Alan Stern 
> Cc: Mathias Nyman 
> Cc: Bin Liu 
> Cc: Felipe Balbi 
> Signed-off-by: Greg Kroah-Hartman 

for drivers/usb/phy:

Acked-by: Felipe Balbi 

-- 
balbi


signature.asc
Description: PGP signature


Re: [PATCH 2/6] USB: move many drivers to use DEVICE_ATTR_RO

2018-01-23 Thread Felipe Balbi

Hi,

Greg Kroah-Hartman  writes:
> Instead of "open coding" a DEVICE_ATTR() define, use the
> DEVICE_ATTR_RO() macro instead, which does everything properly instead.
>
> This does require a few static functions to be renamed to work properly,
> but thanks to a script from Joe Perches, this was easily done.
>
> Reported-by: Joe Perches 
> Cc: Matthieu CASTET 
> Cc: Stanislaw Gruszka 
> Cc: Oliver Neukum 
> Cc: Pete Zaitcev 
> Cc: Felipe Balbi 
> Cc: Alan Stern 
> Signed-off-by: Greg Kroah-Hartman 

For drivers/usb/phy:

Acked-by: Felipe Balbi 

-- 
balbi


signature.asc
Description: PGP signature


Re: [PATCH 3/6] USB: move many drivers to use DEVICE_ATTR_WO

2018-01-23 Thread Felipe Balbi
Greg Kroah-Hartman  writes:

> Instead of "open coding" a DEVICE_ATTR() define, use the
> DEVICE_ATTR_WO() macro instead, which does everything properly instead.
>
> This does require a few static functions to be renamed to work properly,
> but thanks to a script from Joe Perches, this was easily done.
>
> Reported-by: Joe Perches 
> Cc: Peter Chen 
> Cc: Felipe Balbi 
> Cc: Johan Hovold 
> Cc: Valentina Manea 
> Cc: Shuah Khan 
> Signed-off-by: Greg Kroah-Hartman 

For drivers/usb/{gadget,phy}:

Acked-by: Felipe Balbi 

-- 
balbi


signature.asc
Description: PGP signature


Re: [PATCH 1/6] USB: move many drivers to use DEVICE_ATTR_RW

2018-01-23 Thread Greg Kroah-Hartman
On Tue, Jan 23, 2018 at 12:26:38PM +0200, Felipe Balbi wrote:
> 
> Hi,
> 
> Greg Kroah-Hartman  writes:
> > Instead of "open coding" a DEVICE_ATTR() define, use the
> > DEVICE_ATTR_RW() macro instead, which does everything properly instead.
> >
> > This does require a few static functions to be renamed to work properly,
> > but thanks to a script from Joe Perches, this was easily done.
> >
> > Reported-by: Joe Perches 
> > Cc: Matthieu CASTET 
> > Cc: Stanislaw Gruszka 
> > Cc: Peter Chen 
> > Cc: Alan Stern 
> > Cc: Mathias Nyman 
> > Cc: Bin Liu 
> > Cc: Felipe Balbi 
> > Signed-off-by: Greg Kroah-Hartman 
> 
> for drivers/usb/phy:
> 
> Acked-by: Felipe Balbi 

Great, thanks for the quick review of these.

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/2] usb: dwc3: drd: Fix lock-up on ID change during system suspend/resume

2018-01-23 Thread Roger Quadros
Hi Manu,

On 23/01/18 05:45, Manu Gautam wrote:
> Hi,
> 
> 
> On 1/22/2018 6:31 PM, Roger Quadros wrote:
>> Adding/removing host/gadget controller before .pm_complete()
>> causes a lock-up. Let's prevent any dual-role state change
>> between .pm_prepare() and .pm_complete() to fix this.
> 
> What kind of lock-up are you seeing? Some hardware lockup or software 
> deadlock?
> IMO using a freezable_wq for drd_work should address that?
> 

I was seeing a software deadlock. freezable_wq is a good idea. I'll try it out.

> 
>>


-- 
cheers,
-roger

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. 
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [BUG] SD card reader disappears after suspend

2018-01-23 Thread Samuel Sadok
Thanks Alan,

While I was at it I also enabled debug logs for xhci_hcd and xhci_pci.

$ echo module usbcore =p > /sys/kernel/debug/dynamic_debug/control
$ echo module xhci_hcd =p > /sys/kernel/debug/dynamic_debug/control
$ echo module xhci_pci =p > /sys/kernel/debug/dynamic_debug/control
$ modprobe usbmon
$ cat /sys/kernel/debug/usb/usbmon/0u > /tmp/usbmon.log
$ # press power button

dmesg: https://gist.github.com/anonymous/29b81574abf40605f999cfeefe98e341
usbmon: https://gist.github.com/anonymous/55b6d9bbf8b8c8627230b10d2b09dcb6

Both logs were collected at the same time so the timestamps should match.

Resume starts at dmesg line 1255.
As far as I can judge, the earliest indication of something going
wrong is line 1514:
[ 36.087176] xhci_hcd :00:14.0: xHCI xhci_urb_enqueue called with
unaddressed device
[ 36.087180] usb 2-4: Disable of device-initiated U1 failed.
[ 36.087212] xhci_hcd :00:14.0: xHCI xhci_urb_enqueue called with
unaddressed device
[ 36.087224] usb 2-4: Disable of device-initiated U2 failed.
[ 36.087226] xhci_hcd :00:14.0: xHCI xhci_urb_enqueue called with
unaddressed device
[ 36.087227] usb 2-4: usb_reset_and_verify_device Failed to disable LTM

2018-01-22 22:39 GMT+01:00 Alan Stern :
> On Mon, 22 Jan 2018, Samuel Sadok wrote:
>
>> As requested by Chen Yu on bugzilla, I added no_console_suspend=1 to
>> the kernel cmdline and updated to the (roughly) latest kernel,
>> 4.14.14-1-ARCH.
>>
>> Here's the new log:
>> https://pastebin.com/buhEMyKk
>>
>> From a quick comparison with the old log I don't see any significant
>> difference, except that these messages
>>
>> [   32.671107] xhci_hcd :00:14.0: Cannot set link state.
>> [   32.671112] usb usb2-port4: cannot disable (err = -32)
>> [   32.671153] xhci_hcd :00:14.0: Cannot set link state.
>> [   32.671157] usb usb2-port4: cannot disable (err = -32)
>>
>> don't repeat forever.
>
> It would be helpful to include debugging information in your log.
> Before starting the suspend, do:
>
> echo module usbcore =p >/sys/kernel/debug/dynamic_debug/control
>
> You could also collect a usbmon trace while running the test; it might
> help too.
>
> Alan Stern
>
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/4] arm64: dts: uniphier: add dwc3 usb node for LD20

2018-01-23 Thread Kunihiko Hayashi
Add usb node for LD20, which has 1 dwc3 controller instance, and
enable this for LD20 boards.

Signed-off-by: Kunihiko Hayashi 
---
 .../boot/dts/socionext/uniphier-ld20-global.dts|  4 ++
 .../arm64/boot/dts/socionext/uniphier-ld20-ref.dts |  4 ++
 arch/arm64/boot/dts/socionext/uniphier-ld20.dtsi   | 77 ++
 3 files changed, 85 insertions(+)

diff --git a/arch/arm64/boot/dts/socionext/uniphier-ld20-global.dts 
b/arch/arm64/boot/dts/socionext/uniphier-ld20-global.dts
index fc2bc9d..82eea9d 100644
--- a/arch/arm64/boot/dts/socionext/uniphier-ld20-global.dts
+++ b/arch/arm64/boot/dts/socionext/uniphier-ld20-global.dts
@@ -54,3 +54,7 @@
 &nand {
status = "okay";
 };
+
+&usb {
+   status = "okay";
+};
diff --git a/arch/arm64/boot/dts/socionext/uniphier-ld20-ref.dts 
b/arch/arm64/boot/dts/socionext/uniphier-ld20-ref.dts
index 6933710..3ea0985 100644
--- a/arch/arm64/boot/dts/socionext/uniphier-ld20-ref.dts
+++ b/arch/arm64/boot/dts/socionext/uniphier-ld20-ref.dts
@@ -58,3 +58,7 @@
 &i2c0 {
status = "okay";
 };
+
+&usb {
+   status = "okay";
+};
diff --git a/arch/arm64/boot/dts/socionext/uniphier-ld20.dtsi 
b/arch/arm64/boot/dts/socionext/uniphier-ld20.dtsi
index 8a3276b..e3e1900 100644
--- a/arch/arm64/boot/dts/socionext/uniphier-ld20.dtsi
+++ b/arch/arm64/boot/dts/socionext/uniphier-ld20.dtsi
@@ -467,6 +467,50 @@
efuse@200 {
compatible = "socionext,uniphier-efuse";
reg = <0x200 0x68>;
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   /* USB cells */
+   usb_rterm0: trim@54,4 {
+   reg = <0x54 1>;
+   bits = <4 2>;
+   };
+   usb_rterm1: trim@55,4 {
+   reg = <0x55 1>;
+   bits = <4 2>;
+   };
+   usb_rterm2: trim@58,4 {
+   reg = <0x58 1>;
+   bits = <4 2>;
+   };
+   usb_rterm3: trim@59,4 {
+   reg = <0x59 1>;
+   bits = <4 2>;
+   };
+   usb_sel_t0: trim@54,0 {
+   reg = <0x54 1>;
+   bits = <0 4>;
+   };
+   usb_sel_t1: trim@55,0 {
+   reg = <0x55 1>;
+   bits = <0 4>;
+   };
+   usb_sel_t2: trim@58,0 {
+   reg = <0x58 1>;
+   bits = <0 4>;
+   };
+   usb_sel_t3: trim@59,0 {
+   reg = <0x59 1>;
+   bits = <0 4>;
+   };
+   usb_hs_i0: trim@56,0 {
+   reg = <0x56 1>;
+   bits = <0 4>;
+   };
+   usb_hs_i2: trim@5a,0 {
+   reg = <0x5a 1>;
+   bits = <0 4>;
+   };
};
};
 
@@ -513,6 +557,39 @@
};
};
 
+   usb: usb@65b0 {
+   compatible = "socionext,uniphier-ld20-dwc3";
+   status = "disabled";
+   reg = <0x65b0 0x1000>;
+   #address-cells = <1>;
+   #size-cells = <1>;
+   pinctrl-names = "default";
+   pinctrl-0 = <&pinctrl_usb0>, <&pinctrl_usb1>,
+   <&pinctrl_usb2>, <&pinctrl_usb3>;
+   clocks = <&sys_clk 14>, <&sys_clk 16>, <&sys_clk 17>;
+   resets = <&sys_rst 12>, <&sys_rst 16>, <&sys_rst 17>,
+<&sys_rst 18>, <&sys_rst 19>;
+   nvmem-cells = <&usb_rterm0>, <&usb_rterm1>,
+ <&usb_rterm2>, <&usb_rterm3>,
+ <&usb_sel_t0>, <&usb_sel_t1>,
+ <&usb_sel_t2>, <&usb_sel_t3>,
+ <&usb_hs_i0>,  <&usb_hs_i0>,
+ <&usb_hs_i2>,  <&usb_hs_i2>;
+   nvmem-cell-names =
+   

[PATCH 3/4] ARM: dts: uniphier: add dwc3 usb node for PXs2

2018-01-23 Thread Kunihiko Hayashi
Add usb node for PXs2 SoC which has 2 dwc3 controller instances, and
enable this for PXs2 boards.

Signed-off-by: Kunihiko Hayashi 
---
 arch/arm/boot/dts/uniphier-pxs2-gentil.dts |  8 ++
 arch/arm/boot/dts/uniphier-pxs2-vodka.dts  |  4 +++
 arch/arm/boot/dts/uniphier-pxs2.dtsi   | 43 ++
 3 files changed, 55 insertions(+)

diff --git a/arch/arm/boot/dts/uniphier-pxs2-gentil.dts 
b/arch/arm/boot/dts/uniphier-pxs2-gentil.dts
index 7dfae26..91cc7c5 100644
--- a/arch/arm/boot/dts/uniphier-pxs2-gentil.dts
+++ b/arch/arm/boot/dts/uniphier-pxs2-gentil.dts
@@ -53,3 +53,11 @@
 &i2c2 {
status = "okay";
 };
+
+&usb0 {
+   status = "okay";
+};
+
+&usb1 {
+   status = "okay";
+};
diff --git a/arch/arm/boot/dts/uniphier-pxs2-vodka.dts 
b/arch/arm/boot/dts/uniphier-pxs2-vodka.dts
index 0cf6154..ed5395b 100644
--- a/arch/arm/boot/dts/uniphier-pxs2-vodka.dts
+++ b/arch/arm/boot/dts/uniphier-pxs2-vodka.dts
@@ -41,3 +41,7 @@
 &i2c0 {
status = "okay";
 };
+
+&usb0 {
+   status = "okay";
+};
diff --git a/arch/arm/boot/dts/uniphier-pxs2.dtsi 
b/arch/arm/boot/dts/uniphier-pxs2.dtsi
index c083468..b65bf1c 100644
--- a/arch/arm/boot/dts/uniphier-pxs2.dtsi
+++ b/arch/arm/boot/dts/uniphier-pxs2.dtsi
@@ -446,6 +446,49 @@
};
};
 
+   usb0: usb@65b0 {
+   compatible = "socionext,uniphier-pxs2-dwc3";
+   status = "disabled";
+   reg = <0x65b0 0x1000>;
+   #address-cells = <1>;
+   #size-cells = <1>;
+   pinctrl-names = "default";
+   pinctrl-0 = <&pinctrl_usb0>, <&pinctrl_usb2>;
+   clocks = <&sys_clk 14>, <&sys_clk 16>;
+   resets = <&sys_rst 14>, <&sys_rst 16>,
+<&sys_rst 17>, <&sys_rst 18>;
+   ranges;
+
+   dwc3@65a0 {
+   compatible = "snps,dwc3";
+   reg = <0x65a0 0xcd00>;
+   interrupt-names = "host", "peripheral";
+   interrupts = <0 134 4>, <0 135 4>;
+   dr_mode = "host";
+   };
+   };
+
+   usb1: usb@65d0 {
+   compatible = "socionext,uniphier-pxs2-dwc3";
+   status = "disabled";
+   reg = <0x65d0 0x1000>;
+   #address-cells = <1>;
+   #size-cells = <1>;
+   pinctrl-names = "default";
+   pinctrl-0 = <&pinctrl_usb1>, <&pinctrl_usb3>;
+   clocks = <&sys_clk 15>, <&sys_clk 20>;
+   resets = <&sys_rst 15>, <&sys_rst 20>, <&sys_rst 21>;
+   ranges;
+
+   dwc3@65c0 {
+   compatible = "snps,dwc3";
+   reg = <0x65c0 0xcd00>;
+   interrupt-names = "host", "peripheral";
+   interrupts = <0 137 4>, <0 138 4>;
+   dr_mode = "host";
+   };
+   };
+
nand: nand@6800 {
compatible = "socionext,uniphier-denali-nand-v5b";
status = "disabled";
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/4] usb: dwc3: add UniPhier dwc3 glue layer support

2018-01-23 Thread Kunihiko Hayashi
This patch series adds support for DWC3 glue layer implemented on
UniPhier SoCs. It supports PXs2 and LD20 SoCs.

In case of LD20, since some trimming values for PHY initialization
are included in nvmem, This series includes the way to access to
nvmem and bitmap definitions of nvmem in DT.

Thank you,
---

Kunihiko Hayashi (4):
  dt-bindings: dwc3: add binding documentation for UniPhier dwc3 glue
driver
  usb: dwc3: add dwc3 glue layer for UniPhier SoCs
  ARM: dts: uniphier: add dwc3 usb node for PXs2
  arm64: dts: uniphier: add dwc3 usb node for LD20

 .../devicetree/bindings/usb/dwc3-uniphier.txt  |  58 +++
 arch/arm/boot/dts/uniphier-pxs2-gentil.dts |   8 +
 arch/arm/boot/dts/uniphier-pxs2-vodka.dts  |   4 +
 arch/arm/boot/dts/uniphier-pxs2.dtsi   |  43 ++
 .../boot/dts/socionext/uniphier-ld20-global.dts|   4 +
 .../arm64/boot/dts/socionext/uniphier-ld20-ref.dts |   4 +
 arch/arm64/boot/dts/socionext/uniphier-ld20.dtsi   |  77 +++
 drivers/usb/dwc3/Kconfig   |   9 +
 drivers/usb/dwc3/Makefile  |   1 +
 drivers/usb/dwc3/dwc3-uniphier.c   | 554 +
 10 files changed, 762 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/dwc3-uniphier.txt
 create mode 100644 drivers/usb/dwc3/dwc3-uniphier.c

-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/4] dt-bindings: dwc3: add binding documentation for UniPhier dwc3 glue driver

2018-01-23 Thread Kunihiko Hayashi
Add devicetree binding documentation for dwc3 glue driver implemented
on Socionext UniPhier SoCs.

Signed-off-by: Kunihiko Hayashi 
---
 .../devicetree/bindings/usb/dwc3-uniphier.txt  | 58 ++
 1 file changed, 58 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/dwc3-uniphier.txt

diff --git a/Documentation/devicetree/bindings/usb/dwc3-uniphier.txt 
b/Documentation/devicetree/bindings/usb/dwc3-uniphier.txt
new file mode 100644
index 000..677e072
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/dwc3-uniphier.txt
@@ -0,0 +1,58 @@
+UniPhier DWC3 glue layer
+
+This describes the devicetree bindings for dwc3-uniphier driver implemented on
+Socionext UniPhier SoCs.
+
+Required properties:
+- compatible:
+  - "socionext,uniphier-pxs2-dwc3" : For UniPhier PXs2 SoC
+  - "socionext,uniphier-ld20-dwc3" : For UniPhier LD20 SoC
+- reg: Address and range of the glue logic
+- clocks: List of phandles for the clocks, and the number of phandles depends
+ on SoC platform.
+
+Optional properties:
+- resets: List of phandles for the resets, and the number of phandles depends
+   on SoC platform.
+- nvmem-cells: Phandles to nvmem cell that contains the trimming data.
+   Available only for LD20, and if unspecified, default value is used.
+- nvmem-cell-names: Should be the following names, which correspond to each
+   nvmem-cells. N is the number indicating a port of phy.
+   All of the 3 parameters associated with the following names are
+   required for each port, if any one is omitted, the trimming data
+   of the port will not be set at all.
+   - "rtermN", "sel_tN", "hs_iN" : Each cell name for phy parameters
+
+Required child node:
+A child node must exist to represent the core DWC3 IP block. The name of
+the node is not important. The content of the node is defined in dwc3.txt.
+
+Example:
+
+   usb: usb@65b0 {
+   compatible = "socionext,uniphier-ld20-dwc3";
+   reg = <0x65b0 0x1000>;
+   #address-cells = <1>;
+   #size-cells = <1>;
+   clocks = <&sys_clk 14>, <&sys_clk 16>, <&sys_clk 17>;
+   resets = <&sys_rst 12>, <&sys_rst 16>, <&sys_rst 17>,
+<&sys_rst 18>, <&sys_rst 19>;
+   nvmem-cells = <&usb_rterm0>, <&usb_rterm1>,
+ <&usb_rterm2>, <&usb_rterm3>,
+ <&usb_sel_t0>, <&usb_sel_t1>,
+ <&usb_sel_t2>, <&usb_sel_t3>,
+ <&usb_hs_i0>,  <&usb_hs_i0>,
+ <&usb_hs_i2>,  <&usb_hs_i2>;
+   nvmem-cell-names = "rterm0", "rterm1", "rterm2", "rterm3",
+  "sel_t0", "sel_t1", "sel_t2", "sel_t3",
+  "hs_i0",  "hs_i1",  "hs_i2",  "hs_i3";
+   ranges;
+
+   dwc3@65a0 {
+   compatible = "snps,dwc3";
+   reg = <0x65a0 0xcd00>;
+   interrupt-names = "host";
+   interrupts = <0 134 4>;
+   dr_mode = "host";
+   };
+   };
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/4] usb: dwc3: add dwc3 glue layer for UniPhier SoCs

2018-01-23 Thread Kunihiko Hayashi
Add a specific glue layer for UniPhier SoC platform to support
USB host mode. It manages hardware operating sequences to enable multiple
clock gates and assert resets, and to prepare to use dwc3 controller
on the SoC.

This patch also handles the physical layer that has same register space
as the glue layer, because it needs to integrate initialziation sequence
between glue and phy.

In case of some SoCs, since some initialization values for PHY are
included in nvmem, this patch includes the way to get the values from nvmem.

It supports PXs2 and LD20 SoCs.

Signed-off-by: Kunihiko Hayashi 
Signed-off-by: Motoya Tanigawa 
Signed-off-by: Masami Hiramatsu 
---
 drivers/usb/dwc3/Kconfig |   9 +
 drivers/usb/dwc3/Makefile|   1 +
 drivers/usb/dwc3/dwc3-uniphier.c | 554 +++
 3 files changed, 564 insertions(+)
 create mode 100644 drivers/usb/dwc3/dwc3-uniphier.c

diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig
index ab8c0e0..a5cadc6 100644
--- a/drivers/usb/dwc3/Kconfig
+++ b/drivers/usb/dwc3/Kconfig
@@ -106,4 +106,13 @@ config USB_DWC3_ST
  inside (i.e. STiH407).
  Say 'Y' or 'M' if you have one such device.
 
+config USB_DWC3_UNIPHIER
+   tristate "Socionext UniPhier Platforms"
+   depends on (ARCH_UNIPHIER || COMPILE_TEST) && OF
+   default USB_DWC3
+   help
+ Support USB2/3 functionality in UniPhier platforms.
+ Say 'Y' or 'M' if your system that UniPhier SoC is implemented
+ has USB controllers based on DWC USB3 IP.
+
 endif
diff --git a/drivers/usb/dwc3/Makefile b/drivers/usb/dwc3/Makefile
index 7ac7250..31e82b3 100644
--- a/drivers/usb/dwc3/Makefile
+++ b/drivers/usb/dwc3/Makefile
@@ -48,3 +48,4 @@ obj-$(CONFIG_USB_DWC3_PCI)+= dwc3-pci.o
 obj-$(CONFIG_USB_DWC3_KEYSTONE)+= dwc3-keystone.o
 obj-$(CONFIG_USB_DWC3_OF_SIMPLE)   += dwc3-of-simple.o
 obj-$(CONFIG_USB_DWC3_ST)  += dwc3-st.o
+obj-$(CONFIG_USB_DWC3_UNIPHIER)+= dwc3-uniphier.o
diff --git a/drivers/usb/dwc3/dwc3-uniphier.c b/drivers/usb/dwc3/dwc3-uniphier.c
new file mode 100644
index 000..58e84cd
--- /dev/null
+++ b/drivers/usb/dwc3/dwc3-uniphier.c
@@ -0,0 +1,554 @@
+// SPDX-License-Identifier: GPL-2.0
+/**
+ * dwc3-uniphier.c - Socionext UniPhier DWC3 specific glue layer
+ *
+ * Copyright 2015-2018 Socionext Inc.
+ *
+ * Author:
+ * Kunihiko Hayashi 
+ * Contributors:
+ *  Motoya Tanigawa 
+ *  Masami Hiramatsu 
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define RESET_CTL  0x000
+#define LINK_RESET BIT(15)
+
+#define VBUS_CONTROL(n)(0x100 + 0x10 * (n))
+#define DRVVBUS_REGBIT(4)
+#define DRVVBUS_REG_EN BIT(3)
+
+#define U2PHY_CFG0(n)  (0x200 + 0x10 * (n))
+#define U2PHY_CFG0_HS_I_MASK   GENMASK(31, 28)
+#define U2PHY_CFG0_HSDISC_MASK GENMASK(27, 26)
+#define U2PHY_CFG0_SWING_MASK  GENMASK(17, 16)
+#define U2PHY_CFG0_SEL_T_MASK  GENMASK(15, 12)
+#define U2PHY_CFG0_RTERM_MASK  GENMASK(7, 6)
+#define U2PHY_CFG0_TRIMMASK(U2PHY_CFG0_HS_I_MASK \
+| U2PHY_CFG0_SEL_T_MASK \
+| U2PHY_CFG0_RTERM_MASK)
+
+#define U2PHY_CFG1(n)  (0x204 + 0x10 * (n))
+#define U2PHY_CFG1_DAT_EN  BIT(29)
+#define U2PHY_CFG1_ADR_EN  BIT(28)
+#define U2PHY_CFG1_ADR_MASKGENMASK(27, 16)
+#define U2PHY_CFG1_DAT_MASKGENMASK(23, 16)
+
+#define U3PHY_TESTI(n) (0x300 + 0x10 * (n))
+#define U3PHY_TESTO(n) (0x304 + 0x10 * (n))
+#define TESTI_DAT_MASK GENMASK(13, 6)
+#define TESTI_ADR_MASK GENMASK(5, 1)
+#define TESTI_WR_ENBIT(0)
+
+#define HOST_CONFIG0   0x400
+#define NUM_U3_MASKGENMASK(13, 11)
+#define NUM_U2_MASKGENMASK(10, 8)
+
+#define PHY_MAX_PARAMS 32
+
+struct dwc3u_phy_param {
+   u32 addr;
+   u32 mask;
+   u32 val;
+};
+
+struct dwc3u_trim_param {
+   u32 rterm;
+   u32 sel_t;
+   u32 hs_i;
+};
+
+#define trim_param_is_valid(p) ((p)->rterm || (p)->sel_t || (p)->hs_i)
+
+struct dwc3u_priv {
+   struct device   *dev;
+   void __iomem*base;
+   struct clk  **clks;
+   int nclks;
+   struct reset_control*rst;
+   int nvbus;
+   const struct dwc3u_soc_data *data;
+};
+
+struct dwc3u_soc_data {
+   int ss_nparams;
+   struct dwc3u_phy_param ss_param[PHY_MAX_PARAMS];
+   int hs_nparams;
+   struct dwc3u_phy_param hs_param[PHY_MAX_PARAMS];
+   u32 hs_config0;
+   u32 hs_config1;
+   void (*trim_func)(struct dwc3u_priv *priv, u32 *pconfig,
+ struct dwc3u_trim_param *trim);
+};
+
+static inline u32 dwc3u_read(struct dwc3u_priv *priv, off_t offset)
+{
+   return readl(pri

Re: [PATCH 2/4] usb: dwc3: add dwc3 glue layer for UniPhier SoCs

2018-01-23 Thread Felipe Balbi

Hi,

Kunihiko Hayashi  writes:
> Add a specific glue layer for UniPhier SoC platform to support
> USB host mode. It manages hardware operating sequences to enable multiple
> clock gates and assert resets, and to prepare to use dwc3 controller
> on the SoC.
>
> This patch also handles the physical layer that has same register space
> as the glue layer, because it needs to integrate initialziation sequence
> between glue and phy.
>
> In case of some SoCs, since some initialization values for PHY are
> included in nvmem, this patch includes the way to get the values from nvmem.
>
> It supports PXs2 and LD20 SoCs.
>
> Signed-off-by: Kunihiko Hayashi 
> Signed-off-by: Motoya Tanigawa 
> Signed-off-by: Masami Hiramatsu 
> ---
>  drivers/usb/dwc3/Kconfig |   9 +
>  drivers/usb/dwc3/Makefile|   1 +
>  drivers/usb/dwc3/dwc3-uniphier.c | 554 
> +++
>  3 files changed, 564 insertions(+)
>  create mode 100644 drivers/usb/dwc3/dwc3-uniphier.c
>
> diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig
> index ab8c0e0..a5cadc6 100644
> --- a/drivers/usb/dwc3/Kconfig
> +++ b/drivers/usb/dwc3/Kconfig
> @@ -106,4 +106,13 @@ config USB_DWC3_ST
> inside (i.e. STiH407).
> Say 'Y' or 'M' if you have one such device.
>  
> +config USB_DWC3_UNIPHIER
> + tristate "Socionext UniPhier Platforms"
> + depends on (ARCH_UNIPHIER || COMPILE_TEST) && OF
> + default USB_DWC3
> + help
> +   Support USB2/3 functionality in UniPhier platforms.
> +   Say 'Y' or 'M' if your system that UniPhier SoC is implemented
> +   has USB controllers based on DWC USB3 IP.
> +
>  endif
> diff --git a/drivers/usb/dwc3/Makefile b/drivers/usb/dwc3/Makefile
> index 7ac7250..31e82b3 100644
> --- a/drivers/usb/dwc3/Makefile
> +++ b/drivers/usb/dwc3/Makefile
> @@ -48,3 +48,4 @@ obj-$(CONFIG_USB_DWC3_PCI)  += dwc3-pci.o
>  obj-$(CONFIG_USB_DWC3_KEYSTONE)  += dwc3-keystone.o
>  obj-$(CONFIG_USB_DWC3_OF_SIMPLE) += dwc3-of-simple.o
>  obj-$(CONFIG_USB_DWC3_ST)+= dwc3-st.o
> +obj-$(CONFIG_USB_DWC3_UNIPHIER)  += dwc3-uniphier.o
> diff --git a/drivers/usb/dwc3/dwc3-uniphier.c 
> b/drivers/usb/dwc3/dwc3-uniphier.c
> new file mode 100644
> index 000..58e84cd
> --- /dev/null
> +++ b/drivers/usb/dwc3/dwc3-uniphier.c
> @@ -0,0 +1,554 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/**
> + * dwc3-uniphier.c - Socionext UniPhier DWC3 specific glue layer
> + *
> + * Copyright 2015-2018 Socionext Inc.
> + *
> + * Author:
> + *   Kunihiko Hayashi 
> + * Contributors:
> + *  Motoya Tanigawa 
> + *  Masami Hiramatsu 
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#define RESET_CTL0x000
> +#define LINK_RESET   BIT(15)
> +
> +#define VBUS_CONTROL(n)  (0x100 + 0x10 * (n))
> +#define DRVVBUS_REG  BIT(4)
> +#define DRVVBUS_REG_EN   BIT(3)
> +
> +#define U2PHY_CFG0(n)(0x200 + 0x10 * (n))
> +#define U2PHY_CFG0_HS_I_MASK GENMASK(31, 28)
> +#define U2PHY_CFG0_HSDISC_MASK   GENMASK(27, 26)
> +#define U2PHY_CFG0_SWING_MASKGENMASK(17, 16)
> +#define U2PHY_CFG0_SEL_T_MASKGENMASK(15, 12)
> +#define U2PHY_CFG0_RTERM_MASKGENMASK(7, 6)
> +#define U2PHY_CFG0_TRIMMASK  (U2PHY_CFG0_HS_I_MASK \
> +  | U2PHY_CFG0_SEL_T_MASK \
> +  | U2PHY_CFG0_RTERM_MASK)
> +
> +#define U2PHY_CFG1(n)(0x204 + 0x10 * (n))
> +#define U2PHY_CFG1_DAT_ENBIT(29)
> +#define U2PHY_CFG1_ADR_ENBIT(28)
> +#define U2PHY_CFG1_ADR_MASK  GENMASK(27, 16)
> +#define U2PHY_CFG1_DAT_MASK  GENMASK(23, 16)
> +
> +#define U3PHY_TESTI(n)   (0x300 + 0x10 * (n))
> +#define U3PHY_TESTO(n)   (0x304 + 0x10 * (n))
> +#define TESTI_DAT_MASK   GENMASK(13, 6)
> +#define TESTI_ADR_MASK   GENMASK(5, 1)
> +#define TESTI_WR_EN  BIT(0)
> +
> +#define HOST_CONFIG0 0x400
> +#define NUM_U3_MASK  GENMASK(13, 11)
> +#define NUM_U2_MASK  GENMASK(10, 8)
> +
> +#define PHY_MAX_PARAMS   32
> +
> +struct dwc3u_phy_param {
> + u32 addr;
> + u32 mask;
> + u32 val;
> +};
> +
> +struct dwc3u_trim_param {
> + u32 rterm;
> + u32 sel_t;
> + u32 hs_i;
> +};
> +
> +#define trim_param_is_valid(p)   ((p)->rterm || (p)->sel_t || (p)->hs_i)
> +
> +struct dwc3u_priv {
> + struct device   *dev;
> + void __iomem*base;
> + struct clk  **clks;
> + int nclks;
> + struct reset_control*rst;
> + int nvbus;
> + const struct dwc3u_soc_data *data;
> +};
> +
> +struct dwc3u_soc_data {
> + int ss_nparams;
> + struct dwc3u_phy_param ss_param[PHY_MAX_PARAMS];
> + int hs_nparams;
> + struct dwc3

Re: [PATCH 1/6] USB: move many drivers to use DEVICE_ATTR_RW

2018-01-23 Thread Alan Stern
On Tue, 23 Jan 2018, Greg Kroah-Hartman wrote:

> Instead of "open coding" a DEVICE_ATTR() define, use the
> DEVICE_ATTR_RW() macro instead, which does everything properly instead.
> 
> This does require a few static functions to be renamed to work properly,
> but thanks to a script from Joe Perches, this was easily done.
> 
> Reported-by: Joe Perches 
> Cc: Matthieu CASTET 
> Cc: Stanislaw Gruszka 
> Cc: Peter Chen 
> Cc: Alan Stern 
> Cc: Mathias Nyman 
> Cc: Bin Liu 
> Cc: Felipe Balbi 
> Signed-off-by: Greg Kroah-Hartman 

For the EHCI part of 1/6 and the storage part of 2/6:

Acked-by: Alan Stern 

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/6] USB: move many drivers to use DEVICE_ATTR_WO

2018-01-23 Thread Shuah Khan
On 01/23/2018 03:24 AM, Greg Kroah-Hartman wrote:
> Instead of "open coding" a DEVICE_ATTR() define, use the
> DEVICE_ATTR_WO() macro instead, which does everything properly instead.
> 
> This does require a few static functions to be renamed to work properly,
> but thanks to a script from Joe Perches, this was easily done.
> 
> Reported-by: Joe Perches 
> Cc: Peter Chen 
> Cc: Felipe Balbi 
> Cc: Johan Hovold 
> Cc: Valentina Manea 
> Cc: Shuah Khan 
> Signed-off-by: Greg Kroah-Hartman 
> ---
>  drivers/usb/chipidea/otg_fsm.c | 4 ++--
>  drivers/usb/gadget/udc/core.c  | 8 
>  drivers/usb/phy/phy-mv-usb.c   | 4 ++--
>  drivers/usb/serial/ftdi_sio.c  | 4 ++--
>  drivers/usb/usbip/stub_dev.c   | 4 ++--
>  drivers/usb/usbip/vhci_sysfs.c | 8 
>  drivers/usb/usbip/vudc_sysfs.c | 4 ++--
>  7 files changed, 18 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/usb/chipidea/otg_fsm.c b/drivers/usb/chipidea/otg_fsm.c
> index d076cfa22fdf..6ed4b00dba96 100644
> --- a/drivers/usb/chipidea/otg_fsm.c
> +++ b/drivers/usb/chipidea/otg_fsm.c
> @@ -162,7 +162,7 @@ b_bus_req_store(struct device *dev, struct 
> device_attribute *attr,
>  static DEVICE_ATTR_RW(b_bus_req);
>  
>  static ssize_t
> -set_a_clr_err(struct device *dev, struct device_attribute *attr,
> +a_clr_err_store(struct device *dev, struct device_attribute *attr,
>   const char *buf, size_t count)
>  {
>   struct ci_hdrc  *ci = dev_get_drvdata(dev);
> @@ -179,7 +179,7 @@ set_a_clr_err(struct device *dev, struct device_attribute 
> *attr,
>  
>   return count;
>  }
> -static DEVICE_ATTR(a_clr_err, S_IWUSR, NULL, set_a_clr_err);
> +static DEVICE_ATTR_WO(a_clr_err);
>  
>  static struct attribute *inputs_attrs[] = {
>   &dev_attr_a_bus_req.attr,
> diff --git a/drivers/usb/gadget/udc/core.c b/drivers/usb/gadget/udc/core.c
> index ac0541529499..859d5b11ba4c 100644
> --- a/drivers/usb/gadget/udc/core.c
> +++ b/drivers/usb/gadget/udc/core.c
> @@ -1417,7 +1417,7 @@ EXPORT_SYMBOL_GPL(usb_gadget_unregister_driver);
>  
>  /* - 
> */
>  
> -static ssize_t usb_udc_srp_store(struct device *dev,
> +static ssize_t srp_store(struct device *dev,
>   struct device_attribute *attr, const char *buf, size_t n)
>  {
>   struct usb_udc  *udc = container_of(dev, struct usb_udc, dev);
> @@ -1427,9 +1427,9 @@ static ssize_t usb_udc_srp_store(struct device *dev,
>  
>   return n;
>  }
> -static DEVICE_ATTR(srp, S_IWUSR, NULL, usb_udc_srp_store);
> +static DEVICE_ATTR_WO(srp);
>  
> -static ssize_t usb_udc_softconn_store(struct device *dev,
> +static ssize_t soft_connect_store(struct device *dev,
>   struct device_attribute *attr, const char *buf, size_t n)
>  {
>   struct usb_udc  *udc = container_of(dev, struct usb_udc, dev);
> @@ -1453,7 +1453,7 @@ static ssize_t usb_udc_softconn_store(struct device 
> *dev,
>  
>   return n;
>  }
> -static DEVICE_ATTR(soft_connect, S_IWUSR, NULL, usb_udc_softconn_store);
> +static DEVICE_ATTR_WO(soft_connect);
>  
>  static ssize_t state_show(struct device *dev, struct device_attribute *attr,
> char *buf)
> diff --git a/drivers/usb/phy/phy-mv-usb.c b/drivers/usb/phy/phy-mv-usb.c
> index 49a4dd88c301..cfd9add10bf4 100644
> --- a/drivers/usb/phy/phy-mv-usb.c
> +++ b/drivers/usb/phy/phy-mv-usb.c
> @@ -562,7 +562,7 @@ a_bus_req_store(struct device *dev, struct 
> device_attribute *attr,
>  static DEVICE_ATTR_RW(a_bus_req);
>  
>  static ssize_t
> -set_a_clr_err(struct device *dev, struct device_attribute *attr,
> +a_clr_err_store(struct device *dev, struct device_attribute *attr,
> const char *buf, size_t count)
>  {
>   struct mv_otg *mvotg = dev_get_drvdata(dev);
> @@ -586,7 +586,7 @@ set_a_clr_err(struct device *dev, struct device_attribute 
> *attr,
>   return count;
>  }
>  
> -static DEVICE_ATTR(a_clr_err, S_IWUSR, NULL, set_a_clr_err);
> +static DEVICE_ATTR_WO(a_clr_err);
>  
>  static ssize_t
>  a_bus_drop_show(struct device *dev, struct device_attribute *attr,
> diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
> index fc68952c994a..f58c4ff6b387 100644
> --- a/drivers/usb/serial/ftdi_sio.c
> +++ b/drivers/usb/serial/ftdi_sio.c
> @@ -1691,7 +1691,7 @@ static DEVICE_ATTR_RW(latency_timer);
>  
>  /* Write an event character directly to the FTDI register.  The ASCII
> value is in the low 8 bits, with the enable bit in the 9th bit. */
> -static ssize_t store_event_char(struct device *dev,
> +static ssize_t event_char_store(struct device *dev,
>   struct device_attribute *attr, const char *valbuf, size_t count)
>  {
>   struct usb_serial_port *port = to_usb_serial_port(dev);
> @@ -1718,7 +1718,7 @@ static ssize_t store_event_char(struct device *dev,
>  
>   return count;
>  }
> -static DEVICE_ATTR(event_char, S_IWUSR, NULL, store_event_char);
> +static DEVICE_ATTR_WO(event

[PATCH] USB: misc: chaoskey: Use true and false for boolean values

2018-01-23 Thread Gustavo A. R. Silva
Assign true or false to boolean variables instead of an integer value.

This issue was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva 
---
 drivers/usb/misc/chaoskey.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/misc/chaoskey.c b/drivers/usb/misc/chaoskey.c
index b6a1b93..716cb51 100644
--- a/drivers/usb/misc/chaoskey.c
+++ b/drivers/usb/misc/chaoskey.c
@@ -183,10 +183,10 @@ static int chaoskey_probe(struct usb_interface *interface,
dev->in_ep = in_ep;
 
if (le16_to_cpu(udev->descriptor.idVendor) != ALEA_VENDOR_ID)
-   dev->reads_started = 1;
+   dev->reads_started = true;
 
dev->size = size;
-   dev->present = 1;
+   dev->present = true;
 
init_waitqueue_head(&dev->wait_q);
 
@@ -239,7 +239,7 @@ static void chaoskey_disconnect(struct usb_interface 
*interface)
usb_set_intfdata(interface, NULL);
mutex_lock(&dev->lock);
 
-   dev->present = 0;
+   dev->present = false;
usb_poison_urb(dev->urb);
 
if (!dev->open) {
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] usb: dwc2: gadget: Use true and false for boolean values

2018-01-23 Thread Gustavo A. R. Silva
Assign true or false to boolean variables instead of an integer value.

This issue was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva 
---
 drivers/usb/dwc2/gadget.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index e4c3ce0..1f684dd 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -116,10 +116,10 @@ static inline void dwc2_gadget_incr_frame_num(struct 
dwc2_hsotg_ep *hs_ep)
 {
hs_ep->target_frame += hs_ep->interval;
if (hs_ep->target_frame > DSTS_SOFFN_LIMIT) {
-   hs_ep->frame_overrun = 1;
+   hs_ep->frame_overrun = true;
hs_ep->target_frame &= DSTS_SOFFN_LIMIT;
} else {
-   hs_ep->frame_overrun = 0;
+   hs_ep->frame_overrun = false;
}
 }
 
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [BUG] SD card reader disappears after suspend

2018-01-23 Thread Alan Stern
On Tue, 23 Jan 2018, Samuel Sadok wrote:

> Thanks Alan,
> 
> While I was at it I also enabled debug logs for xhci_hcd and xhci_pci.
> 
> $ echo module usbcore =p > /sys/kernel/debug/dynamic_debug/control
> $ echo module xhci_hcd =p > /sys/kernel/debug/dynamic_debug/control
> $ echo module xhci_pci =p > /sys/kernel/debug/dynamic_debug/control
> $ modprobe usbmon
> $ cat /sys/kernel/debug/usb/usbmon/0u > /tmp/usbmon.log
> $ # press power button
> 
> dmesg: https://gist.github.com/anonymous/29b81574abf40605f999cfeefe98e341
> usbmon: https://gist.github.com/anonymous/55b6d9bbf8b8c8627230b10d2b09dcb6
> 
> Both logs were collected at the same time so the timestamps should match.

In fact they do, quite closely.  But there is a noticeable gap in the
usbmon trace, between lines 197 and 198 (the timestamp jumps from
35923531 to 38925126) and there obviously was a lot of activity on bus
1 in between.

> Resume starts at dmesg line 1255.
> As far as I can judge, the earliest indication of something going
> wrong is line 1514:
> [ 36.087176] xhci_hcd :00:14.0: xHCI xhci_urb_enqueue called with
> unaddressed device
> [ 36.087180] usb 2-4: Disable of device-initiated U1 failed.
> [ 36.087212] xhci_hcd :00:14.0: xHCI xhci_urb_enqueue called with
> unaddressed device
> [ 36.087224] usb 2-4: Disable of device-initiated U2 failed.
> [ 36.087226] xhci_hcd :00:14.0: xHCI xhci_urb_enqueue called with
> unaddressed device
> [ 36.087227] usb 2-4: usb_reset_and_verify_device Failed to disable LTM

Yes, that's where the problem first seems to show up.  Apparently 
usb_disable_ltm() fails because it can't communicate with the device, 
and usb_reset_and_verify_device() then aborts because of that failure.
It shouldn't do this; after all, one very good reason for resetting the 
device is because we're unable to communicate with it.

You could try editing the source code for usb_reset_and_verify_device() 
in drivers/usb/core/hub.c, to see what happens if it doesn't give up 
after usb_disable_ltm() fails.

However, this does not explain the errors that occur later, notably 
around line 2008 or a little earlier:

[   42.819016] usb usb2-port4: not enabled, trying warm reset again...
[   42.819020] usb usb2-port4: Cannot enable. Maybe the USB cable is bad?
[   42.819110] xhci_hcd :00:14.0: Cannot set link state.
[   42.819125] usb usb2-port4: cannot disable (err = -32)
[   42.819180] usb usb2-port4: status 0341, change 0010, 5.0 Gb/s
[   42.819185] usb 2-4: USB disconnect, device number 2

Perhaps Mathias can take a look at this, and the error messages that
follow, and figure out what's going wrong.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB-C Devices only show up if connected at boot

2018-01-23 Thread Mike Lothian
Hi

I raised https://bugzilla.kernel.org/show_bug.cgi?id=198557 but was
informed by Greg bugs should be raised on the mailing list not in
bugzilla

So USB-C devices only show up in dmesg or for use if they are
connected during boot

Once booted and the device is disconnected the following message
appears in the dmesg:

[  100.814687] usb 3-1: USB disconnect, device number 3
[  100.882840] xhci_hcd :39:00.0: xHCI host controller not
responding, assume dead
[  100.882843] xhci_hcd :39:00.0: HC died; cleaning up

No further connections or disconnections display anything further in
the dmesg, the device works fine if connected via USB-A

I've witnessed this behaviour since getting the laptop at the end of
2015 so this isn't a regression

The full dmesg can be seen here
https://bugzilla.kernel.org/attachment.cgi?id=273801

Thanks for any help you can offer

Mike
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/6] USB: move many drivers to use DEVICE_ATTR_RW

2018-01-23 Thread Bin Liu
On Tue, Jan 23, 2018 at 11:24:05AM +0100, Greg Kroah-Hartman wrote:
> Instead of "open coding" a DEVICE_ATTR() define, use the
> DEVICE_ATTR_RW() macro instead, which does everything properly instead.
> 
> This does require a few static functions to be renamed to work properly,
> but thanks to a script from Joe Perches, this was easily done.
> 
> Reported-by: Joe Perches 
> Cc: Matthieu CASTET 
> Cc: Stanislaw Gruszka 
> Cc: Peter Chen 
> Cc: Alan Stern 
> Cc: Mathias Nyman 
> Cc: Bin Liu 
> Cc: Felipe Balbi 
> Signed-off-by: Greg Kroah-Hartman 

For MUSB part in 1/6, and 5/6:

Acked-by: Bin Liu 

Regards,
-Bin.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: USB-C Devices only show up if connected at boot

2018-01-23 Thread Greg KH
On Tue, Jan 23, 2018 at 05:12:03PM +, Mike Lothian wrote:
> Hi
> 
> I raised https://bugzilla.kernel.org/show_bug.cgi?id=198557 but was
> informed by Greg bugs should be raised on the mailing list not in
> bugzilla
> 
> So USB-C devices only show up in dmesg or for use if they are
> connected during boot
> 
> Once booted and the device is disconnected the following message
> appears in the dmesg:
> 
> [  100.814687] usb 3-1: USB disconnect, device number 3
> [  100.882840] xhci_hcd :39:00.0: xHCI host controller not
> responding, assume dead
> [  100.882843] xhci_hcd :39:00.0: HC died; cleaning up
> 
> No further connections or disconnections display anything further in
> the dmesg, the device works fine if connected via USB-A
> 
> I've witnessed this behaviour since getting the laptop at the end of
> 2015 so this isn't a regression

Is there a BIOS update for the laptop?  This has been seen a lot in the
past on lots of different laptops but was always resolved by the BIOS
update (the latest one for mine also updates the xhci controller as
well.)

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: USB-C Devices only show up if connected at boot

2018-01-23 Thread Mike Lothian
On Tue, 23 Jan 2018 at 17:30 Greg KH  wrote:
>
> On Tue, Jan 23, 2018 at 05:12:03PM +, Mike Lothian wrote:
> > Hi
> >
> > I raised https://bugzilla.kernel.org/show_bug.cgi?id=198557 but was
> > informed by Greg bugs should be raised on the mailing list not in
> > bugzilla
> >
> > So USB-C devices only show up in dmesg or for use if they are
> > connected during boot
> >
> > Once booted and the device is disconnected the following message
> > appears in the dmesg:
> >
> > [  100.814687] usb 3-1: USB disconnect, device number 3
> > [  100.882840] xhci_hcd :39:00.0: xHCI host controller not
> > responding, assume dead
> > [  100.882843] xhci_hcd :39:00.0: HC died; cleaning up
> >
> > No further connections or disconnections display anything further in
> > the dmesg, the device works fine if connected via USB-A
> >
> > I've witnessed this behaviour since getting the laptop at the end of
> > 2015 so this isn't a regression
>
> Is there a BIOS update for the laptop?  This has been seen a lot in the
> past on lots of different laptops but was always resolved by the BIOS
> update (the latest one for mine also updates the xhci controller as
> well.)
>
> thanks,
>
> greg k-h


Hi

I've applied all BIOS updates for my laptop including the pulled one
for Spectre/Meltdown & ME bugs the other week
http://www.dell.com/support/home/uk/en/ukdhs1/product-support/servicetag/8k5w662/drivers

If it helps, I don't have this issue in Windows but I rarely have it booted

I thought it might have something to do with an ACPI failure (see bug
https://bugzilla.kernel.org/show_bug.cgi?id=198051)

Regards

Mike
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: USB-C Devices only show up if connected at boot

2018-01-23 Thread Adrian Bocaniciu
On Tue, 23 Jan 2018 17:43:27 +
Mike Lothian  wrote:

> Hi
> 
> I've applied all BIOS updates for my laptop including the pulled one
> for Spectre/Meltdown & ME bugs the other week
> http://www.dell.com/support/home/uk/en/ukdhs1/product-support/servicetag/8k5w662/drivers
> 
> If it helps, I don't have this issue in Windows but I rarely have it booted
> 
> I thought it might have something to do with an ACPI failure (see bug
> https://bugzilla.kernel.org/show_bug.cgi?id=198051)
> 
> Regards
> 
> Mike
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


Hi Mike,

You did not specify what provides the USB-C port.

I suppose that your USB-C port is actually a Thunderbolt 3 port from an Intel 
controller.

What you describe is a well known bug that affects all Thunderbolt 3 ports and 
this bug has always existed in Linux, including until now.


I also have a Dell laptop, some Intel NUCs and some ATX motherboards with 
Thunderbolt 3 ports, all of which have this bug.

On the other hand, all the USB C ports that I have seen, which are connected to 
other USB controllers, e.g. from ASMedia, those work normally, they do not have 
this bug.

Best regards !









--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: USB-C Devices only show up if connected at boot

2018-01-23 Thread Mike Lothian
>
> Hi Mike,
>
> You did not specify what provides the USB-C port.
>
> I suppose that your USB-C port is actually a Thunderbolt 3 port from an Intel 
> controller.
>
> What you describe is a well known bug that affects all Thunderbolt 3 ports 
> and this bug has always existed in Linux, including until now.
>
>
> I also have a Dell laptop, some Intel NUCs and some ATX motherboards with 
> Thunderbolt 3 ports, all of which have this bug.
>
> On the other hand, all the USB C ports that I have seen, which are connected 
> to other USB controllers, e.g. from ASMedia, those work normally, they do not 
> have this bug.
>
> Best regards !


Hi

I'm not sure what chip is in the laptop, most of the time it doesn't
show up at all

Is there a bug report I can follow? Is this issue even being worked on?

Thanks

Mike
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] USB: misc: chaoskey: Use true and false for boolean values

2018-01-23 Thread Keith Packard
"Gustavo A. R. Silva"  writes:

> Assign true or false to boolean variables instead of an integer value.
>
> This issue was detected with the help of Coccinelle.
>
> Signed-off-by: Gustavo A. R. Silva 

Reviewed-by: Keith Packard 

-- 
-keith


signature.asc
Description: PGP signature


Re: [PATCH 3/6] USB: move many drivers to use DEVICE_ATTR_WO

2018-01-23 Thread Johan Hovold
On Tue, Jan 23, 2018 at 11:24:07AM +0100, Greg Kroah-Hartman wrote:
> Instead of "open coding" a DEVICE_ATTR() define, use the
> DEVICE_ATTR_WO() macro instead, which does everything properly instead.
> 
> This does require a few static functions to be renamed to work properly,
> but thanks to a script from Joe Perches, this was easily done.
> 
> Reported-by: Joe Perches 
> Cc: Peter Chen 
> Cc: Felipe Balbi 
> Cc: Johan Hovold 
> Cc: Valentina Manea 
> Cc: Shuah Khan 
> Signed-off-by: Greg Kroah-Hartman 
> ---
>  drivers/usb/chipidea/otg_fsm.c | 4 ++--
>  drivers/usb/gadget/udc/core.c  | 8 
>  drivers/usb/phy/phy-mv-usb.c   | 4 ++--
>  drivers/usb/serial/ftdi_sio.c  | 4 ++--

For usb-serial:

Acked-by: Johan Hovold 
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/6] USB: move many drivers to use DEVICE_ATTR_RO

2018-01-23 Thread Pete Zaitcev
On Tue, 23 Jan 2018 11:24:06 +0100
Greg Kroah-Hartman  wrote:

> +++ b/drivers/usb/class/usblp.c

> -static ssize_t usblp_show_ieee1284_id(struct device *dev, struct 
> device_attribute *attr, char *buf)
> +static ssize_t ieee1284_id_show(struct device *dev, struct device_attribute 
> *attr, char *buf)

> -static DEVICE_ATTR(ieee1284_id, S_IRUGO, usblp_show_ieee1284_id, NULL);
> +static DEVICE_ATTR_RO(ieee1284_id);

You know, I hate this interface a little: it's too implicit. Before,
one could hit '*' in vi and get to the function that implements it.
Now, you have to know the foo_show convention. But if you think
it's worth being a bit more explicit about "this is intended to
be a RO attribute", then okay.

Acked-by: Pete Zaitcev 

-- P
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v10] xhci : AMD Promontory USB disable port support

2018-01-23 Thread Joe Lee
For AMD Promontory xHCI host,although you can disable USB ports in
BIOSsettings,those ports will be enabled anyway after you remove a
device onthat port and re-plug it in again. It's a known limitation of
the chip.As a workaround we can clear the PORT_WAKE_BITS.

Signed-off-by: Joe Lee 
---
v10:Change coding style
v9: Fix multi-line comment style 
v8: usb_amd_pt_check_port() function return a bool
v7: add a empty function for the case 
when CONFIG_USB_PCI is not defined in pci-quirks.h
v6: Fix coding format.
v5: Add check disable port setting before set PORT_WAKE_BITS
v4: Remove the patch code in case USB_PORT_FEAT_REMOTE_WAKE_MASK
v3: Fix some checkpatch.pl

 drivers/usb/host/pci-quirks.c | 107 ++
 drivers/usb/host/pci-quirks.h |   5 ++
 drivers/usb/host/xhci-hub.c   |   7 +++
 drivers/usb/host/xhci-pci.c   |  11 +
 drivers/usb/host/xhci.h   |   2 +-
 5 files changed, 131 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
index 1615367..be2bd53 100644
--- a/drivers/usb/host/pci-quirks.c
+++ b/drivers/usb/host/pci-quirks.c
@@ -66,6 +66,23 @@
 #defineAX_INDXC0x30
 #defineAX_DATAC0x34
 
+#define PT_ADDR_INDX   0xE8
+#define PT_READ_INDX   0xE4
+#define PT_SIG_1_ADDR  0xA520
+#define PT_SIG_2_ADDR  0xA521
+#define PT_SIG_3_ADDR  0xA522
+#define PT_SIG_4_ADDR  0xA523
+#define PT_SIG_1_DATA  0x78
+#define PT_SIG_2_DATA  0x56
+#define PT_SIG_3_DATA  0x34
+#define PT_SIG_4_DATA  0x12
+#define PT4_P1_REG 0xB521
+#define PT4_P2_REG 0xB522
+#define PT2_P1_REG 0xD520
+#define PT2_P2_REG 0xD521
+#define PT1_P1_REG 0xD522
+#define PT1_P2_REG 0xD523
+
 #defineNB_PCIE_INDX_ADDR   0xe0
 #defineNB_PCIE_INDX_DATA   0xe4
 #definePCIE_P_CNTL 0x10040
@@ -512,6 +529,96 @@ void usb_amd_dev_put(void)
 }
 EXPORT_SYMBOL_GPL(usb_amd_dev_put);
 
+bool usb_amd_pt_check_port(struct device *device, int port)
+{
+   unsigned char value, port_shift;
+   struct pci_dev *pdev;
+   u16 reg;
+
+   pdev = to_pci_dev(device);
+   pci_write_config_word(pdev, PT_ADDR_INDX, PT_SIG_1_ADDR);
+
+   pci_read_config_byte(pdev, PT_READ_INDX, &value);
+   if (value != PT_SIG_1_DATA)
+   return false;
+
+   pci_write_config_word(pdev, PT_ADDR_INDX, PT_SIG_2_ADDR);
+
+   pci_read_config_byte(pdev, PT_READ_INDX, &value);
+   if (value != PT_SIG_2_DATA)
+   return false;
+
+   pci_write_config_word(pdev, PT_ADDR_INDX, PT_SIG_3_ADDR);
+
+   pci_read_config_byte(pdev, PT_READ_INDX, &value);
+   if (value != PT_SIG_3_DATA)
+   return false;
+
+   pci_write_config_word(pdev, PT_ADDR_INDX, PT_SIG_4_ADDR);
+
+   pci_read_config_byte(pdev, PT_READ_INDX, &value);
+   if (value != PT_SIG_4_DATA)
+   return false;
+
+
+   switch (pdev->device) {
+   /* device is AMD_PROMONTORYA_4(0x43b9) or
+* PROMONTORYA_3(0x43ba)
+* disable port setting
+* PT_4_P1_REG[7..1] is USB2.0 port6 to 0
+* PT4_P2_REG[6..0] is USB 13 to port 7
+* 0 : disable ;1 : enable
+*/
+   case 0x43b9:
+   case 0x43ba:
+   if (port > 6) {
+   reg = PT4_P2_REG;
+   port_shift = port - 7;
+   } else {
+   reg = PT4_P1_REG;
+   port_shift = port + 1;
+   }
+   break;
+   /* device is AMD_PROMONTORYA_2(0x43bb)
+* disable port setting
+* PT2_P1_REG[7..5] is USB2.0 port2 to 0
+* PT2_P2_REG[5..0] is USB 9 to port3
+* 0 : disable ;1 : enable
+*/
+   case 0x43bb:
+   if (port > 2) {
+   reg = PT2_P2_REG;
+   port_shift = port - 3;
+   } else {
+   reg = PT2_P1_REG;
+   port_shift = port + 5;
+   }
+   break;
+   /* device is AMD_PROMONTORYA_1(0x43bc)
+* disable port setting
+* PT1_P1_REG[7..4] is USB2.0 port3 to 0
+* PT1_P2_REG[5..0] is USB 9 to port4
+* 0 : disable ;1 : enable
+*/
+   case 0x43bc:
+   if (port > 3) {
+   reg = PT1_P2_REG;
+   port_shift = port - 4;
+   } else {
+   reg = PT1_P1_REG;
+   port_shift = port + 4;
+   }
+   break;
+   default:
+   return false;
+   }
+   pci_write_config_word(pdev, PT_ADDR_INDX, reg);
+   pci_read_config_byte(pdev, PT_READ_INDX, &value);
+
+   return !(value & BIT(port_shift));
+}
+EXPORT_SYMBOL_GPL(usb_amd_pt_check_port);
+
 /*
  * Make sure the contro

Re: [PATCH v3 2/2] usb/gadget: Add driver for Aspeed SoC virtual hub

2018-01-23 Thread kbuild test robot
Hi Benjamin,

I love your patch! Yet something to improve:

[auto build test ERROR on balbi-usb/next]
[also build test ERROR on v4.15-rc9]
[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/Benjamin-Herrenschmidt/usb-gadget-Add-an-EP-dispose-callback-for-EP-lifetime-tracking/20180124-065635
base:   https://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git next
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 7.2.0
reproduce:
wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=ia64 

All errors (new ones prefixed by >>):

   WARNING: modpost: missing MODULE_LICENSE() in 
drivers/auxdisplay/img-ascii-lcd.o
   see include/linux/module.h for more information
   WARNING: modpost: missing MODULE_LICENSE() in drivers/gpio/gpio-ath79.o
   see include/linux/module.h for more information
   WARNING: modpost: missing MODULE_LICENSE() in drivers/gpio/gpio-iop.o
   see include/linux/module.h for more information
   WARNING: modpost: missing MODULE_LICENSE() in drivers/iio/accel/kxsd9-i2c.o
   see include/linux/module.h for more information
   WARNING: modpost: missing MODULE_LICENSE() in 
drivers/iio/adc/qcom-vadc-common.o
   see include/linux/module.h for more information
   WARNING: modpost: missing MODULE_LICENSE() in 
drivers/media/platform/mtk-vcodec/mtk-vcodec-common.o
   see include/linux/module.h for more information
   WARNING: modpost: missing MODULE_LICENSE() in 
drivers/media/platform/tegra-cec/tegra_cec.o
   see include/linux/module.h for more information
   WARNING: modpost: missing MODULE_LICENSE() in drivers/mtd/nand/denali_pci.o
   see include/linux/module.h for more information
   WARNING: modpost: missing MODULE_LICENSE() in 
drivers/pinctrl/pxa/pinctrl-pxa2xx.o
   see include/linux/module.h for more information
   WARNING: modpost: missing MODULE_LICENSE() in drivers/power/reset/zx-reboot.o
   see include/linux/module.h for more information
   WARNING: modpost: missing MODULE_LICENSE() in 
drivers/usb/gadget/udc/aspeed-vhub/dev.o
   see include/linux/module.h for more information
   WARNING: modpost: missing MODULE_LICENSE() in 
drivers/usb/gadget/udc/aspeed-vhub/ep0.o
   see include/linux/module.h for more information
   WARNING: modpost: missing MODULE_LICENSE() in 
drivers/usb/gadget/udc/aspeed-vhub/epn.o
   see include/linux/module.h for more information
   WARNING: modpost: missing MODULE_LICENSE() in 
drivers/usb/gadget/udc/aspeed-vhub/hub.o
   see include/linux/module.h for more information
>> ERROR: "ast_vhub_dev_suspend" [drivers/usb/gadget/udc/aspeed-vhub/hub.ko] 
>> undefined!
>> ERROR: "ast_vhub_dev_reset" [drivers/usb/gadget/udc/aspeed-vhub/hub.ko] 
>> undefined!
>> ERROR: "__ast_vhub_simple_reply" [drivers/usb/gadget/udc/aspeed-vhub/hub.ko] 
>> undefined!
>> ERROR: "ast_vhub_dev_resume" [drivers/usb/gadget/udc/aspeed-vhub/hub.ko] 
>> undefined!
>> ERROR: "ast_vhub_reply" [drivers/usb/gadget/udc/aspeed-vhub/hub.ko] 
>> undefined!
>> ERROR: "ast_vhub_free_request" [drivers/usb/gadget/udc/aspeed-vhub/epn.ko] 
>> undefined!
>> ERROR: "ast_vhub_alloc_request" [drivers/usb/gadget/udc/aspeed-vhub/epn.ko] 
>> undefined!
>> ERROR: "ast_vhub_nuke" [drivers/usb/gadget/udc/aspeed-vhub/epn.ko] undefined!
>> ERROR: "ast_vhub_done" [drivers/usb/gadget/udc/aspeed-vhub/epn.ko] undefined!
>> ERROR: "ast_vhub_free_request" [drivers/usb/gadget/udc/aspeed-vhub/ep0.ko] 
>> undefined!
>> ERROR: "ast_vhub_alloc_request" [drivers/usb/gadget/udc/aspeed-vhub/ep0.ko] 
>> undefined!
>> ERROR: "ast_vhub_std_dev_request" 
>> [drivers/usb/gadget/udc/aspeed-vhub/ep0.ko] undefined!
>> ERROR: "ast_vhub_class_hub_request" 
>> [drivers/usb/gadget/udc/aspeed-vhub/ep0.ko] undefined!
>> ERROR: "ast_vhub_std_hub_request" 
>> [drivers/usb/gadget/udc/aspeed-vhub/ep0.ko] undefined!
>> ERROR: "ast_vhub_nuke" [drivers/usb/gadget/udc/aspeed-vhub/ep0.ko] undefined!
>> ERROR: "ast_vhub_done" [drivers/usb/gadget/udc/aspeed-vhub/ep0.ko] undefined!
>> ERROR: "ast_vhub_init_ep0" [drivers/usb/gadget/udc/aspeed-vhub/dev.ko] 
>> undefined!
>> ERROR: "__ast_vhub_simple_reply" [drivers/usb/gadget/udc/aspeed-vhub/dev.ko] 
>> undefined!
>> ERROR: "ast_vhub_ep0_handle_setup" 
>> [drivers/usb/gadget/udc/aspeed-vhub/dev.ko] undefined!
>> ERROR: "ast_vhub_ep0_handle_ack" [drivers/usb/gadget/udc/aspeed-vhub/dev.ko] 
>> undefined!

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


.config.gz
Description: application/gzip


[PATCH 3/3] firmware: Fix up docs referring to FIRMWARE_IN_KERNEL

2018-01-23 Thread Benjamin Gilbert
We've removed the option, so stop talking about it.

Signed-off-by: Benjamin Gilbert 
Cc: Borislav Petkov 
Cc: Thomas Gleixner 
Cc: Ingo Molnar 
Cc: H. Peter Anvin 
---
 Documentation/driver-api/firmware/built-in-fw.rst | 7 +--
 Documentation/x86/microcode.txt   | 5 ++---
 arch/x86/Kconfig  | 6 +++---
 3 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/Documentation/driver-api/firmware/built-in-fw.rst 
b/Documentation/driver-api/firmware/built-in-fw.rst
index 7300e66857f8..396cdf591ac5 100644
--- a/Documentation/driver-api/firmware/built-in-fw.rst
+++ b/Documentation/driver-api/firmware/built-in-fw.rst
@@ -11,13 +11,8 @@ options:
   * CONFIG_EXTRA_FIRMWARE
   * CONFIG_EXTRA_FIRMWARE_DIR
 
-This should not be confused with CONFIG_FIRMWARE_IN_KERNEL, this is for drivers
-which enables firmware to be built as part of the kernel build process. This
-option, CONFIG_FIRMWARE_IN_KERNEL, will build all firmware for all drivers
-enabled which ship its firmware inside the Linux kernel source tree.
-
 There are a few reasons why you might want to consider building your firmware
-into the kernel with CONFIG_EXTRA_FIRMWARE though:
+into the kernel with CONFIG_EXTRA_FIRMWARE:
 
 * Speed
 * Firmware is needed for accessing the boot device, and the user doesn't
diff --git a/Documentation/x86/microcode.txt b/Documentation/x86/microcode.txt
index f57e1b45e628..aacd2f5e1a46 100644
--- a/Documentation/x86/microcode.txt
+++ b/Documentation/x86/microcode.txt
@@ -108,12 +108,11 @@ packages already put them there.
 
 
 The loader supports also loading of a builtin microcode supplied through
-the regular firmware builtin method CONFIG_FIRMWARE_IN_KERNEL. Only
-64-bit is currently supported.
+the regular firmware builtin method CONFIG_EXTRA_FIRMWARE. Only 64-bit is
+currently supported.
 
 Here's an example:
 
-CONFIG_FIRMWARE_IN_KERNEL=y
 CONFIG_EXTRA_FIRMWARE="intel-ucode/06-3a-09 amd-ucode/microcode_amd_fam15h.bin"
 CONFIG_EXTRA_FIRMWARE_DIR="/lib/firmware"
 
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 20da391b5f32..6d27d53de60d 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -1255,9 +1255,9 @@ config MICROCODE
  CONFIG_BLK_DEV_INITRD in order for the loader to be able to scan the
  initrd for microcode blobs.
 
- In addition, you can build-in the microcode into the kernel. For that 
you
- need to enable FIRMWARE_IN_KERNEL and add the vendor-supplied 
microcode
- to the CONFIG_EXTRA_FIRMWARE config option.
+ In addition, you can build the microcode into the kernel. For that you
+ need to add the vendor-supplied microcode to the CONFIG_EXTRA_FIRMWARE
+ config option.
 
 config MICROCODE_INTEL
bool "Intel microcode loading support"
-- 
2.13.6

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/3] USB: serial: keyspan: Drop firmware Kconfig options

2018-01-23 Thread Benjamin Gilbert
The USB_SERIAL_KEYSPAN_* firmware options no longer do anything.

Fixes: 5620a0d1aacd ("firmware: delete in-kernel firmware")
Signed-off-by: Benjamin Gilbert 
Cc: Greg Kroah-Hartman 
Cc: Johan Hovold 
---
 arch/mips/configs/rm200_defconfig |  9 
 arch/powerpc/configs/c2k_defconfig| 12 --
 arch/powerpc/configs/g5_defconfig | 12 --
 arch/powerpc/configs/maple_defconfig  | 12 --
 arch/powerpc/configs/pmac32_defconfig | 12 --
 drivers/usb/serial/Kconfig| 78 ---
 6 files changed, 135 deletions(-)

diff --git a/arch/mips/configs/rm200_defconfig 
b/arch/mips/configs/rm200_defconfig
index 99679e514042..5f71aa598b06 100644
--- a/arch/mips/configs/rm200_defconfig
+++ b/arch/mips/configs/rm200_defconfig
@@ -325,15 +325,6 @@ CONFIG_USB_SERIAL_EDGEPORT=m
 CONFIG_USB_SERIAL_EDGEPORT_TI=m
 CONFIG_USB_SERIAL_KEYSPAN_PDA=m
 CONFIG_USB_SERIAL_KEYSPAN=m
-CONFIG_USB_SERIAL_KEYSPAN_MPR=y
-CONFIG_USB_SERIAL_KEYSPAN_USA28X=y
-CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y
-CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y
-CONFIG_USB_SERIAL_KEYSPAN_USA19W=y
-CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y
-CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y
-CONFIG_USB_SERIAL_KEYSPAN_USA49W=y
-CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
 CONFIG_USB_SERIAL_KLSI=m
 CONFIG_USB_SERIAL_KOBIL_SCT=m
 CONFIG_USB_SERIAL_MCT_U232=m
diff --git a/arch/powerpc/configs/c2k_defconfig 
b/arch/powerpc/configs/c2k_defconfig
index f1552af9eecc..4bb832a41d55 100644
--- a/arch/powerpc/configs/c2k_defconfig
+++ b/arch/powerpc/configs/c2k_defconfig
@@ -272,18 +272,6 @@ CONFIG_USB_SERIAL_EDGEPORT=m
 CONFIG_USB_SERIAL_EDGEPORT_TI=m
 CONFIG_USB_SERIAL_KEYSPAN_PDA=m
 CONFIG_USB_SERIAL_KEYSPAN=m
-CONFIG_USB_SERIAL_KEYSPAN_MPR=y
-CONFIG_USB_SERIAL_KEYSPAN_USA28=y
-CONFIG_USB_SERIAL_KEYSPAN_USA28X=y
-CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y
-CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y
-CONFIG_USB_SERIAL_KEYSPAN_USA19=y
-CONFIG_USB_SERIAL_KEYSPAN_USA18X=y
-CONFIG_USB_SERIAL_KEYSPAN_USA19W=y
-CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y
-CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y
-CONFIG_USB_SERIAL_KEYSPAN_USA49W=y
-CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
 CONFIG_USB_SERIAL_KLSI=m
 CONFIG_USB_SERIAL_KOBIL_SCT=m
 CONFIG_USB_SERIAL_MCT_U232=m
diff --git a/arch/powerpc/configs/g5_defconfig 
b/arch/powerpc/configs/g5_defconfig
index 063817fee61c..67c39f4acede 100644
--- a/arch/powerpc/configs/g5_defconfig
+++ b/arch/powerpc/configs/g5_defconfig
@@ -189,18 +189,6 @@ CONFIG_USB_SERIAL_GARMIN=m
 CONFIG_USB_SERIAL_IPW=m
 CONFIG_USB_SERIAL_KEYSPAN_PDA=m
 CONFIG_USB_SERIAL_KEYSPAN=m
-CONFIG_USB_SERIAL_KEYSPAN_MPR=y
-CONFIG_USB_SERIAL_KEYSPAN_USA28=y
-CONFIG_USB_SERIAL_KEYSPAN_USA28X=y
-CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y
-CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y
-CONFIG_USB_SERIAL_KEYSPAN_USA19=y
-CONFIG_USB_SERIAL_KEYSPAN_USA18X=y
-CONFIG_USB_SERIAL_KEYSPAN_USA19W=y
-CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y
-CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y
-CONFIG_USB_SERIAL_KEYSPAN_USA49W=y
-CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
 CONFIG_USB_SERIAL_KLSI=m
 CONFIG_USB_SERIAL_KOBIL_SCT=m
 CONFIG_USB_SERIAL_MCT_U232=m
diff --git a/arch/powerpc/configs/maple_defconfig 
b/arch/powerpc/configs/maple_defconfig
index 078cdb427fc9..59e47ec85336 100644
--- a/arch/powerpc/configs/maple_defconfig
+++ b/arch/powerpc/configs/maple_defconfig
@@ -82,18 +82,6 @@ CONFIG_USB_SERIAL_CYPRESS_M8=m
 CONFIG_USB_SERIAL_GARMIN=m
 CONFIG_USB_SERIAL_IPW=m
 CONFIG_USB_SERIAL_KEYSPAN=y
-CONFIG_USB_SERIAL_KEYSPAN_MPR=y
-CONFIG_USB_SERIAL_KEYSPAN_USA28=y
-CONFIG_USB_SERIAL_KEYSPAN_USA28X=y
-CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y
-CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y
-CONFIG_USB_SERIAL_KEYSPAN_USA19=y
-CONFIG_USB_SERIAL_KEYSPAN_USA18X=y
-CONFIG_USB_SERIAL_KEYSPAN_USA19W=y
-CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y
-CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y
-CONFIG_USB_SERIAL_KEYSPAN_USA49W=y
-CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
 CONFIG_USB_SERIAL_TI=m
 CONFIG_EXT2_FS=y
 CONFIG_EXT4_FS=y
diff --git a/arch/powerpc/configs/pmac32_defconfig 
b/arch/powerpc/configs/pmac32_defconfig
index 1aab9a62a681..62948d198d7f 100644
--- a/arch/powerpc/configs/pmac32_defconfig
+++ b/arch/powerpc/configs/pmac32_defconfig
@@ -264,18 +264,6 @@ CONFIG_USB_SERIAL_VISOR=m
 CONFIG_USB_SERIAL_IPAQ=m
 CONFIG_USB_SERIAL_KEYSPAN_PDA=m
 CONFIG_USB_SERIAL_KEYSPAN=m
-CONFIG_USB_SERIAL_KEYSPAN_MPR=y
-CONFIG_USB_SERIAL_KEYSPAN_USA28=y
-CONFIG_USB_SERIAL_KEYSPAN_USA28X=y
-CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y
-CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y
-CONFIG_USB_SERIAL_KEYSPAN_USA19=y
-CONFIG_USB_SERIAL_KEYSPAN_USA18X=y
-CONFIG_USB_SERIAL_KEYSPAN_USA19W=y
-CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y
-CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y
-CONFIG_USB_SERIAL_KEYSPAN_USA49W=y
-CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
 CONFIG_USB_APPLEDISPLAY=m
 CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
 CONFIG_EXT2_FS=y
diff --git a/drivers/usb/serial/Kconfig b/drivers/usb/serial/Kconfig
index a8d5f2e4878d..716a3aa142ff 100644
--- a/drivers/usb/serial/Kconfig
+++ b/drivers/usb/serial/Kconfig
@@ -322,84 +322,6 @@ config USB_SERIAL_KEYSPAN

[PATCH 0/3] Drop config options left over from in-kernel firmware

2018-01-23 Thread Benjamin Gilbert
5620a0d1aacd ("firmware: delete in-kernel firmware") left behind several
config options which no longer do anything.  Remove them and fix up
documentation.

Benjamin Gilbert (3):
  USB: serial: keyspan: Drop firmware Kconfig options
  firmware: Drop FIRMWARE_IN_KERNEL Kconfig option
  firmware: Fix up docs referring to FIRMWARE_IN_KERNEL

 Documentation/driver-api/firmware/built-in-fw.rst |  7 +-
 Documentation/x86/microcode.txt   |  5 +-
 arch/arc/configs/axs101_defconfig |  1 -
 arch/arc/configs/axs103_defconfig |  1 -
 arch/arc/configs/axs103_smp_defconfig |  1 -
 arch/arc/configs/haps_hs_defconfig|  1 -
 arch/arc/configs/haps_hs_smp_defconfig|  1 -
 arch/arc/configs/hsdk_defconfig   |  1 -
 arch/arc/configs/nsim_700_defconfig   |  1 -
 arch/arc/configs/nsim_hs_defconfig|  1 -
 arch/arc/configs/nsim_hs_smp_defconfig|  1 -
 arch/arc/configs/nsimosci_defconfig   |  1 -
 arch/arc/configs/nsimosci_hs_defconfig|  1 -
 arch/arc/configs/nsimosci_hs_smp_defconfig|  1 -
 arch/arc/configs/tb10x_defconfig  |  1 -
 arch/arc/configs/vdk_hs38_defconfig   |  1 -
 arch/arc/configs/vdk_hs38_smp_defconfig   |  1 -
 arch/arm/configs/cns3420vb_defconfig  |  1 -
 arch/arm/configs/magician_defconfig   |  1 -
 arch/arm/configs/mini2440_defconfig   |  1 -
 arch/arm/configs/mv78xx0_defconfig|  1 -
 arch/arm/configs/mxs_defconfig|  1 -
 arch/arm/configs/orion5x_defconfig|  1 -
 arch/arm/configs/tegra_defconfig  |  1 -
 arch/arm/configs/vf610m4_defconfig|  1 -
 arch/m68k/configs/amiga_defconfig |  1 -
 arch/m68k/configs/apollo_defconfig|  1 -
 arch/m68k/configs/atari_defconfig |  1 -
 arch/m68k/configs/bvme6000_defconfig  |  1 -
 arch/m68k/configs/hp300_defconfig |  1 -
 arch/m68k/configs/mac_defconfig   |  1 -
 arch/m68k/configs/multi_defconfig |  1 -
 arch/m68k/configs/mvme147_defconfig   |  1 -
 arch/m68k/configs/mvme16x_defconfig   |  1 -
 arch/m68k/configs/q40_defconfig   |  1 -
 arch/m68k/configs/sun3_defconfig  |  1 -
 arch/m68k/configs/sun3x_defconfig |  1 -
 arch/mips/configs/ar7_defconfig   |  1 -
 arch/mips/configs/ath25_defconfig |  1 -
 arch/mips/configs/ath79_defconfig |  1 -
 arch/mips/configs/pic32mzda_defconfig |  1 -
 arch/mips/configs/qi_lb60_defconfig   |  1 -
 arch/mips/configs/rm200_defconfig |  9 ---
 arch/mips/configs/rt305x_defconfig|  1 -
 arch/mips/configs/xway_defconfig  |  1 -
 arch/mn10300/configs/asb2364_defconfig|  1 -
 arch/powerpc/configs/44x/warp_defconfig   |  1 -
 arch/powerpc/configs/c2k_defconfig| 12 
 arch/powerpc/configs/g5_defconfig | 12 
 arch/powerpc/configs/maple_defconfig  | 12 
 arch/powerpc/configs/mpc512x_defconfig|  1 -
 arch/powerpc/configs/pmac32_defconfig | 12 
 arch/powerpc/configs/ppc6xx_defconfig |  1 -
 arch/powerpc/configs/ps3_defconfig|  1 -
 arch/powerpc/configs/wii_defconfig|  1 -
 arch/s390/configs/zfcpdump_defconfig  |  1 -
 arch/sh/configs/polaris_defconfig |  1 -
 arch/tile/configs/tilegx_defconfig|  1 -
 arch/tile/configs/tilepro_defconfig   |  1 -
 arch/x86/Kconfig  |  6 +-
 drivers/base/Kconfig  | 28 ++--
 drivers/usb/serial/Kconfig| 78 ---
 62 files changed, 11 insertions(+), 222 deletions(-)

-- 
2.13.6

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/3] firmware: Drop FIRMWARE_IN_KERNEL Kconfig option

2018-01-23 Thread Benjamin Gilbert
It doesn't actually do anything.  Merge its help text into
EXTRA_FIRMWARE.

Fixes: 5620a0d1aacd ("firmware: delete in-kernel firmware")
Fixes: 0946b2fb38fd ("firmware: cleanup FIRMWARE_IN_KERNEL message")
Signed-off-by: Benjamin Gilbert 
Cc: Greg Kroah-Hartman 
Cc: Robin H. Johnson 
---
 arch/arc/configs/axs101_defconfig  |  1 -
 arch/arc/configs/axs103_defconfig  |  1 -
 arch/arc/configs/axs103_smp_defconfig  |  1 -
 arch/arc/configs/haps_hs_defconfig |  1 -
 arch/arc/configs/haps_hs_smp_defconfig |  1 -
 arch/arc/configs/hsdk_defconfig|  1 -
 arch/arc/configs/nsim_700_defconfig|  1 -
 arch/arc/configs/nsim_hs_defconfig |  1 -
 arch/arc/configs/nsim_hs_smp_defconfig |  1 -
 arch/arc/configs/nsimosci_defconfig|  1 -
 arch/arc/configs/nsimosci_hs_defconfig |  1 -
 arch/arc/configs/nsimosci_hs_smp_defconfig |  1 -
 arch/arc/configs/tb10x_defconfig   |  1 -
 arch/arc/configs/vdk_hs38_defconfig|  1 -
 arch/arc/configs/vdk_hs38_smp_defconfig|  1 -
 arch/arm/configs/cns3420vb_defconfig   |  1 -
 arch/arm/configs/magician_defconfig|  1 -
 arch/arm/configs/mini2440_defconfig|  1 -
 arch/arm/configs/mv78xx0_defconfig |  1 -
 arch/arm/configs/mxs_defconfig |  1 -
 arch/arm/configs/orion5x_defconfig |  1 -
 arch/arm/configs/tegra_defconfig   |  1 -
 arch/arm/configs/vf610m4_defconfig |  1 -
 arch/m68k/configs/amiga_defconfig  |  1 -
 arch/m68k/configs/apollo_defconfig |  1 -
 arch/m68k/configs/atari_defconfig  |  1 -
 arch/m68k/configs/bvme6000_defconfig   |  1 -
 arch/m68k/configs/hp300_defconfig  |  1 -
 arch/m68k/configs/mac_defconfig|  1 -
 arch/m68k/configs/multi_defconfig  |  1 -
 arch/m68k/configs/mvme147_defconfig|  1 -
 arch/m68k/configs/mvme16x_defconfig|  1 -
 arch/m68k/configs/q40_defconfig|  1 -
 arch/m68k/configs/sun3_defconfig   |  1 -
 arch/m68k/configs/sun3x_defconfig  |  1 -
 arch/mips/configs/ar7_defconfig|  1 -
 arch/mips/configs/ath25_defconfig  |  1 -
 arch/mips/configs/ath79_defconfig  |  1 -
 arch/mips/configs/pic32mzda_defconfig  |  1 -
 arch/mips/configs/qi_lb60_defconfig|  1 -
 arch/mips/configs/rt305x_defconfig |  1 -
 arch/mips/configs/xway_defconfig   |  1 -
 arch/mn10300/configs/asb2364_defconfig |  1 -
 arch/powerpc/configs/44x/warp_defconfig|  1 -
 arch/powerpc/configs/mpc512x_defconfig |  1 -
 arch/powerpc/configs/ppc6xx_defconfig  |  1 -
 arch/powerpc/configs/ps3_defconfig |  1 -
 arch/powerpc/configs/wii_defconfig |  1 -
 arch/s390/configs/zfcpdump_defconfig   |  1 -
 arch/sh/configs/polaris_defconfig  |  1 -
 arch/tile/configs/tilegx_defconfig |  1 -
 arch/tile/configs/tilepro_defconfig|  1 -
 drivers/base/Kconfig   | 28 +---
 53 files changed, 5 insertions(+), 75 deletions(-)

diff --git a/arch/arc/configs/axs101_defconfig 
b/arch/arc/configs/axs101_defconfig
index ec7c849a5c8e..09f85154c5a4 100644
--- a/arch/arc/configs/axs101_defconfig
+++ b/arch/arc/configs/axs101_defconfig
@@ -44,7 +44,6 @@ CONFIG_IP_PNP_RARP=y
 CONFIG_DEVTMPFS=y
 # CONFIG_STANDALONE is not set
 # CONFIG_PREVENT_FIRMWARE_BUILD is not set
-# CONFIG_FIRMWARE_IN_KERNEL is not set
 CONFIG_SCSI=y
 CONFIG_BLK_DEV_SD=y
 CONFIG_NETDEVICES=y
diff --git a/arch/arc/configs/axs103_defconfig 
b/arch/arc/configs/axs103_defconfig
index 63d3cf69e0b0..09fed3ef22b6 100644
--- a/arch/arc/configs/axs103_defconfig
+++ b/arch/arc/configs/axs103_defconfig
@@ -44,7 +44,6 @@ CONFIG_IP_PNP_RARP=y
 CONFIG_DEVTMPFS=y
 # CONFIG_STANDALONE is not set
 # CONFIG_PREVENT_FIRMWARE_BUILD is not set
-# CONFIG_FIRMWARE_IN_KERNEL is not set
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_SCSI=y
 CONFIG_BLK_DEV_SD=y
diff --git a/arch/arc/configs/axs103_smp_defconfig 
b/arch/arc/configs/axs103_smp_defconfig
index f613ecac14a7..ea2f6d817d1a 100644
--- a/arch/arc/configs/axs103_smp_defconfig
+++ b/arch/arc/configs/axs103_smp_defconfig
@@ -45,7 +45,6 @@ CONFIG_IP_PNP_RARP=y
 CONFIG_DEVTMPFS=y
 # CONFIG_STANDALONE is not set
 # CONFIG_PREVENT_FIRMWARE_BUILD is not set
-# CONFIG_FIRMWARE_IN_KERNEL is not set
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_SCSI=y
 CONFIG_BLK_DEV_SD=y
diff --git a/arch/arc/configs/haps_hs_defconfig 
b/arch/arc/configs/haps_hs_defconfig
index db04ea4dd2d9..ab231c040efe 100644
--- a/arch/arc/configs/haps_hs_defconfig
+++ b/arch/arc/configs/haps_hs_defconfig
@@ -40,7 +40,6 @@ CONFIG_INET=y
 CONFIG_DEVTMPFS=y
 # CONFIG_STANDALONE is not set
 # CONFIG_PREVENT_FIRMWARE_BUILD is not set
-# CONFIG_FIRMWARE_IN_KERNEL is not set
 # CONFIG_BLK_DEV is not set
 CONFIG_NETDEVICES=y
 # CONFIG_NET_VENDOR_ARC is not set
diff --git a/arch/arc/configs/haps_hs_smp_defconfig 
b/arch/arc/configs/haps_hs_smp_defconfig
index 3507be2af6fe..cf449cbf440d 100644
--- a/ar

Re: [PATCH v3 2/2] usb/gadget: Add driver for Aspeed SoC virtual hub

2018-01-23 Thread Benjamin Herrenschmidt
On Wed, 2018-01-24 at 09:50 +0800, kbuild test robot wrote:
> Hi Benjamin,
> 
> I love your patch! Yet something to improve:
> 
> [auto build test ERROR on balbi-usb/next]
> [also build test ERROR on v4.15-rc9]
> [if your patch is applied to the wrong git tree, please drop us a note to 
> help improve the system]

Looks like my Makefile is rotten for module build. I'll fix that up.

Felipe, don't let that hold a review of the driver itself, this looks
like a rather trivial Makefile issue.

Cheers,
Ben.

> url:
> https://github.com/0day-ci/linux/commits/Benjamin-Herrenschmidt/usb-gadget-Add-an-EP-dispose-callback-for-EP-lifetime-tracking/20180124-065635
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git next
> config: ia64-allmodconfig (attached as .config)
> compiler: ia64-linux-gcc (GCC) 7.2.0
> reproduce:
> wget 
> https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
> ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # save the attached .config to linux build tree
> make.cross ARCH=ia64 
> 
> All errors (new ones prefixed by >>):
> 
>WARNING: modpost: missing MODULE_LICENSE() in 
> drivers/auxdisplay/img-ascii-lcd.o
>see include/linux/module.h for more information
>WARNING: modpost: missing MODULE_LICENSE() in drivers/gpio/gpio-ath79.o
>see include/linux/module.h for more information
>WARNING: modpost: missing MODULE_LICENSE() in drivers/gpio/gpio-iop.o
>see include/linux/module.h for more information
>WARNING: modpost: missing MODULE_LICENSE() in drivers/iio/accel/kxsd9-i2c.o
>see include/linux/module.h for more information
>WARNING: modpost: missing MODULE_LICENSE() in 
> drivers/iio/adc/qcom-vadc-common.o
>see include/linux/module.h for more information
>WARNING: modpost: missing MODULE_LICENSE() in 
> drivers/media/platform/mtk-vcodec/mtk-vcodec-common.o
>see include/linux/module.h for more information
>WARNING: modpost: missing MODULE_LICENSE() in 
> drivers/media/platform/tegra-cec/tegra_cec.o
>see include/linux/module.h for more information
>WARNING: modpost: missing MODULE_LICENSE() in drivers/mtd/nand/denali_pci.o
>see include/linux/module.h for more information
>WARNING: modpost: missing MODULE_LICENSE() in 
> drivers/pinctrl/pxa/pinctrl-pxa2xx.o
>see include/linux/module.h for more information
>WARNING: modpost: missing MODULE_LICENSE() in 
> drivers/power/reset/zx-reboot.o
>see include/linux/module.h for more information
>WARNING: modpost: missing MODULE_LICENSE() in 
> drivers/usb/gadget/udc/aspeed-vhub/dev.o
>see include/linux/module.h for more information
>WARNING: modpost: missing MODULE_LICENSE() in 
> drivers/usb/gadget/udc/aspeed-vhub/ep0.o
>see include/linux/module.h for more information
>WARNING: modpost: missing MODULE_LICENSE() in 
> drivers/usb/gadget/udc/aspeed-vhub/epn.o
>see include/linux/module.h for more information
>WARNING: modpost: missing MODULE_LICENSE() in 
> drivers/usb/gadget/udc/aspeed-vhub/hub.o
>see include/linux/module.h for more information
> > > ERROR: "ast_vhub_dev_suspend" [drivers/usb/gadget/udc/aspeed-vhub/hub.ko] 
> > > undefined!
> > > ERROR: "ast_vhub_dev_reset" [drivers/usb/gadget/udc/aspeed-vhub/hub.ko] 
> > > undefined!
> > > ERROR: "__ast_vhub_simple_reply" 
> > > [drivers/usb/gadget/udc/aspeed-vhub/hub.ko] undefined!
> > > ERROR: "ast_vhub_dev_resume" [drivers/usb/gadget/udc/aspeed-vhub/hub.ko] 
> > > undefined!
> > > ERROR: "ast_vhub_reply" [drivers/usb/gadget/udc/aspeed-vhub/hub.ko] 
> > > undefined!
> > > ERROR: "ast_vhub_free_request" 
> > > [drivers/usb/gadget/udc/aspeed-vhub/epn.ko] undefined!
> > > ERROR: "ast_vhub_alloc_request" 
> > > [drivers/usb/gadget/udc/aspeed-vhub/epn.ko] undefined!
> > > ERROR: "ast_vhub_nuke" [drivers/usb/gadget/udc/aspeed-vhub/epn.ko] 
> > > undefined!
> > > ERROR: "ast_vhub_done" [drivers/usb/gadget/udc/aspeed-vhub/epn.ko] 
> > > undefined!
> > > ERROR: "ast_vhub_free_request" 
> > > [drivers/usb/gadget/udc/aspeed-vhub/ep0.ko] undefined!
> > > ERROR: "ast_vhub_alloc_request" 
> > > [drivers/usb/gadget/udc/aspeed-vhub/ep0.ko] undefined!
> > > ERROR: "ast_vhub_std_dev_request" 
> > > [drivers/usb/gadget/udc/aspeed-vhub/ep0.ko] undefined!
> > > ERROR: "ast_vhub_class_hub_request" 
> > > [drivers/usb/gadget/udc/aspeed-vhub/ep0.ko] undefined!
> > > ERROR: "ast_vhub_std_hub_request" 
> > > [drivers/usb/gadget/udc/aspeed-vhub/ep0.ko] undefined!
> > > ERROR: "ast_vhub_nuke" [drivers/usb/gadget/udc/aspeed-vhub/ep0.ko] 
> > > undefined!
> > > ERROR: "ast_vhub_done" [drivers/usb/gadget/udc/aspeed-vhub/ep0.ko] 
> > > undefined!
> > > ERROR: "ast_vhub_init_ep0" [drivers/usb/gadget/udc/aspeed-vhub/dev.ko] 
> > > undefined!
> > > ERROR: "__ast_vhub_simple_reply" 
> > > [drivers/usb/gadget/udc/aspeed-vhub/dev.ko] undefined!
> > > ERROR: "ast_vhub_ep0_handle_setup" 
> > > [drivers/usb/gadget/udc/aspeed-vhub/dev.ko] undefined!
> > > ERROR: "ast_

[PATCH 4.9] usbip: prevent vhci_hcd driver from leaking a socket pointer address

2018-01-23 Thread Shuah Khan
commit 2f2d0088eb93 ("usbip: prevent vhci_hcd driver from leaking a
socket pointer address")

When a client has a USB device attached over IP, the vhci_hcd driver is
locally leaking a socket pointer address via the

/sys/devices/platform/vhci_hcd/status file (world-readable) and in debug
output when "usbip --debug port" is run.

Fix it to not leak. The socket pointer address is not used at the moment
and it was made visible as a convenient way to find IP address from
socket pointer address by looking up /proc/net/{tcp,tcp6}.

As this opens a security hole, the fix replaces socket pointer address
with sockfd.

Reported-by: Secunia Research 
Signed-off-by: Shuah Khan 
---
 drivers/usb/usbip/usbip_common.h |  1 +
 drivers/usb/usbip/vhci_sysfs.c   | 25 +++--
 tools/usb/usbip/libsrc/vhci_driver.c |  8 
 3 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/drivers/usb/usbip/usbip_common.h b/drivers/usb/usbip/usbip_common.h
index 9f490375ac92..f0b955f8504e 100644
--- a/drivers/usb/usbip/usbip_common.h
+++ b/drivers/usb/usbip/usbip_common.h
@@ -271,6 +271,7 @@ struct usbip_device {
/* lock for status */
spinlock_t lock;
 
+   int sockfd;
struct socket *tcp_socket;
 
struct task_struct *tcp_rx;
diff --git a/drivers/usb/usbip/vhci_sysfs.c b/drivers/usb/usbip/vhci_sysfs.c
index b96e5b189269..c287ccc78fde 100644
--- a/drivers/usb/usbip/vhci_sysfs.c
+++ b/drivers/usb/usbip/vhci_sysfs.c
@@ -49,13 +49,17 @@ static ssize_t status_show_vhci(int pdev_nr, char *out)
 
/*
 * output example:
-* port sta spd dev  socket   local_busid
-*  004 000  c5a7bb80 1-2.3
-* 0001 004 000  d8cee980 2-3.4
+* port sta spd dev  sockfd local_busid
+*  004 000  03 1-2.3
+* 0001 004 000  04 2-3.4
 *
-* IP address can be retrieved from a socket pointer address by looking
-* up /proc/net/{tcp,tcp6}. Also, a userland program may remember a
-* port number and its peer IP address.
+* Output includes socket fd instead of socket pointer address to
+* avoid leaking kernel memory address in:
+*  /sys/devices/platform/vhci_hcd.0/status and in debug output.
+* The socket pointer address is not used at the moment and it was
+* made visible as a convenient way to find IP address from socket
+* pointer address by looking up /proc/net/{tcp,tcp6}. As this opens
+* a security hole, the change is made to use sockfd instead.
 */
for (i = 0; i < VHCI_HC_PORTS; i++) {
struct vhci_device *vdev = &vhci->vdev[i];
@@ -68,13 +72,13 @@ static ssize_t status_show_vhci(int pdev_nr, char *out)
if (vdev->ud.status == VDEV_ST_USED) {
out += sprintf(out, "%03u %08x ",
vdev->speed, vdev->devid);
-   out += sprintf(out, "%16p %s",
-   vdev->ud.tcp_socket,
+   out += sprintf(out, "%06u %s",
+   vdev->ud.sockfd,
dev_name(&vdev->udev->dev));
 
} else {
out += sprintf(out, "000  ");
-   out += sprintf(out, " 0-0");
+   out += sprintf(out, "00 0-0");
}
 
out += sprintf(out, "\n");
@@ -125,7 +129,7 @@ static ssize_t status_show(struct device *dev,
int pdev_nr;
 
out += sprintf(out,
-  "port sta spd dev  socket   local_busid\n");
+  "port sta spd dev  sockfd local_busid\n");
 
pdev_nr = status_name_to_id(attr->attr.name);
if (pdev_nr < 0)
@@ -324,6 +328,7 @@ static ssize_t store_attach(struct device *dev, struct 
device_attribute *attr,
 
vdev->devid = devid;
vdev->speed = speed;
+   vdev->ud.sockfd = sockfd;
vdev->ud.tcp_socket = socket;
vdev->ud.status = VDEV_ST_NOTASSIGNED;
 
diff --git a/tools/usb/usbip/libsrc/vhci_driver.c 
b/tools/usb/usbip/libsrc/vhci_driver.c
index ad9204773533..1274f326242c 100644
--- a/tools/usb/usbip/libsrc/vhci_driver.c
+++ b/tools/usb/usbip/libsrc/vhci_driver.c
@@ -55,12 +55,12 @@ static int parse_status(const char *value)
 
while (*c != '\0') {
int port, status, speed, devid;
-   unsigned long socket;
+   int sockfd;
char lbusid[SYSFS_BUS_ID_SIZE];
 
-   ret = sscanf(c, "%d %d %d %x %lx %31s\n",
+   ret = sscanf(c, "%d %d %d %x %u %31s\n",
&port, &status, &speed,
-   &devid, &socket, lbusid);
+   &devid, &sockfd,

[PATCH 4.9] usbip: Fix implicit fallthrough warning

2018-01-23 Thread Shuah Khan
From: Jonathan Dieter 

Upstream commit cfd6ed4537a9 ("usbip: Fix implicit fallthrough warning")

GCC 7 now warns when switch statements fall through implicitly, and with
-Werror enabled in configure.ac, that makes these tools unbuildable.

We fix this by notifying the compiler that this particular case statement
is meant to fall through.

Reviewed-by: Peter Senna Tschudin 
Signed-off-by: Jonathan Dieter 
Signed-off-by: Greg Kroah-Hartman 
Signed-off-by: Shuah Khan 
---
 tools/usb/usbip/src/usbip.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/usb/usbip/src/usbip.c b/tools/usb/usbip/src/usbip.c
index d7599d943529..73d8eee8130b 100644
--- a/tools/usb/usbip/src/usbip.c
+++ b/tools/usb/usbip/src/usbip.c
@@ -176,6 +176,8 @@ int main(int argc, char *argv[])
break;
case '?':
printf("usbip: invalid option\n");
+   /* Terminate after printing error */
+   /* FALLTHRU */
default:
usbip_usage();
goto out;
-- 
2.14.1

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4.9] usbip: Fix potential format overflow in userspace tools

2018-01-23 Thread Shuah Khan
From: Jonathan Dieter 

Upstream commit e5dfa3f902b9 ("usbip: Fix potential format overflow in
userspace tools")

The usbip userspace tools call sprintf()/snprintf() and don't check for
the return value which can lead the paths to overflow, truncating the
final file in the path.

More urgently, GCC 7 now warns that these aren't checked with
-Wformat-overflow, and with -Werror enabled in configure.ac, that makes
these tools unbuildable.

This patch fixes these problems by replacing sprintf() with snprintf() in
one place and adding checks for the return value of snprintf().

Reviewed-by: Peter Senna Tschudin 
Signed-off-by: Jonathan Dieter 
Acked-by: Shuah Khan 
Signed-off-by: Greg Kroah-Hartman 
Signed-off-by: Shuah Khan 
---
 tools/usb/usbip/libsrc/usbip_common.c  |  9 -
 tools/usb/usbip/libsrc/usbip_host_common.c | 28 +++-
 2 files changed, 31 insertions(+), 6 deletions(-)

diff --git a/tools/usb/usbip/libsrc/usbip_common.c 
b/tools/usb/usbip/libsrc/usbip_common.c
index ac73710473de..8000445ff884 100644
--- a/tools/usb/usbip/libsrc/usbip_common.c
+++ b/tools/usb/usbip/libsrc/usbip_common.c
@@ -215,9 +215,16 @@ int read_usb_interface(struct usbip_usb_device *udev, int 
i,
   struct usbip_usb_interface *uinf)
 {
char busid[SYSFS_BUS_ID_SIZE];
+   int size;
struct udev_device *sif;
 
-   sprintf(busid, "%s:%d.%d", udev->busid, udev->bConfigurationValue, i);
+   size = snprintf(busid, sizeof(busid), "%s:%d.%d",
+   udev->busid, udev->bConfigurationValue, i);
+   if (size < 0 || (unsigned int)size >= sizeof(busid)) {
+   err("busid length %i >= %lu or < 0", size,
+   (unsigned long)sizeof(busid));
+   return -1;
+   }
 
sif = udev_device_new_from_subsystem_sysname(udev_context, "usb", 
busid);
if (!sif) {
diff --git a/tools/usb/usbip/libsrc/usbip_host_common.c 
b/tools/usb/usbip/libsrc/usbip_host_common.c
index 9d415228883d..c10379439668 100644
--- a/tools/usb/usbip/libsrc/usbip_host_common.c
+++ b/tools/usb/usbip/libsrc/usbip_host_common.c
@@ -40,13 +40,20 @@ struct udev *udev_context;
 static int32_t read_attr_usbip_status(struct usbip_usb_device *udev)
 {
char status_attr_path[SYSFS_PATH_MAX];
+   int size;
int fd;
int length;
char status;
int value = 0;
 
-   snprintf(status_attr_path, SYSFS_PATH_MAX, "%s/usbip_status",
-udev->path);
+   size = snprintf(status_attr_path, sizeof(status_attr_path),
+   "%s/usbip_status", udev->path);
+   if (size < 0 || (unsigned int)size >= sizeof(status_attr_path)) {
+   err("usbip_status path length %i >= %lu or < 0", size,
+   (unsigned long)sizeof(status_attr_path));
+   return -1;
+   }
+
 
fd = open(status_attr_path, O_RDONLY);
if (fd < 0) {
@@ -218,6 +225,7 @@ int usbip_export_device(struct usbip_exported_device *edev, 
int sockfd)
 {
char attr_name[] = "usbip_sockfd";
char sockfd_attr_path[SYSFS_PATH_MAX];
+   int size;
char sockfd_buff[30];
int ret;
 
@@ -237,10 +245,20 @@ int usbip_export_device(struct usbip_exported_device 
*edev, int sockfd)
}
 
/* only the first interface is true */
-   snprintf(sockfd_attr_path, sizeof(sockfd_attr_path), "%s/%s",
-edev->udev.path, attr_name);
+   size = snprintf(sockfd_attr_path, sizeof(sockfd_attr_path), "%s/%s",
+   edev->udev.path, attr_name);
+   if (size < 0 || (unsigned int)size >= sizeof(sockfd_attr_path)) {
+   err("exported device path length %i >= %lu or < 0", size,
+   (unsigned long)sizeof(sockfd_attr_path));
+   return -1;
+   }
 
-   snprintf(sockfd_buff, sizeof(sockfd_buff), "%d\n", sockfd);
+   size = snprintf(sockfd_buff, sizeof(sockfd_buff), "%d\n", sockfd);
+   if (size < 0 || (unsigned int)size >= sizeof(sockfd_buff)) {
+   err("socket length %i >= %lu or < 0", size,
+   (unsigned long)sizeof(sockfd_buff));
+   return -1;
+   }
 
ret = write_sysfs_attribute(sockfd_attr_path, sockfd_buff,
strlen(sockfd_buff));
-- 
2.14.1

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4.4] usbip: prevent vhci_hcd driver from leaking a socket pointer address

2018-01-23 Thread Shuah Khan
commit 2f2d0088eb93 ("usbip: prevent vhci_hcd driver from leaking a
socket pointer address")

When a client has a USB device attached over IP, the vhci_hcd driver is
locally leaking a socket pointer address via the

/sys/devices/platform/vhci_hcd/status file (world-readable) and in debug
output when "usbip --debug port" is run.

Fix it to not leak. The socket pointer address is not used at the moment
and it was made visible as a convenient way to find IP address from
socket pointer address by looking up /proc/net/{tcp,tcp6}.

As this opens a security hole, the fix replaces socket pointer address
with sockfd.

Reported-by: Secunia Research 
Signed-off-by: Shuah Khan 
---
 drivers/usb/usbip/usbip_common.h |  1 +
 drivers/usb/usbip/vhci_sysfs.c   | 25 +++--
 tools/usb/usbip/libsrc/vhci_driver.c |  8 
 3 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/drivers/usb/usbip/usbip_common.h b/drivers/usb/usbip/usbip_common.h
index 86b08475c254..f875ccaa55f9 100644
--- a/drivers/usb/usbip/usbip_common.h
+++ b/drivers/usb/usbip/usbip_common.h
@@ -261,6 +261,7 @@ struct usbip_device {
/* lock for status */
spinlock_t lock;
 
+   int sockfd;
struct socket *tcp_socket;
 
struct task_struct *tcp_rx;
diff --git a/drivers/usb/usbip/vhci_sysfs.c b/drivers/usb/usbip/vhci_sysfs.c
index 211f43f67ea2..84c21c4ccf46 100644
--- a/drivers/usb/usbip/vhci_sysfs.c
+++ b/drivers/usb/usbip/vhci_sysfs.c
@@ -39,16 +39,20 @@ static ssize_t status_show(struct device *dev, struct 
device_attribute *attr,
 
/*
 * output example:
-* prt sta spd dev socket   local_busid
-* 000 004 000 000 c5a7bb80 1-2.3
-* 001 004 000 000 d8cee980 2-3.4
+* port sta spd dev  sockfd local_busid
+*  004 000  03 1-2.3
+* 0001 004 000  04 2-3.4
 *
-* IP address can be retrieved from a socket pointer address by looking
-* up /proc/net/{tcp,tcp6}. Also, a userland program may remember a
-* port number and its peer IP address.
+* Output includes socket fd instead of socket pointer address to
+* avoid leaking kernel memory address in:
+*  /sys/devices/platform/vhci_hcd.0/status and in debug output.
+* The socket pointer address is not used at the moment and it was
+* made visible as a convenient way to find IP address from socket
+* pointer address by looking up /proc/net/{tcp,tcp6}. As this opens
+* a security hole, the change is made to use sockfd instead.
 */
out += sprintf(out,
-  "prt sta spd bus dev socket   local_busid\n");
+  "prt sta spd bus dev sockfd local_busid\n");
 
for (i = 0; i < VHCI_NPORTS; i++) {
struct vhci_device *vdev = port_to_vdev(i);
@@ -60,11 +64,11 @@ static ssize_t status_show(struct device *dev, struct 
device_attribute *attr,
out += sprintf(out, "%03u %08x ",
   vdev->speed, vdev->devid);
out += sprintf(out, "%16p ", vdev->ud.tcp_socket);
+   out += sprintf(out, "%06u", vdev->ud.sockfd);
out += sprintf(out, "%s", dev_name(&vdev->udev->dev));
 
-   } else {
-   out += sprintf(out, "000 000 000  0-0");
-   }
+   } else
+   out += sprintf(out, "000 000 000 00 0-0");
 
out += sprintf(out, "\n");
spin_unlock(&vdev->ud.lock);
@@ -223,6 +227,7 @@ static ssize_t store_attach(struct device *dev, struct 
device_attribute *attr,
 
vdev->devid = devid;
vdev->speed = speed;
+   vdev->ud.sockfd = sockfd;
vdev->ud.tcp_socket = socket;
vdev->ud.status = VDEV_ST_NOTASSIGNED;
 
diff --git a/tools/usb/usbip/libsrc/vhci_driver.c 
b/tools/usb/usbip/libsrc/vhci_driver.c
index ad9204773533..1274f326242c 100644
--- a/tools/usb/usbip/libsrc/vhci_driver.c
+++ b/tools/usb/usbip/libsrc/vhci_driver.c
@@ -55,12 +55,12 @@ static int parse_status(const char *value)
 
while (*c != '\0') {
int port, status, speed, devid;
-   unsigned long socket;
+   int sockfd;
char lbusid[SYSFS_BUS_ID_SIZE];
 
-   ret = sscanf(c, "%d %d %d %x %lx %31s\n",
+   ret = sscanf(c, "%d %d %d %x %u %31s\n",
&port, &status, &speed,
-   &devid, &socket, lbusid);
+   &devid, &sockfd, lbusid);
 
if (ret < 5) {
dbg("sscanf failed: %d", ret);
@@ -69,7 +69,7 @@ static int parse_status(const char *value)
 
dbg("port %d status %d speed %d devid %x",
port, sta

[PATCH 4.4] usbip: Fix potential format overflow in userspace tools

2018-01-23 Thread Shuah Khan
Upstream commit e5dfa3f902b9 ("usbip: Fix potential format overflow in
userspace tools")

The usbip userspace tools call sprintf()/snprintf() and don't check for
the return value which can lead the paths to overflow, truncating the
final file in the path.

More urgently, GCC 7 now warns that these aren't checked with
-Wformat-overflow, and with -Werror enabled in configure.ac, that makes
these tools unbuildable.

This patch fixes these problems by replacing sprintf() with snprintf()
in one place and adding checks for the return value of snprintf().

Signed-off-by: Shuah Khan 
---
 tools/usb/usbip/libsrc/usbip_common.c  |  9 -
 tools/usb/usbip/libsrc/usbip_host_driver.c | 27 ++-
 2 files changed, 30 insertions(+), 6 deletions(-)

diff --git a/tools/usb/usbip/libsrc/usbip_common.c 
b/tools/usb/usbip/libsrc/usbip_common.c
index ac73710473de..8000445ff884 100644
--- a/tools/usb/usbip/libsrc/usbip_common.c
+++ b/tools/usb/usbip/libsrc/usbip_common.c
@@ -215,9 +215,16 @@ int read_usb_interface(struct usbip_usb_device *udev, int 
i,
   struct usbip_usb_interface *uinf)
 {
char busid[SYSFS_BUS_ID_SIZE];
+   int size;
struct udev_device *sif;
 
-   sprintf(busid, "%s:%d.%d", udev->busid, udev->bConfigurationValue, i);
+   size = snprintf(busid, sizeof(busid), "%s:%d.%d",
+   udev->busid, udev->bConfigurationValue, i);
+   if (size < 0 || (unsigned int)size >= sizeof(busid)) {
+   err("busid length %i >= %lu or < 0", size,
+   (unsigned long)sizeof(busid));
+   return -1;
+   }
 
sif = udev_device_new_from_subsystem_sysname(udev_context, "usb", 
busid);
if (!sif) {
diff --git a/tools/usb/usbip/libsrc/usbip_host_driver.c 
b/tools/usb/usbip/libsrc/usbip_host_driver.c
index bef08d5c44e8..14c2916b4fec 100644
--- a/tools/usb/usbip/libsrc/usbip_host_driver.c
+++ b/tools/usb/usbip/libsrc/usbip_host_driver.c
@@ -39,13 +39,19 @@ struct udev *udev_context;
 static int32_t read_attr_usbip_status(struct usbip_usb_device *udev)
 {
char status_attr_path[SYSFS_PATH_MAX];
+   int size;
int fd;
int length;
char status;
int value = 0;
 
-   snprintf(status_attr_path, SYSFS_PATH_MAX, "%s/usbip_status",
-udev->path);
+   size = snprintf(status_attr_path, SYSFS_PATH_MAX, "%s/usbip_status",
+   udev->path);
+   if (size < 0 || (unsigned int)size >= sizeof(status_attr_path)) {
+   err("usbip_status path length %i >= %lu or < 0", size,
+   (unsigned long)sizeof(status_attr_path));
+   return -1;
+   }
 
fd = open(status_attr_path, O_RDONLY);
if (fd < 0) {
@@ -225,6 +231,7 @@ int usbip_host_export_device(struct usbip_exported_device 
*edev, int sockfd)
 {
char attr_name[] = "usbip_sockfd";
char sockfd_attr_path[SYSFS_PATH_MAX];
+   int size;
char sockfd_buff[30];
int ret;
 
@@ -244,10 +251,20 @@ int usbip_host_export_device(struct usbip_exported_device 
*edev, int sockfd)
}
 
/* only the first interface is true */
-   snprintf(sockfd_attr_path, sizeof(sockfd_attr_path), "%s/%s",
-edev->udev.path, attr_name);
+   size = snprintf(sockfd_attr_path, sizeof(sockfd_attr_path), "%s/%s",
+   edev->udev.path, attr_name);
+   if (size < 0 || (unsigned int)size >= sizeof(sockfd_attr_path)) {
+   err("exported device path length %i >= %lu or < 0", size,
+   (unsigned long)sizeof(sockfd_attr_path));
+   return -1;
+   }
 
-   snprintf(sockfd_buff, sizeof(sockfd_buff), "%d\n", sockfd);
+   size = snprintf(sockfd_buff, sizeof(sockfd_buff), "%d\n", sockfd);
+   if (size < 0 || (unsigned int)size >= sizeof(sockfd_buff)) {
+   err("socket length %i >= %lu or < 0", size,
+   (unsigned long)sizeof(sockfd_buff));
+   return -1;
+   }
 
ret = write_sysfs_attribute(sockfd_attr_path, sockfd_buff,
strlen(sockfd_buff));
-- 
2.14.1

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4.4] usbip: Fix implicit fallthrough warning

2018-01-23 Thread Shuah Khan
From: Jonathan Dieter 

Upstream commit cfd6ed4537a9 ("usbip: Fix implicit fallthrough warning")

GCC 7 now warns when switch statements fall through implicitly, and with
-Werror enabled in configure.ac, that makes these tools unbuildable.

We fix this by notifying the compiler that this particular case statement
is meant to fall through.

Reviewed-by: Peter Senna Tschudin 
Signed-off-by: Jonathan Dieter 
Signed-off-by: Greg Kroah-Hartman 
Signed-off-by: Shuah Khan 
---
 tools/usb/usbip/src/usbip.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/usb/usbip/src/usbip.c b/tools/usb/usbip/src/usbip.c
index d7599d943529..73d8eee8130b 100644
--- a/tools/usb/usbip/src/usbip.c
+++ b/tools/usb/usbip/src/usbip.c
@@ -176,6 +176,8 @@ int main(int argc, char *argv[])
break;
case '?':
printf("usbip: invalid option\n");
+   /* Terminate after printing error */
+   /* FALLTHRU */
default:
usbip_usage();
goto out;
-- 
2.14.1

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 2/2] usb/gadget: Add driver for Aspeed SoC virtual hub

2018-01-23 Thread kbuild test robot
Hi Benjamin,

I love your patch! Perhaps something to improve:

[auto build test WARNING on balbi-usb/next]
[also build test WARNING on v4.15-rc9 next-20180119]
[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/Benjamin-Herrenschmidt/usb-gadget-Add-an-EP-dispose-callback-for-EP-lifetime-tracking/20180124-065635
base:   https://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git next
config: m32r-allyesconfig (attached as .config)
compiler: m32r-linux-gcc (GCC) 7.2.0
reproduce:
wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=m32r 

All warnings (new ones prefixed by >>):

   In file included from arch/m32r/include/uapi/asm/byteorder.h:8:0,
from arch/m32r/include/asm/bitops.h:22,
from include/linux/bitops.h:38,
from include/linux/kernel.h:11,
from drivers/usb/gadget/udc/aspeed-vhub/core.c:14:
   include/linux/byteorder/big_endian.h:8:2: warning: #warning inconsistent 
configuration, needs CONFIG_CPU_BIG_ENDIAN [-Wcpp]
#warning inconsistent configuration, needs CONFIG_CPU_BIG_ENDIAN
 ^~~
   In file included from include/linux/printk.h:329:0,
from include/linux/kernel.h:14,
from drivers/usb/gadget/udc/aspeed-vhub/core.c:14:
   drivers/usb/gadget/udc/aspeed-vhub/core.c: In function 'ast_vhub_irq':
>> drivers/usb/gadget/udc/aspeed-vhub/core.c:127:16: warning: format '%x' 
>> expects argument of type 'unsigned int', but argument 5 has type 'long 
>> unsigned int' [-Wformat=]
 UDCVDBG(vhub, "irq status=%08x, ep_acks=%08x ep_nacks=%08x\n",
   ^
   include/linux/dynamic_debug.h:135:39: note: in definition of macro 
'dynamic_dev_dbg'
  __dynamic_dev_dbg(&descriptor, dev, fmt, \
  ^~~
   drivers/usb/gadget/udc/aspeed-vhub/vhub.h:405:28: note: in expansion of 
macro 'dev_dbg'
#define UDCVDBG(u, fmt...) dev_dbg(&(u)->pdev->dev, fmt)
   ^~~
   drivers/usb/gadget/udc/aspeed-vhub/core.c:127:2: note: in expansion of macro 
'UDCVDBG'
 UDCVDBG(vhub, "irq status=%08x, ep_acks=%08x ep_nacks=%08x\n",
 ^~~
   drivers/usb/gadget/udc/aspeed-vhub/core.c:127:16: warning: format '%x' 
expects argument of type 'unsigned int', but argument 6 has type 'long unsigned 
int' [-Wformat=]
 UDCVDBG(vhub, "irq status=%08x, ep_acks=%08x ep_nacks=%08x\n",
   ^
   include/linux/dynamic_debug.h:135:39: note: in definition of macro 
'dynamic_dev_dbg'
  __dynamic_dev_dbg(&descriptor, dev, fmt, \
  ^~~
   drivers/usb/gadget/udc/aspeed-vhub/vhub.h:405:28: note: in expansion of 
macro 'dev_dbg'
#define UDCVDBG(u, fmt...) dev_dbg(&(u)->pdev->dev, fmt)
   ^~~
   drivers/usb/gadget/udc/aspeed-vhub/core.c:127:2: note: in expansion of macro 
'UDCVDBG'
 UDCVDBG(vhub, "irq status=%08x, ep_acks=%08x ep_nacks=%08x\n",
 ^~~
--
   In file included from arch/m32r/include/uapi/asm/byteorder.h:8:0,
from arch/m32r/include/asm/bitops.h:22,
from include/linux/bitops.h:38,
from include/linux/kernel.h:11,
from drivers/usb/gadget/udc/aspeed-vhub/epn.c:14:
   include/linux/byteorder/big_endian.h:8:2: warning: #warning inconsistent 
configuration, needs CONFIG_CPU_BIG_ENDIAN [-Wcpp]
#warning inconsistent configuration, needs CONFIG_CPU_BIG_ENDIAN
 ^~~
   In file included from include/linux/printk.h:329:0,
from include/linux/kernel.h:14,
from drivers/usb/gadget/udc/aspeed-vhub/epn.c:14:
   drivers/usb/gadget/udc/aspeed-vhub/epn.c: In function 
'ast_vhub_epn_kick_desc':
>> drivers/usb/gadget/udc/aspeed-vhub/vhub.h:409:3: warning: format '%x' 
>> expects argument of type 'unsigned int', but argument 7 has type 'long 
>> unsigned int' [-Wformat=]
  "%s:EP%d " fmt,\
  ^
   include/linux/dynamic_debug.h:135:39: note: in definition of macro 
'dynamic_dev_dbg'
  __dynamic_dev_dbg(&descriptor, dev, fmt, \
  ^~~
   drivers/usb/gadget/udc/aspeed-vhub/vhub.h:408:2: note: in expansion of macro 
'dev_dbg'
 dev_dbg(&(ep)->vhub->pdev->dev,   \
 ^~~
   drivers/usb/gadget/udc/aspeed-vhub/epn.c:233:2: note: in expansion of macro 
'EPVDBG'
 EPVDBG(ep, "HW kicked, d_next=%d dstat=%08x\n",
 ^~
   drivers/usb/gadget/udc/aspeed-vhub/epn.c:233:44: note: format string is 
defined here
 EPVDBG(ep, "HW kicked, d_next=%d dstat=%08x\n",
~~~^
%08lx

vim +127 drivers/usb/gadget/udc/aspee

Re: USB-C Devices only show up if connected at boot

2018-01-23 Thread Greg KH
On Tue, Jan 23, 2018 at 05:43:27PM +, Mike Lothian wrote:
> On Tue, 23 Jan 2018 at 17:30 Greg KH  wrote:
> >
> > On Tue, Jan 23, 2018 at 05:12:03PM +, Mike Lothian wrote:
> > > Hi
> > >
> > > I raised https://bugzilla.kernel.org/show_bug.cgi?id=198557 but was
> > > informed by Greg bugs should be raised on the mailing list not in
> > > bugzilla
> > >
> > > So USB-C devices only show up in dmesg or for use if they are
> > > connected during boot
> > >
> > > Once booted and the device is disconnected the following message
> > > appears in the dmesg:
> > >
> > > [  100.814687] usb 3-1: USB disconnect, device number 3
> > > [  100.882840] xhci_hcd :39:00.0: xHCI host controller not
> > > responding, assume dead
> > > [  100.882843] xhci_hcd :39:00.0: HC died; cleaning up
> > >
> > > No further connections or disconnections display anything further in
> > > the dmesg, the device works fine if connected via USB-A
> > >
> > > I've witnessed this behaviour since getting the laptop at the end of
> > > 2015 so this isn't a regression
> >
> > Is there a BIOS update for the laptop?  This has been seen a lot in the
> > past on lots of different laptops but was always resolved by the BIOS
> > update (the latest one for mine also updates the xhci controller as
> > well.)
> >
> > thanks,
> >
> > greg k-h
> 
> 
> Hi
> 
> I've applied all BIOS updates for my laptop including the pulled one
> for Spectre/Meltdown & ME bugs the other week
> http://www.dell.com/support/home/uk/en/ukdhs1/product-support/servicetag/8k5w662/drivers
> 
> If it helps, I don't have this issue in Windows but I rarely have it booted
> 
> I thought it might have something to do with an ACPI failure (see bug
> https://bugzilla.kernel.org/show_bug.cgi?id=198051)

I can't see web links at the moment, but are you sure you have PCI
hotplug enabled in your kernel?  Same for ACPI PCI hotplug?  That's how
the controller usually shows up in the system, and that's a PCI issue,
not a USB issue.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3] firmware: Drop FIRMWARE_IN_KERNEL Kconfig option

2018-01-23 Thread Robin H. Johnson
+1 on this series.

Signed-off-by: Robin H. Johnson 

On Tue, Jan 23, 2018 at 06:06:31PM -0800, Benjamin Gilbert wrote:
> It doesn't actually do anything.  Merge its help text into
> EXTRA_FIRMWARE.
> 
> Fixes: 5620a0d1aacd ("firmware: delete in-kernel firmware")
> Fixes: 0946b2fb38fd ("firmware: cleanup FIRMWARE_IN_KERNEL message")
> Signed-off-by: Benjamin Gilbert 
> Cc: Greg Kroah-Hartman 
> Cc: Robin H. Johnson 
> ---
>  arch/arc/configs/axs101_defconfig  |  1 -
>  arch/arc/configs/axs103_defconfig  |  1 -
>  arch/arc/configs/axs103_smp_defconfig  |  1 -
>  arch/arc/configs/haps_hs_defconfig |  1 -
>  arch/arc/configs/haps_hs_smp_defconfig |  1 -
>  arch/arc/configs/hsdk_defconfig|  1 -
>  arch/arc/configs/nsim_700_defconfig|  1 -
>  arch/arc/configs/nsim_hs_defconfig |  1 -
>  arch/arc/configs/nsim_hs_smp_defconfig |  1 -
>  arch/arc/configs/nsimosci_defconfig|  1 -
>  arch/arc/configs/nsimosci_hs_defconfig |  1 -
>  arch/arc/configs/nsimosci_hs_smp_defconfig |  1 -
>  arch/arc/configs/tb10x_defconfig   |  1 -
>  arch/arc/configs/vdk_hs38_defconfig|  1 -
>  arch/arc/configs/vdk_hs38_smp_defconfig|  1 -
>  arch/arm/configs/cns3420vb_defconfig   |  1 -
>  arch/arm/configs/magician_defconfig|  1 -
>  arch/arm/configs/mini2440_defconfig|  1 -
>  arch/arm/configs/mv78xx0_defconfig |  1 -
>  arch/arm/configs/mxs_defconfig |  1 -
>  arch/arm/configs/orion5x_defconfig |  1 -
>  arch/arm/configs/tegra_defconfig   |  1 -
>  arch/arm/configs/vf610m4_defconfig |  1 -
>  arch/m68k/configs/amiga_defconfig  |  1 -
>  arch/m68k/configs/apollo_defconfig |  1 -
>  arch/m68k/configs/atari_defconfig  |  1 -
>  arch/m68k/configs/bvme6000_defconfig   |  1 -
>  arch/m68k/configs/hp300_defconfig  |  1 -
>  arch/m68k/configs/mac_defconfig|  1 -
>  arch/m68k/configs/multi_defconfig  |  1 -
>  arch/m68k/configs/mvme147_defconfig|  1 -
>  arch/m68k/configs/mvme16x_defconfig|  1 -
>  arch/m68k/configs/q40_defconfig|  1 -
>  arch/m68k/configs/sun3_defconfig   |  1 -
>  arch/m68k/configs/sun3x_defconfig  |  1 -
>  arch/mips/configs/ar7_defconfig|  1 -
>  arch/mips/configs/ath25_defconfig  |  1 -
>  arch/mips/configs/ath79_defconfig  |  1 -
>  arch/mips/configs/pic32mzda_defconfig  |  1 -
>  arch/mips/configs/qi_lb60_defconfig|  1 -
>  arch/mips/configs/rt305x_defconfig |  1 -
>  arch/mips/configs/xway_defconfig   |  1 -
>  arch/mn10300/configs/asb2364_defconfig |  1 -
>  arch/powerpc/configs/44x/warp_defconfig|  1 -
>  arch/powerpc/configs/mpc512x_defconfig |  1 -
>  arch/powerpc/configs/ppc6xx_defconfig  |  1 -
>  arch/powerpc/configs/ps3_defconfig |  1 -
>  arch/powerpc/configs/wii_defconfig |  1 -
>  arch/s390/configs/zfcpdump_defconfig   |  1 -
>  arch/sh/configs/polaris_defconfig  |  1 -
>  arch/tile/configs/tilegx_defconfig |  1 -
>  arch/tile/configs/tilepro_defconfig|  1 -
>  drivers/base/Kconfig   | 28 +---
>  53 files changed, 5 insertions(+), 75 deletions(-)
> 
> diff --git a/arch/arc/configs/axs101_defconfig 
> b/arch/arc/configs/axs101_defconfig
> index ec7c849a5c8e..09f85154c5a4 100644
> --- a/arch/arc/configs/axs101_defconfig
> +++ b/arch/arc/configs/axs101_defconfig
> @@ -44,7 +44,6 @@ CONFIG_IP_PNP_RARP=y
>  CONFIG_DEVTMPFS=y
>  # CONFIG_STANDALONE is not set
>  # CONFIG_PREVENT_FIRMWARE_BUILD is not set
> -# CONFIG_FIRMWARE_IN_KERNEL is not set
>  CONFIG_SCSI=y
>  CONFIG_BLK_DEV_SD=y
>  CONFIG_NETDEVICES=y
> diff --git a/arch/arc/configs/axs103_defconfig 
> b/arch/arc/configs/axs103_defconfig
> index 63d3cf69e0b0..09fed3ef22b6 100644
> --- a/arch/arc/configs/axs103_defconfig
> +++ b/arch/arc/configs/axs103_defconfig
> @@ -44,7 +44,6 @@ CONFIG_IP_PNP_RARP=y
>  CONFIG_DEVTMPFS=y
>  # CONFIG_STANDALONE is not set
>  # CONFIG_PREVENT_FIRMWARE_BUILD is not set
> -# CONFIG_FIRMWARE_IN_KERNEL is not set
>  CONFIG_BLK_DEV_LOOP=y
>  CONFIG_SCSI=y
>  CONFIG_BLK_DEV_SD=y
> diff --git a/arch/arc/configs/axs103_smp_defconfig 
> b/arch/arc/configs/axs103_smp_defconfig
> index f613ecac14a7..ea2f6d817d1a 100644
> --- a/arch/arc/configs/axs103_smp_defconfig
> +++ b/arch/arc/configs/axs103_smp_defconfig
> @@ -45,7 +45,6 @@ CONFIG_IP_PNP_RARP=y
>  CONFIG_DEVTMPFS=y
>  # CONFIG_STANDALONE is not set
>  # CONFIG_PREVENT_FIRMWARE_BUILD is not set
> -# CONFIG_FIRMWARE_IN_KERNEL is not set
>  CONFIG_BLK_DEV_LOOP=y
>  CONFIG_SCSI=y
>  CONFIG_BLK_DEV_SD=y
> diff --git a/arch/arc/configs/haps_hs_defconfig 
> b/arch/arc/configs/haps_hs_defconfig
> index db04ea4dd2d9..ab231c040efe 100644
> --- a/arch/arc/configs/haps_hs_defconfig
> +++ b/arch/arc/configs/haps_hs_defconfig
> @@ -40,7 +40,6 @@ CONFIG_INET=y
>  CONFIG_DEVTMPFS=y
>  #

Re: [PATCH v3 2/2] usb/gadget: Add driver for Aspeed SoC virtual hub

2018-01-23 Thread kbuild test robot
Hi Benjamin,

I love your patch! Perhaps something to improve:

[auto build test WARNING on balbi-usb/next]
[also build test WARNING on v4.15-rc9 next-20180119]
[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/Benjamin-Herrenschmidt/usb-gadget-Add-an-EP-dispose-callback-for-EP-lifetime-tracking/20180124-065635
base:   https://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git next
reproduce:
# apt-get install sparse
make ARCH=x86_64 allmodconfig
make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

>> drivers/usb/gadget/udc/aspeed-vhub/epn.c:270:23: sparse: restricted __le32 
>> degrades to integer
--
>> drivers/usb/gadget/udc/aspeed-vhub/dev.c:269:9: sparse: context imbalance in 
>> 'ast_vhub_udc_wakeup' - different lock contexts for basic block

vim +270 drivers/usb/gadget/udc/aspeed-vhub/epn.c

   236  
   237  static void ast_vhub_epn_handle_ack_desc(struct ast_vhub_ep *ep)
   238  {
   239  struct ast_vhub_req *req;
   240  unsigned int len, d_last;
   241  u32 stat, stat1;
   242  
   243  /* Read EP status, workaround HW race */
   244  do {
   245  stat = readl(ep->epn.regs + AST_VHUB_EP_DESC_STATUS);
   246  stat1 = readl(ep->epn.regs + AST_VHUB_EP_DESC_STATUS);
   247  } while(stat != stat1);
   248  
   249  /* Extract RPTR */
   250  d_last = VHUB_EP_DMA_RPTR(stat);
   251  
   252  /* Grab current request if any */
   253  req = list_first_entry_or_null(&ep->queue, struct ast_vhub_req, 
queue);
   254  
   255  EPVDBG(ep, "ACK status=%08x is_in=%d ep->d_last=%d..%d\n",
   256 stat, ep->epn.is_in, ep->epn.d_last, d_last);
   257  
   258  /* Check all completed descriptors */
   259  while (ep->epn.d_last != d_last) {
   260  struct ast_vhub_desc *desc;
   261  unsigned int d_num;
   262  bool is_last_desc;
   263  
   264  /* Grab next completed descriptor */
   265  d_num = ep->epn.d_last;
   266  desc = &ep->epn.descs[d_num];
   267  ep->epn.d_last = (d_num + 1) & (AST_VHUB_DESCS_COUNT - 
1);
   268  
   269  /* Grab len out of descriptor */
 > 270  len = VHUB_DSC1_IN_LEN(desc->w1);
   271  
   272  EPVDBG(ep, " desc %d len=%d req=%p (act=%d)\n",
   273 d_num, len, req, req ? req->active : 0);
   274  
   275  /* If no active request pending, move on */
   276  if (!req || !req->active)
   277  continue;
   278  
   279  /* Adjust size */
   280  req->req.actual += len;
   281  
   282  /* Is that the last chunk ? */
   283  is_last_desc = req->last_desc == d_num;
   284  CHECK(ep, is_last_desc == (len < ep->ep.maxpacket ||
   285 (req->req.actual >= 
req->req.length &&
   286  !req->req.zero)),
   287"Last packet discrepancy: last_desc=%d len=%d 
r.act=%d "
   288"r.len=%d r.zero=%d mp=%d\n",
   289is_last_desc, len, req->req.actual, 
req->req.length,
   290req->req.zero, ep->ep.maxpacket);
   291  
   292  if (is_last_desc) {
   293  /*
   294   * Because we can only have one request at a 
time
   295   * in our descriptor list in this 
implementation,
   296   * d_last and ep->d_last should now be equal
   297   */
   298  CHECK(ep, d_last == ep->epn.d_last,
   299"DMA read ptr mismatch %d vs %d\n",
   300d_last, ep->epn.d_last);
   301  
   302  /* Note: done will drop and re-acquire the lock 
*/
   303  ast_vhub_done(ep, req, 0);
   304  req = list_first_entry_or_null(&ep->queue,
   305 struct 
ast_vhub_req,
   306 queue);
   307  break;
   308  }
   309  }
   310  
   311  /* More work ? */
   312  if (req)
   313  ast_vhub_epn_kick_desc(ep, req);
   314  }
   315  

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a mes

Re: [PATCH 3/3] firmware: Fix up docs referring to FIRMWARE_IN_KERNEL

2018-01-23 Thread Ingo Molnar

* Benjamin Gilbert  wrote:

> We've removed the option, so stop talking about it.
> 
> Signed-off-by: Benjamin Gilbert 
> Cc: Borislav Petkov 
> Cc: Thomas Gleixner 
> Cc: Ingo Molnar 
> Cc: H. Peter Anvin 
> ---
>  Documentation/driver-api/firmware/built-in-fw.rst | 7 +--
>  Documentation/x86/microcode.txt   | 5 ++---
>  arch/x86/Kconfig  | 6 +++---
>  3 files changed, 6 insertions(+), 12 deletions(-)
> 
> diff --git a/Documentation/driver-api/firmware/built-in-fw.rst 
> b/Documentation/driver-api/firmware/built-in-fw.rst
> index 7300e66857f8..396cdf591ac5 100644
> --- a/Documentation/driver-api/firmware/built-in-fw.rst
> +++ b/Documentation/driver-api/firmware/built-in-fw.rst
> @@ -11,13 +11,8 @@ options:
>* CONFIG_EXTRA_FIRMWARE
>* CONFIG_EXTRA_FIRMWARE_DIR
>  
> -This should not be confused with CONFIG_FIRMWARE_IN_KERNEL, this is for 
> drivers
> -which enables firmware to be built as part of the kernel build process. This
> -option, CONFIG_FIRMWARE_IN_KERNEL, will build all firmware for all drivers
> -enabled which ship its firmware inside the Linux kernel source tree.
> -
>  There are a few reasons why you might want to consider building your firmware
> -into the kernel with CONFIG_EXTRA_FIRMWARE though:
> +into the kernel with CONFIG_EXTRA_FIRMWARE:
>  
>  * Speed
>  * Firmware is needed for accessing the boot device, and the user doesn't
> diff --git a/Documentation/x86/microcode.txt b/Documentation/x86/microcode.txt
> index f57e1b45e628..aacd2f5e1a46 100644
> --- a/Documentation/x86/microcode.txt
> +++ b/Documentation/x86/microcode.txt
> @@ -108,12 +108,11 @@ packages already put them there.
>  
>  
>  The loader supports also loading of a builtin microcode supplied through
> -the regular firmware builtin method CONFIG_FIRMWARE_IN_KERNEL. Only
> -64-bit is currently supported.
> +the regular firmware builtin method CONFIG_EXTRA_FIRMWARE. Only 64-bit is
> +currently supported.

s/regular firmware builtin method
 /regular builtin firmware method

With that fixed:

Acked-by: Ingo Molnar 

Thanks,

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html