1. 23 11月, 2018 2 次提交
  2. 21 11月, 2018 6 次提交
  3. 14 11月, 2018 15 次提交
    • H
      media: hdmi.h: rename ADOBE_RGB to OPRGB and ADOBE_YCC to OPYCC · 3f7987f8
      Hans Verkuil 提交于
      commit 463659a08d7999d5461fa45b35b17686189a70ca upstream.
      
      These names have been renamed in the CTA-861 standard due to trademark
      issues. Replace them here as well so they are in sync with the standard.
      Signed-off-by: NHans Verkuil <hansverk@cisco.com>
      Cc: stable@vger.kernel.org
      Acked-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3f7987f8
    • H
      media: replace ADOBERGB by OPRGB · b1452c51
      Hans Verkuil 提交于
      commit db0340182444612bcadb98bdec22f651aa42266c upstream.
      
      The CTA-861 standards have been updated to refer to opRGB instead
      of AdobeRGB. The official standard is in fact named opRGB, so
      switch to that.
      
      The two old defines referring to ADOBERGB in the public API are
      put under #ifndef __KERNEL__ and a comment mentions that they are
      deprecated.
      Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
      Cc: stable@vger.kernel.org
      Acked-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b1452c51
    • H
      media: cec: fix the Signal Free Time calculation · b68d405a
      Hans Verkuil 提交于
      commit 7d867a1b upstream.
      
      The calculation of the Signal Free Time in the framework was not
      correct. If a message was received, then the next transmit should be
      considered a New Initiator and use a shorter SFT value.
      
      This was not done with the result that if both sides where continually
      sending messages, they both could use the same SFT value and one side
      could deny the other side access to the bus.
      
      Note that this fix does not take the corner case into account where
      a receive is in progress when you call adap_transmit.
      Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
      Cc: <stable@vger.kernel.org>      # for v4.18 and up
      Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b68d405a
    • H
      media: cec: add new tx/rx status bits to detect aborts/timeouts · 94ec4487
      Hans Verkuil 提交于
      commit 7ec2b3b941a666a942859684281b5f6460a0c234 upstream.
      
      If the HDMI cable is disconnected or the CEC adapter is manually
      unconfigured, then all pending transmits and wait-for-replies are
      aborted. Signal this with new status bits (CEC_RX/TX_STATUS_ABORTED).
      
      If due to (usually) a driver bug a transmit never ends (i.e. the
      transmit_done was never called by the driver), then when this times
      out the message is marked with CEC_TX_STATUS_TIMEOUT.
      
      This should not happen and is an indication of a driver bug.
      
      Without a separate status bit for this it was impossible to detect
      this from userspace.
      
      The 'transmit timed out' kernel message is now a warning, so this
      should be more prominent in the kernel log as well.
      Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
      Cc: <stable@vger.kernel.org>      # for v4.18 and up
      Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      94ec4487
    • H
      media: cec: make cec_get_edid_spa_location() an inline function · c1a4102e
      Hans Verkuil 提交于
      commit b915bf575d5b7774d0f22d57d6c143e07dcaade2 upstream.
      
      This function is needed by both V4L2 and CEC, so move this to
      cec.h as a static inline since there are no obvious shared
      modules between the two subsystems.
      
      This patch, together with the following ones, fixes a
      dependency bug: if CEC_CORE is disabled, then building adv7604
      (and other HDMI receivers) will fail because an essential
      function is now stubbed out.
      Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
      Cc: <stable@vger.kernel.org>      # for v4.17 and up
      Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c1a4102e
    • M
      TC: Set DMA masks for devices · b0b62843
      Maciej W. Rozycki 提交于
      commit 3f2aa244ee1a0d17ed5b6c86564d2c1b24d1c96b upstream.
      
      Fix a TURBOchannel support regression with commit 205e1b7f
      ("dma-mapping: warn when there is no coherent_dma_mask") that caused
      coherent DMA allocations to produce a warning such as:
      
      defxx: v1.11 2014/07/01  Lawrence V. Stefani and others
      tc1: DEFTA at MMIO addr = 0x1e900000, IRQ = 20, Hardware addr = 08-00-2b-a3-a3-29
      ------------[ cut here ]------------
      WARNING: CPU: 0 PID: 1 at ./include/linux/dma-mapping.h:516 dfx_dev_register+0x670/0x678
      Modules linked in:
      CPU: 0 PID: 1 Comm: swapper Not tainted 4.19.0-rc6 #2
      Stack : ffffffff8009ffc0 fffffffffffffec0 0000000000000000 ffffffff80647650
              0000000000000000 0000000000000000 ffffffff806f5f80 ffffffffffffffff
              0000000000000000 0000000000000000 0000000000000001 ffffffff8065d4e8
              98000000031b6300 ffffffff80563478 ffffffff805685b0 ffffffffffffffff
              0000000000000000 ffffffff805d6720 0000000000000204 ffffffff80388df8
              0000000000000000 0000000000000009 ffffffff8053efd0 ffffffff806657d0
              0000000000000000 ffffffff803177f8 0000000000000000 ffffffff806d0000
              9800000003078000 980000000307b9e0 000000001e900000 ffffffff80067940
              0000000000000000 ffffffff805d6720 0000000000000204 ffffffff80388df8
              ffffffff805176c0 ffffffff8004dc78 0000000000000000 ffffffff80067940
              ...
      Call Trace:
      [<ffffffff8004dc78>] show_stack+0xa0/0x130
      [<ffffffff80067940>] __warn+0x128/0x170
      ---[ end trace b1d1e094f67f3bb2 ]---
      
      This is because the TURBOchannel bus driver fails to set the coherent
      DMA mask for devices enumerated.
      
      Set the regular and coherent DMA masks for TURBOchannel devices then,
      observing that the bus protocol supports a 34-bit (16GiB) DMA address
      space, by interpreting the value presented in the address cycle across
      the 32 `ad' lines as a 32-bit word rather than byte address[1].  The
      architectural size of the TURBOchannel DMA address space exceeds the
      maximum amount of RAM any actual TURBOchannel system in existence may
      have, hence both masks are the same.
      
      This removes the warning shown above.
      
      References:
      
      [1] "TURBOchannel Hardware Specification", EK-369AA-OD-007B, Digital
          Equipment Corporation, January 1993, Section "DMA", pp. 1-15 -- 1-17
      Signed-off-by: NMaciej W. Rozycki <macro@linux-mips.org>
      Signed-off-by: NPaul Burton <paul.burton@mips.com>
      Patchwork: https://patchwork.linux-mips.org/patch/20835/
      Fixes: 205e1b7f ("dma-mapping: warn when there is no coherent_dma_mask")
      Cc: stable@vger.kernel.org # 4.16+
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b0b62843
    • J
      fsnotify: Fix busy inodes during unmount · 778af261
      Jan Kara 提交于
      commit 721fb6fbfd2132164c2e8777cc837f9b2c1794dc upstream.
      
      Detaching of mark connector from fsnotify_put_mark() can race with
      unmounting of the filesystem like:
      
        CPU1				CPU2
      fsnotify_put_mark()
        spin_lock(&conn->lock);
        ...
        inode = fsnotify_detach_connector_from_object(conn)
        spin_unlock(&conn->lock);
      				generic_shutdown_super()
      				  fsnotify_unmount_inodes()
      				    sees connector detached for inode
      				      -> nothing to do
      				  evict_inode()
      				    barfs on pending inode reference
        iput(inode);
      
      Resulting in "Busy inodes after unmount" message and possible kernel
      oops. Make fsnotify_unmount_inodes() properly wait for outstanding inode
      references from detached connectors.
      
      Note that the accounting of outstanding inode references in the
      superblock can cause some cacheline contention on the counter. OTOH it
      happens only during deletion of the last notification mark from an inode
      (or during unlinking of watched inode) and that is not too bad. I have
      measured time to create & delete inotify watch 100000 times from 64
      processes in parallel (each process having its own inotify group and its
      own file on a shared superblock) on a 64 CPU machine. Average and
      standard deviation of 15 runs look like:
      
      	Avg		Stddev
      Vanilla	9.817400	0.276165
      Fixed	9.710467	0.228294
      
      So there's no statistically significant difference.
      
      Fixes: 6b3f05d2 ("fsnotify: Detach mark from object list when last reference is dropped")
      CC: stable@vger.kernel.org
      Signed-off-by: NJan Kara <jack@suse.cz>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      778af261
    • J
      crypto: speck - remove Speck · 3252b60c
      Jason A. Donenfeld 提交于
      commit 578bdaabd015b9b164842c3e8ace9802f38e7ecc upstream.
      
      These are unused, undesired, and have never actually been used by
      anybody. The original authors of this code have changed their mind about
      its inclusion. While originally proposed for disk encryption on low-end
      devices, the idea was discarded [1] in favor of something else before
      that could really get going. Therefore, this patch removes Speck.
      
      [1] https://marc.info/?l=linux-crypto-vger&m=153359499015659Signed-off-by: NJason A. Donenfeld <Jason@zx2c4.com>
      Acked-by: NEric Biggers <ebiggers@google.com>
      Cc: stable@vger.kernel.org
      Acked-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3252b60c
    • E
      signal: Guard against negative signal numbers in copy_siginfo_from_user32 · 04eb7194
      Eric W. Biederman 提交于
      commit a3670058 upstream.
      
      While fixing an out of bounds array access in known_siginfo_layout
      reported by the kernel test robot it became apparent that the same bug
      exists in siginfo_layout and affects copy_siginfo_from_user32.
      
      The straight forward fix that makes guards against making this mistake
      in the future and should keep the code size small is to just take an
      unsigned signal number instead of a signed signal number, as I did to
      fix known_siginfo_layout.
      
      Cc: stable@vger.kernel.org
      Fixes: cc731525 ("signal: Remove kernel interal si_code magic")
      Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      04eb7194
    • J
      IB/rxe: Revise the ib_wr_opcode enum · 3b0b2820
      Jason Gunthorpe 提交于
      commit 9a59739bd01f77db6fbe2955a4fce165f0f43568 upstream.
      
      This enum has become part of the uABI, as both RXE and the
      ib_uverbs_post_send() command expect userspace to supply values from this
      enum. So it should be properly placed in include/uapi/rdma.
      
      In userspace this enum is called 'enum ibv_wr_opcode' as part of
      libibverbs.h. That enum defines different values for IB_WR_LOCAL_INV,
      IB_WR_SEND_WITH_INV, and IB_WR_LSO. These were introduced (incorrectly, it
      turns out) into libiberbs in 2015.
      
      The kernel has changed its mind on the numbering for several of the IB_WC
      values over the years, but has remained stable on IB_WR_LOCAL_INV and
      below.
      
      Based on this we can conclude that there is no real user space user of the
      values beyond IB_WR_ATOMIC_FETCH_AND_ADD, as they have never worked via
      rdma-core. This is confirmed by inspection, only rxe uses the kernel enum
      and implements the latter operations. rxe has clearly never worked with
      these attributes from userspace. Other drivers that support these opcodes
      implement the functionality without calling out to the kernel.
      
      To make IB_WR_SEND_WITH_INV and related work for RXE in userspace we
      choose to renumber the IB_WR enum in the kernel to match the uABI that
      userspace has bee using since before Soft RoCE was merged. This is an
      overall simpler configuration for the whole software stack, and obviously
      can't break anything existing.
      Reported-by: NSeth Howell <seth.howell@intel.com>
      Tested-by: NSeth Howell <seth.howell@intel.com>
      Fixes: 8700e3e7 ("Soft RoCE driver")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3b0b2820
    • N
      scsi: sched/wait: Add wait_event_lock_irq_timeout for TASK_UNINTERRUPTIBLE usage · fd594155
      Nicholas Bellinger 提交于
      commit 25ab0bc334b43bbbe4eabc255006ce42a9424da2 upstream.
      
      Short of reverting commit 00d909a1 ("scsi: target: Make the session
      shutdown code also wait for commands that are being aborted") for v4.19,
      target-core needs a wait_event_t macro can be executed using
      TASK_UNINTERRUPTIBLE to function correctly with existing fabric drivers that
      expect to run with signals pending during session shutdown and active se_cmd
      I/O quiesce.
      
      The most notable is iscsi-target/iser-target, while ibmvscsi_tgt invokes
      session shutdown logic from userspace via configfs attribute that could also
      potentially have signals pending.
      
      So go ahead and introduce wait_event_lock_irq_timeout() to achieve this, and
      update + rename __wait_event_lock_irq_timeout() to make it accept 'state' as a
      parameter.
      
      Fixes: 00d909a1 ("scsi: target: Make the session shutdown code also wait for commands that are being aborted")
      Cc: <stable@vger.kernel.org> # v4.19+
      Cc: Bart Van Assche <bvanassche@acm.org>
      Cc: Mike Christie <mchristi@redhat.com>
      Cc: Hannes Reinecke <hare@suse.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Sagi Grimberg <sagi@grimberg.me>
      Cc: Bryant G. Ly <bryantly@linux.vnet.ibm.com>
      Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
      Tested-by: NNicholas Bellinger <nab@linux-iscsi.org>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      Reviewed-by: NBryant G. Ly <bly@catalogicsoftware.com>
      Acked-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Reviewed-by: NBart Van Assche <bvanassche@acm.org>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fd594155
    • D
      UAPI: ndctl: Fix g++-unsupported initialisation in headers · cd888e8a
      David Howells 提交于
      [ Upstream commit 9607871f ]
      
      The following code in the linux/ndctl header file:
      
      	static inline const char *nvdimm_bus_cmd_name(unsigned cmd)
      	{
      		static const char * const names[] = {
      			[ND_CMD_ARS_CAP] = "ars_cap",
      			[ND_CMD_ARS_START] = "ars_start",
      			[ND_CMD_ARS_STATUS] = "ars_status",
      			[ND_CMD_CLEAR_ERROR] = "clear_error",
      			[ND_CMD_CALL] = "cmd_call",
      		};
      
      		if (cmd < ARRAY_SIZE(names) && names[cmd])
      			return names[cmd];
      		return "unknown";
      	}
      
      is broken in a number of ways:
      
       (1) ARRAY_SIZE() is not generally defined.
      
       (2) g++ does not support "non-trivial" array initialisers fully yet.
      
       (3) Every file that calls this function will acquire a copy of names[].
      
      The same goes for nvdimm_cmd_name().
      
      Fix all three by converting to a switch statement where each case returns a
      string.  That way if cmd is a constant, the compiler can trivially reduce it
      and, if not, the compiler can use a shared lookup table if it thinks that is
      more efficient.
      
      A better way would be to remove these functions and their arrays from the
      header entirely.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cd888e8a
    • W
      signal: Introduce COMPAT_SIGMINSTKSZ for use in compat_sys_sigaltstack · 5445a4b0
      Will Deacon 提交于
      [ Upstream commit 22839869f21ab3850fbbac9b425ccc4c0023926f ]
      
      The sigaltstack(2) system call fails with -ENOMEM if the new alternative
      signal stack is found to be smaller than SIGMINSTKSZ. On architectures
      such as arm64, where the native value for SIGMINSTKSZ is larger than
      the compat value, this can result in an unexpected error being reported
      to a compat task. See, for example:
      
        https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=904385
      
      This patch fixes the problem by extending do_sigaltstack to take the
      minimum signal stack size as an additional parameter, allowing the
      native and compat system call entry code to pass in their respective
      values. COMPAT_SIGMINSTKSZ is just defined as SIGMINSTKSZ if it has not
      been defined by the architecture.
      
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Dominik Brodowski <linux@dominikbrodowski.net>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Reported-by: NSteve McIntyre <steve.mcintyre@arm.com>
      Tested-by: NSteve McIntyre <93sam@debian.org>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5445a4b0
    • J
      nvme: call nvme_complete_rq when nvmf_check_ready fails for mpath I/O · 4b445d47
      James Smart 提交于
      [ Upstream commit 783f4a4408e1251d17f333ad56abac24dde988b9 ]
      
      When an io is rejected by nvmf_check_ready() due to validation of the
      controller state, the nvmf_fail_nonready_command() will normally return
      BLK_STS_RESOURCE to requeue and retry.  However, if the controller is
      dying or the I/O is marked for NVMe multipath, the I/O is failed so that
      the controller can terminate or so that the io can be issued on a
      different path.  Unfortunately, as this reject point is before the
      transport has accepted the command, blk-mq ends up completing the I/O
      and never calls nvme_complete_rq(), which is where multipath may preserve
      or re-route the I/O. The end result is, the device user ends up seeing an
      EIO error.
      
      Example: single path connectivity, controller is under load, and a reset
      is induced.  An I/O is received:
      
        a) while the reset state has been set but the queues have yet to be
           stopped; or
        b) after queues are started (at end of reset) but before the reconnect
           has completed.
      
      The I/O finishes with an EIO status.
      
      This patch makes the following changes:
      
        - Adds the HOST_PATH_ERROR pathing status from TP4028
        - Modifies the reject point such that it appears to queue successfully,
          but actually completes the io with the new pathing status and calls
          nvme_complete_rq().
        - nvme_complete_rq() recognizes the new status, avoids resetting the
          controller (likely was already done in order to get this new status),
          and calls the multipather to clear the current path that errored.
          This allows the next command (retry or new command) to select a new
          path if there is one.
      Signed-off-by: NJames Smart <jsmart2021@gmail.com>
      Reviewed-by: NSagi Grimberg <sagi@grimberg.me>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4b445d47
    • D
      bpf: fix partial copy of map_ptr when dst is scalar · d93080cd
      Daniel Borkmann 提交于
      commit 0962590e553331db2cc0aef2dc35c57f6300dbbe upstream.
      
      ALU operations on pointers such as scalar_reg += map_value_ptr are
      handled in adjust_ptr_min_max_vals(). Problem is however that map_ptr
      and range in the register state share a union, so transferring state
      through dst_reg->range = ptr_reg->range is just buggy as any new
      map_ptr in the dst_reg is then truncated (or null) for subsequent
      checks. Fix this by adding a raw member and use it for copying state
      over to dst_reg.
      
      Fixes: f1174f77 ("bpf/verifier: rework value tracking")
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Cc: Edward Cree <ecree@solarflare.com>
      Acked-by: NAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Acked-by: NEdward Cree <ecree@solarflare.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      d93080cd
  4. 04 11月, 2018 1 次提交
  5. 19 10月, 2018 1 次提交
    • L
      drm: Get ref on CRTC commit object when waiting for flip_done · 4364bcb2
      Leo Li 提交于
      This fixes a general protection fault, caused by accessing the contents
      of a flip_done completion object that has already been freed. It occurs
      due to the preemption of a non-blocking commit worker thread W by
      another commit thread X. X continues to clear its atomic state at the
      end, destroying the CRTC commit object that W still needs. Switching
      back to W and accessing the commit objects then leads to bad results.
      
      Worker W becomes preemptable when waiting for flip_done to complete. At
      this point, a frequently occurring commit thread X can take over. Here's
      an example where W is a worker thread that flips on both CRTCs, and X
      does a legacy cursor update on both CRTCs:
      
              ...
           1. W does flip work
           2. W runs commit_hw_done()
           3. W waits for flip_done on CRTC 1
           4. > flip_done for CRTC 1 completes
           5. W finishes waiting for CRTC 1
           6. W waits for flip_done on CRTC 2
      
           7. > Preempted by X
           8. > flip_done for CRTC 2 completes
           9. X atomic_check: hw_done and flip_done are complete on all CRTCs
          10. X updates cursor on both CRTCs
          11. X destroys atomic state
          12. X done
      
          13. > Switch back to W
          14. W waits for flip_done on CRTC 2
          15. W raises general protection fault
      
      The error looks like so:
      
          general protection fault: 0000 [#1] PREEMPT SMP PTI
          **snip**
          Call Trace:
           lock_acquire+0xa2/0x1b0
           _raw_spin_lock_irq+0x39/0x70
           wait_for_completion_timeout+0x31/0x130
           drm_atomic_helper_wait_for_flip_done+0x64/0x90 [drm_kms_helper]
           amdgpu_dm_atomic_commit_tail+0xcae/0xdd0 [amdgpu]
           commit_tail+0x3d/0x70 [drm_kms_helper]
           process_one_work+0x212/0x650
           worker_thread+0x49/0x420
           kthread+0xfb/0x130
           ret_from_fork+0x3a/0x50
          Modules linked in: x86_pkg_temp_thermal amdgpu(O) chash(O)
          gpu_sched(O) drm_kms_helper(O) syscopyarea sysfillrect sysimgblt
          fb_sys_fops ttm(O) drm(O)
      
      Note that i915 has this issue masked, since hw_done is signaled after
      waiting for flip_done. Doing so will block the cursor update from
      happening until hw_done is signaled, preventing the cursor commit from
      destroying the state.
      
      v2: The reference on the commit object needs to be obtained before
          hw_done() is signaled, since that's the point where another commit
          is allowed to modify the state. Assuming that the
          new_crtc_state->commit object still exists within flip_done() is
          incorrect.
      
          Fix by getting a reference in setup_commit(), and releasing it
          during default_clear().
      Signed-off-by: NLeo Li <sunpeng.li@amd.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NHarry Wentland <harry.wentland@amd.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/1539611200-6184-1-git-send-email-sunpeng.li@amd.com
      4364bcb2
  6. 18 10月, 2018 4 次提交
    • L
      mremap: properly flush TLB before releasing the page · eb66ae03
      Linus Torvalds 提交于
      Jann Horn points out that our TLB flushing was subtly wrong for the
      mremap() case.  What makes mremap() special is that we don't follow the
      usual "add page to list of pages to be freed, then flush tlb, and then
      free pages".  No, mremap() obviously just _moves_ the page from one page
      table location to another.
      
      That matters, because mremap() thus doesn't directly control the
      lifetime of the moved page with a freelist: instead, the lifetime of the
      page is controlled by the page table locking, that serializes access to
      the entry.
      
      As a result, we need to flush the TLB not just before releasing the lock
      for the source location (to avoid any concurrent accesses to the entry),
      but also before we release the destination page table lock (to avoid the
      TLB being flushed after somebody else has already done something to that
      page).
      
      This also makes the whole "need_flush" logic unnecessary, since we now
      always end up flushing the TLB for every valid entry.
      Reported-and-tested-by: NJann Horn <jannh@google.com>
      Acked-by: NWill Deacon <will.deacon@arm.com>
      Tested-by: NIngo Molnar <mingo@kernel.org>
      Acked-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      eb66ae03
    • X
      sctp: fix the data size calculation in sctp_data_size · 5660b9d9
      Xin Long 提交于
      sctp data size should be calculated by subtracting data chunk header's
      length from chunk_hdr->length, not just data header.
      
      Fixes: 668c9beb ("sctp: implement assign_number for sctp_stream_interleave")
      Signed-off-by: NXin Long <lucien.xin@gmail.com>
      Acked-by: NMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5660b9d9
    • S
      geneve, vxlan: Don't set exceptions if skb->len < mtu · 6b4f92af
      Stefano Brivio 提交于
      We shouldn't abuse exceptions: if the destination MTU is already higher
      than what we're transmitting, no exception should be created.
      
      Fixes: 52a589d5 ("geneve: update skb dst pmtu on tx path")
      Fixes: a93bf0ff ("vxlan: update skb dst pmtu on tx path")
      Signed-off-by: NStefano Brivio <sbrivio@redhat.com>
      Reviewed-by: NSabrina Dubroca <sd@queasysnail.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6b4f92af
    • M
      tracepoint: Fix tracepoint array element size mismatch · 9c0be3f6
      Mathieu Desnoyers 提交于
      commit 46e0c9be ("kernel: tracepoints: add support for relative
      references") changes the layout of the __tracepoint_ptrs section on
      architectures supporting relative references. However, it does so
      without turning struct tracepoint * const into const int elsewhere in
      the tracepoint code, which has the following side-effect:
      
      Setting mod->num_tracepoints is done in by module.c:
      
          mod->tracepoints_ptrs = section_objs(info, "__tracepoints_ptrs",
                                               sizeof(*mod->tracepoints_ptrs),
                                               &mod->num_tracepoints);
      
      Basically, since sizeof(*mod->tracepoints_ptrs) is a pointer size
      (rather than sizeof(int)), num_tracepoints is erroneously set to half the
      size it should be on 64-bit arch. So a module with an odd number of
      tracepoints misses the last tracepoint due to effect of integer
      division.
      
      So in the module going notifier:
      
              for_each_tracepoint_range(mod->tracepoints_ptrs,
                      mod->tracepoints_ptrs + mod->num_tracepoints,
                      tp_module_going_check_quiescent, NULL);
      
      the expression (mod->tracepoints_ptrs + mod->num_tracepoints) actually
      evaluates to something within the bounds of the array, but miss the
      last tracepoint if the number of tracepoints is odd on 64-bit arch.
      
      Fix this by introducing a new typedef: tracepoint_ptr_t, which
      is either "const int" on architectures that have PREL32 relocations,
      or "struct tracepoint * const" on architectures that does not have
      this feature.
      
      Also provide a new tracepoint_ptr_defer() static inline to
      encapsulate deferencing this type rather than duplicate code and
      ugly idefs within the for_each_tracepoint_range() implementation.
      
      This issue appears in 4.19-rc kernels, and should ideally be fixed
      before the end of the rc cycle.
      Acked-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Acked-by: NJessica Yu <jeyu@kernel.org>
      Link: http://lkml.kernel.org/r/20181013191050.22389-1-mathieu.desnoyers@efficios.com
      Link: http://lkml.kernel.org/r/20180704083651.24360-7-ard.biesheuvel@linaro.org
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: James Morris <james.morris@microsoft.com>
      Cc: James Morris <jmorris@namei.org>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Nicolas Pitre <nico@linaro.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: "Serge E. Hallyn" <serge@hallyn.com>
      Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Thomas Garnier <thgarnie@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NMathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Signed-off-by: NSteven Rostedt (VMware) <rostedt@goodmis.org>
      9c0be3f6
  7. 17 10月, 2018 1 次提交
  8. 16 10月, 2018 3 次提交
  9. 12 10月, 2018 3 次提交
  10. 11 10月, 2018 4 次提交
    • S
      net: ipv4: update fnhe_pmtu when first hop's MTU changes · af7d6cce
      Sabrina Dubroca 提交于
      Since commit 5aad1de5 ("ipv4: use separate genid for next hop
      exceptions"), exceptions get deprecated separately from cached
      routes. In particular, administrative changes don't clear PMTU anymore.
      
      As Stefano described in commit e9fa1495 ("ipv6: Reflect MTU changes
      on PMTU of exceptions for MTU-less routes"), the PMTU discovered before
      the local MTU change can become stale:
       - if the local MTU is now lower than the PMTU, that PMTU is now
         incorrect
       - if the local MTU was the lowest value in the path, and is increased,
         we might discover a higher PMTU
      
      Similarly to what commit e9fa1495 did for IPv6, update PMTU in those
      cases.
      
      If the exception was locked, the discovered PMTU was smaller than the
      minimal accepted PMTU. In that case, if the new local MTU is smaller
      than the current PMTU, let PMTU discovery figure out if locking of the
      exception is still needed.
      
      To do this, we need to know the old link MTU in the NETDEV_CHANGEMTU
      notifier. By the time the notifier is called, dev->mtu has been
      changed. This patch adds the old MTU as additional information in the
      notifier structure, and a new call_netdevice_notifiers_u32() function.
      
      Fixes: 5aad1de5 ("ipv4: use separate genid for next hop exceptions")
      Signed-off-by: NSabrina Dubroca <sd@queasysnail.net>
      Reviewed-by: NStefano Brivio <sbrivio@redhat.com>
      Reviewed-by: NDavid Ahern <dsahern@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      af7d6cce
    • T
      net/mlx5: WQ, fixes for fragmented WQ buffers API · 37fdffb2
      Tariq Toukan 提交于
      mlx5e netdevice used to calculate fragment edges by a call to
      mlx5_wq_cyc_get_frag_size(). This calculation did not give the correct
      indication for queues smaller than a PAGE_SIZE, (broken by default on
      PowerPC, where PAGE_SIZE == 64KB).  Here it is replaced by the correct new
      calls/API.
      
      Since (TX/RX) Work Queues buffers are fragmented, here we introduce
      changes to the API in core driver, so that it gets a stride index and
      returns the index of last stride on same fragment, and an additional
      wrapping function that returns the number of physically contiguous
      strides that can be written contiguously to the work queue.
      
      This obsoletes the following API functions, and their buggy
      usage in EN driver:
      * mlx5_wq_cyc_get_frag_size()
      * mlx5_wq_cyc_ctr2fragix()
      
      The new API improves modularity and hides the details of such
      calculation for mlx5e netdevice and mlx5_ib rdma drivers.
      
      New calculation is also more efficient, and improves performance
      as follows:
      
      Packet rate test: pktgen, UDP / IPv4, 64byte, single ring, 8K ring size.
      
      Before: 16,477,619 pps
      After:  17,085,793 pps
      
      3.7% improvement
      
      Fixes: 3a2f7033 ("net/mlx5: Use order-0 allocations for all WQ types")
      Signed-off-by: NTariq Toukan <tariqt@mellanox.com>
      Reviewed-by: NEran Ben Elisha <eranbe@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      37fdffb2
    • M
      devlink: Add helper function for safely copy string param · bde74ad1
      Moshe Shemesh 提交于
      Devlink string param buffer is allocated at the size of
      DEVLINK_PARAM_MAX_STRING_VALUE. Add helper function which makes sure
      this size is not exceeded.
      Renamed DEVLINK_PARAM_MAX_STRING_VALUE to
      __DEVLINK_PARAM_MAX_STRING_VALUE to emphasize that it should be used by
      devlink only. The driver should use the helper function instead to
      verify it doesn't exceed the allowed length.
      Signed-off-by: NMoshe Shemesh <moshe@mellanox.com>
      Acked-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bde74ad1
    • M
      devlink: Fix param set handling for string type · f355cfcd
      Moshe Shemesh 提交于
      In case devlink param type is string, it needs to copy the string value
      it got from the input to devlink_param_value.
      
      Fixes: e3b7ca18 ("devlink: Add param set command")
      Signed-off-by: NMoshe Shemesh <moshe@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f355cfcd