2013-08-27 15:54:00

by Rupesh Gujare

[permalink] [raw]
Subject: [PATCH 1/4] staging: ozwpan: Increase ISOC IN buffer depth

Increase ISOC IN buffer depth to 100 units.

Signed-off-by: Rupesh Gujare <[email protected]>
---
drivers/staging/ozwpan/ozhcd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/ozwpan/ozhcd.c b/drivers/staging/ozwpan/ozhcd.c
index 3548860..b0398c5 100644
--- a/drivers/staging/ozwpan/ozhcd.c
+++ b/drivers/staging/ozwpan/ozhcd.c
@@ -39,7 +39,7 @@
* Number of units of buffering to capture for an isochronous IN endpoint before
* allowing data to be indicated up.
*/
-#define OZ_IN_BUFFERING_UNITS 50
+#define OZ_IN_BUFFERING_UNITS 100

/* Name of our platform device.
*/
--
1.7.9.5


2013-08-27 15:54:04

by Rupesh Gujare

[permalink] [raw]
Subject: [PATCH 2/4] staging: ozwpan: Reset PORT_ENABLE bit.

Reset PORT_ENABLE bit of port status on loosing PD.

Signed-off-by: Rupesh Gujare <[email protected]>
---
drivers/staging/ozwpan/ozhcd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/ozwpan/ozhcd.c b/drivers/staging/ozwpan/ozhcd.c
index b0398c5..39f5066 100644
--- a/drivers/staging/ozwpan/ozhcd.c
+++ b/drivers/staging/ozwpan/ozhcd.c
@@ -756,7 +756,7 @@ void oz_hcd_pd_departed(struct oz_port *port)
port->config_num = 0;
port->flags &= ~(OZ_PORT_F_PRESENT | OZ_PORT_F_DYING);
port->flags |= OZ_PORT_F_CHANGED;
- port->status &= ~USB_PORT_STAT_CONNECTION;
+ port->status &= ~(USB_PORT_STAT_CONNECTION | USB_PORT_STAT_ENABLE);
port->status |= (USB_PORT_STAT_C_CONNECTION << 16);
/* If there is an endpont 0 then clear the pointer while we hold
* the spinlock be we deallocate it after releasing the lock.
--
1.7.9.5

2013-08-27 15:54:08

by Rupesh Gujare

[permalink] [raw]
Subject: [PATCH 3/4] staging: ozwpan: Add debounce time before unregistering.

Fixes following error caused during unloading driver.

[ 1127.542888] usb 5-1: USB disconnect, device number 2
[ 1127.542909] ozwpan ozwpan: remove, state 1
[ 1127.542933] usb usb5: USB disconnect, device number 1
[ 1127.618634] hub 5-0:1.0: hub_port_status failed (err = -19)
[ 1127.618647] hub_port_connect_change: 45 callbacks suppressed
[ 1127.618657] hub 5-0:1.0: connect-debounce failed, port 1 disabled
[ 1127.618668] hub 5-0:1.0: cannot disable port 1 (err = -19)

Signed-off-by: Rupesh Gujare <[email protected]>
---
drivers/staging/ozwpan/ozhcd.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/drivers/staging/ozwpan/ozhcd.c b/drivers/staging/ozwpan/ozhcd.c
index 39f5066..d9c43c3 100644
--- a/drivers/staging/ozwpan/ozhcd.c
+++ b/drivers/staging/ozwpan/ozhcd.c
@@ -57,6 +57,10 @@
*/
#define EP0_TIMEOUT_COUNTER 13

+/* Debounce time HCD driver should wait before unregistering.
+ */
+#define OZ_HUB_DEBOUNCE_TIMEOUT 1500
+
/*
* Used to link urbs together and also store some status information for each
* urb.
@@ -2355,6 +2359,7 @@ error:
*/
void oz_hcd_term(void)
{
+ msleep(OZ_HUB_DEBOUNCE_TIMEOUT);
tasklet_kill(&g_urb_process_tasklet);
tasklet_kill(&g_urb_cancel_tasklet);
platform_device_unregister(g_plat_dev);
--
1.7.9.5

2013-08-27 15:54:22

by Rupesh Gujare

[permalink] [raw]
Subject: [PATCH 4/4] staging: ozwpan: Return error, if PD is not connected.

Return error if we receive write(), while PD is not connected.

Signed-off-by: Rupesh Gujare <[email protected]>
---
drivers/staging/ozwpan/ozcdev.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/staging/ozwpan/ozcdev.c b/drivers/staging/ozwpan/ozcdev.c
index 03b41ee..22cb2ae 100644
--- a/drivers/staging/ozwpan/ozcdev.c
+++ b/drivers/staging/ozwpan/ozcdev.c
@@ -162,6 +162,8 @@ static ssize_t oz_cdev_write(struct file *filp, const char __user *buf,
spin_unlock_bh(&g_cdev.lock);
if (pd == NULL)
return -1;
+ if (!(pd->state & OZ_PD_S_CONNECTED))
+ return -ENXIO;
eb = &pd->elt_buff;
ei = oz_elt_info_alloc(eb);
if (ei == NULL) {
--
1.7.9.5

2013-08-27 17:28:04

by Sergei Shtylyov

[permalink] [raw]
Subject: Re: [PATCH 4/4] staging: ozwpan: Return error, if PD is not connected.

Hello.

On 08/27/2013 07:53 PM, Rupesh Gujare wrote:

> Return error if we receive write(), while PD is not connected.

> Signed-off-by: Rupesh Gujare <[email protected]>
> ---
> drivers/staging/ozwpan/ozcdev.c | 2 ++
> 1 file changed, 2 insertions(+)

> diff --git a/drivers/staging/ozwpan/ozcdev.c b/drivers/staging/ozwpan/ozcdev.c
> index 03b41ee..22cb2ae 100644
> --- a/drivers/staging/ozwpan/ozcdev.c
> +++ b/drivers/staging/ozwpan/ozcdev.c
> @@ -162,6 +162,8 @@ static ssize_t oz_cdev_write(struct file *filp, const char __user *buf,
> spin_unlock_bh(&g_cdev.lock);
> if (pd == NULL)
> return -1;

Note that returning -EPERM here is hardly correct.

> + if (!(pd->state & OZ_PD_S_CONNECTED))
> + return -ENXIO;

WBR, Sergei

2013-08-27 18:57:53

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH 1/4] staging: ozwpan: Increase ISOC IN buffer depth

On Tue, Aug 27, 2013 at 04:53:40PM +0100, Rupesh Gujare wrote:
> Increase ISOC IN buffer depth to 100 units.
>

This change log is not useful. What are the user visible effects of
this bug?

regards,
dan carpenter