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

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

 



Hello.

On 26-04-2011 4:21, Kuninori Morimoto wrote:

   Sorry for the grammar nitpicking but...
   Subject shoiuld have "re-ällocate" nistead of "re-allocation"

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

   Does not care about pipe re-allocation.

In this situation, driver will create new pipe without caring old pipe

   Caring for 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.

   s/mean/means/

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>
[...]

diff --git a/drivers/usb/renesas_usbhs/mod_gadget.c b/drivers/usb/renesas_usbhs/mod_gadget.c
index 318ecde..a35728d 100644
--- a/drivers/usb/renesas_usbhs/mod_gadget.c
+++ b/drivers/usb/renesas_usbhs/mod_gadget.c
[...]
@@ -810,6 +816,13 @@ static int usbhsg_ep_enable(struct usb_ep *ep,
  	unsigned long flags;
  	int ret = -EIO;

+	/*
+	 * if it already have pipe,

   s/have/has/

+	 * nothing to do
+	 */
+	if (uep->pipe)
+		return 0;
+
  	/********************  spin lock ********************/
  	spin_lock_irqsave(lock, flags);


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