drivers: clocksource: add CPU PM notifier for ARM architected timer
Few control settings done in architected timer as part of initialisation
can be lost when CPU enters deeper power states. They need to be
restored when the CPU is (warm)reset again.
This patch adds CPU PM notifiers to save the counter control register
when entering low power modes and restore it when CPU exits low power.
Update the cfg layer with active channel list after
associating to AP. Currently cfg layer gets updated
only during driver initialization. If some other
channel is passive during that time, it will never
get updated to active. Also, this update should be
done after every scan, but this should take care of
at least to update the AP association channel to be
active so that the p2p GO can be created on the APs
channel. Cfg layer does not check the passive channel
list for wlan0 connection but it checks the passive
channel for p2p GO creations.
Sang-Hun Lee [Wed, 30 Jul 2014 00:53:48 +0000 (17:53 -0700)]
bcmdhd: ensure work completion before freeing
Problem description:
- wl_dealloc_netinfo would free allocated wireless_dev structures, which has
work_struct for wdev_cleanup_work
- If there is any job scheduled for wdev_cleanup_work and if it
is scheduled after kfree of its parent struct, the result is undefined
- But simply waiting for wdev_cleanup_work completion in
wl_cfg80211_netdev_notifier_call would result in a dead lock, as wdev_cleanup_work
and cfg80211_event_work both use the same workqueue. cfg80211_event_work
may ultimately call wl_cfg80211_netdev_notifier_call
Fix description:
- Separate the detach of an interface from the deallocation of an interface
- Upon a detach, only remove the interface, and schedule a deallocation of it
Sudhir Vyas [Mon, 24 Mar 2014 15:34:51 +0000 (21:04 +0530)]
video: tegra: host: Register VI isomgr on request
Register VI as isomgr client when the camera user
driver has requested for memory BW requirements.
Currently it is being done in probe only, which
may be unnecessary for the usecases where VI is
not the memory client.
If the p2p device is unregistered before the cfg
cleanup work item is scheduled then, the wdev
struct is corrupted and can cause the kernel panic.
wait for the work item to finish before freeing
Sai Gurrappadi [Fri, 18 Jul 2014 06:46:56 +0000 (23:46 -0700)]
staging: ozwpan: Cancel hrtimer before expiry set
Currently oz_timer_add sets the new expiry time before calling
hrtimer_start_expires where the timer is actually updated in the
timerqueue.
However, this update to expiry time is racy because the the
hrtimer_set_expires call is being performed from a softirq or a thread's
context. The CPU could recieve a hrtimer_interrupt before the
hrtimer_start_expires call but after hrtimer_set_expires.
This would leave the hrtimer with a new expiry value but with the same
position in the rbtree which a subsequent hrtimer_interrupt could use
to perform its timerqueue add/del operations with. Leaving the rbtree
in this stale/bad state causes some timers to never get serviced.
Fix this by first removing the timer from the timerqueue by calling
hrtimer_cancel and then updating the expiry time.
Sang-Hun Lee [Fri, 11 Jul 2014 18:05:28 +0000 (14:05 -0400)]
net: wireless: bcmdhd: reduce tasklet priority
In case there is a lot of workload, wifi's bottom half handler can
starve the system critical threads such as the watchdog and CPU workload
monitor triggering a system reboot
Lower the priority of wifi tasklets to match the other bottom half handlers
priority
usb: gadget: tegra: conditionally update LP0 connect type
After driver resume sometimes connect_type_lp0 is not
set to NONE, due some tasks didn't get scheduled.
In this case retain the value, so that correct
value will be preserved.
Add the driver command MKEEP_ALIVE to send a periodic IP based keep alive
packet from the firmware to avoid deauth from access point due to inactivity.
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