1. 01 6月, 2018 1 次提交
  2. 31 5月, 2018 1 次提交
    • N
      drm/bridge/synopsys: dw-hdmi: fix dw_hdmi_setup_rx_sense · c32048d9
      Neil Armstrong 提交于
      The dw_hdmi_setup_rx_sense exported function should not use struct device
      to recover the dw-hdmi context using drvdata, but take struct dw_hdmi
      directly like other exported functions.
      
      This caused a regression using Meson DRM on S905X since v4.17-rc1 :
      
      Internal error: Oops: 96000007 [#1] PREEMPT SMP
      [...]
      CPU: 0 PID: 124 Comm: irq/32-dw_hdmi_ Not tainted 4.17.0-rc7 #2
      Hardware name: Libre Technology CC (DT)
      [...]
      pc : osq_lock+0x54/0x188
      lr : __mutex_lock.isra.0+0x74/0x530
      [...]
      Process irq/32-dw_hdmi_ (pid: 124, stack limit = 0x00000000adf418cb)
      Call trace:
        osq_lock+0x54/0x188
        __mutex_lock_slowpath+0x10/0x18
        mutex_lock+0x30/0x38
        __dw_hdmi_setup_rx_sense+0x28/0x98
        dw_hdmi_setup_rx_sense+0x10/0x18
        dw_hdmi_top_thread_irq+0x2c/0x50
        irq_thread_fn+0x28/0x68
        irq_thread+0x10c/0x1a0
        kthread+0x128/0x130
        ret_from_fork+0x10/0x18
       Code: 34000964 d00050a2 51000484 9135c042 (f864d844)
       ---[ end trace 945641e1fbbc07da ]---
       note: irq/32-dw_hdmi_[124] exited with preempt_count 1
       genirq: exiting task "irq/32-dw_hdmi_" (124) is an active IRQ thread (irq 32)
      
      Fixes: eea034af ("drm/bridge/synopsys: dw-hdmi: don't clobber drvdata")
      Signed-off-by: NNeil Armstrong <narmstrong@baylibre.com>
      Tested-by: NKoen Kooi <koen@dominion.thruhere.net>
      Signed-off-by: NSean Paul <seanpaul@chromium.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/1527673438-20643-1-git-send-email-narmstrong@baylibre.com
      c32048d9
  3. 30 5月, 2018 1 次提交
  4. 29 5月, 2018 1 次提交
  5. 28 5月, 2018 3 次提交
  6. 26 5月, 2018 2 次提交
    • J
      mm/memory_hotplug: fix leftover use of struct page during hotplug · a2155861
      Jonathan Cameron 提交于
      The case of a new numa node got missed in avoiding using the node info
      from page_struct during hotplug.  In this path we have a call to
      register_mem_sect_under_node (which allows us to specify it is hotplug
      so don't change the node), via link_mem_sections which unfortunately
      does not.
      
      Fix is to pass check_nid through link_mem_sections as well and disable
      it in the new numa node path.
      
      Note the bug only 'sometimes' manifests depending on what happens to be
      in the struct page structures - there are lots of them and it only needs
      to match one of them.
      
      The result of the bug is that (with a new memory only node) we never
      successfully call register_mem_sect_under_node so don't get the memory
      associated with the node in sysfs and meminfo for the node doesn't
      report it.
      
      It came up whilst testing some arm64 hotplug patches, but appears to be
      universal.  Whilst I'm triggering it by removing then reinserting memory
      to a node with no other elements (thus making the node disappear then
      appear again), it appears it would happen on hotplugging memory where
      there was none before and it doesn't seem to be related the arm64
      patches.
      
      These patches call __add_pages (where most of the issue was fixed by
      Pavel's patch).  If there is a node at the time of the __add_pages call
      then all is well as it calls register_mem_sect_under_node from there
      with check_nid set to false.  Without a node that function returns
      having not done the sysfs related stuff as there is no node to use.
      This is expected but it is the resulting path that fails...
      
      Exact path to the problem is as follows:
      
       mm/memory_hotplug.c: add_memory_resource()
      
         The node is not online so we enter the 'if (new_node)' twice, on the
         second such block there is a call to link_mem_sections which calls
         into
      
        drivers/node.c: link_mem_sections() which calls
      
        drivers/node.c: register_mem_sect_under_node() which calls
           get_nid_for_pfn and keeps trying until the output of that matches
           the expected node (passed all the way down from
           add_memory_resource)
      
      It is effectively the same fix as the one referred to in the fixes tag
      just in the code path for a new node where the comments point out we
      have to rerun the link creation because it will have failed in
      register_new_memory (as there was no node at the time).  (actually that
      comment is wrong now as we don't have register_new_memory any more it
      got renamed to hotplug_memory_register in Pavel's patch).
      
      Link: http://lkml.kernel.org/r/20180504085311.1240-1-Jonathan.Cameron@huawei.com
      Fixes: fc44f7f9 ("mm/memory_hotplug: don't read nid from struct page during hotplug")
      Signed-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
      Reviewed-by: NPavel Tatashin <pasha.tatashin@oracle.com>
      Acked-by: NMichal Hocko <mhocko@suse.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a2155861
    • T
      ibmvnic: Fix partial success login retries · eb110410
      Thomas Falcon 提交于
      In its current state, the driver will handle backing device
      login in a loop for a certain number of retries while the
      device returns a partial success, indicating that the driver
      may need to try again using a smaller number of resources.
      
      The variable it checks to continue retrying may change
      over the course of operations, resulting in reallocation
      of resources but exits without sending the login attempt.
      Guard against this by introducing a boolean variable that
      will retain the state indicating that the driver needs to
      reattempt login with backing device firmware.
      Signed-off-by: NThomas Falcon <tlfalcon@linux.vnet.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      eb110410
  7. 25 5月, 2018 8 次提交
  8. 24 5月, 2018 15 次提交
  9. 23 5月, 2018 8 次提交
    • T
      drm/vmwgfx: Schedule an fb dirty update after resume · 6a93cea1
      Thomas Hellstrom 提交于
      We have had problems displaying fbdev after a resume and as a
      workaround we have had to call vmw_fb_refresh(). This has had
      a number of unwanted side-effects. The root of the problem was,
      however that the coalesced fbdev dirty region was not empty on
      the first dirty_mark() after a resume, so a flush was never
      scheduled.
      
      Fix this by force scheduling an fbdev flush after resume, and
      remove the workaround.
      Signed-off-by: NThomas Hellstrom <thellstrom@vmware.com>
      Reviewed-by: NBrian Paul <brianp@vmware.com>
      Reviewed-by: NDeepak Rawat <drawat@vmware.com>
      6a93cea1
    • T
      drm/vmwgfx: Fix host logging / guestinfo reading error paths · f37230c0
      Thomas Hellstrom 提交于
      The error paths were leaking opened channels.
      Fix by using dedicated error paths.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NThomas Hellstrom <thellstrom@vmware.com>
      Reviewed-by: NBrian Paul <brianp@vmware.com>
      Reviewed-by: NSinclair Yeh <syeh@vmware.com>
      f37230c0
    • T
      drm/vmwgfx: Fix 32-bit VMW_PORT_HB_[IN|OUT] macros · 938ae725
      Thomas Hellstrom 提交于
      Depending on whether the kernel is compiled with frame-pointer or not,
      the temporary memory location used for the bp parameter in these macros
      is referenced relative to the stack pointer or the frame pointer.
      Hence we can never reference that parameter when we've modified either
      the stack pointer or the frame pointer, because then the compiler would
      generate an incorrect stack reference.
      
      Fix this by pushing the temporary memory parameter on a known location on
      the stack before modifying the stack- and frame pointers.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NThomas Hellstrom <thellstrom@vmware.com>
      Reviewed-by: NBrian Paul <brianp@vmware.com>
      Reviewed-by: NSinclair Yeh <syeh@vmware.com>
      938ae725
    • B
      mfd: cros_ec: Retry commands when EC is known to be busy · 11799564
      Brian Norris 提交于
      Commit 001dde94 ("mfd: cros ec: spi: Fix "in progress" error
      signaling") pointed out some bad code, but its analysis and conclusion
      was not 100% correct.
      
      It *is* correct that we should not propagate result==EC_RES_IN_PROGRESS
      for transport errors, because this has a special meaning -- that we
      should follow up with EC_CMD_GET_COMMS_STATUS until the EC is no longer
      busy. This is definitely the wrong thing for many commands, because
      among other problems, EC_CMD_GET_COMMS_STATUS doesn't actually retrieve
      any RX data from the EC, so commands that expected some data back will
      instead start processing junk.
      
      For such commands, the right answer is to either propagate the error
      (and return that error to the caller) or resend the original command
      (*not* EC_CMD_GET_COMMS_STATUS).
      
      Unfortunately, commit 001dde94 forgets a crucial point: that for
      some long-running operations, the EC physically cannot respond to
      commands any more. For example, with EC_CMD_FLASH_ERASE, the EC may be
      re-flashing its own code regions, so it can't respond to SPI interrupts.
      Instead, the EC prepares us ahead of time for being busy for a "long"
      time, and fills its hardware buffer with EC_SPI_PAST_END. Thus, we
      expect to see several "transport" errors (or, messages filled with
      EC_SPI_PAST_END). So we should really translate that to a retryable
      error (-EAGAIN) and continue sending EC_CMD_GET_COMMS_STATUS until we
      get a ready status.
      
      IOW, it is actually important to treat some of these "junk" values as
      retryable errors.
      
      Together with commit 001dde94, this resolves bugs like the
      following:
      
      1. EC_CMD_FLASH_ERASE now works again (with commit 001dde94, we
         would abort the first time we saw EC_SPI_PAST_END)
      2. Before commit 001dde94, transport errors (e.g.,
         EC_SPI_RX_BAD_DATA) seen in other commands (e.g.,
         EC_CMD_RTC_GET_VALUE) used to yield junk data in the RX buffer; they
         will now yield -EAGAIN return values, and tools like 'hwclock' will
         simply fail instead of retrieving and re-programming undefined time
         values
      
      Fixes: 001dde94 ("mfd: cros ec: spi: Fix "in progress" error signaling")
      Signed-off-by: NBrian Norris <briannorris@chromium.org>
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      11799564
    • B
      pcnet32: add an error handling path in pcnet32_probe_pci() · d7db3186
      Bo Chen 提交于
      Make sure to invoke pci_disable_device() when errors occur in
      pcnet32_probe_pci().
      Signed-off-by: NBo Chen <chenbo@pdx.edu>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d7db3186
    • S
      qed: Fix mask for physical address in ILT entry · fdd13dd3
      Shahed Shaikh 提交于
      ILT entry requires 12 bit right shifted physical address.
      Existing mask for ILT entry of physical address i.e.
      ILT_ENTRY_PHY_ADDR_MASK is not sufficient to handle 64bit
      address because upper 8 bits of 64 bit address were getting
      masked which resulted in completer abort error on
      PCIe bus due to invalid address.
      
      Fix that mask to handle 64bit physical address.
      
      Fixes: fe56b9e6 ("qed: Add module with basic common support")
      Signed-off-by: NShahed Shaikh <shahed.shaikh@cavium.com>
      Signed-off-by: NAriel Elior <ariel.elior@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fdd13dd3
    • W
      isdn: eicon: fix a missing-check bug · 6009d1fe
      Wenwen Wang 提交于
      In divasmain.c, the function divas_write() firstly invokes the function
      diva_xdi_open_adapter() to open the adapter that matches with the adapter
      number provided by the user, and then invokes the function diva_xdi_write()
      to perform the write operation using the matched adapter. The two functions
      diva_xdi_open_adapter() and diva_xdi_write() are located in diva.c.
      
      In diva_xdi_open_adapter(), the user command is copied to the object 'msg'
      from the userspace pointer 'src' through the function pointer 'cp_fn',
      which eventually calls copy_from_user() to do the copy. Then, the adapter
      number 'msg.adapter' is used to find out a matched adapter from the
      'adapter_queue'. A matched adapter will be returned if it is found.
      Otherwise, NULL is returned to indicate the failure of the verification on
      the adapter number.
      
      As mentioned above, if a matched adapter is returned, the function
      diva_xdi_write() is invoked to perform the write operation. In this
      function, the user command is copied once again from the userspace pointer
      'src', which is the same as the 'src' pointer in diva_xdi_open_adapter() as
      both of them are from the 'buf' pointer in divas_write(). Similarly, the
      copy is achieved through the function pointer 'cp_fn', which finally calls
      copy_from_user(). After the successful copy, the corresponding command
      processing handler of the matched adapter is invoked to perform the write
      operation.
      
      It is obvious that there are two copies here from userspace, one is in
      diva_xdi_open_adapter(), and one is in diva_xdi_write(). Plus, both of
      these two copies share the same source userspace pointer, i.e., the 'buf'
      pointer in divas_write(). Given that a malicious userspace process can race
      to change the content pointed by the 'buf' pointer, this can pose potential
      security issues. For example, in the first copy, the user provides a valid
      adapter number to pass the verification process and a valid adapter can be
      found. Then the user can modify the adapter number to an invalid number.
      This way, the user can bypass the verification process of the adapter
      number and inject inconsistent data.
      
      This patch reuses the data copied in
      diva_xdi_open_adapter() and passes it to diva_xdi_write(). This way, the
      above issues can be avoided.
      Signed-off-by: NWenwen Wang <wang6495@umn.edu>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6009d1fe
    • F
      net: fec: Add a SPDX identifier · 1f508124
      Fabio Estevam 提交于
      Currently there is no license information in the header of
      this file.
      
      The MODULE_LICENSE field contains ("GPL"), which means
      GNU Public License v2 or later, so add a corresponding
      SPDX license identifier.
      Signed-off-by: NFabio Estevam <fabio.estevam@nxp.com>
      Acked-by: NFugang Duan <fugang.duan@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1f508124