android-sdk/kernel-video.git
5 years agoARM: dts: dra72: enable dss node glsdk-7.03.00.03
Anand Balagopalakrishnan [Fri, 11 Dec 2015 10:43:24 +0000 (16:13 +0530)]
ARM: dts: dra72: enable dss node

Change-Id: I4eab014f9d1eba5b40f81d5005936c72a95d8497
Signed-off-by: Anand Balagopalakrishnan <anandb@ti.com>
5 years agodrm/omap: fix leak & crash in omap_gem_op_sync()
Tomi Valkeinen [Thu, 3 Dec 2015 15:56:08 +0000 (17:56 +0200)]
drm/omap: fix leak & crash in omap_gem_op_sync()

If omap_gem_op_sync is interrupted while it waits for notify to finish,
two issues occur:

 * the waiter struct is not freed
 * the wait condition is on stack, so on return of the
   waiting function, the stack is corrupted

Therefore, the wait is made non-interruptible. So, when omap_gem_op_sync
returns, it is gurranteed that the gem operation is complete.

The downside is that if, for whatever reason, the notify never happens,
the thread waits forever. Fixing this properly would require large
changes to omap_gem.c, and as we should always get a notify, this seems
like an acceptable fix for the time being.

Original patch by Subhajit Paul <subhajit_paul@ti.com>

Change-Id: I143e3a1a259cfc0961821f5a65b1fddf182efa60
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
5 years agodrm/omap: fix kfree call when freeing omap_obj
Tomi Valkeinen [Thu, 3 Dec 2015 11:56:58 +0000 (13:56 +0200)]
drm/omap: fix kfree call when freeing omap_obj

omapdrm allocates struct omap_gem_objects, but when freeing them, it
uses the pointer to struct drm_gem_object. These are currently the same,
so no issue is seen, but if the struct omap_gem_object is changed,
problems could arise.

So fix the possible future problem by kfree'ing the objects using the
correct pointer.

Change-Id: Ia645a7ad7ed348ecad39be7afe293d8b4667363c
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
5 years agodrm/omap: call waiter->notify from non-atomic context
Tomi Valkeinen [Wed, 2 Dec 2015 17:30:34 +0000 (19:30 +0200)]
drm/omap: call waiter->notify from non-atomic context

The SGX driver is called via the sync_op notify callback, and this
callback may happen in atomic context. However, the SGX driver uses
mutex in the callback, causing the kernel to crash.

The best fix would probably be to change the SGX driver. However, this
patch fixes the issue also by first collecting the notify callbacks
which need to be called, and then actually calling them a bit later from
non-atomic context.

Change-Id: I58c42dbf84f4d97cb73f78667d7a2a88213b3946
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
5 years agodrm/omap: flush crtcs only when needed
Tomi Valkeinen [Tue, 1 Dec 2015 13:58:00 +0000 (15:58 +0200)]
drm/omap: flush crtcs only when needed

At the moment omapdrm flushes all crtcs when any client is closed. But
as only the master client can queue new work for crtcs, we can do the
flush only for the master.

We also do the flush in master_drop, so that a master_drop followed by
device close will still cause a flush.

Change-Id: Ie0bebed735a1b654122c5d84f7c52b69ba54229c
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
5 years agoOMAPDSS: Introduced tlc59108 compatibility label for FPDLink
Marcus Cooksey [Thu, 3 Dec 2015 18:04:36 +0000 (12:04 -0600)]
OMAPDSS: Introduced tlc59108 compatibility label for FPDLink

The FPDLink compatiility flag is used to distiguish between
the tlc59108 display panel.  Since the FPDLink configuration
doesn't require backlight, for example, but only requires
dss output setup, certain TLC59108 configuration steps
are ignored.

Change-Id: I773890bb2d28bde405d7af340cafe1171406eb37
Signed-off-by: Marcus Cooksey <mcooksey@ti.com>
5 years agoOMAPDSS: Add FPDLink Serdes and FDLink panel display DT entries.
Marcus Cooksey [Mon, 11 May 2015 17:24:24 +0000 (12:24 -0500)]
OMAPDSS: Add FPDLink Serdes and FDLink panel display DT entries.

Enables FPDLink output by adding
device tree nodes for fpdlink serializer.

Change-Id: Icbfd4b98c178d3b77ac327b0bfdf6e9540bac74f
Signed-off-by: Marcus Cooksey <mcooksey@ti.com>
5 years agoRevert "OMAPDSS: i886: FPDLink PLL unlocks with certain soc PLL M/N Values"
Marcus Cooksey [Wed, 2 Dec 2015 21:51:14 +0000 (15:51 -0600)]
Revert "OMAPDSS: i886: FPDLink PLL unlocks with certain soc PLL M/N Values"

This reverts commit aece4a4eed3cd0d0d7efe08889c7e1e8b73ff7b5.

More rework is required because HDMI fails detection if resolution
is dynamically changed.

Change-Id: I6067c85f0469a0a6d8e4d5639364b99a3f30ac6b
Signed-off-by: Marcus Cooksey <mcooksey@ti.com>
5 years agomedia: ti-vpe: vpdma: Use u32 for the DMA address in descriptors
Oleksandr Tyshchenko [Wed, 7 Oct 2015 12:17:49 +0000 (15:17 +0300)]
media: ti-vpe: vpdma: Use u32 for the DMA address in descriptors

VPDMA desciptor definition for data/config descriptors expect the addresses
to be 32 bit. Enabling CONFIG_ARCH_DMA_ADDR_T_64BIT that laeds to
sizeof(dma_addr_t) = 8.

Due of this, the descriptors are interpreted incorrectly causing failures.
Fix this by using u32 instead of dma_addr_t for some fields inside data
transfer descriptor.

Change-Id: I1e33241b884f575ae01d3ce3cba19b512a404c99
Signed-off-by: Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
5 years agomedia: ti-vpe: vpe: Fix kernel crash with allocation failure
Nikhil Devshatwar [Thu, 3 Dec 2015 10:41:24 +0000 (16:11 +0530)]
media: ti-vpe: vpe: Fix kernel crash with allocation failure

If for some reason, the driver is not able to allocate the motion
vectors needed for DEI operation, device_run function directly
starts using the NULL dma_addr for VPDMA transaction.

This causes L3 bus errors and the kernel goes in panic state.
Fix this by checking the status of set_srcdst_params before
starting to streamon.

Change-Id: Iba1aa39e94fcc455ac022a27ec7881ea552066ed
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
5 years agodra7: dt: update regulator constraints for main VDDs
Ravikumar Kattekola [Mon, 23 Nov 2015 06:13:39 +0000 (11:43 +0530)]
dra7: dt: update regulator constraints for main VDDs

MPU,DSP,IVA,GPU and CORE voltage domains support
AVS class 0, so the voltage that needs to be configured
actually is read from efuses which may vary between a min and
a max, to allow this variation an absolute-max-voltage
has been introduced to allow the regulator to set
any voltage between the efused value and the max.
Update regulator constraints to meet this requirement.

Change-Id: I76b2d7726ec91e96576a1bb325f184277bebb273
Signed-off-by: Ravikumar Kattekola <rk@ti.com>
5 years agoMerge branch 'p-ti-linux-3.14.y-common-new-panel' into p-ti-linux-3.14.y-common
Praneeth Bajjuri [Wed, 25 Nov 2015 20:42:28 +0000 (14:42 -0600)]
Merge branch 'p-ti-linux-3.14.y-common-new-panel' into p-ti-linux-3.14.y-common

Add support of new 10 inch osd display , touch and backlight driver

* p-ti-linux-3.14.y-common-new-panel: (59 commits)
  PLATFORM: removed vout1_pin config from DT
  CONFIG: Add config for TLC59108 and TC3587XXBG
  INPUT: Add DT Entries to enable EDT-FT5x06 TSC
  OMAPDSS: Add DT Entries to enable TLC59108 BL Controller
  BACKLIGHT: Add Driver for TLC59108 Backlight Driver
  OMAPDSS: Add DT Entries to enable 10 inch OSD Display
  OMAPDSS: New driver for the OSD 10" Display
  of: EXPORT_SYMBOL_GPL of_property_read_u64_array
  Driver core: Unified device properties interface for platform firmware
  of: add functions to count number of elements in a property
  Input: Merged 4.1 OF helper functions
  of: Introduce device tree node flag helpers.
  Driver core: Unified interface for firmware node properties
  Driver core: Unified device properties interface for platform firmware
  Driver core: Unified device properties interface for platform firmware
  device property: fix potential NULL pointer dereference
  device property: Introduce firmware node type for platform data
  driver core: Implement device property accessors through fwnode ones
  driver core: property: Update fwnode_property_read_string_array()
  Driver core: Fix missing whitespace in function argument
  ...

Change-Id: Ibb582958e81c1e0b19293100e4f81bb033715917
Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
5 years agoPLATFORM: removed vout1_pin config from DT
Marcus Cooksey [Wed, 25 Nov 2015 20:20:29 +0000 (14:20 -0600)]
PLATFORM: removed vout1_pin config from DT

IO Delay requires moving pinmux config from DT
to u-boot.

Signed-off-by: Marcus Cooksey <mcooksey@ti.com>
Change-Id: I05641e3c2129647f45b88db2ee196e7bbaf494a2

5 years agousb: dwc3: host: pass BROKEN_PE flag for known broken revisions
Felipe Balbi [Mon, 26 Oct 2015 17:25:42 +0000 (12:25 -0500)]
usb: dwc3: host: pass BROKEN_PE flag for known broken revisions

part of i896 errata fix
i896: USB xHCI port disable feature does not work

picked from ti-linux-4.1.y

commit 879f8c60ee5b ("usb: dwc3: host: pass BROKEN_PE flag for known broken revisions")

Now that we have a broken pe quirk flag, dwc3
can tell XHCI core about it.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
[cherrypick and commit-msg update for auto 3.14]
Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
Change-Id: I01b29cfeb6d4718fc263b3420c295df8a6e342e1

5 years agousb: host: xhci-plat: enable BROKEN_PE quirk if platform requested
Felipe Balbi [Mon, 26 Oct 2015 17:25:41 +0000 (12:25 -0500)]
usb: host: xhci-plat: enable BROKEN_PE quirk if platform requested

part of i896 errata fix
i896: USB xHCI port disable feature does not work

picked from ti-linux-4.1.y

commit 6b5205c61bd9 ("usb: host: xhci-plat: enable BROKEN_PE quirk if platform requested")

In case a broken pe flag is passed in via pdata,
we should enable the corresponding BROKEN_PE quirk
flag for XHCI core.

Change-Id: I1345902e888c616e5167c3b2978b2d9e4467efc9
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
[cherrypick and commit-msg update for auto 3.14]
Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
5 years agousb: host: xhci: add broken pe quirk flag to pdata
Felipe Balbi [Mon, 26 Oct 2015 17:25:40 +0000 (12:25 -0500)]
usb: host: xhci: add broken pe quirk flag to pdata

part of i896 errata fix
i896: USB xHCI port disable feature does not work

picked from ti-linux-4.1.y

commit fab38ba2a359 ("usb: host: xhci: add broken pe quirk flag to pdata")

Let platform_data users pass broken pe flag to
xhci driver.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
[cherrypick and commit-msg update for auto 3.14]
Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
Change-Id: I47aede2c86e69a429bdfc997b1d8d8f6e9f59e45

5 years agousb: dwc3: core: define macros for newest revisions
Felipe Balbi [Mon, 26 Oct 2015 17:25:39 +0000 (12:25 -0500)]
usb: dwc3: core: define macros for newest revisions

part of i896 errata fix
i896: USB xHCI port disable feature does not work

picked from ti-linux-4.1.y

commit f56d404b3022 ("usb: dwc3: core: define macros for newest revisions")

dwc3 has released two other versions (2.90a and 3.00a),
this patch just adds revision macros.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
[cherrypick and update commit-msg to auto 3.14]

Change-Id: I2353e777ee8734f7dee156dd592166223dbe8db5
Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
5 years agousb: host: xhci: dont' clear previously enabled quirks
Felipe Balbi [Wed, 11 Nov 2015 14:26:40 +0000 (08:26 -0600)]
usb: host: xhci: dont' clear previously enabled quirks

part of i896 errata fix
i896: USB xHCI port disable feature does not work

picked from ti-linux-4.1.y

commit f5adb97463c2 ("usb: host: xhci: dont' clear previously enabled quirks")

At least xhci-plat.c enables some quirks during
probe() as those are passed in via
platform_data. Instead of possibly reinitializing
those on xhci.c, let's make sure that we enable
missing ones while leaving detected bits alone.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Acked-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
[cherry-pick and update commit-msg to auto 3.14.y]
Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
Change-Id: I746465d0615fe53a61d3ef48304afa903dce3511

5 years agoCONFIG: Add config for TLC59108 and TC3587XXBG
Marcus Cooksey [Wed, 25 Nov 2015 16:17:12 +0000 (10:17 -0600)]
CONFIG: Add config for TLC59108 and TC3587XXBG

Included build flags CONFIG_BACKLIGHT_TLC59108
and CONFIG_DISPLAY_PANEL_TC3587XXBG

Change-Id: I39b04bd8c7297b76128d26f670ad467b12726ae3
Signed-off-by: Marcus Cooksey <mcooksey@ti.com>
5 years agoINPUT: Add DT Entries to enable EDT-FT5x06 TSC
Marcus Cooksey [Wed, 25 Nov 2015 01:11:37 +0000 (19:11 -0600)]
INPUT: Add DT Entries to enable EDT-FT5x06 TSC

OMAPDSS: Add DT Entries to enable 10 inch OSD Display

Add related device tree nodes and settings to support the
edt-ftx06 touchscreen controller that is
on the OSD 10" display panel (panel-tc3587xxbg).

Change-Id: I5010e055c3717cb7a1eb855a382cb48d5fb1ba42
Signed-off-by: Marcus Cooksey <mcooksey@ti.com>
5 years agoOMAPDSS: Add DT Entries to enable TLC59108 BL Controller
Marcus Cooksey [Wed, 25 Nov 2015 16:06:40 +0000 (10:06 -0600)]
OMAPDSS: Add DT Entries to enable TLC59108 BL Controller

Provide related device tree nodes and settings to enable the
backlight controller that is part of the panel-tc3587xxbg.

Change-Id: Ie0f834dfde13d2a37dc144918f1cafb3bdf548f0
Signed-off-by: Marcus Cooksey <mcooksey@ti.com>
5 years agoBACKLIGHT: Add Driver for TLC59108 Backlight Driver
Marcus Cooksey [Wed, 25 Nov 2015 00:45:08 +0000 (18:45 -0600)]
BACKLIGHT: Add Driver for TLC59108 Backlight Driver

Created a new driver to decouple it from the panel
drivers.  Currently this driver is only compatible
with the panel-tc3587xxbg driver.

Change-Id: Ic182d43c0f8500c7e7775a1c69d3510583021a80
Signed-off-by: Marcus Cooksey <mcooksey@ti.com>
5 years agoOMAPDSS: Add DT Entries to enable 10 inch OSD Display
Marcus Cooksey [Wed, 25 Nov 2015 15:51:20 +0000 (09:51 -0600)]
OMAPDSS: Add DT Entries to enable 10 inch OSD Display

Provide related device tree nodes and settings to support the
new panel-tc3587xxbg display driver.

Change-Id: I0cd8f54be4b45cbd8d1829d5b55ee03231128a1d
Signed-off-by: Marcus Cooksey <mcooksey@ti.com>
5 years agoOMAPDSS: New driver for the OSD 10" Display
Marcus Cooksey [Mon, 3 Aug 2015 19:23:45 +0000 (14:23 -0500)]
OMAPDSS: New driver for the OSD 10" Display

Added new driver for the TC3587 DPI-to-DSI
display panel

Change-Id: Ic6b8800c58cf7fb26a5baf4ad859b6682c8e8159
Signed-off-by: Marcus Cooksey <mcooksey@ti.com>
5 years agoof: EXPORT_SYMBOL_GPL of_property_read_u64_array
Sakari Ailus [Tue, 27 Jan 2015 10:26:35 +0000 (12:26 +0200)]
of: EXPORT_SYMBOL_GPL of_property_read_u64_array

Make of_property_read_u64_array() available for modules as well. This was
missing from the patch which originally added the function.

Change-Id: Iec36c3f80d9ea536848b3c417177a4df1ee99287
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Rob Herring <robh@kernel.org>
5 years agoDriver core: Unified device properties interface for platform firmware
Rafael J. Wysocki [Tue, 4 Nov 2014 00:28:56 +0000 (01:28 +0100)]
Driver core: Unified device properties interface for platform firmware

Add a uniform interface by which device drivers can request device
properties from the platform firmware by providing a property name
and the corresponding data type.  The purpose of it is to help to
write portable code that won't depend on any particular platform
firmware interface.

The following general helper functions are added:

device_property_present()
device_property_read_u8()
device_property_read_u16()
device_property_read_u32()
device_property_read_u64()
device_property_read_string()
device_property_read_u8_array()
device_property_read_u16_array()
device_property_read_u32_array()
device_property_read_u64_array()
device_property_read_string_array()

The first one allows the caller to check if the given property is
present.  The next 5 of them allow single-valued properties of
various types to be retrieved in a uniform way.  The remaining 5 are
for reading properties with multiple values (arrays of either numbers
or strings).

The interface covers both ACPI and Device Trees.

This change set includes material from Mika Westerberg and Aaron Lu.

Change-Id: I24d2fd641a94736caec008d9907670a48d54d111
Signed-off-by: Aaron Lu <aaron.lu@intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
5 years agoof: add functions to count number of elements in a property
Heiko Stuebner [Wed, 12 Feb 2014 00:00:34 +0000 (01:00 +0100)]
of: add functions to count number of elements in a property

The need to know the number of array elements in a property is
a common pattern. To prevent duplication of open-coded implementations
add a helper static function that also centralises strict sanity
checking and DTB format details, as well as a set of wrapper functions
for u8, u16, u32 and u64.

Change-Id: I08815cd845628cfc35988a6e4324217bf629eaef
Suggested-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Heiko Stuebner <heiko.stuebner@bqreaders.com>
Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Grant Likely <grant.likely@linaro.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
5 years agoInput: Merged 4.1 OF helper functions
Marcus Cooksey [Tue, 24 Nov 2015 05:11:37 +0000 (23:11 -0600)]
Input: Merged 4.1 OF helper functions

Backported portion of the 4.1 Kernel mainline
for changes that did not merge without conflict.
These changes are required to enable the
edt-ft5x06 touchscreen controller.

Change-Id: I1f6ff7b777aa02284bf5a75f2eff593e7333a39a
Signed-off-by: Marcus Cooksey <mcooksey@ti.com>
5 years agoof: Introduce device tree node flag helpers.
Pantelis Antoniou [Fri, 8 Nov 2013 15:03:56 +0000 (17:03 +0200)]
of: Introduce device tree node flag helpers.

Helper functions for working with device node flags.

Change-Id: I661b2736bafb536fc699b2be08de733e1ca8d93f
Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
Signed-off-by: Grant Likely <grant.likely@linaro.org>
5 years agoDriver core: Unified interface for firmware node properties
Rafael J. Wysocki [Tue, 4 Nov 2014 13:03:59 +0000 (14:03 +0100)]
Driver core: Unified interface for firmware node properties

Add new generic routines are provided for retrieving properties from
device description objects in the platform firmware in case there are
no struct device objects for them (either those objects have not been
created yet or they do not exist at all).

The following functions are provided:

fwnode_property_present()
fwnode_property_read_u8()
fwnode_property_read_u16()
fwnode_property_read_u32()
fwnode_property_read_u64()
fwnode_property_read_string()
fwnode_property_read_u8_array()
fwnode_property_read_u16_array()
fwnode_property_read_u32_array()
fwnode_property_read_u64_array()
fwnode_property_read_string_array()

in analogy with the corresponding functions for struct device added
previously.  For all of them, the first argument is a pointer to struct
fwnode_handle (new type) that allows a device description object
(depending on what platform firmware interface is in use) to be
obtained.

Add a new macro device_for_each_child_node() for iterating over the
children of the device description object associated with a given
device and a new function device_get_child_node_count() returning the
number of a given device's child nodes.

The interface covers both ACPI and Device Trees.

Change-Id: Ie113a52dbffa5ae8ba702999b352cf4e029278c1
Suggested-by: Grant Likely <grant.likely@linaro.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
5 years agoDriver core: Unified device properties interface for platform firmware
Rafael J. Wysocki [Tue, 4 Nov 2014 00:28:56 +0000 (01:28 +0100)]
Driver core: Unified device properties interface for platform firmware

Add a uniform interface by which device drivers can request device
properties from the platform firmware by providing a property name
and the corresponding data type.  The purpose of it is to help to
write portable code that won't depend on any particular platform
firmware interface.

The following general helper functions are added:

device_property_present()
device_property_read_u8()
device_property_read_u16()
device_property_read_u32()
device_property_read_u64()
device_property_read_string()
device_property_read_u8_array()
device_property_read_u16_array()
device_property_read_u32_array()
device_property_read_u64_array()
device_property_read_string_array()

The first one allows the caller to check if the given property is
present.  The next 5 of them allow single-valued properties of
various types to be retrieved in a uniform way.  The remaining 5 are
for reading properties with multiple values (arrays of either numbers
or strings).

The interface covers both ACPI and Device Trees.

This change set includes material from Mika Westerberg and Aaron Lu.

Change-Id: I63358bcd92fdc6497f4110f3be7b9872a926e926
Signed-off-by: Aaron Lu <aaron.lu@intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
5 years agoDriver core: Unified device properties interface for platform firmware
Rafael J. Wysocki [Tue, 4 Nov 2014 00:28:56 +0000 (01:28 +0100)]
Driver core: Unified device properties interface for platform firmware

Add a uniform interface by which device drivers can request device
properties from the platform firmware by providing a property name
and the corresponding data type.  The purpose of it is to help to
write portable code that won't depend on any particular platform
firmware interface.

The following general helper functions are added:

device_property_present()
device_property_read_u8()
device_property_read_u16()
device_property_read_u32()
device_property_read_u64()
device_property_read_string()
device_property_read_u8_array()
device_property_read_u16_array()
device_property_read_u32_array()
device_property_read_u64_array()
device_property_read_string_array()

The first one allows the caller to check if the given property is
present.  The next 5 of them allow single-valued properties of
various types to be retrieved in a uniform way.  The remaining 5 are
for reading properties with multiple values (arrays of either numbers
or strings).

The interface covers both ACPI and Device Trees.

This change set includes material from Mika Westerberg and Aaron Lu.

Change-Id: Id6741017fb1d9cc83343b15e22893d28c0fd7ab2
Signed-off-by: Aaron Lu <aaron.lu@intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
5 years agodevice property: fix potential NULL pointer dereference
Andy Shevchenko [Wed, 5 Aug 2015 13:51:11 +0000 (16:51 +0300)]
device property: fix potential NULL pointer dereference

commit ecc87eed7beeb50c0be0b73322d62135277ea2b0 upstream.

In device_add_property_set() we check pset parameter for a NULL, but few lines
later we do a pointer arithmetic without check that will crash kernel in the
set_secondary_fwnode().

Here we check if pset parameter is NULL and return immediately.

Change-Id: I2537b06553df576b4639b5fd5496150ecd377016
Fixes: 16ba08d5c9ec (device property: Introduce firmware node type for platform data)
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agodevice property: Introduce firmware node type for platform data
Rafael J. Wysocki [Fri, 3 Apr 2015 14:05:11 +0000 (16:05 +0200)]
device property: Introduce firmware node type for platform data

Introduce data structures and code allowing "built-in" properties
to be associated with devices in such a way that they will be used
by the device_property_* API if no proper firmware node (neither DT
nor ACPI) is present for the given device.

Each property is to be represented by a property_entry structure.
An array of property_entry structures (terminated with a null
entry) can be pointed to by the properties field of struct
property_set that can be added as a firmware node to a struct
device using device_add_property_set().  That will cause the
device_property_* API to use that property_set as the source
of properties if the given device does not have a DT node or
an ACPI companion device object associated with it.

Change-Id: If8d5e8fb7449564d10ffcc9da5666db153fa37dc
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agodriver core: Implement device property accessors through fwnode ones
Rafael J. Wysocki [Mon, 23 Mar 2015 23:24:16 +0000 (00:24 +0100)]
driver core: Implement device property accessors through fwnode ones

Now that the ACPI companions of devices are pointed to by the fwnode
field in struct device, the device_property_*() accessor functions
can be modified to use their fwnode_property_*() counterparts
internally with minimum extra overhead in the IS_ENABLED(CONFIG_OF)
case, so make those changes.

This allows us to get rid of the rather ugly DEV_PROP_READ_ARRAY()
macro among other things.

Change-Id: Ic43e3bc748775c43944cf908ea5818e916a4712c
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agodriver core: property: Update fwnode_property_read_string_array()
Rafael J. Wysocki [Mon, 23 Mar 2015 23:18:05 +0000 (00:18 +0100)]
driver core: property: Update fwnode_property_read_string_array()

Commit 5c0acf3b4f96 (driver core: Add comments about returning array
counts) forgot to update fwnode_property_read_string_array() along
the lines of device_property_read_string_array(), although it did
change the kerneldoc comment of it.  Fix that.

Change-Id: Ifd0f8ef6435c79a0f05a42d55d1fcd0cacabf9f4
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoDriver core: Fix missing whitespace in function argument
Florin Papa [Sun, 8 Mar 2015 10:24:05 +0000 (12:24 +0200)]
Driver core: Fix missing whitespace in function argument

Found this using checkpatch.pl.

Change-Id: Ia65471b186623f6033d91ca90cb34b37f9d3107e
Signed-off-by: Florin Papa <florin.papa192@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agodriver core: Add comments about returning array counts
Adrian Hunter [Tue, 17 Mar 2015 07:58:58 +0000 (09:58 +0200)]
driver core: Add comments about returning array counts

The "read array" variants of the device property functions
can be used to return the number of values in an array.
Update the comments to reflect that.

Change-Id: Ia870352f4d2b44366a307d6f014592eaf3c2191f
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
5 years agoDriver core: Unified interface for firmware node properties
Rafael J. Wysocki [Tue, 4 Nov 2014 13:03:59 +0000 (14:03 +0100)]
Driver core: Unified interface for firmware node properties

Add new generic routines are provided for retrieving properties from
device description objects in the platform firmware in case there are
no struct device objects for them (either those objects have not been
created yet or they do not exist at all).

The following functions are provided:

fwnode_property_present()
fwnode_property_read_u8()
fwnode_property_read_u16()
fwnode_property_read_u32()
fwnode_property_read_u64()
fwnode_property_read_string()
fwnode_property_read_u8_array()
fwnode_property_read_u16_array()
fwnode_property_read_u32_array()
fwnode_property_read_u64_array()
fwnode_property_read_string_array()

in analogy with the corresponding functions for struct device added
previously.  For all of them, the first argument is a pointer to struct
fwnode_handle (new type) that allows a device description object
(depending on what platform firmware interface is in use) to be
obtained.

Add a new macro device_for_each_child_node() for iterating over the
children of the device description object associated with a given
device and a new function device_get_child_node_count() returning the
number of a given device's child nodes.

The interface covers both ACPI and Device Trees.

Change-Id: Ic6082b2793327af8770a941aff9032f081321797
Suggested-by: Grant Likely <grant.likely@linaro.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
5 years agoDriver core: Unified device properties interface for platform firmware
Rafael J. Wysocki [Tue, 4 Nov 2014 00:28:56 +0000 (01:28 +0100)]
Driver core: Unified device properties interface for platform firmware

Add a uniform interface by which device drivers can request device
properties from the platform firmware by providing a property name
and the corresponding data type.  The purpose of it is to help to
write portable code that won't depend on any particular platform
firmware interface.

The following general helper functions are added:

device_property_present()
device_property_read_u8()
device_property_read_u16()
device_property_read_u32()
device_property_read_u64()
device_property_read_string()
device_property_read_u8_array()
device_property_read_u16_array()
device_property_read_u32_array()
device_property_read_u64_array()
device_property_read_string_array()

The first one allows the caller to check if the given property is
present.  The next 5 of them allow single-valued properties of
various types to be retrieved in a uniform way.  The remaining 5 are
for reading properties with multiple values (arrays of either numbers
or strings).

The interface covers both ACPI and Device Trees.

This change set includes material from Mika Westerberg and Aaron Lu.

Change-Id: I6ca9e95c0ba19698db4bc82417af3dc79845c53f
Signed-off-by: Aaron Lu <aaron.lu@intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
5 years agodevice property: Introduce firmware node type for platform data
Rafael J. Wysocki [Fri, 3 Apr 2015 14:05:11 +0000 (16:05 +0200)]
device property: Introduce firmware node type for platform data

Introduce data structures and code allowing "built-in" properties
to be associated with devices in such a way that they will be used
by the device_property_* API if no proper firmware node (neither DT
nor ACPI) is present for the given device.

Each property is to be represented by a property_entry structure.
An array of property_entry structures (terminated with a null
entry) can be pointed to by the properties field of struct
property_set that can be added as a firmware node to a struct
device using device_add_property_set().  That will cause the
device_property_* API to use that property_set as the source
of properties if the given device does not have a DT node or
an ACPI companion device object associated with it.

Change-Id: Ia72af51b6ee707249a50c0a08accc977173d88ae
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agodevice property: Make it possible to use secondary firmware nodes
Rafael J. Wysocki [Fri, 3 Apr 2015 21:23:37 +0000 (23:23 +0200)]
device property: Make it possible to use secondary firmware nodes

Add a secondary pointer to struct fwnode_handle so as to make it
possible for a device to have two firmware nodes associated with
it at the same time, for example, an ACPI node and a node with
a set of properties provided by platform initialization code.

In the future that will allow device property lookup to fall back
from the primary firmware node to the secondary one if the given
property is not present there to make it easier to provide defaults
for device properties used by device drivers.

Introduce two helper routines, set_primary_fwnode() and
set_secondary_fwnode() allowing callers to add a primary/secondary
firmware node to the given device in such a way that

 (1) If there's only one firmware node for that device, it will be
     pointed to by the device's firmware node pointer.
 (2) If both the primary and secondary firmware nodes are present,
     the primary one will be pointed to by the device's firmware
     node pointer, while the secondary one will be pointed to by the
     primary node's secondary pointer.
 (3) If one of these nodes is removed (by calling one of the new
     nelpers with NULL as the second argument), the other one will
     be preserved.

Make ACPI use set_primary_fwnode() for attaching its firmware nodes
to devices.

Change-Id: Ief75df58b5f447e353755ada9fc3d4efbc4d8191
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agodriver core / ACPI: Represent ACPI companions using fwnode_handle
Rafael J. Wysocki [Mon, 16 Mar 2015 22:49:03 +0000 (23:49 +0100)]
driver core / ACPI: Represent ACPI companions using fwnode_handle

Now that we have struct fwnode_handle, we can use that to point to
ACPI companions from struct device objects instead of pointing to
struct acpi_device directly.

There are two benefits from that.  First, the somewhat ugly and
hackish struct acpi_dev_node can be dropped and, second, the same
struct fwnode_handle pointer can be used in the future to point
to other (non-ACPI) firmware device node types.

Change-Id: I07bd6ba8aca14909b9fa7fc4e38d07b5ddd6657c
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Grant Likely <grant.likely@linaro.org>
5 years agodevice property: Introduce firmware node type for platform data
Rafael J. Wysocki [Fri, 3 Apr 2015 14:05:11 +0000 (16:05 +0200)]
device property: Introduce firmware node type for platform data

Introduce data structures and code allowing "built-in" properties
to be associated with devices in such a way that they will be used
by the device_property_* API if no proper firmware node (neither DT
nor ACPI) is present for the given device.

Each property is to be represented by a property_entry structure.
An array of property_entry structures (terminated with a null
entry) can be pointed to by the properties field of struct
property_set that can be added as a firmware node to a struct
device using device_add_property_set().  That will cause the
device_property_* API to use that property_set as the source
of properties if the given device does not have a DT node or
an ACPI companion device object associated with it.

Change-Id: Icb4e139acafa9dd6de6e3a2dbc97afabd541cfb2
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agodriver core / ACPI: Represent ACPI companions using fwnode_handle
Rafael J. Wysocki [Mon, 16 Mar 2015 22:49:03 +0000 (23:49 +0100)]
driver core / ACPI: Represent ACPI companions using fwnode_handle

Now that we have struct fwnode_handle, we can use that to point to
ACPI companions from struct device objects instead of pointing to
struct acpi_device directly.

There are two benefits from that.  First, the somewhat ugly and
hackish struct acpi_dev_node can be dropped and, second, the same
struct fwnode_handle pointer can be used in the future to point
to other (non-ACPI) firmware device node types.

Change-Id: Iee9338d2101782a051efe422848be6bb0cea87b3
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Grant Likely <grant.likely@linaro.org>
5 years agoDriver core: Unified interface for firmware node properties
Rafael J. Wysocki [Tue, 4 Nov 2014 13:03:59 +0000 (14:03 +0100)]
Driver core: Unified interface for firmware node properties

Add new generic routines are provided for retrieving properties from
device description objects in the platform firmware in case there are
no struct device objects for them (either those objects have not been
created yet or they do not exist at all).

The following functions are provided:

fwnode_property_present()
fwnode_property_read_u8()
fwnode_property_read_u16()
fwnode_property_read_u32()
fwnode_property_read_u64()
fwnode_property_read_string()
fwnode_property_read_u8_array()
fwnode_property_read_u16_array()
fwnode_property_read_u32_array()
fwnode_property_read_u64_array()
fwnode_property_read_string_array()

in analogy with the corresponding functions for struct device added
previously.  For all of them, the first argument is a pointer to struct
fwnode_handle (new type) that allows a device description object
(depending on what platform firmware interface is in use) to be
obtained.

Add a new macro device_for_each_child_node() for iterating over the
children of the device description object associated with a given
device and a new function device_get_child_node_count() returning the
number of a given device's child nodes.

The interface covers both ACPI and Device Trees.

Change-Id: Ib49c4ffd8d143ba28f8b9af261c9463e7a46e466
Suggested-by: Grant Likely <grant.likely@linaro.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
5 years agoDriver core: Unified device properties interface for platform firmware
Rafael J. Wysocki [Tue, 4 Nov 2014 00:28:56 +0000 (01:28 +0100)]
Driver core: Unified device properties interface for platform firmware

Add a uniform interface by which device drivers can request device
properties from the platform firmware by providing a property name
and the corresponding data type.  The purpose of it is to help to
write portable code that won't depend on any particular platform
firmware interface.

The following general helper functions are added:

device_property_present()
device_property_read_u8()
device_property_read_u16()
device_property_read_u32()
device_property_read_u64()
device_property_read_string()
device_property_read_u8_array()
device_property_read_u16_array()
device_property_read_u32_array()
device_property_read_u64_array()
device_property_read_string_array()

The first one allows the caller to check if the given property is
present.  The next 5 of them allow single-valued properties of
various types to be retrieved in a uniform way.  The remaining 5 are
for reading properties with multiple values (arrays of either numbers
or strings).

The interface covers both ACPI and Device Trees.

This change set includes material from Mika Westerberg and Aaron Lu.

Change-Id: Ib2db573e9e71d9786582c4a6b8f58fd4e8588da1
Signed-off-by: Aaron Lu <aaron.lu@intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
5 years agoInput: of_touchscreen - switch to using device properties
Dmitry Torokhov [Tue, 7 Jul 2015 12:51:03 +0000 (15:51 +0300)]
Input: of_touchscreen - switch to using device properties

Let's switch form OF to device properties so that common parsing code could
work not only on device tree but also on ACPI-based platforms.

Change-Id: I944f6d2fe7c14767f510910939961cda3863d83c
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agoInput: of_touchscreen - switch to using device properties
Dmitry Torokhov [Tue, 7 Jul 2015 12:51:03 +0000 (15:51 +0300)]
Input: of_touchscreen - switch to using device properties

Let's switch form OF to device properties so that common parsing code could
work not only on device tree but also on ACPI-based platforms.

Change-Id: Ibd7f411b0133845a1d6833528c92caa71e955337
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agoInput: of_touchscreen - switch to using device properties
Dmitry Torokhov [Tue, 7 Jul 2015 12:51:03 +0000 (15:51 +0300)]
Input: of_touchscreen - switch to using device properties

Let's switch form OF to device properties so that common parsing code could
work not only on device tree but also on ACPI-based platforms.

Change-Id: Id763f5f68f2e2f19456df6cc97931206a1e39813
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agoInput: of_touchscreen - fix setting max values on X/Y axis
Dmitry Torokhov [Tue, 7 Jul 2015 12:51:02 +0000 (15:51 +0300)]
Input: of_touchscreen - fix setting max values on X/Y axis

The binding specification says that "touchscreen-size-x" and "-y" specify
horizontal and vertical resolution of the touchscreen and therefore maximum
absolute coordinates should be reduced by 1 since we are starting with 0.

Change-Id: I02e53b22222831483bec4ffc74e65c0135561515
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agoInput: of_touchscreen - always issue warning if axis is not set up
Dmitry Torokhov [Tue, 7 Jul 2015 12:51:01 +0000 (15:51 +0300)]
Input: of_touchscreen - always issue warning if axis is not set up

Do issue warning about axis that is present in device tree but not specified
by the driver even in case of multi-touch axis as callers now tell us if they
expect multi-touch data or not.

Change-Id: Ie85898d7cb9f38bf1069719a54d2431977727000
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agoInput: improve parsing OF parameters for touchscreens
Dmitry Torokhov [Tue, 7 Jul 2015 12:41:53 +0000 (15:41 +0300)]
Input: improve parsing OF parameters for touchscreens

When applying touchscreen parameters specified in device tree let's make
sure we keep whatever setup was done by the driver and not reset the
missing values to zero.

Change-Id: I94e5579475e61c566607e27fc5a074e8158c0d9b
Reported-by: Pavel Machek <pavel@ucw.cz>
Tested-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agoInput: of_touchscreen - register multitouch axes
Maxime Ripard [Sun, 22 Mar 2015 03:17:57 +0000 (20:17 -0700)]
Input: of_touchscreen - register multitouch axes

So far, the DT parsing code was only setting up the regular input axes,
completely ignoring their multitouch counter parts.

Fill them with the same parameters than the regular axes.

Change-Id: Ie62169f52da5ec934aa8d0974d2d129e5f2a8001
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
5 years agoInput: of_touchscreen - rework the DT parsing function
Maxime Ripard [Sun, 22 Mar 2015 03:17:48 +0000 (20:17 -0700)]
Input: of_touchscreen - rework the DT parsing function

The DT parsing function currently duplicates a lot of the code to parse the
touchscreen DT properties. In order to ease further additions to this
parsing routine, rework it slightly to create new helper functions.

Change-Id: Id47cd885ec12613fc401f7e38c299e2ea1cece78
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
5 years agoInput: add common DT binding for touchscreens
Sebastian Reichel [Thu, 29 May 2014 06:51:53 +0000 (23:51 -0700)]
Input: add common DT binding for touchscreens

Add common DT binding documentation for touchscreen devices and
implement input_parse_touchscreen_of_params, which parses the common
properties and configures the input device accordingly.

The method currently does not interpret the axis inversion properties,
since there is no matching flag in the generic linux input device.

Change-Id: If5819786899d2a741f30be8ba6096af06e36ff00
Reviewed-by: Pavel Machek <pavel@ucw.cz>
Acked-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
5 years agoInput: Enable new driver for edt-ft5x06
Marcus Cooksey [Tue, 24 Nov 2015 00:37:45 +0000 (18:37 -0600)]
Input: Enable new driver for edt-ft5x06

Ported the edt-ft5x06 touchscreen controller
driver along with the dependent config and
devicetree framework.

Change-Id: I91b6b00a9d51b1e06f44a2a180505e273c511ec9
Signed-off-by: Marcus Cooksey <mcooksey@ti.com>
5 years agoInput: of_touchscreen - switch to using device properties
Dmitry Torokhov [Tue, 7 Jul 2015 12:51:03 +0000 (15:51 +0300)]
Input: of_touchscreen - switch to using device properties

Let's switch form OF to device properties so that common parsing code could
work not only on device tree but also on ACPI-based platforms.

Change-Id: Ide0d9634a7e46b2eabee4577e8c75e334d5a01b1
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agoInput: improve parsing OF parameters for touchscreens
Dmitry Torokhov [Tue, 7 Jul 2015 12:41:53 +0000 (15:41 +0300)]
Input: improve parsing OF parameters for touchscreens

When applying touchscreen parameters specified in device tree let's make
sure we keep whatever setup was done by the driver and not reset the
missing values to zero.

Change-Id: I979fdc6e595d6453593a25aadca6df3ce89c06cb
Reported-by: Pavel Machek <pavel@ucw.cz>
Tested-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agoInput: add common DT binding for touchscreens
Sebastian Reichel [Thu, 29 May 2014 06:51:53 +0000 (23:51 -0700)]
Input: add common DT binding for touchscreens

Add common DT binding documentation for touchscreen devices and
implement input_parse_touchscreen_of_params, which parses the common
properties and configures the input device accordingly.

The method currently does not interpret the axis inversion properties,
since there is no matching flag in the generic linux input device.

Change-Id: Ibdff3dcea7f6148523eac0b1e216c3766a690f77
Reviewed-by: Pavel Machek <pavel@ucw.cz>
Acked-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
5 years agoInput: edt-ft5x06 - Work around FT5506 firmware bug
Franklin S Cooper Jr [Wed, 7 Oct 2015 09:52:25 +0000 (04:52 -0500)]
Input: edt-ft5x06 - Work around FT5506 firmware bug

In the touchscreen controller ISR, reading the tsc starting from
register 0x2 causes the tsc to very infrequently update the detected
finger movement coordinates. The irq pin toogles at a fast rate to
indicate touch events are happening but when reading the coordinates
from the tsc the are only updated/change at at rate of ~100 ms.

Example:
X: 10 , Y: 30
X: 10 , Y: 30
X: 10,  Y: 30
..
// After 100 ms
X: 300, Y: 300
X: 300, y: 300
..
// After 100 ms
X: 1743, Y: 621
X: 1743, Y: 621

For some reason if instead of starting to read at register 0x2 you
start reading at register 0x0 this issue isn't seen. This seems like
a quirk only seen in the EDT FT5506 so to fix this issue simply
adjust the code to start reading from 0x0. Since there is technically
nothing wrong with doing this no regressions should be seen with other
touchscreen controllers supported by this driver.

Change-Id: I2b08c8e17a3ec59db1842f580b5e8dd6e102648d
Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agoInput: edt-ft5x06 - Add support for 10 touch points for FT5506
Franklin S Cooper Jr [Wed, 7 Oct 2015 09:52:24 +0000 (04:52 -0500)]
Input: edt-ft5x06 - Add support for 10 touch points for FT5506

FT5506 supports up to 10 touch points so increase the maximum support
points to 10.

Change-Id: I41030d1701d88b7c702d343a003f202f3f057faf
Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agoInput: edt-ft5x06 - Add support for variable amount of max support points
Franklin S Cooper Jr [Wed, 7 Oct 2015 09:52:23 +0000 (04:52 -0500)]
Input: edt-ft5x06 - Add support for variable amount of max support points

Update code so that the maximum supported points aren't hard coded but can
be changed.

Set the maximum support points based on the data passed along side the
compatible field.

Change-Id: Ic1a586d2e481c71a87e5d3fe9ce3158078d20867
Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agoInput: edt-ft5x06 - Use max support points to determine read length
Franklin S Cooper Jr [Wed, 7 Oct 2015 09:52:22 +0000 (04:52 -0500)]
Input: edt-ft5x06 - Use max support points to determine read length

Calculate the amount of data that needs to be read for specified max number
of support points. If the maximum number of support points changes then the
amount that is read from the touch screen controller should reflect this.

Change-Id: Iad904d3e90f97dbcb6424bdfe3da1d19efd3f9e9
Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agoInput: edt-ft5x06 - do not call desc_to_gpio for invalid gpios
Franklin S Cooper Jr [Wed, 7 Oct 2015 09:52:21 +0000 (04:52 -0500)]
Input: edt-ft5x06 - do not call desc_to_gpio for invalid gpios

Since reset and wake pin are optional the gpio structure for those
pins may be null. Therefore, they can't be blindly passed to
desc_to_gpio.

Change-Id: I02e808ef69dd2772cf0c574fc2d9dcb1e1921455
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agoInput: edt-ft5x06 - Add compatible field for FT5506
Franklin S Cooper Jr [Tue, 1 Sep 2015 14:56:29 +0000 (09:56 -0500)]
Input: edt-ft5x06 - Add compatible field for FT5506

FT5506 is essentially the same as other FT5x06 devices. Add new
compatibility field to reflect this.

Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com>
[nsekhar@ti.com: fix typos in binding documentation and commit
                 text]
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Change-Id: I8c1d59558810a2a2838bad7a4018166be3cef149

