[PATCH] usb: cdns3: include host-export,h for cdns3_host_init

2019-10-17 Thread Ben Dooks (Codethink)
The cdns3_host_init() function is declared in host-export.h
but host.c does not include it. Add the include to have
the declaration present (and remove the declaration of
cdns3_host_exit which is now static).

Fixes the following sparse warning:

drivers/usb/cdns3/host.c:58:5: warning: symbol 'cdns3_host_init' was not 
declared. Should it be static?

Signed-off-by: Ben Dooks 
---
Cc: Greg Kroah-Hartman 
Cc: Pawel Laszczak 
Cc: Felipe Balbi 
Cc: "Ben Dooks
Cc: linux-usb@vger.kernel.org
---
 drivers/usb/cdns3/host-export.h | 1 -
 drivers/usb/cdns3/host.c| 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/cdns3/host-export.h b/drivers/usb/cdns3/host-export.h
index b498a170b7e8..ae11810f8826 100644
--- a/drivers/usb/cdns3/host-export.h
+++ b/drivers/usb/cdns3/host-export.h
@@ -12,7 +12,6 @@
 #ifdef CONFIG_USB_CDNS3_HOST
 
 int cdns3_host_init(struct cdns3 *cdns);
-void cdns3_host_exit(struct cdns3 *cdns);
 
 #else
 
diff --git a/drivers/usb/cdns3/host.c b/drivers/usb/cdns3/host.c
index 2733a8f71fcd..ad788bf3fe4f 100644
--- a/drivers/usb/cdns3/host.c
+++ b/drivers/usb/cdns3/host.c
@@ -12,6 +12,7 @@
 #include 
 #include "core.h"
 #include "drd.h"
