Re: [PATCH 2/6] usb: renesas_usbhs: don't re-allocation pipe buffer

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

 



Hello.

On 21-04-2011 9:10, Kuninori Morimoto wrote:

Because pipe buffer allocation is very picky and difficult,
current renesas_usbhs driver is not caring pipe re-allocation.

In this situation, driver will create new pipe without caring old pipe
if "usbhsg_ep_enable" is called after "usbhsg_ep_disable" on current driver.
This mean the limited pipe and buffer will be used as waste.
But it is possible to re-use same buffer to same pipe.

By this patch, driver will initialize pipe when it detected new connection or
new gadget, and doesn't try re-allocation for same pipe in above case.

Signed-off-by: Kuninori Morimoto<kuninori.morimoto.gx@xxxxxxxxxxx>
---
  drivers/usb/renesas_usbhs/mod_gadget.c |   18 +++++++++++++++---
  1 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/renesas_usbhs/mod_gadget.c b/drivers/usb/renesas_usbhs/mod_gadget.c
index 9a5ac02..7cb30e4 100644
--- a/drivers/usb/renesas_usbhs/mod_gadget.c
+++ b/drivers/usb/renesas_usbhs/mod_gadget.c
[...]
@@ -809,6 +815,11 @@ static int usbhsg_ep_enable(struct usb_ep *ep,
  	unsigned long flags;
  	int ret = -EIO;

+	/* if it already have pipe,
+	 * nothing to do */

   The preferred style of the multi-line commenst is this:

/*
 * bla
 * bla
 */

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


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

  Powered by Linux