Initialization of pointer should be done with NULL. Removes sparse
warnings:
arch/arm/mach-omap2/serial.c:566:17: warning: Using plain integer as NULL pointer
arch/arm/mach-omap2/serial.c:567:17: warning: Using plain integer as NULL pointer
Signed-off-by: Nishanth Menon <nm@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Jarkko Nikula [Mon, 2 Aug 2010 10:18:02 +0000 (13:18 +0300)]
omap: rx51: Use REGULATOR_SUPPLY macro when initializingregulator consumers
There is REGULATOR_SUPPLY macro available for initializing the struct
regulator_consumer_supply so use it where applicable (all other supplies
than vdds_sdi) as it improves the readability.
Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Acked-by: Eduardo Valentin <eduardo.valentin@nokia.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Jarkko Nikula [Mon, 2 Aug 2010 10:18:02 +0000 (13:18 +0300)]
omap: rx51: Add platform_data for tlv320aic3x with reset gpionumber
Proper operation of the tlv320aic3x audio codec requires that reset
sequencing is done in pair with supply voltages when using the regulator
framework. Add the codec reset gpio used in Nokia RX51 to tlv320aic3x
data.
Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Jarkko Nikula [Mon, 2 Aug 2010 10:18:02 +0000 (13:18 +0300)]
omap: rx51: Set regulator V28 always on
It seems that the battery cover sensor in Nokia N900 is powered from the
V28 domain. Now if this regulator is disabled it causes that the gpio 160
reads only zero which effectively causes uSD removal detection.
Currently the bootloader enabled V28 is kept on but this may change in the
future according to comment in
drivers/regulator/core.c: regulator_has_full_constraints.
Also if there are any consumers on the V28 domain doing regulator_enable
regulator_disable cycle the V28 will be disabled after that.
Prepare for these by defining the V28 as always_on regulator.
Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Cc: Adrian Hunter <adrian.hunter@nokia.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Update gpio-keys setup so it matches what is on default firmware.
Also make use of debounce feature in gpio-keys instead of setting it
explicitly, as gpio-keys is now capable of using hardware debounce on
OMAPs thanks to recent gpiolib changes.
Also fix a sparce warning along the way.
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
This patch corrects the LCD reset pin configuration.
Original code from early devkit8000 patch sets the TWL4030 GPIO_1
to EHCI_nOC and TWL4030_GPIO_MAX+1 to ledA. Indeed these two pins
are both LCD_PWREN. Setup the lcd reset_gpio properly so it can be
disabled when other display is turned on.
Signed-off-by: Kan-Ru Chen <kanru@0xlab.org> Signed-off-by: Tony Lindgren <tony@atomide.com>
Christoph Egger [Mon, 5 Jul 2010 13:31:54 +0000 (16:31 +0300)]
Removing dead OMAP_DSP
OMAP_DSP doesn't exist in Kconfig, therefore removing all
references for it from the source code.
Signed-off-by: Christoph Egger <siccegge@cs.fau.de>
[tony@atomide.com: updated to apply on top of already queued patches] Signed-off-by: Tony Lindgren <tony@atomide.com>
Christoph Egger [Mon, 5 Jul 2010 13:31:53 +0000 (16:31 +0300)]
Replace dead OMAP_MUX_ERRORS with OMAP_MUX_WARNINGS
OMAP_MUX_ERRORS doesn't exist in Kconfig, therefore replacing all
references for it with OMAP_MUX_WARNINGS in the source code.
Signed-off-by: Christoph Egger <siccegge@cs.fau.de> Acked-by: Kirill A. Shutemov <kirill@shutemov.name> Signed-off-by: Tony Lindgren <tony@atomide.com>
Tony Lindgren [Mon, 5 Jul 2010 13:31:28 +0000 (16:31 +0300)]
omap: Separate out omap2 FS USB platform init functions
We want to split old FS USB platform init code and stop doing pin multiplexing
under plat-omap. First move 24xx specific init code into omap2_usb[012]_init
functions.
Cc: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Tony Lindgren <tony@atomide.com>
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (22 commits)
USB: gadget: f_mass_storage: stale common->fsg value bug fix
USB: gadget: f_mass_storage: fixed fs descriptors not being updated
USB: musb: Enable the maximum supported burst mode for DMA
USB: musb: fix Blackfin ulpi stubs
USB: MUSB: make non-OMAP platforms build with CONFIG_PM=y
USB: musb_core: make disconnect and suspend interrupts work again
USB: obey the sysfs power/wakeup setting
USB: gadget eth: Fix calculate CRC32 in EEM
USB: qcserial: fix a memory leak in qcprobe error path
USB: gadget/printer, fix sleep inside atomic
USB: isp1362-hcd, fix double lock
USB: serial: ftdi: correct merge conflict with CONTEC id
USB: fix oops in usb_sg_init()
USB: s3c2410: deactivate endpoints before gadget unbinding
USB: ehci-mxc: bail out on transceiver problems
USB: otg/ulpi: bail out on read errors
usb: musb: Fix a bug by making suspend interrupt available in device mode
USB: r8a66597: Fix failure in change of status
USB: xHCI: Fix bug in link TRB activation change.
USB: gadget: g_fs: possible invalid pointer reference bug fixed
...
futex_find_get_task is currently used (through lookup_pi_state) from two
contexts, futex_requeue and futex_lock_pi_atomic. None of the paths
looks it needs the credentials check, though. Different (e)uids
shouldn't matter at all because the only thing that is important for
shared futex is the accessibility of the shared memory.
The credentail check results in glibc assert failure or process hang (if
glibc is compiled without assert support) for shared robust pthread
mutex with priority inheritance if a process tries to lock already held
lock owned by a process with a different euid:
The problem is that futex_lock_pi_atomic which is called when we try to
lock already held lock checks the current holder (tid is stored in the
futex value) to get the PI state. It uses lookup_pi_state which in turn
gets task struct from futex_find_get_task. ESRCH is returned either
when the task is not found or if credentials check fails.
futex_lock_pi_atomic simply returns if it gets ESRCH. glibc code,
however, doesn't expect that robust lock returns with ESRCH because it
should get either success or owner died.
Signed-off-by: Michal Hocko <mhocko@suse.cz> Acked-by: Darren Hart <dvhltc@us.ibm.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Nick Piggin <npiggin@suse.de> Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru> Cc: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
USB: gadget: f_mass_storage: stale common->fsg value bug fix
On fsg_unbind the common->fsg pointer was not NULLed if the
unbound fsg_dev instance was the current one. As an effect,
the incorrect pointer was preserved in all further operations
which caused do_set_interface to reference an invalid region.
This commit fixes this by raising an exception in fsg_bind
which will change the common->fsg pointer. This also requires
an wait queue so that the thread in fsg_bind can wait till the
worker thread handles the exception.
This commit removes also a config and new_config fields of
fsg_common as they are no longer needed since fsg can be
used to determine whether function is active or not.
Moreover, this commit removes possible race condition where
the fsg field was modified in both the worker thread and
form various other contexts. This is fixed by replacing
prev_fsg with new_fsg. At this point, fsg is assigned only
in worker thread.
Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com> Cc: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
USB: gadget: f_mass_storage: fixed fs descriptors not being updated
The full speed descriptors were copied to the usb_function structure
in the fsg_bind_config function before call to the usb_ep_autoconfig.
The usb_ep_autoconfig was called in fsg_bind using the original
descriptors. In effect copied descriptors were not updated.
This patch changes the copy full speed descriptors after the call to
usb_op_autoconfig is performed. This way, copied full speed
descriptors have updated values.
Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com> Cc: Kyungmin Park <kyungmin.park@samsung.com> Reported-by: Dries Van Puymbroeck <Dries.VanPuymbroeck@dekimo.com> Tested-by: Dries Van Puymbroeck <Dries.VanPuymbroeck@dekimo.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Hema HK [Thu, 24 Jun 2010 17:37:09 +0000 (23:07 +0530)]
USB: musb: Enable the maximum supported burst mode for DMA
Setting MUSB Burst Mode 3 automatically enables support for
lower burst modes (BURST4, BURST8, BURST16 or bursts of unspecified
length). There is no need to set these burst modes based on the
packet size. Also enable the burst mode for both mode1 and mode0.
This is a fix for buggy hardware - having the lower burst modes
enabled can potentially cause lockups of the DMA engine used in
OMAP2/3/4 chips.
Signed-off-by: Hema HK <hemahk@ti.com> Signed-off-by: Anand Gadiyar <gadiyar@ti.com> Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com> Acked-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Mike Frysinger [Thu, 24 Jun 2010 17:37:08 +0000 (23:07 +0530)]
USB: musb: fix Blackfin ulpi stubs
The new ulpi code defines fallback stubs for the Blackfin arch, but does
so incorrectly leading to a build failure:
drivers/usb/musb/musb_core.c:227: error: 'musb_ulpi_read' undeclared here (not in a function)
drivers/usb/musb/musb_core.c:228: error: 'musb_ulpi_write' undeclared here (not in a function)
Tweak the fallback stubs so that they do work as intended.
Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com> Acked-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Sergei Shtylyov [Thu, 24 Jun 2010 17:37:07 +0000 (23:07 +0530)]
USB: MUSB: make non-OMAP platforms build with CONFIG_PM=y
Attempt to build MUSB driver with CONFIG_PM=y (e.g. in the OTG mode) on DaVinci
results in these link errors:
drivers/built-in.o: In function `musb_restore_context':
led-triggers.c:(.text+0x714d8): undefined reference to
`musb_platform_restore_context'
drivers/built-in.o: In function `musb_save_context':
led-triggers.c:(.text+0x71788): undefined reference to
`musb_platform_save_context'
This turned out to be caused by commit 9957dd97ec5e98dd334f87ade1d9a0b24d1f86eb
(usb: musb: Fix compile error for omaps for musb_hdrc). Revert it, taking into
account the rename of CONFIG_ARCH_OMAP34XX into CONFIG_ARCH_OMAP3 (which that
commit fixed in a completely inappropriate way) and the recent addition of
OMAP4 support.
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com> Acked-by: Felipe Balbi <felipe.balbi@nokia.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Sergei Shtylyov [Thu, 24 Jun 2010 17:37:06 +0000 (23:07 +0530)]
USB: musb_core: make disconnect and suspend interrupts work again
Commit 1c25fda4a09e8229800979986ef399401053b46e (usb: musb: handle irqs in the
order dictated by programming guide) forgot to get rid of the old 'STAGE0_MASK'
filter for calling musb_stage0_irq(), so now disconnect and suspend interrupts
are effectively ignored...
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Cc: stable <stable@kernel.org> Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com> Acked-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Stern [Tue, 22 Jun 2010 20:14:48 +0000 (16:14 -0400)]
USB: obey the sysfs power/wakeup setting
This patch (as1403) is a partial reversion of an earlier change
(commit 5f677f1d45b2bf08085bbba7394392dfa586fa8e "USB: fix remote
wakeup settings during system sleep"). After hearing from a user, I
realized that remote wakeup should be enabled during system sleep
whenever userspace allows it, and not only if a driver requests it
too.
Indeed, there could be a device with no driver, that does nothing but
generate a wakeup request when the user presses a button. Such a
device should be allowed to do its job.
The problem fixed by the earlier patch -- device generating a wakeup
request for no reason, causing system suspend to abort -- was also
addressed by a later patch ("USB: don't enable remote wakeup by
default", accepted but not yet merged into mainline). The device
won't be able to generate the bogus wakeup requests because it will be
disabled for remote wakeup by default. Hence this reversion will not
re-introduce any old problems.
Jiri Slaby [Mon, 21 Jun 2010 15:02:40 +0000 (17:02 +0200)]
USB: gadget/printer, fix sleep inside atomic
Stanse found that sleep is called inside atomic context created by
lock_printer_io spinlock in several functions. It's used in process
context only and some functions sleep inside its critical section. As
this is not allowed for spinlocks, switch it to mutex.
Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Craig W. Nadler <craig@nadler.us> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Jiri Slaby [Mon, 21 Jun 2010 15:02:51 +0000 (17:02 +0200)]
USB: isp1362-hcd, fix double lock
Stanse found that isp1362_sw_reset tries to take a isp1362_hcd->lock,
but it is already held in isp1362_hc_stop. Avoid that by introducing
__isp1362_sw_reset which doesn't take the lock and call it from
isp1362_hc_stop. isp1362_sw_reset is then as simple as lock --
__isp1362_sw_reset -- unlock.
Originally I submitted a patch and then they asked me to order the IDs
and resubmit, so did I. But unfortunately in the end somehow both
patches were merged.
Signed-off-by: Daniel Sangorrin <daniel.sangorrin@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Stern [Fri, 18 Jun 2010 14:16:33 +0000 (10:16 -0400)]
USB: fix oops in usb_sg_init()
This patch (as1401) fixes a bug in usb_sg_init() that can cause an
invalid pointer dereference. An inner loop reuses some local variables
in an unsafe manner, so new variables are introduced.
In the change by 749da5f82fe33ff68dd4aa1a5e35cd9aa6246dab,
The change in the status when the USB device is connected is wrong.
Therefore, the device is not recognized.
Acked-by: Alan Stern <stern@rowland.harvard.edu> CC: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> CC: Paul Mundt" <lethal@linux-sh.org> Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Sarah Sharp [Thu, 10 Jun 2010 19:25:28 +0000 (12:25 -0700)]
USB: xHCI: Fix bug in link TRB activation change.
Commit 6c12db90f19727c76990e7f4801c67a148b30111 introduced a bug for
control transfers. The patch was supposed to change when the link TRBs at
the end of each ring segment were given to the hardware. If a transfer
descriptor (TD) ended just before the link TRB, the code wouldn't give
back the link TRB to the hardware; instead it would be given back in
prepare_ring() just before the next TD was enqueued at the top of the
ring.
Unfortunately, the code relied on checking the chain bit of the TRB to
determine whether the TD ended just before the link TRB. It assumed that
the ring enqueuing code would call prepare_ring() before enqueuing the
next TD. However, control transfers are made of multiple TDs, and
prepare_ring() is only called once before enqueuing two or three TDs.
If the first or second TD of the control transfer ended just before the
link TRB, then the code in inc_enq() would not move the enqueue pointer
past the link TRB, and the link TRB would get overwritten. This would
cause the xHCI driver to start writing to memory past the ring segment,
and eventually the system would crash or hang.
The fix is to add a flag to inc_enq() that says whether the caller will
enqueue more TDs before calling prepare_ring(). If the chain bit is
cleared (meaning this is the last TRB in a TD), and the caller will not
enqueue more TDs, then we defer giving back the link TRB.
USB: gadget: g_fs: possible invalid pointer reference bug fixed
During __gfs_do_config() some invalid pointers may be left
in usb_configuration::interfaces array from previous calls
to the __gfs_do_config() for the same configuration. This
will always happen if an user space function which has
a fewer then the last user space function registers itself.
Composite's set_config() function that a pointer after the
last interface in usb_configuration::interface is NULL
unless the array is full.
This patch makes the __gfs_do_config() make sure that if the
usb_configuration::interface is not full then a pointer
after the last interface is NULL.
Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Wan ZongShun [Tue, 29 Jun 2010 22:05:39 +0000 (15:05 -0700)]
drivers/video/nuc900fb.c: fix lcd build error
Fix a nuc900 lcd build error.
Since the 'nuc900_driver_clksrc_div()' API cannot be merged into mainline
successfully, I removed this clock source selection hook in this driver.
This means nuc900 lcd driver has to select default clock source from the
external crystal now.
Signed-off-by: Wan ZongShun <mcuos.com@gmail.com> Cc: Qiang Wang <rurality.wq@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Lubomir Rintel [Tue, 29 Jun 2010 22:05:38 +0000 (15:05 -0700)]
sysvfs: fix NULL deref. when allocating new inode
A call to sysv_write_inode() in sysv_new_inode() to its new interface that
replaced wait flag with writeback structure. This was broken by a9185b41a4f84971b930c519f0c63bd450c4810d ("pass writeback_control to
->write_inode").
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Cc: Christoph Hellwig <hch@infradead.org> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: <stable@kernel.org> [2.6.34.x] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Joakim Tjernlund [Tue, 29 Jun 2010 22:05:34 +0000 (15:05 -0700)]
rtc: fix ds1388 time corruption
The ds1307 driver misreads the ds1388 registers when checking for 12 or 24
hour mode. Instead of checking the hour register it reads the minute
register. Therefore the driver thinks minutes >= 40 has the 12HR bit set
and resets the minute register by zeroing the high bits. This results in
minutes are reset to 0-9, jumping back in time 40 or 50 minutes. The time
jump is also written back to the RTC.
Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se> Cc: Wan ZongShun <mcuos.com@gmail.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Paul Gortmaker <p_gortmaker@yahoo.com> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Nicolas Ferre [Tue, 29 Jun 2010 22:05:33 +0000 (15:05 -0700)]
MAINTAINERS: some Atmel drivers change maintainer
I take over the maintenance of SPI, USART, Ethernet and USB gadget
drivers. Those drivers are found in Atmel microcontrollers, both
AT32/AVR32 and AT91/ARM.
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Acked-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com> Cc: Andrew Victor <avictor.za@gmail.com> Cc: Haavard Skinnemoen <hskinnemoen@atmel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Martin Wilck [Tue, 29 Jun 2010 22:05:31 +0000 (15:05 -0700)]
ipmi: set schedule_timeout_wait() value back to one
Fix a regression introduced by ae74e823cb7d ("ipmi: add parameter to limit
CPU usage in kipmid").
Some systems were seeing CPU usage go up dramatically with the recent
changes to try to reduce timer usage in the IPMI driver. This was traced
down to schedule_timeout_interruptible(1) being changed to
schedule_timeout_interruptbile(0). Revert that part of the change.
Lee Schermerhorn [Tue, 29 Jun 2010 22:05:30 +0000 (15:05 -0700)]
mempolicy: fix dangling reference to tmpfs superblock mpol
My patch to "Factor out duplicate put/frees in mpol_shared_policy_init()
to a common return path"; and Dan Carpenter's fix thereto both left a
dangling reference to the incoming tmpfs superblock mempolicy structure.
A similar leak was introduced earlier when the nodemask was moved offstack
to the scratch area despite the note in the comment block regarding the
incoming ref.
Move the remaining 'put of the incoming "mpol" to the common exit path to
drop the reference.
Signed-off-by: Lee Schermerhorn <lee.schermerhorn@hp.com> Acked-by: Dan Carpenter <error27@gmail.com> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Cc: David Rientjes <rientjes@google.com> Cc: Christoph Lameter <cl@linux-foundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Matthew Garrett [Tue, 29 Jun 2010 22:05:29 +0000 (15:05 -0700)]
ipmi: make sure drivers were registered before unregistering them
The ipmi code will never register a PCI or Open Firmware driver if a
hardcoded device is provided by the user by providing device addresses via
the module parameters. This can cause us to attempt to unregister a
driver that was never registered, resulting in an oops. Keep track of
registration in order to avoid this.
Fixes a post-2.6.34 regression.
Signed-off-by: Matthew Garrett <mjg@redhat.com> Acked-by: Corey Minyard <cminyard@mvista.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>