Grant Likely [Tue, 10 Apr 2012 23:48:42 +0000 (17:48 -0600)]
irq_domain: Fix debug output to use "irq" instead of "virq"
Back when irq_domain was a powerpc-only thing, the term "virq", or
virtual irq, was used to differentiate irq numbers from hardware irq
numbers. However, virqs are synonymous with Linux irq numbers, so
using a different term is confusing. This patch changes the debug
output to use the header "irq" instead of "virq" for the irq number
output column.
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Grant Likely [Tue, 3 Apr 2012 13:11:04 +0000 (07:11 -0600)]
irq: Kill pointless irqd_to_hw export
It makes no sense to export this trivial function. Make it a static inline
instead.
This patch also drops virq_to_hw from arch/c6x since it is unused by that
architecture.
v2: Move irq_hw_number_t into types.h to fix ARM build failure
Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Thomas Gleixner <tglx@linutronix.de> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
David Daney [Thu, 5 Apr 2012 23:52:13 +0000 (16:52 -0700)]
irq/irq_domain: Quit ignoring error returns from irq_alloc_desc_from().
In commit 4bbdd45a (irq_domain/powerpc: eliminate irq_map; use
irq_alloc_desc() instead) code was added that ignores error returns
from irq_alloc_desc_from() by (silently) casting the return value to
unsigned. The negitive value error return now suddenly looks like a
valid irq number.
Commits cc79ca69 (irq_domain: Move irq_domain code from powerpc to
kernel/irq) and 1bc04f2c (irq_domain: Add support for base irq and
hwirq in legacy mappings) move this code to its current location in
irqdomain.c
The result of all of this is a null pointer dereference OOPS if one of
the error cases is hit.
The fix: Don't cast away the negativeness of the return value and then
check for errors.
Signed-off-by: David Daney <david.daney@cavium.com> Acked-by: Rob Herring <rob.herring@calxeda.com>
[grant.likely: dropped addition of new 'irq' variable] Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Dan Williams [Fri, 6 Apr 2012 20:41:15 +0000 (13:41 -0700)]
kobject: provide more diagnostic info for kobject_add_internal() failures
1/ convert open-coded KERN_ERR+dump_stack() to WARN(), so that automated
tools pick up this warning.
2/ include the 'child' and 'parent' kobject names. This information was
useful for tracking down the case where scsi invoked device_del() on a
parent object and subsequently invoked device_add() on a child. Now the
warning looks like:
Dan Williams [Fri, 6 Apr 2012 20:41:06 +0000 (13:41 -0700)]
sysfs: handle 'parent deleted before child added'
In scsi at least two cases of the parent device being deleted before the
child is added have been observed.
1/ scsi is performing async scans and the device is removed prior to the
async can thread running (can happen with an in-opportune / unlikely
unplug during initial scan).
2/ libsas discovery event running after the parent port has been torn
down (this is a bug in libsas).
In this scenario the parent is still valid (because we have a
reference), but it has been device_del()'d which means its kobj->sd
pointer is NULL'd via:
device_del()->kobject_del()->sysfs_remove_dir()
...and then sysfs_create_dir() (without this fix) goes ahead and
de-references parent_sd via sysfs_ns_type():
ASoC: wm9712: Fix build due to missing definition of "runtime"
Fix the following build error:
sound/soc/codecs/wm9712.c:482:32: error: 'runtime' undeclared (first use in this function)
sound/soc/codecs/wm9712.c:499:33: error: 'runtime' undeclared (first use in this function)
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Stephen Warren [Tue, 10 Apr 2012 19:11:17 +0000 (13:11 -0600)]
ASoC: tegra: utils: Don't use of_have_populated_dt()
Recent list discussions concluded that drivers should not be calling
of_have_populated_dt(), and hence of_have_populated_dt() should not be
exported. Use a different mechanism to detect DT vs. non-DT boot.
Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Thomas Abraham [Sun, 25 Mar 2012 15:02:49 +0000 (20:32 +0530)]
of/irq: add empty irq_of_parse_and_map() for non-dt builds
Add a empty irq_of_parse_and_map() function that returns 0 for non-dt
builds and avoid having #ifdef CONFIG_OF around all calls to
irq_of_parse_and_map(). In addition to that, the irq_of_parse_and_map()
function declaration is made available only if CONFIG_OF_IRQ is defined,
which is the same config option that makes the irq_of_parse_and_map()
function definition available. While at it, fix a typo as well.
Changes since v1:
- Moved irq_of_parse_and_map() function declaration under CONFIG_OF_IRQ.
- Fix a minor typo in comments.
Suggested-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org> Acked-by: Rob Herring <rob.herring@calxeda.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Johan Hovold [Tue, 20 Mar 2012 15:59:33 +0000 (16:59 +0100)]
USB: serial: fix race between probe and open
Fix race between probe and open by making sure that the disconnected
flag is not cleared until all ports have been registered.
A call to tty_open while probe is running may get a reference to the
serial structure in serial_install before its ports have been
registered. This may lead to usb_serial_core calling driver open before
port is fully initialised.
With ftdi_sio this result in the following NULL-pointer dereference as
the private data has not been initialised at open:
Roland Stigge [Wed, 4 Apr 2012 00:02:58 +0000 (02:02 +0200)]
gpio: Fix range check in of_gpio_simple_xlate()
of_gpio_simple_xlate() has an off-by-one bug where it checks to see if
args[0] is > ngpio instead of >=. args[0] must always be less than
ngpio because it is a zero-based enumeration.
Signed-off-by: Roland Stigge <stigge@antcom.de>
[grant.likely: beef up commit text] Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Grant Likely [Wed, 28 Mar 2012 20:55:04 +0000 (14:55 -0600)]
gpio/sodaville: Convert sodaville driver to new irqdomain API
The irqdomain api changed significantly in v3.4 which caused a build
failure for this driver.
Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Cc: Hans J. Koch <hjk@linutronix.de> Cc: Torben Hohn <torbenh@linutronix.de>
Grant Likely [Sat, 7 Apr 2012 20:16:53 +0000 (14:16 -0600)]
spi/devicetree: Move devicetree support code into spi directory
The SPI device tree support code isn't shared by any other subsystem. It can
be moved into the core drivers/spi directory and the exported symbol can be
removed.
Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Cc: Rob Herring <rob.herring@calxeda.com>
Shubhrajyoti D [Mon, 26 Mar 2012 11:34:22 +0000 (17:04 +0530)]
spi: omap2-mcspi: add support for pm_runtime autosuspend
Adds support for configuring the omap2-mcspi driver use autosuspend for
runtime power management. This can reduce the latency in starting an
spi transfer by not suspending the device immediately following
completion of a transfer. If another transfer then takes place before
the autosuspend timeout (2 secs), the call to resume the device can
return immediately saving some save/ restore cycles.
Acked-by: Govindraj.R <govindraj.raja@ti.com> Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
Benoit Cousson [Mon, 26 Mar 2012 10:02:33 +0000 (15:32 +0530)]
spi/omap: Remove bus_num usage for instance index
bus_num was used to reference the mcspi controller instance in a fixed array.
Remove this array and store this information directly inside drvdata structure.
bus_num is now just set if the pdev->id is present or with -1 for dynamic
allocation by SPI core, but the driver does not access it anymore.
Clean some bad comments format, and remove un-needed space.
Signed-off-by: Benoit Cousson <b-cousson@ti.com>
[Cleanup the OMAP2_MCSPI_MAX_CTRL macro as it is not needed anymore] Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
Javier Cardona [Sat, 31 Mar 2012 18:31:33 +0000 (11:31 -0700)]
{nl,cfg}80211: Support for mesh synchronization
Report Toffset to userspace.
Let userspace select the mesh synchronization method.
Signed-off-by: Marco Porsch <marco.porsch@s2005.tu-chemnitz.de> Signed-off-by: Pavel Zubarev <pavel.zubarev@gmail.com> Signed-off-by: Javier Cardona <javier@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This patch adds MBSS extensible synchronization framework (Sec.
13.13.2 of IEEE Std. 802.11-2012).
The framework is implemented via an ops table which defines the
following functions:
rx_bcn_presp() - this is called every time a mesh beacon is
received.
adjust_tbtt() - this is called immediately before a beacon is about
to be transmitted.
The default neighbor offset synchronization defined in the standard is
implemented. We also provide template functions for vendor specific
methods.
When neighbor offset synchronization is active (which is the default)
mesh neighbors in the same MBSS will track timing offsets to each other
and compensate clock drift.
In our tests we observed that this mesh synchronization implementation
successfully corrected drifts between stations of ~2PPM while
introducing a jitter of ~20us.
It is also possible to test this framework on mac80211_hwsim simulated
phys to see how it behaves under different topologies, over poor links,
etc.
Signed-off-by: Marco Porsch <marco.porsch@s2005.tu-chemnitz.de> Signed-off-by: Pavel Zubarev <pavel.zubarev@gmail.com> Signed-off-by: Javier Cardona <javier@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Javier Cardona [Sat, 31 Mar 2012 18:31:31 +0000 (11:31 -0700)]
mac80211: Allow tsf increments via debugfs
Reading and writing back the tsf value via tsf is too slow if one wants
to make small increments to this timer. With this change you can use
the syntax "+=<some value>" or "-=<some value>" to add or substract a
value from the tsf counter.
Signed-off-by: Javier Cardona <javier@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Javier Cardona [Sat, 31 Mar 2012 18:31:30 +0000 (11:31 -0700)]
mac80211_hwsim: Fill timestamp beacon at the time it is transmitted
Generate more acurate tsf values in hwsim by setting the tsf value on
trasmitted beacons immediately before they are moved to the rx path.
Also, adjust the beacon timestamp to be the time at which the first byte
of the timestamp is transmitted.
With these changes the observed tsf offset between two hwsim/mesh peers
is 0 (unless the offset is modified via debugfs)
Signed-off-by: Javier Cardona <javier@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>