Commit Graph

601714 Commits

Author SHA1 Message Date
Michael Turquette
59bdefe978 arm64: amlogic: select gxbb clk driver
The AmLogic clock controller code is used by both arm and arm64
architectures. Explicitly select the core code for all Meson (arm64)
builds, and also select the GXBB driver, since that's the way arm64 does
things.

Signed-off-by: Michael Turquette <mturquette@baylibre.com>
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2016-07-07 17:54:08 +02:00
Arnd Bergmann
fc7c0be084 This pull requests contains Broadcom ARM64-based SoC changes for 4.8 second part:
- Eric updates the bcm2836 interrupt controller driver not to rely on ARM/Linux specific functions
   in preparation for using it on ARM64
 
 - Eric also adds a Kconfig entry for the BCM2835 Raspberry Pi family in the ARM64 Kconfig.platforms
   file
 
 - Eric cherry picked a patch from Alexander Graf with Acks from ARM64 maintainers to support different
   DMA and bus offsets, required for the Raspberry Pi 3 SoC
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJXfeKCAAoJEIfQlpxEBwcE5lsQANQE4ppxhTsQe/VhxWFnIchC
 UEBRTP00iFtQbiYLrP0irRe37QxRy16A5AY7yFp9CHPOe9Ut1fvzwOORCsXViqSo
 5NB3UGUnLJmrBSe5q8wbGXXc0JAnFwcFEHIvnhRVPy8lG2dC0QsABmxoOgen1euz
 WFFW3/nWhG3U8S59h0WqYeSlspbr9byDRFLYA8nvyK1GKtaRkwnAd4OuqKhHcI1t
 1Yw1H9WnQk5deEYEYki6LJCNggJ4+cqltFb2h0x7QcMTVLz/KmNDA7uAmR+ZxLpx
 RinlzKW8kdDFOqhzfr250M3z6THCpX9DR+NUjkaua5NxFuQZvhdLldOu9wXlo5Ya
 bhYXgeU3YHdAw3mVHmCwqaNv0UDAhKAbmXtriqqJs44bF0HWr7oT4FyhMf7r1Pae
 V6V3Oh+xYknaYOCS7Ny4ALkPFH7CbArLU5CCvW8uTSt3K38MMmFDwPurAlb7bVph
 UB6jmsNVwPXrs40ha0IMnVgwnC5m8eva4g+UbV/KBr7vrSC4XQMwRfTd4Cm6ZhtB
 GymQ9y7hR4VDkLnt1QNbQDWz+PE4ycixn3uN070rA+6evi0DLcOLH+KK+g3lPdsl
 dZqxBkZR1JpzIM4OezKK6XzlR6cKUSW+vJ4GrDllWIHXXRILVVZLHdiDRG2rBrv0
 /1rBUxXZoPvSGY79dRqD
 =qrTS
 -----END PGP SIGNATURE-----

Merge tag 'arm-soc/for-4.8/soc-arm64-part2' of http://github.com/Broadcom/stblinux into next/arm64

Merge "Broadcom ARM64-based SoC changes for 4.8 second part" from Florian Fainelli:

- Eric updates the bcm2836 interrupt controller driver not to rely on ARM/Linux specific functions
  in preparation for using it on ARM64

- Eric also adds a Kconfig entry for the BCM2835 Raspberry Pi family in the ARM64 Kconfig.platforms
  file

- Eric cherry picked a patch from Alexander Graf with Acks from ARM64 maintainers to support different
  DMA and bus offsets, required for the Raspberry Pi 3 SoC

* tag 'arm-soc/for-4.8/soc-arm64-part2' of http://github.com/Broadcom/stblinux:
  arm64: Add platform selection for BCM2835.
  arm64: Allow for different DMA and CPU bus offsets
  irqchip: bcm2835: Avoid arch/arm-specific handle_IRQ
2016-07-07 15:54:54 +02:00
Arnd Bergmann
623149b00e mvebu arm64 for 4.8
enable Armada 3700 clock drivers
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iEYEABECAAYFAld6ykAACgkQCwYYjhRyO9Wo8ACdH6kYBKYuaivu3ggVBoSle+01
 5noAn13h+iScUld+CAn0UVktOjd7Yplp
 =sjV8
 -----END PGP SIGNATURE-----

Merge tag 'mvebu-arm64-4.8-1' of git://git.infradead.org/linux-mvebu into next/arm64

Merge "mvebu arm64 for 4.8" from Gregory CLEMENT:

enable Armada 3700 clock drivers

* tag 'mvebu-arm64-4.8-1' of git://git.infradead.org/linux-mvebu:
  arm64: marvell: enable Armada 3700 clock drivers
2016-07-07 14:16:43 +02:00
Olof Johansson
744f0b376d Renesas ARM64 Based SoC Defconfig Updates for v4.8
* Enable Renesas R8A7796 SoC in ARM64 defcnfig
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJXdRYaAAoJENfPZGlqN0++NvEQAJN5eMuk92Z426CyubNx/TBM
 pTD/TQg8FyX7wYFSL66LqLZgzYPxzuQlGl0Lfy55IlIsxoGp9xf7t4tZPcvcw5wQ
 BfvhQ6vOeQV8NGbsQS0sRmMrgH6rhPwaQWs/RUawr34v1vVhyRTNJF5pQbpBCqUD
 9pQW9G6G+1WdffjEHQ53Cp56E+nB3sZ0Y/mbI1kydfr5UNx/sTccGOuIPc7UPAwn
 xzpL8XhV6eDKUZu3tGQEDn6rw6iacyi4SB2GQE+QCzw/DB0V/Zb3Z8dd6k2R/6rm
 TZ8xHvz5lucxsGhPpJa43+IVF2nb/RwPs/EsJ8UZrMFgvDEdgCAFEKOwKtI9cPl3
 CELgofXHXMChaA8fwGOVbLlLDNi4H/gV6MEC6jFm8HP6nJRxKwrBGbWQmHKfuqnA
 YPB29ba5GsBUUzV2l8S/Re8eLO85tplzq2vgLSMLixAM4R5LN7tNB2HgRAOrSLND
 ts0qQRyYdIV8Kfdh0e/alXsXnCoJ5RCSkL/KvAsvcNQADizhPLyBKWBk6JZfN0Rr
 XSwcxRybratvNUoKDQjAyCvrSY8fbtJdE4dSa/BmEvY+CH4NsTIye9c7DmoOqluw
 Zoii6V3eTSpHNGooepd8tAtIWF9kXU0xUAB8sFvPwm+O4BSBMIsM78KkuU3E85GS
 +sQKKyhWmsBH0KbDkIZS
 =LjO1
 -----END PGP SIGNATURE-----

Merge tag 'renesas-arm64-defconfig-for-v4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/arm64

Renesas ARM64 Based SoC Defconfig Updates for v4.8

* Enable Renesas R8A7796 SoC in ARM64 defcnfig

* tag 'renesas-arm64-defconfig-for-v4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
  arm64: defconfig: enable Renesas R8A7796 SoC

Signed-off-by: Olof Johansson <olof@lixom.net>
2016-07-06 22:00:41 -07:00
Florian Fainelli
c4c0e2607a This pull request brings in the build support for the Raspberry Pi
arm64 port.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABCgAGBQJXea6iAAoJELXWKTbR/J7oJlkP/jtpW5QNzWMUYq833W9/XqxU
 CJQ2QvxFnYJGYAdyMUzsE+/nmXZYRwvoY/E2majlt9hblpkv8//r+EDKQzVd8KDs
 AcYIskjljDNMQAzeEIowlA8LlMLRlQzo3xGSZ1F/PqGR7O41kxEGJGEWZM3t0ZEU
 CShP028jc42z09XS/6JrFEEQZqG6QsDfp4ReCOrcI1VBG+NKzJbIAQkKDjw2Dw3g
 NckvB2j6aAHzzQU/O4RZYfS+g/qvd76sTadAbW04aBEBvZ+bArK8w939mBpetpnB
 La6LXmlujRdjugVWWVMJF8NzsE/RCLQI+TJZtUB49TFkcpaG8D4h2gMV7zwGgswv
 HecvCZiZ2eHlc+MTUB9e7buANE5lbxKxZZZXaAAiD9dCBeCfi3N5QNSZ1e5BUnet
 yJKaf0rX1CR46W9YO25pJ3lu2k5oADm7SdnmpVfCcVr6Btsq2ABEod2c0zYP2s5B
 uBPl1R/QB3mzzNltkbICx8ENairp+Z1tKa3AQcmWy7FGb5DX5iqd5ESB/11H0SQs
 uN9ePs32baGk0UyGR1m4HzbZOUlmb6dLnTwIKHdgCW2O5cUNE6QV1fJzoeU14zVK
 6SWWbiEHXEoNQZ9JuqyVO+maMEypQLAQy42SY0EoMdNsSISbcxymVFhKVYhOR+uc
 QVtEJiI3v+p0LD+xL2Nd
 =Rdgt
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJXfH/7AAoJEIfQlpxEBwcE2y4P/isPwi6mxx5t5EbbMXBMV+Yd
 QbIH158lScKpfktBavCa9ktc6LtJOJspIGB7dsjMh4dLjtGIacufXRGIt9piakgR
 tZhRE9a49c6mRS2/9LUN7xSWiE/naSWrwxldtz7wl/oR+sf7yfTO/rU/nIgg5F0p
 KfeTq2QYn4kmY9KJl+VI1QN7vtbdIoCsyJMKn5IQRUqTyKeFERV1WQj9oQ0aUbB1
 qUy0Wa2eQvCjNjz7VRXrQIqznkqy/q2yEozsmx6pwkG0GrNWrhST7B46E4lz3h0z
 g0p8M6JvIbI3Wn/Jo8IlYv2Arsy4WNYgSE4oQapdZqFnyOae6O6tAWaJX10oYA+i
 b7ya2vzKXWHVvy37HTQ/Y4yTqdIUMuYw2b7JWIiOlOPZPQa5Y9/EpyxYILkNprQO
 WaOtrWb0R4FNP0PLJ9NXTQfXuTO+xJ/DMs2P5yzhAeNuN+MLgcM7DqJkSwSQVX/c
 40fBP2DVRd+dYodg/sKbQscJsAMmUvzanypYLSlglvAnW7QhACBy8W46Ew9rFV0o
 l1PMdOZhKZZykvrA8sXrStXqNzjnIndg7MpWer+peSr++ZUmXDtXr+4Q0N24ryD+
 fLOVNlK/NMVI9+DheG/U68x983qB1pPHz9qBZkU+KJg544bIkp89N8HV02aXKxfY
 eoA+8Qp/Gdu6e4oOMRe5
 =pK2X
 -----END PGP SIGNATURE-----

Merge tag 'bcm2835-arm64-next-2016-07-03' into soc-arm64/next

This pull request brings in the build support for the Raspberry Pi arm64
port. This has an external dependency on Jason Cooper's irqchip/bcm
branch, it is a stable branch based on v4.7-rc1, and it has been in
-next for a couple of weeks.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
2016-07-05 20:49:24 -07:00
Olof Johansson
031bd3a91c Qualcomm ARM64 Based defconfig Updates for v4.8
* Enable PM8xxx pwrkey support
 * Enable MSM8996 support
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJXcaHFAAoJEFKiBbHx2RXVBaQQAOY09MEEUQxoOx1P/WnP1cBj
 h5mq3TsQyYRPCeudHD7VouLHFTYITMClTVX+ykFH4au2Me0FBp2Hbz9sPvwo5DrN
 doeWJZo2mRaiLiOuPFwy6/Tgm0HMQwp6zMxWiwYOpndrDjNiBpttyb0NOfCaCFj8
 8T3GvV5XnuTZHOO+8jgfwmFSZlErGibOL9DnapXuZSd0WAL4XQy0xehrY+Ij1nwv
 asswFzMT3Z67JJJwXfo+P6w5vYOkPCRG1BdhqTrRUn+nS79+AkU7ReGfdZJgHdrN
 An06R+gTpl36gdGwxcr2RCXhK+u6IJN2jyL1cs9MBbyEiFBt858SzBXiWSnCntqJ
 BsHVEAlKnwTXdFm5gXu7o90uhQbm+k+NsbdEyLSLxHLEHEm9WobZom9Ei7BZDl9c
 /1nYUalPnU05xCS319MPW/6aSEbuUiTp8xjRC7+9d4S2n/lePMAI6ukutVEe3U4p
 DKsPrk78gy2tkpLhD6NiCfC8qTPCoXAZLmjYN45cEjYWP3NehpKjBzHAeS7IJdgP
 35Z7rOjAGgGuc8nyVAXiwZb/vrT1NuwCF1CMQe350UAYdp3WQu3QCRBJScGdwDUz
 k9UyvasUOdqgiQsM2A5/2lV/7E2XdrtnKpGwM7/vw/Aevv7vxBftclZb1NmVBZmm
 CbZFy0cX77ZgWaNS3fuQ
 =gIDP
 -----END PGP SIGNATURE-----

Merge tag 'qcom-arm64-defconfig-for-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux into next/arm64

Qualcomm ARM64 Based defconfig Updates for v4.8

* Enable PM8xxx pwrkey support
* Enable MSM8996 support

* tag 'qcom-arm64-defconfig-for-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux:
  arm64: defconfig: enable msm8996 pinctrl support
  arm64: defconfig: Enable qcom msm8996 clk drivers
  arm: defconfig: Enable PM8941 pwr key

Signed-off-by: Olof Johansson <olof@lixom.net>
2016-07-04 22:23:23 -07:00
Olof Johansson
e124174e4c ARMv8 Juno/Vexpress defconfig updates for v4.8
1. Enable support for SCPI based sensors(temperature, voltage,
    current and power)
 
 2. Enable the Generic on-chip SRAM driver. SRAM is used for SCPI based
    communication with SCP on Juno
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABCAAGBQJXaQ0ZAAoJEABBurwxfuKYmooP/3VSLhrpD7gxtyNrfCxTge4O
 3w3wvFtNrdvsce3nGZzdtcUs+G6iqj69rjwcTzfGMiLBmS2oD+LTfKYAF46JWgE7
 KqHBPhUAz0d9UgfGWyLF8YEneTZ9TM6Gb6/3DFNE5zIIW1JlQBAkN61U1SYFw6JO
 JPM1RbmA51cSosdS0woFZpQ391QwwXLIKkMCQWeWuK6qCjmtMKTAynEgmCXfoejX
 Y2mdeTx0rsXDQsZIsX3Z65cKpd5M8FtN8hCoFm4hDTdMOVVX+aDhlzdk+CRsJWa7
 2pXpUDqdwH1NPOikQqVwzhTizUur6IbXXYNO2V6k/M/HqplqVpuxpu+B90nvjoDo
 UrswqKaJKjh29pRynkWVYGUggC6dQFN31lecEQMEPYk4FVifgwW7dOx3cekVvs67
 wEjBCG2tbL5DkZOLe1s2f22bJQUItEb2Rwzya+o05l6y8ehxzdz/uUyagikPrqJO
 ihCwTqsp/UOREaVUvAGrO3Av3FYcyx1fkN1GGYqsoyUPQognrMEsjBQGvRrmixHB
 Ps4/kd89jJWaCpFMJYf5t0M1lSHGEN5esgSqnG01Pg7oOy2qqt6gNzVyTbH2tnXE
 KvguBriCPIeE7TXQHb0Swep7nufXuTHvYoNQJxfa8oiqoyijlY1Bt3pLE67ST8xE
 Rh1wTtONBqDNLtXoL3sm
 =r5Ie
 -----END PGP SIGNATURE-----

Merge tag 'juno-defconfig-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into next/arm64

ARMv8 Juno/Vexpress defconfig updates for v4.8

1. Enable support for SCPI based sensors(temperature, voltage,
   current and power)

2. Enable the Generic on-chip SRAM driver. SRAM is used for SCPI based
   communication with SCP on Juno

* tag 'juno-defconfig-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux:
  arm64: defconfig: enable SENSORS_ARM_SCPI
  arm64: defconfig: enable Generic on-chip SRAM driver

Signed-off-by: Olof Johansson <olof@lixom.net>
2016-07-04 21:32:49 -07:00
Olof Johansson
f88cbd2ef9 mvebu defconfig64 for 4.8 (part 1)
- Enable the PCIe host controller found on the Armada 7K/8K SoCs
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iEYEABECAAYFAldpA7YACgkQCwYYjhRyO9UpFwCgoVM2L6jaF0AU9Yg+aR8xeHrF
 5xUAnRCe8B0TYqE0Bucj+MwmKXbWTLU7
 =sEoy
 -----END PGP SIGNATURE-----

Merge tag 'mvebu-defconfig64-4.8-1' of git://git.infradead.org/linux-mvebu into next/arm64

mvebu defconfig64 for 4.8 (part 1)

- Enable the PCIe host controller found on the Armada 7K/8K SoCs

* tag 'mvebu-defconfig64-4.8-1' of git://git.infradead.org/linux-mvebu:
  arm64: configs: enable PCIe driver for Armada 7K/8K

Signed-off-by: Olof Johansson <olof@lixom.net>
2016-07-04 20:38:48 -07:00
Gregory CLEMENT
ff60d834d1 arm64: marvell: enable Armada 3700 clock drivers
This patch enables the support for the clocks drivers used on the
Armada 3700.

Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
2016-07-04 22:18:06 +02:00
Srinivas Kandagatla
f1a176f25a arm64: defconfig: enable msm8996 pinctrl support
This patch enables pinctrl support required to boot msm8996/apq8096
boards.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
2016-06-24 22:36:33 -05:00
Stephen Boyd
28f049df25 arm64: defconfig: Enable qcom msm8996 clk drivers
Enable the clk drivers on msm8996. This allows us to boot and
test most device drivers on this SoC.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
2016-06-24 22:36:33 -05:00
Andy Gross
fde88a0715 arm: defconfig: Enable PM8941 pwr key
This patch enables the PM8941 pwr key driver.

Signed-off-by: Andy Gross <andy.gross@linaro.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2016-06-24 22:36:33 -05:00
Kevin Hilman
72557a658a arm64: defconfig: enable stmmac and realtek PHY as modules
Some Amlogic GXBB boards use the stmmac ethernet driver.  Also, enable
the realtek PHY used on meson-gxbb-odroidc2.  The micrel PHY used on the
meson-gxbb-p20x boards is already enabled.

Signed-off-by: Kevin Hilman <khilman@baylibre.com>
2016-06-23 16:53:37 -07:00
Sudeep Holla
8da7cc087b arm64: Kconfig: select PM{,_GENERIC_DOMAINS} for ARCH_VEXPRESS
The Linux AMBA bus framework probes the peripheral IDs when adding the
AMBA devices very early on the boot. Generally they are on APB bus and
just require APB clocks to be on even when most of the core logic of the
IP is powered down.

However on Juno, the entire debugsys domain needs to be ON to access
even the coresight components' CID/PID registers and hence broken by
design. Accessing those while debugsys power domain is off will lead to
the bridge stalling the transactions instead of returning the slave error.

Further, the AMBA framework can't deal with !CONFIG_PM_GENERIC_DOMAINS
case: it ignores the error and proceeds to access the device region.
It was suggested to always enable CONFIG_PM{,_GENERIC_DOMAINS} in order
to handle above explained scenario.

Cc: Arnd Bergmann <arnd@arndb.de>
Suggested-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
2016-06-20 22:59:54 -07:00
Javi Merino
2a0e527c7e arm64: defconfig: enable SENSORS_ARM_SCPI
ARM SCPI Sensors were merged for v4.4 and they are defined in the Juno
dts.  Enable it in the defconfig to get them registered automatically in
Juno by default.

Signed-off-by: Javi Merino <javi.merino@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2016-06-20 16:45:30 +01:00
Sudeep Holla
71ee68a8e7 arm64: defconfig: enable Generic on-chip SRAM driver
Most of the ARM SoCs have small SRAM memory used for various purposes
that require faster access to data compared to normal DDR.

This patch enables the Generic on-chip SRAM driver on ARM64.

Cc: Kevin Hilman <khilman@kernel.org>
Cc: Olof Johansson <olof@lixom.net>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2016-06-20 16:44:18 +01:00
Olof Johansson
cfa999ef5b This pull request contains SoC changes for Broadcom ARM64-based SoCs:
- Kamlakant updates the Broadcom Vulcan Kconfig entry with GPIOLIB to enable
   GPIO on these platforms
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJXY1ZeAAoJEIfQlpxEBwcEtosP/1DjcxRFQrpVmOkLyMU6lR9h
 gTbV47sRNIw+kWSGU6yqtWfQybIUI3CDdQOZFcsYc4rd26YpSO9cszB2dYjoC3a+
 11xJPj2MjUdIyNEBHC8LuN1X+SZKxVvgcXD9rJ3GEKHbFW5vwKXfM0TFBOQClWME
 2YE5Ucr+LE4CmXzPiw16lqsdaU33ea5ZKwk6+RXJHxBNTGiYe7mEZ7FJuAsX/dzd
 pzqk3VgrpmhxHrWLfDyDfogR5dz+FrfX7acw4IfFyLwTK9LC/B7luG/lfnO622Ym
 xJ+1dRnB/qj1TcO8hQtZck+rEZbL9yerQ+Lh3MTrZEUVbBTIXQ0NWP57xvSL3Zge
 VfspJTgyxfLIpiiHVCbPmA+tCIogm1PKN8JRH+YVUgR67MAEWkt7JACgrMUrHwY4
 aXVNnDcfPglqJrA/K7o5kpKSgkVSTDL2Wq5t9ao8PrURVNfag0nk3c+nzhkQCtmZ
 2NmvisYRvCSkXww3cGlLiZs5CM4PLQ+UX2Ao/3j5H3DHqeYM9LqMBzPj21Z+G0Rr
 SH/XdoLlW0dLoA8FoGqBCsXXsMOWaY8hF+LFTiFcInoYsxxeezb7ILOASZk1MZng
 b27yX/9JY94AFqEH2AQWrTOf52ou7UcoV4PL+IHOALhA5ATXIbxWVUul8MW+dUHO
 aMRkaGRScNUTO7CmEwjg
 =MnRp
 -----END PGP SIGNATURE-----

Merge tag 'arm-soc/for-4.8/soc-arm64' of http://github.com/Broadcom/stblinux into next/arm64

This pull request contains SoC changes for Broadcom ARM64-based SoCs:

- Kamlakant updates the Broadcom Vulcan Kconfig entry with GPIOLIB to enable
  GPIO on these platforms

* tag 'arm-soc/for-4.8/soc-arm64' of http://github.com/Broadcom/stblinux:
  arm64: vulcan: enable GPIOLIB in Kconfig

Signed-off-by: Olof Johansson <olof@lixom.net>
2016-06-19 22:43:50 -07:00
Thomas Petazzoni
4cf28937ca arm64: configs: enable PCIe driver for Armada 7K/8K
This patch enables the driver for the PCIe host controller found on
the Marvell Armada 7K/8K ARM64 SoCs.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
2016-06-16 17:08:50 +02:00
Eric Anholt
628d30d1cc arm64: Add platform selection for BCM2835.
Signed-off-by: Eric Anholt <eric@anholt.net>
[ kraxel: copy some selects from arm to arm64 ]
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
2016-06-15 14:10:30 -07:00
Eric Anholt
a8e76509ce Merge remote-tracking branch 'irqchip/irqchip/bcm' into bcm2835-arm64-next
Bring in the build fix for arm64 before we add BCM2835 arm64 to
Kconfig/Makefiles.
2016-06-14 23:40:34 -07:00
Olof Johansson
97e80da315 Amlogic SoC changes for v4.8
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABCAAGBQJXUcY0AAoJEFk3GJrT+8ZlGUsP+wdX5d96MDcm+zOBNHpdNorQ
 A/fk1cSXHDk91ya0sRf6ktybrltthJL1NuntX1iKpyvlhTh7QFrZaInxm1HvwQAI
 g/bRi44G6BN2goVn8gUU1ErPIejYMTjLMfGjBhkGwzwxbx0wi39Z0aQjaapJ2xlU
 oyGV3hqrSMeAyKCuyCjo1QrODWr7vyDWcnY5cfIYR6KAX3LUPA2A2j3EwTOlRi3h
 meOE/ZWiFAVO6eOZCQnOZOVVRoxcWJMwEEp4uWALmL4xBsg4pHrfA1RKOb7tCPzl
 5qQ68+8OOG3FbiNd+0SJ2LXLrAajknW6Jvvx5GrM1NzopR3ZCqQRTgMLXq3PQa1M
 BMkZ80+D3wVJdJPLPhU0eE2mPPy+0RcjDmGUhgk0B8vJeVVtitJ4BbSfKI3svSdl
 0gNxuIFZ00fUkDIiO4A1J1rpTUEja1gOTjY9zKlkH7UN4uykKTdUEmFwUwAPubjU
 TmgGzXPEXn+LmeyoawbkOQ4NM1Z1E1V/WjlwmBEWjKbxM6lZC2eRIFfq5Ss5WJ3F
 whI9GWXoDh8EB1FiwSf2RDb4GOiYgrblmYbNrZRa7qGHD5E+zOh8n1z+zdC1OCDA
 W0nKcKE8lL44QnW4XDIwCtPV6YB4ycU1Ns9yUd/sYoZzHtk6Rc0m0goLxX1FYNiU
 t2jCOnJZUH7HXxk2NAAs
 =usWW
 -----END PGP SIGNATURE-----

Merge tag 'amlogic-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic into next/arm64

Amlogic SoC changes for v4.8

* tag 'amlogic-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic:
  ARM64: Kconfig: Select the Amlogic Meson pin controller driver

Signed-off-by: Olof Johansson <olof@lixom.net>
2016-06-14 10:31:31 -07:00
Ard Biesheuvel
16740e7f89 arm64: defconfig: disable plain NEON implementation of AES
The plain NEON implementation of AES is only suited for v8 cores that lack
the ARMv8 Crypto Extensions but have an implementation of the NEON tbl/tbx
instruction that is not pathetically slow. Unfortunately, this is currently
the empty set, so there is no point in including this implementation by
default. So disable it.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Olof Johansson <olof@lixom.net>
2016-06-14 10:28:27 -07:00
Olof Johansson
087eb3167d Samsung arm64 update for v4.8:
1. Select drivers/soc/samsung.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJXVWESAAoJEME3ZuaGi4PX5ZEP/3I6KS+bFH6hANtrnx/PxmI6
 FMzldAUaMcO/72/qe+cQ36JIBWy4Mo6cOkDVV0GMJ5NQAJmespSLSHPmAAYEk62c
 zYErvmr9+FZiKsDARintUB4/FMdVnBvti7lUd39QBC/1vbfxtXyET7Jes3zvclsJ
 UMJbshVAFDjXydfffDAxT0MLavQfR4f9AclAZUrv/N3eWA0xUu/PIJYkI93CAjqY
 AjNSj/PtgxZJsmJ4E+RRq+nvqicNAVV5ZTN+/v5Qk7tOHK/p7+Y0h+btgIG6UgZV
 tR4ZA1M+H8ppxTRqZuGMn9UsPMGnHMJ2tzgX5i9cXj7RQ4AaKjfv/bFUkhzxx2LH
 awWB4pO1ureoeq8i/60KO4X7kotlweHF14crDOMSqqH/Epkkkp/DSyIzY5ki2qUq
 jqOfdxsOBcxZttXmwykHjjy7/to52c5lnZ2XpgETYV4RkxAFO0MXQ+BBVQJ5Fsys
 Sbgm+wiF8Zawg6bS3ZfCbHbg9tRnMmrhm8iPb8qre4DIwohBUx44s2EUBFOi9VyV
 /3p+rlkcvXnm1HAuWR7nbK4XrRiYSz6Dqc+6fq3kQvgrzzuY3sT3A80d2/S3Dlo4
 NRgLD5dYiWtaCQ1OS/yhvm0sEya/2mXtFHmQsEumhBycFBVRuQWdcZYrV1OMDf7Y
 3q+0+fn7oOHy8QucAazo
 =mZFG
 -----END PGP SIGNATURE-----

Merge tag 'samsung-soc64-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into next/arm64

Samsung arm64 update for v4.8:
1. Select drivers/soc/samsung.

* tag 'samsung-soc64-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux:
  arm64: exynos: Select SOC specific drivers

Signed-off-by: Olof Johansson <olof@lixom.net>
2016-06-13 14:25:18 -07:00
Alexander Graf
1a9a0536d8 arm64: Allow for different DMA and CPU bus offsets
On arm64, all SoCs we supported so far either have an IOMMU or have bus
addresses equal to CPU addresses.

However, with the Raspberry Pi 3 coming up, this is no longer true. To
allow DMA to work with an AArch64 kernel on those devices, let's allow
devices to have DMA offsets again.

Signed-off-by: Alexander Graf <agraf@suse.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2016-06-06 13:48:54 -07:00
Takeshi Kihara
62bcf90871 arm64: defconfig: enable Renesas R8A7796 SoC
This patch enables the Renesas R8A7796 SoC in the arm64 defconfig.

Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
2016-06-06 10:26:04 +09:00
Eric Anholt
d7e3528eed irqchip: bcm2835: Avoid arch/arm-specific handle_IRQ
With commit

  76ba59f836 genirq: Add irq_domain-aware core IRQ handler

architecture-specific irq handlers are no longer necessary.  Update the bcm2835
irq driver to use the core irq handler.  As a bonus, this allows the driver to
support arm64 as well.

Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Link: https://lkml.kernel.org/r/1464728727-16300-1-git-send-email-eric@anholt.net
[jac reworded commit message for clarity]
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
2016-06-04 14:16:59 +00:00
Chanho Min
ad763ee761 arm64: defconfig: Enable Cadence MACB/GEM support
This patch enables the cadence MACB/GEM support that is needed
by lg1k SoCs.

Signed-off-by: Chanho Min <chanho.min@lge.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
2016-06-03 12:22:50 -07:00
Carlo Caione
bf56c7762d ARM64: Kconfig: Select the Amlogic Meson pin controller driver
Select the Meson pin controller driver also for the AArch64 Meson
platform.

Signed-off-by: Carlo Caione <carlo@endlessm.com>
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
2016-06-01 10:55:05 -07:00
Kamlakant Patel
9c7a680175 arm64: vulcan: enable GPIOLIB in Kconfig
Add select GPIOLIB in Kconfig for Broadcom Vulcan ARM64 GPIO driver.

Signed-off-by: Kamlakant Patel <kamlakant.patel@broadcom.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
2016-05-31 10:52:25 -07:00
Krzysztof Kozlowski
3b3428e384 arm64: exynos: Select SOC specific drivers
Recently some Exynos drivers were moved from arm/mach-exynos to
drivers/soc. Building the directory depends on SOC_SAMSUNG Kconfig
option so we want it also on ARMv8 platforms, even though none of the
drivers support ARMv8 SoCs yet.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
2016-05-30 08:44:33 +02:00
Linus Torvalds
1a695a905c Linux 4.7-rc1 2016-05-29 09:29:24 -07:00
George Spelvin
e0ab7af9bd hash_string: Fix zero-length case for !DCACHE_WORD_ACCESS
The self-test was updated to cover zero-length strings; the function
needs to be updated, too.

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: George Spelvin <linux@sciencehorizons.net>
Fixes: fcfd2fbf22 ("fs/namei.c: Add hashlen_string() function")
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-05-29 07:33:47 -07:00
George Spelvin
f2a031b66e Rename other copy of hash_string to hashlen_string
The original name was simply hash_string(), but that conflicted with a
function with that name in drivers/base/power/trace.c, and I decided
that calling it "hashlen_" was better anyway.

But you have to do it in two places.

[ This caused build errors for architectures that don't define
  CONFIG_DCACHE_WORD_ACCESS   - Linus ]

