<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/usb/gadget/function/f_fs.c, branch linux-4.0.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.0.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.0.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2015-07-10T16:45:39Z</updated>
<entry>
<title>usb: gadget: f_fs: add extra check before unregister_gadget_item</title>
<updated>2015-07-10T16:45:39Z</updated>
<author>
<name>Rui Miguel Silva</name>
</author>
<published>2015-05-20T13:52:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7fa24a821af13e4cf468e9c9e2cfeae6b71832d3'/>
<id>urn:sha1:7fa24a821af13e4cf468e9c9e2cfeae6b71832d3</id>
<content type='text'>
commit f14e9ad17f46051b02bffffac2036486097de19e upstream.

ffs_closed can race with configfs_rmdir which will call config_item_release, so
add an extra check to avoid calling the unregister_gadget_item with an null
gadget item.

Signed-off-by: Rui Miguel Silva &lt;rui.silva@linaro.org&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>usb: gadget: f_fs: fix check in read operation</title>
<updated>2015-07-10T16:45:38Z</updated>
<author>
<name>Rui Miguel Silva</name>
</author>
<published>2015-05-20T13:53:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0b5531419e0537db4b9f92e1c615bf76fc55d98b'/>
<id>urn:sha1:0b5531419e0537db4b9f92e1c615bf76fc55d98b</id>
<content type='text'>
commit 342f39a6c8d34d638a87b7d5f2156adc4db2585c upstream.

when copying to iter the size can be different then the iov count,
the check for full iov is wrong and make any read on request which
is not the exactly size of iov to return -EFAULT.

So, just check the success of the copy.

Signed-off-by: Rui Miguel Silva &lt;rui.silva@linaro.org&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>gadget/function/f_fs.c: switch to -&gt;{read,write}_iter()</title>
<updated>2015-02-18T03:23:31Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2015-02-01T04:55:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=70e60d917e91fff2237095b8950810effa2b1a50'/>
<id>urn:sha1:70e60d917e91fff2237095b8950810effa2b1a50</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>gadget/function/f_fs.c: use put iov_iter into io_data</title>
<updated>2015-02-18T03:23:29Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2015-02-01T04:23:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c993c39b86398c627afda36b45dc92de655e213e'/>
<id>urn:sha1:c993c39b86398c627afda36b45dc92de655e213e</id>
<content type='text'>
both on aio and non-aio sides

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>gadget/function/f_fs.c: close leaks</title>
<updated>2015-02-18T03:23:28Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2015-02-01T04:42:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=de2080d41b5d584205e408d72021f0f335a046fc'/>
<id>urn:sha1:de2080d41b5d584205e408d72021f0f335a046fc</id>
<content type='text'>
If ffs_epfile_io() fails in AIO case, we end up leaking io_data
(and iovec_copy in case of AIO read).

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>usb: gadget: ffs: add eventfd notification about ffs events</title>
<updated>2015-01-27T15:34:59Z</updated>
<author>
<name>Robert Baldyga</name>
</author>
<published>2015-01-23T12:41:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5e33f6fdf735cda1d4580fe6f1878da05718fe73'/>
<id>urn:sha1:5e33f6fdf735cda1d4580fe6f1878da05718fe73</id>
<content type='text'>
Add eventfd which notifies userspace about ep0 events and AIO completion
events. It simplifies using of FunctionFS with event loop, because now
we need to poll on single file (instead of polling on ep0 and eventfd's
supplied to AIO layer).

FunctionFS eventfd is not triggered if another eventfd is supplied to
AIO layer (in AIO request). It can be useful, for example, when we want
to handle AIO transations for chosen endpoint in separate thread.

Signed-off-by: Robert Baldyga &lt;r.baldyga@samsung.com&gt;
Acked-by: Michal Nazarewicz &lt;mina86@mina86.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: f_fs: Fix loop variable</title>
<updated>2015-01-27T15:34:59Z</updated>
<author>
<name>Mario Schuknecht</name>
</author>
<published>2015-01-26T19:40:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=acba23fec527012e901636e4ba091ee25461c943'/>
<id>urn:sha1:acba23fec527012e901636e4ba091ee25461c943</id>
<content type='text'>
Use if-loop variable 'epfile' instead of start variable 'epfiles'. Now the
correct endpoint file name is stored.

Signed-off-by: Mario Schuknecht &lt;mario.schuknecht@dresearch-fe.de&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: f_fs: add "no_disconnect" mode</title>
<updated>2015-01-15T15:41:50Z</updated>
<author>
<name>Robert Baldyga</name>
</author>
<published>2014-12-18T08:55:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=18d6b32fca3841f7cd9479b4024abd8a9b299281'/>
<id>urn:sha1:18d6b32fca3841f7cd9479b4024abd8a9b299281</id>
<content type='text'>
Since we can compose gadgets from many functions, there is the problem
related to gadget breakage while FunctionFS daemon being closed. FFS
function is userspace code so there is no way to know when it will close
files (it doesn't matter what is the reason of this situation, it can
be daemon logic, program breakage, process kill or any other). So when
we have another function in gadget which, for example, sends some amount
of data, does some software update or implements some real-time functionality,
we may want to keep the gadget connected despite FFS function is no longer
functional.

We can't just remove one of functions from gadget since it has been
enumerated, so the only way to keep entire gadget working is to make
broken FFS function deactivated but still visible to host. For this
purpose this patch introduces "no_disconnect" mode. It can be enabled
by setting mount option "no_disconnect=1", and results with defering
function disconnect to the moment of reopen ep0 file or filesystem
unmount. After closing all endpoint files, FunctionFS is set to state
FFS_DEACTIVATED.

When ffs-&gt;state == FFS_DEACTIVATED:
- function is still bound and visible to host,
- setup requests are automatically stalled,
- transfers on other endpoints are refused,
- epfiles, except ep0, are deleted from the filesystem,
- opening ep0 causes the function to be closed, and then FunctionFS
  is ready for descriptors and string write,
- altsetting change causes the function to be closed - we want to keep
  function alive until another functions are potentialy used, altsetting
  change means that another configuration is being selected or USB cable
  was unplugged, which indicates that we don't need to stay longer in
  FFS_DEACTIVATED state
- unmounting of the FunctionFS instance causes the function to be closed.

Tested-by: David Cohen &lt;david.a.cohen@linux.intel.com&gt;
Acked-by: Michal Nazarewicz &lt;mina86@mina86.com&gt;
Signed-off-by: Robert Baldyga &lt;r.baldyga@samsung.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: f_fs: refactor and document __ffs_ep0_read_events better</title>
<updated>2015-01-12T18:13:29Z</updated>
<author>
<name>Michal Nazarewicz</name>
</author>
<published>2014-09-10T15:50:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=67913bbd0b62d297520667cd3057aff5a5890ca6'/>
<id>urn:sha1:67913bbd0b62d297520667cd3057aff5a5890ca6</id>
<content type='text'>
Instead of using variable length array, use a static length equal to
the size of the ffs-&gt;ev.types array.  This gets rid of a sparse warning:

	drivers/usb/gadget/function/f_fs.c:401:44: warning:
	Variable length array is used.

and makes it more explicit that the array has a very tight upper size
limit.  Also add some more documentation about the ev.types array and
how its size is limited and affects the rest of the code.

Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Reported-by: Rohith Seelaboyina &lt;rseelaboyina@nvidia.com&gt;
Signed-off-by: Michal Nazarewicz &lt;mina86@mina86.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
<entry>
<title>usb: ffs: fix regression when quirk_ep_out_aligned_size flag is set</title>
<updated>2014-10-23T14:55:42Z</updated>
<author>
<name>David Cohen</name>
</author>
<published>2014-10-13T18:15:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c0d31b3c3d9a025b8d5a57c35671e60c5f388bf7'/>
<id>urn:sha1:c0d31b3c3d9a025b8d5a57c35671e60c5f388bf7</id>
<content type='text'>
The commit '2e4c7553cd usb: gadget: f_fs: add aio support' broke the
quirk implemented to align buffer size to maxpacketsize on out endpoint.
As result, functionfs does not work on Intel platforms using dwc3 driver
(i.e. Bay Trail and Merrifield). This patch fixes the issue.

This code is based on a previous Qiuxu's patch.

Fixes: 2e4c7553cd (usb: gadget: f_fs: add aio support)
Cc: &lt;stable@vger.kernel.org&gt; # v3.16+
Signed-off-by: David Cohen &lt;david.a.cohen@linux.intel.com&gt;
Signed-off-by: Qiuxu Zhuo &lt;qiuxu.zhuo@intel.com&gt;
Acked-by: Michal Nazarewicz &lt;mina86@mina86.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
</feed>
