2021-05-26 13:28:29

by Lee Jones

[permalink] [raw]
Subject: [PATCH 00/24] Rid W=1 warnings from USB

This set is part of a larger effort attempting to clean-up W=1
kernel builds, which are currently overwhelmingly riddled with
niggly little warnings.

Lee Jones (24):
usb: cdns3: core: Fix a couple of incorrectly documented function
names
usb: dwc2: platform: Provide function name for
'dwc2_check_core_version()'
usb: common: ulpi: Add leading underscores for function name
'__ulpi_register_driver()'
usb: cdns3: cdns3-plat: Fix incorrect naming of function
'cdns3_plat_remove()'
usb: dwc2: params: Fix naming of 'dwc2_get_hwparams()' in the docs
usb: isp1760: isp1760-udc: Provide missing description for 'udc' param
usb: cdns3: cdns3-gadget: Fix a bunch of kernel-doc related formatting
issues
usb: cdns3: cdns3-ti: File headers are not good candidates for
kernel-doc
usb: cdns3: cdns3-ep0: Fix a few kernel-doc formatting issues
usb: cdns3: cdns3-imx: File headers are not good candidates for
kernel-doc
usb: dwc2: hcd_queue: Fix typeo in function name
'dwc2_hs_pmap_unschedule()'
usb: dwc2: pci: Fix possible copy/paste issue
usb: chipidea: core: Fix incorrectly documented function
'ci_usb_phy_exit()'
usb: chipidea: otg: Fix formatting and missing documentation issues
usb: dwc2: gadget: Repair 'dwc2_hsotg_core_init_disconnected()'s
documentation
usb: chipidea: udc: Fix incorrectly documented function
'hw_port_is_high_speed()'
usb: host: xhci: Remove unused variable 'len'
usb: gadget: udc: pxa27x_udc: Fix documentation for
'pxa27x_udc_start()'
usb: gadget: udc: udc-xilinx: Place correct function names into the
headers
usb: cdns3: cdns3-gadget: Provide correct function naming for
'__cdns3_gadget_ep_queue()'
usb: host: xhci: Move array of structs from the stack onto the heap
usb: host: xhci: Document xhci_get_endpoint_index()'s 'desc' param
usb: cdns3: cdnsp-gadget: Provide function name for
'cdnsp_find_next_ext_cap()'
usb: typec: ucsi: Fix copy/paste issue for 'ucsi_set_drvdata()'

drivers/usb/cdns3/cdns3-ep0.c | 6 ++---
drivers/usb/cdns3/cdns3-gadget.c | 34 ++++++++++++++---------------
drivers/usb/cdns3/cdns3-imx.c | 2 +-
drivers/usb/cdns3/cdns3-plat.c | 2 +-
drivers/usb/cdns3/cdns3-ti.c | 2 +-
drivers/usb/cdns3/cdnsp-gadget.c | 3 ++-
drivers/usb/cdns3/core.c | 4 ++--
drivers/usb/chipidea/core.c | 2 +-
drivers/usb/chipidea/otg.c | 9 ++++----
drivers/usb/chipidea/udc.c | 2 +-
drivers/usb/common/ulpi.c | 2 +-
drivers/usb/dwc2/gadget.c | 2 +-
drivers/usb/dwc2/hcd_queue.c | 2 +-
drivers/usb/dwc2/params.c | 4 ++--
drivers/usb/dwc2/pci.c | 2 +-
drivers/usb/dwc2/platform.c | 2 +-
drivers/usb/gadget/udc/pxa27x_udc.c | 2 +-
drivers/usb/gadget/udc/udc-xilinx.c | 4 ++--
drivers/usb/host/xhci.c | 19 +++++++++++-----
drivers/usb/isp1760/isp1760-udc.c | 1 +
drivers/usb/typec/ucsi/ucsi.c | 2 +-
21 files changed, 59 insertions(+), 49 deletions(-)

Cc: Aswath Govindraju <[email protected]>
Cc: Ben Dooks <[email protected]>
Cc: Daniel Mack <[email protected]>
Cc: David Lopo <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Felipe Balbi <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Haojian Zhuang <[email protected]>
Cc: Heikki Krogerus <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Liam Girdwood <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: Mark Brown <[email protected]>
Cc: Mathias Nyman <[email protected]>
Cc: Matthijs Kooijman <[email protected]>
Cc: Michal Simek <[email protected]>
Cc: Minas Harutyunyan <[email protected]>
Cc: NXP Linux Team <[email protected]>
Cc: Pawel Jez <[email protected]>
Cc: Pawel Laszczak <[email protected]>
Cc: Pengutronix Kernel Team <[email protected]>
Cc: Peter Chen <[email protected]>
Cc: Philipp Zabel <[email protected]>
Cc: Robert Jarzmik <[email protected]>
Cc: Roger Quadros <[email protected]>
Cc: Rui Miguel Silva <[email protected]>
Cc: Sascha Hauer <[email protected]>
Cc: Shawn Guo <[email protected]>
--
2.31.1


2021-05-26 13:28:32

by Lee Jones

[permalink] [raw]
Subject: [PATCH 03/24] usb: common: ulpi: Add leading underscores for function name '__ulpi_register_driver()'

Fixes the following W=1 kernel build warning(s):

drivers/usb/common/ulpi.c:151: warning: expecting prototype for ulpi_register_driver(). Prototype was for __ulpi_register_driver() instead

Cc: Heikki Krogerus <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/usb/common/ulpi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/common/ulpi.c b/drivers/usb/common/ulpi.c
index ce5e6f6711f79..7e13b74e60e5a 100644
--- a/drivers/usb/common/ulpi.c
+++ b/drivers/usb/common/ulpi.c
@@ -141,7 +141,7 @@ static const struct device_type ulpi_dev_type = {
/* -------------------------------------------------------------------------- */

/**
- * ulpi_register_driver - register a driver with the ULPI bus
+ * __ulpi_register_driver - register a driver with the ULPI bus
* @drv: driver being registered
* @module: ends up being THIS_MODULE
*
--
2.31.1

2021-05-26 13:29:15

by Lee Jones

[permalink] [raw]
Subject: [PATCH 04/24] usb: cdns3: cdns3-plat: Fix incorrect naming of function 'cdns3_plat_remove()'

Fixes the following W=1 kernel build warning(s):

drivers/usb/cdns3/cdns3-plat.c:179: warning: expecting prototype for cdns3_remove(). Prototype was for cdns3_plat_remove() instead

Cc: Peter Chen <[email protected]>
Cc: Pawel Laszczak <[email protected]>
Cc: Roger Quadros <[email protected]>
Cc: Aswath Govindraju <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/usb/cdns3/cdns3-plat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/cdns3/cdns3-plat.c b/drivers/usb/cdns3/cdns3-plat.c
index e1deeada425cd..4d0f027e5bd3a 100644
--- a/drivers/usb/cdns3/cdns3-plat.c
+++ b/drivers/usb/cdns3/cdns3-plat.c
@@ -170,7 +170,7 @@ static int cdns3_plat_probe(struct platform_device *pdev)
}

/**
- * cdns3_remove - unbind drd driver and clean up
+ * cdns3_plat_remove() - unbind drd driver and clean up
* @pdev: Pointer to Linux platform device
*
* Returns 0 on success otherwise negative errno
--
2.31.1

2021-05-26 13:30:21

by Lee Jones

[permalink] [raw]
Subject: [PATCH 06/24] usb: isp1760: isp1760-udc: Provide missing description for 'udc' param

Fixes the following W=1 kernel build warning(s):

drivers/usb/isp1760/isp1760-udc.c:150: warning: Function parameter or member 'udc' not described in 'isp1760_udc_select_ep'

Cc: Greg Kroah-Hartman <[email protected]>
Cc: Rui Miguel Silva <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/usb/isp1760/isp1760-udc.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/usb/isp1760/isp1760-udc.c b/drivers/usb/isp1760/isp1760-udc.c
index 3e05e36054357..a78da59d6417b 100644
--- a/drivers/usb/isp1760/isp1760-udc.c
+++ b/drivers/usb/isp1760/isp1760-udc.c
@@ -137,6 +137,7 @@ static void __isp1760_udc_select_ep(struct isp1760_udc *udc,
/**
* isp1760_udc_select_ep - Select an endpoint for register access
* @ep: The endpoint
+ * @udc: Reference to the device controller
*
* The ISP1761 endpoint registers are banked. This function selects the target
* endpoint for banked register access. The selection remains valid until the
--
2.31.1

2021-05-26 13:32:42

by Lee Jones

[permalink] [raw]
Subject: [PATCH 15/24] usb: dwc2: gadget: Repair 'dwc2_hsotg_core_init_disconnected()'s documentation

Fixes the following W=1 kernel build warning(s):

drivers/usb/dwc2/gadget.c:3349: warning: expecting prototype for dwc2_hsotg_core_init(). Prototype was for dwc2_hsotg_core_init_disconnected() instead

Cc: Minas Harutyunyan <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Ben Dooks <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/usb/dwc2/gadget.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index b16fb3611a869..c581ee41ac81b 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -3338,7 +3338,7 @@ static void dwc2_hsotg_irq_fifoempty(struct dwc2_hsotg *hsotg, bool periodic)

static int dwc2_hsotg_ep_disable(struct usb_ep *ep);
/**
- * dwc2_hsotg_core_init - issue softreset to the core
+ * dwc2_hsotg_core_init_disconnected - issue softreset to the core
* @hsotg: The device state
* @is_usb_reset: Usb resetting flag
*
--
2.31.1

2021-05-26 13:32:46

by Lee Jones

[permalink] [raw]
Subject: [PATCH 07/24] usb: cdns3: cdns3-gadget: Fix a bunch of kernel-doc related formatting issues

Fixes the following W=1 kernel build warning(s):

drivers/usb/cdns3/cdns3-gadget.c:163: warning: expecting prototype for select_ep(). Prototype was for cdns3_select_ep() instead
drivers/usb/cdns3/cdns3-gadget.c:2025: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
drivers/usb/cdns3/cdns3-gadget.c:2224: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
drivers/usb/cdns3/cdns3-gadget.c:2247: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
drivers/usb/cdns3/cdns3-gadget.c:2264: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
drivers/usb/cdns3/cdns3-gadget.c:2399: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
drivers/usb/cdns3/cdns3-gadget.c:2489: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
drivers/usb/cdns3/cdns3-gadget.c:2589: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
drivers/usb/cdns3/cdns3-gadget.c:2656: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
drivers/usb/cdns3/cdns3-gadget.c:2677: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
drivers/usb/cdns3/cdns3-gadget.c:2722: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
drivers/usb/cdns3/cdns3-gadget.c:2768: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
drivers/usb/cdns3/cdns3-gadget.c:2877: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
drivers/usb/cdns3/cdns3-gadget.c:2923: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
drivers/usb/cdns3/cdns3-gadget.c:2986: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst

Cc: Peter Chen <[email protected]>
Cc: Pawel Laszczak <[email protected]>
Cc: Roger Quadros <[email protected]>
Cc: Aswath Govindraju <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Pawel Jez <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/usb/cdns3/cdns3-gadget.c | 34 ++++++++++++++++----------------
1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/drivers/usb/cdns3/cdns3-gadget.c b/drivers/usb/cdns3/cdns3-gadget.c
index f3c027653e0e6..54fa429fae777 100644
--- a/drivers/usb/cdns3/cdns3-gadget.c
+++ b/drivers/usb/cdns3/cdns3-gadget.c
@@ -155,7 +155,7 @@ static struct cdns3_request *cdns3_next_priv_request(struct list_head *list)
}

/**
- * select_ep - selects endpoint
+ * cdns3_select_ep - selects endpoint
* @priv_dev: extended gadget object
* @ep: endpoint address
*/
@@ -1835,7 +1835,7 @@ __must_hold(&priv_dev->lock)
}

