Commit graph

869077 commits

Author SHA1 Message Date
Linus Torvalds
bbfe0d6b8b This is the bulk of changes in the GPIO subsystem for the
v5.4 kernel cycle.
 
 Core changes:
 
 - Support hierarchical GPIO irqchips. We now have three
   consumers that can use this: Intel IXP4xx, ThunderX and
   Qualcomm SPMI GPIO (in the pinctrl subsystem). The support
   code has been long in the making and hashed out so it should
   be easily adaptable for all hierarchical irqchip parents.
   The code only gets compiled in if hierarchical irqchip
   is used at the topmost irq controller at least, as the
   hierarchical irqchip requires strict hierarchy all the
   way up in the system.
 
 - Determine the need for a "valid_mask" for GPIO lines on the
   gpio_chip and conversely for the "valid_mask" for the GPIO
   interrupt chip interrupt lines by looking for a
   .init_valid_mask() callback in the main chip or GPIO interrupt
   chip respectively. Allocate it with bitmap_alloc().
 
 - Isolate the device tree/open firmware GPIO description code
   out in its own file properly.
 
 - Isolate the ACPI GPIO description code out in its own file
   properly.
 
 - Drop a whole lot of #ifdef:s in the main includes: it does
   not hurt to keep the include items around, and we get
   quicker and clearer compile failures if the appropriate
   kernel symbols are not selected for drivers.
 
 New/deleted drivers:
 
 - New driver for Aspeed SGPIO.
 
 - The KS8695 driver is deleted as the platform gets deleted
   from arch/arm in this kernel cycle.
 
 - The Cirrus Logic Madera driver now supports CS47L92 and
   CS47L15.
 
 - The Freescale MPC8xxx now supports LS1028A and LS1088A.
 
 Driver improvements:
 
 - We pass the GPIO irqchip intialization by directly filling
   in the struct instead of using set-up functions (the new
   way) for Intel MID, Lynxpoint, Merrifield, XLP, HLWD, Aspeed,
   ZX, VF610, TQMX86, MT7621, Zynq and EP93xx.
 
 Out-of-band changes:
 
 - Fix a GPIO header inclusion in Unicore - no response from
   maintainer.
 
 - Drop FMC subsystem from MAINTAINERS - was deleted in the
   GPIO tree last cycle so let's mop up the shards.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEElDRnuGcz/wPCXQWMQRCzN7AZXXMFAl1/BO0ACgkQQRCzN7AZ
 XXPiPw/9GPSYqvHuv37RJwUTiaygDleLLayCy73AsudopSeInAfcPIElJgW2/5oa
 i5x4rdd81SpuReQWNKqqPjuDffdZvJW9rwuXU/LXsOk0fhWIe8BidUPISRPTYSJP
 q3NpmBJG4opVmhWZ3yxnq9tPboabjdTikVkM90Nwpe3vpdKk/7GV5k/T8/18fXb6
 bn7E6YaN6Qrt3jknb+eK+ne6zLv5/ncFIGqYvUPKeqi0MOs4JDc/YroK90MAMSrD
 WvtOZl72bYKutxa42ZYf0lZVKhZHKMoigulEWczxVxwHSulxbMDbNa+CzNfunkjz
 5iBDA34gzliCoA5NdcqMuQs44qkiRBS6ci9PRXBlW9QJuDHzpK5j4mKy2Kp5K2bQ
 +FX1dAftsAQBEkqVqQs97kGIfE5z0hRsyH8+fLKH3tkZmfkLKjYAB+pwHIhAFwvV
 f8WJ8Ay+gorvpWDwqjBeP2SnxFCE5GmgZHCfp0oJ1Kr/BM4hLPDT6RwvavDPO7uz
 xMcJFH1ZS1HCdkuFKOboD+FpRHCDeL4IJvHpal3dcu3P4RMr16M3E+UAeQAwdnYM
 AmqDYLbXyHdEszpk4uwc0nHt+gwie0CLfhuUvswJunnDkbwXiD4nj2c9ipaFsVLI
 /KaZvUe44/I5ItRb8vGkpP6Z++QiVqJkmdO0Lxy+UEaV6jb7mfg=
 =/TRI
 -----END PGP SIGNATURE-----

Merge tag 'gpio-v5.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio

Pull GPIO updates from Linus Walleij:
 "This is the bulk of changes in the GPIO subsystem for the v5.4 kernel
  cycle.

  Core changes:

   - Support hierarchical GPIO irqchips.

     We now have three consumers that can use this: Intel IXP4xx,
     ThunderX and Qualcomm SPMI GPIO (in the pinctrl subsystem).

     The support code has been long in the making and hashed out so it
     should be easily adaptable for all hierarchical irqchip parents.
     The code only gets compiled in if hierarchical irqchip is used at
     the topmost irq controller at least, as the hierarchical irqchip
     requires strict hierarchy all the way up in the system.

   - Determine the need for a "valid_mask" for GPIO lines on the
     gpio_chip and conversely for the "valid_mask" for the GPIO
     interrupt chip interrupt lines by looking for a .init_valid_mask()
     callback in the main chip or GPIO interrupt chip respectively.
     Allocate it with bitmap_alloc().

   - Isolate the device tree/open firmware GPIO description code out in
     its own file properly.

   - Isolate the ACPI GPIO description code out in its own file
     properly.

   - Drop a whole lot of #ifdef:s in the main includes: it does not hurt
     to keep the include items around, and we get quicker and clearer
     compile failures if the appropriate kernel symbols are not selected
     for drivers.

  New/deleted drivers:

   - New driver for Aspeed SGPIO.

   - The KS8695 driver is deleted as the platform gets deleted from
     arch/arm in this kernel cycle.

   - The Cirrus Logic Madera driver now supports CS47L92 and CS47L15.

   - The Freescale MPC8xxx now supports LS1028A and LS1088A.

  Driver improvements:

   - We pass the GPIO irqchip intialization by directly filling in the
     struct instead of using set-up functions (the new way) for Intel
     MID, Lynxpoint, Merrifield, XLP, HLWD, Aspeed, ZX, VF610, TQMX86,
     MT7621, Zynq and EP93xx.

  Out-of-band changes:

   - Fix a GPIO header inclusion in Unicore - no response from
     maintainer.

   - Drop FMC subsystem from MAINTAINERS - was deleted in the GPIO tree
     last cycle so let's mop up the shards"

* tag 'gpio-v5.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (82 commits)
  gpiolib: of: add a fallback for wlf,reset GPIO name
  gpio: htc-egpio: Remove unused exported htc_egpio_get_wakeup_irq()
  gpio: remove explicit comparison with 0
  gpio: creg-snps: use devm_platform_ioremap_resource() to simplify code
  gpio: devres: Switch to EXPORT_SYMBOL_GPL()
  gpio: of: Switch to EXPORT_SYMBOL_GPL()
  gpio: of: Make of_gpio_simple_xlate() private
  gpio: of: Make of_get_named_gpiod_flags() private
  gpio: aspeed: Add in ast2600 details to Aspeed driver
  gpio: aspeed: Use ngpio property from device tree if available
  gpio: aspeed: Setup irqchip dynamically
  gpio/aspeed: Fix incorrect number of banks
  gpio: aspeed: Update documentation with ast2600 controllers
  gpio: Initialize the irqchip valid_mask with a callback
  gpiolib: acpi: make acpi_can_fallback_to_crs() static
  gpio: Fix further merge errors
  gpio: Fix up merge collision in include file
  gpio: of: Normalize return code variable name
  gpio: gpiolib: Normalize return code variable name
  gpio: ep93xx: Pass irqchip when adding gpiochip
  ...
2019-09-16 14:06:50 -07:00
Linus Torvalds
31dda85e49 Core changes:
* Export i3c_device_match_id() so driver can get per-device data
 * Add addr and lvr fields to i2c_dev_desc so we can attach I2C devices
   that are not described in the DT
 * Add a missing of_node_put()
 * Fix a memory leak
 * Use dev_to_i3cmaster() instead of open-coding it
 
 Driver changes:
 * Use for_each_set_bit() in the Cadence driver
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEKmCqpbOU668PNA69Ze02AX4ItwAFAl1/N00ACgkQZe02AX4I
 twB8wxAAvK2wd7IMXD/GldIjFmqRb94sLMHjbLavKMNv/kmTZM68BoM600pntVO0
 +2lmqL7tL/2I5fnI35LJFEe2zS7XqPrh8m9rOZZHvj/uDaZnHxp18a4vwKqpw3gy
 QzlvUAQY5fp3dOlLqawKHbUTEwXA4WAuoFQujNimLbluKWZYiU3mBEPcVjYcNqnW
 1qn+FckJ7HSNKgIwvMfD7MaF77FSkKiWmAud/Zm23vc0pISuVi4sYBT2UJ90bSBL
 npPiW0l9BieAsCWLn1kv0T5AaY7X1LfBkAS10Nb3vxUOXxkHR0GtlG4Xno5cwfqy
 bcNH8QwJ9wNi0tNcPxCe0CM1d5k0ekW95VBv4HzRT/wHP/cAcgxhk65jPPCdwuus
 IYMp6B0p+G50xW2b7NzQGrLbktzn6kAqfzZWCBmX3/k2V+Y0CmBLarZp1LHL/hBR
 51dvqVNlgGG5DBHnAMoYCKbsas6yqXK7rxpXKkW3yhlcHHkn86wx1MI4+XqJAHKH
 AQOfuu+sjp35tOelb+wd49jXgWBVPVdQ2rv1h2YK6r2rgpbXE+P/t4R0BbIsIR0z
 4wa9lnLaDgjyRaABUFC7YIqjSuHW7NsGJDHMajwsd8WvcUhPNDznTRnhp7o4rWXt
 5ERqArQIxYCbVaROsYrgoYtxJ1E9ErnsW6cNxZX7O/6vljBxYLI=
 =wXtJ
 -----END PGP SIGNATURE-----

Merge tag 'i3c/for-5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux

Pull i3c updates from Boris Brezillon:
 "Core changes:

   - Export i3c_device_match_id() so driver can get per-device data

   - Add addr and lvr fields to i2c_dev_desc so we can attach I2C
     devices that are not described in the DT

   - Add a missing of_node_put()

   - Fix a memory leak

   - Use dev_to_i3cmaster() instead of open-coding it

  Driver changes:

   - Use for_each_set_bit() in the Cadence driver"

* tag 'i3c/for-5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux:
  i3c: master: Use dev_to_i3cmaster()
  i3c: master: fix a memory leak bug
  i3c: add addr and lvr to i2c_dev_desc structure
  i3c: master: cdns: Use for_each_set_bit()
  i3c: master: Add of_node_put() before return
  i3c: move i3c_device_match_id to device.c and export it
2019-09-16 14:04:46 -07:00
Linus Torvalds
aa62325dc3 spi: Updates for v5.4
The big theme for this release has been performance, we've had a series
 of unrelated overhauls of a few drivers all with a big peformance
 component.  Otherwise it's been relatively quiet, highlights include:
 
  - A big overhaul of the spi-fsl-dspi driver improving the code quality,
    performance and stability from Vladimir Oltean.
  - A big performance enhancement for the bc2835 (Raspberry Pi) driver
    for unidirectional transfers from Lukas Wunner.
  - Improved performance on small transfers for the uniphier driver from
    Keiji Hayashibara.
  - Lots of coccinelle generated cleanups from Yue Haibing.
  - New device support for Freescale ls2080a and Nuvoton NPCM FIU.
 -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl1+xloTHGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0CfNB/9V35QHqszLhsoN4w9CwQg8ijd+DqUC
 DJKQU76VxfdFSkMIYVgssnwaVO5VA06Pmx9d3cj8K+x76raLAT9gGa98Ja36pSCO
 IFdH5v5SPNUR8zPs11wFYxNZkAZX1vG11TMXYzAOa/SkZW6S4D2rT5EN+yzmoASZ
 IhJGmCh7nkpZpGmKPCgZzgNPCnEx1336IQPe3gfJg2+MvS3hiNDQiCfLzPtghU5M
 GDcdZK14saRvj00oGdRQSoRNBayXSsNGiF6OOIZWmZIQUMGpDevZSlVsvpZcwjFP
 SOx53PFDtQJYEoX6AJRyLUS76TEIiTtOSS6oKto3WmRSND0V4cs6IeLp
 =GZAn
 -----END PGP SIGNATURE-----

Merge tag 'spi-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi

Pull spi updates from Mark Brown:
 "The big theme for this release has been performance, we've had a
  series of unrelated overhauls of a few drivers all with a big
  peformance component.

  Otherwise it's been relatively quiet, highlights include:

   - A big overhaul of the spi-fsl-dspi driver improving the code
     quality, performance and stability from Vladimir Oltean.

   - A big performance enhancement for the bc2835 (Raspberry Pi) driver
     for unidirectional transfers from Lukas Wunner.

   - Improved performance on small transfers for the uniphier driver
     from Keiji Hayashibara.

   - Lots of coccinelle generated cleanups from Yue Haibing.

   - New device support for Freescale ls2080a and Nuvoton NPCM FIU"

* tag 'spi-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: (102 commits)
  spi: mediatek: support large PA
  spi: mediatek: add spi support for mt6765 IC
  dt-bindings: spi: update bindings for MT6765 SoC
  spi: bcm2835: Speed up RX-only DMA transfers by zero-filling TX FIFO
  spi: bcm2835: Speed up TX-only DMA transfers by clearing RX FIFO
  dmaengine: bcm2835: Avoid accessing memory when copying zeroes
  spi: bcm2835: Cache CS register value for ->prepare_message()
  dmaengine: bcm2835: Document struct bcm2835_dmadev
  spi: Guarantee cacheline alignment of driver-private data
  dmaengine: bcm2835: Allow reusable descriptors
  dmaengine: bcm2835: Allow cyclic transactions without interrupt
  spi: bcm2835: Drop dma_pending flag
  spi: bcm2835: Work around DONE bit erratum
  spi-gpio: Use PTR_ERR_OR_ZERO() in spi_gpio_request()
  spi: Use an abbreviated pointer to ctlr->cur_msg in __spi_pump_messages
  spi: npcm-fiu: remove set but not used variable 'retlen'
  spi: fsl-spi: use devm_platform_ioremap_resource() to simplify code
  spi: zynq-qspi: use devm_platform_ioremap_resource() to simplify code
  spi: zynqmp: use devm_platform_ioremap_resource() to simplify code
  spi: xlp: use devm_platform_ioremap_resource() to simplify code
  ...
2019-09-16 14:02:43 -07:00
Linus Torvalds
c4d11ccb2b regulator: Updates for v5.4
A small update for the regualtor API for this cycle, some small fixes
 and a bunch of new devices but none of them very big.  The most stand
 out thing is the regulator-fixed-clock driver which is for regulators
 where the enable control is done by using a clock instead of a GPIO or
 register write, a novel hardware design that had not previously come up.
 
  - Added a keyword pattern for regulator_get_optional() since usage of
    that API generally needs extra review.
  - Operating mode and suspend state support for act8865.
  - New device support for Active Semiconductor ACT8600 chargers,
    Mediatek MT6358, Qualcomm SM8150, regulator-fixed-clock, and
    Synoptics SY20276, SY20278 and SY8824E.
 -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl1+wp8THGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0GP2B/4ia4TBT2u5ZuxlyLfrsHoAJ1iVleYW
 D0s+Nsfou6lTrbJrIQgbVXsqbeBGhIBEYgfuyRJiy7CEwMssA7ltyyKbeBQ0U81W
 ywXniN1W5ChRGP770DI1Rez4qqDyIQegLC1afx1dXH4p7Be/Ttk69NQJscmpm9hC
 sXJ2tMoa2N1+nKeMEQvVsqegbdy8ddXNRIKnUnzV0HPkOTEVIwlTVR/gQXOtOpax
 UXx+mTeLQKplq9zditkRysuTWIsog1jC1kZRVu5goZ8+uudWK0SrVML4bWB6rPrJ
 d8moHJuwLHMipv+xLhI0bKGEYD4jnDqyGPJkJBuDSZTZ5EAJPaaiH923
 =a+m4
 -----END PGP SIGNATURE-----

Merge tag 'regulator-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator

Pull regulator updates from Mark Brown:
 "A small update for the regualtor API for this cycle, some small fixes
  and a bunch of new devices but none of them very big.

  The most stand out thing is the regulator-fixed-clock driver which is
  for regulators where the enable control is done by using a clock
  instead of a GPIO or register write, a novel hardware design that had
  not previously come up.

  Summary:

   - Added a keyword pattern for regulator_get_optional() since usage of
     that API generally needs extra review.

   - Operating mode and suspend state support for act8865.

   - New device support for Active Semiconductor ACT8600 chargers,
     Mediatek MT6358, Qualcomm SM8150, regulator-fixed-clock, and
     Synoptics SY20276, SY20278 and SY8824E"

* tag 'regulator-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (52 commits)
  regulator: core: Fix error return for /sys access
  regulator: da9211: fix obtaining "enable" GPIO
  regulator: max77686: fix obtaining "maxim,ena" GPIO
  regulator: uniphier: Add Pro5 USB3 VBUS support
  dt-bindings: regulator: add regulator-fixed-clock binding
  regulator: fixed: add possibility to enable by clock
  regulator: s2mps11: Consistently use local variable
  regulator: lp87565: Simplify lp87565_buck_set_ramp_delay
  regulator: slg51000: use devm_gpiod_get_optional() in probe
  regulator: lp8788-ldo: make array en_mask static const, makes object smaller
  regulator: tps65132: Stop parsing DT when gpio is not found
  regulator: Defer init completion for a while after late_initcall
  regulator: add missing 'static inline' to a helper's stub
  regulator: provide regulator_bulk_set_supply_names()
  MAINTAINERS: Add keyword pattern on regulator_get_optional()
  regulator: sy8824x: add prefixes to BUCK_EN and MODE macros
  regulator: sy8824x: use c++style for the comment block near SPDX
  regulator: mt6358: Add BROKEN dependency while waiting for MFD to merge
  regulator: mt6358: Add support for MT6358 regulator
  regulator: Add document for MT6358 regulator
  ...
2019-09-16 13:58:43 -07:00
Linus Torvalds
0372fd1a70 regmap: Updates for v5.4
Only two changes for this release, one fix for error handling with
 runtime PM and a change from Greg removing error handling from debugfs
 API calls now that they implement user visible error reporting.
 -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl1+vGATHGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0JMJB/9Nx/DQ8mGc4KTiNjOd2ic0nwPfsYNB
 Nr7/5GXmvjPc64tLmDDITZZTNbruMxMfcvJqli+JVre/yVbM8DrGMuPKpV7KJQl1
 ZKXCeRfXRtsZ/u3e/Kek0GEDRGgSwp1qTR3e4SoEQYyrf8oWIrVfRn53ptF+xJld
 inQh81+uoLHjWLZ+B2JQ/Dx7729z1+cmM3xpttvakDDRBJ7d9kIs2XA6mNfcWx4/
 JibNoOdRt+xxU2ALaa2yNEomv/AuFbQARYop2w6ivxefQAYpVAdqwnYJJdAHIZXi
 vkBczdLQpLeGXLaDrR6v0nvKvNBKaUH2WU2osFHI8ww9+HWEVr834Xor
 =UQDg
 -----END PGP SIGNATURE-----

Merge tag 'regmap-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap

Pull regmap updates from Mark Brown:
 "Only two changes for this release, one fix for error handling with
  runtime PM and a change from Greg removing error handling from debugfs
  API calls now that they implement user visible error reporting"

* tag 'regmap-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
  regmap-irq: Correct error paths in regmap_irq_thread for pm_runtime
  regmap: no need to check return value of debugfs_create functions
2019-09-16 13:57:02 -07:00
Linus Torvalds
6729fb666a hwmon updates for v5.4
New drivers and chip support
 - Add Inspur Power System power supply driver
 - Add Synaptics AS370 PVT sensor driver
 - Add support for SHTC3 to shtc1 driver
 - Add support for NCT6116 to nct6775 driver
 - Add support for AMD family 17h, model 70h CPUs to k10temp driver
 - Add support for PCT2075 to lm75 driver
 
 Removed drivers
 - Remove ads1015 driver (now supported in iio)
 
 Other changes
 - Convert drivers to use devm_i2c_new_dummy_device
 - Substantial structural improvements in lm75 driver
   Add support for writing sample interval for supported chips
 - Add support for PSU version 2 to ibm-cffps driver
 - Add support for power attribute to iio_hwmon bridge
 - Add support for additional fan, voltage and temperature attributes
   to nct7904 driver
 - Convert adt7475 driver to use hwmon_device_register_with_groups()
 - Convert k8temp driver to use hwmon_device_register_with_info()
 - Various other improvements and minor fixes
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiHPvMQj9QTOCiqgVyx8mb86fmYEFAl1+t+UACgkQyx8mb86f
 mYF3VA/9EMM6XOOTAyDgxmiE3UltgIWsKzVyWvU/uJpaxmTNG9aPF2cQXBslJyqH
 6vqHYCh6ilPqNR7ExFf1Y85rvpA+8oOzn9jkWxVr4ywJYsiJfIC9Amxf55hfKk3V
 ej+MZ2WjWXmwyHfV0vw8LPB8LEnDBH5f9bwM4Q5vCwwrgByfV7z3F7zpGjv5kZmm
 XbqCkfPgge+lZOV3/hDJKh9ylajpxJDhdrP4hhsFDVq9Tys17WZVSRGyKAvJLPMm
 Ya4TcJzQlIlr7OaxRQjONvPn34Wh3L299Hg6L5rqIxS8+WnIkLPse4YAOXbpO4Nf
 J01mS1H7XNHHWf76fedbK6+jnhLhyl67QaGoTttiNyjQyW/PYEz7PkmRNz8xsLbd
 TbUjqd3izPCrx2OEJYBoQDhQS6K3HijtRo8mBO7Svh61Y749+v0DegnEzpz6J+l4
 fIegne/LvNcyB0nQUtNQl+UpeqSlGeujAR2MVT6RYIiMlVCMueLfVk/zlGIO+tzO
 TPQoYyhosYdBG9uLgG796pQ4LPmx9L3aqd8oXqAWDx55+sOjLMWiNolJJgkH3Vfz
 8eUV8CrdNgs7NQadv+Dp5NoS3pXle8SZAbSqy40GYDlX6BORPujIJgXOcazRIreG
 IhyMoxGt6WfgSob38Od+jRE6d9rkke36gFfDUJTUzJROOCRMLLw=
 =sRtz
 -----END PGP SIGNATURE-----

Merge tag 'hwmon-for-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging

Pull hwmon updates from Guenter Roeck:
 "New drivers:
   - Inspur Power System power supply driver
   - Synaptics AS370 PVT sensor driver

  Chip support:
   - support SHTC3 in shtc1 driver
   - support NCT6116 in nct6775 driver
   - support AMD family 17h, model 70h CPUs in k10temp driver
   - support PCT2075 in lm75 driver

  Removed drivers:
   - ads1015 driver (now supported in iio)

  Other changes:
   - Convert drivers to use devm_i2c_new_dummy_device
   - Substantial structural improvements in lm75 driver adding support
     for writing sample interval for supported chips
   - Add support for PSU version 2 to ibm-cffps driver
   - Add support for power attribute to iio_hwmon bridge
   - Add support for additional fan, voltage and temperature attributes
     to nct7904 driver
   - Convert adt7475 driver to use hwmon_device_register_with_groups()
   - Convert k8temp driver to use hwmon_device_register_with_info()
   - Various other improvements and minor fixes"

* tag 'hwmon-for-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (48 commits)
  hwmon: submitting-patches: Add note on comment style
  hwmon: submitting-patches: Point to with_info API
  hwmon: (nct7904) Fix incorrect SMI status register setting of LTD temperature and fan.
  hwmon: (shtc1) add support for the SHTC3 sensor
  hwmon: (shtc1) fix shtc1 and shtw1 id mask
  hwmon: (lm75) Aproximate sample times to data-sheet values
  hwmon: (w83793d) convert to use devm_i2c_new_dummy_device
  hwmon: (w83792d) convert to use devm_i2c_new_dummy_device
  hwmon: (w83791d) convert to use devm_i2c_new_dummy_device
  hwmon: (as370-hwmon) fix devm_platform_ioremap_resource.cocci warnings
  hwmon: (lm75) Add support for writing sampling period on PCT2075
  hwmon: (lm75) Add support for writing conversion time for TMP112
  hwmon: (lm75) Move updating the sample interval to its own function
  hwmon: (lm75) Support configuring the sample time for various chips
  hwmon: (nct7904) Fix incorrect temperature limitation register setting of LTD.
  hwmon: (as370-hwmon) Add DT bindings for Synaptics AS370 PVT
  hwmon: Add Synaptics AS370 PVT sensor driver
  pmbus: (ibm-cffps) Add support for version 2 of the PSU
  dt-bindings: hwmon: Document ibm,cffps2 compatible string
  hwmon: (iio_hwmon) Enable power exporting from IIO
  ...
2019-09-16 13:44:16 -07:00
Linus Torvalds
8e97be2acd Merge branch 'ras-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull RAS updates from Borislav Petkov:
 "The latest meager RAS updates:

   - Enable processing of action-optional MCEs which have the Overflow
     bit set (Tony Luck)

   - -Wmissing-prototypes warning fix and a build fix (Valdis
     Klētnieks)"

* 'ras-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  RAS: Build debugfs.o only when enabled in Kconfig
  RAS: Fix prototype warnings
  x86/mce: Don't check for the overflow bit on action optional machine checks
2019-09-16 13:42:25 -07:00
Linus Torvalds
ff881842e1 * EDAC tree has three maintainers and one new designated reviewer now,
so that the work can scale better.
 
 * New driver for Mellanox' BlueField SoC DDR controller	(Shravan Kumar Ramani)
 
 * AMD Rome support in amd64_edac (Yazen Ghannam and Isaac Vaughn)
 
 * Misc fixes, cleanups and code improvements
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEzv7L6UO9uDPlPSfHEsHwGGHeVUoFAl17RrMACgkQEsHwGGHe
 VUpt1g//WHs2FkGvwzHFmNHaUpATWLVKJ3azrNs+q1Av53xGngg/V8qTewwcQ1tx
 OdgCqHj6PIMAoJbI2IIMIrjdMfM7EFXKgtk1kSut2uBowODkt29Ccj1ncdQ6uZOa
 OSBIt7fXcsQQoX+0/SbutR3GB0gH6/rJQ+LFZix1g1o0pUfqgPGf1ypZ+gaSc8zr
 bq+Ke8mXwaw13qy06eXAoOb32sAOfHqHjQUs53ecA+shmhua6AhRwuH+LcQyORoI
 RdIKLIKb6yw/Vri3PdrokVKZo4OPa8hbdSlC9JPhZ3SfAMlmrDfr7OiVqneKfBJz
 wRBfVVNNozbIHu5lv7ZxVaDAUh6VnWhhW036HxiMSG6NdjalVb9HB8xpKNbBlDxy
 L7q0Y5CLEcRQpkmO/S0SK8KA4Vr8w8Vw/rYVRO9ypM6LEz+uoyMIZ5+mJjiCnjYo
 sClPz5TqqgxCieId0tyAs+IZ1iXItRpEogBTXmvgIrrnWXkhQmo6Jhvd7VGDM6bT
 3RwrkWXApzxdLQSv/JqRC7N8mdII0WwDI6AjBUoC7cOeBaMQcHrcD3sLYgjWL1Up
 IQgSfHdR13S2p4Og1Phni/gSOnruCzCJQI1aCC8jjj92f1z8a/T0rjyMkE/qpZ+X
 tPOqNGkXfw86LzBDFFIOtGI6v8fdVX+Di/pTQid5hm3YdPMe1D8=
 =lEnD
 -----END PGP SIGNATURE-----

Merge tag 'edac_for_5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras

Pull EDAC updates from Borislav Petkov:
 "The new thing this time around is that we have three maintainers now
  and a new, old repo. New because it is new for the EDAC tree which is
  hosted there from now on and old because it is Tony's and mine's old
  RAS repo which we still use occasionally when the stuff isn't in tip.

  Summary:

   -  EDAC tree has three maintainers and one new designated reviewer
      now, so that the work can scale better.

   -  New driver for Mellanox' BlueField SoC DDR controller (Shravan
      Kumar Ramani)

   -  AMD Rome support in amd64_edac (Yazen Ghannam and Isaac Vaughn)

   -  Misc fixes, cleanups and code improvements"

