From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout3.w1.samsung.com ([210.118.77.13]:46662 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759139AbbIVSRC (ORCPT ); Tue, 22 Sep 2015 14:17:02 -0400 Subject: Re: [PATCH v2 2/2] usb: gadget: loopback: Fix looping back logic implementation To: balbi@ti.com, gregkh@linuxfoundation.org References: <1442941006-16595-1-git-send-email-k.opasiak@samsung.com> <1442941006-16595-2-git-send-email-k.opasiak@samsung.com> Cc: linux-usb@vger.kernel.org, andrzej.p@samsung.com, stable@vger.kernel.org From: Krzysztof Opasiak Message-id: <56019B1A.7030306@samsung.com> Date: Tue, 22 Sep 2015 20:16:58 +0200 MIME-version: 1.0 In-reply-to: <1442941006-16595-2-git-send-email-k.opasiak@samsung.com> Content-type: text/plain; charset=windows-1252; format=flowed Content-transfer-encoding: 7bit Sender: stable-owner@vger.kernel.org List-ID: On 09/22/2015 06:56 PM, Krzysztof Opasiak wrote: > Since: > > commit e0857ce58e8658657f5f12fe25272b93cfeb16aa > ("usb: gadget: loopback: don't queue requests to bogus endpoints") > > Loopback function is not realy working as that commit removed > all looping back logic. After that commit ep-out works like > /dev/null and ep-in works like /dev/zero. > > This commit fix this issue by allocating set of out requests > and set of in requests but each out req shares buffer with > one in req: > > out_req->buf ---> buf <--- in_req.buf > out_req->context <---> in_req.context > > The completion routine simply enqueue the suitable req in > an oposite direction. > > Cc: # 3.18+ > Signed-off-by: Krzysztof Opasiak > --- > Changes since v1: > - add missing usb_ep_free_request() in complete() callback After hour of using this I have faced some problem with memory feeing. I will look for it and send update shortly. -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics