From mboxrd@z Thu Jan 1 00:00:00 1970 From: Krzysztof Opasiak Subject: Re: [RFC][PATCH 1/2] usb: gadget: configfs: add MTP function Date: Thu, 13 Aug 2015 21:34:46 +0200 Message-ID: <55CCF156.8010302@samsung.com> References: <1439493140-22207-1-git-send-email-amit.pundir@linaro.org> <1439493140-22207-2-git-send-email-amit.pundir@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-reply-to: <1439493140-22207-2-git-send-email-amit.pundir-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Amit Pundir , linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Cc: Mike Lockwood , Benoit Goby , Colin Cross , =?UTF-8?B?QXJ2ZSBIasO4bm5ldsOlZw==?= , Peter Oh , Greg Hackmann , Badhri Jagan Sridharan , Android Kernel Team , Greg Kroah-Hartman , Jonathan Corbet , Felipe Balbi , Andrzej Pietrasiewicz , Laurent Pinchart , Yegor Yefremov , Philippe Reynes , John Stultz , Sumit Semwal List-Id: linux-api@vger.kernel.org Hello, On 08/13/2015 09:12 PM, Amit Pundir wrote: > his MTP function is based on years of work originally done in the > Android kernel tree by: > Mike Lockwood > Benoit Goby > Colin Cross > Arve Hj=C3=B8nnev=C3=A5g > Peter Oh > Greg Hackmann > Badhri Jagan Sridharan > I've folded the series up to make it easier to review, and to provide > a coherent patch description. > > Post Gingerbread (Android v2.3), Android dropped USB Mass Storage > in favor of Media Transfer Protocal (MTP), which is widely used for > transferring media files to digital music players and similar > applications. This USB gadget function implements MTP functionalty. > > Historically this function has been a part of Android composite > gadget driver. Android composite driver was Android's solution > for dynamic gadget function switching prior to the ConfigFS gadget > being merged. There were failed few attempts in past > http://marc.info/?l=3Dlinux-usb&m=3D132451695808552 to upstream Andr= oid > composite driver as well. Now this Android MTP gadget function has be= en > re-implemented so as to be used as a generic ConfigFS function instea= d. > > Again, many thanks to Mike, Benoit, Colin, Arve, Peter, Greg and Badh= ri, > as they are the real authors of this work. However, I've folded their > patches together and modified it enough that I don't want them to be > blamed for any mistakes I've made condensing their patches down. > > Cc: Mike Lockwood > Cc: Benoit Goby > Cc: Colin Cross > Cc: Arve Hj=C3=B8nnev=C3=A5g > Cc: Peter Oh > Cc: Greg Hackmann > Cc: Badhri Jagan Sridharan > Cc: Android Kernel Team > Cc: Greg Kroah-Hartman > Cc: Jonathan Corbet > Cc: Felipe Balbi > Cc: Andrzej Pietrasiewicz > Cc: Laurent Pinchart > Cc: Yegor Yefremov > Cc: Philippe Reynes > Cc: John Stultz > Cc: Sumit Semwal > Signed-off-by: Amit Pundir In my humble opinion adding such function to Linux kernel doesn't make=20 any sense. By design, MTP is a protocol which requires access to=20 userspace features esp. file system. It is very important to run MTP=20 daemon with suitable user and LSM label and many many other issues whic= h=20 should be handled by userspace access policy. Moreover this is not a fully functional USB function but only some=20 interface which can be used by mtp-responder (mtp-daemon - call it as=20 you like) to communicate with host. As we have FunctionFS which allows=20 to implement any USB function in as a userspace service. As MTP nature=20 is more related to userspace I think that porting MTP daemon to use thi= s=20 is a right way to go. This should be much more reasonable than adding=20 new function which also requires daemon for proper working. So why add=20 another interface while we can use a generic one? Best regards, --=20 Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics