1. 05 11月, 2016 1 次提交
  2. 03 11月, 2016 1 次提交
  3. 02 11月, 2016 1 次提交
    • J
      gpio/mvebu: Use irq_domain_add_linear · 812d4788
      Jason Gunthorpe 提交于
      This fixes the irq allocation in this driver to not print:
       irq: Cannot allocate irq_descs @ IRQ34, assuming pre-allocated
       irq: Cannot allocate irq_descs @ IRQ66, assuming pre-allocated
      
      Which happens because the driver already called irq_alloc_descs()
      and so the change to use irq_domain_add_simple resulted in calling
      irq_alloc_descs() twice.
      
      Modernize the irq allocation in this driver to use the
      irq_domain_add_linear flow directly and eliminate the use of
      irq_domain_add_simple/legacy
      
      Fixes: ce931f57 ("gpio/mvebu: convert to use irq_domain_add_simple()")
      Signed-off-by: NJason Gunthorpe <jgunthorpe@obsidianresearch.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      812d4788
  4. 01 11月, 2016 3 次提交
    • P
      drm/nouveau/acpi: fix check for power resources support · b0a6af8b
      Peter Wu 提交于
      Check whether the kernel really supports power resources for a device,
      otherwise the power might not be removed when the device is runtime
      suspended (DSM should still work in these cases where PR does not).
      
      This is a workaround for a problem where ACPICA and Windows 10 differ in
      behavior. ACPICA does not correctly enumerate power resources within a
      conditional block (due to delayed execution of such blocks) and as a
      result power_resources is set to false even if _PR3 exists.
      
      Fixes: 692a17dc ("drm/nouveau/acpi: fix lockup with PCIe runtime PM")
      Link: https://bugs.freedesktop.org/show_bug.cgi?id=98398Reported-and-tested-by: NRick Kerkhof <rick.2889@gmail.com>
      Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Cc: stable@vger.kernel.org # v4.8+
      Signed-off-by: NPeter Wu <peter@lekensteyn.nl>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      b0a6af8b
    • M
      gpio: of: fix GPIO drivers with multiple gpio_chip for a single node · c7e9d398
      Masahiro Yamada 提交于
      Sylvain Lemieux reports the LPC32xx GPIO driver is broken since
      commit 762c2e46 ("gpio: of: remove of_gpiochip_and_xlate() and
      struct gg_data").  Probably, gpio-etraxfs.c and gpio-davinci.c are
      broken too.
      
      Those drivers register multiple gpio_chip that are associated to a
      single OF node, and their own .of_xlate() checks if the passed
      gpio_chip is valid.
      
      Now, the problem is of_find_gpiochip_by_node() returns the first
      gpio_chip found to match the given node.  So, .of_xlate() fails,
      except for the first GPIO bank.
      
      Reverting the commit could be a solution, but I do not want to go
      back to the mess of struct gg_data.  Another solution here is to
      take the match by a node pointer and the success of .of_xlate().
      It is a bit clumsy to call .of_xlate twice; for gpio_chip matching
      and for really getting the gpio_desc index.  Perhaps, our long-term
      goal might be to convert the drivers to single chip registration,
      but this commit will solve the problem until then.
      
      Fixes: 762c2e46 ("gpio: of: remove of_gpiochip_and_xlate() and struct gg_data")
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Reported-by: NSylvain Lemieux <slemieux.tyco@gmail.com>
      Tested-by: NDavid Lechner <david@lechnology.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      c7e9d398
    • L
      gpio: GPIO_GET_LINE{HANDLE,EVENT}_IOCTL: Fix file descriptor leak · 953b956a
      Lars-Peter Clausen 提交于
      When allocating a new line handle or event a file is allocated that it is
      associated to. The file is attached to a file descriptor of the current
      process and the file descriptor is returned to userspace using
      copy_to_user(). If this copy operation fails the line handle or event
      allocation is aborted, all acquired resources are freed and an error is
      returned.
      
      But the file struct is not freed and left attached to the userspace
      application and even though the file descriptor number was not copied it is
      trivial to guess. If a userspace application performs a IOCTL on such a
      left over file descriptor it will trigger a use-after-free and if the file
      descriptor is closed (latest when the application exits) a double-free is
      triggered.
      
      anon_inode_getfd() performs 3 tasks, allocate a file struct, allocate a
      file descriptor for the current process and install the file struct in the
      file descriptor. As soon as the file struct is installed in the file
      descriptor it is accessible by userspace (even if the IOCTL itself hasn't
      completed yet), this means uninstalling the fd on the error path is not an
      option, since userspace might already got a reference to the file.
      
      Instead anon_inode_getfd() needs to be broken into its individual steps.
      The allocation of the file struct and file descriptor is done first, then
      the copy_to_user() is executed and only if it succeeds the file is
      installed.
      
      Since the file struct is reference counted it can not be just freed, but
      its reference needs to be dropped, which will also call the release()
      callback, which will free the state attached to the file. So in this case
      the normal error cleanup path should not be taken.
      
      Cc: stable@vger.kernel.org
      Fixes: d932cd49 ("gpio: free handles in fringe cases")
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      953b956a
  5. 31 10月, 2016 9 次提交
  6. 30 10月, 2016 25 次提交