Signed-off-by: George Spelvin <linux@sciencehorizons.net>
Reported-by: Guenter Roeck <linux@roeck-us.net>
Fixes: fcfd2fbf22 ("fs/namei.c: Add hashlen_string() function")
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-05-28 22:34:33 -07:00
Mikulas Patocka
037369b872 hpfs: implement the show_options method
The HPFS filesystem used generic_show_options to produce string that is
displayed in /proc/mounts.  However, there is a problem that the options
may disappear after remount.  If we mount the filesystem with option1
and then remount it with option2, /proc/mounts should show both option1
and option2, however it only shows option2 because the whole option
string is replaced with replace_mount_options in hpfs_remount_fs.

To fix this bug, implement the hpfs_show_options function that prints
options that are currently selected.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-05-28 16:50:24 -07:00
Mikulas Patocka
01d6e08711 affs: fix remount failure when there are no options changed
Commit c8f33d0bec ("affs: kstrdup() memory handling") checks if the
kstrdup function returns NULL due to out-of-memory condition.

However, if we are remounting a filesystem with no change to
filesystem-specific options, the parameter data is NULL.  In this case,
kstrdup returns NULL (because it was passed NULL parameter), although no
out of memory condition exists.  The mount syscall then fails with
ENOMEM.

This patch fixes the bug.  We fail with ENOMEM only if data is non-NULL.

The patch also changes the call to replace_mount_options - if we didn't
pass any filesystem-specific options, we don't call
replace_mount_options (thus we don't erase existing reported options).

Fixes: c8f33d0bec ("affs: kstrdup() memory handling")
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@vger.kernel.org	# v4.1+
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-05-28 16:50:24 -07:00
Mikulas Patocka
44d51706b4 hpfs: fix remount failure when there are no options changed
Commit ce657611ba ("hpfs: kstrdup() out of memory handling") checks if
the kstrdup function returns NULL due to out-of-memory condition.

However, if we are remounting a filesystem with no change to
filesystem-specific options, the parameter data is NULL.  In this case,
kstrdup returns NULL (because it was passed NULL parameter), although no
out of memory condition exists.  The mount syscall then fails with
ENOMEM.

This patch fixes the bug.  We fail with ENOMEM only if data is non-NULL.

The patch also changes the call to replace_mount_options - if we didn't
pass any filesystem-specific options, we don't call
replace_mount_options (thus we don't erase existing reported options).

Fixes: ce657611ba ("hpfs: kstrdup() out of memory handling")
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-05-28 16:50:24 -07:00
Linus Torvalds
4029632c34 Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Pull more MIPS updates from Ralf Baechle:
 "This is the secondnd batch of MIPS patches for 4.7. Summary:

  CPS:
   - Copy EVA configuration when starting secondary VPs.

  EIC:
   - Clear Status IPL.

  Lasat:
   - Fix a few off by one bugs.

  lib:
   - Mark intrinsics notrace.  Not only are the intrinsics
     uninteresting, it would cause infinite recursion.

  MAINTAINERS:
   - Add file patterns for MIPS BRCM device tree bindings.
   - Add file patterns for mips device tree bindings.

  MT7628:
   - Fix MT7628 pinmux typos.
   - wled_an pinmux gpio.
   - EPHY LEDs pinmux support.

  Pistachio:
   - Enable KASLR

  VDSO:
   - Build microMIPS VDSO for microMIPS kernels.
   - Fix aliasing warning by building with `-fno-strict-aliasing' for
     debugging but also tracing them might result in recursion.

  Misc:
   - Add missing FROZEN hotplug notifier transitions.
   - Fix clk binding example for varioius PIC32 devices.
   - Fix cpu interrupt controller node-names in the DT files.
   - Fix XPA CPU feature separation.
   - Fix write_gc0_* macros when writing zero.
   - Add inline asm encoding helpers.
   - Add missing VZ accessor microMIPS encodings.
   - Fix little endian microMIPS MSA encodings.
   - Add 64-bit HTW fields and fix its configuration.
   - Fix sigreturn via VDSO on microMIPS kernel.
   - Lots of typo fixes.
   - Add definitions of SegCtl registers and use them"

* 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (49 commits)
  MIPS: Add missing FROZEN hotplug notifier transitions
  MIPS: Build microMIPS VDSO for microMIPS kernels
  MIPS: Fix sigreturn via VDSO on microMIPS kernel
  MIPS: devicetree: fix cpu interrupt controller node-names
  MIPS: VDSO: Build with `-fno-strict-aliasing'
  MIPS: Pistachio: Enable KASLR
  MIPS: lib: Mark intrinsics notrace
  MIPS: Fix 64-bit HTW configuration
  MIPS: Add 64-bit HTW fields
  MAINTAINERS: Add file patterns for mips device tree bindings
  MAINTAINERS: Add file patterns for mips brcm device tree bindings
  MIPS: Simplify DSP instruction encoding macros
  MIPS: Add missing tlbinvf/XPA microMIPS encodings
  MIPS: Fix little endian microMIPS MSA encodings
  MIPS: Add missing VZ accessor microMIPS encodings
  MIPS: Add inline asm encoding helpers
  MIPS: Spelling fix lets -> let's
  MIPS: VR41xx: Fix typo
  MIPS: oprofile: Fix typo
  MIPS: math-emu: Fix typo
  ...
2016-05-28 16:41:39 -07:00
Guenter Roeck
d66492bce1 fs: fix binfmt_aout.c build error
Various builds (such as i386:allmodconfig) fail with

  fs/binfmt_aout.c:133:2: error: expected identifier or '(' before 'return'
  fs/binfmt_aout.c:134:1: error: expected identifier or '(' before '}' token

[ Oops. My bad, I had stupidly thought that "allmodconfig" covered this
  on x86-64 too, but it obviously doesn't.  Egg on my face.  - Linus ]

Fixes: 5d22fc25d4 ("mm: remove more IS_ERR_VALUE abuses")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-05-28 16:34:59 -07:00
Linus Torvalds
7e0fb73c52 Merge branch 'hash' of git://ftp.sciencehorizons.net/linux
Pull string hash improvements from George Spelvin:
 "This series does several related things:

   - Makes the dcache hash (fs/namei.c) useful for general kernel use.

     (Thanks to Bruce for noticing the zero-length corner case)

   - Converts the string hashes in <linux/sunrpc/svcauth.h> to use the
     above.

   - Avoids 64-bit multiplies in hash_64() on 32-bit platforms.  Two
     32-bit multiplies will do well enough.

   - Rids the world of the bad hash multipliers in hash_32.

     This finishes the job started in commit 689de1d6ca ("Minimal
     fix-up of bad hashing behavior of hash_64()")

     The vast majority of Linux architectures have hardware support for
     32x32-bit multiply and so derive no benefit from "simplified"
     multipliers.

     The few processors that do not (68000, h8/300 and some models of
     Microblaze) have arch-specific implementations added.  Those
     patches are last in the series.

   - Overhauls the dcache hash mixing.

     The patch in commit 0fed3ac866 ("namei: Improve hash mixing if
     CONFIG_DCACHE_WORD_ACCESS") was an off-the-cuff suggestion.
     Replaced with a much more careful design that's simultaneously
     faster and better.  (My own invention, as there was noting suitable
     in the literature I could find.  Comments welcome!)

   - Modify the hash_name() loop to skip the initial HASH_MIX().  This
     would let us salt the hash if we ever wanted to.

   - Sort out partial_name_hash().

     The hash function is declared as using a long state, even though
     it's truncated to 32 bits at the end and the extra internal state
     contributes nothing to the result.  And some callers do odd things:

      - fs/hfs/string.c only allocates 32 bits of state
      - fs/hfsplus/unicode.c uses it to hash 16-bit unicode symbols not bytes

   - Modify bytemask_from_count to handle inputs of 1..sizeof(long)
     rather than 0..sizeof(long)-1.  This would simplify users other
     than full_name_hash"

  Special thanks to Bruce Fields for testing and finding bugs in v1.  (I
  learned some humbling lessons about "obviously correct" code.)

  On the arch-specific front, the m68k assembly has been tested in a
  standalone test harness, I've been in contact with the Microblaze
  maintainers who mostly don't care, as the hardware multiplier is never
  omitted in real-world applications, and I haven't heard anything from
  the H8/300 world"

* 'hash' of git://ftp.sciencehorizons.net/linux:
  h8300: Add <asm/hash.h>
  microblaze: Add <asm/hash.h>
  m68k: Add <asm/hash.h>
  <linux/hash.h>: Add support for architecture-specific functions
  fs/namei.c: Improve dcache hash function
  Eliminate bad hash multipliers from hash_32() and  hash_64()
  Change hash_64() return value to 32 bits
  <linux/sunrpc/svcauth.h>: Define hash_str() in terms of hashlen_string()
  fs/namei.c: Add hashlen_string() function
  Pull out string hash to <linux/stringhash.h>
2016-05-28 16:15:25 -07:00
George Spelvin
4684fe9530 h8300: Add <asm/hash.h>
This will improve the performance of hash_32() and hash_64(), but due
to complete lack of multi-bit shift instructions on H8, performance will
still be bad in surrounding code.

Designing H8-specific hash algorithms to work around that is a separate
project.  (But if the maintainers would like to get in touch...)

Signed-off-by: George Spelvin <linux@sciencehorizons.net>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: uclinux-h8-devel@lists.sourceforge.jp
2016-05-28 15:48:58 -04:00
George Spelvin
7b13277b68 microblaze: Add <asm/hash.h>
Microblaze is an FPGA soft core that can be configured various ways.

If it is configured without a multiplier, the standard __hash_32()
will require a call to __mulsi3, which is a slow software loop.

Instead, use a shift-and-add sequence for the constant multiply.
GCC knows how to do this, but it's not as clever as some.

Signed-off-by: George Spelvin <linux@sciencehorizons.net>
Cc: Alistair Francis <alistair.francis@xilinx.com>
Cc: Michal Simek <michal.simek@xilinx.com>
2016-05-28 15:48:58 -04:00
George Spelvin
14c44b95b3 m68k: Add <asm/hash.h>
This provides a multiply by constant GOLDEN_RATIO_32 = 0x61C88647
for the original mc68000, which lacks a 32x32-bit multiply instruction.

Yes, the amount of optimization effort put in is excessive. :-)

Shift-add chain found by Yevgen Voronenko's Hcub algorithm at
http://spiral.ece.cmu.edu/mcm/gen.html

Signed-off-by: George Spelvin <linux@sciencehorizons.net>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Greg Ungerer <gerg@linux-m68k.org>
Cc: Andreas Schwab <schwab@linux-m68k.org>
Cc: Philippe De Muyter <phdm@macq.eu>
Cc: linux-m68k@lists.linux-m68k.org
2016-05-28 15:48:57 -04:00
George Spelvin
468a942852 <linux/hash.h>: Add support for architecture-specific functions
This is just the infrastructure; there are no users yet.

This is modelled on CONFIG_ARCH_RANDOM; a CONFIG_ symbol declares
the existence of <asm/hash.h>.

That file may define its own versions of various functions, and define
HAVE_* symbols (no CONFIG_ prefix!) to suppress the generic ones.

Included is a self-test (in lib/test_hash.c) that verifies the basics.
It is NOT in general required that the arch-specific functions compute
the same thing as the generic, but if a HAVE_* symbol is defined with
the value 1, then equality is tested.

Signed-off-by: George Spelvin <linux@sciencehorizons.net>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Greg Ungerer <gerg@linux-m68k.org>
Cc: Andreas Schwab <schwab@linux-m68k.org>
Cc: Philippe De Muyter <phdm@macq.eu>
Cc: linux-m68k@lists.linux-m68k.org
Cc: Alistair Francis <alistai@xilinx.com>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: uclinux-h8-devel@lists.sourceforge.jp
2016-05-28 15:48:31 -04:00
George Spelvin
2a18da7a9c fs/namei.c: Improve dcache hash function
Patch 0fed3ac866 improved the hash mixing, but the function is slower
than necessary; there's a 7-instruction dependency chain (10 on x86)
each loop iteration.

Word-at-a-time access is a very tight loop (which is good, because
link_path_walk() is one of the hottest code paths in the entire kernel),
and the hash mixing function must not have a longer latency to avoid
slowing it down.

There do not appear to be any published fast hash functions that:
1) Operate on the input a word at a time, and
2) Don't need to know the length of the input beforehand, and
3) Have a single iterated mixing function, not needing conditional
   branches or unrolling to distinguish different loop iterations.

One of the algorithms which comes closest is Yann Collet's xxHash, but
that's two dependent multiplies per word, which is too much.

The key insights in this design are:

1) Barring expensive ops like multiplies, to diffuse one input bit
   across 64 bits of hash state takes at least log2(64) = 6 sequentially
   dependent instructions.  That is more cycles than we'd like.
2) An operation like "hash ^= hash << 13" requires a second temporary
   register anyway, and on a 2-operand machine like x86, it's three
   instructions.
3) A better use of a second register is to hold a two-word hash state.
   With careful design, no temporaries are needed at all, so it doesn't
   increase register pressure.  And this gets rid of register copying
   on 2-operand machines, so the code is smaller and faster.