5 years agoInput: edt-ft5x06 - Switch to newer gpio framework
Franklin S Cooper Jr [Tue, 1 Sep 2015 14:56:28 +0000 (09:56 -0500)]
Input: edt-ft5x06 - Switch to newer gpio framework

The current/old gpio framework used doesn't properly listen to
ACTIVE_LOW and ACTIVE_HIGH flags. The newer gpio framework takes into
account these flags when setting gpio values.

Since the values being outputed were base on voltage and not logic the
values being outputted must change to refect this difference. Also use
gpiod_set_value_cansleep since wake and reset pins can be provided by
bus based io expanders.

Switch from msleep(5) to udelay_range(5000,6000) to avoid check patch
warning.

Change-Id: Idd8a7c5b8a9ce97feb6cdb92e873a97c8580c60d
Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agoInput: of_touchscreen - switch to using device properties
Dmitry Torokhov [Tue, 7 Jul 2015 12:51:03 +0000 (15:51 +0300)]
Input: of_touchscreen - switch to using device properties

Let's switch form OF to device properties so that common parsing code could
work not only on device tree but also on ACPI-based platforms.

Change-Id: If0c00cec5919a8875c4f40e78cf444e0e9dbfac5
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agoInput: improve parsing OF parameters for touchscreens
Dmitry Torokhov [Tue, 7 Jul 2015 12:41:53 +0000 (15:41 +0300)]
Input: improve parsing OF parameters for touchscreens

When applying touchscreen parameters specified in device tree let's make
sure we keep whatever setup was done by the driver and not reset the
missing values to zero.

Change-Id: Iad3a642242f4c905768730bc9e3f3a16827f5e1e
Reported-by: Pavel Machek <pavel@ucw.cz>
Tested-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agoInput: edt-ft5x06 - remove EV_SYN event report
Maxime Ripard [Sun, 22 Mar 2015 03:18:59 +0000 (20:18 -0700)]
Input: edt-ft5x06 - remove EV_SYN event report

input_register_device already sets the EV_SYN event since all devices can
generate them.

Remove the redundant affectation.

Change-Id: I7e110fb07285d138d3141dc707ebc263bdc94c8d
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
5 years agoInput: edt-ft5x06 - allow to setting the maximum axes value through the DT
Maxime Ripard [Sun, 22 Mar 2015 03:18:06 +0000 (20:18 -0700)]
Input: edt-ft5x06 - allow to setting the maximum axes value through the DT

Currently the driver relies on some obscure and undocumented register to set
the maximum axis value.

The reported value is way too high to be meaningful, which confuses some
userspace tools like QT's evdevtouch plugin which try to scale the reported
events to the maximum values.

Use the values from the DT to set meaningful values.

Change-Id: Ib74de0d591bf0499a73399f5ea06e21f3f4c96be
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
5 years agoInput: edt-ft5x06 - fixed a macro coding style issue
Asaf Vertz [Sat, 13 Dec 2014 18:59:04 +0000 (10:59 -0800)]
Input: edt-ft5x06 - fixed a macro coding style issue

Fixed a coding style error, macros with complex values should be
enclosed in parentheses.

Change-Id: I04a67a67bd7541e56eeca04956c1136eebefdc69
Signed-off-by: Asaf Vertz <asaf.vertz@tandemg.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
5 years agoInput: touchscreen - use __maybe_unused instead of ifdef around suspend/resume
Jingoo Han [Sun, 2 Nov 2014 07:04:14 +0000 (00:04 -0700)]
Input: touchscreen - use __maybe_unused instead of ifdef around suspend/resume

Use __maybe_unused instead of ifdef guards around suspend/resume
functions, in order to increase build coverage and fix build warnings.

Change-Id: I44e09f0a696232ee7560c549f157c366ecaeb379
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
5 years agoinput: edt-ft5x06: replace strnicmp with strncasecmp
Rasmus Villemoes [Mon, 13 Oct 2014 22:54:48 +0000 (15:54 -0700)]
input: edt-ft5x06: replace strnicmp with strncasecmp

The kernel used to contain two functions for length-delimited,
case-insensitive string comparison, strnicmp with correct semantics and
a slightly buggy strncasecmp.  The latter is the POSIX name, so strnicmp
was renamed to strncasecmp, and strnicmp made into a wrapper for the new
strncasecmp to avoid breaking existing users.

To allow the compat wrapper strnicmp to be removed at some point in the
future, and to avoid the extra indirection cost, do
s/strnicmp/strncasecmp/g.

Change-Id: Ib2be03dbea60bd74a9751e6d1ba59a76df50863b
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
5 years agoInput: edt-ft5x06 - remove superfluous assignment
Maks Naumov [Wed, 13 Aug 2014 22:27:52 +0000 (15:27 -0700)]
Input: edt-ft5x06 - remove superfluous assignment

Somehow we ended up with a duplicate line in edt_ft5x06_register_write()

Change-Id: I80b152279a0525bd62ca70bff299736a118a343e
Signed-off-by: Maks Naumov <maksqwe1@ukr.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
5 years agoInput: edt-ft5x06 - remove unnecessary null test
Fabian Frederick [Wed, 9 Jul 2014 16:45:57 +0000 (09:45 -0700)]
Input: edt-ft5x06 - remove unnecessary null test

Fix checkpatch warning:
"WARNING: debugfs_remove_recursive(NULL) is safe this check is probably not required"

Change-Id: Ibef720e5b5a93ffa9f5c1a432d5cb9caf8de6a32
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
5 years agoarm: dts: dra72: Remove pinmux from kernel
Nikhil Devshatwar [Mon, 23 Nov 2015 07:29:09 +0000 (12:59 +0530)]
arm: dts: dra72: Remove pinmux from kernel

With iodelay configuration and pad configuration being performed
in isolation from bootloader, all the pinmux config is to be moved
to the bootloader. Hence removing the pinmux entries and corresponding
pinctrl properties in all peripheral device nodes.

Note that the updated bootloader with patches for pad configuration
is needed for this kernel to be functional.

Change-Id: Ib0b2a43aac94f1ef57ec3c1a6d2cde4ecc733cbb
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
5 years agoarm: dts: dra72: Add MMC padmux and delay entries
Nikhil Devshatwar [Fri, 20 Nov 2015 11:42:41 +0000 (17:12 +0530)]
arm: dts: dra72: Add MMC padmux and delay entries

For MMC module, depending on the speed grade of the card,
and the controller is used in different modes. For each of the
supported mode, to guarantee timing specifications, external
iodelay configuration is needed.

Add the padmux and iodelay data for all the MMC instances used on
DRA72 EVM and update the pinctrl properties accordingly.

NOTE: On DRA72x, for MMC1 and MMC2 modules, switching between
internal loopback and pad loopback can be done via CTRL_CORE_SPARE_RW.
All the timings used here assume Pad Loopback for all instances.

All values are generated from the PCT XML files from DRA72x v1.0.5
with the python tool.

Change-Id: Ie647855d437ea376133de089e9670f722bf7ba1f
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
5 years agoOMAPDSS: i886: FPDLink PLL unlocks with certain soc PLL M/N Values
Marcus Cooksey [Thu, 12 Nov 2015 04:39:07 +0000 (22:39 -0600)]
OMAPDSS: i886: FPDLink PLL unlocks with certain soc PLL M/N Values

i886 - FPDLink PLL unlocks with certain SoC PLL M/N values

Additionally, back ported dependent video pll
configuration routines from ti-linux-4.1.y branch
commit 0a20170aa5ef ("OMAPDSS: Add common PLL code")

Change-Id: I9bbf2c5e44d550d2ac33e51594c45c403d88bc31
Signed-off-by: Marcus Cooksey <mcooksey@ti.com>
[cosmetic commit fixes only]
Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
5 years agousb: dwc3: gadget: reinitialize endpoints on suspend
Felipe Balbi [Thu, 12 Nov 2015 10:16:38 +0000 (15:46 +0530)]
usb: dwc3: gadget: reinitialize endpoints on suspend

We know the controller will just loose all of its
context and completely forget about any pending transfers.

This means we can just reinitialize the endpoints
and on resume everything works as expected.

cherrypick from ti-linux-4.1.y
commit 97a1b43e99381d39a3713680475d28fbd3cb3b95
Author: Felipe Balbi <balbi@ti.com>

Change-Id: I56dd320be704a5623c68dd0e6bdd7ca60b4b5173
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
[rebased to auto 3.14.y]
Signed-off-by: Ravi Babu <ravibabu@ti.com>
5 years agousb: dwc3: gadget: don't leave locks held
Felipe Balbi [Thu, 12 Nov 2015 09:56:07 +0000 (15:26 +0530)]
usb: dwc3: gadget: don't leave locks held

prevent a lock leak by making sure it's disabled
in the error path.

cherry-pick from ti-linux-4.1.y
commit 73fe27865f6a9ff38c2804df245d776a9745c1b5
Author: Felipe Balbi <balbi@ti.com>

