pandora-kernel.git
12 years agoupdate defconfigs sz_beta1
Grazvydas Ignotas [Thu, 9 Feb 2012 16:56:06 +0000 (18:56 +0200)]
update defconfigs

enable cpuidle, tune debug options

12 years agoASoC: twl4030: in-kernel OSS emu compatibility hack
Grazvydas Ignotas [Fri, 17 Feb 2012 21:42:02 +0000 (23:42 +0200)]
ASoC: twl4030: in-kernel OSS emu compatibility hack

12 years agopandora: fix usbhs platform data
Grazvydas Ignotas [Fri, 17 Feb 2012 23:36:16 +0000 (01:36 +0200)]
pandora: fix usbhs platform data

It turned out wrong OMAP HSUSB port was configured on pandora,
but still managed to work somehow. This was noticed after enabling
in-kernel mux, where USB muxing was causing other devices not to work,
because hsusb1 pins (instead of hsusb2) were wrongly remuxed, that
are used for other things on pandora.

12 years agoinput device rebranding hacks
Grazvydas Ignotas [Fri, 10 Feb 2012 18:06:54 +0000 (20:06 +0200)]
input device rebranding hacks

trying to maintain old device names seen by userspace

12 years agovsense: change reset behavior
Grazvydas Ignotas [Thu, 9 Feb 2012 21:59:01 +0000 (23:59 +0200)]
vsense: change reset behavior

- have to keep gpio requested or it becomes input again
  (.27 did not do that)
- always keep it out of reset, unless user wants otherwise

12 years agopandora: enable wakeup for pandora button
Grazvydas Ignotas [Thu, 9 Feb 2012 13:10:45 +0000 (15:10 +0200)]
pandora: enable wakeup for pandora button

12 years agopandora: add a hack to keep vsim on while not suspended
Grazvydas Ignotas [Sat, 11 Feb 2012 23:45:01 +0000 (01:45 +0200)]
pandora: add a hack to keep vsim on while not suspended

VSIM is used by the lid switch

12 years agoASoC: pandora: switch clock back to internal on stop
Grazvydas Ignotas [Wed, 8 Feb 2012 21:50:58 +0000 (23:50 +0200)]
ASoC: pandora: switch clock back to internal on stop

For some reason, OMAP doesn't enter lower power states with functional
clock (CLKS) source set to external, so switch it back to internal when
done playing.

12 years agoOMAP: DSS2: TPO-TD03MTEA1: update default gamma
Grazvydas Ignotas [Mon, 6 Feb 2012 22:55:12 +0000 (00:55 +0200)]
OMAP: DSS2: TPO-TD03MTEA1: update default gamma

Over time better gamma has been determined and tuned with some
equipment so update the defaults. From subjective point of view
dark shades should be better visible.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
12 years agoOMAP: DSS2: TPO-TD03MTEA1: fix suspend hang
Grazvydas Ignotas [Mon, 6 Feb 2012 22:36:24 +0000 (00:36 +0200)]
OMAP: DSS2: TPO-TD03MTEA1: fix suspend hang

During system suspend, at the time DSS is being suspended, SPI is
already suspended and it's clocks are cut. Because of this trying to
communicate with the LCD controller results in a deadlock.

To fix this, split out LCD programming parts of display enable/disable
functions and perform them from SPI PM callbacks instead when system is
being suspended. If the display is just being enabled/disabled, do it
from DSS callbacks as before.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
12 years agoOMAPDSS: use sync versions of pm_runtime_put
Tomi Valkeinen [Mon, 23 Jan 2012 11:23:08 +0000 (13:23 +0200)]
OMAPDSS: use sync versions of pm_runtime_put

omapdss doesn't work properly on system suspend. The problem seems to be
the fact that omapdss uses pm_runtime_put() functions when turning off
the hardware, and when system suspend is in process only sync versions
are allowed.

Using non-sync versions normally and sync versions when suspending would
need rather ugly hacks to convey the information of
suspending/not-suspending to different functions. Optimally the driver
wouldn't even need to care about this, and the PM layer would handle
syncing when suspend is in process.

This patch changes all omapdss's pm_runtime_put calls to
pm_runtime_put_sync. This fixes the suspend problem, and probably the
performance penalty of always using sync versions is negligible.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Kevin Hilman <khilman@ti.com>
12 years agoARM: OMAP3: hwmod data: add SYSC_HAS_ENAWAKEUP for dispc
Tomi Valkeinen [Mon, 23 Jan 2012 12:15:29 +0000 (14:15 +0200)]
ARM: OMAP3: hwmod data: add SYSC_HAS_ENAWAKEUP for dispc

dispc's sysc_flags is missing SYSC_HAS_ENAWAKEUP flag. This seems to
cause SYNC_LOST errors from the DSS when the power management is
enabled.

