1. 09 12月, 2020 1 次提交
  2. 04 12月, 2020 6 次提交
    • J
      USB: serial: cp210x: clean up dtr_rts() · daa91919
      Johan Hovold 提交于
      Clean up dtr_rts() by renaming the port parameter and adding missing
      whitespace.
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      daa91919
    • J
      USB: serial: cp210x: refactor flow-control handling · ed921771
      Johan Hovold 提交于
      Add a helper function to be used to configure flow control.
      
      The flow-control code was the last caller that relied on the
      memset-on-failure behaviour of cp210x_read_reg_block(), which we can now
      drop in favour of bailing out on errors when retrieving the flow-control
      settings.
      
      This should also simplify adding support for software flow control.
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      ed921771
    • J
      USB: serial: cp210x: drop flow-control debugging · b339628e
      Johan Hovold 提交于
      Drop some unnecessary flow-control debugging.
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      b339628e
    • J
      USB: serial: cp210x: set terminal settings on open · 46827bda
      Johan Hovold 提交于
      Unlike other drivers cp210x have been retrieving the current terminal
      settings from the device on open and reflecting those in termios.
      
      Due to how set_termios() used to be implemented, this saved a few
      control requests on open but has instead caused problems like broken
      flow control and has required adding workarounds for swapped
      line-control in cp2108 and line-speed initialisation on cp2104.
      
      This unusual implementation also complicates adding new features for no
      good reason.
      
      Rip out the corresponding code and the above mentioned workarounds and
      instead initialise the terminal settings unconditionally on open.
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      46827bda
    • J
      USB: serial: cp210x: clean up line-control handling · d4297629
      Johan Hovold 提交于
      Update the line-control settings in one request unconditionally instead
      of setting the word-length, parity and stop-bit settings separately.
      
      This avoids multiple requests when several settings are changed even if
      this scheme could potentially also be used to detect unsupported device
      settings. Since all device types but CP2101 appears to support all
      settings, let's handle that one specifically and also report back the
      unsupported settings properly through termios by clearing the
      corresponding bits.
      
      Also drop the related unnecessary debug printks.
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      d4297629
    • J
      USB: serial: cp210x: return early on unchanged termios · 95168d62
      Johan Hovold 提交于
      Return early from set_termios() in case no relevant terminal settings
      have changed.
      
      This avoids testing each parameter in turn and specifically allows the
      line-control handling to be cleaned up further.
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      95168d62
  3. 20 11月, 2020 1 次提交
    • D
      USB: serial: mos7720: defer state restore to a workqueue · 053af9e6
      Davidlohr Bueso 提交于
      The parallel port restore operation currently defers writes
      to a tasklet, if it sees a locked disconnect mutex. The
      driver goes to a lot of trouble to ensure writes happen
      in a non-blocking context, but things can be greatly
      simplified if it's done in regular process context and
      this is not a system performance critical path. As such,
      instead of doing the state restore writes in softirq context,
      use a workqueue and just do regular synchronous writes.
      
      In addition to the cleanup, this also imposes less on the
      overall system as tasklets have been deprecated because
      of it's softirq implications, potentially blocking a higher
      priority task from running.
      Signed-off-by: NDavidlohr Bueso <dbueso@suse.de>
      Link: https://lore.kernel.org/r/20201120045300.28804-1-dave@stgolabs.net
      [johan: amend commit message ("softirq context")]
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      053af9e6
  4. 05 11月, 2020 1 次提交
  5. 04 11月, 2020 16 次提交
  6. 27 10月, 2020 2 次提交
  7. 26 10月, 2020 2 次提交
  8. 25 10月, 2020 2 次提交
    • H
      i2c: core: Restore acpi_walk_dep_device_list() getting called after registering the ACPI i2c devs · 8058d699
      Hans de Goede 提交于
      Commit 21653a41 ("i2c: core: Call i2c_acpi_install_space_handler()
      before i2c_acpi_register_devices()")'s intention was to only move the
      acpi_install_address_space_handler() call to the point before where
      the ACPI declared i2c-children of the adapter where instantiated by
      i2c_acpi_register_devices().
      
      But i2c_acpi_install_space_handler() had a call to
      acpi_walk_dep_device_list() hidden (that is I missed it) at the end
      of it, so as an unwanted side-effect now acpi_walk_dep_device_list()
      was also being called before i2c_acpi_register_devices().
      
      Move the acpi_walk_dep_device_list() call to the end of
      i2c_acpi_register_devices(), so that it is once again called *after*
      the i2c_client-s hanging of the adapter have been created.
      
      This fixes the Microsoft Surface Go 2 hanging at boot.
      
      Fixes: 21653a41 ("i2c: core: Call i2c_acpi_install_space_handler() before i2c_acpi_register_devices()")
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=209627Reported-by: NRainer Finke <rainer@finke.cc>
      Reported-by: NKieran Bingham <kieran.bingham@ideasonboard.com>
      Suggested-by: NMaximilian Luz <luzmaximilian@gmail.com>
      Tested-by: NKieran Bingham <kieran.bingham@ideasonboard.com>
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NWolfram Sang <wsa@kernel.org>
      8058d699
    • G
      random32: make prandom_u32() output unpredictable · c51f8f88
      George Spelvin 提交于
      Non-cryptographic PRNGs may have great statistical properties, but
      are usually trivially predictable to someone who knows the algorithm,
      given a small sample of their output.  An LFSR like prandom_u32() is
      particularly simple, even if the sample is widely scattered bits.
      
      It turns out the network stack uses prandom_u32() for some things like
      random port numbers which it would prefer are *not* trivially predictable.
      Predictability led to a practical DNS spoofing attack.  Oops.
      
      This patch replaces the LFSR with a homebrew cryptographic PRNG based
      on the SipHash round function, which is in turn seeded with 128 bits
      of strong random key.  (The authors of SipHash have *not* been consulted
      about this abuse of their algorithm.)  Speed is prioritized over security;
      attacks are rare, while performance is always wanted.
      
      Replacing all callers of prandom_u32() is the quick fix.
      Whether to reinstate a weaker PRNG for uses which can tolerate it
      is an open question.
      
      Commit f227e3ec ("random32: update the net random state on interrupt
      and activity") was an earlier attempt at a solution.  This patch replaces
      it.
      Reported-by: NAmit Klein <aksecurity@gmail.com>
      Cc: Willy Tarreau <w@1wt.eu>
      Cc: Eric Dumazet <edumazet@google.com>
      Cc: "Jason A. Donenfeld" <Jason@zx2c4.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: tytso@mit.edu
      Cc: Florian Westphal <fw@strlen.de>
      Cc: Marc Plumb <lkml.mplumb@gmail.com>
      Fixes: f227e3ec ("random32: update the net random state on interrupt and activity")
      Signed-off-by: NGeorge Spelvin <lkml@sdf.org>
      Link: https://lore.kernel.org/netdev/20200808152628.GA27941@SDF.ORG/
      [ willy: partial reversal of f227e3ec; moved SIPROUND definitions
        to prandom.h for later use; merged George's prandom_seed() proposal;
        inlined siprand_u32(); replaced the net_rand_state[] array with 4
        members to fix a build issue; cosmetic cleanups to make checkpatch
        happy; fixed RANDOM32_SELFTEST build ]
      Signed-off-by: NWilly Tarreau <w@1wt.eu>
      c51f8f88
  9. 24 10月, 2020 2 次提交
  10. 23 10月, 2020 7 次提交