Change-Id: I52693a0d08c23a62d352c968b594a1f463cdf33a
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
[backport to auto 3.14.y]
Signed-off-by: Ravi Babu <ravibabu@ti.com>
5 years agousb: dwc3: gadget: Fix incorrect DEPCMD and DGCMD status macros
Subbaraya Sundeep Bhatta [Thu, 21 May 2015 10:16:46 +0000 (15:46 +0530)]
usb: dwc3: gadget: Fix incorrect DEPCMD and DGCMD status macros

Fixed the incorrect macro definitions correctly as per databook.

Change-Id: I9fa06ee7a8fa67b24a50eada9d902f2609027401
Signed-off-by: Subbaraya Sundeep Bhatta <sbhatta@xilinx.com>
Fixes: b09bb64239c8 (usb: dwc3: gadget: implement Global Command support)
Cc: <stable@vger.kernel.org> #v3.5+
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ravi Babu <ravibabu@ti.com>
5 years agomedia: ti-vpe: vpe: Fix line stride for output motion vector
Nikhil Devshatwar [Wed, 14 Oct 2015 19:59:09 +0000 (01:29 +0530)]
media: ti-vpe: vpe: Fix line stride for output motion vector

For deinterlacing operation, VPE hardware uses motion vectors.
MV calculated in the previous iteration are used for next interation.
Therefore driver allocates two motion vectors in ping-pong fashion.

For every transaction, one MV is DMAed in and one is DMAed out.
All the outbound DMAs (DMA to memory) use output parameters, but as
the motion vectors is generated purely out of input fields, it should
use the input parameters for DMA.

Fix the add_out_dtd to use source q_data for creating descriptor.
If the output size is greater than input stride, without this change,
MV DMA may overwrite the buffer causing memory corruption.

This CRITICAL fix ensures that the motion vector DMA descriptor is
created based on the attributes with which the buffer was allocated.

Change-Id: I3c9469055966f99a8cd92a6c779a1dbe550c0653
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
Signed-off-by: Ravikumar Kattekola <rk@ti.com>
Signed-off-by: Ravi Babu <ravibabu@ti.com>
5 years agousb: xhci: i896: add quirk flag for broken PED bits
Felipe Balbi [Thu, 12 Nov 2015 16:34:19 +0000 (10:34 -0600)]
usb: xhci: i896: add quirk flag for broken PED bits

this patch is for fixing

i896: USB xHCI port disable feature does not work

picked from ti-linux-4.1.y

commit 5dea9519038a ("usb: xhci: add quirk flag for broken PED bits")

Some devices from Texas Instruments suffer from
a silicon bug where Port Enabled/Disabled bit
should not be used to silence an erroneous device.

The bug is so that if port is disabled with PED
bit, an IRQ for device removal (or attachment)
will never fire.

Just for the sake of completeness, the actual
problem lies with SNPS USB IP and this affects
all known versions up to 3.00a. A separate
patch will be added to dwc3 to enabled this
quirk flag if version is <= 3.00a.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
[append public errata ID and pull to 3.14 auto baseline]
Change-Id: Ie431876759baf753f22618e4341793c155e4b5f8
Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
5 years agoMerge branch 'ti-linux-3.14.y' of git://git.ti.com/ti-linux-kernel/ti-linux-kernel...
Praneeth Bajjuri [Wed, 11 Nov 2015 18:46:38 +0000 (12:46 -0600)]
Merge branch 'ti-linux-3.14.y' of git://git.ti.com/ti-linux-kernel/ti-linux-kernel into p-ti-linux-3.14.y-common

* 'ti-linux-3.14.y' of git://git.ti.com/ti-linux-kernel/ti-linux-kernel: (38 commits)
  Linux 3.14.57
  vhost/scsi: potential memory corruption
  xen: fix backport of previous kexec patch
  serial: 8250_pci: Add support for 12 port Exar boards
  serial: 8250_pci: Add support for 16 port Exar boards
  md/raid5: fix locking in handle_stripe_clean_event()
  IB/cm: Fix rb-tree duplicate free and use-after-free
  mvsas: Fix NULL pointer dereference in mvs_slot_task_free
  Revert "md: allow a partially recovered device to be hot-added to an array."
  md/raid10: submit_bio_wait() returns 0 on success
  md/raid1: submit_bio_wait() returns 0 on success
  crypto: api - Only abort operations on fatal signal
  module: Fix locking in symbol_put_addr()
  xen-blkfront: check for null drvdata in blkback_changed (XenbusStateClosing)
  xhci: Add spurious wakeup quirk for LynxPoint-LP controllers
  xhci: handle no ping response error properly
  dm btree: fix leak of bufio-backed block in btree_split_beneath error path
  dm btree remove: fix a bug when rebalancing nodes after removal
  Revert "ARM64: unwind: Fix PC calculation"
  rbd: prevent kernel stack blow up on rbd map
  ...

Change-Id: I44010e8831fba2720daa64682a2a451c65a0e0fc
Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
5 years agoMerge tag 'v3.14.57' of http://git.kernel.org/pub/scm/linux/kernel/git/stable/linux...
LCPD Auto Merger [Tue, 10 Nov 2015 01:18:02 +0000 (19:18 -0600)]
Merge tag 'v3.14.57' of git./linux/kernel/git/stable/linux-stable into ti-linux-3.14.y

This is the 3.14.57 stable release

* tag 'v3.14.57' of http://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable: (38 commits)
  Linux 3.14.57
  vhost/scsi: potential memory corruption
  xen: fix backport of previous kexec patch
  serial: 8250_pci: Add support for 12 port Exar boards
  serial: 8250_pci: Add support for 16 port Exar boards
  md/raid5: fix locking in handle_stripe_clean_event()
  IB/cm: Fix rb-tree duplicate free and use-after-free
  mvsas: Fix NULL pointer dereference in mvs_slot_task_free
  Revert "md: allow a partially recovered device to be hot-added to an array."
  md/raid10: submit_bio_wait() returns 0 on success
  md/raid1: submit_bio_wait() returns 0 on success
  crypto: api - Only abort operations on fatal signal
  module: Fix locking in symbol_put_addr()
  xen-blkfront: check for null drvdata in blkback_changed (XenbusStateClosing)
  xhci: Add spurious wakeup quirk for LynxPoint-LP controllers
  xhci: handle no ping response error properly
  dm btree: fix leak of bufio-backed block in btree_split_beneath error path
  dm btree remove: fix a bug when rebalancing nodes after removal
  Revert "ARM64: unwind: Fix PC calculation"
  rbd: prevent kernel stack blow up on rbd map
  ...

Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
5 years agoLinux 3.14.57
Greg Kroah-Hartman [Mon, 9 Nov 2015 20:50:58 +0000 (12:50 -0800)]
Linux 3.14.57

5 years agovhost/scsi: potential memory corruption
Dan Carpenter [Thu, 5 Feb 2015 07:37:33 +0000 (10:37 +0300)]
vhost/scsi: potential memory corruption

commit 59c816c1f24df0204e01851431d3bab3eb76719c upstream.

This code in vhost_scsi_make_tpg() is confusing because we limit "tpgt"
to UINT_MAX but the data type of "tpg->tport_tpgt" and that is a u16.

I looked at the context and it turns out that in
vhost_scsi_set_endpoint(), "tpg->tport_tpgt" is used as an offset into
the vs_tpg[] array which has VHOST_SCSI_MAX_TARGET (256) elements so
anything higher than 255 then it is invalid.  I have made that the limit
now.

In vhost_scsi_send_evt() we mask away values higher than 255, but now
that the limit has changed, we don't need the mask.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Cc: Ray Yang <ray.yang@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoxen: fix backport of previous kexec patch
Greg Kroah-Hartman [Fri, 6 Nov 2015 19:07:07 +0000 (11:07 -0800)]
xen: fix backport of previous kexec patch

Fixes the backport of 0b34a166f291d255755be46e43ed5497cdd194f2 upstream

Commit 0b34a166f291d255755be46e43ed5497cdd194f2 "x86/xen: Support
kexec/kdump in HVM guests by doing a soft reset" has been added to the
4.2-stable tree" needed to correct the CONFIG variable, as
CONFIG_KEXEC_CORE only showed up in 4.3.

Reported-by: David Vrabel <david.vrabel@citrix.com>
Reported-by: Luis Henriques <luis.henriques@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoserial: 8250_pci: Add support for 12 port Exar boards
Soeren Grunewald [Thu, 11 Jun 2015 07:25:04 +0000 (09:25 +0200)]
serial: 8250_pci: Add support for 12 port Exar boards

commit be32c0cf0462c36f482b5ddcff1d8371be1e183c upstream.

The Exar XR17V358 can also be combined with a XR17V354 chip to act as a
single 12 port chip. This works the same way as the combining two XR17V358
chips. But the reported device id then is 0x4358.

Signed-off-by: Soeren Grunewald <soeren.grunewald@desy.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoserial: 8250_pci: Add support for 16 port Exar boards
Soeren Grunewald [Tue, 28 Apr 2015 14:29:49 +0000 (16:29 +0200)]
serial: 8250_pci: Add support for 16 port Exar boards

commit 96a5d18bc1338786fecac73599f1681f59a59a8e upstream.

