summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2012-08-27drivers: mfd: Add support for TI aic3262 driverManoj Gangwal
Bug 1034241 Change-Id: I5607d53cf0bdd25c5e2b8447cd7e676b64cd32a2 Signed-off-by: Manoj Gangwal <mgangwal@nvidia.com> Reviewed-on: http://git-master/r/125169 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Lokesh Pathak <lpathak@nvidia.com>
2012-08-27video: tegra: nvmap: fix handle usecount trackingTuomas Tynkkynen
A handle's usecount used to be incremented once during the mmap ioctl, and decremented when the mapping is closed by the kernel. However, that fails if a mapping cloned, for example if the mapping was split due to a munmap, or (presumably) during fork, as the decrement will then happen for each cloned mapping. Therefore increment the usecount when a mapping is opened. Also fix a BUG_ON() that would have caught this bug, if it wouldn't have done the check by checking if the unsigned usecount field is less than zero. Bug 1033981 Change-Id: I72ac9361a19e44f91ffd6b1126f4632e0f7b6726 Signed-off-by: Tuomas Tynkkynen <ttynkkynen@nvidia.com> Reviewed-on: http://git-master/r/123710 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
2012-08-23net/usbnet: avoid recursive locking in usbnet_stop()Steve Lin
|kernel BUG at kernel/rtmutex.c:724! |[<c029599c>] (rt_spin_lock_slowlock+0x108/0x2bc) from [<c01c2330>] (defer_bh+0x1c/0xb4) |[<c01c2330>] (defer_bh+0x1c/0xb4) from [<c01c3afc>] (rx_complete+0x14c/0x194) |[<c01c3afc>] (rx_complete+0x14c/0x194) from [<c01cac88>] (usb_hcd_giveback_urb+0xa0/0xf0) |[<c01cac88>] (usb_hcd_giveback_urb+0xa0/0xf0) from [<c01e1ff4>] (musb_giveback+0x34/0x40) |[<c01e1ff4>] (musb_giveback+0x34/0x40) from [<c01e2b1c>] (musb_advance_schedule+0xb4/0x1c0) |[<c01e2b1c>] (musb_advance_schedule+0xb4/0x1c0) from [<c01e2ca8>] (musb_cleanup_urb.isra.9+0x80/0x8c) |[<c01e2ca8>] (musb_cleanup_urb.isra.9+0x80/0x8c) from [<c01e2ed0>] (musb_urb_dequeue+0xec/0x108) |[<c01e2ed0>] (musb_urb_dequeue+0xec/0x108) from [<c01cbb90>] (unlink1+0xbc/0xcc) |[<c01cbb90>] (unlink1+0xbc/0xcc) from [<c01cc2ec>] (usb_hcd_unlink_urb+0x54/0xa8) |[<c01cc2ec>] (usb_hcd_unlink_urb+0x54/0xa8) from [<c01c2a84>] (unlink_urbs.isra.17+0x2c/0x58) |[<c01c2a84>] (unlink_urbs.isra.17+0x2c/0x58) from [<c01c2b44>] (usbnet_terminate_urbs+0x94/0x10c) |[<c01c2b44>] (usbnet_terminate_urbs+0x94/0x10c) from [<c01c2d68>] (usbnet_stop+0x100/0x15c) |[<c01c2d68>] (usbnet_stop+0x100/0x15c) from [<c020f718>] (__dev_close_many+0x94/0xc8) defer_bh() takes the lock which is hold during unlink_urbs(). The safe walk suggest that the skb will be removed from the list and this is done by defer_bh() so it seems to be okay to drop the lock here. Reported-by: Aníbal Almeida Pinto <anibal.pinto@efacec.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Acked-by: Oliver Neukum <oliver@neukum.org> Signed-off-by: David S. Miller <davem@davemloft.net> (cherry picked from commit 4231d47e6fe69f061f96c98c30eaf9fb4c14b96d) --------------------------------------------------------------------- net/usbnet: reserve headroom on rx skbs network drivers should reserve some headroom on incoming skbs so that we dont need expensive reallocations, eg forwarding packets in tunnels. This NET_SKB_PAD padding is done in various helpers, like __netdev_alloc_skb_ip_align() in this patch, combining NET_SKB_PAD and NET_IP_ALIGN magic. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Cc: Oliver Neukum <oneukum@suse.de> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: David S. Miller <davem@davemloft.net> (cherry picked from commit 7bdd402706cf26bfef9050dfee3f229b7f33ee4f) --------------------------------------------------------------------- usbnet: use netif_tx_wake_queue instead of netif_start_queue If host is going to autosuspend function with two interfaces and if IP packet has arrived in-between of two usbnet_suspend() callbacks, i.e usbnet_resume() is called in-between, tx data flow is stopped. When autosuspend timer expires and device is put to autosuspend again, tx queue is waked up and data can be sent again. This behavior might be repeated several times in a row. Tested on Intel/ARM. Reviewed-by: Sjur Brændeland <sjur.brandeland@stericsson.com> Tested-by: Dmitry Tarnyagin <dmitry.tarnyagin@stericsson.com> Signed-off-by: Alexey Orishko <alexey.orishko@stericsson.com> Acked-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: David S. Miller <davem@davemloft.net> (cherry picked from commit 1aa9bc5b2f4cf8c48944fb9a607bf1dd674e2c10) --------------------------------------------------------------------- usbnet: increase URB reference count before usb_unlink_urb Commit 4231d47e6fe69f061f96c98c30eaf9fb4c14b96d(net/usbnet: avoid recursive locking in usbnet_stop()) fixes the recursive locking problem by releasing the skb queue lock, but it makes usb_unlink_urb racing with defer_bh, and the URB to being unlinked may be freed before or during calling usb_unlink_urb, so use-after-free problem may be triggerd inside usb_unlink_urb. The patch fixes the use-after-free problem by increasing URB reference count with skb queue lock held before calling usb_unlink_urb, so the URB won't be freed until return from usb_unlink_urb. Reported-by: Dave Jones <davej@redhat.com> Signed-off-by: Ming Lei <tom.leiming@gmail.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: David S. Miller <davem@davemloft.net> (cherry picked from commit 0956a8c20b23d429e79ff86d4325583fc06f9eb4) --------------------------------------------------------------------- usbnet: don't clear urb->dev in tx_complete URB unlinking is always racing with its completion and tx_complete may be called before or during running usb_unlink_urb, so tx_complete must not clear urb->dev since it will be used in unlink path, otherwise invalid memory accesses or usb device leak may be caused inside usb_unlink_urb. Signed-off-by: Ming Lei <tom.leiming@gmail.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: David S. Miller <davem@davemloft.net> (cherry picked from commit 5d5440a835710d09f0ef18da5000541ec98b537a) --------------------------------------------------------------------- usbnet: consider device busy at each recieved packet usbnet should centrally handle busy reporting in the rx path so subdrivers need not worry. This hurts use cases which do rx only or predominantly. Signed-off-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: David S. Miller <davem@davemloft.net> (cherry picked from commit 8a78335442cea429afb2b964318b6e257448ea00) --------------------------------------------------------------------- usbnet: fix leak of transfer buffer of dev->interrupt The transfer buffer of dev->interrupt is allocated in .probe path, but not freed in .disconnet path, so mark the interrupt URB as URB_FREE_BUFFER to free the buffer when the URB is destroyed. Signed-off-by: Ming Lei <tom.leiming@gmail.com> Acked-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: David S. Miller <davem@davemloft.net> (cherry picked from commit 267a83e8e00dc5a878b24c39883643c20a8b1482) Bug 1036768 Change-Id: I5d6620c8ff4e6cef52c3f467fb2196658c4d47b1 Signed-off-by: Steve Lin <stlin@nvidia.com> Reviewed-on: http://git-master/r/125338 GVS: Gerrit_Virtual_Submit
2012-08-23video: tegra: host: Clear intr list at intr_putTerje Bergstrom
Process wait list when removing a waiter. This clears the interrupt once it is no longer needed. Bug 1031724 Change-Id: Ifb46672f70c8bbd6359d0a8aeaac0d718a5394b2 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/125230 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
2012-08-23video: tegra: dc: Make framebuffer console init OKMark Zhang
Update framebuffer's modelist after we changed it's fb_var_screeninfo. This makes sure the framebuffer console can be inited successfully. During framebuffer console init, it'll check whether the var info of the framebuffer is consistent with the modelist. Unsuccessful init of framebuffer console driver makes VT driver doesn't work in right way. Bug 996992 Signed-off-by: Mark Zhang <markz@nvidia.com> Change-Id: I96a1db1f389be75dcba48b20447cf1510ad3768b Reviewed-on: http://git-master/r/107866 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Shashank Sharma <shashanks@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Jon Mayo <jmayo@nvidia.com>
2012-08-23gpio: tegra: Added support for GCOV for GPIOSumit Sharma
Added support for GCOV code coverage for GPIO Signed-off-by: Sumit Sharma <sumsharma@nvidia.com> Change-Id: I407433db690696644aa67dffc0de8bc03c624b54 Reviewed-on: http://git-master/r/125183 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> GVS: Gerrit_Virtual_Submit
2012-08-23hwmon: tegra: tsensor:Fix compilation errorNagaraja Kolur
Bug 1024886 Resolved compilation error for unused code. Signed-off-by: Nagaraja Kolur <nkolur@nvidia.com> Change-Id: I9167d8129a9cba0fc6cb203180e07192d66db439 Reviewed-on: http://git-master/r/120581 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Nagaraj Kolur <nkolur@nvidia.com> Tested-by: Nagaraj Kolur <nkolur@nvidia.com> Reviewed-by: Vijaya Bhaskar <vbhaskar@nvidia.com> Reviewed-by: Wahed Syed <wsyed@nvidia.com> Reviewed-by: Dan Willemsen <dwillemsen@nvidia.com>
2012-08-22i2c: tegra: Add delay before resetting the controller after NACKLaxman Dewangan
NACK interrupt is generated before I2C controller generates the STOP condition on bus. Because of this reset of controller is happening before I2C controller could complete STOP condition. So wait for some time before resetting the controller so that STOP condition has delivered properly on bus. Added delay of 2 clock period before resetting the controller in case of NACK error. Signed-off-by: Alok Chauhan <alokc@nvidia.com> Acked-by: Stephen Warren <swarren@wwwdotorg.org> Taken change from mainline commit. Change-Id: Id089aae313614e58ec6da36eda4ff2d87c5cddc3 Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/125148 Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
2012-08-22video: tegra: host: Fix freeing a ERR_PTR valueTuomas Tynkkynen
nvhost_3dctx_alloc_common correctly checks the return value of an allocator function, and attempts to perform cleanup. However, this particular allocation API returns ERR_PTR values in case of failure, which then gets passed to the deallocation function, causing a crash. Also, the return value of that allocator API is checked with IS_ERR in some places, and with IS_ERR_OR_NULL in others. For consistency and avoiding surprises if the allocation implementation changes, use IS_ERR_OR_NULL in all places. Bug 1035878 Change-Id: I65ce97e11f9712b2e9630b38183f6e70bc14b254 Signed-off-by: Tuomas Tynkkynen <ttynkkynen@nvidia.com> Reviewed-on: http://git-master/r/124657 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2012-08-22video: tegra: host: Fix crash if allocation failsTuomas Tynkkynen
nvhost_module_remove_client assumes that a client structure to be freed exists in the linked list. However, if an allocation fails in nvhost_module_add_client, no client structure is allocated, and during cleanup, nvhost_module_remove_client would then attempt to free an invalid pointer. Bug 1034729 Change-Id: Ie1a641071b86f8246951e9be824a6003f14b04b6 Signed-off-by: Tuomas Tynkkynen <ttynkkynen@nvidia.com> Reviewed-on: http://git-master/r/124096 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
2012-08-21media: video: tegra: ar0832: Add slew rate supportNaren Bhat
Add slew rate support for AR0832 focuser. bug 1028733 Change-Id: I4fd0245fad7f7c820fc30a7c4bfc970d52903da6 Signed-off-by: Naren Bhat <nbhat@nvidia.com> Reviewed-on: http://git-master/r/124695 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Jon Mayo <jmayo@nvidia.com> Reviewed-by: Frank Chen <frankc@nvidia.com> Reviewed-by: Dan Willemsen <dwillemsen@nvidia.com>
2012-08-21i2c: tegra: protect suspend/resume callbacks with CONFIG_PM_SLEEPLaxman Dewangan
The CONFIG_PM doesn't actually enable any of the PM callbacks, it only allows to enable CONFIG_PM_SLEEP and CONFIG_PM_RUNTIME. This means if CONFIG_PM is used to protect system sleep callbacks then it may end up unreferenced if only runtime PM is enabled. Hence protecting sleep callbacks with CONFIG_PM_SLEEP. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Change-Id: I090e167c1de8f254a278e9e3b511292cfbc5f250 Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/124872 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
2012-08-21i2c: tegra: better describe fast and div clocksLaxman Dewangan
Describe the fast and div clock part of structure and prints better error message when any failure occurs in enabling clocks. Change-Id: I72f66b5f8cbefbe8b2c6b8c7150edff3ee2244b4 Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/124873 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
2012-08-21i2c: tegra: declare iomap address to iomem typeLaxman Dewangan
Declare the iomap address to __iomem type. Change-Id: Ic855834f6e7fd417e4c2fd0415a6195655d3ed60 Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/124874 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
2012-08-21i2c: tegra: I2_M_NOSTART functionality not supported in Tegra20Laxman Dewangan
Tegra20 i2c controller does not support the continue transfer which implements the I2C_M_NOSTART functionality of i2c protocol mangling. Removing the I2C_M_NOSTART functionality support for Tegra20. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Stephen Warren <swarren@nvidia.com> Cherry-picked from mainline 72dedc2fb12ff31cc2da977d0c40c3ac58f554cf Change-Id: I461342749a834ff2eae056f1c6616a8d7693a32c Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/124875 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
2012-08-21video: tegra: dc: Add timestamp supportRaghavendra VK
bug 1021221 Change-Id: Ifbe007de5bdeafaa15a0b3f2a138086045eba160 Signed-off-by: Raghavendra VK <rvk@nvidia.com> Reviewed-on: http://git-master/r/118179 (cherry picked from commit 74be8d4e7210d7bcea0d55565a7cbb06d6cc960e) Reviewed-on: http://git-master/r/121087 Reviewed-by: Jon Mayo <jmayo@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Robert Morell <rmorell@nvidia.com>
2012-08-20video: tegra: nvmap: Fix overflow in nvmap_heapTuomas Tynkkynen
do_heap_alloc locates a suitable free block from a nvmap heap given a size and alignment. Unfortunately, if a heap block happens to be smaller than the alignment passed to the function, an integer overflow will occur, and a block that's too small gets accidentally returned. Bug 1032642 Change-Id: Ic650c520409134d753e968f62f144ddeb065ccc7 Signed-off-by: Tuomas Tynkkynen <ttynkkynen@nvidia.com> Reviewed-on: http://git-master/r/123076 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
2012-08-17PM: Need to wake_up_all when suspend failBH Hsieh
In rpm_suspend, when suspend fail, before going to reschedule another autosuspend, wake_up_all is required to avoid remote wakeup issues. Bug 1026169 Bug 1027598 Bug 1032565 Change-Id: Ieaf9282dae59b2cb343bf01aa2ba837a8cdc39c7 Signed-off-by: BH Hsieh <bhsieh@nvidia.com> Reviewed-on: http://git-master/r/122978 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Neil Patel <neilp@nvidia.com> Tested-by: Neil Patel <neilp@nvidia.com> Tested-by: Steve Lin <stlin@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Steve Lin <stlin@nvidia.com>
2012-08-17usb: otg: tegra: fix racing USB connection eventsXin Xie
Sometimes USB connect and disconnect events is not detected properly. The OTG irq handler is using a workqueue which has no protection for multiple incoming event handling. This patch adds mutex to protect the workqueue for USB connection handling. BUG 968345 Change-Id: If1c6fec4231dd0dc918f7f278e0a1d7667782917 Signed-off-by: Xin Xie <xxie@nvidia.com> Reviewed-on: http://git-master/r/122308 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Rakesh Bodla <rbodla@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
2012-08-17usb: gadget: tegra: remove unnecessary bus resumeXin Xie
Current Tegra UDC driver share same IRQ with OTG driver, and it will call bus_resume() even if there is no UDC IRQ pending. This patch will check UDC IRQ source and will not cause bus resume if no IRQ pending for UDC driver. BUG 1015685 Change-Id: Ifc5634ae5d1f7f1435c64bc527ab2e9fb8d0e36b Signed-off-by: Xin Xie <xxie@nvidia.com> Reviewed-on: http://git-master/r/121896 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
2012-08-17usb: gadget: tegra_udc: use USB charging spec 1.2Xin Xie
Enable the USB charging based on the USB charging spec 1.2. Now we can detect: 1. SDP (stanardard downstream port) 2. CDP (charging downstream port) 3. DCP (dedicated charging port) 4. None (no cable connected) 5. Non-standard charger For some non-standard charger, we cannot detect it as DCP device. If we find a charger detected as USB device but no EP0 packet recieved with 1s, we then decided this is 1A charger. bug 968345 Change-Id: I804f90ea6e4794da8f52b1c3ebd694828d99f40e Signed-off-by: Xin Xie <xxie@nvidia.com> Reviewed-on: http://git-master/r/120218 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
2012-08-16video: tegra: nvmap: Add sanity checks for page pools.Krishna Reddy
Check return code for set_page_array_* calls. Change-Id: Ie62ac78b82321939d5bd9d2a636d72dadea50d28 Signed-off-by: Krishna Reddy <vdumpa@nvidia.com> Reviewed-on: http://git-master/r/123544
2012-08-16USB: gadget: f_audio_source: Adjust packet timing to reduce glitchesMike Lockwood
Increase max packet size and clean up timing logic so we can better recover from not getting an interrupt in time for a SOF. Bug 1026047 Signed-off-by: Mike Lockwood <lockwood@google.com> (cherry picked from commit 3d2096a7959d023bc31a3cf934c3d425de01c94f) Signed-off-by: Rakesh Bodla <rbodla@nvidia.com> Change-Id: I0a0a6f448e71e4a0c478bb44cadc54fa021e13e4 Reviewed-on: http://git-master/r/123344 Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
2012-08-16USB: gadget: f_audio_source: New gadget driver for audio outputMike Lockwood
This driver presents a standard USB audio class interface to the host and an ALSA PCM device to userspace Bug 1026047 Signed-off-by: Mike Lockwood <lockwood@google.com> (cherry picked from commit a23ff394752015a233dd3b27b05c9d913cbf5536) Signed-off-by: Rakesh Bodla <rbodla@nvidia.com> Change-Id: I4054e09888f17d9cdfcfd4a3d430ca5cfb3fd9fa Reviewed-on: http://git-master/r/123343 Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
2012-08-16USB: gadget: f_accessory: Add support for HID input devicesRakesh Bodla
Bug 1026047 Signed-off-by: Mike Lockwood <lockwood@google.com> (cherry picked from commit 7a3d01af4f04950a86a18f5a439f1802d8093650) Conflicts: drivers/usb/gadget/f_accessory.c Change-Id: I30bc02a1bcf636967d56370db83578f49f0e7514 Signed-off-by: Rakesh Bodla <rbodla@nvidia.com> Reviewed-on: http://git-master/r/123342 Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
2012-08-16Add ACCESSORY_SET_AUDIO_MODE control request and ioctlMike Lockwood
The control request will be used by the host to enable/disable USB audio and the ioctl will be used by userspace to read the audio mode Bug 1026047 Signed-off-by: Mike Lockwood <lockwood@google.com> (cherry picked from commit 3e1ff6142761eef148c667e540381d1fbc437d4f) Signed-off-by: Rakesh Bodla <rbodla@nvidia.com> Change-Id: I5f449de230ca8f44e2dae30a0f87772310b68f20 Reviewed-on: http://git-master/r/123341 Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
2012-08-16power: max17048: update charge status when resumeKerwin Wan
bug 1033234 Change-Id: I67a28113fbf0a2461886658322f9106d17a69f23 Signed-off-by: Kerwin Wan <kerwinw@nvidia.com> Reviewed-on: http://git-master/r/123301 Reviewed-by: Chandler Zhang <chazhang@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>
2012-08-16video: tegra: nvmap: fix input check in mmap ioctlTuomas Tynkkynen
nvmap_map_into_caller_ptr takes a memory handle from usermode and adds a memory mapping for the handle. However, the handle is not checked for being allocated. An unallocated handle would cause a kernel panic later on from a NULL dereference. Change-Id: I73987b097a0c843b913660445e8bd1b4755dac61 Signed-off-by: Tuomas Tynkkynen <ttynkkynen@nvidia.com> Reviewed-on: http://git-master/r/119689 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
2012-08-16gpio: tegra: hide tegra_gpio_enable()/disable()Laxman Dewangan
The direction apis and irq_set_wake() support the configuration of pins in gpio mode and hence it is not require to export the apis for gpio_enable()/ gpio_disable(). Hiding these api. Change-Id: I5493e4f270df85da21afb6500ac841f4fa4b522a Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/119616 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Bitan Biswas <bbiswas@nvidia.com> GVS: Gerrit_Virtual_Submit
2012-08-16usb: gadget: tegra_udc: Enable DR IRQ in udc_startPreetham Chandru
Currently dr_controller_run() is called only during otg state change. When we unload a gadget driver, for example g_mass_storage gadget driver, dr_controller_stop() is called but when it is loaded back dr_controller_run() won't get called becasue of the if condition failure. i.e if (!udc->transceiver) { dr_controller_run(udc); } So when the gadget driver is loaded for the second time without removing the cable (i.e without otg state change), the device won't get enumerated on the host because DR IRQs are not enabled. This CL fixes the above issue. Bug 1012787 Signed-off-by: Preetham Chandru <pchandru@nvidia.com> Change-Id: Ia127630e24dbe4c1e418163c2b858efb3baa8e45 Reviewed-on: http://git-master/r/114592 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
2012-08-16video: tegra: dc: disuse notifierIlan Aelion
Due to issues with rcu notifiers on secureos, modifying dc flip notifications to use a simple callback instead. Bug 1028850 Change-Id: Iebf2a6d64d7316e3df2b88444201f9f9a29698c5 Signed-off-by: Ilan Aelion <iaelion@nvidia.com> Reviewed-on: http://git-master/r/123103 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Jon Mayo <jmayo@nvidia.com> Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-by: Nitin Kumbhar <nkumbhar@nvidia.com>
2012-08-15video: tegra: host: Fix leak in 3D register readTerje Bergstrom
When 3D register is read, and we need to do a context switch, the old context reference is incremented, but it never gets decremented. Fix by using nvhost_job_get_hwctx() to acquire the reference. Bug 1031746 Change-Id: Ic72637cb2399f960e2297733bfe45e585a8ec180 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/123678 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Arto Merilainen <amerilainen@nvidia.com> Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com> GVS: Gerrit_Virtual_Submit
2012-08-15video: tegra: nvmap: Add support for zeroed pagesAlex Waterman
Add support to alloc zeroed pages for user space alloc requests. Also define a config option to force userspace allocation requests to be zeroed. Change-Id: I75d3b2bc36e808f1470b423578ec4cba99e0f967 Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: http://git-master/r/122549 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
2012-08-15video: tegra: host: Disable host1x irqs at suspendTerje Bergstrom
host1x interrupts have been left on at suspend due to using wrong constant for the interrupt register. Disable host1x interrupts at suspend. Change-Id: I915fc4e663e6ad90fccacff6fb223c5080e21fcd Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/123055 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Andrew Howe <ahowe@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com> Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
2012-08-15power: tps80031-battery: enable battery full eventXin Xie
BUG 1015045 Change-Id: Id9ac783365f08787638edc057d55f29c9a0e46eb Signed-off-by: Xin Xie <xxie@nvidia.com> Reviewed-on: http://git-master/r/122310 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
2012-08-15power: tps80031: charger: handle re-charge eventXin Xie
After the charging completed, TPS80031 can re-enable the charging if it sense the voltage dropping (120mV below target). Current drive does not handle this event and causing the charging forever stopped. This patch will check the above re-charging happens in the charging WDT handler, and will ack WDT in order to continue charging. BUG 1015045 Change-Id: Ia0a53d29cd0e73e7ebcd53f8176c8ef81b6c6090 Signed-off-by: Xin Xie <xxie@nvidia.com> Reviewed-on: http://git-master/r/122309 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
2012-08-14misc: throughput: move client calls to work queueIlan Aelion
Perform throughput notifications to clients on work queue rather than synchronously to dc flip notifications. Bug 1028850 Change-Id: Ib9446a4ab87a476230a90a1f23c260bcf98e01dc Signed-off-by: Ilan Aelion <iaelion@nvidia.com> (cherry picked from commit f48bec5168232d7a50ecfb193146a4be214af3d7) Reviewed-on: http://git-master/r/#change,122160 Reviewed-on: http://git-master/r/123102 Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User
2012-08-14video: tegra: hdcp: Add Missing LockMatt Wagner
Lock was missing around one state set, so we add it here. Bug 1024031 Change-Id: Iab013fff7e8519e8bcc91e84a5ca7cd6e6e783da Signed-off-by: Matt Wagner <mwagner@nvidia.com> Reviewed-on: http://git-master/r/122802 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Jon Mayo <jmayo@nvidia.com>
2012-08-13power: smb349: correct charger statusAllen Yu
When tegra-otg suspends with charger cable connected, the charger state and type should not be changed, neither should the charger callback be executed. SMB349 has a debounce delay of ~20ms +/- 3 after cable is unpluged and will stop all I2C functions for 2.3ms when getting reset to POR. Add 50ms' delay before reading charger status to avoid I2C error and make sure we get the right charger state. Bug 1024735 Change-Id: I1667b23df768b46b524c6578c4bee09e131d9f96 Signed-off-by: Allen Yu <alleny@nvidia.com> Reviewed-on: http://git-master/r/120905 Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> GVS: Gerrit_Virtual_Submit
2012-08-13video: tegra: host: Fix section mismatchesTerje Bergstrom
nvhost context related functions were in init section, even though they are called from non-init functions. Bug 1022681 Change-Id: Ie85e9dd3f19873aec4153e34c7bffa19f40d37fa Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/120884 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
2012-08-13mtd: tegra-nor: treat warnings as errorsDeepak Nibade
add compilation flag to treat warnings as errors handle error of variable declaration bug 949219 Change-Id: Iac05d4d0e4c4cbf39a534b7aee32c0dac57ae49d Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/118027 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Sanjay Singh Rawat <srawat@nvidia.com> Reviewed-by: Sri Krishna Chowdary <schowdary@nvidia.com> Reviewed-by: Manoj Chourasia <mchourasia@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2012-08-13input: tegra: kbc: treat warnings as errorsDeepak Nibade
-add compilation flag to treat warning as error bug 949219 Change-Id: I3f7f557099b0473883e0b959b65eb8f17ed30978 Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/118008 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Sanjay Singh Rawat <srawat@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2012-08-10video: tegra: nvmap: fix usermode input validationTuomas Tynkkynen
nvmap_pin_ids accepts a list of handles to pin, which are passed directly from usermode when called from nvmap_ioctl_pinop. However, if invalid handles are passed in, the function might still access them as valid handles, and cause a crash. Bug 1023954 Change-Id: I6b98a2ef448bb496be7d569ddd4fb516fc399cba Signed-off-by: Tuomas Tynkkynen <ttynkkynen@nvidia.com> Reviewed-on: http://git-master/r/119667 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
2012-08-10usb: ehci: tegra: Fix Slab corruption errorPreetham Chandru
Give ownership of the DMA buffer back to the processor first and then free the buffer. Otherwise processor won't be able to access the dma mapped buffers and this would lead to slab corruption. When the DMA buffer is freed without a call to dma_sync_single_for_cpu(), the kernel won't be able to set the buffer as POISON FREE and when we acquire this memory back again the kernel will start printing slab corruption output as the memory is not set to POISON FREE Bug 1017884 Bug 1018161 Reviewed-on: http://git-master/r/#change,122151 Signed-off-by: Preetham Chandru R <pchandru@nvidia.com> Change-Id: I00d6cb185cd2314cccb56f968eb0a05288588c13 Reviewed-on: http://git-master/r/122390 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
2012-08-10arm: tegra: xmm: device set to null in unregisterVinayak Pane
hsic_unregister is being called multiple times during two step enumeration process of xmm. In failure cases when enumeration does not complete properly, kernel panic is seen because of extra unregister-ehci device. Bug 1016593 Change-Id: Ibaeb20ed0dab0e906741fdfad78f7d89a3672f60 Signed-off-by: Vinayak Pane <vpane@nvidia.com> Reviewed-on: http://git-master/r/116626 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
2012-08-09misc: tegra-throughput: warn on short framesIlan Aelion
issue a warning on flip events less than 1 microsecond apart. Bug 1027664 Bug 1028850 Signed-off-by: Ilan Aelion <iaelion@nvidia.com> Reviewed-on: http://git-master/r/121810 (cherry picked from commit 6c0e907b437765fb9f7093599911b71a836d49a6) Change-Id: Ie15256e35475d345b2ebe6ddb637ccc181fcb61e Reviewed-on: http://git-master/r/122326 Reviewed-by: Donghan Ryu <dryu@nvidia.com> Tested-by: Donghan Ryu <dryu@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit
2012-08-09video: tegra: host: invalidate FDC before context saveNuno Subtil
Invalidate the FDC before submitting the context save pushbuffer to ensure cache coherency across both GPU cores. Bug 1020291 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/121945 (cherry picked from commit cef956d07ec717f4714f5101805bbe2f0f149e71) Change-Id: I43ffee6a77122b4f2fe17f063dc6756c501e59c7 Reviewed-on: http://git-master/r/122323 Tested-by: Donghan Ryu <dryu@nvidia.com> Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-by: Donghan Ryu <dryu@nvidia.com>
2012-08-09usb: host: fix tegra_ehci_remove() warningsVenu Byravarasu
usb_put_hcd calls hcd_release which frees up memory allocated for hcd. As iounmap is called after usb_put_hcd and it is trying to access hcd->regs, getting warning messages during unload of USB. Hence fixing it. bug 1023362 Change-Id: Ic339395edad9a76a9eeae290eff3517d2c714477 Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com> Reviewed-on: http://git-master/r/122088 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Krishna Yarlagadda <kyarlagadda@nvidia.com> Tested-by: Krishna Yarlagadda <kyarlagadda@nvidia.com> Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
2012-08-09USB: otg: delay device disconnectKrishna Yarlagadda
Device disconnect during resume might fail if notification clients for this device removal are not ready. Disconnecting device after the resume is complete. Bug 1024496 Change-Id: Ia806e177d2dd2b1b43d3fea7a4af45f0d4a93cd4 Signed-off-by: Krishna Yarlagadda <kyarlagadda@nvidia.com> Reviewed-on: http://git-master/r/122079 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
2012-08-09usb: gadget: tegra: fix compilation issueRakesh Bodla
Fixing the potential compilation this is currently masked as CONFIG_USB_OTG_UTILS is enabled. Change-Id: Ie10e5fc252156b8b904d387d87a11136fcc3f4c1 Signed-off-by: Rakesh Bodla <rbodla@nvidia.com> Reviewed-on: http://git-master/r/122043 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>