* tag 'edac_for_5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras:
  EDAC/amd64: Add PCI device IDs for family 17h, model 70h
  MAINTAINERS: Add Robert as a EDAC reviewer
  EDAC/mc_sysfs: Make debug messages consistent
  EDAC/mc_sysfs: Remove pointless gotos
  EDAC: Prefer 'unsigned int' to bare use of 'unsigned'
  EDAC/amd64: Support asymmetric dual-rank DIMMs
  EDAC/amd64: Cache secondary Chip Select registers
  EDAC/amd64: Decode syndrome before translating address
  EDAC/amd64: Find Chip Select memory size using Address Mask
  EDAC/amd64: Initialize DIMM info for systems with more than two channels
  EDAC/amd64: Recognize DRAM device type ECC capability
  EDAC/amd64: Support more than two controllers for chip selects handling
  EDAC/mc: Cleanup _edac_mc_free() code
  EDAC, pnd2: Fix ioremap() size in dnv_rd_reg()
  EDAC, mellanox: Add ECC support for BlueField DDR4
  EDAC/altera: Use the proper type for the IRQ status bits
  EDAC/mc: Fix grain_bits calculation
  edac: altera: Move Stratix10 SDRAM ECC to peripheral
  MAINTAINERS: update EDAC entry to reflect current tree and maintainers
2019-09-16 13:38:45 -07:00
Linus Torvalds
a7bd4bcf13 tpmdd updates for Linux v5.4
-----BEGIN PGP SIGNATURE-----
 
 iJYEABYIAD4WIQRE6pSOnaBC00OEHEIaerohdGur0gUCXW0lVyAcamFya2tvLnNh
 a2tpbmVuQGxpbnV4LmludGVsLmNvbQAKCRAaerohdGur0sjdAQD3lpIS7YeT37Bu
 QVdUkRObzkN3gWvv2oZkGXPg72843AD+KH0GL+M9SfBrYO/1StBJascarOHIIqUt
 /1uqUgL7fAI=
 =IV4V
 -----END PGP SIGNATURE-----

Merge tag 'tpmdd-next-20190902' of git://git.infradead.org/users/jjs/linux-tpmdd

Pull tpm updates from Jarkko Sakkinen:
 "A new driver for fTPM living inside ARM TEE was added this round.

  In addition to that, there are three bug fixes and one clean up"

* tag 'tpmdd-next-20190902' of git://git.infradead.org/users/jjs/linux-tpmdd:
  tpm/tpm_ftpm_tee: Document fTPM TEE driver
  tpm/tpm_ftpm_tee: A driver for firmware TPM running inside TEE
  tpm: Remove a deprecated comments about implicit sysfs locking
  tpm_tis_core: Set TPM_CHIP_FLAG_IRQ before probing for interrupts
  tpm_tis_core: Turn on the TPM before probing IRQ's
  MAINTAINERS: fix style in KEYS-TRUSTED entry
2019-09-16 13:34:04 -07:00
Eugen Hristev
69a6bcde7f clk: at91: select parent if main oscillator or bypass is enabled
Selecting the right parent for the main clock is done using only
main oscillator enabled bit.
In case we have this oscillator bypassed by an external signal (no driving
on the XOUT line), we still use external clock, but with BYPASS bit set.
So, in this case we must select the same parent as before.
Create a macro that will select the right parent considering both bits from
the MOR register.
Use this macro when looking for the right parent.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
Link: https://lkml.kernel.org/r/1568042692-11784-2-git-send-email-eugen.hristev@microchip.com
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
2019-09-16 13:15:10 -07:00
Eugen Hristev
263eaf8f17 clk: at91: fix update bit maps on CFG_MOR write
The regmap update bits call was not selecting the proper mask, considering
the bits which was updating.
Update the mask from call to also include OSCBYPASS.
Removed MOSCEN which was not updated.

Fixes: 1bdf02326b ("clk: at91: make use of syscon/regmap internally")
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
Link: https://lkml.kernel.org/r/1568042692-11784-1-git-send-email-eugen.hristev@microchip.com
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
2019-09-16 13:15:01 -07:00
David S. Miller
990925fad5 Merge branch 'mlxsw-spectrum_buffers-Add-the-ability-to-query-the-CPU-ports-shared-buffer'
Ido Schimmel says:

====================
mlxsw: spectrum_buffers: Add the ability to query the CPU port's shared buffer

Shalom says:

While debugging packet loss towards the CPU, it is useful to be able to
query the CPU port's shared buffer quotas and occupancy.

Patch #1 prevents changing the CPU port's threshold and binding.

Patch #2 registers the CPU port with devlink.

Patch #3 adds the ability to query the CPU port's shared buffer quotas and
occupancy.

v3:

Patch #2:
* Remove unnecessary wrapping

v2:

Patch #1:
* s/0/MLXSW_PORT_CPU_PORT/
* Assign "mlxsw_sp->ports[MLXSW_PORT_CPU_PORT]" at the end of
  mlxsw_sp_cpu_port_create() to avoid NULL assignment on error path
* Add common functions for mlxsw_core_port_init/fini()

Patch #2:
* Move "changing CPU port's threshold and binding" check to a separate
  patch
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2019-09-16 22:07:59 +02:00
Shalom Toledo
a759ab6dac mlxsw: spectrum_buffers: Add the ability to query the CPU port's shared buffer
While debugging packet loss towards the CPU, it is useful to be able to
query the CPU port's shared buffer quotas and occupancy.

Since the CPU port has no ingress buffers, all the shared buffers ingress
information will be cleared.

Signed-off-by: Shalom Toledo <shalomt@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-09-16 22:07:59 +02:00
Shalom Toledo
28b1987ef5 mlxsw: spectrum: Register CPU port with devlink
Register CPU port with devlink.

Signed-off-by: Shalom Toledo <shalomt@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-09-16 22:07:59 +02:00
Shalom Toledo
9d0aa053ea mlxsw: spectrum_buffers: Prevent changing CPU port's configuration
Next patch is going to register the CPU port with devlink, but only so
that the CPU port's shared buffer configuration and occupancy could be
queried.

Prevent changing CPU port's shared buffer threshold and binding
configuration.

Signed-off-by: Shalom Toledo <shalomt@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-09-16 22:07:59 +02:00
David S. Miller
b63e1a02d7 Merge branch 'net-ena-implement-adaptive-interrupt-moderation-using-dim'
Arthur Kiyanovski says:

====================
net: ena: implement adaptive interrupt moderation using dim

In this patchset we replace our adaptive interrupt moderation
implementation with the dim library implementation.
The dim library showed great improvement in throughput, latency
and CPU usage in different scenarios on ARM CPUs.
This patchset also includes a few bug fixes to the parts of the
old implementation of adaptive interrupt moderation that were left.

Changes from V1 patchset:
Removed stray empty lines from patches 01/11, 09/11.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2019-09-16 22:06:03 +02:00
Arthur Kiyanovski
79226cea4a net: ena: fix incorrect update of intr_delay_resolution
ena_dev->intr_moder_rx/tx_interval save the intervals received from the
user after dividing them by ena_dev->intr_delay_resolution. Therefore
when intr_delay_resolution changes, the code needs to first mutiply
intr_moder_rx/tx_interval by the previous intr_delay_resolution to get
the value originally given by the user, and only then divide it by the
new intr_delay_resolution.