/**
- * cdns3_device_irq_handler- interrupt handler for device part of controller
+ * cdns3_device_irq_handler - interrupt handler for device part of controller
*
* @irq: irq number for cdns3 core device
* @data: structure of cdns3
@@ -1879,7 +1879,7 @@ static irqreturn_t cdns3_device_irq_handler(int irq, void *data)
}

/**
- * cdns3_device_thread_irq_handler- interrupt handler for device part
+ * cdns3_device_thread_irq_handler - interrupt handler for device part
* of controller
*
* @irq: irq number for cdns3 core device
@@ -2022,7 +2022,7 @@ static void cdns3_configure_dmult(struct cdns3_device *priv_dev,
}

/**
- * cdns3_ep_config Configure hardware endpoint
+ * cdns3_ep_config - Configure hardware endpoint
* @priv_ep: extended endpoint object
* @enable: set EP_CFG_ENABLE bit in ep_cfg register.
*/
@@ -2221,7 +2221,7 @@ usb_ep *cdns3_gadget_match_ep(struct usb_gadget *gadget,
}

/**
- * cdns3_gadget_ep_alloc_request Allocates request
+ * cdns3_gadget_ep_alloc_request - Allocates request
* @ep: endpoint object associated with request
* @gfp_flags: gfp flags
*
@@ -2244,7 +2244,7 @@ struct usb_request *cdns3_gadget_ep_alloc_request(struct usb_ep *ep,
}

/**
- * cdns3_gadget_ep_free_request Free memory occupied by request
+ * cdns3_gadget_ep_free_request - Free memory occupied by request
* @ep: endpoint object associated with request
* @request: request to free memory
*/
@@ -2261,7 +2261,7 @@ void cdns3_gadget_ep_free_request(struct usb_ep *ep,
}

/**
- * cdns3_gadget_ep_enable Enable endpoint
+ * cdns3_gadget_ep_enable - Enable endpoint
* @ep: endpoint object
* @desc: endpoint descriptor
*
@@ -2396,7 +2396,7 @@ static int cdns3_gadget_ep_enable(struct usb_ep *ep,
}

/**
- * cdns3_gadget_ep_disable Disable endpoint
+ * cdns3_gadget_ep_disable - Disable endpoint
* @ep: endpoint object
*
* Returns 0 on success, error code elsewhere
@@ -2486,7 +2486,7 @@ static int cdns3_gadget_ep_disable(struct usb_ep *ep)
}

/**
- * cdns3_gadget_ep_queue Transfer data on endpoint
+ * cdns3_gadget_ep_queue - Transfer data on endpoint
* @ep: endpoint object
* @request: request object
* @gfp_flags: gfp flags
@@ -2586,7 +2586,7 @@ static int cdns3_gadget_ep_queue(struct usb_ep *ep, struct usb_request *request,
}

/**
- * cdns3_gadget_ep_dequeue Remove request from transfer queue
+ * cdns3_gadget_ep_dequeue - Remove request from transfer queue
* @ep: endpoint object associated with request
* @request: request object
*
@@ -2653,7 +2653,7 @@ int cdns3_gadget_ep_dequeue(struct usb_ep *ep,
}

/**
- * __cdns3_gadget_ep_set_halt Sets stall on selected endpoint
+ * __cdns3_gadget_ep_set_halt - Sets stall on selected endpoint
* Should be called after acquiring spin_lock and selecting ep
* @priv_ep: endpoint object to set stall on.
*/
@@ -2674,7 +2674,7 @@ void __cdns3_gadget_ep_set_halt(struct cdns3_endpoint *priv_ep)
}

/**
- * __cdns3_gadget_ep_clear_halt Clears stall on selected endpoint
+ * __cdns3_gadget_ep_clear_halt - Clears stall on selected endpoint
* Should be called after acquiring spin_lock and selecting ep
* @priv_ep: endpoint object to clear stall on
*/
@@ -2719,7 +2719,7 @@ int __cdns3_gadget_ep_clear_halt(struct cdns3_endpoint *priv_ep)
}

/**
- * cdns3_gadget_ep_set_halt Sets/clears stall on selected endpoint
+ * cdns3_gadget_ep_set_halt - Sets/clears stall on selected endpoint
* @ep: endpoint object to set/clear stall on
* @value: 1 for set stall, 0 for clear stall
*
@@ -2765,7 +2765,7 @@ static const struct usb_ep_ops cdns3_gadget_ep_ops = {
};

/**
- * cdns3_gadget_get_frame Returns number of actual ITP frame
+ * cdns3_gadget_get_frame - Returns number of actual ITP frame
* @gadget: gadget object
*
* Returns number of actual ITP frame
@@ -2874,7 +2874,7 @@ static void cdns3_gadget_config(struct cdns3_device *priv_dev)
}

/**
- * cdns3_gadget_udc_start Gadget start
+ * cdns3_gadget_udc_start - Gadget start
* @gadget: gadget object
* @driver: driver which operates on this gadget
*
@@ -2920,7 +2920,7 @@ static int cdns3_gadget_udc_start(struct usb_gadget *gadget,
}

/**
- * cdns3_gadget_udc_stop Stops gadget
+ * cdns3_gadget_udc_stop - Stops gadget
* @gadget: gadget object
*
* Returns 0
@@ -2983,7 +2983,7 @@ static void cdns3_free_all_eps(struct cdns3_device *priv_dev)
}

/**
- * cdns3_init_eps Initializes software endpoints of gadget
+ * cdns3_init_eps - Initializes software endpoints of gadget
* @priv_dev: extended gadget object
*
* Returns 0 on success, error code elsewhere
--
2.31.1

2021-05-26 13:32:49

by Lee Jones

[permalink] [raw]
Subject: [PATCH 16/24] usb: chipidea: udc: Fix incorrectly documented function 'hw_port_is_high_speed()'

Fixes the following W=1 kernel build warning(s):

drivers/usb/chipidea/udc.c:247: warning: expecting prototype for hw_is_port_high_speed(). Prototype was for hw_port_is_high_speed() instead

Cc: Peter Chen <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/usb/chipidea/udc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
index 393f216b91615..8834ca6137219 100644
--- a/drivers/usb/chipidea/udc.c
+++ b/drivers/usb/chipidea/udc.c
@@ -238,7 +238,7 @@ static int hw_ep_set_halt(struct ci_hdrc *ci, int num, int dir, int value)
}

/**
- * hw_is_port_high_speed: test if port is high speed
+ * hw_port_is_high_speed: test if port is high speed
* @ci: the controller
*
* This function returns true if high speed port
--
2.31.1

2021-05-26 13:33:50

by Lee Jones

[permalink] [raw]
Subject: [PATCH 20/24] usb: cdns3: cdns3-gadget: Provide correct function naming for '__cdns3_gadget_ep_queue()'

Fixes the following W=1 kernel build warning(s):

drivers/usb/cdns3/cdns3-gadget.c:2499: warning: expecting prototype for cdns3_gadget_ep_queue(). Prototype was for __cdns3_gadget_ep_queue() instead

Cc: Peter Chen <[email protected]>
Cc: Pawel Laszczak <[email protected]>
Cc: Roger Quadros <[email protected]>
Cc: Aswath Govindraju <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Pawel Jez <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/usb/cdns3/cdns3-gadget.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/cdns3/cdns3-gadget.c b/drivers/usb/cdns3/cdns3-gadget.c
index 54fa429fae777..57adcdbfab5f6 100644
--- a/drivers/usb/cdns3/cdns3-gadget.c
+++ b/drivers/usb/cdns3/cdns3-gadget.c
@@ -2486,7 +2486,7 @@ static int cdns3_gadget_ep_disable(struct usb_ep *ep)
}

/**
- * cdns3_gadget_ep_queue - Transfer data on endpoint
+ * __cdns3_gadget_ep_queue - Transfer data on endpoint
* @ep: endpoint object
* @request: request object
* @gfp_flags: gfp flags
--
2.31.1

2021-05-26 13:34:04

by Lee Jones

[permalink] [raw]
Subject: [PATCH 10/24] usb: cdns3: cdns3-imx: File headers are not good candidates for kernel-doc

Fixes the following W=1 kernel build warning(s):

drivers/usb/cdns3/cdns3-imx.c:21: warning: expecting prototype for cdns3(). Prototype was for USB3_CORE_CTRL1() instead

Cc: Peter Chen <[email protected]>
Cc: Pawel Laszczak <[email protected]>
Cc: Roger Quadros <[email protected]>
Cc: Aswath Govindraju <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Shawn Guo <[email protected]>
Cc: Sascha Hauer <[email protected]>
Cc: Pengutronix Kernel Team <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: NXP Linux Team <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/usb/cdns3/cdns3-imx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/cdns3/cdns3-imx.c b/drivers/usb/cdns3/cdns3-imx.c
index 74e758dc08955..59860d1753fd5 100644
--- a/drivers/usb/cdns3/cdns3-imx.c
+++ b/drivers/usb/cdns3/cdns3-imx.c
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
-/**
+/*
* cdns3-imx.c - NXP i.MX specific Glue layer for Cadence USB Controller
*
* Copyright (C) 2019 NXP
--
2.31.1

2021-05-26 13:34:09

by Lee Jones

[permalink] [raw]
Subject: [PATCH 18/24] usb: gadget: udc: pxa27x_udc: Fix documentation for 'pxa27x_udc_start()'

Fixes the following W=1 kernel build warning(s):

drivers/usb/gadget/udc/pxa27x_udc.c:1749: warning: expecting prototype for pxa27x_start(). Prototype was for pxa27x_udc_start() instead

Cc: Daniel Mack <[email protected]>
Cc: Haojian Zhuang <[email protected]>
Cc: Robert Jarzmik <[email protected]>
Cc: Felipe Balbi <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/usb/gadget/udc/pxa27x_udc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/pxa27x_udc.c b/drivers/usb/gadget/udc/pxa27x_udc.c
index ce57961dfd2d6..b2759b04b8e94 100644
--- a/drivers/usb/gadget/udc/pxa27x_udc.c
+++ b/drivers/usb/gadget/udc/pxa27x_udc.c
@@ -1730,7 +1730,7 @@ static void udc_enable(struct pxa_udc *udc)
}

/**
- * pxa27x_start - Register gadget driver
+ * pxa27x_udc_start - Register gadget driver
* @g: gadget
* @driver: gadget driver
*
--
2.31.1

2021-05-26 13:34:09

by Lee Jones

[permalink] [raw]
Subject: [PATCH 24/24] usb: typec: ucsi: Fix copy/paste issue for 'ucsi_set_drvdata()'

Fixes the following W=1 kernel build warning(s):

drivers/usb/typec/ucsi/ucsi.c:1287: warning: expecting prototype for ucsi_get_drvdata(). Prototype was for ucsi_set_drvdata() instead

Cc: Heikki Krogerus <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/usb/typec/ucsi/ucsi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
index b433169ef6fa4..4e1973fbdf0dc 100644
--- a/drivers/usb/typec/ucsi/ucsi.c
+++ b/drivers/usb/typec/ucsi/ucsi.c
@@ -1279,7 +1279,7 @@ void *ucsi_get_drvdata(struct ucsi *ucsi)
EXPORT_SYMBOL_GPL(ucsi_get_drvdata);

/**
- * ucsi_get_drvdata - Assign private driver data pointer
+ * ucsi_set_drvdata - Assign private driver data pointer
* @ucsi: UCSI interface
* @data: Private data pointer
*/
--
2.31.1