This patch adds the missing SYSC_HAS_ENAWAKEUP flag. Note that there are
other flags missing also (clock activity, DSI's sysc flags), but as they
are not critical, they will be fixed in the next merge window.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
12 years agoARM: OMAP2+: hwmod data: split omap2/3 dispc hwmod class
Tomi Valkeinen [Mon, 23 Jan 2012 12:15:28 +0000 (14:15 +0200)]
ARM: OMAP2+: hwmod data: split omap2/3 dispc hwmod class

Currently OMAP2 and 3 share the same omap_hwmod_class and
omap_hwmod_class_sysconfig for dispc. However, OMAP3 has sysconfig
bits that OMAP2 doesn't have, so we need to split those structs into
OMAP2 and OMAP3 specific versions.

This patch only splits the structs, without changing the contents.
This is a prerequisite for a subsequent fix.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
[paul@pwsan.com: added commit note]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
12 years agopandora: update backlight name
Grazvydas Ignotas [Wed, 8 Feb 2012 22:35:56 +0000 (00:35 +0200)]
pandora: update backlight name

12 years agobacklight/pandora_bl.c: update to mainline version
Grazvydas Ignotas [Wed, 8 Feb 2012 22:15:26 +0000 (00:15 +0200)]
backlight/pandora_bl.c: update to mainline version

..that will hopefully appear in 3.4

12 years agobacklight/pandora_bl.c: use backlight core suspend instead
Grazvydas Ignotas [Fri, 3 Feb 2012 14:15:44 +0000 (16:15 +0200)]
backlight/pandora_bl.c: use backlight core suspend instead

can drop some code and perhaps fix a crash.

12 years agoomap: UART: enable powersave by default
Grazvydas Ignotas [Thu, 2 Feb 2012 12:37:15 +0000 (14:37 +0200)]
omap: UART: enable powersave by default

almost no users have serial, so we don't care about lost chars.

12 years agoARM: OMAP3: PM: allow MPU to enter low-power states even when the UART is active
Paul Walmsley [Fri, 13 Jan 2012 10:05:03 +0000 (03:05 -0700)]
ARM: OMAP3: PM: allow MPU to enter low-power states even when the UART is active

For some reason, both the existing OMAP3 PM code and the OMAP3 CPUIdle
driver prevent the MPU powerdomain from entering low-power modes when
any UART isn't asleep.  Possibly it is intended to minimize the ARM
wakeup latency when UART activity arrives, but the UART has a FIFO
that should handle this for most cases, with no dropped characters.  I
may be forgetting something important, though.  And CORE/PER low-power
states are a different matter entirely.

Thanks to NeilBrown <neilb@suse.de> for reporting the problem.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: NeilBrown <neilb@suse.de>
Cc: Joe Woodward <jw@terrafix.co.uk>
Cc: Tero Kristo <t-kristo@ti.com>
Cc: Kevin Hilman <khilman@ti.com>
Cc: Govindraj.R <govindraj.raja@ti.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agousb: musb: wake the device before ulpi transfers
Grazvydas Ignotas [Fri, 3 Feb 2012 16:00:28 +0000 (18:00 +0200)]
usb: musb: wake the device before ulpi transfers

musb can be suspended at the time some other driver wants to do ulpi
transfers using otg_io_* functions, and that can cause data abort,
as it happened with isp1704_charger:
http://article.gmane.org/gmane.linux.kernel/1226122

Add pm_runtime to ulpi functions to rectify this. This also adds io_dev
to otg_transceiver so that pm_runtime can be used.

Cc: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
12 years agomusb suspend crash prevent hack
Grazvydas Ignotas [Wed, 1 Feb 2012 13:23:49 +0000 (15:23 +0200)]
musb suspend crash prevent hack

12 years agogpio/omap: disable debounce on idle
Grazvydas Ignotas [Wed, 1 Feb 2012 13:10:52 +0000 (15:10 +0200)]
gpio/omap: disable debounce on idle

After omap2_gpio_prepare_for_idle call it's not guaranteed that given
GPIO module will hit idle, so it might end up in active state but with
debounce clock disabled, which will break input functionality.

Disable debounce feature on idle to avoid this problem.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
12 years agoMerge branches 'pandora-3.2-aufs', 'pandora-3.2-mru', 'pandora-3.2-picks' and 'pandor...
Grazvydas Ignotas [Sun, 15 Jan 2012 18:13:06 +0000 (20:13 +0200)]
Merge branches 'pandora-3.2-aufs', 'pandora-3.2-mru', 'pandora-3.2-picks' and 'pandora-3.2-pnd' into pandora-3.2

12 years agoadd pandora's defconfigs
Grazvydas Ignotas [Tue, 31 May 2011 22:22:17 +0000 (01:22 +0300)]
add pandora's defconfigs

There are 2 defconfigs now:
- arch/arm/configs/omap3_pandora_defconfig
  proposed kernel config to be used for kernel in firmware
- arch/arm/configs/omap3_pandora_debug_defconfig
  defconfig with debugging options enabled and most stuff built in
  for quick debug sessions.

12 years agobq27x00_battery: delay work a bit on external notification
Grazvydas Ignotas [Sat, 14 Jan 2012 22:10:15 +0000 (00:10 +0200)]
bq27x00_battery: delay work a bit on external notification

..to wait for the chip fully update

12 years agotwl4030_charger: pass supplied_to through platform_data
Grazvydas Ignotas [Sat, 14 Jan 2012 22:05:12 +0000 (00:05 +0200)]
twl4030_charger: pass supplied_to through platform_data

12 years agotwl4030_charger: allow to disable charging from userspace
Grazvydas Ignotas [Sat, 14 Jan 2012 16:39:40 +0000 (18:39 +0200)]
twl4030_charger: allow to disable charging from userspace

12 years agotwl4030_charger: ack and ratelimit monitoring events
Grazvydas Ignotas [Sat, 4 Jun 2011 16:40:44 +0000 (19:40 +0300)]
twl4030_charger: ack and ratelimit monitoring events

12 years agomusb VBUS workaround
Grazvydas Ignotas [Wed, 6 Oct 2010 22:12:09 +0000 (01:12 +0300)]
musb VBUS workaround

For some reason VBUS never falls after cable is disconnected
on pandora. The voltage can be even measured with a multimeter.
This is not the case on a friend's beagle. So this hack was written
to work around this.

12 years agopandora: enable vbus
Grazvydas Ignotas [Thu, 12 Jan 2012 23:50:08 +0000 (01:50 +0200)]
pandora: enable vbus

keep it always enabled for now

12 years agopandora: add power data for poweroff
Grazvydas Ignotas [Thu, 12 Jan 2012 15:17:24 +0000 (17:17 +0200)]
pandora: add power data for poweroff

12 years agopower_supply: twl4030: allow USB charging by default
Grazvydas Ignotas [Sat, 26 Feb 2011 18:00:08 +0000 (20:00 +0200)]
power_supply: twl4030: allow USB charging by default

This is disabled in mainline because we don't know amount of current
host device can provide, but enabling it here regardless like we did
with 2.6.27.

12 years agopandora: setup fn keys for hacked twl4030_keypad
Grazvydas Ignotas [Sat, 26 Jun 2010 20:10:18 +0000 (23:10 +0300)]
pandora: setup fn keys for hacked twl4030_keypad

12 years agoinput: add hackish fn handling to twl4030_keypad
Grazvydas Ignotas [Sat, 26 Jun 2010 20:03:59 +0000 (23:03 +0300)]
input: add hackish fn handling to twl4030_keypad

12 years agopandora: add leds_pwm platform data
Grazvydas Ignotas [Sun, 27 Jun 2010 18:36:11 +0000 (21:36 +0300)]
pandora: add leds_pwm platform data

12 years agoleds: add TWL4030 PWM LED driver
Grazvydas Ignotas [Sun, 27 Jun 2010 16:59:03 +0000 (19:59 +0300)]
leds: add TWL4030 PWM LED driver

Some code contributed by Urja Rannikko <urjaman@gmail.com>

12 years agopandora: add backlight platform data
Grazvydas Ignotas [Mon, 21 Jun 2010 21:43:25 +0000 (00:43 +0300)]
pandora: add backlight platform data

12 years agobacklight: add backlight driver for pandora
Grazvydas Ignotas [Mon, 21 Jun 2010 21:29:10 +0000 (00:29 +0300)]
backlight: add backlight driver for pandora

This is fine-tuned driver for pandora's backlight connected to
TWL4030 PWM0 and LED driver chip.

12 years agopandora: add vsense platform data
Grazvydas Ignotas [Sun, 20 Jun 2010 19:30:21 +0000 (22:30 +0300)]
pandora: add vsense platform data

12 years agoinput: add VSense (analog controller) driver
Grazvydas Ignotas [Sun, 20 Jun 2010 18:34:00 +0000 (21:34 +0300)]
input: add VSense (analog controller) driver

This drives analog nubs on pandora.

12 years agopandora: create proc entry early
Grazvydas Ignotas [Tue, 22 Jun 2010 20:40:52 +0000 (23:40 +0300)]
pandora: create proc entry early

this will avoid needing to handle it in drivers.

12 years agoadd Pandora Linux logo :)
Grazvydas Ignotas [Sun, 20 Jun 2010 19:57:19 +0000 (22:57 +0300)]
add Pandora Linux logo :)

12 years agobq27x00 - don't report power-supply change so often.
NeilBrown [Fri, 30 Dec 2011 00:58:49 +0000 (11:58 +1100)]
bq27x00 - don't report power-supply change so often.

A power_supply_changed should only be reported on significant changes
such as transition between charging and not.  Incremental changes
such as charge increasing should not be reported - that can easily
be polled for.

[notasas@gmail.com: refreshed for Pali Rohár's patches]
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agobq27x00_battery: Fix OOPS caused by unregistring bq27x00 driver
Pali Rohár [Tue, 1 Nov 2011 00:43:11 +0000 (01:43 +0100)]
bq27x00_battery: Fix OOPS caused by unregistring bq27x00 driver

* power_supply_unregister call bq27x00_battery_get_property which
  call bq27x00_battery_poll
* make sure that bq27x00_battery_poll will not call
  schedule_delayed_work again after unregister (which cause OOPS)

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
12 years agobq27x00_battery: Fix reporting error messages
Pali Rohár [Tue, 1 Nov 2011 00:43:09 +0000 (01:43 +0100)]
bq27x00_battery: Fix reporting error messages

* Do not be noise if battery is not calibrated (use dev_dbg)

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
12 years agobq27x00_battery: Cache temperature value in converted unit
Pali Rohár [Tue, 1 Nov 2011 00:43:07 +0000 (01:43 +0100)]
bq27x00_battery: Cache temperature value in converted unit

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
12 years agobq27x00_battery: Cache energy property
Pali Rohár [Tue, 1 Nov 2011 00:43:06 +0000 (01:43 +0100)]
bq27x00_battery: Cache energy property

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
12 years agobq27x00_battery: Report -ENODATA if bq27000 battery was not calibrated
Pali Rohár [Tue, 1 Nov 2011 00:43:05 +0000 (01:43 +0100)]
bq27x00_battery: Report -ENODATA if bq27000 battery was not calibrated

* CI (Capacity Inaccurate) flag is set after full reset on bq27000 battery
* when is set, all capacity properties should be reported incorrectly,
  because there was no learning cycle and battery was not calibrated
* instead reporting incorrect values, report -ENODATA

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
12 years agobq27x00_battery: Add support for property POWER_SUPPLY_PROP_CAPACITY_LEVEL
Pali Rohár [Tue, 1 Nov 2011 00:43:04 +0000 (01:43 +0100)]
bq27x00_battery: Add support for property POWER_SUPPLY_PROP_CAPACITY_LEVEL

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
12 years agobq27x00_battery: Do not cache current_now value for bq27000 batery
Pali Rohár [Tue, 1 Nov 2011 00:43:03 +0000 (01:43 +0100)]
bq27x00_battery: Do not cache current_now value for bq27000 batery

* This prevent reporting old current_now value for bq27000
* Also ask for current flags, to make sure that current_now
  will be reported with correct signature

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
12 years agoARM: Expose some PMON registers through sysfs
Mans Rullgard [Sat, 28 Mar 2009 13:05:02 +0000 (13:05 +0000)]
ARM: Expose some PMON registers through sysfs

12 years agoARM: Add option to allow userspace access to performance counters
Mans Rullgard [Tue, 10 Nov 2009 00:52:56 +0000 (00:52 +0000)]
ARM: Add option to allow userspace access to performance counters

This adds an option to allow userspace access to the performance monitor
registers of the Cortex-A8.

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agoARM: Add option to allow userspace PLE access
Mans Rullgard [Tue, 10 Nov 2009 00:41:54 +0000 (00:41 +0000)]
ARM: Add option to allow userspace PLE access

This adds a Kconfig option to allow userspace to access the L2 preload
engine (PLE) found in Cortex-A8.

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agoARM: Expose some CPU control registers via sysfs
Mans Rullgard [Tue, 10 Nov 2009 00:39:21 +0000 (00:39 +0000)]
ARM: Expose some CPU control registers via sysfs

This creates sysfs files under /sys/devices/system/cpu/cpuN
exposing the values of the control register, auxiliary control
register, and L2 cache auxiliary control register.  Writing to
the files allows setting the value of bits which are safe to
change at any time.

[notasas@gmail.com: add missing include for 3.2]
Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agoFix apparent typos in twl4030_charger.c
NeilBrown [Mon, 21 Nov 2011 09:17:14 +0000 (20:17 +1100)]
Fix apparent typos in twl4030_charger.c

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoARM: Add prompt for CONFIG_ALIGNMENT_TRAP
Mans Rullgard [Mon, 13 Oct 2008 19:32:16 +0000 (20:32 +0100)]
ARM: Add prompt for CONFIG_ALIGNMENT_TRAP

This adds a prompt text for CONFIG_ALIGNMENT_TRAP, thus making it
visible in make *config.

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agoRevert "usb: musb: fix pm_runtime mismatch"
Grazvydas Ignotas [Fri, 13 Jan 2012 15:10:58 +0000 (17:10 +0200)]
Revert "usb: musb: fix pm_runtime mismatch"

This reverts commit 945d49b38f4e3aa8a570b2fe51f179e7c2181b4d.
It breaks runtipe_suspend, keeps device always on.

12 years agousb: musb: fix shutdown while usb gadget is in use
Grazvydas Ignotas [Thu, 12 Jan 2012 12:25:15 +0000 (14:25 +0200)]
usb: musb: fix shutdown while usb gadget is in use

If we shutdown without stopping the gadget first or removing the cable,
gadget manages to configure itself again:

root@pandora /root# poweroff
The system is going down NOW!
Requesting system poweroff
[   47.714385] musb-hm halted.
[   48.120697]  gadget: suspend
[   48.123748]  gadget: reset config
[   48.127227]  gadget: ecm deactivated
[   48.130981] usb0: gether_disconnect
[   48.281799]  gadget: high-speed config #1: CDC Ethernet (ECM)
[   48.287872]  gadget: init ecm
[   48.290985]  gadget: notify connect false
[   48.295288]  gadget: notify speed 425984000

This is not only unwanted, it's also happening on half-unitialized
state, after musb_shutdown() has returned, which sometimes causes
hardware to fail to work after reboot. Let's better properly stop
gadget on shutdown too.

This patch moves musb_gadget_cleanup out of musb_free(), which has 2
callsites: probe error path and musb_remove. On probe error path it was
superflous since musb_gadget_cleanup is called explicitly there, and
musb_remove() calls musb_shutdown(), so cleanup will get called as before.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
12 years agousb: musb: drop superfluous pm_runtime calls around musb_shutdown
Grazvydas Ignotas [Thu, 12 Jan 2012 12:13:09 +0000 (14:13 +0200)]
usb: musb: drop superfluous pm_runtime calls around musb_shutdown

Since commit 4f9edd2d7e8d "usb: musb: Fix the crash issue during reboot"
musb_shutdown() does pm_runtime_get_sync/pm_runtime_put by itself, so
this no longer needs to be done by the caller. Also, musb_exit_debugfs()
doesn't access the device, so just drop those runtime_pm calls.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
12 years agoARM: OMAP: fix MMC2 loopback clock handling
Grazvydas Ignotas [Wed, 11 Jan 2012 14:03:48 +0000 (16:03 +0200)]
ARM: OMAP: fix MMC2 loopback clock handling

Currently MMC2 setup code can only enable loopback clock and
relies on reset value for boards that need to have it disabled.
This causes a problem with certain bootloaders that always enable
that clock, resulting in unwanted bootloader dependencies.
Fix this by making it disable the clock if board data says so.

12 years agoARM: OMAP: fix erroneous mmc2 clock change on mmc3 setup
Grazvydas Ignotas [Sun, 18 Dec 2011 00:00:40 +0000 (02:00 +0200)]
ARM: OMAP: fix erroneous mmc2 clock change on mmc3 setup

hsmmc23_before_set_reg() can set MMCSDIO2ADPCLKISEL bit, which
enables internal clock for MMC2. Currently this function is also called
by code handling MMC3, and if .internal_clock is set in platform data
(by default it currently is), it will set MMCSDIO2ADPCLKISEL for MMC2
instead of MMC3 (MMC3 doesn't have such bit so nothing actually needs to
be done). This breaks 2nd SD slot on pandora.

Fix this by changing hsmmc23_before_set_reg() to only handle MMC2.
Note that this removes .remux() call for MMC3, but no board currently
needs it and it's also not called for MMC4 and MMC5.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
12 years agoOMAP3: hwmod_data: register dss hwmods after dss_core
Ilya Yanok [Tue, 27 Dec 2011 23:31:33 +0000 (00:31 +0100)]
OMAP3: hwmod_data: register dss hwmods after dss_core

dss_core has to be initialized before any other DSS hwmod. Currently
this is broken as dss_core is listed in chip/revision specific hwmod
lists while other DSS hwmods are listed in common list which is
registered first.

This patch moves DSS hwmods (except for dss_core) to the separate list
which is registered last to ensure that dss_core is already registered.

This solves the problem with BUG() in L3 interrupt handler on boards
with DSS enabled in bootloader.

CC: Tomi Valkeinen <tomi.valkeinen@ti.com>
CC: Archit Taneja <archit@ti.com>
CC: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Ilya Yanok <yanok@emcraft.com>
12 years agousb: musb: omap2+: save and restore OTG_INTERFSEL
Hema HK [Wed, 7 Sep 2011 16:19:24 +0000 (09:19 -0700)]
usb: musb: omap2+: save and restore OTG_INTERFSEL

we need to save and restore OTG_INTERFSEL register
else we will be unable to function on resume after
OFF mode.

Reported-by: Devaraj Rangasamy <dev@ti.com>
Signed-off-by: Hema HK <hemahk@ti.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
12 years agousb: musb: omap2+: fix context api's
Vikram Pandita [Wed, 7 Sep 2011 16:19:23 +0000 (09:19 -0700)]
usb: musb: omap2+: fix context api's

RxFifoSz, TxFifoSz, RxFifoAddr, TxFifoAddr
are all indexed registers.

So before doing a context save or restore, INDEX register
should be set, then only one gets to the right register offset.

Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
12 years agomfd: Add power off functionality to TWL
Igor Grinberg [Sun, 13 Nov 2011 09:49:50 +0000 (11:49 +0200)]
mfd: Add power off functionality to TWL

TWL family of PMICs, used in master mode, have a power off
functionality. The resulting power off sequence shuts down all the SoC
supplies, LDOs, etc. The sequence is described in the datasheets
chapter "Power-Off Sequence".
Note, that board must be wired correctly for the power off to work as
expected.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agommc: omap_hsmmc: use threaded irq handler for card-detect.
NeilBrown [Fri, 30 Dec 2011 01:35:13 +0000 (12:35 +1100)]
mmc: omap_hsmmc: use threaded irq handler for card-detect.

As the card-detect irq handler just schedules work to be done by a
thread, we can use request_threaded_irq to do much of the work for
us.  This means that interrupts which arrive by handle_nested_irq
actually work.

Reviewed-by: Felipe Balbi <balbi@ti.com>
Tested-by: Grazvydas Ignotas <notasas@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Acked-by: Kishore Kadiyala <kishorek.kadiyala@gmail.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agoARM: OMAP3: hwmod data: disable multiblock reads on MMC1/2 on OMAP34xx/35xx <= ES2.1
Paul Walmsley [Fri, 16 Dec 2011 06:30:44 +0000 (23:30 -0700)]
ARM: OMAP3: hwmod data: disable multiblock reads on MMC1/2 on OMAP34xx/35xx <= ES2.1

The HSMMC1/HSMMC2 host controllers on OMAP34xx and
OMAP3503/3515/3525/3530 chips at ES levels prior to 3.0 can't do multiple
block reads[1].  Mark the hwmod data appropriately.

Reported by Dave Hylands <dhylands@gmail.com> and Steve Sakoman
<sakoman@gmail.com>.  Thanks to Steve Sakoman for further help
testing this patch.

1. See for example Advisory 2.1.1.128 "MMC: Multiple Block Read
   Operation Issue" in _OMAP3530/3525/3515/3503 Silicon Errata_
   Revision F (October 2010) (SPRZ278F), available from
   http://focus.ti.com/lit/er/sprz278f/sprz278f.pdf

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Dave Hylands <dhylands@gmail.com>
Cc: Steve Sakoman <sakoman@gmail.com>
12 years agoARM: OMAP: hwmod data: fix the panic on Nokia RM-680 during boot
Aaro Koskinen [Fri, 16 Dec 2011 05:38:37 +0000 (22:38 -0700)]
ARM: OMAP: hwmod data: fix the panic on Nokia RM-680 during boot

Booting the Linux kernel on Nokia RM-680 board has been broken since
2.6.39 due to the following:

[    0.217193] omap_hwmod: timer12: enabling
[    0.221435] Unhandled fault: external abort on non-linefetch (0x1028) at 0xfa304010
[    0.229431] Internal error: : 1028 [#1] SMP
[    0.233825] Modules linked in:
[    0.237060] CPU: 0    Not tainted  (3.2.0-rc4-dirty #46)
[    0.242645] PC is at _update_sysc_cache+0x2c/0x7c
[    0.247589] LR is at _enable+0x1b0/0x2d8
[    0.251708] pc : [<c0026108>]    lr : [<c0026df4>]    psr: 40000013
[    0.251708] sp : ef831f40  ip : ef82f380  fp : c06ac0c0
[    0.263702] r10: 00000000  r9 : c05dfb2c  r8 : ef830000
[    0.269165] r7 : c0027494  r6 : 00000000  r5 : 00000000  r4 : c06608b0
[    0.276000] r3 : fa304000  r2 : 00000010  r1 : c0661e28  r0 : c06608b0
[    0.282806] Flags: nZcv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
[    0.290405] Control: 10c5387d  Table: 80004019  DAC: 00000017
[    0.296417] Process swapper (pid: 1, stack limit = 0xef8302f8)
[    0.302520] Stack: (0xef831f40 to 0xef832000)
[    0.307098] 1f40: c06608b0 c0026df4 c06ad094 c0035120 00000001 c06608b0 00000000 c0027530
[    0.315612] 1f60: c0027604 ef830000 c05dfb2c c06608b0 c0642ac0 c0025bf0 c0621234 c062120c
[    0.324127] 1f80: c0621738 00000013 ef830000 c05dfb6c c0621234 c0008688 c062c880 c009eadc
[    0.332641] 1fa0: 0000005f 00000000 c0621738 35390013 00000000 00000000 00000000 0000019a
[    0.341156] 1fc0: c0681cf4 c0621234 c062120c c0621738 00000013 00000000 00000000 00000000
[    0.349670] 1fe0: 00000000 c05d5298 00000000 c05d5200 c0014fa8 c0014fa8 ffff0000 ffff0000
[    0.358184] [<c0026108>] (_update_sysc_cache+0x2c/0x7c) from [<c0026df4>] (_enable+0x1b0/0x2d8)
[    0.367248] [<c0026df4>] (_enable+0x1b0/0x2d8) from [<c0027530>] (_setup+0x9c/0x170)
[    0.375335] [<c0027530>] (_setup+0x9c/0x170) from [<c0025bf0>] (omap_hwmod_for_each+0x38/0x58)
[    0.384307] [<c0025bf0>] (omap_hwmod_for_each+0x38/0x58) from [<c05dfb6c>] (omap_hwmod_setup_all+0x40/0xa0)
[    0.394409] [<c05dfb6c>] (omap_hwmod_setup_all+0x40/0xa0) from [<c0008688>] (do_one_initcall+0x34/0x180)
[    0.404296] [<c0008688>] (do_one_initcall+0x34/0x180) from [<c05d5298>] (kernel_init+0x98/0x144)
[    0.413452] [<c05d5298>] (kernel_init+0x98/0x144) from [<c0014fa8>] (kernel_thread_exit+0x0/0x8)
[    0.422576] Code: e3130c01 1590304c 0590304c 119320b2 (07932002)
[    0.429046] ---[ end trace 1b75b31a2719ed1c ]---
[    0.433959] Kernel panic - not syncing: Attempted to kill init!

Timer 12 is not necessarily available on non-GP devices (see e.g.
http://marc.info/?l=linux-omap&m=129433066521102&w=2), so it should be
registered only on GP OMAPs. With this change it's again possible to
boot RM-680 into the shell. Tested with 3.2-rc4.

Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
[paul@pwsan.com: changed subject line]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
12 years agoARM: OMAP2+: DMA: Workaround for invalid destination position
Peter Ujfalusi [Fri, 9 Dec 2011 21:38:00 +0000 (13:38 -0800)]
ARM: OMAP2+: DMA: Workaround for invalid destination position

If the DMA destination position has been asked before the
first actual data transfer has been done, the CDAC
register still contains 0 (it is initialized to 0 at
omsp_dma_start).
If CDAC == 0, return the programmed start address.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Reviewed-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
12 years agoARM: OMAP2+: DMA: Workaround for invalid source position
Peter Ujfalusi [Fri, 9 Dec 2011 21:38:00 +0000 (13:38 -0800)]
ARM: OMAP2+: DMA: Workaround for invalid source position

If the DMA source position has been asked before the
first actual data transfer has been done, the CSAC
register does not contain valid information.
We can identify this situation by checking the CDAC
register:
CDAC != 0 indicates that the DMA transfer on the channel has
been started already.
When CDAC == 0 we can not trust the CSAC value since it has
not been updated, and can contain random number.
Return the start address in case the DMA has not jet started.

Note: The CDAC register has been initialized to 0 at dma_start
time.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Reviewed-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
12 years agomfd: Fix twl4030-irq typo
NeilBrown [Sat, 26 Nov 2011 20:17:41 +0000 (07:17 +1100)]
mfd: Fix twl4030-irq typo

overwriten -> overwritten

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Set twl4030-irq tertiary interrupts to be nested/threaded.
NeilBrown [Sat, 26 Nov 2011 20:17:41 +0000 (07:17 +1100)]
mfd: Set twl4030-irq tertiary interrupts to be nested/threaded.

As tertiary interrupts are handled by handle_twl4030_sih calling
handle_nested_irq, they do not need their own separate irq thread.
So mark them as 'nested_thread' interrupts to avoid the extra thread
creation.

Tested on GTA04 Pheonux.

Signed-off-by: NeilBrown <neilb@suse.de>
Tested-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agocpufreq: OMAP: fixup for omap_device changes, include <linux/module.h>
Kevin Hilman [Fri, 30 Sep 2011 17:41:26 +0000 (10:41 -0700)]
cpufreq: OMAP: fixup for omap_device changes, include <linux/module.h>

Minor fixups to work starting with v3.2:
- use the new omap_device API for getting a device by name.
- need to include <linux/module.h>

Signed-off-by: Kevin Hilman <khilman@ti.com>
12 years agocpufreq: OMAP: fix freq_table leak
Nishanth Menon [Fri, 27 May 2011 02:39:20 +0000 (19:39 -0700)]
cpufreq: OMAP: fix freq_table leak

We use a single frequency table for multiple CPUs. But, with
OMAP4, since we have multiple CPUs, the cpu_init call for CPU1
causes freq_table previously allocated for CPU0 to be overwritten.
In addition, we dont free the table on exit path.

We solve this by maintaining an atomic type counter to ensure
just a single table exists at a given time.

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
12 years agocpufreq: OMAP: put clk if cpu_init failed
Nishanth Menon [Fri, 27 May 2011 02:39:19 +0000 (19:39 -0700)]
cpufreq: OMAP: put clk if cpu_init failed

Release the mpu_clk in fail paths.

Reported-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
12 years agocpufreq: OMAP: only supports OPP library
Nishanth Menon [Fri, 27 May 2011 02:39:18 +0000 (19:39 -0700)]
cpufreq: OMAP: only supports OPP library

OMAP2 is the only family using clk_[init|exit]_cpufreq_table, however,
the cpufreq code does not currently use clk_init_cpufreq_table. As a
result, it is unusuable for OMAP2 and only usable only on platforms
using OPP library.

Remove the unbalanced clk_exit_cpufreq_table().  Any platforms where
OPPs are not availble will fail on init because a freq table will not
be properly initialized.

Signed-off-by: Nishanth Menon <nm@ti.com>
[khilman@ti.com: changelog edits, and graceful failure mode changes]
Signed-off-by: Kevin Hilman <khilman@ti.com>
12 years agocpufreq: OMAP: dont support !freq_table
Nishanth Menon [Fri, 27 May 2011 02:39:17 +0000 (19:39 -0700)]
cpufreq: OMAP: dont support !freq_table

OMAP2+ all have frequency tables, hence the hacks we had for older
silicon do not need to be carried forward. As part of this change,
use cpufreq_frequency_table_target to find the best match for
frequency requested.

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
12 years agocpufreq: OMAP: deny initialization if no mpudev
Nishanth Menon [Wed, 25 May 2011 23:38:47 +0000 (16:38 -0700)]
cpufreq: OMAP: deny initialization if no mpudev

if we do not have mpu_dev we normally fail in cpu_init. It is better
to fail driver registration if the devices are not available.

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
12 years agocpufreq: OMAP: move clk name decision to init
Nishanth Menon [Wed, 25 May 2011 23:38:46 +0000 (16:38 -0700)]
cpufreq: OMAP: move clk name decision to init

Clk name does'nt need to dynamically detected during clk init.
move them off to driver initialization, if we dont have a clk name,
there is no point in registering the driver anyways. The actual clk
get and put is left at cpu_init and exit functions.

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
12 years agocpufreq: OMAP: notify even with bad boot frequency
Colin Cross [Tue, 7 Jun 2011 02:05:29 +0000 (21:05 -0500)]
cpufreq: OMAP: notify even with bad boot frequency

Sometimes, bootloaders starts up with a frequency which is not
in the OPP table. At cpu_init, policy->cur contains the frequency
we pick at boot.  It is possible that system might have fixed
it's boot frequency later on as part of power initialization.
After this condition, the first call to omap_target results in the
following:

omap_getspeed(actual device frequency) != policy->cur(frequency that
cpufreq thinks that the system is at), and it is possible that
freqs.old == freqs.new (because the governor requested a scale down).

We exit without triggering the notifiers in the current code, which
does'nt let code which depends on cpufreq_notify_transition to have
accurate information as to what the system frequency is.

Instead, we do a normal transition if policy->cur is wrong, then,
freqs.old will be the actual cpu frequency, freqs.new will be the
actual new cpu frequency and all required notifiers have the accurate
information.

Acked-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Colin Cross <ccross@google.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
12 years agocpufreq: OMAP: Enable all CPUs in shared policy mask
Todd Poynor [Tue, 7 Jun 2011 20:57:52 +0000 (13:57 -0700)]
cpufreq: OMAP: Enable all CPUs in shared policy mask

Enable all CPUs in the shared policy in the CPU init callback.
Otherwise, the governor CPUFREQ_GOV_START event is invoked with
a policy that only includes the first CPU, leaving other CPUs
uninitialized by the governor.

Signed-off-by: Todd Poynor <toddpoynor@google.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
12 years agocpufreq: OMAP: Add SMP support for OMAP4+
Russell King [Wed, 21 Sep 2011 23:53:00 +0000 (16:53 -0700)]
cpufreq: OMAP: Add SMP support for OMAP4+

On OMAP SMP configuartion, both processors share the voltage
and clock. So both CPUs needs to be scaled together and hence
needs software co-ordination.

Also, update lpj with reference value to avoid progressive error.

Adjust _both_ the per-cpu loops_per_jiffy and global lpj. Calibrate
them with with reference to the initial values to avoid a
progressively bigger and bigger error in the value over time.

While at this, re-use the notifiers for UP/SMP since on UP machine or
UP_ON_SMP policy->cpus mask would contain only the boot CPU.

Based on initial SMP support by Santosh Shilimkar.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
[khilman@ti.com: due to overlap/rework, combined original Santosh patch
                 and Russell's rework]
Signed-off-by: Kevin Hilman <khilman@ti.com>
12 years agocpufreq: OMAP: cleanup for multi-SoC support, move into drivers/cpufreq
Santosh Shilimkar [Thu, 12 Aug 2010 00:02:43 +0000 (17:02 -0700)]
cpufreq: OMAP: cleanup for multi-SoC support, move into drivers/cpufreq

Move OMAP cpufreq driver from arch/arm/mach-omap2 into
drivers/cpufreq, along with a few cleanups:

- generalize support for better handling of different SoCs in the OMAP
- use OPP layer instead of OMAP clock internals for frequency table init

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
[khilman@ti.com: move to drivers]
Signed-off-by: Kevin Hilman <khilman@ti.com>
12 years agoaufs: aufs3 kbuild patch
aufs project [Tue, 10 Jan 2012 16:03:54 +0000 (18:03 +0200)]
aufs: aufs3 kbuild patch

12 years agoaufs: aufs3 standalone patch
aufs project [Tue, 10 Jan 2012 16:03:53 +0000 (18:03 +0200)]
aufs: aufs3 standalone patch

12 years agoaufs: aufs3 base patch
aufs project [Tue, 10 Jan 2012 16:03:53 +0000 (18:03 +0200)]
aufs: aufs3 base patch

12 years agoaufs: add files
aufs project [Tue, 10 Jan 2012 16:03:52 +0000 (18:03 +0200)]
aufs: add files

12 years agoLinux 3.2.1 v3.2.1
Greg Kroah-Hartman [Thu, 12 Jan 2012 19:42:45 +0000 (11:42 -0800)]
Linux 3.2.1

12 years agoxfs: fix acl count validation in xfs_acl_from_disk()
Xi Wang [Mon, 12 Dec 2011 21:55:52 +0000 (21:55 +0000)]
xfs: fix acl count validation in xfs_acl_from_disk()

commit 093019cf1b18dd31b2c3b77acce4e000e2cbc9ce upstream.

Commit fa8b18ed didn't prevent the integer overflow and possible
memory corruption.  "count" can go negative and bypass the check.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: cdc-acm: Fix acm_tty_hangup() vs. acm_tty_close() race
Thilo-Alexander Ginkel [Sat, 17 Dec 2011 09:55:10 +0000 (10:55 +0100)]
usb: cdc-acm: Fix acm_tty_hangup() vs. acm_tty_close() race

[Not upstream as it was fixed differently for 3.3 with a much more
"intrusive" rework of the driver - gregkh]

There is a race condition involving acm_tty_hangup() and acm_tty_close()
where hangup() would attempt to access tty->driver_data without proper
locking and NULL checking after close() has potentially already set it
to NULL.  One possibility to (sporadically) trigger this behavior is to
perform a suspend/resume cycle with a running WWAN data connection.

This patch addresses the issue by introducing a NULL check for
tty->driver_data in acm_tty_hangup() protected by open_mutex and exiting
gracefully when hangup() is invoked on a device that has already been
closed.

Signed-off-by: Thilo-Alexander Ginkel <thilo@ginkel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agobonding: fix error handling if slave is busy (v2)
stephen hemminger [Sat, 31 Dec 2011 13:26:46 +0000 (13:26 +0000)]
bonding: fix error handling if slave is busy (v2)

commit f7d9821a6a9c83450ac35e76d3709e32fd38b76f upstream.

If slave device already has a receive handler registered, then the
error unwind of bonding device enslave function is broken.

The following will leave a pointer to freed memory in the slave
device list, causing a later kernel panic.
# modprobe dummy
# ip li add dummy0-1 link dummy0 type macvlan
# modprobe bonding
# echo +dummy0 >/sys/class/net/bond0/bonding/slaves

The fix is to detach the slave (which removes it from the list)
in the unwind path.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Reviewed-by: Nicolas de Pesloüan <nicolas.2p.debian@free.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agoasix: fix infinite loop in rx_fixup()
Aurelien Jacobs [Sat, 7 Jan 2012 20:15:16 +0000 (12:15 -0800)]
asix: fix infinite loop in rx_fixup()

commit 6c15d74defd38e7e7f8805392578b7a1d508097e upstream.

At this point if skb->len happens to be 2, the subsequant skb_pull(skb, 4)
call won't work and the skb->len won't be decreased and won't ever reach 0,
resulting in an infinite loop.

With an ASIX 88772 under heavy load, without this patch, rx_fixup() reaches
an infinite loop in less than a minute. With this patch applied,
no infinite loop even after hours of heavy load.

Signed-off-by: Aurelien Jacobs <aurel@gnuage.org>
Cc: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoigmp: Avoid zero delay when receiving odd mixture of IGMP queries
Ben Hutchings [Mon, 9 Jan 2012 22:06:46 +0000 (14:06 -0800)]
igmp: Avoid zero delay when receiving odd mixture of IGMP queries

commit a8c1f65c79cbbb2f7da782d4c9d15639a9b94b27 upstream.

Commit 5b7c84066733c5dfb0e4016d939757b38de189e4 ('ipv4: correct IGMP
behavior on v3 query during v2-compatibility mode') added yet another
case for query parsing, which can result in max_delay = 0.  Substitute
a value of 1, as in the usual v3 case.

Reported-by: Simon McVittie <smcv@debian.org>
References: http://bugs.debian.org/654876
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agousb: ch9: fix up MaxStreams helper
Felipe Balbi [Mon, 2 Jan 2012 11:35:41 +0000 (13:35 +0200)]
usb: ch9: fix up MaxStreams helper

commit 18b7ede5f7ee2092aedcb578d3ac30bd5d4fc23c upstream.

[ removed the dwc3 portion of the patch as it didn't apply to
older kernels - gregkh]

According to USB 3.0 Specification Table 9-22, if
bmAttributes [4:0] are set to zero, it means "no
streams supported", but the way this helper was
defined on Linux, we will *always* have one stream
which might cause several problems.

For example on DWC3, we would tell the controller
endpoint has streams enabled and yet start transfers
with Stream ID set to 0, which would goof up the host
side.

While doing that, convert the macro to an inline
function due to the different checks we now need.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agoxhci: Properly handle COMP_2ND_BW_ERR
Hans de Goede [Wed, 4 Jan 2012 22:29:18 +0000 (23:29 +0100)]
xhci: Properly handle COMP_2ND_BW_ERR

commit 71d85724bdd947a3b42a88d08af79f290a1a767b upstream.

I encountered a result of COMP_2ND_BW_ERR while improving how the pwc
webcam driver handles not having the full usb1 bandwidth available to
itself.

I created the following test setup, a NEC xhci controller with a
single TT USB 2 hub plugged into it, with a usb keyboard and a pwc webcam
plugged into the usb2 hub. This caused the following to show up in dmesg
when trying to stream from the pwc camera at its highest alt setting:

xhci_hcd 0000:01:00.0: ERROR: unexpected command completion code 0x23.
usb 6-2.1: Not enough bandwidth for altsetting 9

And usb_set_interface returned -EINVAL, which caused my pwc code to not
do the right thing as it expected -ENOSPC.

This patch makes the xhci driver properly handle COMP_2ND_BW_ERR and makes
usb_set_interface return -ENOSPC as expected.

This should be backported to stable kernels as old as 2.6.32.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: fix number of mapped SG DMA entries
Clemens Ladisch [Sat, 3 Dec 2011 22:41:31 +0000 (23:41 +0100)]
usb: fix number of mapped SG DMA entries

commit bc677d5b64644c399cd3db6a905453e611f402ab upstream.

Add a new field num_mapped_sgs to struct urb so that we have a place to
store the number of mapped entries and can also retain the original
value of entries in num_sgs.  Previously, usb_hcd_map_urb_for_dma()
would overwrite this with the number of mapped entries, which would
break dma_unmap_sg() because it requires the original number of entries.

This fixes warnings like the following when using USB storage devices:
 ------------[ cut here ]------------
 WARNING: at lib/dma-debug.c:902 check_unmap+0x4e4/0x695()
 ehci_hcd 0000:00:12.2: DMA-API: device driver frees DMA sg list with different entry count [map count=4] [unmap count=1]
 Modules linked in: ohci_hcd ehci_hcd
 Pid: 0, comm: kworker/0:1 Not tainted 3.2.0-rc2+ #319
 Call Trace:
  <IRQ>  [<ffffffff81036d3b>] warn_slowpath_common+0x80/0x98
  [<ffffffff81036de7>] warn_slowpath_fmt+0x41/0x43
  [<ffffffff811fa5ae>] check_unmap+0x4e4/0x695
  [<ffffffff8105e92c>] ? trace_hardirqs_off+0xd/0xf
  [<ffffffff8147208b>] ? _raw_spin_unlock_irqrestore+0x33/0x50
  [<ffffffff811fa84a>] debug_dma_unmap_sg+0xeb/0x117
  [<ffffffff8137b02f>] usb_hcd_unmap_urb_for_dma+0x71/0x188
  [<ffffffff8137b166>] unmap_urb_for_dma+0x20/0x22
  [<ffffffff8137b1c5>] usb_hcd_giveback_urb+0x5d/0xc0
  [<ffffffffa0000d02>] ehci_urb_done+0xf7/0x10c [ehci_hcd]
  [<ffffffffa0001140>] qh_completions+0x429/0x4bd [ehci_hcd]
  [<ffffffffa000340a>] ehci_work+0x95/0x9c0 [ehci_hcd]
  ...
 ---[ end trace f29ac88a5a48c580 ]---
 Mapped at:
  [<ffffffff811faac4>] debug_dma_map_sg+0x45/0x139
  [<ffffffff8137bc0b>] usb_hcd_map_urb_for_dma+0x22e/0x478
  [<ffffffff8137c494>] usb_hcd_submit_urb+0x63f/0x6fa
  [<ffffffff8137d01c>] usb_submit_urb+0x2c7/0x2de
  [<ffffffff8137dcd4>] usb_sg_wait+0x55/0x161

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agoUSB: Add USB-ID for Multiplex RC serial adapter to cp210x.c
Malte Schröder [Thu, 5 Jan 2012 19:34:40 +0000 (20:34 +0100)]
USB: Add USB-ID for Multiplex RC serial adapter to cp210x.c

commit 08e87d0d773dc9ca5faf4c3306e238ed0ea129b0 upstream.

Hi, below patch adds the USB-ID of the serial adapters sold by
Multiplex RC (www.multiplex-rc.de).

Signed-off-by: Malte Schröder <maltesch@gmx.de>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: option: add ZD Incorporated HSPA modem
Janne Snabb [Wed, 28 Dec 2011 19:36:00 +0000 (19:36 +0000)]
usb: option: add ZD Incorporated HSPA modem

commit 3c8c9316710b83e906e425024153bf0929887b59 upstream.

Add support for Chinese Noname HSPA USB modem which is apparently
manufactured by a company called ZD Incorporated (based on texts in the
Windows drivers).

This product is available at least from Dealextreme (SKU 80032) and
possibly in India with name Olive V-MW250. It is based on Qualcomm
MSM6280 chip.

I needed to also add "options usb-storage quirks=0685:7000:i" in modprobe
configuration because udevd or the kernel keeps poking the embedded
fake-cd-rom which fails and causes the device to reset. There might be
a better way to accomplish the same. usb_modeswitch is not needed with
this device.

Signed-off-by: Janne Snabb <snabb@epipe.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agoUSB: omninet: fix write_room
Johan Hovold [Sun, 6 Nov 2011 18:06:21 +0000 (19:06 +0100)]
USB: omninet: fix write_room

commit 694c6301e515bad574af74b6552134c4d9dcb334 upstream.

Fix regression introduced by commit 507ca9bc047666 ([PATCH] USB: add
ability for usb-serial drivers to determine if their write urb is
currently being used.) which inverted the logic in write_room so that it
returns zero when the write urb is actually free.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: musb: fix pm_runtime mismatch
Felipe Contreras [Mon, 19 Dec 2011 20:01:54 +0000 (22:01 +0200)]
usb: musb: fix pm_runtime mismatch

commit 772aed45b604c5ff171f0f12c12392d868333f79 upstream.

In musb_init_controller() there's a pm_runtime_put(), but there's no
pm_runtime_get(), which creates a mismatch that causes the driver to
sleep when it shouldn't.

This was introduced in 7acc619[1], but it wasn't triggered in my setup
until 18a2689[2] was merged to Linus' branch at point df0914[3]. IOW;
when PM is working as it was supposed to.

However, it seems most of the time this is used in a way that keeps the
counter above 0, so nobody noticed. Also, it seems to depend on the
configuration used in versions before 3.1, but not later (or in it).

I found the problem by loading isp1704_charger before any usb gadgets:
http://article.gmane.org/gmane.linux.kernel/1226122

All versions after 2.6.39 are affected.

[1] usb: musb: Idle path retention and offmode support for OMAP3
[2] OMAP2+: musb: hwmod adaptation for musb registration
[3] Merge branch 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6

Cc: Hema HK <hemahk@ti.com>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
12 years agoUSB: add quirk for another camera
Oliver Neukum [Tue, 3 Jan 2012 08:58:54 +0000 (09:58 +0100)]
USB: add quirk for another camera

commit 35284b3d2f68a8a3703745e629999469f78386b5 upstream.

The Guillemot Webcam Hercules Dualpix Exchange camera
has been reported with a second ID.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>