Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755780AbcDGJ5w (ORCPT ); Thu, 7 Apr 2016 05:57:52 -0400 Received: from mail-wm0-f44.google.com ([74.125.82.44]:33871 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755710AbcDGJ5t convert rfc822-to-8bit (ORCPT ); Thu, 7 Apr 2016 05:57:49 -0400 From: Michal Nazarewicz To: Alan Stern Cc: Ivaylo Dimitrov , Tony Lindgren , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, Felipe Balbi , Bin Liu , pali.rohar@gmail.com Subject: Re: [PATCH] usb: f_mass_storage: test whether thread is running before starting another In-Reply-To: Organization: http://mina86.com/ References: User-Agent: Notmuch/0.19+53~g2e63a09 (http://notmuchmail.org) Emacs/25.1.50.1 (x86_64-unknown-linux-gnu) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJFBMVEWbfGlUPDDHgE57V0jUupKjgIObY0PLrom9mH4dFRK4gmjPs41MxjOgAAACP0lEQVQ4T23Sv2vbQBQHcBk1xE6WyALX107VUEgmn6+ouUwpEQQ6uRjttkWP4CkBg2M0BQLBdPFZYPsyFYo7qEtKDQ7on+t7+nF2Ux8ahD587717OmNYrOvycHsZ+o2r051wHTHysAvGb8ygvgu4QWT0sCmkgZCIEnlV2X8BtyraazFGDuxhmKSQJMlwHQ7v5MHSNxmz78rfElwAa3ieVD9e+hBhjaPDDG6NgFo2f4wBMNIo5YmRtF0RyDgFjJjlMIWbnuM4x9MMfABGTlN4qgIQB4A1DEyA1BHWtfeWNUMwiVJKoqh97KrkOO+qzgluVYLvFCUKAX73nONeBr7BGMdM6Sg0kuep03VywLaIzRiVr+GAzKlpQIsAFnWAG2e6DT5WmWDiudZMIc6hYrMOmeMQK9WX0B+/RfjzL9DI7Y9/Iayn29Ci0r2i4f9gMimMSZLCDMalgQGU5hnUtqAN0OGvEmO1Wnl0C0wWSCEHnuHBqmygxdxA8oWXwbipoc1EoNR9DqOpBpOJrnr0criQab9ZT4LL+wI+K7GBQH30CrhUruilgP9DRTrhVWZCiAyILP+wiuLeCKGTD6r/nc8LOJcAwR6IBTUs+7CASw3QFZ0MdA2PI3zNziH4ZKVhXCRMBjeZ1DWMekKwDCASwExy+NQ86TaykaDAFHO4aP48y4fIcDM5yOG8GcTLbOyp8A8azjJI93JFd1EA6yN8sSxMQJWoABqniRZVykYgRXErzrdqExAoUrRb0xfRp8p2A/4XmfilTtkDZ4cAAAAASUVORK5CYII= X-Face: -TR8(rDTHy/(xl?SfWd1|3:TTgDIatE^t'vop%*gVg[kn$t{EpK(P"VQ=~T2#ysNmJKN$"yTRLB4YQs$4{[.]Fc1)*O]3+XO^oXM>Q#b^ix,O)Zbn)q[y06$`e3?C)`CwR9y5riE=fv^X@x$y?D:XO6L&x4f-}}I4=VRNwiA^t1-ZrVK^07.Pi/57c_du'& X-PGP: 50751FF4 X-PGP-FP: AC1F 5F5C D418 88F8 CC84 5858 2060 4012 5075 1FF4 X-Hashcash: 1:20:160407:ivo.g.dimitrov.75@gmail.com::Zx7dfschM/K+yk4+:000000000000000000000000000000000007Wj X-Hashcash: 1:20:160407:b-liu@ti.com::xKCUYGMF6vNhEnr+:000000nhy X-Hashcash: 1:20:160407:linux-kernel@vger.kernel.org::kdh6tRzZe0/qwTbq:00000000000000000000000000000000010TR X-Hashcash: 1:20:160407:linux-usb@vger.kernel.org::CAEX3Efo1in6kCP+:00000000000000000000000000000000000023JI X-Hashcash: 1:20:160407:stern@rowland.harvard.edu::pcRY5JpssBBctk6j:0000000000000000000000000000000000003xU9 X-Hashcash: 1:20:160407:tony@atomide.com::RVygOxCPtSisIY0N:0B6/L X-Hashcash: 1:20:160407:felipe.balbi@linux.intel.com::Rtii11V7+jpFeK0x:000000000000000000000000000000000DFpS X-Hashcash: 1:20:160407:pali.rohar@gmail.com::e4ZPXnUmBFlgHsbA:00000000000000000000000000000000000000000KDh0 Date: Thu, 07 Apr 2016 11:57:45 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1704 Lines: 44 >> On Tue, Apr 05 2016, Alan Stern wrote: >>> Suppose one usb_function is carrying out an I/O operation while >>> another one in the same config gets a Set-Interface request from the >>> host. > On Wed, 6 Apr 2016, Michal Nazarewicz wrote: >> That cannot happen. A single instance of mass_storage cannot¹ be added >> twice to the same configuration. >> >> ¹ To be more precise, not via configfs. A legacy gadget could do that, >> but that would be a bug in that legacy driver, not f_mass_storage. >> Moreover, no current legacy gadgets do that though so IMO this is an >> academic discussion. On Wed, Apr 06 2016, Alan Stern wrote: > Okay. Then I suggest adding this explanation to the patch > description. Sounds good to me. I’d love someone to test this patch (I sadly have no way of doing that at the moment) and with that I can resend it with updated message. > BTW, is configfs capable of adding a single instance twice in different > configs? Or is that again something only legacy gadgets can do? I don’t think so. I might be wrong though, but here’s configuration from the original post: mkdir functions/mass_storage.0 echo $file > functions/mass_storage.0/lun.0/file ln -s functions/mass_storage.0 configs/c.1 ln -s functions/mass_storage.0 configs/c.2 This makes me suspect it’s not possible to link a function instance to the same configuration twice, but now that I think about it, I’m not quite sure what would happen if one did: ln -s functions/mass_storage.0 configs/c.1/foo ln -s functions/mass_storage.0 configs/c.1/bar -- Best regards ミハウ “????????????????86” ナザレヴイツ «If at first you don’t succeed, give up skydiving»