4) Using two words of state weakens the requirement for one-round mixing;
   we now have two rounds of mixing before cancellation is possible.
5) A two-word hash state also allows operations on both halves to be
   done in parallel, so on a superscalar processor we get more mixing
   in fewer cycles.

I ended up using a mixing function inspired by the ChaCha and Speck
round functions.  It is 6 simple instructions and 3 cycles per iteration
(assuming multiply by 9 can be done by an "lea" instruction):

		x ^= *input++;
	y ^= x;	x = ROL(x, K1);
	x += y;	y = ROL(y, K2);
	y *= 9;

Not only is this reversible, two consecutive rounds are reversible:
if you are given the initial and final states, but not the intermediate
state, it is possible to compute both input words.  This means that at
least 3 words of input are required to create a collision.

(It also has the property, used by hash_name() to avoid a branch, that
it hashes all-zero to all-zero.)

The rotate constants K1 and K2 were found by experiment.  The search took
a sample of random initial states (I used 1023) and considered the effect
of flipping each of the 64 input bits on each of the 128 output bits two
rounds later.  Each of the 8192 pairs can be considered a biased coin, and
adding up the Shannon entropy of all of them produces a score.

The best-scoring shifts also did well in other tests (flipping bits in y,
trying 3 or 4 rounds of mixing, flipping all 64*63/2 pairs of input bits),
so the choice was made with the additional constraint that the sum of the
shifts is odd and not too close to the word size.

The final state is then folded into a 32-bit hash value by a less carefully
optimized multiply-based scheme.  This also has to be fast, as pathname
components tend to be short (the most common case is one iteration!), but
there's some room for latency, as there is a fair bit of intervening logic
before the hash value is used for anything.

(Performance verified with "bonnie++ -s 0 -n 1536:-2" on tmpfs.  I need
a better benchmark; the numbers seem to show a slight dip in performance
between 4.6.0 and this patch, but they're too noisy to quote.)

Special thanks to Bruce fields for diligent testing which uncovered a
nasty fencepost error in an earlier version of this patch.

[checkpatch.pl formatting complaints noted and respectfully disagreed with.]

Signed-off-by: George Spelvin <linux@sciencehorizons.net>
Tested-by: J. Bruce Fields <bfields@redhat.com>
2016-05-28 15:45:29 -04:00
George Spelvin
ef703f49a6 Eliminate bad hash multipliers from hash_32() and hash_64()
The "simplified" prime multipliers made very bad hash functions, so get rid
of them.  This completes the work of 689de1d6ca.

To avoid the inefficiency which was the motivation for the "simplified"
multipliers, hash_64() on 32-bit systems is changed to use a different
algorithm.  It makes two calls to hash_32() instead.

drivers/media/usb/dvb-usb-v2/af9015.c uses the old GOLDEN_RATIO_PRIME_32
for some horrible reason, so it inherits a copy of the old definition.

Signed-off-by: George Spelvin <linux@sciencehorizons.net>
Cc: Antti Palosaari <crope@iki.fi>
Cc: Mauro Carvalho Chehab <m.chehab@samsung.com>
2016-05-28 15:42:51 -04:00
George Spelvin
92d567740f Change hash_64() return value to 32 bits
That's all that's ever asked for, and it makes the return
type of hash_long() consistent.

It also allows (upcoming patch) an optimized implementation
of hash_64 on 32-bit machines.

I tried adding a BUILD_BUG_ON to ensure the number of bits requested
was never more than 32 (most callers use a compile-time constant), but
adding <linux/bug.h> to <linux/hash.h> breaks the tools/perf compiler
unless tools/perf/MANIFEST is updated, and understanding that code base
well enough to update it is too much trouble.  I did the rest of an
allyesconfig build with such a check, and nothing tripped.

Signed-off-by: George Spelvin <linux@sciencehorizons.net>
2016-05-28 15:42:51 -04:00
George Spelvin
917ea166f4 <linux/sunrpc/svcauth.h>: Define hash_str() in terms of hashlen_string()
Finally, the first use of previous two patches: eliminate the
separate ad-hoc string hash functions in the sunrpc code.

Now hash_str() is a wrapper around hash_string(), and hash_mem() is
likewise a wrapper around full_name_hash().

Note that sunrpc code *does* call hash_mem() with a zero length, which
is why the previous patch needed to handle that in full_name_hash().
(Thanks, Bruce, for finding that!)

This also eliminates the only caller of hash_long which asks for
more than 32 bits of output.

The comment about the quality of hashlen_string() and full_name_hash()
is jumping the gun by a few patches; they aren't very impressive now,
but will be improved greatly later in the series.

Signed-off-by: George Spelvin <linux@sciencehorizons.net>
Tested-by: J. Bruce Fields <bfields@redhat.com>
Acked-by: J. Bruce Fields <bfields@redhat.com>
Cc: Jeff Layton <jlayton@poochiereds.net>
Cc: linux-nfs@vger.kernel.org
2016-05-28 15:42:50 -04:00
George Spelvin
fcfd2fbf22 fs/namei.c: Add hashlen_string() function
We'd like to make more use of the highly-optimized dcache hash functions
throughout the kernel, rather than have every subsystem create its own,
and a function that hashes basic null-terminated strings is required
for that.

(The name is to emphasize that it returns both hash and length.)

It's actually useful in the dcache itself, specifically d_alloc_name().
Other uses in the next patch.

full_name_hash() is also tweaked to make it more generally useful:
1) Take a "char *" rather than "unsigned char *" argument, to
   be consistent with hash_name().
2) Handle zero-length inputs.  If we want more callers, we don't want
   to make them worry about corner cases.

Signed-off-by: George Spelvin <linux@sciencehorizons.net>
2016-05-28 15:42:50 -04:00
George Spelvin
f4bcbe792b Pull out string hash to <linux/stringhash.h>
... so they can be used without the rest of <linux/dcache.h>

The hashlen_* macros will make sense next patch.

Signed-off-by: George Spelvin <linux@sciencehorizons.net>
2016-05-28 15:42:40 -04:00
Linus Torvalds
4e8440b3b6 Merge branch 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
Pull i2c fix from Wolfram Sang:
 "A fix for a regression introduced yesterday.

  The regression didn't show up here locally because I did not have
  PAGE_POISONING enabled.  And buildbots discovered this only after it
  hit your tree.  Thanks to Dan for the quick response"

* 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
  i2c: dev: use after free in detach
2016-05-28 12:38:50 -07:00