aboutsummaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)AuthorFilesLines
2017-01-19virtio_console: fix a crash in config_work_handlerG. Campana1-1/+1
Using control_work instead of config_work as the 3rd argument to container_of results in an invalid portdev pointer. Indeed, the work structure is initialized as below: INIT_WORK(&portdev->config_work, &config_work_handler); It leads to a crash when portdev->vdev is dereferenced later. This bug is triggered when the guest uses a virtio-console without multiport feature and receives a config_changed virtio interrupt. Signed-off-by: G. Campana <[email protected]> Reviewed-by: Amit Shah <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
2017-01-19vhost/scsi: silence uninitialized variable warningDan Carpenter1-1/+1
This is to silence an uninitialized variable warning in debug output. The problem is this line: pr_debug("vhost_get_vq_desc: head: %d, out: %u in: %u\n", head, out, in); If "head == vq->num" is true on the first iteration then "out" and "in" aren't initialized. We handle that a few lines after the printk. I was tempted to just delete the pr_debug() but I decided to just initialize them to zero instead. Also checkpatch.pl complains if variables are declared as just "unsigned" without the "int". Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
2017-01-19vhost: scsi: constify target_core_fabric_ops structuresBhumika Goyal1-1/+1
Declare target_core_fabric_ops strucrues as const as they are only passed as an argument to the functions target_register_template and target_unregister_template. The arguments are of type const struct target_core_fabric_ops *, so target_core_fabric_ops structures having this property can be declared const. Done using Coccinelle: @r disable optional_qualifier@ identifier i; position p; @@ static struct target_core_fabric_ops i@p={...}; @ok@ position p; identifier r.i; @@ ( target_register_template(&i@p) | target_unregister_template(&i@p) ) @bad@ position p!={r.p,ok.p}; identifier r.i; @@ i@p @depends on !bad disable optional_qualifier@ identifier r.i; @@ +const struct target_core_fabric_ops i; File size before: drivers/vhost/scsi.o text data bss dec hex filename 18063 2985 40 21088 5260 drivers/vhost/scsi.o File size after: drivers/vhost/scsi.o text data bss dec hex filename 18479 2601 40 21120 5280 drivers/vhost/scsi.o Signed-off-by: Bhumika Goyal <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]> Acked-by: Jason Wang <[email protected]>
2017-01-19nbd: only set MSG_MORE when we have more to sendJosef Bacik1-4/+2
A user noticed that write performance was horrible over loopback and we traced it to an inversion of when we need to set MSG_MORE. It should be set when we have more bvec's to send, not when we are on the last bvec. This patch made the test go from 20 iops to 78k iops. Signed-off-by: Josef Bacik <[email protected]> Fixes: 429a787be679 ("nbd: fix use-after-free of rq/bio in the xmit path") Signed-off-by: Jens Axboe <[email protected]>
2017-01-19Merge tag 'pci-v4.10-fixes-1' of ↵Linus Torvalds3-11/+13
git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci Pull PCI fixes from Bjorn Helgaas: - recognize that a PCI-to-PCIe bridge originates a PCIe hierarchy, so we enumerate that hierarchy correctly - X-Gene: fix a change merged for v4.10 that broke MSI - Keystone: avoid reading undefined registers, which can cause asynchronous external aborts - Supermicro X8DTH-i/6/iF/6F: ignore broken _CRS that caused us to change (and break) existing I/O port assignments * tag 'pci-v4.10-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: PCI/MSI: pci-xgene-msi: Fix CPU hotplug registration handling PCI: Enumerate switches below PCI-to-PCIe bridges x86/PCI: Ignore _CRS on Supermicro X8DTH-i/6/iF/6F PCI: designware: Check for iATU unroll only on platforms that use ATU
2017-01-19Merge branch 'for-linus' of ↵Linus Torvalds3-23/+63
git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid Pull HID fixes from Jiri Kosina: - regression fix for generic Wacom devices, from Jason Gerecke - DMA-on-stack fixes for hid-corsair driver, from Johan Hovold * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: HID: wacom: Fix sibling detection regression HID: corsair: fix control-transfer error handling HID: corsair: fix DMA buffers on stack
2017-01-19Merge tag 'for-linus-4.10-rc4-tag' of ↵Linus Torvalds1-0/+71
git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen fix from Juergen Gross: "A fix for Xen running in nested virtualization environment" * tag 'for-linus-4.10-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: partially revert "xen: Remove event channel notification through Xen PCI platform device"
2017-01-19drm: qxl: Open code teardown function for qxlGabriel Krisman Bertazi3-20/+9
This avoids using the deprecated drm_put_dev() and unload() hook interfaces in the qxl driver. Signed-off-by: Gabriel Krisman Bertazi <[email protected]> Cc: Dave Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Gustavo Padovan <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-01-19drm: qxl: Open code probing sequence for qxlGabriel Krisman Bertazi5-48/+74
This avoids using the deprecated drm_get_pci_dev() and load() hook interfaces in the qxl driver. The only tricky part is to ensure TTM debugfs initialization happens after the debugfs root node is created, which is done by moving that code into the debufs_init() hook. Tested on qemu with igt and running a WM on top of X. Changes since v1: - Drop verification for primary minor in qxl_debugsfs_init. Changes since V2: - Put new header together with other debugfs headers. Signed-off-by: Gabriel Krisman Bertazi <[email protected]> Cc: Dave Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Gustavo Padovan <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-01-19drm/i915: Remove the double handling of 'flags from ↵Ville Syrjälä1-1/+0
intel_mode_from_pipe_config() We're trying to copy the flags from the adjusted mode to the passed in mode twice. Once is enough. Signed-off-by: Ville Syrjälä <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Chris Wilson <[email protected]>
2017-01-19drm/i915: Remove crtc->config usage from intel_modeset_readout_hw_state()Ville Syrjälä1-14/+24
crtc->config is on its way out. Let's reduce our dependence on it a little bit by removing it from intel_modeset_readout_hw_state(). Also replace crtc->acttive checks with crtc_state->base.active checks. Cc: Maarten Lankhorst <[email protected]> Suggested-by: Maarten Lankhorst <[email protected]> Signed-off-by: Ville Syrjälä <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Daniel Vetter <[email protected]>
2017-01-19drm/i915: Release temporary load-detect state upon switchingChris Wilson1-0/+1
After we call drm_atomic_commit() on the load-detect state, we can free our local reference. Upon restore, we only apply and free the previous state. Fixes: 0853695c3ba4 ("drm: Add reference counting to drm_atomic_state") Signed-off-by: Chris Wilson <[email protected]> Cc: Chris Wilson <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: <[email protected]> # v4.10-rc1+ Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Ville Syrjälä <[email protected]>
2017-01-19HID: wacom: Fix sibling detection regressionJason Gerecke2-8/+18
Commit 345857b ("HID: wacom: generic: Add support for sensor offsets") included a change to the operation and location of the call to 'wacom_add_shared_data' in 'wacom_parse_and_register'. The modifications included moving it higher up so that it would occur before the call to 'wacom_retrieve_hid_descriptor'. This was done to prevent a crash that would have occured when the report containing tablet offsets was fed into the driver with 'wacom_hid_report_raw_event' (specifically: the various 'wacom_wac_*_report' functions were written with the assumption that they would only be called once tablet setup had completed; 'wacom_wac_pen_report' in particular dereferences 'shared' which wasn't yet allocated). Moving the call to 'wacom_add_shared_data' effectively prevented the crash but also broke the sibiling detection code which assumes that the HID descriptor has been read and the various device_type flags set. To fix this situation, we restore the original 'wacom_add_shared_data' operation and location and instead implement an alternative change that can also prevent the crash. Specifically, we notice that the report functions mentioned above expect to be called only for input reports. By adding a check, we can prevent feature reports (such as the offset report) from causing trouble. Fixes: 345857bb49 ("HID: wacom: generic: Add support for sensor offsets") Signed-off-by: Jason Gerecke <[email protected]> Tested-by: Ping Cheng <[email protected]> Reviewed-by: Benjamin Tissoires <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2017-01-19drm/i915: Remove i915_gem_object_to_ggtt()Chris Wilson3-33/+6
With the last user of this convenience wrapper gone, we can kill the wrapper and in the process make the lookup function static. Signed-off-by: Chris Wilson <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Joonas Lahtinen <[email protected]>
2017-01-19drm/i915: Remove i915_vma_create from VMA APIChris Wilson8-45/+13
With the introduce of i915_vma_instance() for obtaining the VMA singleton for a (obj, vm, view) tuple, we can remove the i915_vma_create() in favour of a single entry point. We do incur a lookup onto an empty tree, but the i915_vma_create() were being called infrequently and during initialisation, so the small overhead is negligible. v2: Drop the i915_ prefix from the now static vma_create() function Signed-off-by: Chris Wilson <[email protected]> Reviewed-by: Joonas Lahtinen <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-01-19drm/i915: Add a check that the VMA instance we lookup matches the requestChris Wilson1-0/+1
Just as added paranoia against our future-selves add another check that the lookup/created VMA instance matches the request. Signed-off-by: Chris Wilson <[email protected]> Cc: Joonas Lahtinen <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Joonas Lahtinen <[email protected]>
2017-01-19drm/i915: Rename some warts in the VMA APIChris Wilson7-60/+103
Whilst writing testcases to exercise the VMA API, some oddities came to light, such as i915_gem_obj_lookup_or_create(). Joonas suggested i915_vma_instance() as a neat replacement, so rename them, move them to i915_vma.c and add some kerneldoc as a sugary bonus. s/i915_gem_obj_to_vma/i915_vma_lookup/ s/i915_gem_obj_lookup_or_create_vma/i915_vma_instance/ Suggested-by: Joonas Lahtinen <[email protected]> Signed-off-by: Chris Wilson <[email protected]> Cc: Joonas Lahtinen <[email protected]> Cc: Tvrtko Ursulin <[email protected]> Reviewed-by: Joonas Lahtinen <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-01-19drm/i915: Track pinned vma in intel_plane_stateChris Wilson7-135/+104
With atomic plane states we are able to track an allocation right from preparation, during use and through to the final free after being swapped out for a new plane. We can couple the VMA we pin for the framebuffer (and its rotation) to this lifetime and avoid all the clumsy lookups in between. v2: Remove residual vma on plane cleanup (Chris) v3: Add a description for the vma destruction in intel_plane_destroy_state (Maarten) References: https://bugs.freedesktop.org/show_bug.cgi?id=98829 Signed-off-by: Chris Wilson <[email protected]> Signed-off-by: Maarten Lankhorst <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Acked-by: Joonas Lahtinen <[email protected]>
2017-01-19pinctrl: uniphier: fix Ethernet (RMII) pin-mux setting for LD20Masahiro Yamada1-1/+1
Fix the pin-mux values for the MDC, MDIO, MDIO_INTL, PHYRSTL pins. Fixes: 1e359ab1285e ("pinctrl: uniphier: add Ethernet pin-mux settings") Signed-off-by: Masahiro Yamada <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-01-19pinctrl: meson: fix uart_ao_b for GXBB and GXL/GXMMartin Blumenstingl2-8/+6
The GXBB and GXL/GXM pinctrl drivers had a configuration which conflicts with uart_ao_a. According to the GXBB ("S905") datasheet the AO UART functions are: - GPIOAO_0: Func1 = UART_TX_AO_A (bit 12), Func2 = UART_TX_AO_B (bit 26) - GPIOAO_1: Func1 = UART_RX_AO_A (bit 11), Func2 = UART_RX_AO_B (bit 25) - GPIOAO_4: Func2 = UART_TX_AO_B (bit 24) - GPIOAO_5: Func2 = UART_RX_AO_B (bit 25) The existing definition for uart_AO_A already uses GPIOAO_0 and GPIOAO_1. The old definition of uart_AO_B however was broken, as it used GPIOAO_0 for TX (which would be fine) and two pins (GPIOAO_1 and GPIOAO_5) for RX (which does not make any sense). This fixes the uart_AO_B configuration by moving it to GPIOAO_4 and GPIOAO_5 (it would be possible to use GPIOAO_0 and GPIOAO_1 in theory, but all existing hardware uses uart_AO_A there). The fix for GXBB and GXL/GXM is identical since it seems that these specific pins are identical on both SoC variants. Signed-off-by: Martin Blumenstingl <[email protected]> Reviewed-by: Kevin Hilman <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-01-19drm/i915/get_params: Add HuC status to getparamsAnusha Srivatsa1-0/+7
This patch will allow for getparams to return the status of the HuC. As the HuC has to be validated by the GuC this patch uses the validated status to show when the HuC is loaded and ready for use. You cannot use the loaded status as with the GuC as the HuC is verified after it is loaded and is not usable until it is verified. v2: removed the forewakes as the registers are already force-woken. (T.Ursulin) v3: rebased on top of drm-tip. Removed any reference to intel_huc.h v4: rebased. Rename I915_PARAM_HAS_HUC to I915_PARAM_HUC_STATUS. Remove intel_is_huc_valid() since it is used only in one place. Put the case of I915_PARAM_HAS_HUC() in the right place. v5: rebased. Add a comment to specify that I915_READ(reg) does not read garbage value. The register HUC_STATUS2 is force woken and no rpm is needed. Signed-off-by: Anusha Srivatsa <[email protected]> Signed-off-by: Peter Antoine <[email protected]> Reviewed-by: Arkadiusz Hiler <[email protected]> Signed-off-by: Jani Nikula <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-01-19drm/i915/huc: Support HuC authenticationAnusha Srivatsa4-0/+53
The HuC authentication is done by host2guc call. The HuC RSA keys are sent to GuC for authentication. v2: rebased on top of drm-tip. Changed name format and upped version 1.7. v3: changed wait_for_atomic to wait_for v4: rebased. Rename intel_huc_auh() to intel_guc_auth_huc() and place the prototype in intel_guc.h,correct the comments. v5: rebased. Moved intel_guc_auth_huc from i915_guc_submission.c to intel_uc.c.Update dev to dev_priv in intel_guc_auth_huc(). Renamed HOST2GUC_ACTION_AUTHENTICATE_HUC TO INTEL_GUC_ACTION_ AUTHENTICATE_HUC v6: rebased. Add newline on DRM_ERRORs that already dont have one. v7: rebased. Replace wait_for with intel_wait_for_register() since the latter employs sleep optimisations for quick responses- as pointed out by Chris Wilson. v8: rebased. Cleanup the intel_guc_auth_huc() by removing checks already performed in earlier functions. Make comments more descriptive. v9: rebased. Changed the bias for pinning the HuC object. Move intel_guc_auth_huc() to intel_huc.c. Change DRM_DEBUGs to DRM_ERRORs in intel_guc_auth_huc(). Add return status to DRM_ERRORs. v10: Remove message not required for the user.. Cc: Chris Wilson <[email protected]> Cc: Arkadiusz Hiler <[email protected]> Cc: Michal Wajdeczko <[email protected]> Tested-by: Xiang Haihao <[email protected]> Signed-off-by: Anusha Srivatsa <[email protected]> Signed-off-by: Alex Dai <[email protected]> Signed-off-by: Peter Antoine <[email protected]> Signed-off-by: Jani Nikula <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-01-19drm/i915/huc: Add debugfs for HuC loading status checkAnusha Srivatsa1-0/+31
Add debugfs entry for HuC loading status check. v2: rebased on top of drm-tip. Cc: Michal wajdeczko <[email protected]> Tested-by: Xiang Haihao <[email protected]> Signed-off-by: Anusha Srivatsa <[email protected]> Signed-off-by: Alex Dai <[email protected]> Signed-off-by: Peter Antoine <[email protected]> Reviewed-by: Jeff McGee <[email protected]> Reviewed-by: Michal Wajdeczko <[email protected]> Signed-off-by: Jani Nikula <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-01-19drm/i915/HuC: Add KBL huC loading SupportAnusha Srivatsa1-0/+13
This patch adds the support to load HuC on KBL Version 2.0 v2: rebased on top of drm-tip. Rename KBL_FW_ to KBL_HUC_FW_ v3: rebased. Remove old checks. Cc: Michal Wajdeczko <[email protected]> Cc: Tvrtko Ursulin <[email protected]> Signed-off-by: Anusha Srivatsa <[email protected]> Reviewed-by: Arkadiusz Hiler <[email protected]> Reviewed-by: Michal Wajdeczko <[email protected]> Signed-off-by: Jani Nikula <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-01-19drm/i915/huc: Add BXT HuC Loading SupportAnusha Srivatsa1-0/+11
This patch adds the HuC Loading for the BXT by using the updated file construction. Version 1.7 of the HuC firmware. v2: rebased on to top drm-tip. Rename BXT_FW_MAJOR to BXT_HUC_FW_ Cc: Michal Wajdeczko <[email protected]> Cc: Tvrtko Ursulin <[email protected]> Signed-off-by: Anusha Srivatsa <[email protected]> Reviewed-by: Arkadiusz Hiler <[email protected]> Reviewed-by: Michal Wajdeczko <[email protected]> Signed-off-by: Jani Nikula <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-01-19drm/i915/huc: Add HuC fw loading supportAnusha Srivatsa7-3/+292
The HuC loading process is similar to GuC. The intel_uc_fw_fetch() is used for both cases. HuC loading needs to be before GuC loading. The WOPCM setting must be done early before loading any of them. v2: rebased on-top of drm-intel-nightly. removed if(HAS_GUC()) before the guc call. (D.Gordon) update huc_version number of format. v3: rebased to drm-intel-nightly, changed the file name format to match the one in the huc package. Changed dev->dev_private to to_i915() v4: moved function back to where it was. change wait_for_atomic to wait_for. v5: rebased. Changed the year in the copyright message to reflect the right year.Correct the comments,remove the unwanted WARN message, replace drm_gem_object_unreference() with i915_gem_object_put().Make the prototypes in intel_huc.h non-extern. v6: rebased. Update the file construction done by HuC. It is similar to GuC.Adopted the approach used in- https://patchwork.freedesktop.org/patch/104355/ <Tvrtko Ursulin> v7: Change dev to dev_priv in macro definition. Corrected comments. v8: rebased on top of drm-tip. Updated functions intel_huc_load(), intel_huc_init() and intel_uc_fw_fetch() to accept dev_priv instead of dev. Moved contents of intel_huc.h to intel_uc.h. v9: change SKL_FW_ to SKL_HUC_FW_. Add intel_ prefix to guc_wopcm_size(). Remove unwanted checks in intel_uc.h. Rename huc_fw in struct intel_huc to simply fw to avoid redundency. v10: rebased. Correct comments. Make intel_huc_fini() accept dev_priv instead of dev like intel_huc_init() and intel_huc_load().Move definition to i915_guc_reg.h from intel_uc.h. Clean DMA_CTRL bits after HuC DMA transfer in huc_ucode_xfer() instead of guc_ucode_xfer(). Add suitable WARNs to give extra info. v11: rebased. Add proper bias for HuC and make sure there are asserts on failure by using guc_ggtt_offset_vma(). Introduce intel_huc.c and remove intel_huc_loader.c since it has functions that do more than just loading.Correct year in copyright. v12: remove invalidates that are not required anymore. Cc: Arkadiusz Hiler <[email protected]> Cc: Michal Wajdeczko <[email protected]> Tested-by: Xiang Haihao <[email protected]> Signed-off-by: Anusha Srivatsa <[email protected]> Signed-off-by: Alex Dai <[email protected]> Signed-off-by: Peter Antoine <[email protected]> Reviewed-by: Michal Wajdeczko <[email protected]> Signed-off-by: Jani Nikula <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-01-19gpio: provide lockdep keys for nested/unnested irqchipsLinus Walleij1-9/+9
The helper function for adding a GPIO chip compiles in a lockdep key for debugging, the same key is needed for nested chips as well. The macro construction is unreadable, replace this with two static inlines instead. The _gpiochip_irqchip_add prefixed function is not helpful, rename it with gpiochip_irqchip_add_key() that tell us what the function is actually doing. Fixes: d245b3f9bd36 ("gpio: simplify adding threaded interrupts") Cc: Roger Quadros <[email protected]> Reported-by: Clemens Gruber <[email protected]> Reported-by: Roger Quadros <[email protected]> Reported-by: Grygorii Strashko <[email protected]> Tested-by: Clemens Gruber <[email protected]> Tested-by: Grygorii Strashko <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-01-19drm/i915: prevent crash with .disable_display parameterClint Taylor1-0/+3
The .disable_display parameter was causing a fatal crash when fbdev was dereferenced during driver init. V1: protection in i915_drv.c V2: Moved protection to intel_fbdev.c Fixes: 43cee314345a ("drm/i915/fbdev: Limit the global async-domain synchronization") Testcase: igt/drv_module_reload/basic-no-display Cc: Chris Wilson <[email protected]> Signed-off-by: Clint Taylor <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Chris Wilson <[email protected]> Cc: Lukas Wunner <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Jani Nikula <[email protected]> Cc: <[email protected]> # v4.8+ Signed-off-by: Chris Wilson <[email protected]>
2017-01-19drm/bridge: adv7511: Re-write the i2c address before EDID probingJohn Stultz1-1/+9
I've found that by just turning the chip on and off via the POWER_DOWN register, I end up getting i2c_transfer errors on HiKey. Investigating further, it turns out that some of the register state in hardware is getting lost, as the device registers are reset when the chip is powered down. Thus this patch simply re-writes the i2c address to the ADV7511_REG_EDID_I2C_ADDR register to ensure its properly set before we try to read the EDID data. Cc: David Airlie <[email protected]> Cc: Archit Taneja <[email protected]> Cc: Wolfram Sang <[email protected]> Cc: Lars-Peter Clausen <[email protected]> Cc: Laurent Pinchart <[email protected]> Cc: [email protected] Reviewed-by: Laurent Pinchart <[email protected]> Tested-by: Laurent Pinchart <[email protected]> Signed-off-by: John Stultz <[email protected]> Signed-off-by: Archit Taneja <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-01-19drm/bridge: adv7511: Reuse __adv7511_power_on/off() when probing EDIDJohn Stultz1-14/+3
Thus this patch changes the EDID probing logic so that we re-use the __adv7511_power_on/off() calls instead of duplciating logic. This does change behavior slightly as it adds the HPD signal pulse to the EDID probe path, but Archit has had a patch to add HPD signal pulse to the EDID probe path before, so this should address the cases where that helped. Another difference is that regcache_mark_dirty() is also called in the power off path once EDID is probed. Cc: David Airlie <[email protected]> Cc: Archit Taneja <[email protected]> Cc: Wolfram Sang <[email protected]> Cc: Lars-Peter Clausen <[email protected]> Cc: Laurent Pinchart <[email protected]> Cc: [email protected] Reviewed-by: Laurent Pinchart <[email protected]> Tested-by: Laurent Pinchart <[email protected]> Signed-off-by: John Stultz <[email protected]> Signed-off-by: Archit Taneja <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-01-19drm/bridge: adv7511: Rework adv7511_power_on/off() so they can be reused ↵John Stultz1-4/+11
internally In chasing down issues with EDID probing, I found some duplicated but incomplete logic used to power the chip on and off. This patch refactors the adv7511_power_on/off functions, so they can be used for internal needs. Cc: David Airlie <[email protected]> Cc: Archit Taneja <[email protected]> Cc: Wolfram Sang <[email protected]> Cc: Lars-Peter Clausen <[email protected]> Cc: Laurent Pinchart <[email protected]> Cc: [email protected] Signed-off-by: John Stultz <[email protected]> Signed-off-by: Archit Taneja <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-01-19drm/bridge: adv7511: Enable HPD interrupts to support hotplug and improve ↵Archit Taneja1-1/+5
monitor detection On some adv7511 implementations, we can get some spurious disconnect signals which can cause monitor probing to fail. This patch enables HPD (hot plug detect) interrupt support which allows the monitor to be properly re-initialized when the spurious disconnect signal goes away. This also enables proper hotplug support. Cc: David Airlie <[email protected]> Cc: Archit Taneja <[email protected]> Cc: Wolfram Sang <[email protected]> Cc: Lars-Peter Clausen <[email protected]> Cc: Laurent Pinchart <[email protected]> Cc: [email protected] Acked-by: Laurent Pinchart <[email protected]> Tested-by: Laurent Pinchart <[email protected]> Originally-by: Archit Taneja <[email protected]> [jstultz: Added proper commit message] Signed-off-by: John Stultz <[email protected]> Signed-off-by: Archit Taneja <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-01-19drm/bridge: adv7511: Switch to using drm_kms_helper_hotplug_event()John Stultz1-1/+15
In chasing down a previous issue with EDID probing from calling drm_helper_hpd_irq_event() from irq context, Laurent noticed that the DRM documentation suggests that drm_kms_helper_hotplug_event() should be used instead. Thus this patch replaces drm_helper_hpd_irq_event() with drm_kms_helper_hotplug_event(), which requires we update the connector.status entry and only call _hotplug_event() when the status changes. Cc: David Airlie <[email protected]> Cc: Archit Taneja <[email protected]> Cc: Wolfram Sang <[email protected]> Cc: Lars-Peter Clausen <[email protected]> Cc: Laurent Pinchart <[email protected]> Cc: [email protected] Reviewed-by: Laurent Pinchart <[email protected]> Tested-by: Laurent Pinchart <[email protected]> Signed-off-by: John Stultz <[email protected]> Signed-off-by: Archit Taneja <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-01-19drm/bridge: adv7511: Use work_struct to defer hotplug handing to out of irq ↵John Stultz2-1/+12
context I was recently seeing issues with EDID probing, where the logic to wait for the EDID read bit to be set by the IRQ wasn't happening and the code would time out and fail. Digging deeper, I found this was due to the fact that IRQs were disabled as we were running in IRQ context from the HPD signal. Thus this patch changes the logic to handle the HPD signal via a work_struct so we can be out of irq context. With this patch, the EDID probing on hotplug does not time out. Cc: David Airlie <[email protected]> Cc: Archit Taneja <[email protected]> Cc: Wolfram Sang <[email protected]> Cc: Lars-Peter Clausen <[email protected]> Cc: Laurent Pinchart <[email protected]> Cc: [email protected] Reviewed-by: Laurent Pinchart <[email protected]> Tested-by: Laurent Pinchart <[email protected]> Signed-off-by: John Stultz <[email protected]> Signed-off-by: Archit Taneja <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-01-18Merge tag 'omap-for-v4.10/fixes-rc4' of ↵Olof Johansson1-0/+1
git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into fixes Fixes for omaps for v4.10-rc cycle. Mostly a DMA regression fix for omap1, and then a handful of trivial fixes for boards and devices to work: - Fixes TI wilink bluetooth strange platform data baud rate - Remove duplicate pinmux line for am335x-icev2 - Fix omap1 dma regression - Fix uninitialized return value for wkup_m3_ipc_probe() - Fix Ethernet PHY binding typo for dra72-evm - Fix init for omap5 and dra7 sata ports - Fix mmc card detect pin for Logic PD SOM-LV * tag 'omap-for-v4.10/fixes-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: dts: omap3: Fix Card Detect and Write Protect on Logic PD SOM-LV ARM: dts: OMAP5 / DRA7: indicate that SATA port 0 is available. ARM: dts: dra72-evm-revc: fix typo in ethernet-phy node soc: ti: wkup_m3_ipc: Fix error return code in wkup_m3_ipc_probe() ARM: OMAP1: DMA: Correct the number of logical channels ARM: dts: am335x-icev2: Remove the duplicated pinmux setting ARM: OMAP2+: Fix WL1283 Bluetooth Baud Rate Signed-off-by: Olof Johansson <[email protected]>
2017-01-18Merge branch 'timers-urgent-for-linus' of ↵Linus Torvalds1-0/+1
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull timer fix from Ingo Molnar: "Fix a crash in the ARM-Exynos clocksource driver, triggered by CPU hotplug operations" * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: clocksource/exynos_mct: Clear interrupt when cpu is shut down
2017-01-18drm/i915: Ignore bogus plane coordinates on SKL when the plane is not visibleVille Syrjälä1-0/+3
When the plane is invisible we may have all sorts of bogus stuff in the coordinates, which we must ignore or else we might fail the plane update. This started to happen on SKL when I moved the plane offset computation to happen in the check phase. Previously we happily ignored it all since we never called the update_plane hook with an invisible plane. Cc: Sivakumar Thulasimani <[email protected]> Cc: [email protected] Fixes: b63a16f6cd89 ("drm/i915: Compute display surface offset in the plane check hook for SKL+") Signed-off-by: Ville Syrjälä <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98258 Testcase: igt/pm_rpm/legacy-planes Testcase: igt/pm_rpm/universal-planes Reviewed-by: Matt Roper <[email protected]> Signed-off-by: Matt Roper <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit a5e4c7d0aa6784d8abe95c3ceef0da9656d17468) Signed-off-by: Jani Nikula <[email protected]>
2017-01-18drm/i915: Remove WaDisableLSQCROPERFforOCL KBL workaround.Francisco Jerez2-18/+0
The WaDisableLSQCROPERFforOCL workaround has the side effect of disabling an L3SQ optimization that has huge performance implications and is unlikely to be necessary for the correct functioning of usual graphic workloads. Userspace is free to re-enable the workaround on demand, and is generally in a better position to determine whether the workaround is necessary than the DRM is (e.g. only during the execution of compute kernels that rely on both L3 fences and HDC R/W requests). The same workaround seems to apply to BDW (at least to production stepping G1) and SKL as well (the internal workaround database claims that it does for all steppings, while the BSpec workaround table only mentions pre-production steppings), but the DRM doesn't do anything beyond whitelisting the L3SQCREG4 register so userspace can enable it when it sees fit. Do the same on KBL platforms. Improves performance of the GFXBench4 gl_manhattan31 benchmark by 60%, and gl_4 (AKA car chase) by 14% on a KBL GT2 running Mesa master -- This is followed by a regression of 35% and 10% respectively for the same benchmarks and platform caused by my recent patch series switching userspace to use the dataport constant cache instead of the sampler to implement uniform pull constant loads, which caused us to hit more heavily the L3 cache (and on platforms other than KBL had the opposite effect of improving performance of the same two benchmarks). The overall effect on KBL of this change combined with the recent userspace change is respectively 4.6% and 2.6%. SynMark2 OglShMapPcf was affected by the constant cache changes (though it improved as it did on other platforms rather than regressing), but is not significantly affected by this patch (with statistical significance of 5% and sample size 20). v2: Drop some more code to avoid unused variable warning. Fixes: 738fa1b3123f ("drm/i915/kbl: Add WaDisableLSQCROPERFforOCL") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99256 Signed-off-by: Francisco Jerez <[email protected]> Cc: Matthew Auld <[email protected]> Cc: Eero Tamminen <[email protected]> Cc: Jani Nikula <[email protected]> Cc: Mika Kuoppala <[email protected]> Cc: [email protected] Cc: <[email protected]> # v4.7+ Reviewed-by: Mika Kuoppala <[email protected]> [Removed double Fixes tag] Signed-off-by: Mika Kuoppala <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit 8726f2faa371514fba2f594d799db95203dfeee0) Signed-off-by: Jani Nikula <[email protected]>
2017-01-18drm: vc4: use crtc helper drm_crtc_from_index()Shawn Guo2-11/+7
Use drm_crtc_from_index() to find drm_crtc for given index, so that we do not need to maintain a pointer array in struct vc4_dev. Signed-off-by: Shawn Guo <[email protected]> Cc: Eric Anholt <[email protected]> Signed-off-by: Sean Paul <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-01-18drm: tegra: use crtc helper drm_crtc_from_index()Shawn Guo1-16/+3
Function tegra_crtc_from_pipe() does the exactly same thing as what crtc helper drm_crtc_from_index() provides. Use the helper to save some code. Signed-off-by: Shawn Guo <[email protected]> Cc: Thierry Reding <[email protected]> Signed-off-by: Sean Paul <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-01-18drm: nouveau: use crtc helper drm_crtc_from_index()Shawn Guo1-15/+18
Use drm_crtc_from_index() to find drm_crtc for given index. Signed-off-by: Shawn Guo <[email protected]> Cc: Ben Skeggs <[email protected]> Signed-off-by: Sean Paul <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-01-18drm: mediatek: use crtc helper drm_crtc_from_index()Shawn Guo2-6/+4
Use drm_crtc_from_index() to find drm_crtc for given index, so that we do not need to maintain a pointer array in struct mtk_drm_private. Signed-off-by: Shawn Guo <[email protected]> Cc: CK Hu <[email protected]> Signed-off-by: Sean Paul <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-01-18drm: kirin: use crtc helper drm_crtc_from_index()Shawn Guo2-7/+4
Use drm_crtc_from_index() to find drm_crtc for given index, so that we do not need to maintain a pointer array in struct kirin_drm_private. Reviewed-by: Xinliang Liu<[email protected]> Signed-off-by: Shawn Guo <[email protected]> Signed-off-by: Sean Paul <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-01-18drm: exynos: use crtc helper drm_crtc_from_index()Shawn Guo2-14/+2
Use drm_crtc_from_index() to find drm_crtc for given index, so that we do not need to maintain a pointer array in struct exynos_drm_private. Signed-off-by: Shawn Guo <[email protected]> Cc: Inki Dae <[email protected]> Signed-off-by: Sean Paul <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-01-18drm/i915: Avoid drm_atomic_state_put(NULL) on error pathsAnder Conselvan de Oliveira2-11/+9
The error paths in hsw_trans_edp_pipe_A_crc_wa() and intel_prepare_reset() would potentially call drm_atomic_state_put with a NULL state, which would lead to a NULL pointer dereference. Found by coverity. v2: Improve the error paths. (Chris) Fixes: 0853695c3ba4 ("drm: Add reference counting to drm_atomic_state") Cc: Chris Wilson <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: <[email protected]> # v4.10-rc1+ Signed-off-by: Ander Conselvan de Oliveira <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/1484742868-9551-1-git-send-email-ander.conselvan.de.oliveira@intel.com Reviewed-by: Chris Wilson <[email protected]> Signed-off-by: Chris Wilson <[email protected]>
2017-01-18drm/i915: Avoid drm_atomic_state_put(NULL) in intel_display_resumeChris Wilson1-1/+2
intel_display_resume() may be called without an atomic state to restore, i.e. dev_priv->modeset_reset_restore state is NULL. One such case is following a lid open/close event and the forced modeset in intel_lid_notify(). Reported-by: Stefan Seyfried <[email protected]> Tested-by: Stefan Seyfried <[email protected]> Fixes: 0853695c3ba4 ("drm: Add reference counting to drm_atomic_state") Signed-off-by: Chris Wilson <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Jani Nikula <[email protected]> Cc: <[email protected]> # v4.10-rc1+ Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Ander Conselvan de Oliveira <[email protected]>
2017-01-18drm/i915: Add comment how we treat hung contextsMika Kuoppala1-0/+21
Explain in a comment how and why we treat hung context like we do. Cc: Chris Wilson <[email protected]> Cc: Tvrtko Ursulin <[email protected]> Signed-off-by: Mika Kuoppala <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Chris Wilson <[email protected]> Signed-off-by: Chris Wilson <[email protected]>
2017-01-18drm/i915: Detect a failed GPU reset+recoveryChris Wilson3-4/+21
If we can't recover the GPU after the reset, mark it as wedged to cancel the outstanding tasks and to prevent new users from trying to use the broken GPU. v2: Check the same ring is hung again before declaring the reset broken. v3: use engine_stalled (Mika) Signed-off-by: Chris Wilson <[email protected]> Cc: Mika Kuoppala <[email protected]> Cc: Tvrtko Ursulin <[email protected]> Reviewed-by: Mika Kuoppala <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-01-18drm/i915: Tidy up engine reset logicMika Kuoppala1-11/+19
Split engine reset for engine and request specific parts. Cc: Chris Wilson <[email protected]> Cc: Tvrtko Ursulin <[email protected]> Signed-off-by: Mika Kuoppala <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Chris Wilson <[email protected]> Signed-off-by: Chris Wilson <[email protected]>
2017-01-18drm/i915: Introduce engine_stalled helperMika Kuoppala1-10/+15
Move the engine stalled/pardoned check into a helper function. Cc: Chris Wilson <[email protected]> Cc: Tvrtko Ursulin <[email protected]> Signed-off-by: Mika Kuoppala <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Chris Wilson <[email protected]> Signed-off-by: Chris Wilson <[email protected]>