net: wireless: bcmdhd: delete p2p device if already exist
in case of android service restart, framework calls DRIVER STOP and
and then DRIVER START command. We are not removing p2p device
on DRIVER STOP call as it will as it is also trigger to disable wifi when
wifi sleep policy: never selected(Bug 1525819). While android service
restart, supplicant also restarts that try to create p2p device and it
returns failure because p2p device was not unregister.
Solution: while registering p2p device(it will only call when
supplicant starts), free old p2p device and register it again
instead of returning failure.
staging: iio: light: iqs253: make sensor always on
Keep sensor always on for its proper functioning.
It seems, we do not work fine with sensor turning on when
needed and turning it off when not in use. This behavior
could be because of the time it takes to adjust to the
environment but the root cause is not yet clear.
Allen Yu [Tue, 8 Jul 2014 17:21:21 +0000 (01:21 +0800)]
net: wireless: bcmdhd: reorder sdlock to avoid lockup
dhd_os_sdlock() is called in dhd_watchdog(), which is the timer function
of dhd->timer. So we need to release the lock before deleting the timer
to avoid cpu lockup.
net: wireless: bcmdhd: do not call wl_cfgp2p_del_disc_if on DRIVER STOP
In kernel 3.10 we only use one net device wlan0 and p2p is a
wireless device register above wlan0 (driver_param with with
p2p_device=1). In this specific configuration, the DRIVER STOP
command implies to unregister of the p2p-dev-wlan0 wireless
device and to down the wlan0 iface. But when the DRIVER START
command occurs only the wlan0 net device is up, the p2p-dev-wlan0
wireless device is never registered again.
Solution:
wl_cfgp2p_del_disc_if code in wl_cfgp2p_down is unnecessary
because the function is called during unloading driver.
Jan Kara [Thu, 3 Apr 2014 21:46:23 +0000 (14:46 -0700)]
bdi: avoid oops on device removal
After commit 839a8e8660b6 ("writeback: replace custom worker pool
implementation with unbound workqueue") when device is removed while we
are writing to it we crash in bdi_writeback_workfn() ->
set_worker_desc() because bdi->dev is NULL.
This can happen because even though bdi_unregister() cancels all pending
flushing work, nothing really prevents new ones from being queued from
balance_dirty_pages() or other places.
Fix the problem by clearing BDI_registered bit in bdi_unregister() and
checking it before scheduling of any flushing work.
Fixes: 839a8e8660b6777e7fe4e80af1a048aebe2b5977
Change-Id: Iba983ab2c40ab74f24484d44465741551a24de91 Reviewed-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jan Kara <jack@suse.cz> Cc: Derek Basehore <dbasehore@chromium.org> Cc: Jens Axboe <axboe@kernel.dk> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Nilesh More <nmore@nvidia.com>
Reviewed-on: http://git-master/r/435485 Reviewed-by: Prafull Suryawanshi <prafulls@nvidia.com>
GVS: Gerrit_Virtual_Submit Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Reviewed-by: Robert Shih <rshih@nvidia.com> Tested-by: Robert Shih <rshih@nvidia.com>
On devices that don't have the right firmware, we do see OZ_TIMER_OUT
prints flooded in kernel log. This does cause delay in other threads
to be scheduled. This print is coming from a tasklet for oz_pd_timeout_handler.
- add i2c routines for iqs263
- seperate out routines for iqs263 and iqs253
- auto detect iqs253 vs iqs263 and apply appropriate settings
- set HW suggested init settings to improve settings for iqs263
- Move code to appropriate places i.e., iqs253 first handshake
need not happen for iqs263
- fix regulator logic to match regulator_enable and regulator_disable
1. clean up obsolete code paths
2. modify init sequence
3. modify i2c communication protocol
4. re init on power on reset detection
5. modify proximity detection thresholds and ATI registers
Arto Merilainen [Mon, 7 Jul 2014 08:16:22 +0000 (11:16 +0300)]
video: tegra: host: Do not deinit tsec
tsec deinitialisation is currently triggered when the last user
on tsec channel closes the channel and we release the firmware as
part of the deinitialisation routine. However, we may still have some
work pending on the channel and therefore releasing the firmware
may trigger unexpected faults from tsec.
As firmware release is not needed (i.e. we will need the firmware)
later when the channel is used next time, we can simply remove the
firmware release.
Allen Yu [Sun, 6 Jul 2014 12:10:15 +0000 (20:10 +0800)]
bcmdhd: fix NULL pointer in setting IEs
In case of device role undetermined, we should return error instread of
going ahead to set IEs to FW, which could potentially cause a NULL poiter
issue.
Allen Yu [Sat, 5 Jul 2014 03:55:38 +0000 (11:55 +0800)]
staging: ozwpan: reorder WARN_ON in oz_pd_put
In oz_pd_put(), PD may be already freed after calling oz_pd_destroy().
So we need to move WARN_ON() to the entry of oz_pd_put() instead to
avoid dangling pointer.
Allen Yu [Wed, 2 Jul 2014 07:14:24 +0000 (15:14 +0800)]
media: tegra: nvavp: fix deadlock issue
nvavp_uninit() cancels clock_disable_work in a synchronous manner,
and the work function of clock_disable_work requires nvavp->open_lock,
so any routine holds the same lock should release it before calling
nvavp_uninit().
Jon Mayo [Fri, 16 May 2014 00:45:08 +0000 (17:45 -0700)]
video: tegra: dc: skip duplicate CMU update
Skip updating CMU on first boot, and restore CMU after disable or
suspend. Use dc->pdata->cmu_enable to select initial state of cmu, and
move the current cmu status out of dc->pdata and into dc->cmu_enabled.
Remove unused flag TEGRA_DC_FLAG_CMU_ENABLE.
Aly Hirani [Wed, 2 Jul 2014 05:28:20 +0000 (22:28 -0700)]
bcmdhd: Override fw's check for flowcontrol
The broadcom firmware sends a flowcontrol status in the rx packet
indicating that it is running short on tx buffers. This bit is used to
tell the driver to stop sending packets (based on their priority).
However, there seems to be a significantly large delay (~100ms) in the
fw updating the driver with the new flowcontrol bits.
Ozmo's audio traffic is marked as 0x106 priority which translates to
priority=0x40.
This change overrides the flowcontrol bits sent by the fw
and makes it so that the 0x40 priority traffic is never blocked from
flowcontrol. The DATAOK(bus) check on the bus ensures that we always
have enough tx buffers on the chip (despite the flowcontrol being set)
and that we don't end up clobbering packets on the fw.
Vijayakumar [Fri, 27 Jun 2014 09:20:31 +0000 (14:50 +0530)]
gpu:nvgpu:fix powergate disabling order
ELPG has to disabled before we write to clock gating registers
If ELPG is engaged during clock gating register write it will
cause error in ELPG engine
Allen Yu [Fri, 27 Jun 2014 15:44:30 +0000 (23:44 +0800)]
staging: ozwpan: fix potential race in oz_pd_destroy
If two routines A and B call oz_pd_destroy() in parallel, there could be
a race condition they are both able to get through to the point of increasing
pd_destroy_scheduled. For example, routine A reads pd_destroy_scheduled
and its value is zero, right after that routine B reads pd_destroy_scheduled
as well and its value is still zero. Then routine A and B will both be able
to go ahead to increase pd_destroy_scheduled and then schedule the oz_pd_free
workitem, causing the reduplicate oz_pd_free.
To fix that, using spinlock instead of atomic operation. Also do some cleanup
of the redundant code and fix a potential NULL pointer error in oz_pd_alloc().
Allen Yu [Sat, 28 Jun 2014 17:43:42 +0000 (01:43 +0800)]
staging: ozwpan: fix NULL pointer in stop_store
oz_pd_find() can return 0 if it fails to find any pd in g_pd_list
that matches the mac_addr. This could happen if oz_pd_stop() has been
called on the pd so that it's deleted from g_pd_list.
Change-Id: I6bedf242676d6cd316eae41dacd8a515dac296b8 Signed-off-by: Allen Yu <alleny@nvidia.com>
Reviewed-on: http://git-master/r/432534
GVS: Gerrit_Virtual_Submit Tested-by: Kevin Bruckert <kbruckert@nvidia.com> Reviewed-by: Mitch Luban <mluban@nvidia.com> Reviewed-by: Kevin Bruckert <kbruckert@nvidia.com>
bibhayr [Sat, 28 Jun 2014 02:25:11 +0000 (19:25 -0700)]
bcmdhd: check NULL pointer in cfg80211 callbacks
some of the callbacks does not have the NULL
pointer check for wl. So, add wl NULL check for
every function. If net device gets unregistered
and there is another call on wl, kernel crash
happens. This will avoid all the crashes.
Neil Gabriel [Thu, 26 Jun 2014 23:02:32 +0000 (18:02 -0500)]
gpu: nvgpu: Initialize ELPG ref-count early.
gk20a_pmu_disable_elpg can be called before the PMU driver has
received and processed the INIT message from the PMU. If change
ensures that the ELPG ref-count has been initialized to zero
before that can happen.
Deepak Nibade [Wed, 25 Jun 2014 13:27:23 +0000 (18:57 +0530)]
gpu: nvgpu: fix possible PMU isr race
Possible race description :
- while PMU is booting, it sends messages to kernel which we process
in gk20a_pmu_isr()
- but when messages are processed it is possible that we are on the way
to rail gate the GPU and we have already called pmu_destroy()
- this could lead to hangs if while processing messages, GR is
already off
To fix this, introduce another mutex isr_enable_lock and a flag to
turn on/off ISRs
- when we enable PMU, get the lock and set the flag
- in pmu_destroy(), get the lock and remove the flag
- in pmu_isr(), take the lock, check if flag is set or not. If flag
is not set return, otherwise proceed with the messages
Add Miracast modes 5 and 6 to handle interference mitigation on blake
To prevent blake disconnection on 2.4Ghz channels, set miracast mode 5
to disable interference mitigation and set miracast mode 6 to enable
auto interference mitigation.
tegra: hdmi: audio: sysfs node for max audio channel info
Provide max_pcm_channels from the EDID audio info
to HAL before the EDID audio info gets copied to
the HDA codec driver. This is done since HAL requires
prior channel information in order to open the pcm
device
Om Prakash Singh [Thu, 19 Jun 2014 15:25:41 +0000 (20:55 +0530)]
net: wireless: bcmdhd: fix rtnl_lock deadlock while AGO creation
problem:
during p2p interface add/remove stress, race condition is happening
for rtnl_lock between cfg80211_event_work and dhd driver. due to
which system's net stack is going in to deadlock state.
solution:
to register p2p interface make use of register_netdevice instead
of register_netdev which doesn't require rtnl_lock and remove
rtnl_unlock/lock that was added to make sure register_netdev doesn't
block on rtnl_lock.
Vinayak Pane [Wed, 18 Jun 2014 01:45:14 +0000 (18:45 -0700)]
staging: ozwpan: protect oz_pd_destroy
oz_pd_destroy() is called mulitple times when network
down notifier gets triggered. Destroy workqueue is scheduled
from tasklet and also from oz_binding_remov function.
Protecting it by strictly scheduling workqueue only once.
Vinayak Pane [Wed, 18 Jun 2014 20:10:50 +0000 (13:10 -0700)]
Revert "staging: ozwpan: remove scheduling while atomic"
This reverts commit 3e6733bb4f62148b38af8ccbe56dc0e62a052138.
An improvised fix for this is provided by Atmel with patch
"staging: ozwpan: kobject_uevent_env() from process context"
which is submitted separately.
Seema Khowala [Fri, 20 Jun 2014 18:36:30 +0000 (11:36 -0700)]
arm: tegra: pinmux : enable e_input of sdmmc clk
For all SDMMC controllers, E_INPUT of CLK pad should be
enabled since loopback CLK (Zi of CLK pad) is used to
latch RESP/DATA coming from external device.
If not enabled, you will see RESP/DATA time outs.
In case integration time for the sensor is not properly set,
User space may query the updated value of a sensor before an event
is generated from the sensor. Kernel driver should not send a stale or
invalid event in such cases, else it may impact performance and in some
cases, the user space application may behave in some undesirable way.
This change checks for such invalid events and makes sure such values
are not sent to user space.
Diwakar Tundlam [Thu, 29 May 2014 22:54:12 +0000 (15:54 -0700)]
arm: tegra: soctherm: split suspend and resume nb
Split soctherm suspend and resume notifier callbacks to allow
different priority settings so that soctherm-suspend is called after
dvfs-resume and soctherm-resume is called before dvfs-resume.
Rakesh Bodla [Thu, 19 Jun 2014 11:27:44 +0000 (16:57 +0530)]
power: extcon: fix charging icon during bootup
If device is booted with charger cable, in probe
y-cable extcon dev reports no cable is connected
and cable connection status is getting corrupted.
Fixing this by adding suitable condition.
bibhayr [Thu, 19 Jun 2014 02:35:54 +0000 (19:35 -0700)]
bcmdhd: update CONNECTED on WLC_E_SET_SSID event
update the status of the firmware to connected after
AP association when the WLC_E_SET_SSID event happens.
Currently it updates the status before WLC_E_SET_SSID.
Rakesh Bodla [Thu, 5 Jun 2014 06:31:12 +0000 (12:01 +0530)]
usb: free up composite gadget string ids on unbind
There are only 254 USB composite gadget string_ids available.
When switching gadget mode such as mtp and acm repeatedly,
they will be exhausted.
This bug has been brought up since android composite driver
introduced a way to switch gadget modes while the composite
driver is still holding its bind.
Fix this by reset next_string_id and clean up gstrings when
android gadgets are disabled. Also by removing the condition
comparing gadgets' string id to 0 because gadget string id
has to be re-assigned whenever the string count is reset.
The codes removed the condition check will work as the same
as before they have changed if the gadgets are used by other
composite drivers other than android since all of them call
bind only once and never unbind it hence no side effects considered.
Ported from https://android-review.googlesource.com/#/c/95366/
Deepak Nibade [Wed, 11 Jun 2014 13:52:51 +0000 (19:22 +0530)]
gpu: nvgpu: bail out from poweroff if channel suspend fails
During gk20a_pm_prepare_poweroff(), if call to gk20a_channel_suspend()
fails, we proceed to disable other components and then return error.
But when genpd sees the error, it will abort the suspend sequence and
keep the device state as active.
But since we have already disabled all the components, GPU lands in
invalid state.
Hence, if channel_suspend() fails then do not proceed but return
the error immediately
Deepak Nibade [Mon, 16 Jun 2014 10:25:43 +0000 (15:55 +0530)]
video: tegra: host: fix setclass order in gather submit
We submit gathers in submit_gathers() as below :
1) set class to class id sent from user space
2) call add_sync_waits() which sets class to HOST1X
and adds host waits
3) and then we proceed to insert gathers sent from user space
(which now see wrong class id set i.e. HOST1X)
This results in setting wrong class ids and causes
abnormal behaviour
To fix this, rewrite this sequnce as below :
1) call add_sync_waits() which sets class to HOST1X
and adds host waits
2) set class to class id sent from user space
3) and then we proceed to insert gathers sent from user space
(and now we have correct class id set for this gather)
Martin Chi [Fri, 28 Mar 2014 15:38:42 +0000 (23:38 +0800)]
usb: ehci: Tegra: change to noirq suspend/resume
Chnage ehci suspend/resume to noirq suspend/resume
to enable it get more chances to handle the remote
wake-up which may come after normal suspend/resume
Sang-Hun Lee [Tue, 17 Jun 2014 23:35:49 +0000 (16:35 -0700)]
tegra: ictlr: correct the base address of init
- The initilization of the mselect register was being done
against the hier_ictlr register base address, instead of
the mselect register base address. Correct the address
to the mselect register base
Laxman Dewangan [Thu, 19 Jun 2014 07:16:47 +0000 (12:46 +0530)]
ARM: tegra: convert non-battery DTS to battery dts for P1761-A04-E
Convert the non-battery DTS to battery DTS for the P1761-A04-E to fix the
proper OTA from mp1 to OTA1 release.
The battery dts have the dtsfilename as the non-battery dts which causes the
BC/FG broken after OTA1. The steps are:
- Create nonbattery dtss file and keep same as original non-battery dts.
- Change original non-battery dts to battry supported DTS.
ARM: tegra:provide battery soc range and input voltage limit
adding input voltage limit and soc range to configure
input voltage limit(VINDMP) based on battery SOC value.
add entry for monitor battery current through IIO for
p1761-A04,This enables current_now sysfs which helps
to find out how much current flowing from/to battery.
Laxman Dewangan [Wed, 18 Jun 2014 14:36:31 +0000 (20:06 +0530)]
Revert "extcon: palmas: make aca detection platform dependent"
This reverts commit aa55d35202b5895068bdf8eace842102bf134dab.
Revert the change becasue it breaks the VUS and ID detection. With this change
on some platforms, the VBUS and ID both are detected even only connnect the
VBUS cable. This causes misbehaving of the drivers.
Sang-Hun Lee [Thu, 12 Jun 2014 17:52:59 +0000 (13:52 -0400)]
gpu: nvgpu: gk20a: do not access invalid TLB
Problem description:
- gk20a_mm_tlb_invalidate guarantees callers that
TLB would be in a clean state
- gk20a_mm_tlb_invalidate checks whether the dirty
flag is set, then mark clean, then performs
reset operation
- If there are two parallel callers, one thread would be
performing the clean up operation, while the other thread
is returned to the caller
Fix description:
- Extends the duration of the TLB dirty flag mutex lock
Update fb_monspecs and ext_process_hotplug on every hdmi_disable
This is required since hdmi_disable can also be called when
transitioning from hdmi disconnected to disable, for
example, when hdmi gets disconnected during LP0
Terje Bergstrom [Mon, 12 May 2014 12:14:05 +0000 (15:14 +0300)]
gpu: nvgpu: Remove extraneous FB flush calls
gk20a_mm_fb_flush() invoked G_ELPG_FLUSH and FB_FLUSH. Remove the
invokation of G_ELPG_FLUSH. Replace calls to gk20a_mm_fb_flush() with
gk20a_mm_l2_flush() when appropriate.
"disabled" parameter is currently used by generic PM domains to control
attached cpuidle state. This patch moves disable parameter from idle state
back to state_usage which to avoid the race between sysfs control and
generic PM domains.
Ankita Garg [Tue, 10 Jun 2014 22:48:58 +0000 (15:48 -0700)]
drivers: hid: Support vendor specific usage for blake trackpad
Generic HID drivers do not work well Blake trackpad. So, fw
uses vendor specific usage for the trackpad. Change the usage
internally to register trackpad as a relative mouse.
Change-Id: If8fc6a5d634e4b300ef0de6a5913188fe1f1efb0 Signed-off-by: Jon Mayo <jmayo@nvidia.com>
Reviewed-on: http://git-master/r/422885 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Michael Frydrych <mfrydrych@nvidia.com> Reviewed-by: Thomas Cherry <tcherry@nvidia.com>
power: extcon:convert extcon lock to spinlock from mutex
use spinlock instread of mutex to avoid kernel warning "sleeping
function called from invalid context" if CONFIG_DEBUG_ATOMIC_SLEEP
(sleep inside atomic section checking config) enabled and usb cable
plugged/unplugged.