Current code does not first multiply intr_moder_rx/tx_interval by the old
intr_delay_resolution. This commit fixes it.

Also initialize ena_dev->intr_delay_resolution to be 1.

Signed-off-by: Arthur Kiyanovski <akiyano@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-09-16 22:06:03 +02:00
Arthur Kiyanovski
0eda847953 net: ena: fix retrieval of nonadaptive interrupt moderation intervals
Nonadaptive interrupt moderation intervals are assigned the value set
by the user in ethtool -C divided by ena_dev->intr_delay_resolution.

Therefore when the user tries to get the nonadaptive interrupt moderation
intervals with ethtool -c the code needs to multiply the saved value
by ena_dev->intr_delay_resolution.

The current code erroneously divides instead of multiplying in ethtool -c.
This patch fixes this.

Signed-off-by: Arthur Kiyanovski <akiyano@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-09-16 22:06:02 +02:00
Arthur Kiyanovski
7b8a28787e net: ena: fix update of interrupt moderation register
Current implementation always updates the interrupt register with
the smoothed_interval of the rx_ring. However this should be
done only in case of adaptive interrupt moderation. If non-adaptive
interrupt moderation is used, the non-adaptive interrupt moderation
interval should be used. This commit fixes that.

Signed-off-by: Arthur Kiyanovski <akiyano@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-09-16 22:06:02 +02:00
Arthur Kiyanovski
3ced8cbdf7 net: ena: remove all old adaptive rx interrupt moderation code from ena_com
Remove previous implementation of adaptive rx interrupt moderation
from ena_com files.

Signed-off-by: Arthur Kiyanovski <akiyano@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-09-16 22:06:02 +02:00
Arthur Kiyanovski
64d1fb9dfc net: ena: remove ena_restore_ethtool_params() and relevant fields
Deleted unused 4 fields from struct ena_adapter and their only user
ena_restore_ethtool_params().

Signed-off-by: Arthur Kiyanovski <akiyano@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-09-16 22:06:02 +02:00
Arthur Kiyanovski
242d81fd3d net: ena: remove old adaptive interrupt moderation code from ena_netdev
1. Out of the fields {per_napi_bytes, per_napi_packets} in struct ena_ring,
   only rx_ring->per_napi_packets are used to determine if napi did work
   for dim.
   This commit removes all other uses of these fields.
2. Remove ena_ring->moder_tbl_idx, which is not used by dim.
3. Remove all calls to ena_com_destroy_interrupt_moderation(), since all it
   did was to destroy the interrupt moderation table, which is removed as
   part of removing old interrupt moderation code.

Signed-off-by: Arthur Kiyanovski <akiyano@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-09-16 22:06:02 +02:00
Arthur Kiyanovski
57e3a5f24b net: ena: remove code duplication in ena_com_update_nonadaptive_moderation_interval _*()
Remove code duplication in:
ena_com_update_nonadaptive_moderation_interval_tx()
ena_com_update_nonadaptive_moderation_interval_rx()
functions.

Signed-off-by: Arthur Kiyanovski <akiyano@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-09-16 22:06:02 +02:00
Arthur Kiyanovski
bd21b0cc3a net: ena: enable the interrupt_moderation in driver_supported_features
Add driver_supported_features to host_host info which is a new API used to
communicate to the device which features are supported by the driver.

Add the interrupt_moderation bit to host_info->driver_supported_features
and enable it to signal the device that this driver supports interrupt
moderation properly.

Reserved bits are for features implemented in the future

Signed-off-by: Arthur Kiyanovski <akiyano@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-09-16 22:06:02 +02:00
Arthur Kiyanovski
b3db86dc4b net: ena: reimplement set/get_coalesce()
1. Remove old adaptive interrupt moderation code from set/get_coalesce()
2. Add ena_update_rx_rings_intr_moderation() function for updating
   nonadaptive interrupt moderation intervals similarly to
   ena_update_tx_rings_intr_moderation().
3. Remove checks of multiple unsupported received interrupt coalescing
   parameters. This makes code cleaner and cancels the need to update
   it every time a new coalescing parameter is invented.

Signed-off-by: Arthur Kiyanovski <akiyano@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-09-16 22:06:02 +02:00
Arthur Kiyanovski
282faf61a0 net: ena: switch to dim algorithm for rx adaptive interrupt moderation
Use the dim library for the rx adaptive interrupt moderation implementation

Signed-off-by: Arthur Kiyanovski <akiyano@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-09-16 22:06:02 +02:00
Arthur Kiyanovski
15619e722b net: ena: add intr_moder_rx_interval to struct ena_com_dev and use it
Add intr_moder_rx_interval to struct ena_com_dev and use it as the
location where the interrupt moderation rx interval is saved, instead
of the interrupt moderation table.

This is done as a first step before removing the old interrupt moderation
code.

Signed-off-by: Arthur Kiyanovski <akiyano@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-09-16 22:06:02 +02:00
David S. Miller
1b8da10370 Merge branch 'ethtool-implement-Energy-Detect-Powerdown-support-via-phy-tunable'
Alexandru Ardelean says:

====================
ethtool: implement Energy Detect Powerdown support via phy-tunable

This changeset proposes a new control for PHY tunable to control Energy
Detect Power Down.

The `phy_tunable_id` has been named `ETHTOOL_PHY_EDPD` since it looks like
this feature is common across other PHYs (like EEE), and defining
`ETHTOOL_PHY_ENERGY_DETECT_POWER_DOWN` seems too long.

The way EDPD works, is that the RX block is put to a lower power mode,
except for link-pulse detection circuits. The TX block is also put to low
power mode, but the PHY wakes-up periodically to send link pulses, to avoid
lock-ups in case the other side is also in EDPD mode.

Currently, there are 2 PHY drivers that look like they could use this new
PHY tunable feature: the `adin` && `micrel` PHYs.

This series updates only the `adin` PHY driver to support this new feature,
as this chip has been tested. A change for `micrel` can be proposed after a
discussion of the PHY-tunable API is resolved.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2019-09-16 22:02:53 +02:00
Alexandru Ardelean
65d7be094f net: phy: adin: implement Energy Detect Powerdown mode via phy-tunable
This driver becomes the first user of the kernel's `ETHTOOL_PHY_EDPD`
phy-tunable feature.
EDPD is also enabled by default on PHY config_init, but can be disabled via
the phy-tunable control.

When enabling EDPD, it's also a good idea (for the ADIN PHYs) to enable TX
periodic pulses, so that in case the other PHY is also on EDPD mode, there
is no lock-up situation where both sides are waiting for the other to
transmit.

Via the phy-tunable control, TX pulses can be disabled if specifying 0
`tx-interval` via ethtool.

