Seth Jennings [Thu, 6 Oct 2011 19:28:26 +0000 (14:28 -0500)]
staging: zcache: fix crash on cpu remove
In the case that a cpu is taken offline before zcache_do_preload() is
ever called on the cpu, the per-cpu zcache_preloads structure will
be uninitialized. In the CPU_DEAD case for zcache_cpu_notifier(),
kp->obj is not checked before calling kmem_cache_free() on it.
If it is NULL, a crash results.
This patch ensures that both kp->obj and kp->page are not NULL before
calling the respective free functions. In practice, just checking
one or the other should be sufficient since they are assigned together
in zcache_do_preload(), but I check both for safety.
Dan Carpenter [Thu, 6 Oct 2011 06:17:38 +0000 (09:17 +0300)]
Staging: dt3155v4l: silence a compiler warning
The '!' is dead code that was left over from a previous version.
It causes a compiler warning:
drivers/staging/dt3155v4l/dt3155v4l.c:335:3: warning: value computed
is not used
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Acked-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Commit c6fc806247 ("staging:iio: ABI rework - add in_ or out_ prefix to
channnels") added the AD5868_CHANNEL macro to simplify channel initialization.
Unfortunately the macro hardcodes the channel's address to AD5686_ADDR_DAC0. As
a result writing to any of the channels will change the value of the first
channel.
This patch fixes the issue by calculating the channel address based on the
channel number.
staging:iio:dac/dds/impedance dev_info to indio_dev for consistency
We had a random missmatch of these two. Lets pick the most common
and get rid of the other.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
For adxxxx parts Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
staging:iio:core:naming: dev_info to indio_dev for consistency
We had a random missmatch of these two. Lets pick the most common
and get rid of the other. This patch covers the core. Others
will clean up the drivers.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Dan Carpenter [Thu, 6 Oct 2011 06:15:36 +0000 (09:15 +0300)]
Staging: iio/light/tsl2563: fix compile warning
This fixes a compile warning:
drivers/staging/iio/light/tsl2563.c:696:2:
warning: initialization from incompatible pointer type [enabled by default]
drivers/staging/iio/light/tsl2563.c:696:2:
warning: (near initialization for ‘tsl2563_info.write_event_value’) [enabled by default]
The tsl2563_write_thresh() function returns zero on success and error
codes on failure, so nothing is lost by making the return type int
instead of ssize_t.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Staging: hv: remove vmbus_loglevel as it is not used at all anymore
As there is no user of this variable, it's time to delete it. For
dynamic debugging of the hyperv code, use the standard dynamic debug
kernel interface.
Cc: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Staging: hv: move hyperv code out of staging directory
After many years wandering the desert, it is finally time for the
Microsoft HyperV code to move out of the staging directory. Or at least
the core hyperv bus code, and the utility driver, the rest still have
some review to get through by the various subsystem maintainers.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
K. Y. Srinivasan [Mon, 10 Oct 2011 02:42:28 +0000 (19:42 -0700)]
Staging: hv: util: Invoke cn_netlink_send() in a work context
Invoke cn_netlink_send() in a work context as opposed being called
in the context of channel callback. On entry into the channel callback
code the channel inbound spin lock is held and deferring to a work
context avoids having to invoke cn_netlink_send() while holding
the inbound lock. As part of this adjustment, also increase the
timeout value for waiting for the user level component of KVP.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Staging: hv: util: Fix a bug in kvp implementation
The host gurantees that there can be only one kvp transaction active
against the guest. So, the transaction active state is needed only to
protect against spurious user level calls. The current code had a race
condition where the guest could prematurely return because the previous
transaction state was not cleared - this state was being cleared after
sending the response to the host and there was a window where the host
could notify the guest of a new transaction before the transaction active
state was properly set.
Also deal with the case when the user mode component
does not respond in a timely fashion correctly.
I would like to thank Long Li <longli@microsoft.com>
for identifying the problem.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Diagnosed-by: Long Li <longli@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
staging:iio:resolver:ad2s1210 cleanup gpio handling.
Basically make use of the gpio array functions.
Technically the free doesn't need as much info
as given here, but this keeps it clean and easy
to follow.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
There are far too many possible part numbers that are
not covered in here to have such a generic name.
So move to naming after one of the supported parts.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Ensure naming reflects what is measured, not how it is done.
Resolvers can measure the same thing for starters.
IIO_GYRO->IIO_ANGL_VEL to ensure consistent naming.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
staging:iio:resolver:ad2s90 ensure name is passed to iio_core.
Scraps the pointless name define and adds an id table.
It's not technically required in drivers with only one supported
part but it does make the probe code more consistent.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
staging:iio:resolver:ad2s90 fix registration of null pointer
When the new allocation code was introduced a stray pointer
to iio_dev structure was left in the chip state structure.
This was never set but was then registered with the core.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Throughout the data structures within the driver several references
to the driver variables were stored. As the storage and access
functions are now consolidated into srom.c those references are
no longer needed and have been removed.
Reviewed-by: Roland Vossen <rvossen@broadcom.com> Reviewed-by: Alwin Beukers <alwin@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
staging: brcm80211: use identifiers instead of string for srom lookup
The driver variables from srom are stored in memory with string
identifiers and the caller needed to use this string identifier
to retrieve a driver variable. The commit changes the calling
code replacing strings with enumerated identifiers.
Reported-by: Johannes Berg <johannes@sipsolutions.net> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Roland Vossen <rvossen@broadcom.com> Reviewed-by: Alwin Beukers <alwin@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
staging: brcm80211: fix thread blocking issue in brcmf_sdbrcm_bus_stop()
The function brcmf_sdbrcm_bus_stop() terminates the watchdog and dpc
thread, but this function can be called from the dpc thread itself.
Stopping the dpc thread is only done when it is not the 'current'
thread.
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com> Reviewed-by: Roland Vossen <rvossen@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
The driver contained locking macros which map directly to the
lock function provided by the kernel. It does not provide any
additional value so these have been removed.
Reported-by: Johannes Berg <johannes@sipsolutions.net> Reviewed-by: Roland Vossen <rvossen@broadcom.com> Reviewed-by: Alwin Beukers <alwin@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
staging: brcm80211: change parameter in driver variable lookup
The functions getvar() and getintvar() had to pass the buffer
containing the driver variables. Now they pass the structure
containing this buffer hiding what type of buffer/container
is used for storing the driver variables.
staging: brcm80211: remove code duplication for driver variable lookup
The phy code used its own driver variable lookup functions which were
duplicates of those in the brcmsmac driver (in srom.c). The phy code
now uses the functions in srom.c through the phy_shim interface.
staging: brcm80211: move driver variable functions to srom.c
The driver uses variables which are stored in string format. Using
strings as variable identifiers is disliked by the community. The
driver has been cleaned up and the only module providing these
variables is srom.c. The variable retrieval functions have been
moved to srom.c in preparation of a more likable way to store and
lookup these driver variables.
Reported-by: Johannes Berg <johannes@sipsolutions.net> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Alwin Beukers <alwin@broadcom.com> Reviewed-by: Roland Vossen <rvossen@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alwin Beukers [Tue, 4 Oct 2011 21:19:07 +0000 (23:19 +0200)]
staging: brcm80211: removed synchronisation of wlc->machwcap field
- removed copying field wlc->machwcap from brcms_hardware to brcms_c_info
during module attach.
- field wlc->machwcap was written but never read. Therefore it was removed.
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Roland Vossen <rvossen@broadcom.com> Reviewed-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alwin Beukers [Tue, 4 Oct 2011 21:19:06 +0000 (23:19 +0200)]
staging: brcm80211: removed unneeded call to brcms_b_tx_fifo_suspended
- removed call to brcms_b_tx_fifo_suspended on receipt of TX FIFO suspend/flush
completion signal.
- removed brcms_b_tx_fifo_suspended function as it is not being used elsewhere.
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Roland Vossen <rvossen@broadcom.com> Reviewed-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alwin Beukers [Tue, 4 Oct 2011 21:19:02 +0000 (23:19 +0200)]
staging: brcm80211: removed redundant code from brcms_c_set_gmode
The comment says the rateset is being cleared when switching to GMODE_LEGACY_B,
but the code that follows it does not do so. Besides, the rateset is already
valid at this point.
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Roland Vossen <rvossen@broadcom.com> Reviewed-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
staging: brcm80211: remove brcmu_bprintf and related functions
The functions brcmu_bprintf and brcmu_binit could be replaced by
snprintf kernel function. These are no longer used in both brcm80211
drivers so they have been removed.
Reported-by: Johannes Berg <johannes@sipsolutions.net> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Roland Vossen <rvossen@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
staging: brcm80211: remove filtering of received frames
In the receive path of the brcmsmac driver probe request frames and
frames with invalid mac address fields are dropped. This is only
fine for STA mode. Anticipating coming AP and monitor mode functionality
this is unwanted behavior.
Reported-by: Johannes Berg <johannes@sipsolutions.net> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Roland Vossen <rvossen@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Mark Einon [Sat, 1 Oct 2011 10:14:17 +0000 (11:14 +0100)]
staging: et131x: Fix indefinite low power sleep
The mechanism by which the device is put into low power sleep is broken
in that the device can never come back out of low power mode afterwards.
Temorary fix to bring the device back out of sleep almost immediately,
until a suitable wake trigger can be found.
Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Mark Einon [Sat, 1 Oct 2011 10:14:14 +0000 (11:14 +0100)]
staging: et131x: Fix add_timer() from et131x_open
The error_timer was only getting initialised and an initial jiffies value set following a probe.
This could result in the timer needlessly expiring immediately after et131x_open is called.
Now this is all done from the open call instead.
Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Mark Einon [Sat, 1 Oct 2011 10:14:10 +0000 (11:14 +0100)]
staging: et131x: Remove TODO entry 'alloc_etherdev initilising memory with zero'
Removing this as I'm pretty sure its not true, and alloc_etherdev isn't provided by this driver anyway. Alternatively, its a badly written comment and I don't understand it.
This drivers use of alloc_etherdev() is within keeping with other net devices, so I'm happy.
Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
K. Y. Srinivasan [Thu, 29 Sep 2011 18:54:58 +0000 (11:54 -0700)]
Staging: hv: mousevsc: Now cleanup mousevsc_remove()
Now, cleanup mousevsc_remove(). The mouse driver once initialized only
receives data from the host. So, by closing the channel first in the
unload path, we can properly deal with inflight packets. So, we don't need
the machinery for managing the life-cycle of the mousevsc_dev object.
Get rid of the unnecessary code.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>