The Exar XR17V358 chip usually provides only 8 ports. But two chips can be
combined to act as a single 16 port chip. Therefor one chip is configured
as master the second as slave by connecting the mode pin to VCC (master)
or GND (slave).

Then the master chip is reporting a different device-id depending on
whether a slave is detected or not. The UARTs 8-15 are addressed from
0x2000-0x3fff. So the offset of 0x400 from UART to UART can be used to
address all 16 ports as before.

See: https://www.exar.com/common/content/document.ashx?id=1587 page 11

Signed-off-by: Soeren Grunewald <soeren.grunewald@desy.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agomd/raid5: fix locking in handle_stripe_clean_event()
Roman Gushchin [Fri, 30 Oct 2015 23:53:50 +0000 (10:53 +1100)]
md/raid5: fix locking in handle_stripe_clean_event()

commit b8a9d66d043ffac116100775a469f05f5158c16f upstream.

After commit 566c09c53455 ("raid5: relieve lock contention in get_active_stripe()")
__find_stripe() is called under conf->hash_locks + hash.
But handle_stripe_clean_event() calls remove_hash() under
conf->device_lock.

Under some cirscumstances the hash chain can be circuited,
and we get an infinite loop with disabled interrupts and locked hash
lock in __find_stripe(). This leads to hard lockup on multiple CPUs
and following system crash.

I was able to reproduce this behavior on raid6 over 6 ssd disks.
The devices_handle_discard_safely option should be set to enable trim
support. The following script was used:

for i in `seq 1 32`; do
    dd if=/dev/zero of=large$i bs=10M count=100 &
done

neilb: original was against a 3.x kernel.  I forward-ported
  to 4.3-rc.  This verison is suitable for any kernel since
  Commit: 59fc630b8b5f ("RAID5: batch adjacent full stripe write")
  (v4.1+).  I'll post a version for earlier kernels to stable.

Signed-off-by: Roman Gushchin <klamm@yandex-team.ru>
Fixes: 566c09c53455 ("raid5: relieve lock contention in get_active_stripe()")
Signed-off-by: NeilBrown <neilb@suse.com>
Cc: Shaohua Li <shli@kernel.org>
Cc: <stable@vger.kernel.org> # 3.13 - 4.2
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoIB/cm: Fix rb-tree duplicate free and use-after-free
Doron Tsur [Sun, 11 Oct 2015 12:58:17 +0000 (15:58 +0300)]
IB/cm: Fix rb-tree duplicate free and use-after-free

commit 0ca81a2840f77855bbad1b9f172c545c4dc9e6a4 upstream.

ib_send_cm_sidr_rep could sometimes erase the node from the sidr
(depending on errors in the process). Since ib_send_cm_sidr_rep is
called both from cm_sidr_req_handler and cm_destroy_id, cm_id_priv
could be either erased from the rb_tree twice or not erased at all.
Fixing that by making sure it's erased only once before freeing
cm_id_priv.

Fixes: a977049dacde ('[PATCH] IB: Add the kernel CM implementation')
Signed-off-by: Doron Tsur <doront@mellanox.com>
Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agomvsas: Fix NULL pointer dereference in mvs_slot_task_free
Dāvis Mosāns [Fri, 21 Aug 2015 04:29:22 +0000 (07:29 +0300)]
mvsas: Fix NULL pointer dereference in mvs_slot_task_free

commit 2280521719e81919283b82902ac24058f87dfc1b upstream.

When pci_pool_alloc fails in mvs_task_prep then task->lldd_task stays
NULL but it's later used in mvs_abort_task as slot which is passed
to mvs_slot_task_free causing NULL pointer dereference.

Just return from mvs_slot_task_free when passed with NULL slot.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=101891
Signed-off-by: Dāvis Mosāns <davispuh@gmail.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoRevert "md: allow a partially recovered device to be hot-added to an array."
NeilBrown [Sat, 31 Oct 2015 00:00:56 +0000 (11:00 +1100)]
Revert "md: allow a partially recovered device to be hot-added to an array."

commit d01552a76d71f9879af448e9142389ee9be6e95b upstream.

This reverts commit 7eb418851f3278de67126ea0c427641ab4792c57.

This commit is poorly justified, I can find not discusison in email,
and it clearly causes a problem.

If a device which is being recovered fails and is subsequently
re-added to an array, there could easily have been changes to the
array *before* the point where the recovery was up to.  So the
recovery must start again from the beginning.

If a spare is being recovered and fails, then when it is re-added we
really should do a bitmap-based recovery up to the recovery-offset,
and then a full recovery from there.  Before this reversion, we only
did the "full recovery from there" which is not corect.  After this
reversion with will do a full recovery from the start, which is safer
but not ideal.

It will be left to a future patch to arrange the two different styles
of recovery.

Reported-and-tested-by: Nate Dailey <nate.dailey@stratus.com>
Signed-off-by: NeilBrown <neilb@suse.com>
Fixes: 7eb418851f32 ("md: allow a partially recovered device to be hot-added to an array.")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agomd/raid10: submit_bio_wait() returns 0 on success
Jes Sorensen [Tue, 20 Oct 2015 16:09:13 +0000 (12:09 -0400)]
md/raid10: submit_bio_wait() returns 0 on success

commit 681ab4696062f5aa939c9e04d058732306a97176 upstream.

This was introduced with 9e882242c6193ae6f416f2d8d8db0d9126bd996b
which changed the return value of submit_bio_wait() to return != 0 on
error, but didn't update the caller accordingly.

Fixes: 9e882242c6 ("block: Add submit_bio_wait(), remove from md")
Reported-by: Bill Kuzeja <William.Kuzeja@stratus.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agomd/raid1: submit_bio_wait() returns 0 on success
Jes Sorensen [Tue, 20 Oct 2015 16:09:12 +0000 (12:09 -0400)]
md/raid1: submit_bio_wait() returns 0 on success

commit 203d27b0226a05202438ddb39ef0ef1acb14a759 upstream.

This was introduced with 9e882242c6193ae6f416f2d8d8db0d9126bd996b
which changed the return value of submit_bio_wait() to return != 0 on
error, but didn't update the caller accordingly.

Fixes: 9e882242c6 ("block: Add submit_bio_wait(), remove from md")
Reported-by: Bill Kuzeja <William.Kuzeja@stratus.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agocrypto: api - Only abort operations on fatal signal
Herbert Xu [Mon, 19 Oct 2015 10:23:57 +0000 (18:23 +0800)]
crypto: api - Only abort operations on fatal signal

commit 3fc89adb9fa4beff31374a4bf50b3d099d88ae83 upstream.

Currently a number of Crypto API operations may fail when a signal
occurs.  This causes nasty problems as the caller of those operations
are often not in a good position to restart the operation.

In fact there is currently no need for those operations to be
interrupted by user signals at all.  All we need is for them to
be killable.

This patch replaces the relevant calls of signal_pending with
fatal_signal_pending, and wait_for_completion_interruptible with
wait_for_completion_killable, respectively.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agomodule: Fix locking in symbol_put_addr()
Peter Zijlstra [Thu, 20 Aug 2015 01:04:59 +0000 (10:34 +0930)]
module: Fix locking in symbol_put_addr()

commit 275d7d44d802ef271a42dc87ac091a495ba72fc5 upstream.

Poma (on the way to another bug) reported an assertion triggering:

  [<ffffffff81150529>] module_assert_mutex_or_preempt+0x49/0x90
  [<ffffffff81150822>] __module_address+0x32/0x150
  [<ffffffff81150956>] __module_text_address+0x16/0x70
  [<ffffffff81150f19>] symbol_put_addr+0x29/0x40
  [<ffffffffa04b77ad>] dvb_frontend_detach+0x7d/0x90 [dvb_core]

Laura Abbott <labbott@redhat.com> produced a patch which lead us to
inspect symbol_put_addr(). This function has a comment claiming it
doesn't need to disable preemption around the module lookup
because it holds a reference to the module it wants to find, which
therefore cannot go away.

This is wrong (and a false optimization too, preempt_disable() is really
rather cheap, and I doubt any of this is on uber critical paths,
otherwise it would've retained a pointer to the actual module anyway and
avoided the second lookup).

While its true that the module cannot go away while we hold a reference
on it, the data structure we do the lookup in very much _CAN_ change
while we do the lookup. Therefore fix the comment and add the
required preempt_disable().

Reported-by: poma <pomidorabelisima@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Fixes: a6e6abd575fc ("module: remove module_text_address()")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoxen-blkfront: check for null drvdata in blkback_changed (XenbusStateClosing)
Cathy Avery [Fri, 2 Oct 2015 13:35:01 +0000 (09:35 -0400)]
xen-blkfront: check for null drvdata in blkback_changed (XenbusStateClosing)

commit a54c8f0f2d7df525ff997e2afe71866a1a013064 upstream.

xen-blkfront will crash if the check to talk_to_blkback()
in blkback_changed()(XenbusStateInitWait) returns an error.
The driver data is freed and info is set to NULL. Later during
the close process via talk_to_blkback's call to xenbus_dev_fatal()
the null pointer is passed to and dereference in blkfront_closing.

Signed-off-by: Cathy Avery <cathy.avery@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>