The ADIN PHY supports only fixed 1 second intervals; they cannot be
configured. That is why the acceptable values are 1,
ETHTOOL_PHY_EDPD_DFLT_TX_MSECS and ETHTOOL_PHY_EDPD_NO_TX (which disables
TX pulses).

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-09-16 22:02:45 +02:00
Alexandru Ardelean
9f2f13f4ff ethtool: implement Energy Detect Powerdown support via phy-tunable
The `phy_tunable_id` has been named `ETHTOOL_PHY_EDPD` since it looks like
this feature is common across other PHYs (like EEE), and defining
`ETHTOOL_PHY_ENERGY_DETECT_POWER_DOWN` seems too long.

The way EDPD works, is that the RX block is put to a lower power mode,
except for link-pulse detection circuits. The TX block is also put to low
power mode, but the PHY wakes-up periodically to send link pulses, to avoid
lock-ups in case the other side is also in EDPD mode.

Currently, there are 2 PHY drivers that look like they could use this new
PHY tunable feature: the `adin` && `micrel` PHYs.

The ADIN's datasheet mentions that TX pulses are at intervals of 1 second
default each, and they can be disabled. For the Micrel KSZ9031 PHY, the
datasheet does not mention whether they can be disabled, but mentions that
they can modified.

The way this change is structured, is similar to the PHY tunable downshift
control:
* a `ETHTOOL_PHY_EDPD_DFLT_TX_MSECS` value is exposed to cover a default
  TX interval; some PHYs could specify a certain value that makes sense
* `ETHTOOL_PHY_EDPD_NO_TX` would disable TX when EDPD is enabled
* `ETHTOOL_PHY_EDPD_DISABLE` will disable EDPD

As noted by the `ETHTOOL_PHY_EDPD_DFLT_TX_MSECS` the interval unit is 1
millisecond, which should cover a reasonable range of intervals:
 - from 1 millisecond, which does not sound like much of a power-saver
 - to ~65 seconds which is quite a lot to wait for a link to come up when
   plugging a cable

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-09-16 22:02:45 +02:00
Dongli Zhang
00b368502d xen-netfront: do not assume sk_buff_head list is empty in error handling
When skb_shinfo(skb) is not able to cache extra fragment (that is,
skb_shinfo(skb)->nr_frags >= MAX_SKB_FRAGS), xennet_fill_frags() assumes
the sk_buff_head list is already empty. As a result, cons is increased only
by 1 and returns to error handling path in xennet_poll().

However, if the sk_buff_head list is not empty, queue->rx.rsp_cons may be
set incorrectly. That is, queue->rx.rsp_cons would point to the rx ring
buffer entries whose queue->rx_skbs[i] and queue->grant_rx_ref[i] are
already cleared to NULL. This leads to NULL pointer access in the next
iteration to process rx ring buffer entries.

Below is how xennet_poll() does error handling. All remaining entries in
tmpq are accounted to queue->rx.rsp_cons without assuming how many
outstanding skbs are remained in the list.

 985 static int xennet_poll(struct napi_struct *napi, int budget)
... ...
1032           if (unlikely(xennet_set_skb_gso(skb, gso))) {
1033                   __skb_queue_head(&tmpq, skb);
1034                   queue->rx.rsp_cons += skb_queue_len(&tmpq);
1035                   goto err;
1036           }

It is better to always have the error handling in the same way.

Fixes: ad4f15dc2c ("xen/netfront: don't bug in case of too many frags")
Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-09-16 21:46:22 +02:00
Markus Elfring
56a4e37ef1 s390/ctcm: Delete unnecessary checks before the macro call “dev_kfree_skb”
The dev_kfree_skb() function performs also input parameter validation.
Thus the test around the shown calls is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-09-16 21:45:32 +02:00
Sameeh Jubran
a53651ec93 net: ena: don't wake up tx queue when down
There is a race condition that can occur when calling ena_down().
The ena_clean_tx_irq() - which is a part of the napi handler -
function might wake up the tx queue when the queue is supposed
to be down (during recovery or changing the size of the queues
for example) This causes the ena_start_xmit() function to trigger
and possibly try to access the destroyed queues.

The race is illustrated below:

Flow A:                                       Flow B(napi handler)
ena_down()
   netif_carrier_off()
   netif_tx_disable()
                                                      ena_clean_tx_irq()
                                                         netif_tx_wake_queue()
   ena_napi_disable_all()
   ena_destroy_all_io_queues()

After these flows the tx queue is active and ena_start_xmit() accesses
the destroyed queue which leads to a kernel panic.

fixes: 1738cd3ed3 (net: ena: Add a driver for Amazon Elastic Network Adapters (ENA))

Signed-off-by: Sameeh Jubran <sameehj@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-09-16 21:40:18 +02:00
David S. Miller
f432c2e304 Merge branch 'drop_monitor-Better-sanitize-notified-packets'
Ido Schimmel says:

====================
drop_monitor: Better sanitize notified packets

When working in 'packet' mode, drop monitor generates a notification
with a potentially truncated payload of the dropped packet. The payload
is copied from the MAC header, but I forgot to check that the MAC header
was set, so do it now.

Patch #1 sets the offsets to the various protocol layers in netdevsim,
so that it will continue to work after the MAC header check is added to
drop monitor in patch #2.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2019-09-16 21:39:27 +02:00
Ido Schimmel
bef1746681 drop_monitor: Better sanitize notified packets
When working in 'packet' mode, drop monitor generates a notification
with a potentially truncated payload of the dropped packet. The payload
is copied from the MAC header, but I forgot to check that the MAC header
was set, so do it now.

Fixes: ca30707dee ("drop_monitor: Add packet alert mode")
Fixes: 5e58109b1e ("drop_monitor: Add support for packet alert mode for hardware drops")
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-09-16 21:39:27 +02:00
Ido Schimmel
58a406def4 netdevsim: Set offsets to various protocol layers
The driver periodically generates "trapped" UDP packets that it then
passes on to devlink. Set the offsets to the various protocol layers.

This is a prerequisite to the next patch, where drop monitor is taught
to check that the offset to the MAC header was set.

Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-09-16 21:39:27 +02:00
David S. Miller
db539cae12 Merge branch 'tc-taprio-offload-for-SJA1105-DSA'
Vladimir Oltean says:

====================
tc-taprio offload for SJA1105 DSA

This is the third attempt to submit the tc-taprio offload model for
inclusion in the networking tree. The sja1105 switch driver will provide
the first implementation of the offload. Only the bare minimum is added:

- The offload model and a DSA pass-through
- The hardware implementation
- The interaction with the netdev queues in the tagger code
- Documentation

What has been removed from previous attempts is support for
PTP-as-clocksource in sja1105, as well as configuring the traffic class
for management traffic.  These will be added as soon as the offload
model is settled.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2019-09-16 21:32:58 +02:00
Vladimir Oltean
7c95afa42f docs: net: dsa: sja1105: Add info about the Time-Aware Scheduler
While not an exhaustive usage tutorial, this describes the details
needed to build more complex scenarios.

Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-09-16 21:32:58 +02:00
Vladimir Oltean
317ab5b86c net: dsa: sja1105: Configure the Time-Aware Scheduler via tc-taprio offload
This qdisc offload is the closest thing to what the SJA1105 supports in
hardware for time-based egress shaping. The switch core really is built
around SAE AS6802/TTEthernet (a TTTech standard) but can be made to
operate similarly to IEEE 802.1Qbv with some constraints:

- The gate control list is a global list for all ports. There are 8
  execution threads that iterate through this global list in parallel.
  I don't know why 8, there are only 4 front-panel ports.