2021-05-26 13:35:09

by Lee Jones

[permalink] [raw]
Subject: [PATCH 13/24] usb: chipidea: core: Fix incorrectly documented function 'ci_usb_phy_exit()'

Fixes the following W=1 kernel build warning(s):

drivers/usb/chipidea/core.c:343: warning: expecting prototype for _ci_usb_phy_exit(). Prototype was for ci_usb_phy_exit() instead

Cc: Peter Chen <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Liam Girdwood <[email protected]>
Cc: Mark Brown <[email protected]>
Cc: David Lopo <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/usb/chipidea/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
index 3f6c21406dbd2..2b18f5088ae4a 100644
--- a/drivers/usb/chipidea/core.c
+++ b/drivers/usb/chipidea/core.c
@@ -335,7 +335,7 @@ static int _ci_usb_phy_init(struct ci_hdrc *ci)
}

/**
- * _ci_usb_phy_exit: deinitialize phy taking in account both phy and usb_phy
+ * ci_usb_phy_exit: deinitialize phy taking in account both phy and usb_phy
* interfaces
* @ci: the controller
*/
--
2.31.1

2021-05-26 13:35:13

by Lee Jones

[permalink] [raw]
Subject: [PATCH 22/24] usb: host: xhci: Document xhci_get_endpoint_index()'s 'desc' param

Fixes the following W=1 kernel build warning(s):

drivers/usb/host/xhci.c:1424: warning: Function parameter or member 'desc' not described in 'xhci_get_endpoint_index'

Cc: Mathias Nyman <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/usb/host/xhci.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 40ce4b4eb12ad..094b2bf1e2657 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -1415,6 +1415,8 @@ static void xhci_unmap_urb_for_dma(struct usb_hcd *hcd, struct urb *urb)
* HCDs. Find the index for an endpoint given its descriptor. Use the return
* value to right shift 1 for the bitmask.
*
+ * @desc: USB endpoint descriptor
+ *
* Index = (epnum * 2) + direction - 1,
* where direction = 0 for OUT, 1 for IN.
* For control endpoints, the IN index is used (OUT index is unused), so
--
2.31.1

2021-05-26 13:36:31

by Lee Jones

[permalink] [raw]
Subject: [PATCH 21/24] usb: host: xhci: Move array of structs from the stack onto the heap

Fixes the following W=1 kernel build warning(s):

drivers/usb/host/xhci.c: In function ‘xhci_reserve_bandwidth’:
drivers/usb/host/xhci.c:2859:1: warning: the frame size of 1032 bytes is larger than 1024 bytes [-Wframe-larger-than=]

Cc: Mathias Nyman <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/usb/host/xhci.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index ac2a7d4288883..40ce4b4eb12ad 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -2773,7 +2773,7 @@ static int xhci_reserve_bandwidth(struct xhci_hcd *xhci,
struct xhci_virt_device *virt_dev,
struct xhci_container_ctx *in_ctx)
{
- struct xhci_bw_info ep_bw_info[31];
+ struct xhci_bw_info *ep_bw_info;
int i;
struct xhci_input_control_ctx *ctrl_ctx;
int old_active_eps = 0;
@@ -2788,6 +2788,10 @@ static int xhci_reserve_bandwidth(struct xhci_hcd *xhci,
return -ENOMEM;
}

+ ep_bw_info = kzalloc(sizeof(*ep_bw_info) * 31, GFP_KERNEL);
+ if (!ep_bw_info)
+ return -ENOMEM;
+
for (i = 0; i < 31; i++) {
if (!EP_IS_ADDED(ctrl_ctx, i) && !EP_IS_DROPPED(ctrl_ctx, i))
continue;
@@ -2824,6 +2828,7 @@ static int xhci_reserve_bandwidth(struct xhci_hcd *xhci,
* Update the number of active TTs.
*/
xhci_update_tt_active_eps(xhci, virt_dev, old_active_eps);
+ kfree(ep_bw_info);
return 0;
}

@@ -2855,6 +2860,7 @@ static int xhci_reserve_bandwidth(struct xhci_hcd *xhci,
&virt_dev->eps[i],
virt_dev->tt_info);
}
+ kfree(ep_bw_info);
return -ENOMEM;
}

--
2.31.1

2021-05-26 13:43:50

by Daniel Mack

[permalink] [raw]
Subject: Re: [PATCH 18/24] usb: gadget: udc: pxa27x_udc: Fix documentation for 'pxa27x_udc_start()'

On 5/26/21 3:00 PM, Lee Jones wrote:
> Fixes the following W=1 kernel build warning(s):
>
> drivers/usb/gadget/udc/pxa27x_udc.c:1749: warning: expecting prototype for pxa27x_start(). Prototype was for pxa27x_udc_start() instead
>

Acked-by: Daniel Mack <[email protected]>


Thanks!


> Cc: Haojian Zhuang <[email protected]>
> Cc: Robert Jarzmik <[email protected]>
> Cc: Felipe Balbi <[email protected]>
> Cc: Greg Kroah-Hartman <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Lee Jones <[email protected]>
> ---
> drivers/usb/gadget/udc/pxa27x_udc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/gadget/udc/pxa27x_udc.c b/drivers/usb/gadget/udc/pxa27x_udc.c
> index ce57961dfd2d6..b2759b04b8e94 100644
> --- a/drivers/usb/gadget/udc/pxa27x_udc.c
> +++ b/drivers/usb/gadget/udc/pxa27x_udc.c
> @@ -1730,7 +1730,7 @@ static void udc_enable(struct pxa_udc *udc)
> }
>
> /**
> - * pxa27x_start - Register gadget driver
> + * pxa27x_udc_start - Register gadget driver
> * @g: gadget
> * @driver: gadget driver
> *
>

2021-05-26 14:25:36

by Sergei Shtylyov

[permalink] [raw]
Subject: Re: [PATCH 21/24] usb: host: xhci: Move array of structs from the stack onto the heap

On 5/26/21 4:00 PM, Lee Jones wrote:

> Fixes the following W=1 kernel build warning(s):
>
> drivers/usb/host/xhci.c: In function ‘xhci_reserve_bandwidth’:
> drivers/usb/host/xhci.c:2859:1: warning: the frame size of 1032 bytes is larger than 1024 bytes [-Wframe-larger-than=]
>
> Cc: Mathias Nyman <[email protected]>
> Cc: Greg Kroah-Hartman <[email protected]>
> Cc: [email protected]
> Signed-off-by: Lee Jones <[email protected]>
> ---
> drivers/usb/host/xhci.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
> index ac2a7d4288883..40ce4b4eb12ad 100644
> --- a/drivers/usb/host/xhci.c
> +++ b/drivers/usb/host/xhci.c
[...]
> @@ -2788,6 +2788,10 @@ static int xhci_reserve_bandwidth(struct xhci_hcd *xhci,
> return -ENOMEM;
> }
>
> + ep_bw_info = kzalloc(sizeof(*ep_bw_info) * 31, GFP_KERNEL);

Why not kcalloc()?

[...]

MBR, Sergei

2021-05-26 14:27:41

by Sergei Shtylyov

[permalink] [raw]
Subject: Re: [PATCH 13/24] usb: chipidea: core: Fix incorrectly documented function 'ci_usb_phy_exit()'

On 5/26/21 4:00 PM, Lee Jones wrote:

> Fixes the following W=1 kernel build warning(s):
>
> drivers/usb/chipidea/core.c:343: warning: expecting prototype for _ci_usb_phy_exit(). Prototype was for ci_usb_phy_exit() instead
>
> Cc: Peter Chen <[email protected]>
> Cc: Greg Kroah-Hartman <[email protected]>
> Cc: Liam Girdwood <[email protected]>
> Cc: Mark Brown <[email protected]>
> Cc: David Lopo <[email protected]>
> Cc: [email protected]
> Signed-off-by: Lee Jones <[email protected]>
> ---
> drivers/usb/chipidea/core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
> index 3f6c21406dbd2..2b18f5088ae4a 100644
> --- a/drivers/usb/chipidea/core.c
> +++ b/drivers/usb/chipidea/core.c
> @@ -335,7 +335,7 @@ static int _ci_usb_phy_init(struct ci_hdrc *ci)
> }
>
> /**
> - * _ci_usb_phy_exit: deinitialize phy taking in account both phy and usb_phy
> + * ci_usb_phy_exit: deinitialize phy taking in account both phy and usb_phy

I thought - shoiuld've been used as a separator. Is : good here as well?

> * interfaces
> * @ci: the controller
> */

MBR, Sergei

2021-05-26 14:35:27

by Heikki Krogerus

[permalink] [raw]
Subject: Re: [PATCH 24/24] usb: typec: ucsi: Fix copy/paste issue for 'ucsi_set_drvdata()'

On Wed, May 26, 2021 at 02:00:37PM +0100, Lee Jones wrote:
> Fixes the following W=1 kernel build warning(s):
>
> drivers/usb/typec/ucsi/ucsi.c:1287: warning: expecting prototype for ucsi_get_drvdata(). Prototype was for ucsi_set_drvdata() instead
>
> Cc: Heikki Krogerus <[email protected]>
> Cc: Greg Kroah-Hartman <[email protected]>
> Cc: [email protected]
> Signed-off-by: Lee Jones <[email protected]>

Reviewed-by: Heikki Krogerus <[email protected]>

> ---
> drivers/usb/typec/ucsi/ucsi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
> index b433169ef6fa4..4e1973fbdf0dc 100644
> --- a/drivers/usb/typec/ucsi/ucsi.c
> +++ b/drivers/usb/typec/ucsi/ucsi.c
> @@ -1279,7 +1279,7 @@ void *ucsi_get_drvdata(struct ucsi *ucsi)
> EXPORT_SYMBOL_GPL(ucsi_get_drvdata);
>
> /**
> - * ucsi_get_drvdata - Assign private driver data pointer
> + * ucsi_set_drvdata - Assign private driver data pointer
> * @ucsi: UCSI interface
> * @data: Private data pointer
> */
> --
> 2.31.1

--
heikki

2021-05-26 14:44:28

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 13/24] usb: chipidea: core: Fix incorrectly documented function 'ci_usb_phy_exit()'

On Wed, 26 May 2021, Sergei Shtylyov wrote:

> On 5/26/21 4:00 PM, Lee Jones wrote:
>
> > Fixes the following W=1 kernel build warning(s):
> >
> > drivers/usb/chipidea/core.c:343: warning: expecting prototype for _ci_usb_phy_exit(). Prototype was for ci_usb_phy_exit() instead
> >
> > Cc: Peter Chen <[email protected]>
> > Cc: Greg Kroah-Hartman <[email protected]>
> > Cc: Liam Girdwood <[email protected]>
> > Cc: Mark Brown <[email protected]>
> > Cc: David Lopo <[email protected]>
> > Cc: [email protected]
> > Signed-off-by: Lee Jones <[email protected]>
> > ---
> > drivers/usb/chipidea/core.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
> > index 3f6c21406dbd2..2b18f5088ae4a 100644
> > --- a/drivers/usb/chipidea/core.c
> > +++ b/drivers/usb/chipidea/core.c
> > @@ -335,7 +335,7 @@ static int _ci_usb_phy_init(struct ci_hdrc *ci)
> > }
> >
> > /**
> > - * _ci_usb_phy_exit: deinitialize phy taking in account both phy and usb_phy
> > + * ci_usb_phy_exit: deinitialize phy taking in account both phy and usb_phy
>
> I thought - shoiuld've been used as a separator. Is : good here as well?

If I were drafting from scratch, I would *always* use '-', but
kernel-doc seems to work okay with ':' too, so I'm letting sleeping
dogs lie on this one.

> > * interfaces
> > * @ci: the controller
> > */
>
> MBR, Sergei

--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

2021-05-26 14:46:28

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 21/24] usb: host: xhci: Move array of structs from the stack onto the heap

On Wed, 26 May 2021, Sergei Shtylyov wrote:

> On 5/26/21 4:00 PM, Lee Jones wrote:
>
> > Fixes the following W=1 kernel build warning(s):
> >
> > drivers/usb/host/xhci.c: In function ‘xhci_reserve_bandwidth’:
> > drivers/usb/host/xhci.c:2859:1: warning: the frame size of 1032 bytes is larger than 1024 bytes [-Wframe-larger-than=]
> >
> > Cc: Mathias Nyman <[email protected]>
> > Cc: Greg Kroah-Hartman <[email protected]>
> > Cc: [email protected]
> > Signed-off-by: Lee Jones <[email protected]>
> > ---
> > drivers/usb/host/xhci.c | 8 +++++++-
> > 1 file changed, 7 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
> > index ac2a7d4288883..40ce4b4eb12ad 100644
> > --- a/drivers/usb/host/xhci.c
> > +++ b/drivers/usb/host/xhci.c
> [...]
> > @@ -2788,6 +2788,10 @@ static int xhci_reserve_bandwidth(struct xhci_hcd *xhci,
> > return -ENOMEM;
> > }
> >
> > + ep_bw_info = kzalloc(sizeof(*ep_bw_info) * 31, GFP_KERNEL);
>
> Why not kcalloc()?

No particular reason. Muscle memory I guess.

Happy either way.

--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

2021-05-26 15:16:48

by Minas Harutyunyan

[permalink] [raw]
Subject: Re: [PATCH 15/24] usb: dwc2: gadget: Repair 'dwc2_hsotg_core_init_disconnected()'s documentation

On 5/26/2021 5:00 PM, Lee Jones wrote:
> Fixes the following W=1 kernel build warning(s):
>
> drivers/usb/dwc2/gadget.c:3349: warning: expecting prototype for dwc2_hsotg_core_init(). Prototype was for dwc2_hsotg_core_init_disconnected() instead
>
> Cc: Minas Harutyunyan <[email protected]>
> Cc: Greg Kroah-Hartman <[email protected]>
> Cc: Ben Dooks <[email protected]>
> Cc: [email protected]
> Signed-off-by: Lee Jones <[email protected]>


Acked-by: Minas Harutyunyan <[email protected]>


> ---
> drivers/usb/dwc2/gadget.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
> index b16fb3611a869..c581ee41ac81b 100644
> --- a/drivers/usb/dwc2/gadget.c
> +++ b/drivers/usb/dwc2/gadget.c
> @@ -3338,7 +3338,7 @@ static void dwc2_hsotg_irq_fifoempty(struct dwc2_hsotg *hsotg, bool periodic)
>
> static int dwc2_hsotg_ep_disable(struct usb_ep *ep);
> /**
> - * dwc2_hsotg_core_init - issue softreset to the core
> + * dwc2_hsotg_core_init_disconnected - issue softreset to the core
> * @hsotg: The device state
> * @is_usb_reset: Usb resetting flag
> *
>

2021-05-26 18:08:37

by Lee Jones

[permalink] [raw]
Subject: [PATCH 09/24] usb: cdns3: cdns3-ep0: Fix a few kernel-doc formatting issues

Fixes the following W=1 kernel build warning(s):

drivers/usb/cdns3/cdns3-ep0.c:680: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
drivers/usb/cdns3/cdns3-ep0.c:775: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
drivers/usb/cdns3/cdns3-ep0.c:868: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst

Cc: Peter Chen <[email protected]>
Cc: Pawel Laszczak <[email protected]>
Cc: Roger Quadros <[email protected]>
Cc: Aswath Govindraju <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Pawel Jez <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/usb/cdns3/cdns3-ep0.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/cdns3/cdns3-ep0.c b/drivers/usb/cdns3/cdns3-ep0.c
index 9a17802275d51..02ec7ab4bb489 100644
--- a/drivers/usb/cdns3/cdns3-ep0.c
+++ b/drivers/usb/cdns3/cdns3-ep0.c
@@ -677,7 +677,7 @@ static int cdns3_gadget_ep0_set_halt(struct usb_ep *ep, int value)
}

/**
- * cdns3_gadget_ep0_queue Transfer data on endpoint zero
+ * cdns3_gadget_ep0_queue - Transfer data on endpoint zero
* @ep: pointer to endpoint zero object
* @request: pointer to request object
* @gfp_flags: gfp flags
@@ -772,7 +772,7 @@ static int cdns3_gadget_ep0_queue(struct usb_ep *ep,
}

/**
- * cdns3_gadget_ep_set_wedge Set wedge on selected endpoint
+ * cdns3_gadget_ep_set_wedge - Set wedge on selected endpoint
* @ep: endpoint object
*
* Returns 0
@@ -865,7 +865,7 @@ void cdns3_ep0_config(struct cdns3_device *priv_dev)
}

/**
- * cdns3_init_ep0 Initializes software endpoint 0 of gadget
+ * cdns3_init_ep0 - Initializes software endpoint 0 of gadget
* @priv_dev: extended gadget object
* @priv_ep: extended endpoint object
*
--
2.31.1

2021-05-26 18:10:10

by Lee Jones

[permalink] [raw]
Subject: [PATCH 11/24] usb: dwc2: hcd_queue: Fix typeo in function name 'dwc2_hs_pmap_unschedule()'

Fixes the following W=1 kernel build warning(s):

drivers/usb/dwc2/hcd_queue.c:686: warning: expecting prototype for dwc2_ls_pmap_unschedule(). Prototype was for dwc2_hs_pmap_unschedule() instead

Cc: Minas Harutyunyan <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/usb/dwc2/hcd_queue.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/dwc2/hcd_queue.c b/drivers/usb/dwc2/hcd_queue.c
index 621a4846bd05a..89a788326c562 100644
--- a/drivers/usb/dwc2/hcd_queue.c
+++ b/drivers/usb/dwc2/hcd_queue.c
@@ -675,7 +675,7 @@ static int dwc2_hs_pmap_schedule(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh,
}

/**
- * dwc2_ls_pmap_unschedule() - Undo work done by dwc2_hs_pmap_schedule()
+ * dwc2_hs_pmap_unschedule() - Undo work done by dwc2_hs_pmap_schedule()
*
* @hsotg: The HCD state structure for the DWC OTG controller.
* @qh: QH for the periodic transfer.
--
2.31.1

2021-05-26 18:12:00

by Lee Jones

[permalink] [raw]
Subject: [PATCH 12/24] usb: dwc2: pci: Fix possible copy/paste issue

Fixes the following W=1 kernel build warning(s):

drivers/usb/dwc2/pci.c:73: warning: expecting prototype for dwc2_pci_probe(). Prototype was for dwc2_pci_remove() instead

Cc: Minas Harutyunyan <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/usb/dwc2/pci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/dwc2/pci.c b/drivers/usb/dwc2/pci.c
index 0000151e3ca96..a93559b4ecdbc 100644
--- a/drivers/usb/dwc2/pci.c
+++ b/drivers/usb/dwc2/pci.c
@@ -64,7 +64,7 @@ struct dwc2_pci_glue {
};

/**
- * dwc2_pci_probe() - Provides the cleanup entry points for the DWC_otg PCI
+ * dwc2_pci_remove() - Provides the cleanup entry points for the DWC_otg PCI
* driver
*
* @pci: The programming view of DWC_otg PCI
--
2.31.1

2021-05-26 18:14:02

by Lee Jones

[permalink] [raw]
Subject: [PATCH 17/24] usb: host: xhci: Remove unused variable 'len'

Fixes the following W=1 kernel build warning(s):

drivers/usb/host/xhci.c: In function ‘xhci_unmap_temp_buf’:
drivers/usb/host/xhci.c:1349:15: warning: variable ‘len’ set but not used [-Wunused-but-set-variable]

Cc: Mathias Nyman <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/usb/host/xhci.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 27283654ca080..ac2a7d4288883 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -1346,7 +1346,6 @@ static bool xhci_urb_temp_buffer_required(struct usb_hcd *hcd,

static void xhci_unmap_temp_buf(struct usb_hcd *hcd, struct urb *urb)
{
- unsigned int len;
unsigned int buf_len;
enum dma_data_direction dir;

@@ -1362,10 +1361,10 @@ static void xhci_unmap_temp_buf(struct usb_hcd *hcd, struct urb *urb)
dir);

if (usb_urb_dir_in(urb))
- len = sg_pcopy_from_buffer(urb->sg, urb->num_sgs,
- urb->transfer_buffer,
- buf_len,
- 0);
+ sg_pcopy_from_buffer(urb->sg, urb->num_sgs,
+ urb->transfer_buffer,
+ buf_len,
+ 0);

urb->transfer_flags &= ~URB_DMA_MAP_SINGLE;
kfree(urb->transfer_buffer);
--
2.31.1

2021-05-26 18:44:19

by Lee Jones

[permalink] [raw]
Subject: [PATCH 08/24] usb: cdns3: cdns3-ti: File headers are not good candidates for kernel-doc

Fixes the following W=1 kernel build warning(s):

drivers/usb/cdns3/cdns3-ti.c:20: warning: expecting prototype for cdns3(). Prototype was for USBSS_PID() instead

Cc: Peter Chen <[email protected]>
Cc: Pawel Laszczak <[email protected]>
Cc: Roger Quadros <[email protected]>
Cc: Aswath Govindraju <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/usb/cdns3/cdns3-ti.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/cdns3/cdns3-ti.c b/drivers/usb/cdns3/cdns3-ti.c
index eccb1c766bba5..07c3187703623 100644
--- a/drivers/usb/cdns3/cdns3-ti.c
+++ b/drivers/usb/cdns3/cdns3-ti.c
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
-/**
+/*
* cdns3-ti.c - TI specific Glue layer for Cadence USB Controller
*
* Copyright (C) 2019 Texas Instruments Incorporated - https://www.ti.com
--
2.31.1

2021-05-26 18:44:59

by Lee Jones

[permalink] [raw]
Subject: [PATCH 14/24] usb: chipidea: otg: Fix formatting and missing documentation issues

Fixes the following W=1 kernel build warning(s):

drivers/usb/chipidea/otg.c:25: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
drivers/usb/chipidea/otg.c:78: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
drivers/usb/chipidea/otg.c:143: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst

Cc: Peter Chen <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/usb/chipidea/otg.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/chipidea/otg.c b/drivers/usb/chipidea/otg.c
index d3aada3ce7ec2..8dd59282827b0 100644
--- a/drivers/usb/chipidea/otg.c
+++ b/drivers/usb/chipidea/otg.c
@@ -22,7 +22,7 @@
#include "otg_fsm.h"

/**
- * hw_read_otgsc returns otgsc register bits value.
+ * hw_read_otgsc - returns otgsc register bits value.
* @ci: the controller
* @mask: bitfield mask
*/
@@ -75,7 +75,7 @@ u32 hw_read_otgsc(struct ci_hdrc *ci, u32 mask)
}