+#include "host-export.h"
 
 static int __cdns3_host_init(struct cdns3 *cdns)
 {
-- 
2.23.0



Re: [PATCH v2] usbip: tools: Fix read_usb_vudc_device() error path handling

2019-10-17 Thread shuah

On 10/16/19 11:26 PM, GwanYeong Kim wrote:

On Wed, 16 Oct 2019 20:33:39 -0600
shuah  wrote:


On 10/16/19 8:25 PM, GwanYeong Kim wrote:

cannot be less than 0 - fread() returns 0 on error.



This isn't really accurate right. fread() doesn't always
return 0 in error. It could return < number of elements
and set errno.

Please make changes to reflect that.


Will reflect this.




Signed-off-by: GwanYeong Kim 
---
   tools/usb/usbip/libsrc/usbip_device_driver.c | 4 ++--
   1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/usb/usbip/libsrc/usbip_device_driver.c
b/tools/usb/usbip/libsrc/usbip_device_driver.c index
051d7d3f443b..959bb29d0477 100644 ---
a/tools/usb/usbip/libsrc/usbip_device_driver.c +++
b/tools/usb/usbip/libsrc/usbip_device_driver.c @@ -69,7 +69,7 @@
int read_usb_vudc_device(struct udev_device *sdev, struct
usbip_usb_device *dev) FILE *fd = NULL; struct udev_device *plat;
const char *speed;
-   int ret = 0;
+   size_t ret = 0;


You don't need to initialize this.


Exactly, because "ret" variable receives a "fread()" return value,



   
   	plat = udev_device_get_parent(sdev);

path = udev_device_get_syspath(plat);
@@ -79,7 +79,7 @@ int read_usb_vudc_device(struct udev_device
*sdev, struct usbip_usb_device *dev) if (!fd)
return -1;
ret = fread((char *) &descr, sizeof(descr), 1, fd);
-   if (ret < 0)
+   if (ret != 1)


Why not print error message?



Sorry, I'll add a message.

How about this?

err("Cannot read vudc device descr file");


Using strerror() with errno gives you more information. Add that
to them essage you proposed.

thanks,
-- Shuah


[PATCH] usb: host: oxu210hp-hcd: fix __iomem annotations

2019-10-17 Thread Ben Dooks (Codethink)
There are a number of places in the driver where it fails
to maintain __iomem on pointers used to access registers
so fixup the warnings by adding these in the appropriate
places.

Examples of the sparse warnings fixed:

drivers/usb/host/oxu210hp-hcd.c:686:9: warning: incorrect type in argument 2 
(different address spaces)
drivers/usb/host/oxu210hp-hcd.c:686:9:expected void volatile [noderef] 
 *addr
drivers/usb/host/oxu210hp-hcd.c:686:9:got void *
drivers/usb/host/oxu210hp-hcd.c:686:9: warning: incorrect type in argument 2 
(different address spaces)
drivers/usb/host/oxu210hp-hcd.c:686:9:expected void volatile [noderef] 
 *addr
drivers/usb/host/oxu210hp-hcd.c:686:9:got void *
drivers/usb/host/oxu210hp-hcd.c:686:9: warning: incorrect type in argument 2 
(different address spaces)
drivers/usb/host/oxu210hp-hcd.c:686:9:expected void volatile [noderef] 
 *addr
drivers/usb/host/oxu210hp-hcd.c:686:9:got void *
drivers/usb/host/oxu210hp-hcd.c:681:16: warning: incorrect type in argument 1 
(different address spaces)
drivers/usb/host/oxu210hp-hcd.c:681:16:expected void const volatile 
[noderef]  *addr
drivers/usb/host/oxu210hp-hcd.c:681:16:got void *

Signed-off-by: Ben Dooks 
---
Cc: Greg Kroah-Hartman 
Cc: linux-usb@vger.kernel.org
---
 drivers/usb/host/oxu210hp-hcd.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/usb/host/oxu210hp-hcd.c b/drivers/usb/host/oxu210hp-hcd.c
index e67242e437ed..fe09b8626329 100644
--- a/drivers/usb/host/oxu210hp-hcd.c
+++ b/drivers/usb/host/oxu210hp-hcd.c
@@ -676,12 +676,12 @@ static int oxu_hub_control(struct usb_hcd *hcd,
  */
 
 /* Low level read/write registers functions */
-static inline u32 oxu_readl(void *base, u32 reg)
+static inline u32 oxu_readl(void __iomem *base, u32 reg)
 {
return readl(base + reg);
 }
 
-static inline void oxu_writel(void *base, u32 reg, u32 val)
+static inline void oxu_writel(void __iomem *base, u32 reg, u32 val)
 {
writel(val, base + reg);
 }
@@ -4063,7 +4063,7 @@ static const struct hc_driver oxu_hc_driver = {
  * Module stuff
  */
 
-static void oxu_configuration(struct platform_device *pdev, void *base)
+static void oxu_configuration(struct platform_device *pdev, void __iomem *base)
 {
u32 tmp;
 
@@ -4093,7 +4093,7 @@ static void oxu_configuration(struct platform_device 
*pdev, void *base)
oxu_writel(base, OXU_CHIPIRQEN_SET, OXU_USBSPHLPWUI | OXU_USBOTGLPWUI);
 }
 
-static int oxu_verify_id(struct platform_device *pdev, void *base)
+static int oxu_verify_id(struct platform_device *pdev, void __iomem *base)
 {
u32 id;
static const char * const bo[] = {
@@ -4121,7 +4121,7 @@ static int oxu_verify_id(struct platform_device *pdev, 
void *base)
 static const struct hc_driver oxu_hc_driver;
 static struct usb_hcd *oxu_create(struct platform_device *pdev,
unsigned long memstart, unsigned long memlen,
-   void *base, int irq, int otg)
+   void __iomem *base, int irq, int otg)
 {
struct device *dev = &pdev->dev;
 
@@ -4158,7 +4158,7 @@ static struct usb_hcd *oxu_create(struct platform_device 
*pdev,
 
 static int oxu_init(struct platform_device *pdev,
unsigned long memstart, unsigned long memlen,
-   void *base, int irq)
+   void __iomem *base, int irq)
 {
struct oxu_info *info = platform_get_drvdata(pdev);
struct usb_hcd *hcd;
@@ -4207,7 +4207,7 @@ static int oxu_init(struct platform_device *pdev,
 static int oxu_drv_probe(struct platform_device *pdev)
 {
struct resource *res;
-   void *base;
+   void __iomem *base;
unsigned long memstart, memlen;
int irq, ret;
struct oxu_info *info;
-- 
2.23.0



[PATCH] usb: mtu3: fix missing include of mtu3_dr.h

2019-10-17 Thread Ben Dooks (Codethink)
The declarations of ssusb_gadget_{init,exit} are
in the mtu3_dr.h file but the code does that implements
them does not include this. Add the include to fix the
following sparse warnigns:

drivers/usb/mtu3/mtu3_core.c:825:5: warning: symbol 'ssusb_gadget_init' was not 
declared. Should it be static?
drivers/usb/mtu3/mtu3_core.c:925:6: warning: symbol 'ssusb_gadget_exit' was not 
declared. Should it be static?

Signed-off-by: Ben Dooks 
---
Cc: Chunfeng Yun 
Cc: Greg Kroah-Hartman 
Cc: linux-usb@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-media...@lists.infradead.org
---
 drivers/usb/mtu3/mtu3_core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/mtu3/mtu3_core.c b/drivers/usb/mtu3/mtu3_core.c
index c3d5c1206eec..9dd02160cca9 100644
--- a/drivers/usb/mtu3/mtu3_core.c
+++ b/drivers/usb/mtu3/mtu3_core.c
@@ -16,6 +16,7 @@
 #include 
 
 #include "mtu3.h"
+#include "mtu3_dr.h"
 #include "mtu3_debug.h"
 #include "mtu3_trace.h"
 
-- 
2.23.0



[USB EHCI DRIVER] [Regression] EHCI no longer working in 5.4 series kernel

2019-10-17 Thread Benedikt Schemmer
Hi all,

I recently started compiling the 5.4. kernel starting with rc3 and noticed that 
both my keyboard and mouse aren't working
when connected to the motherboards USB ports (they work fine when connected to 
an xhci extension card) and they work fine
with the 5.3 series up to 5.3.6

Cheers,
Benedikt

Output of dmesg when unbinding/binding ehci:
[ 4699.013556] ehci-pci :00:1a.0: remove, state 4
[ 4699.013561] usb usb1: USB disconnect, device number 1
[ 4699.017708] ehci-pci :00:1a.0: USB bus 1 deregistered
[ 4704.653496] ehci-pci :00:1d.0: remove, state 4
[ 4704.653501] usb usb2: USB disconnect, device number 1
[ 4704.657667] ehci-pci :00:1d.0: USB bus 2 deregistered
[ 4718.630640] ehci-pci :00:1d.0: EHCI Host Controller
[ 4718.630647] ehci-pci :00:1d.0: new USB bus registered, assigned bus 
number 1
[ 4718.630663] ehci-pci :00:1d.0: debug port 2
[ 4718.634567] ehci-pci :00:1d.0: cache line size of 64 is not supported
[ 4718.634585] ehci-pci :00:1d.0: irq 23, io mem 0xfe706000
[ 4718.646958] ehci-pci :00:1d.0: USB 2.0 started, EHCI 1.00
[ 4718.647037] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, 
bcdDevice= 5.04
[ 4718.647039] usb usb1: New USB device strings: Mfr=3, Product=2, 
SerialNumber=1
[ 4718.647041] usb usb1: Product: EHCI Host Controller
[ 4718.647042] usb usb1: Manufacturer: Linux 5.4.0-rc3+ ehci_hcd
[ 4718.647043] usb usb1: SerialNumber: :00:1d.0
[ 4718.648138] hub 1-0:1.0: USB hub found
[ 4718.648151] hub 1-0:1.0: 3 ports detected
[ 4718.982985] usb 1-1: new high-speed USB device number 2 using ehci-pci
[ 4718.982993] swiotlb_tbl_map_single: 42 callbacks suppressed
[ 4718.982995] ehci-pci :00:1d.0: swiotlb buffer is full (sz: 8 bytes), 
total 0 (slots), used 0 (slots)
[ 4718.983003] ehci-pci :00:1d.0: swiotlb buffer is full (sz: 8 bytes), 
total 0 (slots), used 0 (slots)
[ 4718.983006] ehci-pci :00:1d.0: swiotlb buffer is full (sz: 8 bytes), 
total 0 (slots), used 0 (slots)
[ 4719.114965] usb 1-1: device descriptor read/64, error -11
[ 4719.226971] ehci-pci :00:1d.0: swiotlb buffer is full (sz: 8 bytes), 
total 0 (slots), used 0 (slots)
[ 4719.226979] ehci-pci :00:1d.0: swiotlb buffer is full (sz: 8 bytes), 
total 0 (slots), used 0 (slots)
[ 4719.226983] ehci-pci :00:1d.0: swiotlb buffer is full (sz: 8 bytes), 
total 0 (slots), used 0 (slots)
[ 4719.354969] usb 1-1: device descriptor read/64, error -11
[ 4719.594986] usb 1-1: new high-speed USB device number 3 using ehci-pci
[ 4719.594997] ehci-pci :00:1d.0: swiotlb buffer is full (sz: 8 bytes), 
total 0 (slots), used 0 (slots)
[ 4719.595006] ehci-pci :00:1d.0: swiotlb buffer is full (sz: 8 bytes), 
total 0 (slots), used 0 (slots)
[ 4719.595018] ehci-pci :00:1d.0: swiotlb buffer is full (sz: 8 bytes), 
total 0 (slots), used 0 (slots)
[ 4719.722982] usb 1-1: device descriptor read/64, error -11
[ 4719.830982] ehci-pci :00:1d.0: swiotlb buffer is full (sz: 8 bytes), 
total 0 (slots), used 0 (slots)
[ 4719.963017] usb 1-1: device descriptor read/64, error -11
[ 4720.071026] usb usb1-port1: attempt power cycle
[ 4720.522999] usb 1-1: new high-speed USB device number 4 using ehci-pci
[ 4720.651004] usb 1-1: device descriptor read/64, error -11
[ 4720.887014] usb 1-1: device descriptor read/64, error -11
[ 4721.127034] usb 1-1: new high-speed USB device number 5 using ehci-pci
[ 4721.259014] usb 1-1: device descriptor read/64, error -11
[ 4721.495021] usb 1-1: device descriptor read/64, error -11
[ 4721.603047] usb usb1-port1: unable to enumerate USB device
[ 4723.519104] ehci-pci :00:1a.0: EHCI Host Controller
[ 4723.519114] ehci-pci :00:1a.0: new USB bus registered, assigned bus 
number 2
[ 4723.519132] ehci-pci :00:1a.0: debug port 2
[ 4723.523042] ehci-pci :00:1a.0: cache line size of 64 is not supported
[ 4723.523080] ehci-pci :00:1a.0: irq 16, io mem 0xfe707000
[ 4723.539100] ehci-pci :00:1a.0: USB 2.0 started, EHCI 1.00
[ 4723.539169] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002, 
bcdDevice= 5.04
[ 4723.539171] usb usb2: New USB device strings: Mfr=3, Product=2, 
SerialNumber=1
[ 4723.539172] usb usb2: Product: EHCI Host Controller
[ 4723.539173] usb usb2: Manufacturer: Linux 5.4.0-rc3+ ehci_hcd
[ 4723.539174] usb usb2: SerialNumber: :00:1a.0
[ 4723.539376] hub 2-0:1.0: USB hub found
[ 4723.539384] hub 2-0:1.0: 3 ports detected
[ 4723.875077] usb 2-1: new high-speed USB device number 2 using ehci-pci
[ 4724.003097] usb 2-1: device descriptor read/64, error -11
[ 4724.111085] swiotlb_tbl_map_single: 17 callbacks suppressed
[ 4724.111091] ehci-pci :00:1a.0: swiotlb buffer is full (sz: 8 bytes), 
total 0 (slots), used 0 (slots)
[ 4724.00] ehci-pci :00:1a.0: swiotlb buffer is full (sz: 8 bytes), 
total 0 (slots), used 0 (slots)
[ 4724.03] ehci-pci :00:1a.0: swiotlb buffer is full (sz: 8 bytes), 
total 0 (slots), used 0 (slots)
[ 4724.239088] usb 2-1: device descriptor read/64, er

Re: [USB EHCI DRIVER] [Regression] EHCI no longer working in 5.4 series kernel

2019-10-17 Thread Alan Stern
On Thu, 17 Oct 2019, Benedikt Schemmer wrote:

> Hi all,
> 
> I recently started compiling the 5.4. kernel starting with rc3 and noticed 
> that both my keyboard and mouse aren't working
> when connected to the motherboards USB ports (they work fine when connected 
> to an xhci extension card) and they work fine
> with the 5.3 series up to 5.3.6

Can you use git bisect to track the problem down to a particular commit?

Alan Stern



MOTHERLESS CHILDREN IN YOUR CITY !!

2019-10-17 Thread Mr Ekrem Bayraktar
Dear Sir / Madam



Since ever we left your country back to Canada , we have gotten Government 
approval and we have been busying planning for the less privilege Children 
projects.

We are planning to release first batch of the funds $2,990,000.00 within 14 
days for building an estate for motherless children in your city.

I want you to use my mother;s company name to register this charity project in 
your country after receiving the project funds.

It must be registered as { Bayraktar Group Homeless Children Ltd }.


Can you handle and supervise this big project ?
Can you manager all the workers as a senior supervisor ?
We want to be sure you can handle it before we proceed with this project.


Please call me if you want to hear from us + 1-917 580 4919.
Please can you manage such project please Kindly reply for further details.

Your full names---



Ekrem Bayraktar.
Bayraktar Shipping Group


RE: [PATCH] usb: cdns3: include host-export,h for cdns3_host_init

2019-10-17 Thread Pawel Laszczak
Hi

>The cdns3_host_init() function is declared in host-export.h
>but host.c does not include it. Add the include to have
>the declaration present (and remove the declaration of
>cdns3_host_exit which is now static).
>
>Fixes the following sparse warning:
>
>drivers/usb/cdns3/host.c:58:5: warning: symbol 'cdns3_host_init' was not 
>declared. Should it be static?

It should not be static. It can be called from core.c file.
It will be static only if CONFIG_USB_CDNS3_HOST will not be defined and in
this case function will be declared in host-export.h  as static. 

For me It doesn't look like driver issue. 

>
>Signed-off-by: Ben Dooks 
>---
>Cc: Greg Kroah-Hartman 
>Cc: Pawel Laszczak 
>Cc: Felipe Balbi 
>Cc: "Ben Dooks
>Cc: linux-usb@vger.kernel.org
>---
> drivers/usb/cdns3/host-export.h | 1 -
> drivers/usb/cdns3/host.c| 1 +
> 2 files changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/usb/cdns3/host-export.h b/drivers/usb/cdns3/host-export.h
>index b498a170b7e8..ae11810f8826 100644
>--- a/drivers/usb/cdns3/host-export.h
>+++ b/drivers/usb/cdns3/host-export.h
>@@ -12,7 +12,6 @@
> #ifdef CONFIG_USB_CDNS3_HOST
>
> int cdns3_host_init(struct cdns3 *cdns);
>-void cdns3_host_exit(struct cdns3 *cdns);

We can't remove this function. It is invoked from core.c file. 
If you remove it from host-export.h then it will not be visible there. 

>
> #else
>
>diff --git a/drivers/usb/cdns3/host.c b/drivers/usb/cdns3/host.c
>index 2733a8f71fcd..ad788bf3fe4f 100644
>--- a/drivers/usb/cdns3/host.c
>+++ b/drivers/usb/cdns3/host.c
>@@ -12,6 +12,7 @@
> #include 
> #include "core.h"
> #include "drd.h"
>+#include "host-export.h"

Why host must include this file. This function is implemented
In host.c and is used only in  core.c file . 

>
> static int __cdns3_host_init(struct cdns3 *cdns)
> {
>--
>2.23.0


Regards,
Pawell



[PATCH v3] usbip: tools: Fix read_usb_vudc_device() error path handling

2019-10-17 Thread GwanYeong Kim
This isn't really accurate right. fread() doesn't always
return 0 in error. It could return < number of elements
and set errno.

Signed-off-by: GwanYeong Kim 
---
 tools/usb/usbip/libsrc/usbip_device_driver.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/usb/usbip/libsrc/usbip_device_driver.c 
b/tools/usb/usbip/libsrc/usbip_device_driver.c
index 051d7d3f443b..927a151fa9aa 100644
--- a/tools/usb/usbip/libsrc/usbip_device_driver.c
+++ b/tools/usb/usbip/libsrc/usbip_device_driver.c
@@ -69,7 +69,7 @@ int read_usb_vudc_device(struct udev_device *sdev, struct 
usbip_usb_device *dev)
FILE *fd = NULL;
struct udev_device *plat;
const char *speed;
-   int ret = 0;
+   size_t ret;
 
plat = udev_device_get_parent(sdev);
path = udev_device_get_syspath(plat);
@@ -79,8 +79,10 @@ int read_usb_vudc_device(struct udev_device *sdev, struct 
usbip_usb_device *dev)
if (!fd)
return -1;
ret = fread((char *) &descr, sizeof(descr), 1, fd);
-   if (ret < 0)
+   if (ret != 1) {
+   err("Cannot read vudc device descr file: %s", strerror(errno));
goto err;
+   }
fclose(fd);
 
copy_descr_attr(dev, &descr, bDeviceClass);
-- 
2.17.1