1. 17 7月, 2018 1 次提交
    • A
      efi/esrt: Only call efi_mem_reserve() for boot services memory · 61f0d555
      Ard Biesheuvel 提交于
      The following commit:
      
        7e1550b8 ("efi: Drop type and attribute checks in efi_mem_desc_lookup()")
      
      refactored the implementation of efi_mem_desc_lookup() so that the type
      check is moved to the callers, one of which is the x86 version of
      efi_arch_mem_reserve(), where we added a modified check that only takes
      EFI_BOOT_SERVICES_DATA regions into account.
      
      This is reasonable, since it is the only memory type that requires this,
      but doing so uncovered some unexpected behavior in the ESRT code, which
      permits the ESRT table to reside in other types of memory than what the
      UEFI spec mandates (i.e., EFI_BOOT_SERVICES_DATA), and unconditionally
      calls efi_mem_reserve() on the region in question. This may result in
      errors such as
      
        esrt: Reserving ESRT space from 0x000000009c810318 to 0x000000009c810350.
        efi: Failed to lookup EFI memory descriptor for 0x000000009c810318
      
      when the ESRT table is not in EFI_BOOT_SERVICES_DATA memory, but we try
      to reserve it nonetheless.
      
      So make the call to efi_mem_reserve() conditional on the memory type.
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Jones <pjones@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-efi@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      61f0d555
  2. 16 7月, 2018 5 次提交
    • A
      fbdev/efifb: Honour UEFI memory map attributes when mapping the FB · 38ac0287
      Ard Biesheuvel 提交于
      If the framebuffer address provided by the Graphics Output Protocol
      (GOP) is covered by the UEFI memory map, it will tell us which memory
      attributes are permitted when mapping this region. In some cases,
      (KVM guest on ARM), violating this will result in loss of coherency,
      which means that updates sent to the framebuffer by the guest will
      not be observeable by the host, and the emulated display simply does
      not work.
      
      So if the memory map contains such a description, take the attributes
      field into account, and add support for creating WT or WB mappings of
      the framebuffer region.
      Tested-by: NLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Acked-by: NBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Jones <pjones@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-efi@vger.kernel.org
      Link: http://lkml.kernel.org/r/20180711094040.12506-9-ard.biesheuvel@linaro.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
      38ac0287
    • A
      efi: Drop type and attribute checks in efi_mem_desc_lookup() · 7e1550b8
      Ard Biesheuvel 提交于
      The current implementation of efi_mem_desc_lookup() includes the
      following check on the memory descriptor it returns:
      
          if (!(md->attribute & EFI_MEMORY_RUNTIME) &&
              md->type != EFI_BOOT_SERVICES_DATA &&
              md->type != EFI_RUNTIME_SERVICES_DATA) {
                  continue;
          }
      
      This means that only EfiBootServicesData or EfiRuntimeServicesData
      regions are considered, or any other region type provided that it
      has the EFI_MEMORY_RUNTIME attribute set.
      
      Given what the name of the function implies, and the fact that any
      physical address can be described in the UEFI memory map only a single
      time, it does not make sense to impose this condition in the body of the
      loop, but instead, should be imposed by the caller depending on the value
      that is returned to it.
      
      Two such callers exist at the moment:
      
      - The BGRT code when running on x86, via efi_mem_reserve() and
        efi_arch_mem_reserve(). In this case, the region is already known to
        be EfiBootServicesData, and so the check is redundant.
      
      - The ESRT handling code which introduced this function, which calls it
        both directly from efi_esrt_init() and again via efi_mem_reserve() and
        efi_arch_mem_reserve() [on x86].
      
      So let's move this check into the callers instead. This preserves the
      current behavior both for BGRT and ESRT handling, and allows the lookup
      routine to be reused by other [upcoming] users that don't have this
      limitation.
      
      In the ESRT case, keep the entire condition, so that platforms that
      deviate from the UEFI spec and use something other than
      EfiBootServicesData for the ESRT table will keep working as before.
      
      For x86's efi_arch_mem_reserve() implementation, limit the type to
      EfiBootServicesData, since it is the only type the reservation code
      expects to operate on in the first place.
      
      While we're at it, drop the __init annotation so that drivers can use it
      as well.
      Tested-by: NLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Jones <pjones@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-efi@vger.kernel.org
      Link: http://lkml.kernel.org/r/20180711094040.12506-8-ard.biesheuvel@linaro.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
      7e1550b8
    • A
      efi/libstub/arm: Add opt-in Kconfig option for the DTB loader · 3d7ee348
      Ard Biesheuvel 提交于
      There are various ways a platform can provide a device tree binary
      to the kernel, with different levels of sophistication:
      
      - ideally, the UEFI firmware, which is tightly coupled with the
        platform, provides a device tree image directly as a UEFI
        configuration table, and typically permits the contents to be
        manipulated either via menu options or via UEFI environment
        variables that specify a replacement image,
      
      - GRUB for ARM has a 'devicetree' directive which allows a device
        tree image to be loaded from any location accessible to GRUB, and
        supersede the one provided by the firmware,
      
      - the EFI stub implements a dtb= command line option that allows a
        device tree image to be loaded from a file residing in the same
        file system as the one the kernel image was loaded from.
      
      The dtb= command line option was never intended to be more than a
      development feature, to allow the other options to be implemented
      in parallel. So let's make it an opt-in feature that is disabled
      by default, but can be re-enabled at will.
      
      Note that we already disable the dtb= command line option when we
      detect that we are running with UEFI Secure Boot enabled.
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Reviewed-by: NAlexander Graf <agraf@suse.de>
      Acked-by: NLeif Lindholm <leif.lindholm@linaro.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-efi@vger.kernel.org
      Link: http://lkml.kernel.org/r/20180711094040.12506-7-ard.biesheuvel@linaro.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
      3d7ee348
    • A
      efi/cper: Avoid using get_seconds() · 7bb49709
      Arnd Bergmann 提交于
      get_seconds() is deprecated because of the 32-bit time overflow
      in y2038/y2106 on 32-bit architectures. The way it is used in
      cper_next_record_id() causes an overflow in 2106 when unsigned UTC
      seconds overflow, even on 64-bit architectures.
      
      This starts using ktime_get_real_seconds() to give us more than 32 bits
      of timestamp on all architectures, and then changes the algorithm to use
      39 bits for the timestamp after the y2038 wrap date, plus an always-1
      bit at the top. This gives us another 127 epochs of 136 years, with
      strictly monotonically increasing sequence numbers across boots.
      
      This is almost certainly overkill, but seems better than just extending
      the deadline from 2038 to 2106.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-efi@vger.kernel.org
      Link: http://lkml.kernel.org/r/20180711094040.12506-5-ard.biesheuvel@linaro.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
      7bb49709
    • S
      efi: Use a work queue to invoke EFI Runtime Services · 3eb420e7
      Sai Praneeth 提交于
      Presently, when a user process requests the kernel to execute any
      UEFI runtime service, the kernel temporarily switches to a separate
      set of page tables that describe the virtual mapping of the UEFI
      runtime services regions in memory. Since UEFI runtime services are
      typically invoked with interrupts enabled, any code that may be called
      during this time, will have an incorrect view of the process's address
      space. Although it is unusual for code running in interrupt context to
      make assumptions about the process context it runs in, there are cases
      (such as the perf subsystem taking samples) where this causes problems.
      
      So let's set up a work queue for calling UEFI runtime services, so that
      the actual calls are made when the work queue items are dispatched by a
      work queue worker running in a separate kernel thread. Such threads are
      not expected to have userland mappings in the first place, and so the
      additional mappings created for the UEFI runtime services can never
      clash with any.
      
      The ResetSystem() runtime service is not covered by the work queue
      handling, since it is not expected to return, and may be called at a
      time when the kernel is torn down to the point where we cannot expect
      work queues to still be operational.
      
      The non-blocking variants of SetVariable() and QueryVariableInfo()
      are also excluded: these are intended to be used from atomic context,
      which obviously rules out waiting for a completion to be signalled by
      another thread. Note that these variants are currently only used for
      UEFI runtime services calls that occur very early in the boot, and
      for ones that occur in critical conditions, e.g., to flush kernel logs
      to UEFI variables via efi-pstore.
      Suggested-by: NAndy Lutomirski <luto@kernel.org>
      Signed-off-by: NSai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
      [ardb: exclude ResetSystem() from the workqueue treatment
             merge from 2 separate patches and rewrite commit log]
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-efi@vger.kernel.org
      Link: http://lkml.kernel.org/r/20180711094040.12506-4-ard.biesheuvel@linaro.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
      3eb420e7
  3. 13 7月, 2018 2 次提交
  4. 12 7月, 2018 2 次提交
  5. 11 7月, 2018 1 次提交
  6. 10 7月, 2018 1 次提交
    • J
      i2c: tegra: Fix NACK error handling · 54836e2d
      Jon Hunter 提交于
      On Tegra30 Cardhu the PCA9546 I2C mux is not ACK'ing I2C commands on
      resume from suspend (which is caused by the reset signal for the I2C
      mux not being configured correctl). However, this NACK is causing the
      Tegra30 to hang on resuming from suspend which is not expected as we
      detect NACKs and handle them. The hang observed appears to occur when
      resetting the I2C controller to recover from the NACK.
      
      Commit 77821b46 ("i2c: tegra: proper handling of error cases") added
      additional error handling for some error cases including NACK, however,
      it appears that this change conflicts with an early fix by commit
      f70893d0 ("i2c: tegra: Add delay before resetting the controller
      after NACK"). After commit 77821b46 was made we now disable 'packet
      mode' before the delay from commit f70893d0 happens. Testing shows
      that moving the delay to before disabling 'packet mode' fixes the hang
      observed on Tegra30. The delay was added to give the I2C controller
      chance to send a stop condition and so it makes sense to move this to
      before we disable packet mode. Please note that packet mode is always
      enabled for Tegra.
      
      Fixes: 77821b46 ("i2c: tegra: proper handling of error cases")
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Acked-by: NThierry Reding <treding@nvidia.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      Cc: stable@vger.kernel.org
      54836e2d
  7. 09 7月, 2018 4 次提交
    • G
      HID: hiddev: fix potential Spectre v1 · 4f65245f
      Gustavo A. R. Silva 提交于
      uref->field_index, uref->usage_index, finfo.field_index and cinfo.index can be
      indirectly controlled by user-space, hence leading to a potential exploitation
      of the Spectre variant 1 vulnerability.
      
      This issue was detected with the help of Smatch:
      
      drivers/hid/usbhid/hiddev.c:473 hiddev_ioctl_usage() warn: potential spectre issue 'report->field' (local cap)
      drivers/hid/usbhid/hiddev.c:477 hiddev_ioctl_usage() warn: potential spectre issue 'field->usage' (local cap)
      drivers/hid/usbhid/hiddev.c:757 hiddev_ioctl() warn: potential spectre issue 'report->field' (local cap)
      drivers/hid/usbhid/hiddev.c:801 hiddev_ioctl() warn: potential spectre issue 'hid->collection' (local cap)
      
      Fix this by sanitizing such structure fields before using them to index
      report->field, field->usage and hid->collection
      
      Notice that given that speculation windows are large, the policy is
      to kill the speculation on the first load and not worry if it can be
      completed with a dependent load/store [1].
      
      [1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      4f65245f
    • J
      HID: i2c-hid: Fix "incomplete report" noise · ef6eaf27
      Jason Andryuk 提交于
      Commit ac75a041 ("HID: i2c-hid: fix size check and type usage") started
      writing messages when the ret_size is <= 2 from i2c_master_recv.  However, my
      device i2c-DLL07D1 returns 2 for a short period of time (~0.5s) after I stop
      moving the pointing stick or touchpad.  It varies, but you get ~50 messages
      each time which spams the log hard.
      
      [  95.925055] i2c_hid i2c-DLL07D1:01: i2c_hid_get_input: incomplete report (83/2)
      
      This has also been observed with a i2c-ALP0017.
      
      [ 1781.266353] i2c_hid i2c-ALP0017:00: i2c_hid_get_input: incomplete report (30/2)
      
      Only print the message when ret_size is totally invalid and less than 2 to cut
      down on the log spam.
      
      Fixes: ac75a041 ("HID: i2c-hid: fix size check and type usage")
      Reported-by: NJohn Smith <john-s-84@gmx.net>
      Cc: stable@vger.kernel.org
      Signed-off-by: NJason Andryuk <jandryuk@gmail.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      ef6eaf27
    • S
      mmc: sdhci-esdhc-imx: allow 1.8V modes without 100/200MHz pinctrl states · 92748bea
      Stefan Agner 提交于
      If pinctrl nodes for 100/200MHz are missing, the controller should
      not select any mode which need signal frequencies 100MHz or higher.
      To prevent such speed modes the driver currently uses the quirk flag
      SDHCI_QUIRK2_NO_1_8_V. This works nicely for SD cards since 1.8V
      signaling is required for all faster modes and slower modes use 3.3V
      signaling only.
      
      However, there are eMMC modes which use 1.8V signaling and run below
      100MHz, e.g. DDR52 at 1.8V. With using SDHCI_QUIRK2_NO_1_8_V this
      mode is prevented. When using a fixed 1.8V regulator as vqmmc-supply
      the stack has no valid mode to use. In this tenuous situation the
      kernel continuously prints voltage switching errors:
        mmc1: Switching to 3.3V signalling voltage failed
      
      Avoid using SDHCI_QUIRK2_NO_1_8_V and prevent faster modes by
      altering the SDHCI capability register. With that the stack is able
      to select 1.8V modes even if no faster pinctrl states are available:
        # cat /sys/kernel/debug/mmc1/ios
        ...
        timing spec:    8 (mmc DDR52)
        signal voltage: 1 (1.80 V)
        ...
      
      Link: http://lkml.kernel.org/r/20180628081331.13051-1-stefan@agner.chSigned-off-by: NStefan Agner <stefan@agner.ch>
      Fixes: ad93220d ("mmc: sdhci-esdhc-imx: change pinctrl state according
      to uhs mode")
      Cc: <stable@vger.kernel.org> # v4.13+
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      92748bea
    • R
      ACPICA: Clear status of all events when entering S5 · fa85015c
      Rafael J. Wysocki 提交于
      After commit 18996f2d (ACPICA: Events: Stop unconditionally
      clearing ACPI IRQs during suspend/resume) the status of ACPI events
      is not cleared any more when entering the ACPI S5 system state (power
      off) which causes some systems to power up immediately after turing
      off power in certain situations.
      
      That is a functional regression, so address it by making the code
      clear the status of all ACPI events again when entering S5 (for
      system-wide suspend or hibernation the clearing of the status of all
      events is not desirable, as it might cause the kernel to miss wakeup
      events sometimes).
      
      Fixes: 18996f2d (ACPICA: Events: Stop unconditionally clearing ACPI IRQs during suspend/resume)
      Reported-by: NTakashi Iwai <tiwai@suse.de>
      Tested-by: NThomas Hänig <haenig@cosifan.de>
      Cc: 4.17+ <stable@vger.kernel.org> # 4.17+
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      fa85015c
  8. 07 7月, 2018 7 次提交
    • D
      nvmem: Don't let a NULL cell_id for nvmem_cell_get() crash us · 87ed1405
      Douglas Anderson 提交于
      In commit ca04d9d3 ("phy: qcom-qusb2: New driver for QUSB2 PHY on
      Qcom chips") you can see a call like:
      
        devm_nvmem_cell_get(dev, NULL);
      
      Note that the cell ID passed to the function is NULL.  This is because
      the qcom-qusb2 driver is expected to work only on systems where the
      PHY node is hooked up via device-tree and is nameless.
      
      This works OK for the most part.  The first thing nvmem_cell_get()
      does is to call of_nvmem_cell_get() and there it's documented that a
      NULL name is fine.  The problem happens when the call to
      of_nvmem_cell_get() returns -EINVAL.  In such a case we'll fall back
      to nvmem_cell_get_from_list() and eventually might (if nvmem_cells
      isn't an empty list) crash with something that looks like:
      
       strcmp
       nvmem_find_cell
       __nvmem_device_get
       nvmem_cell_get_from_list
       nvmem_cell_get
       devm_nvmem_cell_get
       qusb2_phy_probe
      
      There are several different ways we could fix this problem:
      
      One could argue that perhaps the qcom-qusb2 driver should be changed
      to use of_nvmem_cell_get() which is allowed to have a NULL name.  In
      that case, we'd need to add a patche to introduce
      devm_of_nvmem_cell_get() since the qcom-qusb2 driver is using devm
      managed resources.
      
      One could also argue that perhaps we could just add a name to
      qcom-qusb2.  That would be OK but I believe it effectively changes the
      device tree bindings, so maybe it's a no-go.
      
      In this patch I have chosen to fix the problem by simply not crashing
      when a NULL cell_id is passed to nvmem_cell_get().
      
      NOTE: that for the qcom-qusb2 driver the "nvmem-cells" property is
      defined to be optional and thus it's expected to be a common case that
      we would hit this crash and this is more than just a theoretical fix.
      
      Fixes: ca04d9d3 ("phy: qcom-qusb2: New driver for QUSB2 PHY on Qcom chips")
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Signed-off-by: NSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      87ed1405
    • M
      thunderbolt: Notify userspace when boot_acl is changed · 007a7490
      Mika Westerberg 提交于
      The commit 9aaa3b8b ("thunderbolt: Add support for preboot ACL")
      introduced boot_acl attribute but missed the fact that now userspace
      needs to poll the attribute constantly to find out whether it has
      changed or not. Fix this by sending notification to the userspace
      whenever the boot_acl attribute is changed.
      
      Fixes: 9aaa3b8b ("thunderbolt: Add support for preboot ACL")
      Reported-and-tested-by: NChristian Kellner <christian@kellner.me>
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Reviewed-by: NChristian Kellner <christian@kellner.me>
      Acked-by: NYehezkel Bernat <yehezkelshb@gmail.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      007a7490
    • X
      uio: fix crash after the device is unregistered · 57c5f4df
      Xiubo Li 提交于
      For the target_core_user use case, after the device is unregistered
      it maybe still opened in user space, then the kernel will crash, like:
      
      [  251.163692] BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
      [  251.163820] IP: [<ffffffffc0736213>] show_name+0x23/0x40 [uio]
      [  251.163965] PGD 8000000062694067 PUD 62696067 PMD 0
      [  251.164097] Oops: 0000 [#1] SMP
      ...
      [  251.165605]  e1000 mptscsih mptbase drm_panel_orientation_quirks dm_mirror dm_region_hash dm_log dm_mod
      [  251.166014] CPU: 0 PID: 13380 Comm: tcmu-runner Kdump: loaded Not tainted 3.10.0-916.el7.test.x86_64 #1
      [  251.166381] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 05/19/2017
      [  251.166747] task: ffff971eb91db0c0 ti: ffff971e9e384000 task.ti: ffff971e9e384000
      [  251.167137] RIP: 0010:[<ffffffffc0736213>]  [<ffffffffc0736213>] show_name+0x23/0x40 [uio]
      [  251.167563] RSP: 0018:ffff971e9e387dc8  EFLAGS: 00010282
      [  251.167978] RAX: 0000000000000000 RBX: ffff971e9e3f8000 RCX: ffff971eb8368d98
      [  251.168408] RDX: ffff971e9e3f8000 RSI: ffffffffc0738084 RDI: ffff971e9e3f8000
      [  251.168856] RBP: ffff971e9e387dd0 R08: ffff971eb8bc0018 R09: 0000000000000000
      [  251.169296] R10: 0000000000001000 R11: ffffffffa09d444d R12: ffffffffa1076e80
      [  251.169750] R13: ffff971e9e387f18 R14: 0000000000000001 R15: ffff971e9cfb1c80
      [  251.170213] FS:  00007ff37d175880(0000) GS:ffff971ebb600000(0000) knlGS:0000000000000000
      [  251.170693] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  251.171248] CR2: 0000000000000008 CR3: 00000000001f6000 CR4: 00000000003607f0
      [  251.172071] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [  251.172640] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [  251.173236] Call Trace:
      [  251.173789]  [<ffffffffa0c9b2d3>] dev_attr_show+0x23/0x60
      [  251.174356]  [<ffffffffa0f561b2>] ? mutex_lock+0x12/0x2f
      [  251.174892]  [<ffffffffa0ac6d9f>] sysfs_kf_seq_show+0xcf/0x1f0
      [  251.175433]  [<ffffffffa0ac54e6>] kernfs_seq_show+0x26/0x30
      [  251.175981]  [<ffffffffa0a63be0>] seq_read+0x110/0x3f0
      [  251.176609]  [<ffffffffa0ac5d45>] kernfs_fop_read+0xf5/0x160
      [  251.177158]  [<ffffffffa0a3d3af>] vfs_read+0x9f/0x170
      [  251.177707]  [<ffffffffa0a3e27f>] SyS_read+0x7f/0xf0
      [  251.178268]  [<ffffffffa0f648af>] system_call_fastpath+0x1c/0x21
      [  251.178823] Code: 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 55 48 89 e5 53 48 89 d3 e8 7e 96 56 e0 48 8b 80 d8 02 00 00 48 89 df 48 c7 c6 84 80 73 c0 <48> 8b 50 08 31 c0 e8 e2 67 44 e0 5b 48 98 5d c3 0f 1f 00 66 2e
      [  251.180115] RIP  [<ffffffffc0736213>] show_name+0x23/0x40 [uio]
      [  251.180820]  RSP <ffff971e9e387dc8>
      [  251.181473] CR2: 0000000000000008
      
      CC: Hamish Martin <hamish.martin@alliedtelesis.co.nz>
      CC: Mike Christie <mchristi@redhat.com>
      Reviewed-by: NHamish Martin <hamish.martin@alliedtelesis.co.nz>
      Signed-off-by: NXiubo Li <xiubli@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      57c5f4df
    • X
      uio: change to use the mutex lock instead of the spin lock · 543af586
      Xiubo Li 提交于
      We are hitting a regression with the following commit:
      
      commit a93e7b33
      Author: Hamish Martin <hamish.martin@alliedtelesis.co.nz>
      Date:   Mon May 14 13:32:23 2018 +1200
      
          uio: Prevent device destruction while fds are open
      
      The problem is the addition of spin_lock_irqsave in uio_write. This
      leads to hitting  uio_write -> copy_from_user -> _copy_from_user ->
      might_fault and the logs filling up with sleeping warnings.
      
      I also noticed some uio drivers allocate memory, sleep, grab mutexes
      from callouts like open() and release and uio is now doing
      spin_lock_irqsave while calling them.
      Reported-by: NMike Christie <mchristi@redhat.com>
      CC: Hamish Martin <hamish.martin@alliedtelesis.co.nz>
      Reviewed-by: NHamish Martin <hamish.martin@alliedtelesis.co.nz>
      Signed-off-by: NXiubo Li <xiubli@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      543af586
    • X
      uio: use request_threaded_irq instead · 9421e45f
      Xiubo Li 提交于
      Prepraing for changing to use mutex lock.
      Signed-off-by: NXiubo Li <xiubli@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9421e45f
    • C
      fpga: altera-cvp: Fix an error handling path in 'altera_cvp_probe()' · 122c5770
      Christophe Jaillet 提交于
      If 'fpga_mgr_create()' fails, we should release some resources, as done
      in the other error handling path of the function.
      
      Fixes: 7085e2a9 ("fpga: manager: change api, don't use drvdata")
      Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr>
      Reviewed-by: NMoritz Fischer <mdf@kernel.org>
      Acked-by: NAlan Tull <atull@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      122c5770
    • J
      ibmasm: don't write out of bounds in read handler · a0341fc1
      Jann Horn 提交于
      This read handler had a lot of custom logic and wrote outside the bounds of
      the provided buffer. This could lead to kernel and userspace memory
      corruption. Just use simple_read_from_buffer() with a stack buffer.
      
      Fixes: 1da177e4 ("Linux-2.6.12-rc2")
      Cc: stable@vger.kernel.org
      Signed-off-by: NJann Horn <jannh@google.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a0341fc1
  9. 06 7月, 2018 9 次提交
  10. 05 7月, 2018 5 次提交
    • M
      drm/amd/display: add a check for display depth validity · 413ff0b9
      Mikita Lipski 提交于
      [why]
      HDMI 2.0 fails to validate 4K@60 timing with 10 bpc
      [how]
      Adding a helper function that would verify if the display depth
      assigned would pass a bandwidth validation.
      Drop the display depth by one level till calculated pixel clk
      is lower than maximum TMDS clk.
      
      Bugzilla: https://bugs.freedesktop.org/106959Tested-by: NMike Lothian <mike@fireburn.co.uk>
      Reviewed-by: NHarry Wentland <harry.wentland@amd.com>
      Signed-off-by: NMikita Lipski <mikita.lipski@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      413ff0b9
    • M
      drm/amd/display: adding ycbcr420 pixel encoding for hdmi · a6311be8
      Mikita Lipski 提交于
      [why]
      HDMI EDID's VSDB contains spectial timings for specifically
      YCbCr 4:2:0 colour space. In those cases we need to verify
      if the mode provided is one of the special ones has to use
      YCbCr 4:2:0 pixel encoding for display info.
      [how]
      Verify if the mode is using specific ycbcr420 colour space with
      the help of DRM helper function and assign the mode to use
      ycbcr420 pixel encoding.
      Tested-by: NMike Lothian <mike@fireburn.co.uk>
      Reviewed-by: NHarry Wentland <harry.wentland@amd.com>
      Signed-off-by: NMikita Lipski <mikita.lipski@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      a6311be8
    • L
      drm/etnaviv: bring back progress check in job timeout handler · 2c83a726
      Lucas Stach 提交于
      When the hangcheck handler was replaced by the DRM scheduler timeout
      handling we dropped the forward progress check, as this might allow
      clients to hog the GPU for a long time with a big job.
      
      It turns out that even reasonably well behaved clients like the
      Armada Xorg driver occasionally trip over the 500ms timeout. Bring
      back the forward progress check to get rid of the userspace regression.
      
      We would still like to fix userspace to submit smaller batches
      if possible, but that is for another day.
      
      Cc: <stable@vger.kernel.org>
      Fixes: 6d7a20c0 (drm/etnaviv: replace hangcheck with scheduler timeout)
      Reported-by: NRussell King <linux@armlinux.org.uk>
      Signed-off-by: NLucas Stach <l.stach@pengutronix.de>
      Reviewed-by: NEric Anholt <eric@anholt.net>
      2c83a726
    • S
      mmc: sunxi: Disable irq during pm_suspend · b8ba3578
      Stefan Mavrodiev 提交于
      When mmc host controller enters suspend state, the clocks are
      disabled, but irqs are not. For some reason the irqchip emits
      false interrupts, which causes system lock loop.
      
      Debug log is:
        ...
        sunxi-mmc 1c11000.mmc: setting clk to 52000000, rounded 51200000
        sunxi-mmc 1c11000.mmc: enabling the clock
        sunxi-mmc 1c11000.mmc: cmd 13(8000014d) arg 10000 ie 0x0000bbc6 len 0
        sunxi-mmc 1c11000.mmc: irq: rq (ptrval) mi 00000004 idi 00000000
        sunxi-mmc 1c11000.mmc: cmd 6(80000146) arg 3210101 ie 0x0000bbc6 len 0
        sunxi-mmc 1c11000.mmc: irq: rq (ptrval) mi 00000004 idi 00000000
        sunxi-mmc 1c11000.mmc: cmd 13(8000014d) arg 10000 ie 0x0000bbc6 len 0
        sunxi-mmc 1c11000.mmc: irq: rq (ptrval) mi 00000004 idi 00000000
        mmc1: new DDR MMC card at address 0001
        mmcblk1: mmc1:0001 AGND3R 14.6 GiB
        mmcblk1boot0: mmc1:0001 AGND3R partition 1 4.00 MiB
        mmcblk1boot1: mmc1:0001 AGND3R partition 2 4.00 MiB
        sunxi-mmc 1c11000.mmc: cmd 18(80003352) arg 0 ie 0x0000fbc2 len 409
        sunxi-mmc 1c11000.mmc: irq: rq (ptrval) mi 00004000 idi 00000002
         mmcblk1: p1
        sunxi-mmc 1c11000.mmc: irq: rq   (null) mi 00000000 idi 00000000
        sunxi-mmc 1c11000.mmc: irq: rq   (null) mi 00000000 idi 00000000
        sunxi-mmc 1c11000.mmc: irq: rq   (null) mi 00000000 idi 00000000
        sunxi-mmc 1c11000.mmc: irq: rq   (null) mi 00000000 idi 00000000
      and so on...
      
      This issue apears on eMMC cards, routed on MMC2 slot. The patch is
      tested with A20-OLinuXino-MICRO/LIME/LIME2 boards.
      
      Fixes: 9a8e1e8c ("mmc: sunxi: Add runtime_pm support")
      Signed-off-by: NStefan Mavrodiev <stefan@olimex.com>
      Acked-by: NMaxime Ripard <maxime.ripard@bootlin.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      b8ba3578
    • M
      drm/udl: fix display corruption of the last line · 99ec9e77
      Mikulas Patocka 提交于
      The displaylink hardware has such a peculiarity that it doesn't render a
      command until next command is received. This produces occasional
      corruption, such as when setting 22x11 font on the console, only the first
      line of the cursor will be blinking if the cursor is located at some
      specific columns.
      
      When we end up with a repeating pixel, the driver has a bug that it leaves
      one uninitialized byte after the command (and this byte is enough to flush
      the command and render it - thus it fixes the screen corruption), however
      whe we end up with a non-repeating pixel, there is no byte appended and
      this results in temporary screen corruption.
      
      This patch fixes the screen corruption by always appending a byte 0xAF at
      the end of URB. It also removes the uninitialized byte.
      Signed-off-by: NMikulas Patocka <mpatocka@redhat.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      99ec9e77
  11. 04 7月, 2018 3 次提交