1. 12 8月, 2019 19 次提交
    • S
      firmware: arm_scmi: Add RESET protocol in SCMI v2.0 · 95a15d80
      Sudeep Holla 提交于
      SCMIv2.0 adds a new Reset Management Protocol to manage various reset
      states a given device or domain can enter. Device(s) that can be
      collectively reset through a common reset signal constitute a reset
      domain for the firmware.
      
      A reset domain can be reset autonomously or explicitly through assertion
      and de-assertion of the signal. When autonomous reset is chosen, the
      firmware is responsible for taking the necessary steps to reset the
      domain and to subsequently bring it out of reset. When explicit reset is
      chosen, the caller has to specifically assert and then de-assert the
      reset signal by issuing two separate RESET commands.
      
      Add the basic SCMI reset infrastructure that can be used by Linux
      reset controller driver.
      Reviewed-by: NPeng Fan <peng.fan@nxp.com>
      Reviewed-by: NPhilipp Zabel <p.zabel@pengutronix.de>
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      95a15d80
    • S
      firmware: arm_scmi: Make use SCMI v2.0 fastchannel for performance protocol · 82383957
      Sudeep Holla 提交于
      SCMI v2.0 adds support for "FastChannel" which do not use a message
      header as they are specialized for a single message.
      
      Only PERFORMANCE_LIMITS_{SET,GET} and PERFORMANCE_LEVEL_{SET,GET}
      commands are supported over fastchannels. As they are optional, they
      need to be discovered by PERFORMANCE_DESCRIBE_FASTCHANNEL command.
      Further {LIMIT,LEVEL}_SET commands can have optional doorbell support.
      
      Add support for making use of these fastchannels.
      
      Cc: Ionela Voinescu <Ionela.Voinescu@arm.com>
      Cc: Chris Redpath <Chris.Redpath@arm.com>
      Cc: Quentin Perret <Quentin.Perret@arm.com>
      Reviewed-by: NPeng Fan <peng.fan@nxp.com>
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      82383957
    • S
      firmware: arm_scmi: Add discovery of SCMI v2.0 performance fastchannels · ac8aaf34
      Sudeep Holla 提交于
      SCMI v2.0 adds support for "FastChannel", a lightweight unidirectional
      channel that is dedicated to a single SCMI message type for controlling
      a specific platform resource. They do not use a message header as they
      are specialized for a single message.
      
      Only PERFORMANCE_LIMITS_{SET,GET} and PERFORMANCE_LEVEL_{SET,GET}
      commands are supported over fastchannels. As they are optional, they
      need to be discovered by PERFORMANCE_DESCRIBE_FASTCHANNEL command.
      Further {LIMIT,LEVEL}_SET commands can have optional doorbell support.
      
      Add support for discovery of these fastchannels.
      
      Cc: Ionela Voinescu <Ionela.Voinescu@arm.com>
      Cc: Chris Redpath <Chris.Redpath@arm.com>
      Cc: Quentin Perret <Quentin.Perret@arm.com>
      Reviewed-by: NPeng Fan <peng.fan@nxp.com>
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      ac8aaf34
    • S
      firmware: arm_scmi: Use {get,put}_unaligned_le{32,64} accessors · aa90ac45
      Sudeep Holla 提交于
      Instead of type-casting the {tx,rx}.buf all over the place while
      accessing them to read/write __le{32,64} from/to the firmware, let's
      use the existing {get,put}_unaligned_le{32,64} accessors to hide all
      the type cast ugliness.
      Suggested-by: NPhilipp Zabel <p.zabel@pengutronix.de>
      Reviewed-by: NPhilipp Zabel <p.zabel@pengutronix.de>
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      aa90ac45
    • S
      firmware: arm_scmi: Use asynchronous CLOCK_RATE_SET when possible · 2bc06ffa
      Sudeep Holla 提交于
      CLOCK_PROTOCOL_ATTRIBUTES provides attributes to indicate the maximum
      number of pending asynchronous clock rate changes supported by the
      platform. If it's non-zero, then we should be able to use asynchronous
      clock rate set for any clocks until the maximum limit is reached.
      
      Tracking the current count of pending asynchronous clock set rate
      requests, we can decide if the incoming/new request for clock set rate
      can be handled asynchronously or not until the maximum limit is
      reached.
      
      Cc: linux-clk@vger.kernel.org
      Reviewed-by: NStephen Boyd <sboyd@kernel.org>
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      2bc06ffa
    • S
      firmware: arm_scmi: Drop config flag in clk_ops->rate_set · d0aba116
      Sudeep Holla 提交于
      CLOCK_PROTOCOL_ATTRIBUTES provides attributes to indicate the maximum
      number of pending asynchronous clock rate changes supported by the
      platform. If it's non-zero, then we should be able to use asynchronous
      clock rate set for any clocks until the maximum limit is reached.
      
      In order to add that support, let's drop the config flag passed to
      clk_ops->rate_set and handle the asynchronous requests dynamically.
      
      Cc: Stephen Boyd <sboyd@kernel.org>
      Cc: linux-clk@vger.kernel.org
      Acked-by: NStephen Boyd <sboyd@kernel.org>
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      d0aba116
    • S
      firmware: arm_scmi: Add asynchronous sensor read if it supports · d09aac0e
      Sudeep Holla 提交于
      SENSOR_DESCRIPTION_GET provides attributes to indicate if the sensor
      supports asynchronous read. We can read that flag and use asynchronous
      reads for any sensors with that attribute set.
      
      Let's use the new scmi_do_xfer_with_response to support asynchronous
      sensor reads.
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      d09aac0e
    • S
      firmware: arm_scmi: Drop async flag in sensor_ops->reading_get · 6a55331c
      Sudeep Holla 提交于
      SENSOR_DESCRIPTION_GET provides attributes to indicate if the sensor
      supports asynchronous read. Ideally we should be able to read that flag
      and use asynchronous reads for any sensors with that attribute set.
      
      In order to add that support, let's drop the async flag passed to
      sensor_ops->reading_get and dynamically switch between sync and async
      flags based on the attributes as provided by the firmware.
      
      Cc: linux-hwmon@vger.kernel.org
      Acked-by: NGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      6a55331c
    • S
      firmware: arm_scmi: Add support for asynchronous commands and delayed response · 58ecdf03
      Sudeep Holla 提交于
      Messages that are sent to platform, also known as commands and can be:
      
      1. Synchronous commands that block the channel until the requested work
      has been completed. The platform responds to these commands over the
      same channel and hence can't be used to send another command until the
      previous command has completed.
      
      2. Asynchronous commands on the other hand, the platform schedules the
      requested work to complete later in time and returns almost immediately
      freeing the channel for new commands. The response indicates the success
      or failure in the ability to schedule the requested work. When the work
      has completed, the platform sends an additional delayed response message.
      
      Using the same transmit buffer used for sending the asynchronous command
      even for the delayed response corresponding to it simplifies handling of
      the delayed response. It's the caller of asynchronous command that is
      responsible for allocating the completion flag that scmi driver can
      complete to indicate the arrival of delayed response.
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      58ecdf03
    • S
      firmware: arm_scmi: Add mechanism to unpack message headers · 22d1f761
      Sudeep Holla 提交于
      In order to identify the message type when a response arrives, we need
      a mechanism to unpack the message header similar to packing. Let's
      add one.
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      22d1f761
    • S
      firmware: arm_scmi: Separate out tx buffer handling and prepare to add rx · 38c927fb
      Sudeep Holla 提交于
      Currently we pre-allocate transmit buffers only and use the first free
      slot in that pre-allocated buffer for transmitting any new message that
      are generally originated from OS to the platform firmware.
      
      Notifications or the delayed responses on the other hand are originated
      from the platform firmware and consumes by the OS. It's better to have
      separate and dedicated pre-allocated buffers to handle the notifications.
      We can still use the transmit buffers for the delayed responses.
      
      In addition, let's prepare existing scmi_xfer_{get,put} for acquiring
      and releasing a slot to identify the right(tx/rx) buffers.
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      38c927fb
    • S
      firmware: arm_scmi: Add receive channel support for notifications · 46cc7c28
      Sudeep Holla 提交于
      With scmi_mbox_chan_setup enabled to identify and setup both Tx and Rx,
      let's consolidate setting up of both the channels under the function
      scmi_mbox_txrx_setup.
      
      Since some platforms may opt not to support notifications or delayed
      response, they may not need support for Rx. Hence Rx is optional and
      failure of setting one up is not considered fatal.
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      46cc7c28
    • S
      firmware: arm_scmi: Segregate tx channel handling and prepare to add rx · 3748daf7
      Sudeep Holla 提交于
      The transmit(Tx) channels are specified as the first entry and the
      receive(Rx) channels are the second entry as per the device tree
      bindings. Since we currently just support Tx, index 0 is hardcoded at
      all required callsites.
      
      In order to prepare for adding Rx support, let's remove those hardcoded
      index and add boolean parameter to identify Tx/Rx channels when setting
      them up.
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      3748daf7
    • S
      firmware: arm_scmi: Reorder some functions to avoid forward declarations · 2747a967
      Sudeep Holla 提交于
      Re-shuffling few functions to keep definitions and their usages close.
      This is also needed to avoid too many unnecessary forward declarations
      while adding new features(delayed response and notifications).
      
      Keeping this separate to avoid mixing up of these trivial change that
      doesn't affect functionality into the ones that does.
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      2747a967
    • S
      firmware: arm_scmi: Check if platform has released shmem before using · 9dc34d63
      Sudeep Holla 提交于
      Sometimes platfom may take too long to respond to the command and OS
      might timeout before platform transfer the ownership of the shared
      memory region to the OS with the response.
      
      Since the mailbox channel associated with the channel is freed and new
      commands are dispatch on the same channel, OS needs to wait until it
      gets back the ownership. If not, either OS may end up overwriting the
      platform response for the last command(which is fine as OS timed out
      that command) or platform might overwrite the payload for the next
      command with the response for the old.
      
      The latter is problematic as platform may end up interpretting the
      response as the payload. In order to avoid such race, let's wait until
      the OS gets back the ownership before we prepare the shared memory with
      the payload for the next command.
      Reported-by: NJim Quinlan <james.quinlan@broadcom.com>
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      9dc34d63
    • S
      firmware: arm_scmi: Use the term 'message' instead of 'command' · 5b65af8f
      Sudeep Holla 提交于
      In preparation to adding support for other two types of messages that
      SCMI specification mentions, let's replace the term 'command' with the
      correct term 'message'.
      
      As per the specification the messages are of 3 types:
      commands(synchronous or asynchronous), delayed responses and notifications.
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      5b65af8f
    • S
      firmware: arm_scmi: Fix few trivial typos in comments · c29a6289
      Sudeep Holla 提交于
      While adding new comments found couple of typos that are better fixed.
      
      s/informfation/information/
      s/statues/status/
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      c29a6289
    • S
      firmware: arm_scmi: Remove extra check for invalid length message responses · 37bbffcb
      Sudeep Holla 提交于
      scmi_xfer_get_init ensures both transmit and receive buffer lengths are
      within the maximum limits. If receive buffer length is not supplied by
      the caller, it's set to the maximum limit value. Receive buffer length
      is never modified after that. So there's no need for the extra check
      when receive transmit completion for a command essage.
      
      Further, if the response header length is greater than the prescribed
      receive buffer length, the response buffer is truncated to the latter.
      Reported-by: NJim Quinlan <james.quinlan@broadcom.com>
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      37bbffcb
    • S
      firmware: arm_scmi: Align few names in sensors protocol with SCMI specification · 9eefa43a
      Sudeep Holla 提交于
      Looks like more code developed during the draft versions of the
      specification slipped through and they don't match the final
      released version. This seem to have happened only with sensor
      protocol.
      
      Renaming few command and function names here to match exactly with
      the released version of SCMI specification for ease of maintenance.
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      9eefa43a
  2. 22 7月, 2019 1 次提交
    • Q
      iommu/amd: fix a crash in iova_magazine_free_pfns · 8cf66504
      Qian Cai 提交于
      The commit b3aa14f0 ("iommu: remove the mapping_error dma_map_ops
      method") incorrectly changed the checking from dma_ops_alloc_iova() in
      map_sg() causes a crash under memory pressure as dma_ops_alloc_iova()
      never return DMA_MAPPING_ERROR on failure but 0, so the error handling
      is all wrong.
      
         kernel BUG at drivers/iommu/iova.c:801!
          Workqueue: kblockd blk_mq_run_work_fn
          RIP: 0010:iova_magazine_free_pfns+0x7d/0xc0
          Call Trace:
           free_cpu_cached_iovas+0xbd/0x150
           alloc_iova_fast+0x8c/0xba
           dma_ops_alloc_iova.isra.6+0x65/0xa0
           map_sg+0x8c/0x2a0
           scsi_dma_map+0xc6/0x160
           pqi_aio_submit_io+0x1f6/0x440 [smartpqi]
           pqi_scsi_queue_command+0x90c/0xdd0 [smartpqi]
           scsi_queue_rq+0x79c/0x1200
           blk_mq_dispatch_rq_list+0x4dc/0xb70
           blk_mq_sched_dispatch_requests+0x249/0x310
           __blk_mq_run_hw_queue+0x128/0x200
           blk_mq_run_work_fn+0x27/0x30
           process_one_work+0x522/0xa10
           worker_thread+0x63/0x5b0
           kthread+0x1d2/0x1f0
           ret_from_fork+0x22/0x40
      
      Fixes: b3aa14f0 ("iommu: remove the mapping_error dma_map_ops method")
      Signed-off-by: NQian Cai <cai@lca.pw>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8cf66504
  3. 19 7月, 2019 20 次提交
    • H
      Input: alps - fix a mismatch between a condition check and its comment · 771a081e
      Hui Wang 提交于
      In the function alps_is_cs19_trackpoint(), we check if the param[1] is
      in the 0x20~0x2f range, but the code we wrote for this checking is not
      correct:
      (param[1] & 0x20) does not mean param[1] is in the range of 0x20~0x2f,
      it also means the param[1] is in the range of 0x30~0x3f, 0x60~0x6f...
      
      Now fix it with a new condition checking ((param[1] & 0xf0) == 0x20).
      
      Fixes: 7e4935cc ("Input: alps - don't handle ALPS cs19 trackpoint-only device")
      Cc: stable@vger.kernel.org
      Signed-off-by: NHui Wang <hui.wang@canonical.com>
      Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
      771a081e
    • Y
      Input: psmouse - fix build error of multiple definition · 49e6979e
      YueHaibing 提交于
      trackpoint_detect() should be static inline while
      CONFIG_MOUSE_PS2_TRACKPOINT is not set, otherwise, we build fails:
      
      drivers/input/mouse/alps.o: In function `trackpoint_detect':
      alps.c:(.text+0x8e00): multiple definition of `trackpoint_detect'
      drivers/input/mouse/psmouse-base.o:psmouse-base.c:(.text+0x1b50): first defined here
      Reported-by: NHulk Robot <hulkci@huawei.com>
      Fixes: 55e3d922 ("Input: psmouse - allow disabing certain protocol extensions")
      Signed-off-by: NYueHaibing <yuehaibing@huawei.com>
      Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
      49e6979e
    • M
      Input: applespi - remove set but not used variables 'sts' · d56fef0e
      Mao Wenan 提交于
      Fixes gcc '-Wunused-but-set-variable' warning:
      
      drivers/input/keyboard/applespi.c: In function applespi_set_bl_level:
      drivers/input/keyboard/applespi.c:902:6: warning: variable sts set but not used [-Wunused-but-set-variable]
      
      Fixes: b426ac0452093d ("Input: add Apple SPI keyboard and trackpad driver")
      Signed-off-by: NMao Wenan <maowenan@huawei.com>
      Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
      d56fef0e
    • R
      Input: add Apple SPI keyboard and trackpad driver · 038b1a05
      Ronald Tschalär 提交于
      The keyboard and trackpad on recent MacBook's (since 8,1) and
      MacBookPro's (13,* and 14,*) are attached to an SPI controller instead
      of USB, as previously. The higher level protocol is not publicly
      documented and hence has been reverse engineered. As a consequence there
      are still a number of unknown fields and commands. However, the known
      parts have been working well and received extensive testing and use.
      
      In order for this driver to work, the proper SPI drivers need to be
      loaded too; for MB8,1 these are spi_pxa2xx_platform and spi_pxa2xx_pci;
      for all others they are spi_pxa2xx_platform and intel_lpss_pci.
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=99891
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=108331Signed-off-by: NRonald Tschalär <ronald@innovation.ch>
      Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
      038b1a05
    • B
      drm/nouveau/secboot/gp102-: remove WAR for SEC2 RTOS start bug · 4d352dbd
      Ben Skeggs 提交于
      Appears to be fixed by "flcn/gp102-: improve implementation of
      bind_context() on SEC2/GSP".
      
      Tested on GP10[24678] and GV100.
      Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
      4d352dbd
    • B
      drm/nouveau/flcn/gp102-: improve implementation of bind_context() on SEC2/GSP · 5210e967
      Ben Skeggs 提交于
      Fixes various issues encountered while attempting to initialise ACR.
      Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
      5210e967
    • Y
      drm/nouveau: fix memory leak in nouveau_conn_reset() · 09b90e2f
      Yongxin Liu 提交于
      In nouveau_conn_reset(), if connector->state is true,
      __drm_atomic_helper_connector_destroy_state() will be called,
      but the memory pointed by asyc isn't freed. Memory leak happens
      in the following function __drm_atomic_helper_connector_reset(),
      where newly allocated asyc->state will be assigned to connector->state.
      
      So using nouveau_conn_atomic_destroy_state() instead of
      __drm_atomic_helper_connector_destroy_state to free the "old" asyc.
      
      Here the is the log showing memory leak.
      
      unreferenced object 0xffff8c5480483c80 (size 192):
        comm "kworker/0:2", pid 188, jiffies 4294695279 (age 53.179s)
        hex dump (first 32 bytes):
          00 f0 ba 7b 54 8c ff ff 00 00 00 00 00 00 00 00  ...{T...........
          00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        backtrace:
          [<000000005005c0d0>] kmem_cache_alloc_trace+0x195/0x2c0
          [<00000000a122baed>] nouveau_conn_reset+0x25/0xc0 [nouveau]
          [<000000004fd189a2>] nouveau_connector_create+0x3a7/0x610 [nouveau]
          [<00000000c73343a8>] nv50_display_create+0x343/0x980 [nouveau]
          [<000000002e2b03c3>] nouveau_display_create+0x51f/0x660 [nouveau]
          [<00000000c924699b>] nouveau_drm_device_init+0x182/0x7f0 [nouveau]
          [<00000000cc029436>] nouveau_drm_probe+0x20c/0x2c0 [nouveau]
          [<000000007e961c3e>] local_pci_probe+0x47/0xa0
          [<00000000da14d569>] work_for_cpu_fn+0x1a/0x30
          [<0000000028da4805>] process_one_work+0x27c/0x660
          [<000000001d415b04>] worker_thread+0x22b/0x3f0
          [<0000000003b69f1f>] kthread+0x12f/0x150
          [<00000000c94c29b7>] ret_from_fork+0x3a/0x50
      Signed-off-by: NYongxin Liu <yongxin.liu@windriver.com>
      Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
      09b90e2f
    • R
      drm/nouveau/dmem: missing mutex_lock in error path · d304654b
      Ralph Campbell 提交于
      In nouveau_dmem_pages_alloc(), the drm->dmem->mutex is unlocked before
      calling nouveau_dmem_chunk_alloc() as shown when CONFIG_PROVE_LOCKING
      is enabled:
      
      [ 1294.871933] =====================================
      [ 1294.876656] WARNING: bad unlock balance detected!
      [ 1294.881375] 5.2.0-rc3+ #5 Not tainted
      [ 1294.885048] -------------------------------------
      [ 1294.889773] test-malloc-vra/6299 is trying to release lock (&drm->dmem->mutex) at:
      [ 1294.897482] [<ffffffffa01a220f>] nouveau_dmem_migrate_alloc_and_copy+0x79f/0xbf0 [nouveau]
      [ 1294.905782] but there are no more locks to release!
      [ 1294.910690]
      [ 1294.910690] other info that might help us debug this:
      [ 1294.917249] 1 lock held by test-malloc-vra/6299:
      [ 1294.921881]  #0: 0000000016e10454 (&mm->mmap_sem#2){++++}, at: nouveau_svmm_bind+0x142/0x210 [nouveau]
      [ 1294.931313]
      [ 1294.931313] stack backtrace:
      [ 1294.935702] CPU: 4 PID: 6299 Comm: test-malloc-vra Not tainted 5.2.0-rc3+ #5
      [ 1294.942786] Hardware name: ASUS X299-A/PRIME X299-A, BIOS 1401 05/21/2018
      [ 1294.949590] Call Trace:
      [ 1294.952059]  dump_stack+0x7c/0xc0
      [ 1294.955469]  ? nouveau_dmem_migrate_alloc_and_copy+0x79f/0xbf0 [nouveau]
      [ 1294.962213]  print_unlock_imbalance_bug.cold.52+0xca/0xcf
      [ 1294.967641]  lock_release+0x306/0x380
      [ 1294.971383]  ? nouveau_dmem_migrate_alloc_and_copy+0x79f/0xbf0 [nouveau]
      [ 1294.978089]  ? lock_downgrade+0x2d0/0x2d0
      [ 1294.982121]  ? find_held_lock+0xac/0xd0
      [ 1294.985979]  __mutex_unlock_slowpath+0x8f/0x3f0
      [ 1294.990540]  ? wait_for_completion+0x230/0x230
      [ 1294.995002]  ? rwlock_bug.part.2+0x60/0x60
      [ 1294.999197]  nouveau_dmem_migrate_alloc_and_copy+0x79f/0xbf0 [nouveau]
      [ 1295.005751]  ? page_mapping+0x98/0x110
      [ 1295.009511]  migrate_vma+0xa74/0x1090
      [ 1295.013186]  ? move_to_new_page+0x480/0x480
      [ 1295.017400]  ? __kmalloc+0x153/0x300
      [ 1295.021052]  ? nouveau_dmem_migrate_vma+0xd8/0x1e0 [nouveau]
      [ 1295.026796]  nouveau_dmem_migrate_vma+0x157/0x1e0 [nouveau]
      [ 1295.032466]  ? nouveau_dmem_init+0x490/0x490 [nouveau]
      [ 1295.037612]  ? vmacache_find+0xc2/0x110
      [ 1295.041537]  nouveau_svmm_bind+0x1b4/0x210 [nouveau]
      [ 1295.046583]  ? nouveau_svm_fault+0x13e0/0x13e0 [nouveau]
      [ 1295.051912]  drm_ioctl_kernel+0x14d/0x1a0
      [ 1295.055930]  ? drm_setversion+0x330/0x330
      [ 1295.059971]  drm_ioctl+0x308/0x530
      [ 1295.063384]  ? drm_version+0x150/0x150
      [ 1295.067153]  ? find_held_lock+0xac/0xd0
      [ 1295.070996]  ? __pm_runtime_resume+0x3f/0xa0
      [ 1295.075285]  ? mark_held_locks+0x29/0xa0
      [ 1295.079230]  ? _raw_spin_unlock_irqrestore+0x3c/0x50
      [ 1295.084232]  ? lockdep_hardirqs_on+0x17d/0x250
      [ 1295.088768]  nouveau_drm_ioctl+0x9a/0x100 [nouveau]
      [ 1295.093661]  do_vfs_ioctl+0x137/0x9a0
      [ 1295.097341]  ? ioctl_preallocate+0x140/0x140
      [ 1295.101623]  ? match_held_lock+0x1b/0x230
      [ 1295.105646]  ? match_held_lock+0x1b/0x230
      [ 1295.109660]  ? find_held_lock+0xac/0xd0
      [ 1295.113512]  ? __do_page_fault+0x324/0x630
      [ 1295.117617]  ? lock_downgrade+0x2d0/0x2d0
      [ 1295.121648]  ? mark_held_locks+0x79/0xa0
      [ 1295.125583]  ? handle_mm_fault+0x352/0x430
      [ 1295.129687]  ksys_ioctl+0x60/0x90
      [ 1295.133020]  ? mark_held_locks+0x29/0xa0
      [ 1295.136964]  __x64_sys_ioctl+0x3d/0x50
      [ 1295.140726]  do_syscall_64+0x68/0x250
      [ 1295.144400]  entry_SYSCALL_64_after_hwframe+0x49/0xbe
      [ 1295.149465] RIP: 0033:0x7f1a3495809b
      [ 1295.153053] Code: 0f 1e fa 48 8b 05 ed bd 0c 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 0f 1f 44 00 00 f3 0f 1e fa b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d bd bd 0c 00 f7 d8 64 89 01 48
      [ 1295.171850] RSP: 002b:00007ffef7ed1358 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
      [ 1295.179451] RAX: ffffffffffffffda RBX: 00007ffef7ed1628 RCX: 00007f1a3495809b
      [ 1295.186601] RDX: 00007ffef7ed13b0 RSI: 0000000040406449 RDI: 0000000000000004
      [ 1295.193759] RBP: 00007ffef7ed13b0 R08: 0000000000000000 R09: 000000000157e770
      [ 1295.200917] R10: 000000000151c010 R11: 0000000000000246 R12: 0000000040406449
      [ 1295.208083] R13: 0000000000000004 R14: 0000000000000000 R15: 0000000000000000
      
      Reacquire the lock before continuing to the next page.
      Signed-off-by: NRalph Campbell <rcampbell@nvidia.com>
      Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
      d304654b
    • K
      drm/nouveau/hwmon: return EINVAL if the GPU is powered down for sensors reads · 68bf8b57
      Karol Herbst 提交于
      fixes bogus values userspace gets from hwmon while the GPU is powered down
      Signed-off-by: NKarol Herbst <kherbst@redhat.com>
      Reviewed-by: NRhys Kidd <rhyskidd@gmail.com>
      Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
      68bf8b57
    • B
      drm/nouveau: fix bogus GPL-2 license header · b0f84a84
      Ben Skeggs 提交于
      The bulk SPDX addition made all these files into GPL-2.0 licensed files.
      However the remainder of the project is MIT-licensed, these files
      were simply missing the boiler plate and got caught up in the global update.
      
      Fixes: 96ac6d43 (treewide: Add SPDX license identifier - Kbuild)
      Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
      b0f84a84
    • I
      drm/nouveau: fix bogus GPL-2 license header · b7019ac5
      Ilia Mirkin 提交于
      The bulk SPDX addition made all these files into GPL-2.0 licensed files.
      However the remainder of the project is MIT-licensed, these files
      (primarily header files) were simply missing the boiler plate and got
      caught up in the global update.
      
      Fixes: b2441318 (License cleanup: add SPDX GPL-2.0 license identifier to files with no license)
      Signed-off-by: NIlia Mirkin <imirkin@alum.mit.edu>
      Acked-by: NEmil Velikov <emil.l.velikov@gmail.com>
      Acked-by: NKarol Herbst <kherbst@redhat.com>
      Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
      b7019ac5
    • L
      drm/nouveau/i2c: Enable i2c pads & busses during preinit · 7cb95eee
      Lyude Paul 提交于
      It turns out that while disabling i2c bus access from software when the
      GPU is suspended was a step in the right direction with:
      
      commit 342406e4 ("drm/nouveau/i2c: Disable i2c bus access after
      ->fini()")
      
      We also ended up accidentally breaking the vbios init scripts on some
      older Tesla GPUs, as apparently said scripts can actually use the i2c
      bus. Since these scripts are executed before initializing any
      subdevices, we end up failing to acquire access to the i2c bus which has
      left a number of cards with their fan controllers uninitialized. Luckily
      this doesn't break hardware - it just means the fan gets stuck at 100%.
      
      This also means that we've always been using our i2c busses before
      initializing them during the init scripts for older GPUs, we just didn't
      notice it until we started preventing them from being used until init.
      It's pretty impressive this never caused us any issues before!
      
      So, fix this by initializing our i2c pad and busses during subdev
      pre-init. We skip initializing aux busses during pre-init, as those are
      guaranteed to only ever be used by nouveau for DP aux transactions.
      Signed-off-by: NLyude Paul <lyude@redhat.com>
      Tested-by: NMarc Meledandri <m.meledandri@gmail.com>
      Fixes: 342406e4 ("drm/nouveau/i2c: Disable i2c bus access after ->fini()")
      Cc: stable@vger.kernel.org
      Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
      7cb95eee
    • B
      drm/nouveau/disp/tu102-: wire up scdc parameter setter · 3485b7b5
      Ben Skeggs 提交于
      Regs seem valid here still, and tested on TU116.
      Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
      3485b7b5
    • B
      drm/nouveau/core: recognise TU116 chipset · 75dec321
      Ben Skeggs 提交于
      Modesetting only, still waiting on ACR/GR firmware from NVIDIA for Turing
      graphics/compute bring-up.
      
      Each subsystem was compared with traces, along with various tests to check
      that things generally work as they should, and appears compatible enough
      with the current TU117 code to enable support.
      Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
      75dec321
    • B
      drm/nouveau/kms: disallow dual-link harder if hdmi connection detected · d1084184
      Ben Skeggs 提交于
      The fallthrough cases (pre-Fermi) would accidentally allow dual-link pixel
      clocks even where they shouldn't be.  This leads to a high resolution HDMI
      displays, connected via a DVI->HDMI adapter, to fail on the original NV50.
      Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
      d1084184
    • I
      drm/nouveau/disp/nv50-: fix center/aspect-corrected scaling · 533f4752
      Ilia Mirkin 提交于
      Previously center scaling would get scaling applied to it (when it was
      only supposed to center the image), and aspect-corrected scaling did not
      always correctly pick whether to reduce width or height for a particular
      combination of inputs/outputs.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110660Signed-off-by: NIlia Mirkin <imirkin@alum.mit.edu>
      Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
      533f4752
    • I
      drm/nouveau/disp/nv50-: force scaler for any non-default LVDS/eDP modes · f8d6211a
      Ilia Mirkin 提交于
      Higher layers tend to add a lot of modes not actually in the EDID, such
      as the standard DMT modes. Changing this would be extremely intrusive to
      everyone, so just force the scaler more often. There are no practical
      cases we're aware of where a LVDS/eDP panel has multiple resolutions
      exposed, and i915 already does it this way.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110660Signed-off-by: NIlia Mirkin <imirkin@alum.mit.edu>
      Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
      f8d6211a
    • T
      drm/nouveau/mcp89/mmu: Use mcp77_mmu_new instead of g84_mmu_new on MCP89. · bb2b4074
      Timo Wiren 提交于
      Fix a crash or broken depth testing in all OpenGL applications that use the
      depth buffer on MCP89 (GeForce 320M) seen on a MacBook Pro Late 2010.
      
      The bug is tracked in https://bugs.freedesktop.org/show_bug.cgi?id=108500Signed-off-by: NTimo Wiren <timo.wiren@gmail.com>
      Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
      bb2b4074
    • W
      ag71xx: fix return value check in ag71xx_probe() · 269b7c5f
      Wei Yongjun 提交于
      In case of error, the function of_get_mac_address() returns ERR_PTR()
      and never returns NULL. The NULL test in the return value check should
      be replaced with IS_ERR().
      
      Fixes: d51b6ce4 ("net: ethernet: add ag71xx driver")
      Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com>
      Reviewed-by: NOleksij Rempel <o.rempel@pengutronix.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      269b7c5f
    • W
      ag71xx: fix error return code in ag71xx_probe() · 6f5fa8d2
      Wei Yongjun 提交于
      Fix to return error code -ENOMEM from the dmam_alloc_coherent() error
      handling case instead of 0, as done elsewhere in this function.
      
      Fixes: d51b6ce4 ("net: ethernet: add ag71xx driver")
      Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com>
      Reviewed-by: NOleksij Rempel <o.rempel@pengutronix.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6f5fa8d2