- Care must be taken by the user to make sure that two execution threads
  never get to execute a GCL entry simultaneously. I created a O(n^4)
  checker for this hardware limitation, prior to accepting a taprio
  offload configuration as valid.

- The spec says that if a GCL entry's interval is shorter than the frame
  length, you shouldn't send it (and end up in head-of-line blocking).
  Well, this switch does anyway.

- The switch has no concept of ADMIN and OPER configurations. Because
  it's so simple, the TAS settings are loaded through the static config
  tables interface, so there isn't even place for any discussion about
  'graceful switchover between ADMIN and OPER'. You just reset the
  switch and upload a new OPER config.

- The switch accepts multiple time sources for the gate events. Right
  now I am using the standalone clock source as opposed to PTP. So the
  base time parameter doesn't really do much. Support for the PTP clock
  source will be added in a future series.

Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-09-16 21:32:58 +02:00
Vladimir Oltean
5f06c63bd3 net: dsa: sja1105: Advertise the 8 TX queues
This is a preparation patch for the tc-taprio offload (and potentially
for other future offloads such as tc-mqprio).

Instead of looking directly at skb->priority during xmit, let's get the
netdev queue and the queue-to-traffic-class mapping, and put the
resulting traffic class into the dsa_8021q PCP field. The switch is
configured with a 1-to-1 PCP-to-ingress-queue-to-egress-queue mapping
(see vlan_pmap in sja1105_main.c), so the effect is that we can inject
into a front-panel's egress traffic class through VLAN tagging from
Linux, completely transparently.

Unfortunately the switch doesn't look at the VLAN PCP in the case of
management traffic to/from the CPU (link-local frames at
01-80-C2-xx-xx-xx or 01-1B-19-xx-xx-xx) so we can't alter the
transmission queue of this type of traffic on a frame-by-frame basis. It
is only selected through the "hostprio" setting which ATM is harcoded in
the driver to 7.

Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-09-16 21:32:57 +02:00
Vladimir Oltean
7f1e4ba814 net: dsa: sja1105: Add static config tables for scheduling
In order to support tc-taprio offload, the TTEthernet egress scheduling
core registers must be made visible through the static interface.

Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-09-16 21:32:57 +02:00
Vladimir Oltean
47d23af292 net: dsa: Pass ndo_setup_tc slave callback to drivers
DSA currently handles shared block filters (for the classifier-action
qdisc) in the core due to what I believe are simply pragmatic reasons -
hiding the complexity from drivers and offerring a simple API for port
mirroring.

Extend the dsa_slave_setup_tc function by passing all other qdisc
offloads to the driver layer, where the driver may choose what it
implements and how. DSA is simply a pass-through in this case.

Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Acked-by: Kurt Kanzenbach <kurt@linutronix.de>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-09-16 21:32:57 +02:00
Vinicius Costa Gomes
9c66d15646 taprio: Add support for hardware offloading
This allows taprio to offload the schedule enforcement to capable
network cards, resulting in more precise windows and less CPU usage.

The gate mask acts on traffic classes (groups of queues of same
priority), as specified in IEEE 802.1Q-2018, and following the existing
taprio and mqprio semantics.
It is up to the driver to perform conversion between tc and individual
netdev queues if for some reason it needs to make that distinction.

Full offload is requested from the network interface by specifying
"flags 2" in the tc qdisc creation command, which in turn corresponds to
the TCA_TAPRIO_ATTR_FLAG_FULL_OFFLOAD bit.

The important detail here is the clockid which is implicitly /dev/ptpN
for full offload, and hence not configurable.

A reference counting API is added to support the use case where Ethernet
drivers need to keep the taprio offload structure locally (i.e. they are
a multi-port switch driver, and configuring a port depends on the
settings of other ports as well). The refcount_t variable is kept in a
private structure (__tc_taprio_qopt_offload) and not exposed to drivers.

In the future, the private structure might also be expanded with a
backpointer to taprio_sched *q, to implement the notification system
described in the patch (of when admin became oper, or an error occurred,
etc, so the offload can be monitored with 'tc qdisc show').

Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Signed-off-by: Voon Weifeng <weifeng.voon@intel.com>
Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-09-16 21:32:57 +02:00
Jack Morgenstein
3eca7fc2d8 RDMA: Fix double-free in srq creation error flow
The cited commit introduced a double-free of the srq buffer in the error
flow of procedure __uverbs_create_xsrq().

The problem is that ib_destroy_srq_user() called in the error flow also
frees the srq buffer.

Thus, if uverbs_response() fails in __uverbs_create_srq(), the srq buffer
will be freed twice.

Cc: <stable@vger.kernel.org>
Fixes: 68e326dea1 ("RDMA: Handle SRQ allocations by IB/core")
Link: https://lore.kernel.org/r/20190916071154.20383-5-leon@kernel.org
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Reviewed-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
2019-09-16 14:37:38 -03:00
Gal Pressman
a3f4b8e318 RDMA/efa: Fix incorrect error print
The error print should indicate that it failed to get the queue
attributes, not network attributes.

Link: https://lore.kernel.org/r/20190910134301.4194-2-galpress@amazon.com
Reviewed-by: Daniel Kranzdorf <dkkranzd@amazon.com>
Reviewed-by: Firas JahJah <firasj@amazon.com>
Signed-off-by: Gal Pressman <galpress@amazon.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
2019-09-16 14:25:43 -03:00
Danit Goldberg
5d44adebbb IB/mlx5: Free mpi in mp_slave mode
ib_add_slave_port() allocates a multiport struct but never frees it.
Don't leak memory, free the allocated mpi struct during driver unload.

Cc: <stable@vger.kernel.org>
Fixes: 32f69e4be2 ("{net, IB}/mlx5: Manage port association for multiport RoCE")
Link: https://lore.kernel.org/r/20190916064818.19823-3-leon@kernel.org
Signed-off-by: Danit Goldberg <danitg@mellanox.com>
Reviewed-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
2019-09-16 14:08:18 -03:00
Dmitry Torokhov
0898782247 Merge branch 'next' into for-linus
Prepare input updates for 5.4 merge window.
2019-09-16 09:56:27 -07:00
Aurelien Aptel
352f2c9a57 cifs: cifsroot: add more err checking
make cifs more verbose about buffer size errors
and add some comments

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
2019-09-16 11:43:39 -05:00
Steve French
c3498185b7 smb3: add missing worker function for SMB3 change notify
SMB3 change notify is important to allow applications to wait
on directory change events of different types (e.g. adding
and deleting files from others systems). Add worker functions
for this.

Acked-by: Aurelien Aptel <aaptel@suse.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
2019-09-16 11:43:39 -05:00
Paulo Alcantara (SUSE)
8eecd1c2e5 cifs: Add support for root file systems
Introduce a new CONFIG_CIFS_ROOT option to handle root file systems
over a SMB share.

In order to mount the root file system during the init process, make
cifs.ko perform non-blocking socket operations while mounting and
accessing it.

Cc: Steve French <smfrench@gmail.com>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
Signed-off-by: Paulo Alcantara (SUSE) <paulo@paulo.ac>
Signed-off-by: Steve French <stfrench@microsoft.com>
2019-09-16 11:43:38 -05:00