1. 01 Nov, 2017 1 commit
  2. 30 Oct, 2017 8 commits
    • Claudio Foellmi's avatar
      i2c: omap: Trigger bus recovery in lockup case · 93367bfc
      Claudio Foellmi authored
      A very conservative check for bus activity (to prevent interference
      in multimaster setups) prevented the bus recovery methods from being
      triggered in the case that SDA or SCL was stuck low.
      This defeats the purpose of the recovery mechanism, which was introduced
      for exactly this situation (a slave device keeping SDA pulled down).
      
      Also added a check to make sure SDA is low before attempting recovery.
      If SDA is not stuck low, recovery will not help, so we can skip it.
      
      Note that bus lockups can persist across reboots. The only other options
      are to reset or power cycle the offending slave device, and many i2c
      slaves do not even have a reset pin.
      
      If we see that one of the lines is low for the entire timeout duration,
      we can actually be sure that there is no other master driving the bus.
      It is therefore save for us to attempt a bus recovery.
      Signed-off-by: default avatarClaudio Foellmi <claudio.foellmi@ergon.ch>
      Tested-by: default avatarVignesh R <vigneshr@ti.com>
      Reviewed-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
      [wsa: fixed one return code to -EBUSY]
      Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
      93367bfc
    • Linus Walleij's avatar
      i2c: gpio: Add support for named gpios in DT · 05c74778
      Linus Walleij authored
      This adds support for using the "sda" and "scl" GPIOs in
      device tree instead of anonymously using index 0 and 1 of
      the "gpios" property.
      
      We add a helper function to retrieve the GPIO descriptors
      and some explicit error handling since the probe may have
      to be deferred. At least this happened to me when moving
      to using named "sda" and "scl" lines (all of a sudden this
      started to probe before the GPIO driver) so we need to
      gracefully defer probe when we ge -ENOENT in the error
      pointer.
      Suggested-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Tested-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      05c74778
    • Geert Uytterhoeven's avatar
      dt-bindings: i2c: i2c-gpio: Add support for named gpios · 7d29f509
      Geert Uytterhoeven authored
      The current i2c-gpio DT bindings use a single unnamed "gpios" property
      to refer to the SDA and SCL signal lines by index.  This is error-prone
      for the casual DT writer and reviewer, as one has to look up the order
      in the DT bindings.
      
      Fix this by amending the DT bindings to use two separate named gpios
      properties, and deprecate the old unnamed variant.
      
      Take this opportunity to clearly deprecate the "i2c-gpio,sda-open-drain"
      and "i2c-gpio,scl-open-drain" flags as well. The commit describes
      in detail what these flags actually mean, and why they should not be
      used in new device trees.
      
      Cc: devicetree@vger.kernel.org
      Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      [Augmented to what I and Rob would like]
      Tested-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Acked-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      7d29f509
    • Linus Walleij's avatar
      i2c: gpio: Local vars in probe · b9ab0517
      Linus Walleij authored
      By creating local variables for *dev and *np, the code become
      much easier to read, in my opinion.
      Tested-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      b9ab0517
    • Linus Walleij's avatar
      i2c: gpio: Augment all boardfiles to use open drain · 4d0ce62c
      Linus Walleij authored
      We now handle the open drain mode internally in the I2C GPIO
      driver, but we will get warnings from the gpiolib that we
      override the default mode of the line so it becomes open
      drain.
      
      We can fix all in-kernel users by simply passing the right
      flag along in the descriptor table, and we already touched
      all of these files in the series so let's just tidy it up.
      
      Cc: Steven Miao <realmz6@gmail.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Acked-by: default avatarOlof Johansson <olof@lixom.net>
      Acked-by: default avatarLee Jones <lee.jones@linaro.org>
      Acked-by: default avatarRobert Jarzmik <robert.jarzmik@free.fr>
      Acked-by: default avatarRalf Baechle <ralf@linux-mips.org>
      Acked-by: default avatarWu, Aaron <Aaron.Wu@analog.com>
      Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
      Tested-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      4d0ce62c
    • Linus Walleij's avatar
      i2c: gpio: Enforce open drain through gpiolib · 7bb75029
      Linus Walleij authored
      The I2C GPIO bitbang driver currently emulates open drain
      behaviour by implementing what the gpiolib already does:
      not actively driving the line high, instead setting it to
      input.
      
      This makes no sense. Use the new facility in gpiolib to
      request the lines enforced into open drain mode, and let
      the open drain emulation already present in the gpiolib
      kick in and handle this.
      
      As a bonus: if the GPIO driver in the back-end actually
      supports open drain in hardware using the .set_config()
      callback, it will be utilized. That's correct: we never
      used that hardware feature before, instead relying on
      emulating open drain even if the GPIO controller could
      actually handle this for us.
      
      Users will sometimes get messages like this:
      gpio-485 (?): enforced open drain please flag it properly
        in DT/ACPI DSDT/board file
      gpio-486 (?): enforced open drain please flag it properly
        in DT/ACPI DSDT/board file
      i2c-gpio gpio-i2c: using lines 485 (SDA) and 486 (SCL)
      
      Which is completely proper: since the line is used as
      open drain, it should actually be flagged properly with
      e.g.
      
      gpios = <&gpio0 5 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>,
              <&gpio0 6 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
      
      Or similar facilities in board file descriptor tables
      or ACPI DSDT.
      Tested-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      7bb75029
    • Linus Walleij's avatar
      gpio: Make it possible for consumers to enforce open drain · f926dfc1
      Linus Walleij authored
      Some busses, like I2C, strictly need to have the line handled
      as open drain, i.e. not actively driven high. For this reason
      the i2c-gpio.c bit-banged I2C driver is reimplementing open
      drain handling outside of gpiolib.
      
      This is not very optimal. Instead make it possible for a
      consumer to explcitly express that the line must be handled
      as open drain instead of allowing local hacks papering over
      this issue.
      
      The descriptor tables, whether DT, ACPI or board files, should
      of course have flagged these lines as open drain. E.g.:
      enum gpio_lookup_flags GPIO_OPEN_DRAIN for a board file, or
      gpios = <&foo 42 GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN>; in a
      device tree using <dt-bindings/gpio/gpio.h>
      
      But more often than not, these descriptors are wrong. So
      we need to make it possible for consumers to enforce this
      open drain behaviour.
      
      We now have two new enumerated GPIO descriptor config flags:
      GPIOD_OUT_LOW_OPEN_DRAIN and GPIOD_OUT_HIGH_OPEN_DRAIN
      that will set up the lined enforced as open drain as output
      low or high, using open drain (if the driver supports it)
      or using open drain emulation (setting the line as input
      to drive it high) from the gpiolib core.
      
      Cc: linux-gpio@vger.kernel.org
      Tested-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      f926dfc1
    • Linus Walleij's avatar
      i2c: gpio: Convert to use descriptors · b2e63555
      Linus Walleij authored
      This converts the GPIO-based I2C-driver to using GPIO
      descriptors instead of the old global numberspace-based
      GPIO interface. We:
      
      - Convert the driver to unconditionally grab two GPIOs
        from the device by index 0 (SDA) and 1 (SCL) which
        will work fine with device tree and descriptor tables.
        The existing device trees will continue to work just
        like before, but without any roundtrip through the
        global numberspace.
      
      - Brutally convert all boardfiles still passing global
        GPIOs by registering descriptor tables associated with
        the devices instead so this driver does not need to keep
        supporting passing any GPIO numbers as platform data.
      
      There is no stepwise approach as elegant as this, I
      strongly prefer this big hammer over any antsteps for this
      conversion. This way the old GPIO numbers go away and
      NEVER COME BACK.
      
      Special conversion for the different boards utilizing
      I2C-GPIO:
      
      - EP93xx (arch/arm/mach-ep93xx): pretty straight forward as
        all boards were using the same two GPIO lines, just define
        these two in a lookup table for "i2c-gpio" and register
        these along with the device. None of them define any
        other platform data so just pass NULL as platform data.
        This platform selects GPIOLIB so all should be smooth.
        The pins appear on a gpiochip for bank "G" as pins 1 (SDA)
        and 0 (SCL).
      
      - IXP4 (arch/arm/mach-ixp4): descriptor tables have to
        be registered for each board separately. They all use
        "IXP4XX_GPIO_CHIP" so it is pretty straight forward.
        Most board define no other platform data than SCL/SDA
        so they can drop the #include of <linux/i2c-gpio.h> and
        assign NULL to platform data.
      
        The "goramo_mlr" (Goramo Multilink Router) board is a bit
        worrisome: it implements its own I2C bit-banging in the
        board file, and optionally registers an I2C serial port,
        but claims the same GPIO lines for itself in the board file.
        This is not going to work: there will be competition for the
        GPIO lines, so delete the optional extra I2C bus instead, no
        I2C devices are registered on it anyway, there are just hints
        that it may contain an EEPROM that may be accessed from
        userspace. This needs to be fixed up properly by the serial
        clock using I2C emulation so drop a note in the code.
      
      - KS8695 board acs5k (arch/arm/mach-ks8695/board-acs5.c)
        has some platform data in addition to the pins so it needs to
        be kept around sans GPIO lines. Its GPIO chip is named
        "KS8695" and the arch selects GPIOLIB.
      
      - PXA boards (arch/arm/mach-pxa/*) use some of the platform
        data so it needs to be preserved here. The viper board even
        registers two GPIO I2Cs. The gpiochip is named "gpio-pxa" and
        the arch selects GPIOLIB.
      
      - SA1100 Simpad (arch/arm/mach-sa1100/simpad.c) defines a GPIO
        I2C bus, and the arch selects GPIOLIB.
      
      - Blackfin boards (arch/blackfin/bf533 etc) for these I assume
        their I2C GPIOs refer to the local gpiochip defined in
        arch/blackfin/kernel/bfin_gpio.c names "BFIN-GPIO".
        The arch selects GPIOLIB. The boards get spiked with
        IF_ENABLED(I2C_GPIO) but that is a side effect of it
        being like that already (I would just have Kconfig select
        I2C_GPIO and get rid of them all.) I also delete any
        platform data set to 0 as it will get that value anyway
        from static declartions of platform data.
      
      - The MIPS selects GPIOLIB and the Alchemy machine is using
        two local GPIO chips, one of them has a GPIO I2C. We need
        to adjust the local offset from the global number space here.
        The ATH79 has a proper GPIO driver in drivers/gpio/gpio-ath79.c
        and AFAICT the chip is named "ath79-gpio" and the PB44
        PCF857x expander spawns from this on GPIO 1 and 0. The latter
        board only use the platform data to specify pins so it can be
        cut altogether after this.
      
      - The MFD Silicon Motion SM501 is a special case. It dynamically
        spawns an I2C bus off the MFD using sm501_create_subdev().
        We use an approach to dynamically create a machine descriptor
        table and attach this to the "SM501-LOW" or "SM501-HIGH"
        gpiochip. We use chip-local offsets to grab the right lines.
        We can get rid of two local static inline helpers as part
        of this refactoring.
      
      Cc: Steven Miao <realmz6@gmail.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Guenter Roeck <linux@roeck-us.net>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Magnus Damm <magnus.damm@gmail.com>
      Cc: Ben Dooks <ben.dooks@codethink.co.uk>
      Cc: Heiko Schocher <hs@denx.de>
      Acked-by: default avatarWu, Aaron <Aaron.Wu@analog.com>
      Acked-by: default avatarOlof Johansson <olof@lixom.net>
      Acked-by: default avatarLee Jones <lee.jones@linaro.org>
      Acked-by: default avatarRalf Baechle <ralf@linux-mips.org>
      Tested-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      b2e63555
  3. 28 Oct, 2017 3 commits
  4. 27 Oct, 2017 7 commits
  5. 26 Oct, 2017 2 commits
  6. 23 Oct, 2017 4 commits
    • Linus Torvalds's avatar
      Linux 4.14-rc6 · bb176f67
      Linus Torvalds authored
      bb176f67
    • Linus Torvalds's avatar
      Merge tag 'staging-4.14-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · dd9d064e
      Linus Torvalds authored
      Pull staging and IIO fixes from Greg KH:
       "Here are a small number of patches to resolve some reported IIO and a
        staging driver problem. Nothing major here, full details are in the
        shortlog below.
      
        All have been in linux-next with no reported issues"
      
      * tag 'staging-4.14-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
        staging: bcm2835-audio: Fix memory corruption
        iio: adc: at91-sama5d2_adc: fix probe error on missing trigger property
        iio: adc: dln2-adc: fix build error
        iio: dummy: events: Add missing break
        staging: iio: ade7759: fix signed extension bug on shift of a u8
        iio: pressure: zpa2326: Remove always-true check which confuses gcc
        iio: proximity: as3935: noise detection + threshold changes
      dd9d064e
    • Linus Torvalds's avatar
      Merge tag 'char-misc-4.14-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · 17e7637f
      Linus Torvalds authored
      Pull char/misc driver fixes from Greg KH:
       "Here are four small fixes for 4.14-rc6.
      
        Three of them are binder driver fixes for reported issues, and the
        last one is a hyperv driver bugfix. Nothing major, but good fixes to
        get into 4.14-final.
      
        All of these have been in linux-next with no reported issues"
      
      * tag 'char-misc-4.14-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
        android: binder: Fix null ptr dereference in debug msg
        android: binder: Don't get mm from task
        vmbus: hvsock: add proper sync for vmbus_hvsock_device_unregister()
        binder: call poll_wait() unconditionally.
      17e7637f
    • Linus Torvalds's avatar
      Merge tag 'usb-4.14-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 58059921
      Linus Torvalds authored
      Pull USB/PHY fixes from Greg KH:
       "Here are a small number of USB and PHY driver fixes for 4.14-rc6
      
        There is the usual musb and xhci fixes in here, as well as some needed
        phy patches. Also is a nasty regression fix for usbfs that has started
        to hit a lot of people using virtual machines.
      
        All of these have been in linux-next with no reported problems"
      
      * tag 'usb-4.14-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (26 commits)
        usb: hub: Allow reset retry for USB2 devices on connect bounce
        USB: core: fix out-of-bounds access bug in usb_get_bos_descriptor()
        MAINTAINERS: fix git tree url for musb module
        usb: quirks: add quirk for WORLDE MINI MIDI keyboard
        usb: musb: sunxi: Explicitly release USB PHY on exit
        usb: musb: Check for host-mode using is_host_active() on reset interrupt
        usb: musb: musb_cppi41: Configure the number of channels for DA8xx
        usb: musb: musb_cppi41: Fix cppi41_set_dma_mode() for DA8xx
        usb: musb: musb_cppi41: Fix the address of teardown and autoreq registers
        USB: musb: fix late external abort on suspend
        USB: musb: fix session-bit runtime-PM quirk
        usb: cdc_acm: Add quirk for Elatec TWN3
        USB: devio: Revert "USB: devio: Don't corrupt user memory"
        usb: xhci: Handle error condition in xhci_stop_device()
        usb: xhci: Reset halted endpoint if trb is noop
        xhci: Cleanup current_cmd in xhci_cleanup_command_queue()
        xhci: Identify USB 3.1 capable hosts by their port protocol capability
        USB: serial: metro-usb: add MS7820 device id
        phy: rockchip-typec: Check for errors from tcphy_phy_init()
        phy: rockchip-typec: Don't set the aux voltage swing to 400 mV
        ...
      58059921
  7. 22 Oct, 2017 15 commits
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input · 02982f85
      Linus Torvalds authored
      Pull input fix from Dmitry Torokhov:
       "A fix for a broken commit in the previous pull breaking automatic
        module loading of input handlers, such ad evdev"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
        Input: do not use property bits when generating module alias
      02982f85
    • Dmitry Torokhov's avatar
      Input: do not use property bits when generating module alias · 09c3e01b
      Dmitry Torokhov authored
      The commit 8724ecb0 ("Input: allow matching device IDs on property
      bits") started using property bits when generating module aliases for input
      handlers, but did not adjust the generation of MODALIAS attribute on input
      device uevents, breaking automatic module loading. Given that no handler
      currently uses property bits in their module tables, let's revert this part
      of the commit for now.
      Reported-by: default avatarDamien Wyart <damien.wyart@gmail.com>
      Tested-by: default avatarDamien Wyart <damien.wyart@gmail.com>
      Fixes: 8724ecb0 ("Input: allow matching device IDs on property bits")
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      09c3e01b
    • Linus Torvalds's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 936fd005
      Linus Torvalds authored
      Pull x86 fixes from Thomas Gleixner:
       "A couple of fixes addressing the following issues:
      
         - The last polishing for the TLB code, removing the last BUG_ON() and
           the debug file along with tidying up the lazy TLB code.
      
         - Prevent triple fault on 1st Gen. 486 caused by stupidly calling the
           early IDT setup after the first function which causes a fault which
           should be caught by the exception table.
      
         - Limit the mmap of /dev/mem to valid addresses
      
         - Prevent late microcode loading on Broadwell X
      
         - Remove a redundant assignment in the cache info code"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/mm: Limit mmap() of /dev/mem to valid physical addresses
        x86/mm: Remove debug/x86/tlb_defer_switch_to_init_mm
        x86/mm: Tidy up "x86/mm: Flush more aggressively in lazy TLB mode"
        x86/mm/64: Remove the last VM_BUG_ON() from the TLB code
        x86/microcode/intel: Disable late loading on model 79
        x86/idt: Initialize early IDT before cr4_init_shadow()
        x86/cpu/intel_cacheinfo: Remove redundant assignment to 'this_leaf'
      936fd005
    • Linus Torvalds's avatar
      Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 9e415a8e
      Linus Torvalds authored
      Pull timer fix from Thomas Gleixner:
       "A single fix to make the cs5535 clock event driver robust agaist
        spurious interrupts"
      
      * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        clockevents/drivers/cs5535: Improve resilience to spurious interrupts
      9e415a8e
    • Linus Torvalds's avatar
      Merge branch 'smp-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 5670a847
      Linus Torvalds authored
      Pull smp/hotplug fix from Thomas Gleixner:
       "The recent rework of the callback invocation missed to cleanup the
        leftovers of the operation, so under certain circumstances a
        subsequent CPU hotplug operation accesses stale data and crashes.
        Clean it up."
      
      * 'smp-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        cpu/hotplug: Reset node state after operation
      5670a847
    • Linus Torvalds's avatar
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 085cf9bf
      Linus Torvalds authored
      Pull perf fixes from Thomas Gleixner:
       "A series of fixes for perf tooling:
      
         - Make xyarray return the X/Y size correctly which fixes a crash in
           the exit code.
      
         - Fix the libc path in test so it works not only on Debian/Ubuntu
           correctly
      
         - Check for eBPF file existance and output a useful error message
           instead of failing to compile a non existant file
      
         - Make sure perf_hpp_fmt is not longer references before freeing it
      
         - Use list_del_init() in the histogram code to prevent a crash when
           the already deleted element is deleted again
      
         - Remove the leftovers of the removed '-l' option
      
         - Add reviewer entries to the MAINTAINERS file"
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf test shell trace+probe_libc_inet_pton.sh: Be compatible with Debian/Ubuntu
        perf xyarray: Fix wrong processing when closing evsel fd
        perf buildid-list: Fix crash when processing PERF_RECORD_NAMESPACE
        perf record: Fix documentation for a inexistent option '-l'
        perf tools: Add long time reviewers to MAINTAINERS
        perf tools: Check wether the eBPF file exists in event parsing
        perf hists: Add extra integrity checks to fmt_free()
        perf hists: Fix crash in perf_hpp__reset_output_field()
      085cf9bf
    • Linus Torvalds's avatar
      Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 4f184d7d
      Linus Torvalds authored
      Pull irq fixes from Thomas Gleixner:
       "A set of small fixes mostly in the irq drivers area:
      
         - Make the tango irq chip work correctly, which requires a new
           function in the generiq irq chip implementation
      
         - A set of updates to the GIC-V3 ITS driver removing a bogus BUG_ON()
           and parsing the VCPU table size correctly"
      
      * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        genirq: generic chip: remove irq_gc_mask_disable_reg_and_ack()
        irqchip/tango: Use irq_gc_mask_disable_and_ack_set
        genirq: generic chip: Add irq_gc_mask_disable_and_ack_set()
        irqchip/gic-v3-its: Add missing changes to support 52bit physical address
        irqchip/gic-v3-its: Fix the incorrect parsing of VCPU table size
        irqchip/gic-v3-its: Fix the incorrect BUG_ON in its_init_vpe_domain()
        DT: arm,gic-v3: Update the ITS size in the examples
      4f184d7d
    • Linus Torvalds's avatar
      Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · b8d389e8
      Linus Torvalds authored
      Pull objtool fix from Thomas Gleixner:
       "Plug a memory leak in the instruction decoder"
      
      * 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        objtool: Fix memory leak in decode_instructions()
      b8d389e8
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · b5ac3beb
      Linus Torvalds authored
      Pull networking fixes from David Miller:
       "A little more than usual this time around. Been travelling, so that is
        part of it.
      
        Anyways, here are the highlights:
      
         1) Deal with memcontrol races wrt. listener dismantle, from Eric
            Dumazet.
      
         2) Handle page allocation failures properly in nfp driver, from Jaku
            Kicinski.
      
         3) Fix memory leaks in macsec, from Sabrina Dubroca.
      
         4) Fix crashes in pppol2tp_session_ioctl(), from Guillaume Nault.
      
         5) Several fixes in bnxt_en driver, including preventing potential
            NVRAM parameter corruption from Michael Chan.
      
         6) Fix for KRACK attacks in wireless, from Johannes Berg.
      
         7) rtnetlink event generation fixes from Xin Long.
      
         8) Deadlock in mlxsw driver, from Ido Schimmel.
      
         9) Disallow arithmetic operations on context pointers in bpf, from
            Jakub Kicinski.
      
        10) Missing sock_owned_by_user() check in sctp_icmp_redirect(), from
            Xin Long.
      
        11) Only TCP is supported for sockmap, make that explicit with a
            check, from John Fastabend.
      
        12) Fix IP options state races in DCCP and TCP, from Eric Dumazet.
      
        13) Fix panic in packet_getsockopt(), also from Eric Dumazet.
      
        14) Add missing locked in hv_sock layer, from Dexuan Cui.
      
        15) Various aquantia bug fixes, including several statistics handling
            cures. From Igor Russkikh et al.
      
        16) Fix arithmetic overflow in devmap code, from John Fastabend.
      
        17) Fix busted socket memory accounting when we get a fault in the tcp
            zero copy paths. From Willem de Bruijn.
      
        18) Don't leave opt->tot_len uninitialized in ipv6, from Eric Dumazet"
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (106 commits)
        stmmac: Don't access tx_q->dirty_tx before netif_tx_lock
        ipv6: flowlabel: do not leave opt->tot_len with garbage
        of_mdio: Fix broken PHY IRQ in case of probe deferral
        textsearch: fix typos in library helpers
        rxrpc: Don't release call mutex on error pointer
        net: stmmac: Prevent infinite loop in get_rx_timestamp_status()
        net: stmmac: Fix stmmac_get_rx_hwtstamp()
        net: stmmac: Add missing call to dev_kfree_skb()
        mlxsw: spectrum_router: Configure TIGCR on init
        mlxsw: reg: Add Tunneling IPinIP General Configuration Register
        net: ethtool: remove error check for legacy setting transceiver type
        soreuseport: fix initialization race
        net: bridge: fix returning of vlan range op errors
        sock: correct sk_wmem_queued accounting on efault in tcp zerocopy
        bpf: add test cases to bpf selftests to cover all access tests
        bpf: fix pattern matches for direct packet access
        bpf: fix off by one for range markings with L{T, E} patterns
        bpf: devmap fix arithmetic overflow in bitmap_size calculation
        net: aquantia: Bad udp rate on default interrupt coalescing
        net: aquantia: Enable coalescing management via ethtool interface
        ...
      b5ac3beb
    • Bernd Edlinger's avatar
      stmmac: Don't access tx_q->dirty_tx before netif_tx_lock · 8d5f4b07
      Bernd Edlinger authored
      This is the possible reason for different hard to reproduce
      problems on my ARMv7-SMP test system.
      
      The symptoms are in recent kernels imprecise external aborts,
      and in older kernels various kinds of network stalls and
      unexpected page allocation failures.
      
      My testing indicates that the trouble started between v4.5 and v4.6
      and prevails up to v4.14.
      
      Using the dirty_tx before acquiring the spin lock is clearly
      wrong and was first introduced with v4.6.
      
      Fixes: e3ad57c9 ("stmmac: review RX/TX ring management")
      Signed-off-by: default avatarBernd Edlinger <bernd.edlinger@hotmail.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8d5f4b07
    • Eric Dumazet's avatar
      ipv6: flowlabel: do not leave opt->tot_len with garbage · 864e2a1f
      Eric Dumazet authored
      When syzkaller team brought us a C repro for the crash [1] that
      had been reported many times in the past, I finally could find
      the root cause.
      
      If FlowLabel info is merged by fl6_merge_options(), we leave
      part of the opt_space storage provided by udp/raw/l2tp with random value
      in opt_space.tot_len, unless a control message was provided at sendmsg()
      time.
      
      Then ip6_setup_cork() would use this random value to perform a kzalloc()
      call. Undefined behavior and crashes.
      
      Fix is to properly set tot_len in fl6_merge_options()
      
      At the same time, we can also avoid consuming memory and cpu cycles
      to clear it, if every option is copied via a kmemdup(). This is the
      change in ip6_setup_cork().
      
      [1]
      kasan: CONFIG_KASAN_INLINE enabled
      kasan: GPF could be caused by NULL-ptr deref or user memory access
      general protection fault: 0000 [#1] SMP KASAN
      Dumping ftrace buffer:
         (ftrace buffer empty)
      Modules linked in:
      CPU: 0 PID: 6613 Comm: syz-executor0 Not tainted 4.14.0-rc4+ #127
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      task: ffff8801cb64a100 task.stack: ffff8801cc350000
      RIP: 0010:ip6_setup_cork+0x274/0x15c0 net/ipv6/ip6_output.c:1168
      RSP: 0018:ffff8801cc357550 EFLAGS: 00010203
      RAX: dffffc0000000000 RBX: ffff8801cc357748 RCX: 0000000000000010
      RDX: 0000000000000002 RSI: ffffffff842bd1d9 RDI: 0000000000000014
      RBP: ffff8801cc357620 R08: ffff8801cb17f380 R09: ffff8801cc357b10
      R10: ffff8801cb64a100 R11: 0000000000000000 R12: ffff8801cc357ab0
      R13: ffff8801cc357b10 R14: 0000000000000000 R15: ffff8801c3bbf0c0
      FS:  00007f9c5c459700(0000) GS:ffff8801db200000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 0000000020324000 CR3: 00000001d1cf2000 CR4: 00000000001406f0
      DR0: 0000000020001010 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000600
      Call Trace:
       ip6_make_skb+0x282/0x530 net/ipv6/ip6_output.c:1729
       udpv6_sendmsg+0x2769/0x3380 net/ipv6/udp.c:1340
       inet_sendmsg+0x11f/0x5e0 net/ipv4/af_inet.c:762
       sock_sendmsg_nosec net/socket.c:633 [inline]
       sock_sendmsg+0xca/0x110 net/socket.c:643
       SYSC_sendto+0x358/0x5a0 net/socket.c:1750
       SyS_sendto+0x40/0x50 net/socket.c:1718
       entry_SYSCALL_64_fastpath+0x1f/0xbe
      RIP: 0033:0x4520a9
      RSP: 002b:00007f9c5c458c08 EFLAGS: 00000216 ORIG_RAX: 000000000000002c
      RAX: ffffffffffffffda RBX: 0000000000718000 RCX: 00000000004520a9
      RDX: 0000000000000001 RSI: 0000000020fd1000 RDI: 0000000000000016
      RBP: 0000000000000086 R08: 0000000020e0afe4 R09: 000000000000001c
      R10: 0000000000000000 R11: 0000000000000216 R12: 00000000004bb1ee
      R13: 00000000ffffffff R14: 0000000000000016 R15: 0000000000000029
      Code: e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 ea 0f 00 00 48 8d 79 04 48 b8 00 00 00 00 00 fc ff df 45 8b 74 24 04 48 89 fa 48 c1 ea 03 <0f> b6 14 02 48 89 f8 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85
      RIP: ip6_setup_cork+0x274/0x15c0 net/ipv6/ip6_output.c:1168 RSP: ffff8801cc357550
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarDmitry Vyukov <dvyukov@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      864e2a1f
    • Geert Uytterhoeven's avatar
      of_mdio: Fix broken PHY IRQ in case of probe deferral · 66bdede4
      Geert Uytterhoeven authored
      If an Ethernet PHY is initialized before the interrupt controller it is
      connected to, a message like the following is printed:
      
          irq: no irq domain found for /interrupt-controller@e61c0000 !
      
      However, the actual error is ignored, leading to a non-functional (POLL)
      PHY interrupt later:
      
          Micrel KSZ8041RNLI ee700000.ethernet-ffffffff:01: attached PHY driver [Micrel KSZ8041RNLI] (mii_bus:phy_addr=ee700000.ethernet-ffffffff:01, irq=POLL)
      
      Depending on whether the PHY driver will fall back to polling, Ethernet
      may or may not work.
      
      To fix this:
        1. Switch of_mdiobus_register_phy() from irq_of_parse_and_map() to
           of_irq_get().
           Unlike the former, the latter returns -EPROBE_DEFER if the
           interrupt controller is not yet available, so this condition can be
           detected.
           Other errors are handled the same as before, i.e. use the passed
           mdio->irq[addr] as interrupt.
        2. Propagate and handle errors from of_mdiobus_register_phy() and
           of_mdiobus_register_device().
      Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      66bdede4
    • Randy Dunlap's avatar
      textsearch: fix typos in library helpers · 7433a8d6
      Randy Dunlap authored
      Fix spellos (typos) in textsearch library helpers.
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7433a8d6
    • David Howells's avatar
      rxrpc: Don't release call mutex on error pointer · 6cb3ece9
      David Howells authored
      Don't release call mutex at the end of rxrpc_kernel_begin_call() if the
      call pointer actually holds an error value.
      
      Fixes: 540b1c48 ("rxrpc: Fix deadlock between call creation and sendmsg/recvmsg")
      Reported-by: default avatarMarc Dionne <marc.dionne@auristor.com>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6cb3ece9
    • David S. Miller's avatar
      Merge branch 'stmmac-hw-tstamp-fixes' · 748759d5
      David S. Miller authored
      Jose Abreu says:
      
      ====================
      net: stmmac: Fix HW timestamping
      
      Three fixes for HW timestamping feature, all of them for RX side.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      748759d5