Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@ti.com>
To: Krzysztof Opasiak <k.opasiak@samsung.com>
Cc: <balbi@ti.com>, Robert Baldyga <r.baldyga@samsung.com>,
	<gregkh@linuxfoundation.org>, <linux-usb@vger.kernel.org>,
	<andrzej.p@samsung.com>, <stable@vger.kernel.org>
Subject: Re: [PATCH v3 1/2] usb: gadget: loopback: fix: Don't share qlen and buflen between instances
Date: Wed, 30 Sep 2015 11:08:43 -0500	[thread overview]
Message-ID: <20150930160843.GF32625@saruman.tx.rr.com> (raw)
In-Reply-To: <56042E9D.5040408@samsung.com>

[-- Attachment #1: Type: text/plain, Size: 2306 bytes --]

On Thu, Sep 24, 2015 at 07:10:53PM +0200, Krzysztof Opasiak wrote:
> 
> 
> On 09/24/2015 06:51 PM, Felipe Balbi wrote:
> >On Thu, Sep 24, 2015 at 05:19:12PM +0200, Robert Baldyga wrote:
> >>On 09/22/2015 08:40 PM, Krzysztof Opasiak wrote:
> >>>Each instance of loopback function may have different qlen
> >>>and buflen attributes values. When linking function to
> >>>configuration those values had been assigned to global
> >>>variables. Linking other instance to config overwrites those
> >>>values.
> >>>
> >>>This commit moves those values to f_loopback structure
> >>>to avoid overwriting. Now each function has its own instance
> >>>of those values.
> >>>
> >>>Cc: <stable@vger.kernel.org> # 3.10+
> >>>Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
> >>
> >>Reviewed-by: Robert Baldyga <r.baldyga@samsung.com>
> >
> >doesn't seem to fit stable IMO. Care to explain why you think we need
> >to backport this to v3.10+ ?
> >
> 
> Let's consider following set of commands:
> 
> cd $CFS_ROOT/usb_gadget
> mkdir g1
> cd g1
> mkdir functions/SourceSink.1
> mkdir functions/SourceSink.2
> echo 1024 > functions/SourceSink.1/buflen
> echo 512 > functions/SourceSink.2/buflen
> mkdir configs/c.1
> ln -s functions/SourceSink.1 configs/c.1/
> ln -s functions/SourceSink.2 configs/c.1/
> echo $UDC > UDC
> 
> You assume that after executing this script you will get two instances of
> SourceSink functions and one of them will alloc requests buffers which has
> 1024 and second one which has only 512.
> 
> Unfortunately due to using global variables both of them are going to alloc
> only 512 bytes for each request. The same situation is with qlen. All
> instances are going to use attributes values from the last one in the
> system, even if they are in multiple gadgets.

that's all fine and dandy, but it's still a new requirement. It fits easily
into "has never worked before" category. If it was something which really
regressed, IOW we used to support it but some other commit broke it, then
I'd agree.

> In my opinion second patch in this series is much more important as it makes
> loopback function working again after almost year of being only /dev/null
> and /dev/zero. But that one should to go only to 3.18.

ok

-- 
balbi

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

      reply	other threads:[~2015-09-30 16:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-22 18:40 [PATCH v3 1/2] usb: gadget: loopback: fix: Don't share qlen and buflen between instances Krzysztof Opasiak
2015-09-22 18:40 ` [PATCH v3 2/2] usb: gadget: loopback: Fix looping back logic implementation Krzysztof Opasiak
2015-09-30 16:11   ` Felipe Balbi
2015-09-30 16:15     ` Felipe Balbi
2015-10-13 18:11       ` Krzysztof Opasiak
2015-10-13 18:16         ` Felipe Balbi
2015-09-24 15:19 ` [PATCH v3 1/2] usb: gadget: loopback: fix: Don't share qlen and buflen between instances Robert Baldyga
2015-09-24 16:51   ` Felipe Balbi
2015-09-24 17:10     ` Krzysztof Opasiak
2015-09-30 16:08       ` Felipe Balbi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150930160843.GF32625@saruman.tx.rr.com \
    --to=balbi@ti.com \
    --cc=andrzej.p@samsung.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=k.opasiak@samsung.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=r.baldyga@samsung.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox