16 Jun, 2009
1 commit
-
This patch (as1233) makes g_file_storage use the "unaligned" accessors.
This is based on work originally done by Harvey Harrison.Signed-off-by: Alan Stern
Acked-by: Harvey Harrison
Acked-by: David Brownell
Signed-off-by: Greg Kroah-Hartman
24 Apr, 2009
1 commit
-
This patch (as1231) fixes a use-after-free bug in g_file_storage. A
device's name may not be available after the device is unregistered,
even if the device structure itself is still allocated. Since
close_backing_file() prints a LUN's name for debugging, it shouldn't
be called after the LUN has been unregistered.That whole area needed to be cleaned up; the backing files were
getting closed in a couple of different places. The patch fixes
things so that they get closed in just one place, as part of the
unbind procedure, immediately before the LUN is unregistered.Signed-off-by: Alan Stern
Signed-off-by: Greg Kroah-Hartman
27 Mar, 2009
1 commit
-
* 'bkl-removal' of git://git.lwn.net/linux-2.6:
Rationalize fasync return values
Move FASYNC bit handling to f_op->fasync()
Use f_lock to protect f_flags
Rename struct file->f_ep_lock
25 Mar, 2009
1 commit
-
The base versions handle constant folding now.
Signed-off-by: Harvey Harrison
Signed-off-by: Greg Kroah-Hartman
16 Mar, 2009
1 commit
-
Traditionally, changes to struct file->f_flags have been done under BKL
protection, or with no protection at all. This patch causes all f_flags
changes after file open/creation time to be done under protection of
f_lock. This allows the removal of some BKL usage and fixes a number of
longstanding (if microscopic) races.Reviewed-by: Christoph Hellwig
Cc: Al Viro
Signed-off-by: Jonathan Corbet
28 Feb, 2009
1 commit
-
This patch (as1220) automatically disables stalls when g_file_storage
finds itself running with an Atmel device controller, because the
Atmel hardware/driver isn't capable of halting bulk endpoints
correctly.Reported-by: Stanislaw Gruszka
Signed-off-by: Alan Stern
Acked-by: David Brownell
Signed-off-by: Greg Kroah-Hartman
08 Jan, 2009
2 commits
-
In some obscure scenarios e.g. passing a 0-byte backing file
storage, wait_for_completion() would wait forever in fsg_cleanup().Prevent it by completing the thread in fsg_bind() error path.
Signed-off-by: Felipe Balbi
Signed-off-by: Alan Stern
Signed-off-by: Greg Kroah-Hartman -
This patch (as1172) adds the ability to emulate a CD-ROM drive to
g_file_storage. The emulation is limited, since it presents as a disc
containing a single data track and no audio tracks. Still, it may
come in useful on occasion.Signed-off-by: Alan Stern
Signed-off-by: Greg Kroah-Hartman
06 Jan, 2009
1 commit
-
Fsync currently has a fdatawrite/fdatawait pair around the method call,
and a mutex_lock/unlock of the inode mutex. All callers of fsync have
to duplicate this, but we have a few and most of them don't quite get
it right. This patch adds a new vfs_fsync that takes care of this.
It's a little more complicated as usual as ->fsync might get a NULL file
pointer and just a dentry from nfsd, but otherwise gets afile and we
want to take the mapping and file operations from it when it is there.Notes on the fsync callers:
- ecryptfs wasn't calling filemap_fdatawrite / filemap_fdatawait on the
lower file
- coda wasn't calling filemap_fdatawrite / filemap_fdatawait on the host
file, and returning 0 when ->fsync was missing
- shm wasn't calling either filemap_fdatawrite / filemap_fdatawait nor
taking i_mutex. Now given that shared memory doesn't have disk
backing not doing anything in fsync seems fine and I left it out of
the vfs_fsync conversion for now, but in that case we might just
not pass it through to the lower file at all but just call the no-op
simple_sync_file directly.[and now actually export vfs_fsync]
Signed-off-by: Christoph Hellwig
Signed-off-by: Al Viro
18 Oct, 2008
2 commits
-
Offer a "how much VBUS power to request" configuration option
for USB gadgets that aren't using board-specific customization
of their gadget or (composite) configuration drivers.Also remove a couple pointless "depends on USB_GADGET" bits
from the Kconfig text; booleans inside an "if USB_GADGET" will
already have that dependency.Based on a patch from Justin Clacherty.
Signed-off-by: David Brownell
Cc: Justin Clacherty
Tested-by: Robert Jarzmik
Signed-off-by: Greg Kroah-Hartman -
Try to workaround issues with bad SCSI implementations
by ignoring the command size error.Signed-off-by: Felipe Balbi
Acked-by: Alan Stern
Signed-off-by: Greg Kroah-Hartman
17 Oct, 2008
1 commit
-
Change how the file storage gadget driver builds: don't
use separate compilation, since it works poorly when key
parts are library code (with init sections etc). Instead
be as close as we can to "gcc --combine ...".Signed-off-by: David Brownell
Signed-off-by: Greg Kroah-Hartman
26 Jul, 2008
1 commit
-
We want to use WARN() as a variant of WARN_ON(), however a few drivers are
using WARN() internally. This patch renames these to WARNING() to avoid the
namespace clash. A few cases were defining but not using the thing, for those
cases I just deleted the definition.Signed-off-by: Arjan van de Ven
Acked-by: Greg KH
Cc: Karsten Keil
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
22 Jul, 2008
2 commits
-
The bus_id field is going away, use the dev_set_name() function
to set it properly.Signed-off-by: Kay Sievers
Signed-off-by: Greg Kroah-Hartman -
The bus_id field is going away, use the dev_name() function instead.
Signed-off-by: Kay Sievers
Signed-off-by: Greg Kroah-Hartman
03 May, 2008
1 commit
-
Gadget tells controller driver to ignore Clear-Feature(HALT_ENDPOINT)
Signed-off-by: David Lopo
Acked-by: Alan Stern
25 Apr, 2008
2 commits
-
__FUNCTION__ is gcc-specific, use __func__
Signed-off-by: Harvey Harrison
Signed-off-by: Greg Kroah-Hartman -
This patch (as1061) makes g_file_storage more compliant with the
Bulk-Only Transport specification. After an invalid CBW is received,
the gadget must ignore any further bulk-OUT data until it is reset.Signed-off-by: Alan Stern
Signed-off-by: Greg Kroah-Hartman
15 Feb, 2008
1 commit
-
d_path() is used on a pair. Lets use a struct path to
reflect this.[akpm@linux-foundation.org: fix build in mm/memory.c]
Signed-off-by: Jan Blunck
Acked-by: Bryan Wu
Acked-by: Christoph Hellwig
Cc: Al Viro
Cc: "J. Bruce Fields"
Cc: Neil Brown
Cc: Michael Halcrow
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
02 Feb, 2008
1 commit
-
We now have pr_err(), pr_warning(), and friends ... start using
them in the gadget stack instead of printk(KERN_ERR) and friends.
This gives us shorter lines and somewhat increased readability.Signed-off-by: David Brownell
Signed-off-by: Greg Kroah-Hartman
20 Oct, 2007
1 commit
-
The task_struct->pid member is going to be deprecated, so start
using the helpers (task_pid_nr/task_pid_vnr/task_pid_nr_ns) in
the kernel.The first thing to start with is the pid, printed to dmesg - in
this case we may safely use task_pid_nr(). Besides, printks produce
more (much more) than a half of all the explicit pid usage.[akpm@linux-foundation.org: git-drm went and changed lots of stuff]
Signed-off-by: Pavel Emelyanov
Cc: Dave Airlie
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
13 Oct, 2007
4 commits
-
Move to , reducing
some of the clutter in the main include directory.Signed-off-by: David Brownell
Signed-off-by: Greg Kroah-Hartman -
This patch (as983) makes a test for minimum-length command sizes in
g_file_storage less restrictive. It doesn't matter because commands
with bad lengths will be detected later on anyway, and doing it like
this makes the driver interoperable with certain buggy hosts such as
the JVC HiFi (reported by Samuel Hangouet).Signed-off-by: Alan Stern
Signed-off-by: Greg Kroah-Hartman -
This patch (as957) makes some minor cleanups to the g_file_storage
driver:Update the copyright date and version string;
Uniformize the logging macros for the gadget and the LUNs;
Remove "inline" markers -- nowadays we rely on the compiler
to decide which routines are best inlined;Use the print_hex_dump() library routines;
Remove some unnecessary assignments within conditionals
and fix some close-brace indenting levels;Fix some column-80 violations.
Signed-off-by: Alan Stern
Signed-off-by: Greg Kroah-Hartman -
Clean up the file storage gadget, using newer APIs and conventions:
- gadget_is_dualspeed() and gadget_is_otg() ... #ifdef removal
- Remove many now-needless #includes
- Use the DEBUG (from Kconfig+Makefile) and VERBOSE_DEBUG conventions.
- Remove some "sparse" warnings (it still dislikes the __user annotations)
This gave only a minor object code shrinkage.
Signed-off-by: David Brownell
Cc: Alan Stern
Signed-off-by: Greg Kroah-Hartman
23 Aug, 2007
2 commits
-
This patch (as963) fixes a recently-introduced bug. The gadget
conversion removing DMA-mapped buffer allocation did not remove quite
enough code from the g_file_storage driver; DMA pointers were being
set to 0.Signed-off-by: Alan Stern
Signed-off-by: Greg Kroah-Hartman -
This patch makes the File Storage Gadget stall the control endpoint
when a MSC class request is made with wValue != 0. This change makes
some MSC compliance test warnings disappear.Signed-off-by: Luis Lloret
Signed-off-by: Alan Stern
Signed-off-by: Greg Kroah-Hartman
18 Jul, 2007
1 commit
-
Currently, the freezer treats all tasks as freezable, except for the kernel
threads that explicitly set the PF_NOFREEZE flag for themselves. This
approach is problematic, since it requires every kernel thread to either
set PF_NOFREEZE explicitly, or call try_to_freeze(), even if it doesn't
care for the freezing of tasks at all.It seems better to only require the kernel threads that want to or need to
be frozen to use some freezer-related code and to remove any
freezer-related code from the other (nonfreezable) kernel threads, which is
done in this patch.The patch causes all kernel threads to be nonfreezable by default (ie. to
have PF_NOFREEZE set by default) and introduces the set_freezable()
function that should be called by the freezable kernel threads in order to
unset PF_NOFREEZE. It also makes all of the currently freezable kernel
threads call set_freezable(), so it shouldn't cause any (intentional)
change of behaviour to appear. Additionally, it updates documentation to
describe the freezing of tasks more accurately.[akpm@linux-foundation.org: build fixes]
Signed-off-by: Rafael J. Wysocki
Acked-by: Nigel Cunningham
Cc: Pavel Machek
Cc: Oleg Nesterov
Cc: Gautham R Shenoy
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
13 Jul, 2007
2 commits
-
Remove usb_ep_{alloc,free}_buffer() calls, for small dma-coherent buffers.
This patch just removes the interface and its users; later patches will
remove controller driver support.- This interface is invariably not implemented correctly in the
controller drivers (e.g. using dma pools, a mechanism which
post-dates the interface by several years).- At this point no gadget driver really *needs* to use it. In
current kernels, any driver that needs such a mechanism could
allocate a dma pool themselves.Removing this interface is thus a simplification and improvement.
Note that the gmidi.c driver had a bug in this area; fixed.
Signed-off-by: David Brownell
Signed-off-by: Greg Kroah-Hartman -
Disable file_storage USB_CONFIG_ATT_WAKEUP as it requires
user interaction during Chapter 9 tests.Signed-off-by: Tony Lindgren
Acked-by: Alan Stern
Acked-by: David Brownell
Signed-off-by: Greg Kroah-Hartman
26 Jun, 2007
1 commit
-
New changes in the signal-handling code require compensating changes
in g_file_storage. This patch (as913) by Oleg Nesterov makes the
code use allow_signal() instead of sigprocmask().From: Alan Stern
Signed-off-by: Alan Stern
Signed-off-by: Greg Kroah-Hartman
12 Feb, 2007
1 commit
-
Convert all calls to invalidate_inode_pages() into open-coded calls to
invalidate_mapping_pages().Leave the invalidate_inode_pages() wrapper in place for now, marked as
deprecated.Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
08 Feb, 2007
2 commits
-
Went looking through some usb stuff and found some unnecessary casts in
file_storage.c This is part of the KernelJanitors TODO list.Signed-off-by: John Daiker
Acked-by: Alan Stern
Signed-off-by: David Brownell
Signed-off-by: Greg Kroah-Hartman -
This moves to to reduce some of the
clutter of usb header files.Signed-off-by: David Brownell
Signed-off-by: Greg Kroah-Hartman
21 Dec, 2006
1 commit
-
Allow gadget drivers to omit the unbind() method. When they're
statically linked, that's an appropriate memory saving tweak.Similarly, provide consistent/simpler handling for a should-not-happen
error case: removing a peripheral controller driver when a gadget
driver is still loaded. Such code dates back to early versions of the
first implementation of the gadget API, and has never been triggered.Includes relevant section annotation fixs for gmidi.c, file_storage.c,
and serial.c; we don't yet have an "init or exit" annotation. Also
some whitespace fixes in gmidi.c (space at EOL, before tabs, etc).Signed-off-by: David Brownell
Signed-off-by: Greg Kroah-Hartman
09 Dec, 2006
1 commit
-
Signed-off-by: Josef Sipek
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
08 Dec, 2006
1 commit
-
Move process freezing functions from include/linux/sched.h to freezer.h, so
that modifications to the freezer or the kernel configuration don't require
recompiling just about everything.[akpm@osdl.org: fix ueagle driver]
Signed-off-by: Nigel Cunningham
Cc: "Rafael J. Wysocki"
Cc: Pavel Machek
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
02 Oct, 2006
1 commit
-
In some places, particularly drivers and __init code, the init utsns is the
appropriate one to use. This patch replaces those with a the init_utsname
helper.Changes: Removed several uses of init_utsname(). Hope I picked all the
right ones in net/ipv4/ipconfig.c. These are now changed to
utsname() (the per-process namespace utsname) in the previous
patch (2/7)[akpm@osdl.org: CIFS fix]
Signed-off-by: Serge E. Hallyn
Cc: Kirill Korotaev
Cc: "Eric W. Biederman"
Cc: Herbert Poetzl
Cc: Andrey Savochkin
Cc: Serge Hallyn
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
29 Sep, 2006
2 commits
-
Strictly speaking, the Valid bit in SCSI sense data is supposed to
be set only when the Information field contains a valid number. This
patch (as793) turns off the Valid bit when the Information field
hasn't been set.Signed-off-by: Alan Stern
Signed-off-by: Greg Kroah-Hartman -
This patch (as792) fixes "ignoring return value" warnings in
file_storage.c.Signed-off-by: Alan Stern
Signed-off-by: Greg Kroah-Hartman