/**
- * hw_write_otgsc updates target bits of OTGSC register.
+ * hw_write_otgsc - updates target bits of OTGSC register.
* @ci: the controller
* @mask: bitfield mask
* @data: to be written
@@ -140,8 +140,9 @@ void ci_handle_vbus_change(struct ci_hdrc *ci)
}

/**
- * When we switch to device mode, the vbus value should be lower
- * than OTGSC_BSV before connecting to host.
+ * hw_wait_vbus_lower_bsv - When we switch to device mode, the vbus value
+ * should be lower than OTGSC_BSV before connecting
+ * to host.
*
* @ci: the controller
*
--
2.31.1

2021-05-26 18:45:08

by Lee Jones

[permalink] [raw]
Subject: [PATCH 23/24] usb: cdns3: cdnsp-gadget: Provide function name for 'cdnsp_find_next_ext_cap()'

Fixes the following W=1 kernel build warning(s):

drivers/usb/cdns3/cdnsp-gadget.c:59: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst

Cc: Pawel Laszczak <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/usb/cdns3/cdnsp-gadget.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/cdns3/cdnsp-gadget.c b/drivers/usb/cdns3/cdnsp-gadget.c
index 47e5795898ccb..c23f53e9b1efe 100644
--- a/drivers/usb/cdns3/cdnsp-gadget.c
+++ b/drivers/usb/cdns3/cdnsp-gadget.c
@@ -56,7 +56,8 @@ u32 cdnsp_port_state_to_neutral(u32 state)
}

/**
- * Find the offset of the extended capabilities with capability ID id.
+ * cdnsp_find_next_ext_cap - Find the offset of the extended capabilities
+ * with capability ID id.
* @base: PCI MMIO registers base address.
* @start: Address at which to start looking, (0 or HCC_PARAMS to start at
* beginning of list)
--
2.31.1

2021-05-26 18:45:25

by Lee Jones

[permalink] [raw]
Subject: [PATCH 19/24] usb: gadget: udc: udc-xilinx: Place correct function names into the headers

Fixes the following W=1 kernel build warning(s):

drivers/usb/gadget/udc/udc-xilinx.c:802: warning: expecting prototype for xudc_ep_enable(). Prototype was for __xudc_ep_enable() instead
drivers/usb/gadget/udc/udc-xilinx.c:997: warning: expecting prototype for xudc_ep0_queue(). Prototype was for __xudc_ep0_queue() instead

Cc: Felipe Balbi <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Michal Simek <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/usb/gadget/udc/udc-xilinx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/udc/udc-xilinx.c b/drivers/usb/gadget/udc/udc-xilinx.c
index 72f2ea062d554..fb4ffedd6f0dd 100644
--- a/drivers/usb/gadget/udc/udc-xilinx.c
+++ b/drivers/usb/gadget/udc/udc-xilinx.c
@@ -791,7 +791,7 @@ static int xudc_ep_set_halt(struct usb_ep *_ep, int value)
}

/**
- * xudc_ep_enable - Enables the given endpoint.
+ * __xudc_ep_enable - Enables the given endpoint.
* @ep: pointer to the xusb endpoint structure.
* @desc: pointer to usb endpoint descriptor.
*
@@ -987,7 +987,7 @@ static void xudc_free_request(struct usb_ep *_ep, struct usb_request *_req)
}

/**
- * xudc_ep0_queue - Adds the request to endpoint 0 queue.
+ * __xudc_ep0_queue - Adds the request to endpoint 0 queue.
* @ep0: pointer to the xusb endpoint 0 structure.
* @req: pointer to the xusb request structure.
*
--
2.31.1

2021-05-26 18:46:12

by Lee Jones

[permalink] [raw]
Subject: [PATCH 05/24] usb: dwc2: params: Fix naming of 'dwc2_get_hwparams()' in the docs

Fixes the following W=1 kernel build warning(s):

drivers/usb/dwc2/params.c:787: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst

Cc: Minas Harutyunyan <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/usb/dwc2/params.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c
index 7a6089fa81e1d..67c5eb1402325 100644
--- a/drivers/usb/dwc2/params.c
+++ b/drivers/usb/dwc2/params.c
@@ -784,8 +784,8 @@ static void dwc2_get_dev_hwparams(struct dwc2_hsotg *hsotg)
}

/**
- * During device initialization, read various hardware configuration
- * registers and interpret the contents.
+ * dwc2_get_hwparams() - During device initialization, read various hardware
+ * configuration registers and interpret the contents.
*
* @hsotg: Programming view of the DWC_otg controller
*
--
2.31.1

2021-05-26 18:56:53

by Sergei Shtylyov

[permalink] [raw]
Subject: Re: [PATCH 21/24] usb: host: xhci: Move array of structs from the stack onto the heap

On 5/26/21 5:44 PM, Lee Jones wrote:

[...]
>>> Fixes the following W=1 kernel build warning(s):
>>>
>>> drivers/usb/host/xhci.c: In function ‘xhci_reserve_bandwidth’:
>>> drivers/usb/host/xhci.c:2859:1: warning: the frame size of 1032 bytes is larger than 1024 bytes [-Wframe-larger-than=]
>>>
>>> Cc: Mathias Nyman <[email protected]>
>>> Cc: Greg Kroah-Hartman <[email protected]>
>>> Cc: [email protected]
>>> Signed-off-by: Lee Jones <[email protected]>
>>> ---
>>> drivers/usb/host/xhci.c | 8 +++++++-
>>> 1 file changed, 7 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
>>> index ac2a7d4288883..40ce4b4eb12ad 100644
>>> --- a/drivers/usb/host/xhci.c
>>> +++ b/drivers/usb/host/xhci.c
>> [...]
>>> @@ -2788,6 +2788,10 @@ static int xhci_reserve_bandwidth(struct xhci_hcd *xhci,
>>> return -ENOMEM;
>>> }
>>>
>>> + ep_bw_info = kzalloc(sizeof(*ep_bw_info) * 31, GFP_KERNEL);
>>
>> Why not kcalloc()?
>
> No particular reason. Muscle memory I guess.
>
> Happy either way.

kcalloc( is designed for allocatiung arrays and clearing them, like calloc(),
so let's stick wuth it...

MBR, Sergei

2021-05-26 19:05:22

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 21/24] usb: host: xhci: Move array of structs from the stack onto the heap

On Wed, 26 May 2021, Sergei Shtylyov wrote:

> On 5/26/21 5:44 PM, Lee Jones wrote:
>
> [...]
> >>> Fixes the following W=1 kernel build warning(s):
> >>>
> >>> drivers/usb/host/xhci.c: In function ‘xhci_reserve_bandwidth’:
> >>> drivers/usb/host/xhci.c:2859:1: warning: the frame size of 1032 bytes is larger than 1024 bytes [-Wframe-larger-than=]
> >>>
> >>> Cc: Mathias Nyman <[email protected]>
> >>> Cc: Greg Kroah-Hartman <[email protected]>
> >>> Cc: [email protected]
> >>> Signed-off-by: Lee Jones <[email protected]>
> >>> ---
> >>> drivers/usb/host/xhci.c | 8 +++++++-
> >>> 1 file changed, 7 insertions(+), 1 deletion(-)
> >>>
> >>> diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
> >>> index ac2a7d4288883..40ce4b4eb12ad 100644
> >>> --- a/drivers/usb/host/xhci.c
> >>> +++ b/drivers/usb/host/xhci.c
> >> [...]
> >>> @@ -2788,6 +2788,10 @@ static int xhci_reserve_bandwidth(struct xhci_hcd *xhci,
> >>> return -ENOMEM;
> >>> }
> >>>
> >>> + ep_bw_info = kzalloc(sizeof(*ep_bw_info) * 31, GFP_KERNEL);
> >>
> >> Why not kcalloc()?
> >
> > No particular reason. Muscle memory I guess.
> >
> > Happy either way.
>
> kcalloc( is designed for allocatiung arrays and clearing them, like calloc(),
> so let's stick wuth it...

No problem. Will fix.

--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

2021-05-26 22:04:13

by Rui Miguel Silva

[permalink] [raw]
Subject: Re: [PATCH 06/24] usb: isp1760: isp1760-udc: Provide missing description for 'udc' param

Hi Lee,
On Wed May 26, 2021 at 2:00 PM WEST, Lee Jones wrote:

> Fixes the following W=1 kernel build warning(s):
>
> drivers/usb/isp1760/isp1760-udc.c:150: warning: Function parameter or member 'udc' not described in 'isp1760_udc_select_ep'
>
> Cc: Greg Kroah-Hartman <[email protected]>
> Cc: Rui Miguel Silva <[email protected]>
> Cc: Laurent Pinchart <[email protected]>
> Cc: [email protected]
> Signed-off-by: Lee Jones <[email protected]>
> ---
> drivers/usb/isp1760/isp1760-udc.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/usb/isp1760/isp1760-udc.c b/drivers/usb/isp1760/isp1760-udc.c
> index 3e05e36054357..a78da59d6417b 100644
> --- a/drivers/usb/isp1760/isp1760-udc.c
> +++ b/drivers/usb/isp1760/isp1760-udc.c
> @@ -137,6 +137,7 @@ static void __isp1760_udc_select_ep(struct isp1760_udc *udc,
> /**
> * isp1760_udc_select_ep - Select an endpoint for register access
> * @ep: The endpoint
> + * @udc: Reference to the device controller

I had this in my latest patch set, but got lost, thanks for fixing
this.

I'd like to ask you to swap the order to match the order in which
the args appear in the function declaration.

With this changed you can add my:
Reviewed-by: Rui Miguel Silva <[email protected]>

------
Cheers,
Rui


> *
> * The ISP1761 endpoint registers are banked. This function selects the target
> * endpoint for banked register access. The selection remains valid until the
> --
> 2.31.1



2021-05-26 22:06:42

by Heikki Krogerus

[permalink] [raw]
Subject: Re: [PATCH 03/24] usb: common: ulpi: Add leading underscores for function name '__ulpi_register_driver()'

On Wed, May 26, 2021 at 02:00:16PM +0100, Lee Jones wrote:
> Fixes the following W=1 kernel build warning(s):
>
> drivers/usb/common/ulpi.c:151: warning: expecting prototype for ulpi_register_driver(). Prototype was for __ulpi_register_driver() instead
>
> Cc: Heikki Krogerus <[email protected]>
> Cc: Greg Kroah-Hartman <[email protected]>
> Cc: [email protected]
> Signed-off-by: Lee Jones <[email protected]>

Reviewed-by: Heikki Krogerus <[email protected]>

> ---
> drivers/usb/common/ulpi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/common/ulpi.c b/drivers/usb/common/ulpi.c
> index ce5e6f6711f79..7e13b74e60e5a 100644
> --- a/drivers/usb/common/ulpi.c
> +++ b/drivers/usb/common/ulpi.c
> @@ -141,7 +141,7 @@ static const struct device_type ulpi_dev_type = {
> /* -------------------------------------------------------------------------- */
>
> /**
> - * ulpi_register_driver - register a driver with the ULPI bus
> + * __ulpi_register_driver - register a driver with the ULPI bus
> * @drv: driver being registered
> * @module: ends up being THIS_MODULE
> *
> --
> 2.31.1

--
heikki

2021-05-26 22:26:31

by Minas Harutyunyan

[permalink] [raw]
Subject: Re: [PATCH 11/24] usb: dwc2: hcd_queue: Fix typeo in function name 'dwc2_hs_pmap_unschedule()'

On 5/26/2021 5:00 PM, Lee Jones wrote:
> Fixes the following W=1 kernel build warning(s):
>
> drivers/usb/dwc2/hcd_queue.c:686: warning: expecting prototype for dwc2_ls_pmap_unschedule(). Prototype was for dwc2_hs_pmap_unschedule() instead
>
> Cc: Minas Harutyunyan <[email protected]>
> Cc: Greg Kroah-Hartman <[email protected]>
> Cc: [email protected]
> Signed-off-by: Lee Jones <[email protected]>


Acked-by: Minas Harutyunyan <[email protected]>


> ---
> drivers/usb/dwc2/hcd_queue.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/dwc2/hcd_queue.c b/drivers/usb/dwc2/hcd_queue.c
> index 621a4846bd05a..89a788326c562 100644
> --- a/drivers/usb/dwc2/hcd_queue.c
> +++ b/drivers/usb/dwc2/hcd_queue.c
> @@ -675,7 +675,7 @@ static int dwc2_hs_pmap_schedule(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh,
> }
>
> /**
> - * dwc2_ls_pmap_unschedule() - Undo work done by dwc2_hs_pmap_schedule()
> + * dwc2_hs_pmap_unschedule() - Undo work done by dwc2_hs_pmap_schedule()
> *
> * @hsotg: The HCD state structure for the DWC OTG controller.
> * @qh: QH for the periodic transfer.
>

2021-05-26 22:26:55

by Minas Harutyunyan

[permalink] [raw]
Subject: Re: [PATCH 12/24] usb: dwc2: pci: Fix possible copy/paste issue

On 5/26/2021 5:00 PM, Lee Jones wrote:
> Fixes the following W=1 kernel build warning(s):
>
> drivers/usb/dwc2/pci.c:73: warning: expecting prototype for dwc2_pci_probe(). Prototype was for dwc2_pci_remove() instead
>
> Cc: Minas Harutyunyan <[email protected]>
> Cc: Greg Kroah-Hartman <[email protected]>
> Cc: [email protected]
> Signed-off-by: Lee Jones <[email protected]>


Acked-by: Minas Harutyunyan <[email protected]>


> ---
> drivers/usb/dwc2/pci.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/dwc2/pci.c b/drivers/usb/dwc2/pci.c
> index 0000151e3ca96..a93559b4ecdbc 100644
> --- a/drivers/usb/dwc2/pci.c
> +++ b/drivers/usb/dwc2/pci.c
> @@ -64,7 +64,7 @@ struct dwc2_pci_glue {
> };
>
> /**
> - * dwc2_pci_probe() - Provides the cleanup entry points for the DWC_otg PCI
> + * dwc2_pci_remove() - Provides the cleanup entry points for the DWC_otg PCI
> * driver
> *
> * @pci: The programming view of DWC_otg PCI
>

2021-05-27 04:59:00

by Peter Chen

[permalink] [raw]
Subject: Re: [PATCH 00/24] Rid W=1 warnings from USB

On 21-05-26 14:00:13, Lee Jones wrote:
> This set is part of a larger effort attempting to clean-up W=1
> kernel builds, which are currently overwhelmingly riddled with
> niggly little warnings.

For chipidea and cdns3 parts:

Acked-by: Peter Chen <[email protected]>

Peter
>
> Lee Jones (24):
> usb: cdns3: core: Fix a couple of incorrectly documented function
> names
> usb: dwc2: platform: Provide function name for
> 'dwc2_check_core_version()'
> usb: common: ulpi: Add leading underscores for function name
> '__ulpi_register_driver()'
> usb: cdns3: cdns3-plat: Fix incorrect naming of function
> 'cdns3_plat_remove()'
> usb: dwc2: params: Fix naming of 'dwc2_get_hwparams()' in the docs
> usb: isp1760: isp1760-udc: Provide missing description for 'udc' param
> usb: cdns3: cdns3-gadget: Fix a bunch of kernel-doc related formatting
> issues
> usb: cdns3: cdns3-ti: File headers are not good candidates for
> kernel-doc
> usb: cdns3: cdns3-ep0: Fix a few kernel-doc formatting issues
> usb: cdns3: cdns3-imx: File headers are not good candidates for
> kernel-doc
> usb: dwc2: hcd_queue: Fix typeo in function name
> 'dwc2_hs_pmap_unschedule()'
> usb: dwc2: pci: Fix possible copy/paste issue
> usb: chipidea: core: Fix incorrectly documented function
> 'ci_usb_phy_exit()'
> usb: chipidea: otg: Fix formatting and missing documentation issues
> usb: dwc2: gadget: Repair 'dwc2_hsotg_core_init_disconnected()'s
> documentation
> usb: chipidea: udc: Fix incorrectly documented function
> 'hw_port_is_high_speed()'
> usb: host: xhci: Remove unused variable 'len'
> usb: gadget: udc: pxa27x_udc: Fix documentation for
> 'pxa27x_udc_start()'
> usb: gadget: udc: udc-xilinx: Place correct function names into the
> headers
> usb: cdns3: cdns3-gadget: Provide correct function naming for
> '__cdns3_gadget_ep_queue()'
> usb: host: xhci: Move array of structs from the stack onto the heap
> usb: host: xhci: Document xhci_get_endpoint_index()'s 'desc' param
> usb: cdns3: cdnsp-gadget: Provide function name for
> 'cdnsp_find_next_ext_cap()'
> usb: typec: ucsi: Fix copy/paste issue for 'ucsi_set_drvdata()'
>
> drivers/usb/cdns3/cdns3-ep0.c | 6 ++---
> drivers/usb/cdns3/cdns3-gadget.c | 34 ++++++++++++++---------------
> drivers/usb/cdns3/cdns3-imx.c | 2 +-
> drivers/usb/cdns3/cdns3-plat.c | 2 +-
> drivers/usb/cdns3/cdns3-ti.c | 2 +-
> drivers/usb/cdns3/cdnsp-gadget.c | 3 ++-
> drivers/usb/cdns3/core.c | 4 ++--
> drivers/usb/chipidea/core.c | 2 +-
> drivers/usb/chipidea/otg.c | 9 ++++----
> drivers/usb/chipidea/udc.c | 2 +-
> drivers/usb/common/ulpi.c | 2 +-
> drivers/usb/dwc2/gadget.c | 2 +-
> drivers/usb/dwc2/hcd_queue.c | 2 +-
> drivers/usb/dwc2/params.c | 4 ++--
> drivers/usb/dwc2/pci.c | 2 +-
> drivers/usb/dwc2/platform.c | 2 +-
> drivers/usb/gadget/udc/pxa27x_udc.c | 2 +-
> drivers/usb/gadget/udc/udc-xilinx.c | 4 ++--
> drivers/usb/host/xhci.c | 19 +++++++++++-----
> drivers/usb/isp1760/isp1760-udc.c | 1 +
> drivers/usb/typec/ucsi/ucsi.c | 2 +-
> 21 files changed, 59 insertions(+), 49 deletions(-)
>
> Cc: Aswath Govindraju <[email protected]>
> Cc: Ben Dooks <[email protected]>
> Cc: Daniel Mack <[email protected]>
> Cc: David Lopo <[email protected]>
> Cc: Fabio Estevam <[email protected]>
> Cc: Felipe Balbi <[email protected]>
> Cc: Greg Kroah-Hartman <[email protected]>
> Cc: Haojian Zhuang <[email protected]>
> Cc: Heikki Krogerus <[email protected]>
> Cc: Laurent Pinchart <[email protected]>
> Cc: Liam Girdwood <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: Mark Brown <[email protected]>
> Cc: Mathias Nyman <[email protected]>
> Cc: Matthijs Kooijman <[email protected]>
> Cc: Michal Simek <[email protected]>
> Cc: Minas Harutyunyan <[email protected]>
> Cc: NXP Linux Team <[email protected]>
> Cc: Pawel Jez <[email protected]>
> Cc: Pawel Laszczak <[email protected]>
> Cc: Pengutronix Kernel Team <[email protected]>
> Cc: Peter Chen <[email protected]>
> Cc: Philipp Zabel <[email protected]>
> Cc: Robert Jarzmik <[email protected]>
> Cc: Roger Quadros <[email protected]>
> Cc: Rui Miguel Silva <[email protected]>
> Cc: Sascha Hauer <[email protected]>
> Cc: Shawn Guo <[email protected]>
> --
> 2.31.1
>

--

Thanks,
Peter Chen

2021-05-27 08:19:50

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 17/24] usb: host: xhci: Remove unused variable 'len'

On Thu, 27 May 2021, Greg Kroah-Hartman wrote:

> On Wed, May 26, 2021 at 02:00:30PM +0100, Lee Jones wrote:
> > Fixes the following W=1 kernel build warning(s):
> >
> > drivers/usb/host/xhci.c: In function ‘xhci_unmap_temp_buf’:
> > drivers/usb/host/xhci.c:1349:15: warning: variable ‘len’ set but not used [-Wunused-but-set-variable]
> >
> > Cc: Mathias Nyman <[email protected]>
> > Cc: Greg Kroah-Hartman <[email protected]>
> > Cc: [email protected]
> > Signed-off-by: Lee Jones <[email protected]>
> > ---
> > drivers/usb/host/xhci.c | 9 ++++-----
> > 1 file changed, 4 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
> > index 27283654ca080..ac2a7d4288883 100644
> > --- a/drivers/usb/host/xhci.c
> > +++ b/drivers/usb/host/xhci.c
> > @@ -1346,7 +1346,6 @@ static bool xhci_urb_temp_buffer_required(struct usb_hcd *hcd,
> >
> > static void xhci_unmap_temp_buf(struct usb_hcd *hcd, struct urb *urb)
> > {
> > - unsigned int len;
> > unsigned int buf_len;
> > enum dma_data_direction dir;
> >
> > @@ -1362,10 +1361,10 @@ static void xhci_unmap_temp_buf(struct usb_hcd *hcd, struct urb *urb)
> > dir);
> >
> > if (usb_urb_dir_in(urb))
> > - len = sg_pcopy_from_buffer(urb->sg, urb->num_sgs,
> > - urb->transfer_buffer,
> > - buf_len,
> > - 0);
> > + sg_pcopy_from_buffer(urb->sg, urb->num_sgs,
> > + urb->transfer_buffer,
> > + buf_len,
> > + 0);
>
> Sorry, but no, I keep rejecting this over and over, it needs to handle
> the error handling properly and not paper over it like this :(

Will fix.

> All the bots keep tripping up on it, you are not alone.

--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

2021-05-27 09:22:59

by Mathias Nyman

[permalink] [raw]
Subject: Re: [PATCH 17/24] usb: host: xhci: Remove unused variable 'len'

On 27.5.2021 11.16, Lee Jones wrote:
> On Thu, 27 May 2021, Greg Kroah-Hartman wrote:
>
>> On Wed, May 26, 2021 at 02:00:30PM +0100, Lee Jones wrote:
>>> Fixes the following W=1 kernel build warning(s):
>>>
>>> drivers/usb/host/xhci.c: In function ‘xhci_unmap_temp_buf’:
>>> drivers/usb/host/xhci.c:1349:15: warning: variable ‘len’ set but not used [-Wunused-but-set-variable]
>>>
>>> Cc: Mathias Nyman <[email protected]>
>>> Cc: Greg Kroah-Hartman <[email protected]>
>>> Cc: [email protected]
>>> Signed-off-by: Lee Jones <[email protected]>
>>> ---
>>> drivers/usb/host/xhci.c | 9 ++++-----
>>> 1 file changed, 4 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
>>> index 27283654ca080..ac2a7d4288883 100644
>>> --- a/drivers/usb/host/xhci.c
>>> +++ b/drivers/usb/host/xhci.c
>>> @@ -1346,7 +1346,6 @@ static bool xhci_urb_temp_buffer_required(struct usb_hcd *hcd,
>>>
>>> static void xhci_unmap_temp_buf(struct usb_hcd *hcd, struct urb *urb)
>>> {
>>> - unsigned int len;
>>> unsigned int buf_len;
>>> enum dma_data_direction dir;
>>>
>>> @@ -1362,10 +1361,10 @@ static void xhci_unmap_temp_buf(struct usb_hcd *hcd, struct urb *urb)
>>> dir);
>>>
>>> if (usb_urb_dir_in(urb))
>>> - len = sg_pcopy_from_buffer(urb->sg, urb->num_sgs,
>>> - urb->transfer_buffer,
>>> - buf_len,
>>> - 0);
>>> + sg_pcopy_from_buffer(urb->sg, urb->num_sgs,
>>> + urb->transfer_buffer,
>>> + buf_len,
>>> + 0);
>>
>> Sorry, but no, I keep rejecting this over and over, it needs to handle
>> the error handling properly and not paper over it like this :(
>
> Will fix.
>
>> All the bots keep tripping up on it, you are not alone.
>

This is getting a lot of attention. Something like this should fix it:

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 27283654ca08..306ab81421fd 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -1361,12 +1361,16 @@ static void xhci_unmap_temp_buf(struct usb_hcd *hcd, struct urb *urb)
urb->transfer_buffer_length,
dir);

- if (usb_urb_dir_in(urb))
+ if (usb_urb_dir_in(urb)) {
len = sg_pcopy_from_buffer(urb->sg, urb->num_sgs,
urb->transfer_buffer,
buf_len,
0);
-
+ if (len != buf_len) {
+ xhci_dbg(xhci, "Copy from tmp buf to urb sg list failed\n");
+ urb->actual_length = len;
+ }
+ }
urb->transfer_flags &= ~URB_DMA_MAP_SINGLE;
kfree(urb->transfer_buffer);
urb->transfer_buffer = NULL;

urb->actual_length is now properly set.
The debug level message will help me find the cause if we ever need
to debug oddly behaving devices.

Note this is a very rarly taken codepath for quirky xHC harware that
can't handle a specific sequence of buffer lengths queued.

I can write a proper commit message and push this forward

-Mathias

2021-05-27 09:51:19

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 17/24] usb: host: xhci: Remove unused variable 'len'

On Thu, May 27, 2021 at 12:23:24PM +0300, Mathias Nyman wrote:
> On 27.5.2021 11.16, Lee Jones wrote:
> > On Thu, 27 May 2021, Greg Kroah-Hartman wrote:
> >
> >> On Wed, May 26, 2021 at 02:00:30PM +0100, Lee Jones wrote:
> >>> Fixes the following W=1 kernel build warning(s):
> >>>
> >>> drivers/usb/host/xhci.c: In function ‘xhci_unmap_temp_buf’:
> >>> drivers/usb/host/xhci.c:1349:15: warning: variable ‘len’ set but not used [-Wunused-but-set-variable]
> >>>
> >>> Cc: Mathias Nyman <[email protected]>
> >>> Cc: Greg Kroah-Hartman <[email protected]>
> >>> Cc: [email protected]
> >>> Signed-off-by: Lee Jones <[email protected]>
> >>> ---
> >>> drivers/usb/host/xhci.c | 9 ++++-----
> >>> 1 file changed, 4 insertions(+), 5 deletions(-)
> >>>
> >>> diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
> >>> index 27283654ca080..ac2a7d4288883 100644
> >>> --- a/drivers/usb/host/xhci.c
> >>> +++ b/drivers/usb/host/xhci.c
> >>> @@ -1346,7 +1346,6 @@ static bool xhci_urb_temp_buffer_required(struct usb_hcd *hcd,
> >>>
> >>> static void xhci_unmap_temp_buf(struct usb_hcd *hcd, struct urb *urb)
> >>> {
> >>> - unsigned int len;
> >>> unsigned int buf_len;
> >>> enum dma_data_direction dir;
> >>>
> >>> @@ -1362,10 +1361,10 @@ static void xhci_unmap_temp_buf(struct usb_hcd *hcd, struct urb *urb)
> >>> dir);
> >>>
> >>> if (usb_urb_dir_in(urb))
> >>> - len = sg_pcopy_from_buffer(urb->sg, urb->num_sgs,
> >>> - urb->transfer_buffer,
> >>> - buf_len,
> >>> - 0);
> >>> + sg_pcopy_from_buffer(urb->sg, urb->num_sgs,
> >>> + urb->transfer_buffer,
> >>> + buf_len,
> >>> + 0);
> >>
> >> Sorry, but no, I keep rejecting this over and over, it needs to handle
> >> the error handling properly and not paper over it like this :(
> >
> > Will fix.
> >
> >> All the bots keep tripping up on it, you are not alone.
> >
>
> This is getting a lot of attention. Something like this should fix it:
>
> diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
> index 27283654ca08..306ab81421fd 100644
> --- a/drivers/usb/host/xhci.c
> +++ b/drivers/usb/host/xhci.c
> @@ -1361,12 +1361,16 @@ static void xhci_unmap_temp_buf(struct usb_hcd *hcd, struct urb *urb)
> urb->transfer_buffer_length,
> dir);
>
> - if (usb_urb_dir_in(urb))
> + if (usb_urb_dir_in(urb)) {
> len = sg_pcopy_from_buffer(urb->sg, urb->num_sgs,
> urb->transfer_buffer,
> buf_len,
> 0);
> -
> + if (len != buf_len) {
> + xhci_dbg(xhci, "Copy from tmp buf to urb sg list failed\n");
> + urb->actual_length = len;
> + }
> + }
> urb->transfer_flags &= ~URB_DMA_MAP_SINGLE;
> kfree(urb->transfer_buffer);
> urb->transfer_buffer = NULL;
>
> urb->actual_length is now properly set.
> The debug level message will help me find the cause if we ever need
> to debug oddly behaving devices.
>
> Note this is a very rarly taken codepath for quirky xHC harware that
> can't handle a specific sequence of buffer lengths queued.
>
> I can write a proper commit message and push this forward

That looks good, I kept waiting for one of the people who kept trying to
report "build warning fixes" to do it right, but I'll gladly take it
from you as well :)

thanks,

greg k-h

2021-05-27 14:41:00

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 17/24] usb: host: xhci: Remove unused variable 'len'

On Wed, May 26, 2021 at 02:00:30PM +0100, Lee Jones wrote:
> Fixes the following W=1 kernel build warning(s):
>
> drivers/usb/host/xhci.c: In function ‘xhci_unmap_temp_buf’:
> drivers/usb/host/xhci.c:1349:15: warning: variable ‘len’ set but not used [-Wunused-but-set-variable]
>
> Cc: Mathias Nyman <[email protected]>
> Cc: Greg Kroah-Hartman <[email protected]>
> Cc: [email protected]
> Signed-off-by: Lee Jones <[email protected]>
> ---
> drivers/usb/host/xhci.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
> index 27283654ca080..ac2a7d4288883 100644
> --- a/drivers/usb/host/xhci.c
> +++ b/drivers/usb/host/xhci.c
> @@ -1346,7 +1346,6 @@ static bool xhci_urb_temp_buffer_required(struct usb_hcd *hcd,
>
> static void xhci_unmap_temp_buf(struct usb_hcd *hcd, struct urb *urb)
> {
> - unsigned int len;
> unsigned int buf_len;
> enum dma_data_direction dir;
>
> @@ -1362,10 +1361,10 @@ static void xhci_unmap_temp_buf(struct usb_hcd *hcd, struct urb *urb)
> dir);
>
> if (usb_urb_dir_in(urb))
> - len = sg_pcopy_from_buffer(urb->sg, urb->num_sgs,
> - urb->transfer_buffer,
> - buf_len,
> - 0);
> + sg_pcopy_from_buffer(urb->sg, urb->num_sgs,
> + urb->transfer_buffer,
> + buf_len,
> + 0);

Sorry, but no, I keep rejecting this over and over, it needs to handle
the error handling properly and not paper over it like this :(

All the bots keep tripping up on it, you are not alone.

thanks,

greg k-h

2021-05-27 15:47:03

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 17/24] usb: host: xhci: Remove unused variable 'len'

On Thu, 27 May 2021, Mathias Nyman wrote:

> On 27.5.2021 11.16, Lee Jones wrote:
> > On Thu, 27 May 2021, Greg Kroah-Hartman wrote:
> >
> >> On Wed, May 26, 2021 at 02:00:30PM +0100, Lee Jones wrote:
> >>> Fixes the following W=1 kernel build warning(s):
> >>>
> >>> drivers/usb/host/xhci.c: In function ‘xhci_unmap_temp_buf’:
> >>> drivers/usb/host/xhci.c:1349:15: warning: variable ‘len’ set but not used [-Wunused-but-set-variable]
> >>>
> >>> Cc: Mathias Nyman <[email protected]>
> >>> Cc: Greg Kroah-Hartman <[email protected]>
> >>> Cc: [email protected]
> >>> Signed-off-by: Lee Jones <[email protected]>
> >>> ---
> >>> drivers/usb/host/xhci.c | 9 ++++-----
> >>> 1 file changed, 4 insertions(+), 5 deletions(-)
> >>>
> >>> diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
> >>> index 27283654ca080..ac2a7d4288883 100644
> >>> --- a/drivers/usb/host/xhci.c
> >>> +++ b/drivers/usb/host/xhci.c
> >>> @@ -1346,7 +1346,6 @@ static bool xhci_urb_temp_buffer_required(struct usb_hcd *hcd,
> >>>
> >>> static void xhci_unmap_temp_buf(struct usb_hcd *hcd, struct urb *urb)
> >>> {
> >>> - unsigned int len;
> >>> unsigned int buf_len;
> >>> enum dma_data_direction dir;
> >>>
> >>> @@ -1362,10 +1361,10 @@ static void xhci_unmap_temp_buf(struct usb_hcd *hcd, struct urb *urb)
> >>> dir);
> >>>
> >>> if (usb_urb_dir_in(urb))
> >>> - len = sg_pcopy_from_buffer(urb->sg, urb->num_sgs,
> >>> - urb->transfer_buffer,
> >>> - buf_len,
> >>> - 0);
> >>> + sg_pcopy_from_buffer(urb->sg, urb->num_sgs,
> >>> + urb->transfer_buffer,
> >>> + buf_len,
> >>> + 0);
> >>
> >> Sorry, but no, I keep rejecting this over and over, it needs to handle
> >> the error handling properly and not paper over it like this :(
> >
> > Will fix.
> >
> >> All the bots keep tripping up on it, you are not alone.
> >
>
> This is getting a lot of attention. Something like this should fix it:
>
> diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
> index 27283654ca08..306ab81421fd 100644
> --- a/drivers/usb/host/xhci.c
> +++ b/drivers/usb/host/xhci.c
> @@ -1361,12 +1361,16 @@ static void xhci_unmap_temp_buf(struct usb_hcd *hcd, struct urb *urb)
> urb->transfer_buffer_length,
> dir);
>
> - if (usb_urb_dir_in(urb))
> + if (usb_urb_dir_in(urb)) {
> len = sg_pcopy_from_buffer(urb->sg, urb->num_sgs,
> urb->transfer_buffer,
> buf_len,
> 0);
> -
> + if (len != buf_len) {
> + xhci_dbg(xhci, "Copy from tmp buf to urb sg list failed\n");
> + urb->actual_length = len;
> + }
> + }
> urb->transfer_flags &= ~URB_DMA_MAP_SINGLE;
> kfree(urb->transfer_buffer);
> urb->transfer_buffer = NULL;
>
> urb->actual_length is now properly set.
> The debug level message will help me find the cause if we ever need
> to debug oddly behaving devices.
>
> Note this is a very rarly taken codepath for quirky xHC harware that
> can't handle a specific sequence of buffer lengths queued.
>
> I can write a proper commit message and push this forward

Okay by me.

--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

2021-05-27 20:48:26

by Mathias Nyman

[permalink] [raw]
Subject: Re: [PATCH 21/24] usb: host: xhci: Move array of structs from the stack onto the heap

On 26.5.2021 18.28, Lee Jones wrote:
> On Wed, 26 May 2021, Sergei Shtylyov wrote:
>
>> On 5/26/21 5:44 PM, Lee Jones wrote:
>>
>> [...]
>>>>> Fixes the following W=1 kernel build warning(s):
>>>>>
>>>>> drivers/usb/host/xhci.c: In function ‘xhci_reserve_bandwidth’:
>>>>> drivers/usb/host/xhci.c:2859:1: warning: the frame size of 1032 bytes is larger than 1024 bytes [-Wframe-larger-than=]
>>>>>
>>>>> Cc: Mathias Nyman <[email protected]>
>>>>> Cc: Greg Kroah-Hartman <[email protected]>
>>>>> Cc: [email protected]
>>>>> Signed-off-by: Lee Jones <[email protected]>
>>>>> ---
>>>>> drivers/usb/host/xhci.c | 8 +++++++-
>>>>> 1 file changed, 7 insertions(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
>>>>> index ac2a7d4288883..40ce4b4eb12ad 100644
>>>>> --- a/drivers/usb/host/xhci.c
>>>>> +++ b/drivers/usb/host/xhci.c
>>>> [...]
>>>>> @@ -2788,6 +2788,10 @@ static int xhci_reserve_bandwidth(struct xhci_hcd *xhci,
>>>>> return -ENOMEM;
>>>>> }
>>>>>
>>>>> + ep_bw_info = kzalloc(sizeof(*ep_bw_info) * 31, GFP_KERNEL);

GFP_KERNEL might not be suitable for all cases.

xhci_reserve_bandwidth() is called from xhci_configure_endpoint(), which again
is called from a lot of places.
For example from xhci_update_hub_device() which can be called with GFP_NOIO mem_flags.

-Mathias

2021-06-01 09:26:59

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 21/24] usb: host: xhci: Move array of structs from the stack onto the heap

On Thu, 27 May 2021, Mathias Nyman wrote:

> On 26.5.2021 18.28, Lee Jones wrote:
> > On Wed, 26 May 2021, Sergei Shtylyov wrote:
> >
> >> On 5/26/21 5:44 PM, Lee Jones wrote:
> >>
> >> [...]
> >>>>> Fixes the following W=1 kernel build warning(s):
> >>>>>
> >>>>> drivers/usb/host/xhci.c: In function ‘xhci_reserve_bandwidth’:
> >>>>> drivers/usb/host/xhci.c:2859:1: warning: the frame size of 1032 bytes is larger than 1024 bytes [-Wframe-larger-than=]
> >>>>>
> >>>>> Cc: Mathias Nyman <[email protected]>
> >>>>> Cc: Greg Kroah-Hartman <[email protected]>
> >>>>> Cc: [email protected]
> >>>>> Signed-off-by: Lee Jones <[email protected]>
> >>>>> ---
> >>>>> drivers/usb/host/xhci.c | 8 +++++++-
> >>>>> 1 file changed, 7 insertions(+), 1 deletion(-)
> >>>>>
> >>>>> diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
> >>>>> index ac2a7d4288883..40ce4b4eb12ad 100644
> >>>>> --- a/drivers/usb/host/xhci.c
> >>>>> +++ b/drivers/usb/host/xhci.c
> >>>> [...]
> >>>>> @@ -2788,6 +2788,10 @@ static int xhci_reserve_bandwidth(struct xhci_hcd *xhci,
> >>>>> return -ENOMEM;
> >>>>> }
> >>>>>
> >>>>> + ep_bw_info = kzalloc(sizeof(*ep_bw_info) * 31, GFP_KERNEL);
>
> GFP_KERNEL might not be suitable for all cases.
>
> xhci_reserve_bandwidth() is called from xhci_configure_endpoint(), which again
> is called from a lot of places.
> For example from xhci_update_hub_device() which can be called with GFP_NOIO mem_flags.

What do you suggest as an alternative?

--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

2021-06-22 10:51:29

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 21/24] usb: host: xhci: Move array of structs from the stack onto the heap

On Tue, 01 Jun 2021, Lee Jones wrote:

> On Thu, 27 May 2021, Mathias Nyman wrote:
>
> > On 26.5.2021 18.28, Lee Jones wrote:
> > > On Wed, 26 May 2021, Sergei Shtylyov wrote:
> > >
> > >> On 5/26/21 5:44 PM, Lee Jones wrote:
> > >>
> > >> [...]
> > >>>>> Fixes the following W=1 kernel build warning(s):
> > >>>>>
> > >>>>> drivers/usb/host/xhci.c: In function ‘xhci_reserve_bandwidth’:
> > >>>>> drivers/usb/host/xhci.c:2859:1: warning: the frame size of 1032 bytes is larger than 1024 bytes [-Wframe-larger-than=]
> > >>>>>
> > >>>>> Cc: Mathias Nyman <[email protected]>
> > >>>>> Cc: Greg Kroah-Hartman <[email protected]>
> > >>>>> Cc: [email protected]
> > >>>>> Signed-off-by: Lee Jones <[email protected]>
> > >>>>> ---
> > >>>>> drivers/usb/host/xhci.c | 8 +++++++-
> > >>>>> 1 file changed, 7 insertions(+), 1 deletion(-)
> > >>>>>
> > >>>>> diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
> > >>>>> index ac2a7d4288883..40ce4b4eb12ad 100644
> > >>>>> --- a/drivers/usb/host/xhci.c
> > >>>>> +++ b/drivers/usb/host/xhci.c
> > >>>> [...]
> > >>>>> @@ -2788,6 +2788,10 @@ static int xhci_reserve_bandwidth(struct xhci_hcd *xhci,
> > >>>>> return -ENOMEM;
> > >>>>> }
> > >>>>>
> > >>>>> + ep_bw_info = kzalloc(sizeof(*ep_bw_info) * 31, GFP_KERNEL);
> >
> > GFP_KERNEL might not be suitable for all cases.
> >
> > xhci_reserve_bandwidth() is called from xhci_configure_endpoint(), which again
> > is called from a lot of places.
> > For example from xhci_update_hub_device() which can be called with GFP_NOIO mem_flags.
>
> What do you suggest as an alternative?

Just working on rectifying this now.

Which Get Free Page flag do you suggest here please?

--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

2021-06-22 11:32:34

by Mathias Nyman

[permalink] [raw]
Subject: Re: [PATCH 21/24] usb: host: xhci: Move array of structs from the stack onto the heap

On 22.6.2021 13.47, Lee Jones wrote:
> On Tue, 01 Jun 2021, Lee Jones wrote:
>
>> On Thu, 27 May 2021, Mathias Nyman wrote:
>>
>>> On 26.5.2021 18.28, Lee Jones wrote:
>>>> On Wed, 26 May 2021, Sergei Shtylyov wrote:
>>>>
>>>>> On 5/26/21 5:44 PM, Lee Jones wrote:
>>>>>
>>>>> [...]
>>>>>>>> Fixes the following W=1 kernel build warning(s):
>>>>>>>>
>>>>>>>> drivers/usb/host/xhci.c: In function ‘xhci_reserve_bandwidth’:
>>>>>>>> drivers/usb/host/xhci.c:2859:1: warning: the frame size of 1032 bytes is larger than 1024 bytes [-Wframe-larger-than=]
>>>>>>>>
>>>>>>>> Cc: Mathias Nyman <[email protected]>
>>>>>>>> Cc: Greg Kroah-Hartman <[email protected]>
>>>>>>>> Cc: [email protected]
>>>>>>>> Signed-off-by: Lee Jones <[email protected]>
>>>>>>>> ---
>>>>>>>> drivers/usb/host/xhci.c | 8 +++++++-
>>>>>>>> 1 file changed, 7 insertions(+), 1 deletion(-)
>>>>>>>>
>>>>>>>> diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
>>>>>>>> index ac2a7d4288883..40ce4b4eb12ad 100644
>>>>>>>> --- a/drivers/usb/host/xhci.c
>>>>>>>> +++ b/drivers/usb/host/xhci.c
>>>>>>> [...]
>>>>>>>> @@ -2788,6 +2788,10 @@ static int xhci_reserve_bandwidth(struct xhci_hcd *xhci,
>>>>>>>> return -ENOMEM;
>>>>>>>> }
>>>>>>>>
>>>>>>>> + ep_bw_info = kzalloc(sizeof(*ep_bw_info) * 31, GFP_KERNEL);
>>>
>>> GFP_KERNEL might not be suitable for all cases.
>>>
>>> xhci_reserve_bandwidth() is called from xhci_configure_endpoint(), which again
>>> is called from a lot of places.
>>> For example from xhci_update_hub_device() which can be called with GFP_NOIO mem_flags.
>>
>> What do you suggest as an alternative?
>
> Just working on rectifying this now.
>
> Which Get Free Page flag do you suggest here please?
>

xhci_reserve_bandwidth() is called with spin lock held, so probably GFP_ATOMIC

But that whole function would need more attention.
It's always consuming 31 * sizeof(*ep_bw_info) bytes to store fallback values.
Normal use case is that just one, or a couple endpoints are changing, and we know which ones do.

-Mathias


just one enpoint changing.