diff options
517 files changed, 3635 insertions, 4683 deletions
diff --git a/.gitignore b/.gitignore index 8f5422cba6e2..2030c7a4d2f8 100644 --- a/.gitignore +++ b/.gitignore | |||
@@ -142,3 +142,6 @@ x509.genkey | |||
142 | 142 | ||
143 | # Kdevelop4 | 143 | # Kdevelop4 |
144 | *.kdev4 | 144 | *.kdev4 |
145 | |||
146 | # Clang's compilation database file | ||
147 | /compile_commands.json | ||
@@ -98,6 +98,7 @@ Jason Gunthorpe <jgg@ziepe.ca> <jgunthorpe@obsidianresearch.com> | |||
98 | Javi Merino <javi.merino@kernel.org> <javi.merino@arm.com> | 98 | Javi Merino <javi.merino@kernel.org> <javi.merino@arm.com> |
99 | <javier@osg.samsung.com> <javier.martinez@collabora.co.uk> | 99 | <javier@osg.samsung.com> <javier.martinez@collabora.co.uk> |
100 | Jean Tourrilhes <jt@hpl.hp.com> | 100 | Jean Tourrilhes <jt@hpl.hp.com> |
101 | <jean-philippe@linaro.org> <jean-philippe.brucker@arm.com> | ||
101 | Jeff Garzik <jgarzik@pretzel.yyz.us> | 102 | Jeff Garzik <jgarzik@pretzel.yyz.us> |
102 | Jeff Layton <jlayton@kernel.org> <jlayton@redhat.com> | 103 | Jeff Layton <jlayton@kernel.org> <jlayton@redhat.com> |
103 | Jeff Layton <jlayton@kernel.org> <jlayton@poochiereds.net> | 104 | Jeff Layton <jlayton@kernel.org> <jlayton@poochiereds.net> |
@@ -116,6 +117,7 @@ John Stultz <johnstul@us.ibm.com> | |||
116 | Juha Yrjola <at solidboot.com> | 117 | Juha Yrjola <at solidboot.com> |
117 | Juha Yrjola <juha.yrjola@nokia.com> | 118 | Juha Yrjola <juha.yrjola@nokia.com> |
118 | Juha Yrjola <juha.yrjola@solidboot.com> | 119 | Juha Yrjola <juha.yrjola@solidboot.com> |
120 | Julien Thierry <julien.thierry.kdev@gmail.com> <julien.thierry@arm.com> | ||
119 | Kay Sievers <kay.sievers@vrfy.org> | 121 | Kay Sievers <kay.sievers@vrfy.org> |
120 | Kenneth W Chen <kenneth.w.chen@intel.com> | 122 | Kenneth W Chen <kenneth.w.chen@intel.com> |
121 | Konstantin Khlebnikov <koct9i@gmail.com> <k.khlebnikov@samsung.com> | 123 | Konstantin Khlebnikov <koct9i@gmail.com> <k.khlebnikov@samsung.com> |
@@ -132,6 +134,7 @@ Linus Lüssing <linus.luessing@c0d3.blue> <linus.luessing@ascom.ch> | |||
132 | Li Yang <leoyang.li@nxp.com> <leo@zh-kernel.org> | 134 | Li Yang <leoyang.li@nxp.com> <leo@zh-kernel.org> |
133 | Li Yang <leoyang.li@nxp.com> <leoli@freescale.com> | 135 | Li Yang <leoyang.li@nxp.com> <leoli@freescale.com> |
134 | Maciej W. Rozycki <macro@mips.com> <macro@imgtec.com> | 136 | Maciej W. Rozycki <macro@mips.com> <macro@imgtec.com> |
137 | Marc Zyngier <maz@kernel.org> <marc.zyngier@arm.com> | ||
135 | Marcin Nowakowski <marcin.nowakowski@mips.com> <marcin.nowakowski@imgtec.com> | 138 | Marcin Nowakowski <marcin.nowakowski@mips.com> <marcin.nowakowski@imgtec.com> |
136 | Mark Brown <broonie@sirena.org.uk> | 139 | Mark Brown <broonie@sirena.org.uk> |
137 | Mark Yao <markyao0591@gmail.com> <mark.yao@rock-chips.com> | 140 | Mark Yao <markyao0591@gmail.com> <mark.yao@rock-chips.com> |
diff --git a/Documentation/PCI/pci-error-recovery.rst b/Documentation/PCI/pci-error-recovery.rst index 83db42092935..e5d450df06b4 100644 --- a/Documentation/PCI/pci-error-recovery.rst +++ b/Documentation/PCI/pci-error-recovery.rst | |||
@@ -403,7 +403,7 @@ That is, the recovery API only requires that: | |||
403 | .. note:: | 403 | .. note:: |
404 | 404 | ||
405 | Implementation details for the powerpc platform are discussed in | 405 | Implementation details for the powerpc platform are discussed in |
406 | the file Documentation/powerpc/eeh-pci-error-recovery.txt | 406 | the file Documentation/powerpc/eeh-pci-error-recovery.rst |
407 | 407 | ||
408 | As of this writing, there is a growing list of device drivers with | 408 | As of this writing, there is a growing list of device drivers with |
409 | patches implementing error recovery. Not all of these patches are in | 409 | patches implementing error recovery. Not all of these patches are in |
@@ -422,3 +422,6 @@ That is, the recovery API only requires that: | |||
422 | - drivers/net/cxgb3 | 422 | - drivers/net/cxgb3 |
423 | - drivers/net/s2io.c | 423 | - drivers/net/s2io.c |
424 | - drivers/net/qlge | 424 | - drivers/net/qlge |
425 | |||
426 | The End | ||
427 | ------- | ||
diff --git a/Documentation/RCU/rculist_nulls.txt b/Documentation/RCU/rculist_nulls.txt index 8151f0195f76..23f115dc87cf 100644 --- a/Documentation/RCU/rculist_nulls.txt +++ b/Documentation/RCU/rculist_nulls.txt | |||
@@ -1,7 +1,7 @@ | |||
1 | Using hlist_nulls to protect read-mostly linked lists and | 1 | Using hlist_nulls to protect read-mostly linked lists and |
2 | objects using SLAB_TYPESAFE_BY_RCU allocations. | 2 | objects using SLAB_TYPESAFE_BY_RCU allocations. |
3 | 3 | ||
4 | Please read the basics in Documentation/RCU/listRCU.txt | 4 | Please read the basics in Documentation/RCU/listRCU.rst |
5 | 5 | ||
6 | Using special makers (called 'nulls') is a convenient way | 6 | Using special makers (called 'nulls') is a convenient way |
7 | to solve following problem : | 7 | to solve following problem : |
diff --git a/Documentation/admin-guide/conf.py b/Documentation/admin-guide/conf.py deleted file mode 100644 index 86f738953799..000000000000 --- a/Documentation/admin-guide/conf.py +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | # -*- coding: utf-8; mode: python -*- | ||
2 | |||
3 | project = 'Linux Kernel User Documentation' | ||
4 | |||
5 | tags.add("subproject") | ||
6 | |||
7 | latex_documents = [ | ||
8 | ('index', 'linux-user.tex', 'Linux Kernel User Documentation', | ||
9 | 'The kernel development community', 'manual'), | ||
10 | ] | ||
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 46b826fcb5ad..7ccd158b3894 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt | |||
@@ -2545,7 +2545,7 @@ | |||
2545 | mem_encrypt=on: Activate SME | 2545 | mem_encrypt=on: Activate SME |
2546 | mem_encrypt=off: Do not activate SME | 2546 | mem_encrypt=off: Do not activate SME |
2547 | 2547 | ||
2548 | Refer to Documentation/virtual/kvm/amd-memory-encryption.rst | 2548 | Refer to Documentation/virt/kvm/amd-memory-encryption.rst |
2549 | for details on when memory encryption can be activated. | 2549 | for details on when memory encryption can be activated. |
2550 | 2550 | ||
2551 | mem_sleep_default= [SUSPEND] Default system suspend mode: | 2551 | mem_sleep_default= [SUSPEND] Default system suspend mode: |
diff --git a/Documentation/admin-guide/mm/transhuge.rst b/Documentation/admin-guide/mm/transhuge.rst index 7ab93a8404b9..bd5714547cee 100644 --- a/Documentation/admin-guide/mm/transhuge.rst +++ b/Documentation/admin-guide/mm/transhuge.rst | |||
@@ -53,7 +53,7 @@ disabled, there is ``khugepaged`` daemon that scans memory and | |||
53 | collapses sequences of basic pages into huge pages. | 53 | collapses sequences of basic pages into huge pages. |
54 | 54 | ||
55 | The THP behaviour is controlled via :ref:`sysfs <thp_sysfs>` | 55 | The THP behaviour is controlled via :ref:`sysfs <thp_sysfs>` |
56 | interface and using madivse(2) and prctl(2) system calls. | 56 | interface and using madvise(2) and prctl(2) system calls. |
57 | 57 | ||
58 | Transparent Hugepage Support maximizes the usefulness of free memory | 58 | Transparent Hugepage Support maximizes the usefulness of free memory |
59 | if compared to the reservation approach of hugetlbfs by allowing all | 59 | if compared to the reservation approach of hugetlbfs by allowing all |
diff --git a/Documentation/conf.py b/Documentation/conf.py index 3b2397bcb565..a8fe845832bc 100644 --- a/Documentation/conf.py +++ b/Documentation/conf.py | |||
@@ -16,6 +16,8 @@ import sys | |||
16 | import os | 16 | import os |
17 | import sphinx | 17 | import sphinx |
18 | 18 | ||
19 | from subprocess import check_output | ||
20 | |||
19 | # Get Sphinx version | 21 | # Get Sphinx version |
20 | major, minor, patch = sphinx.version_info[:3] | 22 | major, minor, patch = sphinx.version_info[:3] |
21 | 23 | ||
@@ -276,10 +278,21 @@ latex_elements = { | |||
276 | \\setsansfont{DejaVu Sans} | 278 | \\setsansfont{DejaVu Sans} |
277 | \\setromanfont{DejaVu Serif} | 279 | \\setromanfont{DejaVu Serif} |
278 | \\setmonofont{DejaVu Sans Mono} | 280 | \\setmonofont{DejaVu Sans Mono} |
279 | |||
280 | ''' | 281 | ''' |
281 | } | 282 | } |
282 | 283 | ||
284 | # At least one book (translations) may have Asian characters | ||
285 | # with are only displayed if xeCJK is used | ||
286 | |||
287 | cjk_cmd = check_output(['fc-list', '--format="%{family[0]}\n"']).decode('utf-8', 'ignore') | ||
288 | if cjk_cmd.find("Noto Sans CJK SC") >= 0: | ||
289 | print ("enabling CJK for LaTeX builder") | ||
290 | latex_elements['preamble'] += ''' | ||
291 | % This is needed for translations | ||
292 | \\usepackage{xeCJK} | ||
293 | \\setCJKmainfont{Noto Sans CJK SC} | ||
294 | ''' | ||
295 | |||
283 | # Fix reference escape troubles with Sphinx 1.4.x | 296 | # Fix reference escape troubles with Sphinx 1.4.x |
284 | if major == 1 and minor > 3: | 297 | if major == 1 and minor > 3: |
285 | latex_elements['preamble'] += '\\renewcommand*{\\DUrole}[2]{ #2 }\n' | 298 | latex_elements['preamble'] += '\\renewcommand*{\\DUrole}[2]{ #2 }\n' |
@@ -410,6 +423,21 @@ latex_documents = [ | |||
410 | 'The kernel development community', 'manual'), | 423 | 'The kernel development community', 'manual'), |
411 | ] | 424 | ] |
412 | 425 | ||
426 | # Add all other index files from Documentation/ subdirectories | ||
427 | for fn in os.listdir('.'): | ||
428 | doc = os.path.join(fn, "index") | ||
429 | if os.path.exists(doc + ".rst"): | ||
430 | has = False | ||
431 | for l in latex_documents: | ||
432 | if l[0] == doc: | ||
433 | has = True | ||
434 | break | ||
435 | if not has: | ||
436 | latex_documents.append((doc, fn + '.tex', | ||
437 | 'Linux %s Documentation' % fn.capitalize(), | ||
438 | 'The kernel development community', | ||
439 | 'manual')) | ||
440 | |||
413 | # The name of an image file (relative to this directory) to place at the top of | 441 | # The name of an image file (relative to this directory) to place at the top of |
414 | # the title page. | 442 | # the title page. |
415 | #latex_logo = None | 443 | #latex_logo = None |
diff --git a/Documentation/core-api/conf.py b/Documentation/core-api/conf.py deleted file mode 100644 index db1f7659f3da..000000000000 --- a/Documentation/core-api/conf.py +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | # -*- coding: utf-8; mode: python -*- | ||
2 | |||
3 | project = "Core-API Documentation" | ||
4 | |||
5 | tags.add("subproject") | ||
6 | |||
7 | latex_documents = [ | ||
8 | ('index', 'core-api.tex', project, | ||
9 | 'The kernel development community', 'manual'), | ||
10 | ] | ||
diff --git a/Documentation/crypto/conf.py b/Documentation/crypto/conf.py deleted file mode 100644 index 4335d251ddf3..000000000000 --- a/Documentation/crypto/conf.py +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | # -*- coding: utf-8; mode: python -*- | ||
2 | |||
3 | project = 'Linux Kernel Crypto API' | ||
4 | |||
5 | tags.add("subproject") | ||
6 | |||
7 | latex_documents = [ | ||
8 | ('index', 'crypto-api.tex', 'Linux Kernel Crypto API manual', | ||
9 | 'The kernel development community', 'manual'), | ||
10 | ] | ||
diff --git a/Documentation/dev-tools/conf.py b/Documentation/dev-tools/conf.py deleted file mode 100644 index 7faafa3f7888..000000000000 --- a/Documentation/dev-tools/conf.py +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | # -*- coding: utf-8; mode: python -*- | ||
2 | |||
3 | project = "Development tools for the kernel" | ||
4 | |||
5 | tags.add("subproject") | ||
6 | |||
7 | latex_documents = [ | ||
8 | ('index', 'dev-tools.tex', project, | ||
9 | 'The kernel development community', 'manual'), | ||
10 | ] | ||
diff --git a/Documentation/devicetree/bindings/arm/idle-states.txt b/Documentation/devicetree/bindings/arm/idle-states.txt index 326f29b270ad..2d325bed37e5 100644 --- a/Documentation/devicetree/bindings/arm/idle-states.txt +++ b/Documentation/devicetree/bindings/arm/idle-states.txt | |||
@@ -703,4 +703,4 @@ cpus { | |||
703 | https://www.devicetree.org/specifications/ | 703 | https://www.devicetree.org/specifications/ |
704 | 704 | ||
705 | [6] ARM Linux Kernel documentation - Booting AArch64 Linux | 705 | [6] ARM Linux Kernel documentation - Booting AArch64 Linux |
706 | Documentation/arm64/booting.txt | 706 | Documentation/arm64/booting.rst |
diff --git a/Documentation/devicetree/bindings/arm/renesas.yaml b/Documentation/devicetree/bindings/arm/renesas.yaml index 08c923f8c257..28eb458f761a 100644 --- a/Documentation/devicetree/bindings/arm/renesas.yaml +++ b/Documentation/devicetree/bindings/arm/renesas.yaml | |||
@@ -1,7 +1,7 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0 | 1 | # SPDX-License-Identifier: GPL-2.0 |
2 | %YAML 1.2 | 2 | %YAML 1.2 |
3 | --- | 3 | --- |
4 | $id: http://devicetree.org/schemas/arm/shmobile.yaml# | 4 | $id: http://devicetree.org/schemas/arm/renesas.yaml# |
5 | $schema: http://devicetree.org/meta-schemas/core.yaml# | 5 | $schema: http://devicetree.org/meta-schemas/core.yaml# |
6 | 6 | ||
7 | title: Renesas SH-Mobile, R-Mobile, and R-Car Platform Device Tree Bindings | 7 | title: Renesas SH-Mobile, R-Mobile, and R-Car Platform Device Tree Bindings |
diff --git a/Documentation/devicetree/bindings/arm/socionext/milbeaut.yaml b/Documentation/devicetree/bindings/arm/socionext/milbeaut.yaml index aae53fc3cb1e..2bd519d2e855 100644 --- a/Documentation/devicetree/bindings/arm/socionext/milbeaut.yaml +++ b/Documentation/devicetree/bindings/arm/socionext/milbeaut.yaml | |||
@@ -1,7 +1,7 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0 | 1 | # SPDX-License-Identifier: GPL-2.0 |
2 | %YAML 1.2 | 2 | %YAML 1.2 |
3 | --- | 3 | --- |
4 | $id: http://devicetree.org/schemas/arm/milbeaut.yaml# | 4 | $id: http://devicetree.org/schemas/arm/socionext/milbeaut.yaml# |
5 | $schema: http://devicetree.org/meta-schemas/core.yaml# | 5 | $schema: http://devicetree.org/meta-schemas/core.yaml# |
6 | 6 | ||
7 | title: Milbeaut platforms device tree bindings | 7 | title: Milbeaut platforms device tree bindings |
diff --git a/Documentation/devicetree/bindings/arm/ti/ti,davinci.yaml b/Documentation/devicetree/bindings/arm/ti/ti,davinci.yaml index 4326d2cfa15d..a8765ba29476 100644 --- a/Documentation/devicetree/bindings/arm/ti/ti,davinci.yaml +++ b/Documentation/devicetree/bindings/arm/ti/ti,davinci.yaml | |||
@@ -1,7 +1,7 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0 | 1 | # SPDX-License-Identifier: GPL-2.0 |
2 | %YAML 1.2 | 2 | %YAML 1.2 |
3 | --- | 3 | --- |
4 | $id: http://devicetree.org/schemas/arm/ti/davinci.yaml# | 4 | $id: http://devicetree.org/schemas/arm/ti/ti,davinci.yaml# |
5 | $schema: http://devicetree.org/meta-schemas/core.yaml# | 5 | $schema: http://devicetree.org/meta-schemas/core.yaml# |
6 | 6 | ||
7 | title: Texas Instruments DaVinci Platforms Device Tree Bindings | 7 | title: Texas Instruments DaVinci Platforms Device Tree Bindings |
diff --git a/Documentation/devicetree/bindings/clock/allwinner,sun4i-a10-ccu.yaml b/Documentation/devicetree/bindings/clock/allwinner,sun4i-a10-ccu.yaml index c935405458fe..fa4d143a73de 100644 --- a/Documentation/devicetree/bindings/clock/allwinner,sun4i-a10-ccu.yaml +++ b/Documentation/devicetree/bindings/clock/allwinner,sun4i-a10-ccu.yaml | |||
@@ -1,7 +1,7 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0 | 1 | # SPDX-License-Identifier: GPL-2.0 |
2 | %YAML 1.2 | 2 | %YAML 1.2 |
3 | --- | 3 | --- |
4 | $id: http://devicetree.org/schemas/phy/allwinner,sun4i-a10-ccu.yaml# | 4 | $id: http://devicetree.org/schemas/clock/allwinner,sun4i-a10-ccu.yaml# |
5 | $schema: http://devicetree.org/meta-schemas/core.yaml# | 5 | $schema: http://devicetree.org/meta-schemas/core.yaml# |
6 | 6 | ||
7 | title: Allwinner Clock Control Unit Device Tree Bindings | 7 | title: Allwinner Clock Control Unit Device Tree Bindings |
diff --git a/Documentation/devicetree/bindings/firmware/intel,ixp4xx-network-processing-engine.yaml b/Documentation/devicetree/bindings/firmware/intel,ixp4xx-network-processing-engine.yaml index 8cb136c376fb..4f0db8ee226a 100644 --- a/Documentation/devicetree/bindings/firmware/intel,ixp4xx-network-processing-engine.yaml +++ b/Documentation/devicetree/bindings/firmware/intel,ixp4xx-network-processing-engine.yaml | |||
@@ -2,7 +2,7 @@ | |||
2 | # Copyright 2019 Linaro Ltd. | 2 | # Copyright 2019 Linaro Ltd. |
3 | %YAML 1.2 | 3 | %YAML 1.2 |
4 | --- | 4 | --- |
5 | $id: "http://devicetree.org/schemas/firmware/intel-ixp4xx-network-processing-engine.yaml#" | 5 | $id: "http://devicetree.org/schemas/firmware/intel,ixp4xx-network-processing-engine.yaml#" |
6 | $schema: "http://devicetree.org/meta-schemas/core.yaml#" | 6 | $schema: "http://devicetree.org/meta-schemas/core.yaml#" |
7 | 7 | ||
8 | title: Intel IXP4xx Network Processing Engine | 8 | title: Intel IXP4xx Network Processing Engine |
diff --git a/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml b/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml index 7ba167e2e1ea..c602b6fe1c0c 100644 --- a/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml +++ b/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml | |||
@@ -1,7 +1,7 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0 | 1 | # SPDX-License-Identifier: GPL-2.0 |
2 | %YAML 1.2 | 2 | %YAML 1.2 |
3 | --- | 3 | --- |
4 | $id: http://devicetree.org/schemas/iio/accelerometers/adi,adxl345.yaml# | 4 | $id: http://devicetree.org/schemas/iio/accel/adi,adxl345.yaml# |
5 | $schema: http://devicetree.org/meta-schemas/core.yaml# | 5 | $schema: http://devicetree.org/meta-schemas/core.yaml# |
6 | 6 | ||
7 | title: Analog Devices ADXL345/ADXL375 3-Axis Digital Accelerometers | 7 | title: Analog Devices ADXL345/ADXL375 3-Axis Digital Accelerometers |
diff --git a/Documentation/devicetree/bindings/iio/accel/adi,adxl372.yaml b/Documentation/devicetree/bindings/iio/accel/adi,adxl372.yaml index a7fafb9bf5c6..e7daffec88d3 100644 --- a/Documentation/devicetree/bindings/iio/accel/adi,adxl372.yaml +++ b/Documentation/devicetree/bindings/iio/accel/adi,adxl372.yaml | |||
@@ -1,7 +1,7 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0 | 1 | # SPDX-License-Identifier: GPL-2.0 |
2 | %YAML 1.2 | 2 | %YAML 1.2 |
3 | --- | 3 | --- |
4 | $id: http://devicetree.org/schemas/iio/accelerometers/adi,adxl372.yaml# | 4 | $id: http://devicetree.org/schemas/iio/accel/adi,adxl372.yaml# |
5 | $schema: http://devicetree.org/meta-schemas/core.yaml# | 5 | $schema: http://devicetree.org/meta-schemas/core.yaml# |
6 | 6 | ||
7 | title: Analog Devices ADXL372 3-Axis, +/-(200g) Digital Accelerometer | 7 | title: Analog Devices ADXL372 3-Axis, +/-(200g) Digital Accelerometer |
diff --git a/Documentation/devicetree/bindings/interrupt-controller/amazon,al-fic.txt b/Documentation/devicetree/bindings/interrupt-controller/amazon,al-fic.txt index 4e82fd575cec..c676b03c752e 100644 --- a/Documentation/devicetree/bindings/interrupt-controller/amazon,al-fic.txt +++ b/Documentation/devicetree/bindings/interrupt-controller/amazon,al-fic.txt | |||
@@ -5,21 +5,19 @@ Required properties: | |||
5 | - compatible: should be "amazon,al-fic" | 5 | - compatible: should be "amazon,al-fic" |
6 | - reg: physical base address and size of the registers | 6 | - reg: physical base address and size of the registers |
7 | - interrupt-controller: identifies the node as an interrupt controller | 7 | - interrupt-controller: identifies the node as an interrupt controller |
8 | - #interrupt-cells: must be 2. | 8 | - #interrupt-cells : must be 2. Specifies the number of cells needed to encode |
9 | First cell defines the index of the interrupt within the controller. | 9 | an interrupt source. Supported trigger types are low-to-high edge |
10 | Second cell is used to specify the trigger type and must be one of the | 10 | triggered and active high level-sensitive. |
11 | following: | ||
12 | - bits[3:0] trigger type and level flags | ||
13 | 1 = low-to-high edge triggered | ||
14 | 4 = active high level-sensitive | ||
15 | - interrupt-parent: specifies the parent interrupt controller. | ||
16 | - interrupts: describes which input line in the interrupt parent, this | 11 | - interrupts: describes which input line in the interrupt parent, this |
17 | fic's output is connected to. This field property depends on the parent's | 12 | fic's output is connected to. This field property depends on the parent's |
18 | binding | 13 | binding |
19 | 14 | ||
15 | Please refer to interrupts.txt in this directory for details of the common | ||
16 | Interrupt Controllers bindings used by client devices. | ||
17 | |||
20 | Example: | 18 | Example: |
21 | 19 | ||
22 | amazon_fic: interrupt-controller@0xfd8a8500 { | 20 | amazon_fic: interrupt-controller@fd8a8500 { |
23 | compatible = "amazon,al-fic"; | 21 | compatible = "amazon,al-fic"; |
24 | interrupt-controller; | 22 | interrupt-controller; |
25 | #interrupt-cells = <2>; | 23 | #interrupt-cells = <2>; |
diff --git a/Documentation/devicetree/bindings/interrupt-controller/intel,ixp4xx-interrupt.yaml b/Documentation/devicetree/bindings/interrupt-controller/intel,ixp4xx-interrupt.yaml index bae10e261fa9..507c141ea760 100644 --- a/Documentation/devicetree/bindings/interrupt-controller/intel,ixp4xx-interrupt.yaml +++ b/Documentation/devicetree/bindings/interrupt-controller/intel,ixp4xx-interrupt.yaml | |||
@@ -2,7 +2,7 @@ | |||
2 | # Copyright 2018 Linaro Ltd. | 2 | # Copyright 2018 Linaro Ltd. |
3 | %YAML 1.2 | 3 | %YAML 1.2 |
4 | --- | 4 | --- |
5 | $id: "http://devicetree.org/schemas/interrupt/intel-ixp4xx-interrupt.yaml#" | 5 | $id: "http://devicetree.org/schemas/interrupt-controller/intel,ixp4xx-interrupt.yaml#" |
6 | $schema: "http://devicetree.org/meta-schemas/core.yaml#" | 6 | $schema: "http://devicetree.org/meta-schemas/core.yaml#" |
7 | 7 | ||
8 | title: Intel IXP4xx XScale Networking Processors Interrupt Controller | 8 | title: Intel IXP4xx XScale Networking Processors Interrupt Controller |
diff --git a/Documentation/devicetree/bindings/misc/intel,ixp4xx-queue-manager.yaml b/Documentation/devicetree/bindings/misc/intel,ixp4xx-ahb-queue-manager.yaml index d2313b1d9405..0ea21a6f70b4 100644 --- a/Documentation/devicetree/bindings/misc/intel,ixp4xx-queue-manager.yaml +++ b/Documentation/devicetree/bindings/misc/intel,ixp4xx-ahb-queue-manager.yaml | |||
@@ -2,7 +2,7 @@ | |||
2 | # Copyright 2019 Linaro Ltd. | 2 | # Copyright 2019 Linaro Ltd. |
3 | %YAML 1.2 | 3 | %YAML 1.2 |
4 | --- | 4 | --- |
5 | $id: "http://devicetree.org/schemas/misc/intel-ixp4xx-ahb-queue-manager.yaml#" | 5 | $id: "http://devicetree.org/schemas/misc/intel,ixp4xx-ahb-queue-manager.yaml#" |
6 | $schema: "http://devicetree.org/meta-schemas/core.yaml#" | 6 | $schema: "http://devicetree.org/meta-schemas/core.yaml#" |
7 | 7 | ||
8 | title: Intel IXP4xx AHB Queue Manager | 8 | title: Intel IXP4xx AHB Queue Manager |
diff --git a/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml b/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml index d4084c149768..3fb0714e761e 100644 --- a/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml +++ b/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml | |||
@@ -1,7 +1,7 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0 | 1 | # SPDX-License-Identifier: GPL-2.0 |
2 | %YAML 1.2 | 2 | %YAML 1.2 |
3 | --- | 3 | --- |
4 | $id: http://devicetree.org/schemas/net/allwinner,sun8i-a83t-gmac.yaml# | 4 | $id: http://devicetree.org/schemas/net/allwinner,sun8i-a83t-emac.yaml# |
5 | $schema: http://devicetree.org/meta-schemas/core.yaml# | 5 | $schema: http://devicetree.org/meta-schemas/core.yaml# |
6 | 6 | ||
7 | title: Allwinner A83t EMAC Device Tree Bindings | 7 | title: Allwinner A83t EMAC Device Tree Bindings |
diff --git a/Documentation/devicetree/bindings/nvmem/allwinner,sun4i-a10-sid.yaml b/Documentation/devicetree/bindings/nvmem/allwinner,sun4i-a10-sid.yaml index c9efd6e2c134..1084e9d2917d 100644 --- a/Documentation/devicetree/bindings/nvmem/allwinner,sun4i-a10-sid.yaml +++ b/Documentation/devicetree/bindings/nvmem/allwinner,sun4i-a10-sid.yaml | |||
@@ -37,13 +37,13 @@ required: | |||
37 | 37 | ||
38 | examples: | 38 | examples: |
39 | - | | 39 | - | |
40 | sid@1c23800 { | 40 | efuse@1c23800 { |
41 | compatible = "allwinner,sun4i-a10-sid"; | 41 | compatible = "allwinner,sun4i-a10-sid"; |
42 | reg = <0x01c23800 0x10>; | 42 | reg = <0x01c23800 0x10>; |
43 | }; | 43 | }; |
44 | 44 | ||
45 | - | | 45 | - | |
46 | sid@1c23800 { | 46 | efuse@1c23800 { |
47 | compatible = "allwinner,sun7i-a20-sid"; | 47 | compatible = "allwinner,sun7i-a20-sid"; |
48 | reg = <0x01c23800 0x200>; | 48 | reg = <0x01c23800 0x200>; |
49 | }; | 49 | }; |
diff --git a/Documentation/devicetree/bindings/nvmem/nvmem-consumer.yaml b/Documentation/devicetree/bindings/nvmem/nvmem-consumer.yaml new file mode 100644 index 000000000000..b7c00ed31085 --- /dev/null +++ b/Documentation/devicetree/bindings/nvmem/nvmem-consumer.yaml | |||
@@ -0,0 +1,45 @@ | |||
1 | # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) | ||
2 | %YAML 1.2 | ||
3 | --- | ||
4 | $id: http://devicetree.org/schemas/nvmem/nvmem-consumer.yaml# | ||
5 | $schema: http://devicetree.org/meta-schemas/core.yaml# | ||
6 | |||
7 | title: NVMEM (Non Volatile Memory) Consumer Device Tree Bindings | ||
8 | |||
9 | maintainers: | ||
10 | - Srinivas Kandagatla <srinivas.kandagatla@linaro.org> | ||
11 | |||
12 | select: true | ||
13 | |||
14 | properties: | ||
15 | nvmem: | ||
16 | $ref: /schemas/types.yaml#/definitions/phandle-array | ||
17 | description: | ||
18 | List of phandle to the nvmem providers. | ||
19 | |||
20 | nvmem-cells: | ||
21 | $ref: /schemas/types.yaml#/definitions/phandle-array | ||
22 | description: | ||
23 | List of phandle to the nvmem data cells. | ||
24 | |||
25 | nvmem-names: | ||
26 | $ref: /schemas/types.yaml#/definitions/string-array | ||
27 | description: | ||
28 | Names for the each nvmem provider. | ||
29 | |||
30 | nvmem-cell-names: | ||
31 | $ref: /schemas/types.yaml#/definitions/string-array | ||
32 | description: | ||
33 | Names for each nvmem-cells specified. | ||
34 | |||
35 | dependencies: | ||
36 | nvmem-names: [ nvmem ] | ||
37 | nvmem-cell-names: [ nvmem-cells ] | ||
38 | |||
39 | examples: | ||
40 | - | | ||
41 | tsens { | ||
42 | /* ... */ | ||
43 | nvmem-cells = <&tsens_calibration>; | ||
44 | nvmem-cell-names = "calibration"; | ||
45 | }; | ||
diff --git a/Documentation/devicetree/bindings/nvmem/nvmem.txt b/Documentation/devicetree/bindings/nvmem/nvmem.txt index fd06c09b822b..46a7ef485e24 100644 --- a/Documentation/devicetree/bindings/nvmem/nvmem.txt +++ b/Documentation/devicetree/bindings/nvmem/nvmem.txt | |||
@@ -1,80 +1 @@ | |||
1 | = NVMEM(Non Volatile Memory) Data Device Tree Bindings = | This file has been moved to nvmem.yaml and nvmem-consumer.yaml. | |
2 | |||
3 | This binding is intended to represent the location of hardware | ||
4 | configuration data stored in NVMEMs like eeprom, efuses and so on. | ||
5 | |||
6 | On a significant proportion of boards, the manufacturer has stored | ||
7 | some data on NVMEM, for the OS to be able to retrieve these information | ||
8 | and act upon it. Obviously, the OS has to know about where to retrieve | ||
9 | these data from, and where they are stored on the storage device. | ||
10 | |||
11 | This document is here to document this. | ||
12 | |||
13 | = Data providers = | ||
14 | Contains bindings specific to provider drivers and data cells as children | ||
15 | of this node. | ||
16 | |||
17 | Optional properties: | ||
18 | read-only: Mark the provider as read only. | ||
19 | |||
20 | = Data cells = | ||
21 | These are the child nodes of the provider which contain data cell | ||
22 | information like offset and size in nvmem provider. | ||
23 | |||
24 | Required properties: | ||
25 | reg: specifies the offset in byte within the storage device. | ||
26 | |||
27 | Optional properties: | ||
28 | |||
29 | bits: Is pair of bit location and number of bits, which specifies offset | ||
30 | in bit and number of bits within the address range specified by reg property. | ||
31 | Offset takes values from 0-7. | ||
32 | |||
33 | For example: | ||
34 | |||
35 | /* Provider */ | ||
36 | qfprom: qfprom@700000 { | ||
37 | ... | ||
38 | |||
39 | /* Data cells */ | ||
40 | tsens_calibration: calib@404 { | ||
41 | reg = <0x404 0x10>; | ||
42 | }; | ||
43 | |||
44 | tsens_calibration_bckp: calib_bckp@504 { | ||
45 | reg = <0x504 0x11>; | ||
46 | bits = <6 128> | ||
47 | }; | ||
48 | |||
49 | pvs_version: pvs-version@6 { | ||
50 | reg = <0x6 0x2> | ||
51 | bits = <7 2> | ||
52 | }; | ||
53 | |||
54 | speed_bin: speed-bin@c{ | ||
55 | reg = <0xc 0x1>; | ||
56 | bits = <2 3>; | ||
57 | |||
58 | }; | ||
59 | ... | ||
60 | }; | ||
61 | |||
62 | = Data consumers = | ||
63 | Are device nodes which consume nvmem data cells/providers. | ||
64 | |||
65 | Required-properties: | ||
66 | nvmem-cells: list of phandle to the nvmem data cells. | ||
67 | nvmem-cell-names: names for the each nvmem-cells specified. Required if | ||
68 | nvmem-cells is used. | ||
69 | |||
70 | Optional-properties: | ||
71 | nvmem : list of phandles to nvmem providers. | ||
72 | nvmem-names: names for the each nvmem provider. required if nvmem is used. | ||
73 | |||
74 | For example: | ||
75 | |||
76 | tsens { | ||
77 | ... | ||
78 | nvmem-cells = <&tsens_calibration>; | ||
79 | nvmem-cell-names = "calibration"; | ||
80 | }; | ||
diff --git a/Documentation/devicetree/bindings/nvmem/nvmem.yaml b/Documentation/devicetree/bindings/nvmem/nvmem.yaml new file mode 100644 index 000000000000..1c75a059206c --- /dev/null +++ b/Documentation/devicetree/bindings/nvmem/nvmem.yaml | |||
@@ -0,0 +1,93 @@ | |||
1 | # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) | ||
2 | %YAML 1.2 | ||
3 | --- | ||
4 | $id: http://devicetree.org/schemas/nvmem/nvmem.yaml# | ||
5 | $schema: http://devicetree.org/meta-schemas/core.yaml# | ||
6 | |||
7 | title: NVMEM (Non Volatile Memory) Device Tree Bindings | ||
8 | |||
9 | maintainers: | ||
10 | - Srinivas Kandagatla <srinivas.kandagatla@linaro.org> | ||
11 | |||
12 | description: | | ||
13 | This binding is intended to represent the location of hardware | ||
14 | configuration data stored in NVMEMs like eeprom, efuses and so on. | ||
15 | |||
16 | On a significant proportion of boards, the manufacturer has stored | ||
17 | some data on NVMEM, for the OS to be able to retrieve these | ||
18 | information and act upon it. Obviously, the OS has to know about | ||
19 | where to retrieve these data from, and where they are stored on the | ||
20 | storage device. | ||
21 | |||
22 | properties: | ||
23 | $nodename: | ||
24 | pattern: "^(eeprom|efuse|nvram)(@.*|-[0-9a-f])*$" | ||
25 | |||
26 | "#address-cells": | ||
27 | const: 1 | ||
28 | |||
29 | "#size-cells": | ||
30 | const: 1 | ||
31 | |||
32 | read-only: | ||
33 | $ref: /schemas/types.yaml#/definitions/flag | ||
34 | description: | ||
35 | Mark the provider as read only. | ||
36 | |||
37 | patternProperties: | ||
38 | "^.*@[0-9a-f]+$": | ||
39 | type: object | ||
40 | |||
41 | properties: | ||
42 | reg: | ||
43 | maxItems: 1 | ||
44 | description: | ||
45 | Offset and size in bytes within the storage device. | ||
46 | |||
47 | bits: | ||
48 | maxItems: 1 | ||
49 | items: | ||
50 | items: | ||
51 | - minimum: 0 | ||
52 | maximum: 7 | ||
53 | description: | ||
54 | Offset in bit within the address range specified by reg. | ||
55 | - minimum: 1 | ||
56 | description: | ||
57 | Size in bit within the address range specified by reg. | ||
58 | |||
59 | required: | ||
60 | - reg | ||
61 | |||
62 | additionalProperties: false | ||
63 | |||
64 | examples: | ||
65 | - | | ||
66 | qfprom: eeprom@700000 { | ||
67 | #address-cells = <1>; | ||
68 | #size-cells = <1>; | ||
69 | |||
70 | /* ... */ | ||
71 | |||
72 | /* Data cells */ | ||
73 | tsens_calibration: calib@404 { | ||
74 | reg = <0x404 0x10>; | ||
75 | }; | ||
76 | |||
77 | tsens_calibration_bckp: calib_bckp@504 { | ||
78 | reg = <0x504 0x11>; | ||
79 | bits = <6 128>; | ||
80 | }; | ||
81 | |||
82 | pvs_version: pvs-version@6 { | ||
83 | reg = <0x6 0x2>; | ||
84 | bits = <7 2>; | ||
85 | }; | ||
86 | |||
87 | speed_bin: speed-bin@c{ | ||
88 | reg = <0xc 0x1>; | ||
89 | bits = <2 3>; | ||
90 | }; | ||
91 | }; | ||
92 | |||
93 | ... | ||
diff --git a/Documentation/devicetree/bindings/phy/allwinner,sun6i-a31-mipi-dphy.yaml b/Documentation/devicetree/bindings/phy/allwinner,sun6i-a31-mipi-dphy.yaml index 250f9d5aabdf..fa46670de299 100644 --- a/Documentation/devicetree/bindings/phy/allwinner,sun6i-a31-mipi-dphy.yaml +++ b/Documentation/devicetree/bindings/phy/allwinner,sun6i-a31-mipi-dphy.yaml | |||
@@ -1,7 +1,7 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0 | 1 | # SPDX-License-Identifier: GPL-2.0 |
2 | %YAML 1.2 | 2 | %YAML 1.2 |
3 | --- | 3 | --- |
4 | $id: http://devicetree.org/schemas/display/allwinner,sun6i-a31-mipi-dphy.yaml# | 4 | $id: http://devicetree.org/schemas/phy/allwinner,sun6i-a31-mipi-dphy.yaml# |
5 | $schema: http://devicetree.org/meta-schemas/core.yaml# | 5 | $schema: http://devicetree.org/meta-schemas/core.yaml# |
6 | 6 | ||
7 | title: Allwinner A31 MIPI D-PHY Controller Device Tree Bindings | 7 | title: Allwinner A31 MIPI D-PHY Controller Device Tree Bindings |
diff --git a/Documentation/devicetree/bindings/timer/intel,ixp4xx-timer.yaml b/Documentation/devicetree/bindings/timer/intel,ixp4xx-timer.yaml index a36a0746c056..2807225db902 100644 --- a/Documentation/devicetree/bindings/timer/intel,ixp4xx-timer.yaml +++ b/Documentation/devicetree/bindings/timer/intel,ixp4xx-timer.yaml | |||
@@ -2,7 +2,7 @@ | |||
2 | # Copyright 2018 Linaro Ltd. | 2 | # Copyright 2018 Linaro Ltd. |
3 | %YAML 1.2 | 3 | %YAML 1.2 |
4 | --- | 4 | --- |
5 | $id: "http://devicetree.org/schemas/timer/intel-ixp4xx-timer.yaml#" | 5 | $id: "http://devicetree.org/schemas/timer/intel,ixp4xx-timer.yaml#" |
6 | $schema: "http://devicetree.org/meta-schemas/core.yaml#" | 6 | $schema: "http://devicetree.org/meta-schemas/core.yaml#" |
7 | 7 | ||
8 | title: Intel IXP4xx XScale Networking Processors Timers | 8 | title: Intel IXP4xx XScale Networking Processors Timers |
diff --git a/Documentation/devicetree/bindings/usb/usb251xb.txt b/Documentation/devicetree/bindings/usb/usb251xb.txt index bc7945e9dbfe..17915f64b8ee 100644 --- a/Documentation/devicetree/bindings/usb/usb251xb.txt +++ b/Documentation/devicetree/bindings/usb/usb251xb.txt | |||
@@ -64,10 +64,8 @@ Optional properties : | |||
64 | - power-on-time-ms : Specifies the time it takes from the time the host | 64 | - power-on-time-ms : Specifies the time it takes from the time the host |
65 | initiates the power-on sequence to a port until the port has adequate | 65 | initiates the power-on sequence to a port until the port has adequate |
66 | power. The value is given in ms in a 0 - 510 range (default is 100ms). | 66 | power. The value is given in ms in a 0 - 510 range (default is 100ms). |
67 | - swap-dx-lanes : Specifies the downstream ports which will swap the | 67 | - swap-dx-lanes : Specifies the ports which will swap the differential-pair |
68 | differential-pair (D+/D-), default is not-swapped. | 68 | (D+/D-), default is not-swapped. |
69 | - swap-us-lanes : Selects the upstream port differential-pair (D+/D-) | ||
70 | swapping (boolean, default is not-swapped) | ||
71 | 69 | ||
72 | Examples: | 70 | Examples: |
73 | usb2512b@2c { | 71 | usb2512b@2c { |
diff --git a/Documentation/doc-guide/conf.py b/Documentation/doc-guide/conf.py deleted file mode 100644 index fd3731182d5a..000000000000 --- a/Documentation/doc-guide/conf.py +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | # -*- coding: utf-8; mode: python -*- | ||
2 | |||
3 | project = 'Linux Kernel Documentation Guide' | ||
4 | |||
5 | tags.add("subproject") | ||
6 | |||
7 | latex_documents = [ | ||
8 | ('index', 'kernel-doc-guide.tex', 'Linux Kernel Documentation Guide', | ||
9 | 'The kernel development community', 'manual'), | ||
10 | ] | ||
diff --git a/Documentation/driver-api/80211/conf.py b/Documentation/driver-api/80211/conf.py deleted file mode 100644 index 4424b4b0b9c3..000000000000 --- a/Documentation/driver-api/80211/conf.py +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | # -*- coding: utf-8; mode: python -*- | ||
2 | |||
3 | project = "Linux 802.11 Driver Developer's Guide" | ||
4 | |||
5 | tags.add("subproject") | ||
6 | |||
7 | latex_documents = [ | ||
8 | ('index', '80211.tex', project, | ||
9 | 'The kernel development community', 'manual'), | ||
10 | ] | ||
diff --git a/Documentation/driver-api/conf.py b/Documentation/driver-api/conf.py deleted file mode 100644 index 202726d20088..000000000000 --- a/Documentation/driver-api/conf.py +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | # -*- coding: utf-8; mode: python -*- | ||
2 | |||
3 | project = "The Linux driver implementer's API guide" | ||
4 | |||
5 | tags.add("subproject") | ||
6 | |||
7 | latex_documents = [ | ||
8 | ('index', 'driver-api.tex', project, | ||
9 | 'The kernel development community', 'manual'), | ||
10 | ] | ||
diff --git a/Documentation/driver-api/generic-counter.rst b/Documentation/driver-api/generic-counter.rst index 0c161b1a3be6..8382f01a53e3 100644 --- a/Documentation/driver-api/generic-counter.rst +++ b/Documentation/driver-api/generic-counter.rst | |||
@@ -233,7 +233,7 @@ Userspace Interface | |||
233 | Several sysfs attributes are generated by the Generic Counter interface, | 233 | Several sysfs attributes are generated by the Generic Counter interface, |
234 | and reside under the /sys/bus/counter/devices/counterX directory, where | 234 | and reside under the /sys/bus/counter/devices/counterX directory, where |
235 | counterX refers to the respective counter device. Please see | 235 | counterX refers to the respective counter device. Please see |
236 | Documentation/ABI/testing/sys-bus-counter-generic-sysfs for detailed | 236 | Documentation/ABI/testing/sysfs-bus-counter for detailed |
237 | information on each Generic Counter interface sysfs attribute. | 237 | information on each Generic Counter interface sysfs attribute. |
238 | 238 | ||
239 | Through these sysfs attributes, programs and scripts may interact with | 239 | Through these sysfs attributes, programs and scripts may interact with |
@@ -325,7 +325,7 @@ sysfs attributes, where Y is the unique ID of the respective Count: | |||
325 | 325 | ||
326 | For a more detailed breakdown of the available Generic Counter interface | 326 | For a more detailed breakdown of the available Generic Counter interface |
327 | sysfs attributes, please refer to the | 327 | sysfs attributes, please refer to the |
328 | Documentation/ABI/testing/sys-bus-counter file. | 328 | Documentation/ABI/testing/sysfs-bus-counter file. |
329 | 329 | ||
330 | The Signals and Counts associated with the Counter device are registered | 330 | The Signals and Counts associated with the Counter device are registered |
331 | to the system as well by the counter_register function. The | 331 | to the system as well by the counter_register function. The |
diff --git a/Documentation/driver-api/phy/phy.rst b/Documentation/driver-api/phy/phy.rst index 457c3e0f86d6..8fc1ce0bb905 100644 --- a/Documentation/driver-api/phy/phy.rst +++ b/Documentation/driver-api/phy/phy.rst | |||
@@ -179,8 +179,8 @@ PHY Mappings | |||
179 | 179 | ||
180 | In order to get reference to a PHY without help from DeviceTree, the framework | 180 | In order to get reference to a PHY without help from DeviceTree, the framework |
181 | offers lookups which can be compared to clkdev that allow clk structures to be | 181 | offers lookups which can be compared to clkdev that allow clk structures to be |
182 | bound to devices. A lookup can be made be made during runtime when a handle to | 182 | bound to devices. A lookup can be made during runtime when a handle to the |
183 | the struct phy already exists. | 183 | struct phy already exists. |
184 | 184 | ||
185 | The framework offers the following API for registering and unregistering the | 185 | The framework offers the following API for registering and unregistering the |
186 | lookups:: | 186 | lookups:: |
diff --git a/Documentation/driver-api/pm/conf.py b/Documentation/driver-api/pm/conf.py deleted file mode 100644 index a89fac11272f..000000000000 --- a/Documentation/driver-api/pm/conf.py +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | # -*- coding: utf-8; mode: python -*- | ||
2 | |||
3 | project = "Device Power Management" | ||
4 | |||
5 | tags.add("subproject") | ||
6 | |||
7 | latex_documents = [ | ||
8 | ('index', 'pm.tex', project, | ||
9 | 'The kernel development community', 'manual'), | ||
10 | ] | ||
diff --git a/Documentation/filesystems/conf.py b/Documentation/filesystems/conf.py deleted file mode 100644 index ea44172af5c4..000000000000 --- a/Documentation/filesystems/conf.py +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | # -*- coding: utf-8; mode: python -*- | ||
2 | |||
3 | project = "Linux Filesystems API" | ||
4 | |||
5 | tags.add("subproject") | ||
6 | |||
7 | latex_documents = [ | ||
8 | ('index', 'filesystems.tex', project, | ||
9 | 'The kernel development community', 'manual'), | ||
10 | ] | ||
diff --git a/Documentation/gpu/conf.py b/Documentation/gpu/conf.py deleted file mode 100644 index 1757b040fb32..000000000000 --- a/Documentation/gpu/conf.py +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | # -*- coding: utf-8; mode: python -*- | ||
2 | |||
3 | project = "Linux GPU Driver Developer's Guide" | ||
4 | |||
5 | tags.add("subproject") | ||
6 | |||
7 | latex_documents = [ | ||
8 | ('index', 'gpu.tex', project, | ||
9 | 'The kernel development community', 'manual'), | ||
10 | ] | ||
diff --git a/Documentation/hwmon/k8temp.rst b/Documentation/hwmon/k8temp.rst index 72da12aa17e5..fe9109521056 100644 --- a/Documentation/hwmon/k8temp.rst +++ b/Documentation/hwmon/k8temp.rst | |||
@@ -9,7 +9,7 @@ Supported chips: | |||
9 | 9 | ||
10 | Addresses scanned: PCI space | 10 | Addresses scanned: PCI space |
11 | 11 | ||
12 | Datasheet: http://support.amd.com/us/Processor_TechDocs/32559.pdf | 12 | Datasheet: http://www.amd.com/system/files/TechDocs/32559.pdf |
13 | 13 | ||
14 | Author: Rudolf Marek | 14 | Author: Rudolf Marek |
15 | 15 | ||
diff --git a/Documentation/index.rst b/Documentation/index.rst index 70ae148ec980..2df5a3da563c 100644 --- a/Documentation/index.rst +++ b/Documentation/index.rst | |||
@@ -111,9 +111,11 @@ needed). | |||
111 | netlabel/index | 111 | netlabel/index |
112 | networking/index | 112 | networking/index |
113 | pcmcia/index | 113 | pcmcia/index |
114 | power/index | ||
114 | target/index | 115 | target/index |
115 | timers/index | 116 | timers/index |
116 | watchdog/index | 117 | watchdog/index |
118 | virtual/index | ||
117 | input/index | 119 | input/index |
118 | hwmon/index | 120 | hwmon/index |
119 | gpu/index | 121 | gpu/index |
@@ -143,6 +145,7 @@ implementation. | |||
143 | arm64/index | 145 | arm64/index |
144 | ia64/index | 146 | ia64/index |
145 | m68k/index | 147 | m68k/index |
148 | powerpc/index | ||
146 | riscv/index | 149 | riscv/index |
147 | s390/index | 150 | s390/index |
148 | sh/index | 151 | sh/index |
diff --git a/Documentation/input/conf.py b/Documentation/input/conf.py deleted file mode 100644 index d2352fdc92ed..000000000000 --- a/Documentation/input/conf.py +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | # -*- coding: utf-8; mode: python -*- | ||
2 | |||
3 | project = "The Linux input driver subsystem" | ||
4 | |||
5 | tags.add("subproject") | ||
6 | |||
7 | latex_documents = [ | ||
8 | ('index', 'linux-input.tex', project, | ||
9 | 'The kernel development community', 'manual'), | ||
10 | ] | ||
diff --git a/Documentation/kernel-hacking/conf.py b/Documentation/kernel-hacking/conf.py deleted file mode 100644 index 3d8acf0f33ad..000000000000 --- a/Documentation/kernel-hacking/conf.py +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | # -*- coding: utf-8; mode: python -*- | ||
2 | |||
3 | project = "Kernel Hacking Guides" | ||
4 | |||
5 | tags.add("subproject") | ||
6 | |||
7 | latex_documents = [ | ||
8 | ('index', 'kernel-hacking.tex', project, | ||
9 | 'The kernel development community', 'manual'), | ||
10 | ] | ||
diff --git a/Documentation/locking/spinlocks.rst b/Documentation/locking/spinlocks.rst index 098107fb7d86..e93ec6645238 100644 --- a/Documentation/locking/spinlocks.rst +++ b/Documentation/locking/spinlocks.rst | |||
@@ -82,7 +82,7 @@ itself. The read lock allows many concurrent readers. Anything that | |||
82 | **changes** the list will have to get the write lock. | 82 | **changes** the list will have to get the write lock. |
83 | 83 | ||
84 | NOTE! RCU is better for list traversal, but requires careful | 84 | NOTE! RCU is better for list traversal, but requires careful |
85 | attention to design detail (see Documentation/RCU/listRCU.txt). | 85 | attention to design detail (see Documentation/RCU/listRCU.rst). |
86 | 86 | ||
87 | Also, you cannot "upgrade" a read-lock to a write-lock, so if you at _any_ | 87 | Also, you cannot "upgrade" a read-lock to a write-lock, so if you at _any_ |
88 | time need to do any changes (even if you don't do it every time), you have | 88 | time need to do any changes (even if you don't do it every time), you have |
@@ -90,7 +90,7 @@ to get the write-lock at the very beginning. | |||
90 | 90 | ||
91 | NOTE! We are working hard to remove reader-writer spinlocks in most | 91 | NOTE! We are working hard to remove reader-writer spinlocks in most |
92 | cases, so please don't add a new one without consensus. (Instead, see | 92 | cases, so please don't add a new one without consensus. (Instead, see |
93 | Documentation/RCU/rcu.txt for complete information.) | 93 | Documentation/RCU/rcu.rst for complete information.) |
94 | 94 | ||
95 | ---- | 95 | ---- |
96 | 96 | ||
diff --git a/Documentation/maintainer/conf.py b/Documentation/maintainer/conf.py deleted file mode 100644 index 81e9eb7a7884..000000000000 --- a/Documentation/maintainer/conf.py +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | # -*- coding: utf-8; mode: python -*- | ||
2 | |||
3 | project = 'Linux Kernel Development Documentation' | ||
4 | |||
5 | tags.add("subproject") | ||
6 | |||
7 | latex_documents = [ | ||
8 | ('index', 'maintainer.tex', 'Linux Kernel Development Documentation', | ||
9 | 'The kernel development community', 'manual'), | ||
10 | ] | ||
diff --git a/Documentation/media/conf.py b/Documentation/media/conf.py deleted file mode 100644 index 1f194fcd2cae..000000000000 --- a/Documentation/media/conf.py +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | # -*- coding: utf-8; mode: python -*- | ||
2 | |||
3 | # SPDX-License-Identifier: GPL-2.0 | ||
4 | |||
5 | project = 'Linux Media Subsystem Documentation' | ||
6 | |||
7 | tags.add("subproject") | ||
8 | |||
9 | latex_documents = [ | ||
10 | ('index', 'media.tex', 'Linux Media Subsystem Documentation', | ||
11 | 'The kernel development community', 'manual'), | ||
12 | ] | ||
diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt index 045bb8148fe9..1adbb8a371c7 100644 --- a/Documentation/memory-barriers.txt +++ b/Documentation/memory-barriers.txt | |||
@@ -548,7 +548,7 @@ There are certain things that the Linux kernel memory barriers do not guarantee: | |||
548 | 548 | ||
549 | [*] For information on bus mastering DMA and coherency please read: | 549 | [*] For information on bus mastering DMA and coherency please read: |
550 | 550 | ||
551 | Documentation/PCI/pci.rst | 551 | Documentation/driver-api/pci/pci.rst |
552 | Documentation/DMA-API-HOWTO.txt | 552 | Documentation/DMA-API-HOWTO.txt |
553 | Documentation/DMA-API.txt | 553 | Documentation/DMA-API.txt |
554 | 554 | ||
diff --git a/Documentation/networking/conf.py b/Documentation/networking/conf.py deleted file mode 100644 index 40f69e67a883..000000000000 --- a/Documentation/networking/conf.py +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | # -*- coding: utf-8; mode: python -*- | ||
2 | |||
3 | project = "Linux Networking Documentation" | ||
4 | |||
5 | tags.add("subproject") | ||
6 | |||
7 | latex_documents = [ | ||
8 | ('index', 'networking.tex', project, | ||
9 | 'The kernel development community', 'manual'), | ||
10 | ] | ||
diff --git a/Documentation/power/index.rst b/Documentation/power/index.rst index 20415f21e48a..002e42745263 100644 --- a/Documentation/power/index.rst +++ b/Documentation/power/index.rst | |||
@@ -1,4 +1,4 @@ | |||
1 | :orphan: | 1 | .. SPDX-License-Identifier: GPL-2.0 |
2 | 2 | ||
3 | ================ | 3 | ================ |
4 | Power Management | 4 | Power Management |
diff --git a/Documentation/powerpc/bootwrapper.txt b/Documentation/powerpc/bootwrapper.rst index d60fced5e1cc..a6292afba573 100644 --- a/Documentation/powerpc/bootwrapper.txt +++ b/Documentation/powerpc/bootwrapper.rst | |||
@@ -1,5 +1,7 @@ | |||
1 | ======================== | ||
1 | The PowerPC boot wrapper | 2 | The PowerPC boot wrapper |
2 | ------------------------ | 3 | ======================== |
4 | |||
3 | Copyright (C) Secret Lab Technologies Ltd. | 5 | Copyright (C) Secret Lab Technologies Ltd. |
4 | 6 | ||
5 | PowerPC image targets compresses and wraps the kernel image (vmlinux) with | 7 | PowerPC image targets compresses and wraps the kernel image (vmlinux) with |
@@ -21,6 +23,7 @@ it uses the wrapper script (arch/powerpc/boot/wrapper) to generate target | |||
21 | image. The details of the build system is discussed in the next section. | 23 | image. The details of the build system is discussed in the next section. |
22 | Currently, the following image format targets exist: | 24 | Currently, the following image format targets exist: |
23 | 25 | ||
26 | ==================== ======================================================== | ||
24 | cuImage.%: Backwards compatible uImage for older version of | 27 | cuImage.%: Backwards compatible uImage for older version of |
25 | U-Boot (for versions that don't understand the device | 28 | U-Boot (for versions that don't understand the device |
26 | tree). This image embeds a device tree blob inside | 29 | tree). This image embeds a device tree blob inside |
@@ -29,31 +32,36 @@ Currently, the following image format targets exist: | |||
29 | with boot wrapper code that extracts data from the old | 32 | with boot wrapper code that extracts data from the old |
30 | bd_info structure and loads the data into the device | 33 | bd_info structure and loads the data into the device |
31 | tree before jumping into the kernel. | 34 | tree before jumping into the kernel. |
32 | Because of the series of #ifdefs found in the | 35 | |
36 | Because of the series of #ifdefs found in the | ||
33 | bd_info structure used in the old U-Boot interfaces, | 37 | bd_info structure used in the old U-Boot interfaces, |
34 | cuImages are platform specific. Each specific | 38 | cuImages are platform specific. Each specific |
35 | U-Boot platform has a different platform init file | 39 | U-Boot platform has a different platform init file |
36 | which populates the embedded device tree with data | 40 | which populates the embedded device tree with data |
37 | from the platform specific bd_info file. The platform | 41 | from the platform specific bd_info file. The platform |
38 | specific cuImage platform init code can be found in | 42 | specific cuImage platform init code can be found in |
39 | arch/powerpc/boot/cuboot.*.c. Selection of the correct | 43 | `arch/powerpc/boot/cuboot.*.c`. Selection of the correct |
40 | cuImage init code for a specific board can be found in | 44 | cuImage init code for a specific board can be found in |
41 | the wrapper structure. | 45 | the wrapper structure. |
46 | |||
42 | dtbImage.%: Similar to zImage, except device tree blob is embedded | 47 | dtbImage.%: Similar to zImage, except device tree blob is embedded |
43 | inside the image instead of provided by firmware. The | 48 | inside the image instead of provided by firmware. The |
44 | output image file can be either an elf file or a flat | 49 | output image file can be either an elf file or a flat |
45 | binary depending on the platform. | 50 | binary depending on the platform. |
46 | dtbImages are used on systems which do not have an | 51 | |
52 | dtbImages are used on systems which do not have an | ||
47 | interface for passing a device tree directly. | 53 | interface for passing a device tree directly. |
48 | dtbImages are similar to simpleImages except that | 54 | dtbImages are similar to simpleImages except that |
49 | dtbImages have platform specific code for extracting | 55 | dtbImages have platform specific code for extracting |
50 | data from the board firmware, but simpleImages do not | 56 | data from the board firmware, but simpleImages do not |
51 | talk to the firmware at all. | 57 | talk to the firmware at all. |
52 | PlayStation 3 support uses dtbImage. So do Embedded | 58 | |
59 | PlayStation 3 support uses dtbImage. So do Embedded | ||
53 | Planet boards using the PlanetCore firmware. Board | 60 | Planet boards using the PlanetCore firmware. Board |
54 | specific initialization code is typically found in a | 61 | specific initialization code is typically found in a |
55 | file named arch/powerpc/boot/<platform>.c; but this | 62 | file named arch/powerpc/boot/<platform>.c; but this |
56 | can be overridden by the wrapper script. | 63 | can be overridden by the wrapper script. |
64 | |||
57 | simpleImage.%: Firmware independent compressed image that does not | 65 | simpleImage.%: Firmware independent compressed image that does not |
58 | depend on any particular firmware interface and embeds | 66 | depend on any particular firmware interface and embeds |
59 | a device tree blob. This image is a flat binary that | 67 | a device tree blob. This image is a flat binary that |
@@ -61,14 +69,16 @@ Currently, the following image format targets exist: | |||
61 | Firmware cannot pass any configuration data to the | 69 | Firmware cannot pass any configuration data to the |
62 | kernel with this image type and it depends entirely on | 70 | kernel with this image type and it depends entirely on |
63 | the embedded device tree for all information. | 71 | the embedded device tree for all information. |
64 | The simpleImage is useful for booting systems with | 72 | |
73 | The simpleImage is useful for booting systems with | ||
65 | an unknown firmware interface or for booting from | 74 | an unknown firmware interface or for booting from |
66 | a debugger when no firmware is present (such as on | 75 | a debugger when no firmware is present (such as on |
67 | the Xilinx Virtex platform). The only assumption that | 76 | the Xilinx Virtex platform). The only assumption that |
68 | simpleImage makes is that RAM is correctly initialized | 77 | simpleImage makes is that RAM is correctly initialized |
69 | and that the MMU is either off or has RAM mapped to | 78 | and that the MMU is either off or has RAM mapped to |
70 | base address 0. | 79 | base address 0. |
71 | simpleImage also supports inserting special platform | 80 | |
81 | simpleImage also supports inserting special platform | ||
72 | specific initialization code to the start of the bootup | 82 | specific initialization code to the start of the bootup |
73 | sequence. The virtex405 platform uses this feature to | 83 | sequence. The virtex405 platform uses this feature to |
74 | ensure that the cache is invalidated before caching | 84 | ensure that the cache is invalidated before caching |
@@ -81,9 +91,11 @@ Currently, the following image format targets exist: | |||
81 | named (virtex405-<board>.dts). Search the wrapper | 91 | named (virtex405-<board>.dts). Search the wrapper |
82 | script for 'virtex405' and see the file | 92 | script for 'virtex405' and see the file |
83 | arch/powerpc/boot/virtex405-head.S for details. | 93 | arch/powerpc/boot/virtex405-head.S for details. |
94 | |||
84 | treeImage.%; Image format for used with OpenBIOS firmware found | 95 | treeImage.%; Image format for used with OpenBIOS firmware found |
85 | on some ppc4xx hardware. This image embeds a device | 96 | on some ppc4xx hardware. This image embeds a device |
86 | tree blob inside the image. | 97 | tree blob inside the image. |
98 | |||
87 | uImage: Native image format used by U-Boot. The uImage target | 99 | uImage: Native image format used by U-Boot. The uImage target |
88 | does not add any boot code. It just wraps a compressed | 100 | does not add any boot code. It just wraps a compressed |
89 | vmlinux in the uImage data structure. This image | 101 | vmlinux in the uImage data structure. This image |
@@ -91,12 +103,14 @@ Currently, the following image format targets exist: | |||
91 | a device tree to the kernel at boot. If using an older | 103 | a device tree to the kernel at boot. If using an older |
92 | version of U-Boot, then you need to use a cuImage | 104 | version of U-Boot, then you need to use a cuImage |
93 | instead. | 105 | instead. |
106 | |||
94 | zImage.%: Image format which does not embed a device tree. | 107 | zImage.%: Image format which does not embed a device tree. |
95 | Used by OpenFirmware and other firmware interfaces | 108 | Used by OpenFirmware and other firmware interfaces |
96 | which are able to supply a device tree. This image | 109 | which are able to supply a device tree. This image |
97 | expects firmware to provide the device tree at boot. | 110 | expects firmware to provide the device tree at boot. |
98 | Typically, if you have general purpose PowerPC | 111 | Typically, if you have general purpose PowerPC |
99 | hardware then you want this image format. | 112 | hardware then you want this image format. |
113 | ==================== ======================================================== | ||
100 | 114 | ||
101 | Image types which embed a device tree blob (simpleImage, dtbImage, treeImage, | 115 | Image types which embed a device tree blob (simpleImage, dtbImage, treeImage, |
102 | and cuImage) all generate the device tree blob from a file in the | 116 | and cuImage) all generate the device tree blob from a file in the |
diff --git a/Documentation/powerpc/cpu_families.txt b/Documentation/powerpc/cpu_families.rst index fc08e22feb1a..1e063c5440c3 100644 --- a/Documentation/powerpc/cpu_families.txt +++ b/Documentation/powerpc/cpu_families.rst | |||
@@ -1,3 +1,4 @@ | |||
1 | ============ | ||
1 | CPU Families | 2 | CPU Families |
2 | ============ | 3 | ============ |
3 | 4 | ||
@@ -8,8 +9,8 @@ and are supported by arch/powerpc. | |||
8 | Book3S (aka sPAPR) | 9 | Book3S (aka sPAPR) |
9 | ------------------ | 10 | ------------------ |
10 | 11 | ||
11 | - Hash MMU | 12 | - Hash MMU |
12 | - Mix of 32 & 64 bit | 13 | - Mix of 32 & 64 bit:: |
13 | 14 | ||
14 | +--------------+ +----------------+ | 15 | +--------------+ +----------------+ |
15 | | Old POWER | --------------> | RS64 (threads) | | 16 | | Old POWER | --------------> | RS64 (threads) | |
@@ -108,8 +109,8 @@ Book3S (aka sPAPR) | |||
108 | IBM BookE | 109 | IBM BookE |
109 | --------- | 110 | --------- |
110 | 111 | ||
111 | - Software loaded TLB. | 112 | - Software loaded TLB. |
112 | - All 32 bit | 113 | - All 32 bit:: |
113 | 114 | ||
114 | +--------------+ | 115 | +--------------+ |
115 | | 401 | | 116 | | 401 | |
@@ -155,8 +156,8 @@ IBM BookE | |||
155 | Motorola/Freescale 8xx | 156 | Motorola/Freescale 8xx |
156 | ---------------------- | 157 | ---------------------- |
157 | 158 | ||
158 | - Software loaded with hardware assist. | 159 | - Software loaded with hardware assist. |
159 | - All 32 bit | 160 | - All 32 bit:: |
160 | 161 | ||
161 | +-------------+ | 162 | +-------------+ |
162 | | MPC8xx Core | | 163 | | MPC8xx Core | |
@@ -166,9 +167,9 @@ Motorola/Freescale 8xx | |||
166 | Freescale BookE | 167 | Freescale BookE |
167 | --------------- | 168 | --------------- |
168 | 169 | ||
169 | - Software loaded TLB. | 170 | - Software loaded TLB. |
170 | - e6500 adds HW loaded indirect TLB entries. | 171 | - e6500 adds HW loaded indirect TLB entries. |
171 | - Mix of 32 & 64 bit | 172 | - Mix of 32 & 64 bit:: |
172 | 173 | ||
173 | +--------------+ | 174 | +--------------+ |
174 | | e200 | | 175 | | e200 | |
@@ -207,8 +208,8 @@ Freescale BookE | |||
207 | IBM A2 core | 208 | IBM A2 core |
208 | ----------- | 209 | ----------- |
209 | 210 | ||
210 | - Book3E, software loaded TLB + HW loaded indirect TLB entries. | 211 | - Book3E, software loaded TLB + HW loaded indirect TLB entries. |
211 | - 64 bit | 212 | - 64 bit:: |
212 | 213 | ||
213 | +--------------+ +----------------+ | 214 | +--------------+ +----------------+ |
214 | | A2 core | --> | WSP | | 215 | | A2 core | --> | WSP | |
diff --git a/Documentation/powerpc/cpu_features.txt b/Documentation/powerpc/cpu_features.rst index ae09df8722c8..b7bcdd2f41bb 100644 --- a/Documentation/powerpc/cpu_features.txt +++ b/Documentation/powerpc/cpu_features.rst | |||
@@ -1,3 +1,7 @@ | |||
1 | ============ | ||
2 | CPU Features | ||
3 | ============ | ||
4 | |||
1 | Hollis Blanchard <hollis@austin.ibm.com> | 5 | Hollis Blanchard <hollis@austin.ibm.com> |
2 | 5 Jun 2002 | 6 | 5 Jun 2002 |
3 | 7 | ||
@@ -32,7 +36,7 @@ anyways). | |||
32 | After detecting the processor type, the kernel patches out sections of code | 36 | After detecting the processor type, the kernel patches out sections of code |
33 | that shouldn't be used by writing nop's over it. Using cpufeatures requires | 37 | that shouldn't be used by writing nop's over it. Using cpufeatures requires |
34 | just 2 macros (found in arch/powerpc/include/asm/cputable.h), as seen in head.S | 38 | just 2 macros (found in arch/powerpc/include/asm/cputable.h), as seen in head.S |
35 | transfer_to_handler: | 39 | transfer_to_handler:: |
36 | 40 | ||
37 | #ifdef CONFIG_ALTIVEC | 41 | #ifdef CONFIG_ALTIVEC |
38 | BEGIN_FTR_SECTION | 42 | BEGIN_FTR_SECTION |
diff --git a/Documentation/powerpc/cxl.txt b/Documentation/powerpc/cxl.rst index c5e8d5098ed3..920546d81326 100644 --- a/Documentation/powerpc/cxl.txt +++ b/Documentation/powerpc/cxl.rst | |||
@@ -1,3 +1,4 @@ | |||
1 | ==================================== | ||
1 | Coherent Accelerator Interface (CXL) | 2 | Coherent Accelerator Interface (CXL) |
2 | ==================================== | 3 | ==================================== |
3 | 4 | ||
@@ -21,6 +22,8 @@ Introduction | |||
21 | Hardware overview | 22 | Hardware overview |
22 | ================= | 23 | ================= |
23 | 24 | ||
25 | :: | ||
26 | |||
24 | POWER8/9 FPGA | 27 | POWER8/9 FPGA |
25 | +----------+ +---------+ | 28 | +----------+ +---------+ |
26 | | | | | | 29 | | | | | |
@@ -59,14 +62,16 @@ Hardware overview | |||
59 | the fault. The context to which this fault is serviced is based on | 62 | the fault. The context to which this fault is serviced is based on |
60 | who owns that acceleration function. | 63 | who owns that acceleration function. |
61 | 64 | ||
62 | POWER8 <-----> PSL Version 8 is compliant to the CAIA Version 1.0. | 65 | - POWER8 and PSL Version 8 are compliant to the CAIA Version 1.0. |
63 | POWER9 <-----> PSL Version 9 is compliant to the CAIA Version 2.0. | 66 | - POWER9 and PSL Version 9 are compliant to the CAIA Version 2.0. |
67 | |||
64 | This PSL Version 9 provides new features such as: | 68 | This PSL Version 9 provides new features such as: |
69 | |||
65 | * Interaction with the nest MMU on the P9 chip. | 70 | * Interaction with the nest MMU on the P9 chip. |
66 | * Native DMA support. | 71 | * Native DMA support. |
67 | * Supports sending ASB_Notify messages for host thread wakeup. | 72 | * Supports sending ASB_Notify messages for host thread wakeup. |
68 | * Supports Atomic operations. | 73 | * Supports Atomic operations. |
69 | * .... | 74 | * etc. |
70 | 75 | ||
71 | Cards with a PSL9 won't work on a POWER8 system and cards with a | 76 | Cards with a PSL9 won't work on a POWER8 system and cards with a |
72 | PSL8 won't work on a POWER9 system. | 77 | PSL8 won't work on a POWER9 system. |
@@ -147,7 +152,9 @@ User API | |||
147 | master devices. | 152 | master devices. |
148 | 153 | ||
149 | A userspace library libcxl is available here: | 154 | A userspace library libcxl is available here: |
155 | |||
150 | https://github.com/ibm-capi/libcxl | 156 | https://github.com/ibm-capi/libcxl |
157 | |||
151 | This provides a C interface to this kernel API. | 158 | This provides a C interface to this kernel API. |
152 | 159 | ||
153 | open | 160 | open |
@@ -165,7 +172,8 @@ open | |||
165 | When all available contexts are allocated the open call will fail | 172 | When all available contexts are allocated the open call will fail |
166 | and return -ENOSPC. | 173 | and return -ENOSPC. |
167 | 174 | ||
168 | Note: IRQs need to be allocated for each context, which may limit | 175 | Note: |
176 | IRQs need to be allocated for each context, which may limit | ||
169 | the number of contexts that can be created, and therefore | 177 | the number of contexts that can be created, and therefore |
170 | how many times the device can be opened. The POWER8 CAPP | 178 | how many times the device can be opened. The POWER8 CAPP |
171 | supports 2040 IRQs and 3 are used by the kernel, so 2037 are | 179 | supports 2040 IRQs and 3 are used by the kernel, so 2037 are |
@@ -186,7 +194,9 @@ ioctl | |||
186 | updated as userspace allocates and frees memory. This ioctl | 194 | updated as userspace allocates and frees memory. This ioctl |
187 | returns once the AFU context is started. | 195 | returns once the AFU context is started. |
188 | 196 | ||
189 | Takes a pointer to a struct cxl_ioctl_start_work: | 197 | Takes a pointer to a struct cxl_ioctl_start_work |
198 | |||
199 | :: | ||
190 | 200 | ||
191 | struct cxl_ioctl_start_work { | 201 | struct cxl_ioctl_start_work { |
192 | __u64 flags; | 202 | __u64 flags; |
@@ -269,7 +279,7 @@ read | |||
269 | The buffer passed to read() must be at least 4K bytes. | 279 | The buffer passed to read() must be at least 4K bytes. |
270 | 280 | ||
271 | The result of the read will be a buffer of one or more events, | 281 | The result of the read will be a buffer of one or more events, |
272 | each event is of type struct cxl_event, of varying size. | 282 | each event is of type struct cxl_event, of varying size:: |
273 | 283 | ||
274 | struct cxl_event { | 284 | struct cxl_event { |
275 | struct cxl_event_header header; | 285 | struct cxl_event_header header; |
@@ -280,7 +290,9 @@ read | |||
280 | }; | 290 | }; |
281 | }; | 291 | }; |
282 | 292 | ||
283 | The struct cxl_event_header is defined as: | 293 | The struct cxl_event_header is defined as |
294 | |||
295 | :: | ||
284 | 296 | ||
285 | struct cxl_event_header { | 297 | struct cxl_event_header { |
286 | __u16 type; | 298 | __u16 type; |
@@ -307,7 +319,9 @@ read | |||
307 | For future extensions and padding. | 319 | For future extensions and padding. |
308 | 320 | ||
309 | If the event type is CXL_EVENT_AFU_INTERRUPT then the event | 321 | If the event type is CXL_EVENT_AFU_INTERRUPT then the event |
310 | structure is defined as: | 322 | structure is defined as |
323 | |||
324 | :: | ||
311 | 325 | ||
312 | struct cxl_event_afu_interrupt { | 326 | struct cxl_event_afu_interrupt { |
313 | __u16 flags; | 327 | __u16 flags; |
@@ -326,7 +340,9 @@ read | |||
326 | For future extensions and padding. | 340 | For future extensions and padding. |
327 | 341 | ||
328 | If the event type is CXL_EVENT_DATA_STORAGE then the event | 342 | If the event type is CXL_EVENT_DATA_STORAGE then the event |
329 | structure is defined as: | 343 | structure is defined as |
344 | |||
345 | :: | ||
330 | 346 | ||
331 | struct cxl_event_data_storage { | 347 | struct cxl_event_data_storage { |
332 | __u16 flags; | 348 | __u16 flags; |
@@ -356,7 +372,9 @@ read | |||
356 | For future extensions | 372 | For future extensions |
357 | 373 | ||
358 | If the event type is CXL_EVENT_AFU_ERROR then the event structure | 374 | If the event type is CXL_EVENT_AFU_ERROR then the event structure |
359 | is defined as: | 375 | is defined as |
376 | |||
377 | :: | ||
360 | 378 | ||
361 | struct cxl_event_afu_error { | 379 | struct cxl_event_afu_error { |
362 | __u16 flags; | 380 | __u16 flags; |
@@ -393,15 +411,15 @@ open | |||
393 | ioctl | 411 | ioctl |
394 | ----- | 412 | ----- |
395 | 413 | ||
396 | CXL_IOCTL_DOWNLOAD_IMAGE: | 414 | CXL_IOCTL_DOWNLOAD_IMAGE / CXL_IOCTL_VALIDATE_IMAGE: |
397 | CXL_IOCTL_VALIDATE_IMAGE: | ||
398 | Starts and controls flashing a new FPGA image. Partial | 415 | Starts and controls flashing a new FPGA image. Partial |
399 | reconfiguration is not supported (yet), so the image must contain | 416 | reconfiguration is not supported (yet), so the image must contain |
400 | a copy of the PSL and AFU(s). Since an image can be quite large, | 417 | a copy of the PSL and AFU(s). Since an image can be quite large, |
401 | the caller may have to iterate, splitting the image in smaller | 418 | the caller may have to iterate, splitting the image in smaller |
402 | chunks. | 419 | chunks. |
403 | 420 | ||
404 | Takes a pointer to a struct cxl_adapter_image: | 421 | Takes a pointer to a struct cxl_adapter_image:: |
422 | |||
405 | struct cxl_adapter_image { | 423 | struct cxl_adapter_image { |
406 | __u64 flags; | 424 | __u64 flags; |
407 | __u64 data; | 425 | __u64 data; |
@@ -442,7 +460,7 @@ Udev rules | |||
442 | The following udev rules could be used to create a symlink to the | 460 | The following udev rules could be used to create a symlink to the |
443 | most logical chardev to use in any programming mode (afuX.Yd for | 461 | most logical chardev to use in any programming mode (afuX.Yd for |
444 | dedicated, afuX.Ys for afu directed), since the API is virtually | 462 | dedicated, afuX.Ys for afu directed), since the API is virtually |
445 | identical for each: | 463 | identical for each:: |
446 | 464 | ||
447 | SUBSYSTEM=="cxl", ATTRS{mode}=="dedicated_process", SYMLINK="cxl/%b" | 465 | SUBSYSTEM=="cxl", ATTRS{mode}=="dedicated_process", SYMLINK="cxl/%b" |
448 | SUBSYSTEM=="cxl", ATTRS{mode}=="afu_directed", \ | 466 | SUBSYSTEM=="cxl", ATTRS{mode}=="afu_directed", \ |
diff --git a/Documentation/powerpc/cxlflash.txt b/Documentation/powerpc/cxlflash.rst index a64bdaa0a1cf..cea67931b3b9 100644 --- a/Documentation/powerpc/cxlflash.txt +++ b/Documentation/powerpc/cxlflash.rst | |||
@@ -1,3 +1,7 @@ | |||
1 | ================================ | ||
2 | Coherent Accelerator (CXL) Flash | ||
3 | ================================ | ||
4 | |||
1 | Introduction | 5 | Introduction |
2 | ============ | 6 | ============ |
3 | 7 | ||
@@ -28,7 +32,7 @@ Introduction | |||
28 | responsible for the initialization of the adapter, setting up the | 32 | responsible for the initialization of the adapter, setting up the |
29 | special path for user space access, and performing error recovery. It | 33 | special path for user space access, and performing error recovery. It |
30 | communicates directly the Flash Accelerator Functional Unit (AFU) | 34 | communicates directly the Flash Accelerator Functional Unit (AFU) |
31 | as described in Documentation/powerpc/cxl.txt. | 35 | as described in Documentation/powerpc/cxl.rst. |
32 | 36 | ||
33 | The cxlflash driver supports two, mutually exclusive, modes of | 37 | The cxlflash driver supports two, mutually exclusive, modes of |
34 | operation at the device (LUN) level: | 38 | operation at the device (LUN) level: |
@@ -58,7 +62,7 @@ Overview | |||
58 | 62 | ||
59 | The CXL Flash Adapter Driver establishes a master context with the | 63 | The CXL Flash Adapter Driver establishes a master context with the |
60 | AFU. It uses memory mapped I/O (MMIO) for this control and setup. The | 64 | AFU. It uses memory mapped I/O (MMIO) for this control and setup. The |
61 | Adapter Problem Space Memory Map looks like this: | 65 | Adapter Problem Space Memory Map looks like this:: |
62 | 66 | ||
63 | +-------------------------------+ | 67 | +-------------------------------+ |
64 | | 512 * 64 KB User MMIO | | 68 | | 512 * 64 KB User MMIO | |
@@ -375,7 +379,7 @@ CXL Flash Driver Host IOCTLs | |||
375 | Each host adapter instance that is supported by the cxlflash driver | 379 | Each host adapter instance that is supported by the cxlflash driver |
376 | has a special character device associated with it to enable a set of | 380 | has a special character device associated with it to enable a set of |
377 | host management function. These character devices are hosted in a | 381 | host management function. These character devices are hosted in a |
378 | class dedicated for cxlflash and can be accessed via /dev/cxlflash/*. | 382 | class dedicated for cxlflash and can be accessed via `/dev/cxlflash/*`. |
379 | 383 | ||
380 | Applications can be written to perform various functions using the | 384 | Applications can be written to perform various functions using the |
381 | host ioctl APIs below. | 385 | host ioctl APIs below. |
diff --git a/Documentation/powerpc/DAWR-POWER9.txt b/Documentation/powerpc/dawr-power9.rst index ecdbb076438c..c96ab6befd9c 100644 --- a/Documentation/powerpc/DAWR-POWER9.txt +++ b/Documentation/powerpc/dawr-power9.rst | |||
@@ -1,10 +1,11 @@ | |||
1 | ===================== | ||
1 | DAWR issues on POWER9 | 2 | DAWR issues on POWER9 |
2 | ============================ | 3 | ===================== |
3 | 4 | ||
4 | On POWER9 the Data Address Watchpoint Register (DAWR) can cause a checkstop | 5 | On POWER9 the Data Address Watchpoint Register (DAWR) can cause a checkstop |
5 | if it points to cache inhibited (CI) memory. Currently Linux has no way to | 6 | if it points to cache inhibited (CI) memory. Currently Linux has no way to |
6 | disinguish CI memory when configuring the DAWR, so (for now) the DAWR is | 7 | disinguish CI memory when configuring the DAWR, so (for now) the DAWR is |
7 | disabled by this commit: | 8 | disabled by this commit:: |
8 | 9 | ||
9 | commit 9654153158d3e0684a1bdb76dbababdb7111d5a0 | 10 | commit 9654153158d3e0684a1bdb76dbababdb7111d5a0 |
10 | Author: Michael Neuling <mikey@neuling.org> | 11 | Author: Michael Neuling <mikey@neuling.org> |
@@ -12,7 +13,7 @@ disabled by this commit: | |||
12 | powerpc: Disable DAWR in the base POWER9 CPU features | 13 | powerpc: Disable DAWR in the base POWER9 CPU features |
13 | 14 | ||
14 | Technical Details: | 15 | Technical Details: |
15 | ============================ | 16 | ================== |
16 | 17 | ||
17 | DAWR has 6 different ways of being set. | 18 | DAWR has 6 different ways of being set. |
18 | 1) ptrace | 19 | 1) ptrace |
@@ -37,7 +38,7 @@ DAWR on the migration. | |||
37 | For xmon, the 'bd' command will return an error on P9. | 38 | For xmon, the 'bd' command will return an error on P9. |
38 | 39 | ||
39 | Consequences for users | 40 | Consequences for users |
40 | ============================ | 41 | ====================== |
41 | 42 | ||
42 | For GDB watchpoints (ie 'watch' command) on POWER9 bare metal , GDB | 43 | For GDB watchpoints (ie 'watch' command) on POWER9 bare metal , GDB |
43 | will accept the command. Unfortunately since there is no hardware | 44 | will accept the command. Unfortunately since there is no hardware |
@@ -57,8 +58,8 @@ trapped in GDB. The watchpoint is remembered, so if the guest is | |||
57 | migrated back to the POWER8 host, it will start working again. | 58 | migrated back to the POWER8 host, it will start working again. |
58 | 59 | ||
59 | Force enabling the DAWR | 60 | Force enabling the DAWR |
60 | ============================= | 61 | ======================= |
61 | Kernels (since ~v5.2) have an option to force enable the DAWR via: | 62 | Kernels (since ~v5.2) have an option to force enable the DAWR via:: |
62 | 63 | ||
63 | echo Y > /sys/kernel/debug/powerpc/dawr_enable_dangerous | 64 | echo Y > /sys/kernel/debug/powerpc/dawr_enable_dangerous |
64 | 65 | ||
@@ -86,5 +87,7 @@ dawr_enable_dangerous file will fail if the hypervisor doesn't support | |||
86 | writing the DAWR. | 87 | writing the DAWR. |
87 | 88 | ||
88 | To double check the DAWR is working, run this kernel selftest: | 89 | To double check the DAWR is working, run this kernel selftest: |
90 | |||
89 | tools/testing/selftests/powerpc/ptrace/ptrace-hwbreak.c | 91 | tools/testing/selftests/powerpc/ptrace/ptrace-hwbreak.c |
92 | |||
90 | Any errors/failures/skips mean something is wrong. | 93 | Any errors/failures/skips mean something is wrong. |
diff --git a/Documentation/powerpc/dscr.txt b/Documentation/powerpc/dscr.rst index ece300c64f76..2ab99006014c 100644 --- a/Documentation/powerpc/dscr.txt +++ b/Documentation/powerpc/dscr.rst | |||
@@ -1,5 +1,6 @@ | |||
1 | DSCR (Data Stream Control Register) | 1 | =================================== |
2 | ================================================ | 2 | DSCR (Data Stream Control Register) |
3 | =================================== | ||
3 | 4 | ||
4 | DSCR register in powerpc allows user to have some control of prefetch of data | 5 | DSCR register in powerpc allows user to have some control of prefetch of data |
5 | stream in the processor. Please refer to the ISA documents or related manual | 6 | stream in the processor. Please refer to the ISA documents or related manual |
@@ -10,14 +11,17 @@ user interface. | |||
10 | 11 | ||
11 | (A) Data Structures: | 12 | (A) Data Structures: |
12 | 13 | ||
13 | (1) thread_struct: | 14 | (1) thread_struct:: |
15 | |||
14 | dscr /* Thread DSCR value */ | 16 | dscr /* Thread DSCR value */ |
15 | dscr_inherit /* Thread has changed default DSCR */ | 17 | dscr_inherit /* Thread has changed default DSCR */ |
16 | 18 | ||
17 | (2) PACA: | 19 | (2) PACA:: |
20 | |||
18 | dscr_default /* per-CPU DSCR default value */ | 21 | dscr_default /* per-CPU DSCR default value */ |
19 | 22 | ||
20 | (3) sysfs.c: | 23 | (3) sysfs.c:: |
24 | |||
21 | dscr_default /* System DSCR default value */ | 25 | dscr_default /* System DSCR default value */ |
22 | 26 | ||
23 | (B) Scheduler Changes: | 27 | (B) Scheduler Changes: |
@@ -35,8 +39,8 @@ user interface. | |||
35 | 39 | ||
36 | (C) SYSFS Interface: | 40 | (C) SYSFS Interface: |
37 | 41 | ||
38 | Global DSCR default: /sys/devices/system/cpu/dscr_default | 42 | - Global DSCR default: /sys/devices/system/cpu/dscr_default |
39 | CPU specific DSCR default: /sys/devices/system/cpu/cpuN/dscr | 43 | - CPU specific DSCR default: /sys/devices/system/cpu/cpuN/dscr |
40 | 44 | ||
41 | Changing the global DSCR default in the sysfs will change all the CPU | 45 | Changing the global DSCR default in the sysfs will change all the CPU |
42 | specific DSCR defaults immediately in their PACA structures. Again if | 46 | specific DSCR defaults immediately in their PACA structures. Again if |
diff --git a/Documentation/powerpc/eeh-pci-error-recovery.txt b/Documentation/powerpc/eeh-pci-error-recovery.rst index 678189280bb4..438a87ebc095 100644 --- a/Documentation/powerpc/eeh-pci-error-recovery.txt +++ b/Documentation/powerpc/eeh-pci-error-recovery.rst | |||
@@ -1,10 +1,10 @@ | |||
1 | ========================== | ||
2 | PCI Bus EEH Error Recovery | ||
3 | ========================== | ||
1 | 4 | ||
5 | Linas Vepstas <linas@austin.ibm.com> | ||
2 | 6 | ||
3 | PCI Bus EEH Error Recovery | 7 | 12 January 2005 |
4 | -------------------------- | ||
5 | Linas Vepstas | ||
6 | <linas@austin.ibm.com> | ||
7 | 12 January 2005 | ||
8 | 8 | ||
9 | 9 | ||
10 | Overview: | 10 | Overview: |
@@ -143,17 +143,17 @@ seen in /proc/ppc64/eeh (subject to change). Normally, almost | |||
143 | all of these occur during boot, when the PCI bus is scanned, where | 143 | all of these occur during boot, when the PCI bus is scanned, where |
144 | a large number of 0xff reads are part of the bus scan procedure. | 144 | a large number of 0xff reads are part of the bus scan procedure. |
145 | 145 | ||
146 | If a frozen slot is detected, code in | 146 | If a frozen slot is detected, code in |
147 | arch/powerpc/platforms/pseries/eeh.c will print a stack trace to | 147 | arch/powerpc/platforms/pseries/eeh.c will print a stack trace to |
148 | syslog (/var/log/messages). This stack trace has proven to be very | 148 | syslog (/var/log/messages). This stack trace has proven to be very |
149 | useful to device-driver authors for finding out at what point the EEH | 149 | useful to device-driver authors for finding out at what point the EEH |
150 | error was detected, as the error itself usually occurs slightly | 150 | error was detected, as the error itself usually occurs slightly |
151 | beforehand. | 151 | beforehand. |
152 | 152 | ||
153 | Next, it uses the Linux kernel notifier chain/work queue mechanism to | 153 | Next, it uses the Linux kernel notifier chain/work queue mechanism to |
154 | allow any interested parties to find out about the failure. Device | 154 | allow any interested parties to find out about the failure. Device |
155 | drivers, or other parts of the kernel, can use | 155 | drivers, or other parts of the kernel, can use |
156 | eeh_register_notifier(struct notifier_block *) to find out about EEH | 156 | `eeh_register_notifier(struct notifier_block *)` to find out about EEH |
157 | events. The event will include a pointer to the pci device, the | 157 | events. The event will include a pointer to the pci device, the |
158 | device node and some state info. Receivers of the event can "do as | 158 | device node and some state info. Receivers of the event can "do as |
159 | they wish"; the default handler will be described further in this | 159 | they wish"; the default handler will be described further in this |
@@ -162,10 +162,13 @@ section. | |||
162 | To assist in the recovery of the device, eeh.c exports the | 162 | To assist in the recovery of the device, eeh.c exports the |
163 | following functions: | 163 | following functions: |
164 | 164 | ||
165 | rtas_set_slot_reset() -- assert the PCI #RST line for 1/8th of a second | 165 | rtas_set_slot_reset() |
166 | rtas_configure_bridge() -- ask firmware to configure any PCI bridges | 166 | assert the PCI #RST line for 1/8th of a second |
167 | rtas_configure_bridge() | ||
168 | ask firmware to configure any PCI bridges | ||
167 | located topologically under the pci slot. | 169 | located topologically under the pci slot. |
168 | eeh_save_bars() and eeh_restore_bars(): save and restore the PCI | 170 | eeh_save_bars() and eeh_restore_bars(): |
171 | save and restore the PCI | ||
169 | config-space info for a device and any devices under it. | 172 | config-space info for a device and any devices under it. |
170 | 173 | ||
171 | 174 | ||
@@ -191,7 +194,7 @@ events get delivered to user-space scripts. | |||
191 | 194 | ||
192 | Following is an example sequence of events that cause a device driver | 195 | Following is an example sequence of events that cause a device driver |
193 | close function to be called during the first phase of an EEH reset. | 196 | close function to be called during the first phase of an EEH reset. |
194 | The following sequence is an example of the pcnet32 device driver. | 197 | The following sequence is an example of the pcnet32 device driver:: |
195 | 198 | ||
196 | rpa_php_unconfig_pci_adapter (struct slot *) // in rpaphp_pci.c | 199 | rpa_php_unconfig_pci_adapter (struct slot *) // in rpaphp_pci.c |
197 | { | 200 | { |
@@ -241,53 +244,54 @@ The following sequence is an example of the pcnet32 device driver. | |||
241 | }}}}}} | 244 | }}}}}} |
242 | 245 | ||
243 | 246 | ||
244 | in drivers/pci/pci_driver.c, | 247 | in drivers/pci/pci_driver.c, |
245 | struct device_driver->remove() is just pci_device_remove() | 248 | struct device_driver->remove() is just pci_device_remove() |
246 | which calls struct pci_driver->remove() which is pcnet32_remove_one() | 249 | which calls struct pci_driver->remove() which is pcnet32_remove_one() |
247 | which calls unregister_netdev() (in net/core/dev.c) | 250 | which calls unregister_netdev() (in net/core/dev.c) |
248 | which calls dev_close() (in net/core/dev.c) | 251 | which calls dev_close() (in net/core/dev.c) |
249 | which calls dev->stop() which is pcnet32_close() | 252 | which calls dev->stop() which is pcnet32_close() |
250 | which then does the appropriate shutdown. | 253 | which then does the appropriate shutdown. |
251 | 254 | ||
252 | --- | 255 | --- |
256 | |||
253 | Following is the analogous stack trace for events sent to user-space | 257 | Following is the analogous stack trace for events sent to user-space |
254 | when the pci device is unconfigured. | 258 | when the pci device is unconfigured:: |
255 | 259 | ||
256 | rpa_php_unconfig_pci_adapter() { // in rpaphp_pci.c | 260 | rpa_php_unconfig_pci_adapter() { // in rpaphp_pci.c |
257 | calls | ||
258 | pci_remove_bus_device (struct pci_dev *) { // in /drivers/pci/remove.c | ||
259 | calls | 261 | calls |
260 | pci_destroy_dev (struct pci_dev *) { | 262 | pci_remove_bus_device (struct pci_dev *) { // in /drivers/pci/remove.c |
261 | calls | 263 | calls |
262 | device_unregister (&dev->dev) { // in /drivers/base/core.c | 264 | pci_destroy_dev (struct pci_dev *) { |
263 | calls | 265 | calls |
264 | device_del(struct device * dev) { // in /drivers/base/core.c | 266 | device_unregister (&dev->dev) { // in /drivers/base/core.c |
265 | calls | 267 | calls |
266 | kobject_del() { //in /libs/kobject.c | 268 | device_del(struct device * dev) { // in /drivers/base/core.c |
267 | calls | 269 | calls |
268 | kobject_uevent() { // in /libs/kobject.c | 270 | kobject_del() { //in /libs/kobject.c |
269 | calls | 271 | calls |
270 | kset_uevent() { // in /lib/kobject.c | 272 | kobject_uevent() { // in /libs/kobject.c |
271 | calls | 273 | calls |
272 | kset->uevent_ops->uevent() // which is really just | 274 | kset_uevent() { // in /lib/kobject.c |
273 | a call to | ||
274 | dev_uevent() { // in /drivers/base/core.c | ||
275 | calls | 275 | calls |
276 | dev->bus->uevent() which is really just a call to | 276 | kset->uevent_ops->uevent() // which is really just |
277 | pci_uevent () { // in drivers/pci/hotplug.c | 277 | a call to |
278 | which prints device name, etc.... | 278 | dev_uevent() { // in /drivers/base/core.c |
279 | calls | ||
280 | dev->bus->uevent() which is really just a call to | ||
281 | pci_uevent () { // in drivers/pci/hotplug.c | ||
282 | which prints device name, etc.... | ||
283 | } | ||
279 | } | 284 | } |
280 | } | 285 | then kobject_uevent() sends a netlink uevent to userspace |
281 | then kobject_uevent() sends a netlink uevent to userspace | 286 | --> userspace uevent |
282 | --> userspace uevent | 287 | (during early boot, nobody listens to netlink events and |
283 | (during early boot, nobody listens to netlink events and | 288 | kobject_uevent() executes uevent_helper[], which runs the |
284 | kobject_uevent() executes uevent_helper[], which runs the | 289 | event process /sbin/hotplug) |
285 | event process /sbin/hotplug) | 290 | } |
286 | } | 291 | } |
287 | } | 292 | kobject_del() then calls sysfs_remove_dir(), which would |
288 | kobject_del() then calls sysfs_remove_dir(), which would | 293 | trigger any user-space daemon that was watching /sysfs, |
289 | trigger any user-space daemon that was watching /sysfs, | 294 | and notice the delete event. |
290 | and notice the delete event. | ||
291 | 295 | ||
292 | 296 | ||
293 | Pro's and Con's of the Current Design | 297 | Pro's and Con's of the Current Design |
@@ -299,12 +303,12 @@ individual device drivers, so that the current design throws a wide net. | |||
299 | The biggest negative of the design is that it potentially disturbs | 303 | The biggest negative of the design is that it potentially disturbs |
300 | network daemons and file systems that didn't need to be disturbed. | 304 | network daemons and file systems that didn't need to be disturbed. |
301 | 305 | ||
302 | -- A minor complaint is that resetting the network card causes | 306 | - A minor complaint is that resetting the network card causes |
303 | user-space back-to-back ifdown/ifup burps that potentially disturb | 307 | user-space back-to-back ifdown/ifup burps that potentially disturb |
304 | network daemons, that didn't need to even know that the pci | 308 | network daemons, that didn't need to even know that the pci |
305 | card was being rebooted. | 309 | card was being rebooted. |
306 | 310 | ||
307 | -- A more serious concern is that the same reset, for SCSI devices, | 311 | - A more serious concern is that the same reset, for SCSI devices, |
308 | causes havoc to mounted file systems. Scripts cannot post-facto | 312 | causes havoc to mounted file systems. Scripts cannot post-facto |
309 | unmount a file system without flushing pending buffers, but this | 313 | unmount a file system without flushing pending buffers, but this |
310 | is impossible, because I/O has already been stopped. Thus, | 314 | is impossible, because I/O has already been stopped. Thus, |
@@ -322,7 +326,7 @@ network daemons and file systems that didn't need to be disturbed. | |||
322 | from the block layer. It would be very natural to add an EEH | 326 | from the block layer. It would be very natural to add an EEH |
323 | reset into this chain of events. | 327 | reset into this chain of events. |
324 | 328 | ||
325 | -- If a SCSI error occurs for the root device, all is lost unless | 329 | - If a SCSI error occurs for the root device, all is lost unless |
326 | the sysadmin had the foresight to run /bin, /sbin, /etc, /var | 330 | the sysadmin had the foresight to run /bin, /sbin, /etc, /var |
327 | and so on, out of ramdisk/tmpfs. | 331 | and so on, out of ramdisk/tmpfs. |
328 | 332 | ||
@@ -330,5 +334,3 @@ network daemons and file systems that didn't need to be disturbed. | |||
330 | Conclusions | 334 | Conclusions |
331 | ----------- | 335 | ----------- |
332 | There's forward progress ... | 336 | There's forward progress ... |
333 | |||
334 | |||
diff --git a/Documentation/powerpc/firmware-assisted-dump.txt b/Documentation/powerpc/firmware-assisted-dump.rst index 10e7f4d16c14..9ca12830a48e 100644 --- a/Documentation/powerpc/firmware-assisted-dump.txt +++ b/Documentation/powerpc/firmware-assisted-dump.rst | |||
@@ -1,7 +1,8 @@ | |||
1 | ====================== | ||
2 | Firmware-Assisted Dump | ||
3 | ====================== | ||
1 | 4 | ||
2 | Firmware-Assisted Dump | 5 | July 2011 |
3 | ------------------------ | ||
4 | July 2011 | ||
5 | 6 | ||
6 | The goal of firmware-assisted dump is to enable the dump of | 7 | The goal of firmware-assisted dump is to enable the dump of |
7 | a crashed system, and to do so from a fully-reset system, and | 8 | a crashed system, and to do so from a fully-reset system, and |
@@ -27,11 +28,11 @@ in production use. | |||
27 | Comparing with kdump or other strategies, firmware-assisted | 28 | Comparing with kdump or other strategies, firmware-assisted |
28 | dump offers several strong, practical advantages: | 29 | dump offers several strong, practical advantages: |
29 | 30 | ||
30 | -- Unlike kdump, the system has been reset, and loaded | 31 | - Unlike kdump, the system has been reset, and loaded |
31 | with a fresh copy of the kernel. In particular, | 32 | with a fresh copy of the kernel. In particular, |
32 | PCI and I/O devices have been reinitialized and are | 33 | PCI and I/O devices have been reinitialized and are |
33 | in a clean, consistent state. | 34 | in a clean, consistent state. |
34 | -- Once the dump is copied out, the memory that held the dump | 35 | - Once the dump is copied out, the memory that held the dump |
35 | is immediately available to the running kernel. And therefore, | 36 | is immediately available to the running kernel. And therefore, |
36 | unlike kdump, fadump doesn't need a 2nd reboot to get back | 37 | unlike kdump, fadump doesn't need a 2nd reboot to get back |
37 | the system to the production configuration. | 38 | the system to the production configuration. |
@@ -40,17 +41,18 @@ The above can only be accomplished by coordination with, | |||
40 | and assistance from the Power firmware. The procedure is | 41 | and assistance from the Power firmware. The procedure is |
41 | as follows: | 42 | as follows: |
42 | 43 | ||
43 | -- The first kernel registers the sections of memory with the | 44 | - The first kernel registers the sections of memory with the |
44 | Power firmware for dump preservation during OS initialization. | 45 | Power firmware for dump preservation during OS initialization. |
45 | These registered sections of memory are reserved by the first | 46 | These registered sections of memory are reserved by the first |
46 | kernel during early boot. | 47 | kernel during early boot. |
47 | 48 | ||
48 | -- When a system crashes, the Power firmware will save | 49 | - When a system crashes, the Power firmware will save |
49 | the low memory (boot memory of size larger of 5% of system RAM | 50 | the low memory (boot memory of size larger of 5% of system RAM |
50 | or 256MB) of RAM to the previous registered region. It will | 51 | or 256MB) of RAM to the previous registered region. It will |
51 | also save system registers, and hardware PTE's. | 52 | also save system registers, and hardware PTE's. |
52 | 53 | ||
53 | NOTE: The term 'boot memory' means size of the low memory chunk | 54 | NOTE: |
55 | The term 'boot memory' means size of the low memory chunk | ||
54 | that is required for a kernel to boot successfully when | 56 | that is required for a kernel to boot successfully when |
55 | booted with restricted memory. By default, the boot memory | 57 | booted with restricted memory. By default, the boot memory |
56 | size will be the larger of 5% of system RAM or 256MB. | 58 | size will be the larger of 5% of system RAM or 256MB. |
@@ -64,12 +66,12 @@ as follows: | |||
64 | as fadump uses a predefined offset to reserve memory | 66 | as fadump uses a predefined offset to reserve memory |
65 | for boot memory dump preservation in case of a crash. | 67 | for boot memory dump preservation in case of a crash. |
66 | 68 | ||
67 | -- After the low memory (boot memory) area has been saved, the | 69 | - After the low memory (boot memory) area has been saved, the |
68 | firmware will reset PCI and other hardware state. It will | 70 | firmware will reset PCI and other hardware state. It will |
69 | *not* clear the RAM. It will then launch the bootloader, as | 71 | *not* clear the RAM. It will then launch the bootloader, as |
70 | normal. | 72 | normal. |
71 | 73 | ||
72 | -- The freshly booted kernel will notice that there is a new | 74 | - The freshly booted kernel will notice that there is a new |
73 | node (ibm,dump-kernel) in the device tree, indicating that | 75 | node (ibm,dump-kernel) in the device tree, indicating that |
74 | there is crash data available from a previous boot. During | 76 | there is crash data available from a previous boot. During |
75 | the early boot OS will reserve rest of the memory above | 77 | the early boot OS will reserve rest of the memory above |
@@ -77,17 +79,18 @@ as follows: | |||
77 | size. This will make sure that the second kernel will not | 79 | size. This will make sure that the second kernel will not |
78 | touch any of the dump memory area. | 80 | touch any of the dump memory area. |
79 | 81 | ||
80 | -- User-space tools will read /proc/vmcore to obtain the contents | 82 | - User-space tools will read /proc/vmcore to obtain the contents |
81 | of memory, which holds the previous crashed kernel dump in ELF | 83 | of memory, which holds the previous crashed kernel dump in ELF |
82 | format. The userspace tools may copy this info to disk, or | 84 | format. The userspace tools may copy this info to disk, or |
83 | network, nas, san, iscsi, etc. as desired. | 85 | network, nas, san, iscsi, etc. as desired. |
84 | 86 | ||
85 | -- Once the userspace tool is done saving dump, it will echo | 87 | - Once the userspace tool is done saving dump, it will echo |
86 | '1' to /sys/kernel/fadump_release_mem to release the reserved | 88 | '1' to /sys/kernel/fadump_release_mem to release the reserved |
87 | memory back to general use, except the memory required for | 89 | memory back to general use, except the memory required for |
88 | next firmware-assisted dump registration. | 90 | next firmware-assisted dump registration. |
89 | 91 | ||
90 | e.g. | 92 | e.g.:: |
93 | |||
91 | # echo 1 > /sys/kernel/fadump_release_mem | 94 | # echo 1 > /sys/kernel/fadump_release_mem |
92 | 95 | ||
93 | Please note that the firmware-assisted dump feature | 96 | Please note that the firmware-assisted dump feature |
@@ -95,7 +98,7 @@ is only available on Power6 and above systems with recent | |||
95 | firmware versions. | 98 | firmware versions. |
96 | 99 | ||
97 | Implementation details: | 100 | Implementation details: |
98 | ---------------------- | 101 | ----------------------- |
99 | 102 | ||
100 | During boot, a check is made to see if firmware supports | 103 | During boot, a check is made to see if firmware supports |
101 | this feature on that particular machine. If it does, then | 104 | this feature on that particular machine. If it does, then |
@@ -121,7 +124,7 @@ Allocator (CMA) for memory reservation if CMA is configured for kernel. | |||
121 | With CMA reservation this memory will be available for applications to | 124 | With CMA reservation this memory will be available for applications to |
122 | use it, while kernel is prevented from using it. With this fadump will | 125 | use it, while kernel is prevented from using it. With this fadump will |
123 | still be able to capture all of the kernel memory and most of the user | 126 | still be able to capture all of the kernel memory and most of the user |
124 | space memory except the user pages that were present in CMA region. | 127 | space memory except the user pages that were present in CMA region:: |
125 | 128 | ||
126 | o Memory Reservation during first kernel | 129 | o Memory Reservation during first kernel |
127 | 130 | ||
@@ -166,7 +169,7 @@ The tools to examine the dump will be same as the ones | |||
166 | used for kdump. | 169 | used for kdump. |
167 | 170 | ||
168 | How to enable firmware-assisted dump (fadump): | 171 | How to enable firmware-assisted dump (fadump): |
169 | ------------------------------------- | 172 | ---------------------------------------------- |
170 | 173 | ||
171 | 1. Set config option CONFIG_FA_DUMP=y and build kernel. | 174 | 1. Set config option CONFIG_FA_DUMP=y and build kernel. |
172 | 2. Boot into linux kernel with 'fadump=on' kernel cmdline option. | 175 | 2. Boot into linux kernel with 'fadump=on' kernel cmdline option. |
@@ -177,19 +180,20 @@ How to enable firmware-assisted dump (fadump): | |||
177 | to specify size of the memory to reserve for boot memory dump | 180 | to specify size of the memory to reserve for boot memory dump |
178 | preservation. | 181 | preservation. |
179 | 182 | ||
180 | NOTE: 1. 'fadump_reserve_mem=' parameter has been deprecated. Instead | 183 | NOTE: |
181 | use 'crashkernel=' to specify size of the memory to reserve | 184 | 1. 'fadump_reserve_mem=' parameter has been deprecated. Instead |
182 | for boot memory dump preservation. | 185 | use 'crashkernel=' to specify size of the memory to reserve |
183 | 2. If firmware-assisted dump fails to reserve memory then it | 186 | for boot memory dump preservation. |
184 | will fallback to existing kdump mechanism if 'crashkernel=' | 187 | 2. If firmware-assisted dump fails to reserve memory then it |
185 | option is set at kernel cmdline. | 188 | will fallback to existing kdump mechanism if 'crashkernel=' |
186 | 3. if user wants to capture all of user space memory and ok with | 189 | option is set at kernel cmdline. |
187 | reserved memory not available to production system, then | 190 | 3. if user wants to capture all of user space memory and ok with |
188 | 'fadump=nocma' kernel parameter can be used to fallback to | 191 | reserved memory not available to production system, then |
189 | old behaviour. | 192 | 'fadump=nocma' kernel parameter can be used to fallback to |
193 | old behaviour. | ||
190 | 194 | ||
191 | Sysfs/debugfs files: | 195 | Sysfs/debugfs files: |
192 | ------------ | 196 | -------------------- |
193 | 197 | ||
194 | Firmware-assisted dump feature uses sysfs file system to hold | 198 | Firmware-assisted dump feature uses sysfs file system to hold |
195 | the control files and debugfs file to display memory reserved region. | 199 | the control files and debugfs file to display memory reserved region. |
@@ -197,20 +201,20 @@ the control files and debugfs file to display memory reserved region. | |||
197 | Here is the list of files under kernel sysfs: | 201 | Here is the list of files under kernel sysfs: |
198 | 202 | ||
199 | /sys/kernel/fadump_enabled | 203 | /sys/kernel/fadump_enabled |
200 | |||
201 | This is used to display the fadump status. | 204 | This is used to display the fadump status. |
202 | 0 = fadump is disabled | 205 | |
203 | 1 = fadump is enabled | 206 | - 0 = fadump is disabled |
207 | - 1 = fadump is enabled | ||
204 | 208 | ||
205 | This interface can be used by kdump init scripts to identify if | 209 | This interface can be used by kdump init scripts to identify if |
206 | fadump is enabled in the kernel and act accordingly. | 210 | fadump is enabled in the kernel and act accordingly. |
207 | 211 | ||
208 | /sys/kernel/fadump_registered | 212 | /sys/kernel/fadump_registered |
209 | |||
210 | This is used to display the fadump registration status as well | 213 | This is used to display the fadump registration status as well |
211 | as to control (start/stop) the fadump registration. | 214 | as to control (start/stop) the fadump registration. |
212 | 0 = fadump is not registered. | 215 | |
213 | 1 = fadump is registered and ready to handle system crash. | 216 | - 0 = fadump is not registered. |
217 | - 1 = fadump is registered and ready to handle system crash. | ||
214 | 218 | ||
215 | To register fadump echo 1 > /sys/kernel/fadump_registered and | 219 | To register fadump echo 1 > /sys/kernel/fadump_registered and |
216 | echo 0 > /sys/kernel/fadump_registered for un-register and stop the | 220 | echo 0 > /sys/kernel/fadump_registered for un-register and stop the |
@@ -219,13 +223,12 @@ Here is the list of files under kernel sysfs: | |||
219 | easily integrated with kdump service start/stop. | 223 | easily integrated with kdump service start/stop. |
220 | 224 | ||
221 | /sys/kernel/fadump_release_mem | 225 | /sys/kernel/fadump_release_mem |
222 | |||
223 | This file is available only when fadump is active during | 226 | This file is available only when fadump is active during |
224 | second kernel. This is used to release the reserved memory | 227 | second kernel. This is used to release the reserved memory |
225 | region that are held for saving crash dump. To release the | 228 | region that are held for saving crash dump. To release the |
226 | reserved memory echo 1 to it: | 229 | reserved memory echo 1 to it:: |
227 | 230 | ||
228 | echo 1 > /sys/kernel/fadump_release_mem | 231 | echo 1 > /sys/kernel/fadump_release_mem |
229 | 232 | ||
230 | After echo 1, the content of the /sys/kernel/debug/powerpc/fadump_region | 233 | After echo 1, the content of the /sys/kernel/debug/powerpc/fadump_region |
231 | file will change to reflect the new memory reservations. | 234 | file will change to reflect the new memory reservations. |
@@ -238,38 +241,39 @@ Here is the list of files under powerpc debugfs: | |||
238 | (Assuming debugfs is mounted on /sys/kernel/debug directory.) | 241 | (Assuming debugfs is mounted on /sys/kernel/debug directory.) |
239 | 242 | ||
240 | /sys/kernel/debug/powerpc/fadump_region | 243 | /sys/kernel/debug/powerpc/fadump_region |
241 | |||
242 | This file shows the reserved memory regions if fadump is | 244 | This file shows the reserved memory regions if fadump is |
243 | enabled otherwise this file is empty. The output format | 245 | enabled otherwise this file is empty. The output format |
244 | is: | 246 | is:: |
245 | <region>: [<start>-<end>] <reserved-size> bytes, Dumped: <dump-size> | 247 | |
248 | <region>: [<start>-<end>] <reserved-size> bytes, Dumped: <dump-size> | ||
246 | 249 | ||
247 | e.g. | 250 | e.g. |
248 | Contents when fadump is registered during first kernel | 251 | Contents when fadump is registered during first kernel:: |
249 | 252 | ||
250 | # cat /sys/kernel/debug/powerpc/fadump_region | 253 | # cat /sys/kernel/debug/powerpc/fadump_region |
251 | CPU : [0x0000006ffb0000-0x0000006fff001f] 0x40020 bytes, Dumped: 0x0 | 254 | CPU : [0x0000006ffb0000-0x0000006fff001f] 0x40020 bytes, Dumped: 0x0 |
252 | HPTE: [0x0000006fff0020-0x0000006fff101f] 0x1000 bytes, Dumped: 0x0 | 255 | HPTE: [0x0000006fff0020-0x0000006fff101f] 0x1000 bytes, Dumped: 0x0 |
253 | DUMP: [0x0000006fff1020-0x0000007fff101f] 0x10000000 bytes, Dumped: 0x0 | 256 | DUMP: [0x0000006fff1020-0x0000007fff101f] 0x10000000 bytes, Dumped: 0x0 |
254 | 257 | ||
255 | Contents when fadump is active during second kernel | 258 | Contents when fadump is active during second kernel:: |
256 | 259 | ||
257 | # cat /sys/kernel/debug/powerpc/fadump_region | 260 | # cat /sys/kernel/debug/powerpc/fadump_region |
258 | CPU : [0x0000006ffb0000-0x0000006fff001f] 0x40020 bytes, Dumped: 0x40020 | 261 | CPU : [0x0000006ffb0000-0x0000006fff001f] 0x40020 bytes, Dumped: 0x40020 |
259 | HPTE: [0x0000006fff0020-0x0000006fff101f] 0x1000 bytes, Dumped: 0x1000 | 262 | HPTE: [0x0000006fff0020-0x0000006fff101f] 0x1000 bytes, Dumped: 0x1000 |
260 | DUMP: [0x0000006fff1020-0x0000007fff101f] 0x10000000 bytes, Dumped: 0x10000000 | 263 | DUMP: [0x0000006fff1020-0x0000007fff101f] 0x10000000 bytes, Dumped: 0x10000000 |
261 | : [0x00000010000000-0x0000006ffaffff] 0x5ffb0000 bytes, Dumped: 0x5ffb0000 | 264 | : [0x00000010000000-0x0000006ffaffff] 0x5ffb0000 bytes, Dumped: 0x5ffb0000 |
262 | 265 | ||
263 | NOTE: Please refer to Documentation/filesystems/debugfs.txt on | 266 | NOTE: |
267 | Please refer to Documentation/filesystems/debugfs.txt on | ||
264 | how to mount the debugfs filesystem. | 268 | how to mount the debugfs filesystem. |
265 | 269 | ||
266 | 270 | ||
267 | TODO: | 271 | TODO: |
268 | ----- | 272 | ----- |
269 | o Need to come up with the better approach to find out more | 273 | - Need to come up with the better approach to find out more |
270 | accurate boot memory size that is required for a kernel to | 274 | accurate boot memory size that is required for a kernel to |
271 | boot successfully when booted with restricted memory. | 275 | boot successfully when booted with restricted memory. |
272 | o The fadump implementation introduces a fadump crash info structure | 276 | - The fadump implementation introduces a fadump crash info structure |
273 | in the scratch area before the ELF core header. The idea of introducing | 277 | in the scratch area before the ELF core header. The idea of introducing |
274 | this structure is to pass some important crash info data to the second | 278 | this structure is to pass some important crash info data to the second |
275 | kernel which will help second kernel to populate ELF core header with | 279 | kernel which will help second kernel to populate ELF core header with |
@@ -277,7 +281,9 @@ TODO: | |||
277 | design implementation does not address a possibility of introducing | 281 | design implementation does not address a possibility of introducing |
278 | additional fields (in future) to this structure without affecting | 282 | additional fields (in future) to this structure without affecting |
279 | compatibility. Need to come up with the better approach to address this. | 283 | compatibility. Need to come up with the better approach to address this. |
284 | |||
280 | The possible approaches are: | 285 | The possible approaches are: |
286 | |||
281 | 1. Introduce version field for version tracking, bump up the version | 287 | 1. Introduce version field for version tracking, bump up the version |
282 | whenever a new field is added to the structure in future. The version | 288 | whenever a new field is added to the structure in future. The version |
283 | field can be used to find out what fields are valid for the current | 289 | field can be used to find out what fields are valid for the current |
@@ -285,8 +291,11 @@ TODO: | |||
285 | 2. Reserve the area of predefined size (say PAGE_SIZE) for this | 291 | 2. Reserve the area of predefined size (say PAGE_SIZE) for this |
286 | structure and have unused area as reserved (initialized to zero) | 292 | structure and have unused area as reserved (initialized to zero) |
287 | for future field additions. | 293 | for future field additions. |
294 | |||
288 | The advantage of approach 1 over 2 is we don't need to reserve extra space. | 295 | The advantage of approach 1 over 2 is we don't need to reserve extra space. |
289 | --- | 296 | |
290 | Author: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com> | 297 | Author: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com> |
298 | |||
291 | This document is based on the original documentation written for phyp | 299 | This document is based on the original documentation written for phyp |
300 | |||
292 | assisted dump by Linas Vepstas and Manish Ahuja. | 301 | assisted dump by Linas Vepstas and Manish Ahuja. |
diff --git a/Documentation/powerpc/hvcs.txt b/Documentation/powerpc/hvcs.rst index a730ca5a07f8..6808acde672f 100644 --- a/Documentation/powerpc/hvcs.txt +++ b/Documentation/powerpc/hvcs.rst | |||
@@ -1,19 +1,22 @@ | |||
1 | =========================================================================== | 1 | =============================================================== |
2 | HVCS | 2 | HVCS IBM "Hypervisor Virtual Console Server" Installation Guide |
3 | IBM "Hypervisor Virtual Console Server" Installation Guide | 3 | =============================================================== |
4 | for Linux Kernel 2.6.4+ | ||
5 | Copyright (C) 2004 IBM Corporation | ||
6 | 4 | ||
7 | =========================================================================== | 5 | for Linux Kernel 2.6.4+ |
8 | NOTE:Eight space tabs are the optimum editor setting for reading this file. | ||
9 | =========================================================================== | ||
10 | 6 | ||
11 | Author(s) : Ryan S. Arnold <rsa@us.ibm.com> | 7 | Copyright (C) 2004 IBM Corporation |
12 | Date Created: March, 02, 2004 | ||
13 | Last Changed: August, 24, 2004 | ||
14 | 8 | ||
15 | --------------------------------------------------------------------------- | 9 | .. =========================================================================== |
16 | Table of contents: | 10 | .. NOTE:Eight space tabs are the optimum editor setting for reading this file. |
11 | .. =========================================================================== | ||
12 | |||
13 | |||
14 | Author(s): Ryan S. Arnold <rsa@us.ibm.com> | ||
15 | |||
16 | Date Created: March, 02, 2004 | ||
17 | Last Changed: August, 24, 2004 | ||
18 | |||
19 | .. Table of contents: | ||
17 | 20 | ||
18 | 1. Driver Introduction: | 21 | 1. Driver Introduction: |
19 | 2. System Requirements | 22 | 2. System Requirements |
@@ -27,8 +30,8 @@ Table of contents: | |||
27 | 8. Questions & Answers: | 30 | 8. Questions & Answers: |
28 | 9. Reporting Bugs: | 31 | 9. Reporting Bugs: |
29 | 32 | ||
30 | --------------------------------------------------------------------------- | ||
31 | 1. Driver Introduction: | 33 | 1. Driver Introduction: |
34 | ======================= | ||
32 | 35 | ||
33 | This is the device driver for the IBM Hypervisor Virtual Console Server, | 36 | This is the device driver for the IBM Hypervisor Virtual Console Server, |
34 | "hvcs". The IBM hvcs provides a tty driver interface to allow Linux user | 37 | "hvcs". The IBM hvcs provides a tty driver interface to allow Linux user |
@@ -38,8 +41,8 @@ ppc64 system. Physical hardware consoles per partition are not practical | |||
38 | on this hardware so system consoles are accessed by this driver using | 41 | on this hardware so system consoles are accessed by this driver using |
39 | firmware interfaces to virtual terminal devices. | 42 | firmware interfaces to virtual terminal devices. |
40 | 43 | ||
41 | --------------------------------------------------------------------------- | ||
42 | 2. System Requirements: | 44 | 2. System Requirements: |
45 | ======================= | ||
43 | 46 | ||
44 | This device driver was written using 2.6.4 Linux kernel APIs and will only | 47 | This device driver was written using 2.6.4 Linux kernel APIs and will only |
45 | build and run on kernels of this version or later. | 48 | build and run on kernels of this version or later. |
@@ -52,8 +55,8 @@ Sysfs must be mounted on the system so that the user can determine which | |||
52 | major and minor numbers are associated with each vty-server. Directions | 55 | major and minor numbers are associated with each vty-server. Directions |
53 | for sysfs mounting are outside the scope of this document. | 56 | for sysfs mounting are outside the scope of this document. |
54 | 57 | ||
55 | --------------------------------------------------------------------------- | ||
56 | 3. Build Options: | 58 | 3. Build Options: |
59 | ================= | ||
57 | 60 | ||
58 | The hvcs driver registers itself as a tty driver. The tty layer | 61 | The hvcs driver registers itself as a tty driver. The tty layer |
59 | dynamically allocates a block of major and minor numbers in a quantity | 62 | dynamically allocates a block of major and minor numbers in a quantity |
@@ -65,11 +68,11 @@ If the default number of device entries is adequate then this driver can be | |||
65 | built into the kernel. If not, the default can be over-ridden by inserting | 68 | built into the kernel. If not, the default can be over-ridden by inserting |
66 | the driver as a module with insmod parameters. | 69 | the driver as a module with insmod parameters. |
67 | 70 | ||
68 | --------------------------------------------------------------------------- | ||
69 | 3.1 Built-in: | 71 | 3.1 Built-in: |
72 | ------------- | ||
70 | 73 | ||
71 | The following menuconfig example demonstrates selecting to build this | 74 | The following menuconfig example demonstrates selecting to build this |
72 | driver into the kernel. | 75 | driver into the kernel:: |
73 | 76 | ||
74 | Device Drivers ---> | 77 | Device Drivers ---> |
75 | Character devices ---> | 78 | Character devices ---> |
@@ -77,11 +80,11 @@ driver into the kernel. | |||
77 | 80 | ||
78 | Begin the kernel make process. | 81 | Begin the kernel make process. |
79 | 82 | ||
80 | --------------------------------------------------------------------------- | ||
81 | 3.2 Module: | 83 | 3.2 Module: |
84 | ----------- | ||
82 | 85 | ||
83 | The following menuconfig example demonstrates selecting to build this | 86 | The following menuconfig example demonstrates selecting to build this |
84 | driver as a kernel module. | 87 | driver as a kernel module:: |
85 | 88 | ||
86 | Device Drivers ---> | 89 | Device Drivers ---> |
87 | Character devices ---> | 90 | Character devices ---> |
@@ -89,11 +92,11 @@ driver as a kernel module. | |||
89 | 92 | ||
90 | The make process will build the following kernel modules: | 93 | The make process will build the following kernel modules: |
91 | 94 | ||
92 | hvcs.ko | 95 | - hvcs.ko |
93 | hvcserver.ko | 96 | - hvcserver.ko |
94 | 97 | ||
95 | To insert the module with the default allocation execute the following | 98 | To insert the module with the default allocation execute the following |
96 | commands in the order they appear: | 99 | commands in the order they appear:: |
97 | 100 | ||
98 | insmod hvcserver.ko | 101 | insmod hvcserver.ko |
99 | insmod hvcs.ko | 102 | insmod hvcs.ko |
@@ -103,7 +106,7 @@ be inserted first, otherwise the hvcs module will not find some of the | |||
103 | symbols it expects. | 106 | symbols it expects. |
104 | 107 | ||
105 | To override the default use an insmod parameter as follows (requesting 4 | 108 | To override the default use an insmod parameter as follows (requesting 4 |
106 | tty devices as an example): | 109 | tty devices as an example):: |
107 | 110 | ||
108 | insmod hvcs.ko hvcs_parm_num_devs=4 | 111 | insmod hvcs.ko hvcs_parm_num_devs=4 |
109 | 112 | ||
@@ -115,31 +118,31 @@ source file before building. | |||
115 | NOTE: The length of time it takes to insmod the driver seems to be related | 118 | NOTE: The length of time it takes to insmod the driver seems to be related |
116 | to the number of tty interfaces the registering driver requests. | 119 | to the number of tty interfaces the registering driver requests. |
117 | 120 | ||
118 | In order to remove the driver module execute the following command: | 121 | In order to remove the driver module execute the following command:: |
119 | 122 | ||
120 | rmmod hvcs.ko | 123 | rmmod hvcs.ko |
121 | 124 | ||
122 | The recommended method for installing hvcs as a module is to use depmod to | 125 | The recommended method for installing hvcs as a module is to use depmod to |
123 | build a current modules.dep file in /lib/modules/`uname -r` and then | 126 | build a current modules.dep file in /lib/modules/`uname -r` and then |
124 | execute: | 127 | execute:: |
125 | 128 | ||
126 | modprobe hvcs hvcs_parm_num_devs=4 | 129 | modprobe hvcs hvcs_parm_num_devs=4 |
127 | 130 | ||
128 | The modules.dep file indicates that hvcserver.ko needs to be inserted | 131 | The modules.dep file indicates that hvcserver.ko needs to be inserted |
129 | before hvcs.ko and modprobe uses this file to smartly insert the modules in | 132 | before hvcs.ko and modprobe uses this file to smartly insert the modules in |
130 | the proper order. | 133 | the proper order. |
131 | 134 | ||
132 | The following modprobe command is used to remove hvcs and hvcserver in the | 135 | The following modprobe command is used to remove hvcs and hvcserver in the |
133 | proper order: | 136 | proper order:: |
134 | 137 | ||
135 | modprobe -r hvcs | 138 | modprobe -r hvcs |
136 | 139 | ||
137 | --------------------------------------------------------------------------- | ||
138 | 4. Installation: | 140 | 4. Installation: |
141 | ================ | ||
139 | 142 | ||
140 | The tty layer creates sysfs entries which contain the major and minor | 143 | The tty layer creates sysfs entries which contain the major and minor |
141 | numbers allocated for the hvcs driver. The following snippet of "tree" | 144 | numbers allocated for the hvcs driver. The following snippet of "tree" |
142 | output of the sysfs directory shows where these numbers are presented: | 145 | output of the sysfs directory shows where these numbers are presented:: |
143 | 146 | ||
144 | sys/ | 147 | sys/ |
145 | |-- *other sysfs base dirs* | 148 | |-- *other sysfs base dirs* |
@@ -164,7 +167,7 @@ output of the sysfs directory shows where these numbers are presented: | |||
164 | |-- *other sysfs base dirs* | 167 | |-- *other sysfs base dirs* |
165 | 168 | ||
166 | For the above examples the following output is a result of cat'ing the | 169 | For the above examples the following output is a result of cat'ing the |
167 | "dev" entry in the hvcs directory: | 170 | "dev" entry in the hvcs directory:: |
168 | 171 | ||
169 | Pow5:/sys/class/tty/hvcs0/ # cat dev | 172 | Pow5:/sys/class/tty/hvcs0/ # cat dev |
170 | 254:0 | 173 | 254:0 |
@@ -184,7 +187,7 @@ systems running hvcs will already have the device entries created or udev | |||
184 | will do it automatically. | 187 | will do it automatically. |
185 | 188 | ||
186 | Given the example output above, to manually create a /dev/hvcs* node entry | 189 | Given the example output above, to manually create a /dev/hvcs* node entry |
187 | mknod can be used as follows: | 190 | mknod can be used as follows:: |
188 | 191 | ||
189 | mknod /dev/hvcs0 c 254 0 | 192 | mknod /dev/hvcs0 c 254 0 |
190 | mknod /dev/hvcs1 c 254 1 | 193 | mknod /dev/hvcs1 c 254 1 |
@@ -195,15 +198,15 @@ Using mknod to manually create the device entries makes these device nodes | |||
195 | persistent. Once created they will exist prior to the driver insmod. | 198 | persistent. Once created they will exist prior to the driver insmod. |
196 | 199 | ||
197 | Attempting to connect an application to /dev/hvcs* prior to insertion of | 200 | Attempting to connect an application to /dev/hvcs* prior to insertion of |
198 | the hvcs module will result in an error message similar to the following: | 201 | the hvcs module will result in an error message similar to the following:: |
199 | 202 | ||
200 | "/dev/hvcs*: No such device". | 203 | "/dev/hvcs*: No such device". |
201 | 204 | ||
202 | NOTE: Just because there is a device node present doesn't mean that there | 205 | NOTE: Just because there is a device node present doesn't mean that there |
203 | is a vty-server device configured for that node. | 206 | is a vty-server device configured for that node. |
204 | 207 | ||
205 | --------------------------------------------------------------------------- | ||
206 | 5. Connection | 208 | 5. Connection |
209 | ============= | ||
207 | 210 | ||
208 | Since this driver controls devices that provide a tty interface a user can | 211 | Since this driver controls devices that provide a tty interface a user can |
209 | interact with the device node entries using any standard tty-interactive | 212 | interact with the device node entries using any standard tty-interactive |
@@ -249,7 +252,7 @@ vty-server adapter is associated with which /dev/hvcs* node a special sysfs | |||
249 | attribute has been added to each vty-server sysfs entry. This entry is | 252 | attribute has been added to each vty-server sysfs entry. This entry is |
250 | called "index" and showing it reveals an integer that refers to the | 253 | called "index" and showing it reveals an integer that refers to the |
251 | /dev/hvcs* entry to use to connect to that device. For instance cating the | 254 | /dev/hvcs* entry to use to connect to that device. For instance cating the |
252 | index attribute of vty-server adapter 30000004 shows the following. | 255 | index attribute of vty-server adapter 30000004 shows the following:: |
253 | 256 | ||
254 | Pow5:/sys/bus/vio/drivers/hvcs/30000004 # cat index | 257 | Pow5:/sys/bus/vio/drivers/hvcs/30000004 # cat index |
255 | 2 | 258 | 2 |
@@ -262,8 +265,8 @@ system the /dev/hvcs* entry that interacts with a particular vty-server | |||
262 | adapter is not guaranteed to remain the same across system reboots. Look | 265 | adapter is not guaranteed to remain the same across system reboots. Look |
263 | in the Q & A section for more on this issue. | 266 | in the Q & A section for more on this issue. |
264 | 267 | ||
265 | --------------------------------------------------------------------------- | ||
266 | 6. Disconnection | 268 | 6. Disconnection |
269 | ================ | ||
267 | 270 | ||
268 | As a security feature to prevent the delivery of stale data to an | 271 | As a security feature to prevent the delivery of stale data to an |
269 | unintended target the Power5 system firmware disables the fetching of data | 272 | unintended target the Power5 system firmware disables the fetching of data |
@@ -305,7 +308,7 @@ connection between the vty-server and target vty ONLY if the vterm_state | |||
305 | previously read '1'. The write directive is ignored if the vterm_state | 308 | previously read '1'. The write directive is ignored if the vterm_state |
306 | read '0' or if any value other than '0' was written to the vterm_state | 309 | read '0' or if any value other than '0' was written to the vterm_state |
307 | attribute. The following example will show the method used for verifying | 310 | attribute. The following example will show the method used for verifying |
308 | the vty-server connection status and disconnecting a vty-server connection. | 311 | the vty-server connection status and disconnecting a vty-server connection:: |
309 | 312 | ||
310 | Pow5:/sys/bus/vio/drivers/hvcs/30000004 # cat vterm_state | 313 | Pow5:/sys/bus/vio/drivers/hvcs/30000004 # cat vterm_state |
311 | 1 | 314 | 1 |
@@ -318,12 +321,12 @@ the vty-server connection status and disconnecting a vty-server connection. | |||
318 | All vty-server connections are automatically terminated when the device is | 321 | All vty-server connections are automatically terminated when the device is |
319 | hotplug removed and when the module is removed. | 322 | hotplug removed and when the module is removed. |
320 | 323 | ||
321 | --------------------------------------------------------------------------- | ||
322 | 7. Configuration | 324 | 7. Configuration |
325 | ================ | ||
323 | 326 | ||
324 | Each vty-server has a sysfs entry in the /sys/devices/vio directory, which | 327 | Each vty-server has a sysfs entry in the /sys/devices/vio directory, which |
325 | is symlinked in several other sysfs tree directories, notably under the | 328 | is symlinked in several other sysfs tree directories, notably under the |
326 | hvcs driver entry, which looks like the following example: | 329 | hvcs driver entry, which looks like the following example:: |
327 | 330 | ||
328 | Pow5:/sys/bus/vio/drivers/hvcs # ls | 331 | Pow5:/sys/bus/vio/drivers/hvcs # ls |
329 | . .. 30000003 30000004 rescan | 332 | . .. 30000003 30000004 rescan |
@@ -344,7 +347,7 @@ completed or was never executed. | |||
344 | 347 | ||
345 | Vty-server entries in this directory are a 32 bit partition unique unit | 348 | Vty-server entries in this directory are a 32 bit partition unique unit |
346 | address that is created by firmware. An example vty-server sysfs entry | 349 | address that is created by firmware. An example vty-server sysfs entry |
347 | looks like the following: | 350 | looks like the following:: |
348 | 351 | ||
349 | Pow5:/sys/bus/vio/drivers/hvcs/30000004 # ls | 352 | Pow5:/sys/bus/vio/drivers/hvcs/30000004 # ls |
350 | . current_vty devspec name partner_vtys | 353 | . current_vty devspec name partner_vtys |
@@ -352,21 +355,21 @@ looks like the following: | |||
352 | 355 | ||
353 | Each entry is provided, by default with a "name" attribute. Reading the | 356 | Each entry is provided, by default with a "name" attribute. Reading the |
354 | "name" attribute will reveal the device type as shown in the following | 357 | "name" attribute will reveal the device type as shown in the following |
355 | example: | 358 | example:: |
356 | 359 | ||
357 | Pow5:/sys/bus/vio/drivers/hvcs/30000003 # cat name | 360 | Pow5:/sys/bus/vio/drivers/hvcs/30000003 # cat name |
358 | vty-server | 361 | vty-server |
359 | 362 | ||
360 | Each entry is also provided, by default, with a "devspec" attribute which | 363 | Each entry is also provided, by default, with a "devspec" attribute which |
361 | reveals the full device specification when read, as shown in the following | 364 | reveals the full device specification when read, as shown in the following |
362 | example: | 365 | example:: |
363 | 366 | ||
364 | Pow5:/sys/bus/vio/drivers/hvcs/30000004 # cat devspec | 367 | Pow5:/sys/bus/vio/drivers/hvcs/30000004 # cat devspec |
365 | /vdevice/vty-server@30000004 | 368 | /vdevice/vty-server@30000004 |
366 | 369 | ||
367 | Each vty-server sysfs dir is provided with two read-only attributes that | 370 | Each vty-server sysfs dir is provided with two read-only attributes that |
368 | provide lists of easily parsed partner vty data: "partner_vtys" and | 371 | provide lists of easily parsed partner vty data: "partner_vtys" and |
369 | "partner_clcs". | 372 | "partner_clcs":: |
370 | 373 | ||
371 | Pow5:/sys/bus/vio/drivers/hvcs/30000004 # cat partner_vtys | 374 | Pow5:/sys/bus/vio/drivers/hvcs/30000004 # cat partner_vtys |
372 | 30000000 | 375 | 30000000 |
@@ -396,7 +399,7 @@ A vty-server can only be connected to a single vty at a time. The entry, | |||
396 | read. | 399 | read. |
397 | 400 | ||
398 | The current_vty can be changed by writing a valid partner clc to the entry | 401 | The current_vty can be changed by writing a valid partner clc to the entry |
399 | as in the following example: | 402 | as in the following example:: |
400 | 403 | ||
401 | Pow5:/sys/bus/vio/drivers/hvcs/30000004 # echo U5112.428.10304 | 404 | Pow5:/sys/bus/vio/drivers/hvcs/30000004 # echo U5112.428.10304 |
402 | 8A-V4-C0 > current_vty | 405 | 8A-V4-C0 > current_vty |
@@ -408,9 +411,9 @@ currently open connection is freed. | |||
408 | Information on the "vterm_state" attribute was covered earlier on the | 411 | Information on the "vterm_state" attribute was covered earlier on the |
409 | chapter entitled "disconnection". | 412 | chapter entitled "disconnection". |
410 | 413 | ||
411 | --------------------------------------------------------------------------- | ||
412 | 8. Questions & Answers: | 414 | 8. Questions & Answers: |
413 | =========================================================================== | 415 | ======================= |
416 | |||
414 | Q: What are the security concerns involving hvcs? | 417 | Q: What are the security concerns involving hvcs? |
415 | 418 | ||
416 | A: There are three main security concerns: | 419 | A: There are three main security concerns: |
@@ -429,6 +432,7 @@ A: There are three main security concerns: | |||
429 | partition) will experience the previously logged in session. | 432 | partition) will experience the previously logged in session. |
430 | 433 | ||
431 | --------------------------------------------------------------------------- | 434 | --------------------------------------------------------------------------- |
435 | |||
432 | Q: How do I multiplex a console that I grab through hvcs so that other | 436 | Q: How do I multiplex a console that I grab through hvcs so that other |
433 | people can see it: | 437 | people can see it: |
434 | 438 | ||
@@ -440,6 +444,7 @@ term type "screen" to others. This means that curses based programs may | |||
440 | not display properly in screen sessions. | 444 | not display properly in screen sessions. |
441 | 445 | ||
442 | --------------------------------------------------------------------------- | 446 | --------------------------------------------------------------------------- |
447 | |||
443 | Q: Why are the colors all messed up? | 448 | Q: Why are the colors all messed up? |
444 | Q: Why are the control characters acting strange or not working? | 449 | Q: Why are the control characters acting strange or not working? |
445 | Q: Why is the console output all strange and unintelligible? | 450 | Q: Why is the console output all strange and unintelligible? |
@@ -455,6 +460,7 @@ disconnect from the console. This will ensure that the next user gets | |||
455 | their own TERM type set when they login. | 460 | their own TERM type set when they login. |
456 | 461 | ||
457 | --------------------------------------------------------------------------- | 462 | --------------------------------------------------------------------------- |
463 | |||
458 | Q: When I try to CONNECT kermit to an hvcs device I get: | 464 | Q: When I try to CONNECT kermit to an hvcs device I get: |
459 | "Sorry, can't open connection: /dev/hvcs*"What is happening? | 465 | "Sorry, can't open connection: /dev/hvcs*"What is happening? |
460 | 466 | ||
@@ -490,6 +496,7 @@ A: There is not a corresponding vty-server device that maps to an existing | |||
490 | /dev/hvcs* entry. | 496 | /dev/hvcs* entry. |
491 | 497 | ||
492 | --------------------------------------------------------------------------- | 498 | --------------------------------------------------------------------------- |
499 | |||
493 | Q: When I try to CONNECT kermit to an hvcs device I get: | 500 | Q: When I try to CONNECT kermit to an hvcs device I get: |
494 | "Sorry, write access to UUCP lockfile directory denied." | 501 | "Sorry, write access to UUCP lockfile directory denied." |
495 | 502 | ||
@@ -497,6 +504,7 @@ A: The /dev/hvcs* entry you have specified doesn't exist where you said it | |||
497 | does? Maybe you haven't inserted the module (on systems with udev). | 504 | does? Maybe you haven't inserted the module (on systems with udev). |
498 | 505 | ||
499 | --------------------------------------------------------------------------- | 506 | --------------------------------------------------------------------------- |
507 | |||
500 | Q: If I already have one Linux partition installed can I use hvcs on said | 508 | Q: If I already have one Linux partition installed can I use hvcs on said |
501 | partition to provide the console for the install of a second Linux | 509 | partition to provide the console for the install of a second Linux |
502 | partition? | 510 | partition? |
@@ -505,6 +513,7 @@ A: Yes granted that your are connected to the /dev/hvcs* device using | |||
505 | kermit or cu or some other program that doesn't provide terminal emulation. | 513 | kermit or cu or some other program that doesn't provide terminal emulation. |
506 | 514 | ||
507 | --------------------------------------------------------------------------- | 515 | --------------------------------------------------------------------------- |
516 | |||
508 | Q: Can I connect to more than one partition's console at a time using this | 517 | Q: Can I connect to more than one partition's console at a time using this |
509 | driver? | 518 | driver? |
510 | 519 | ||
@@ -512,6 +521,7 @@ A: Yes. Of course this means that there must be more than one vty-server | |||
512 | configured for this partition and each must point to a disconnected vty. | 521 | configured for this partition and each must point to a disconnected vty. |
513 | 522 | ||
514 | --------------------------------------------------------------------------- | 523 | --------------------------------------------------------------------------- |
524 | |||
515 | Q: Does the hvcs driver support dynamic (hotplug) addition of devices? | 525 | Q: Does the hvcs driver support dynamic (hotplug) addition of devices? |
516 | 526 | ||
517 | A: Yes, if you have dlpar and hotplug enabled for your system and it has | 527 | A: Yes, if you have dlpar and hotplug enabled for your system and it has |
@@ -519,6 +529,7 @@ been built into the kernel the hvcs drivers is configured to dynamically | |||
519 | handle additions of new devices and removals of unused devices. | 529 | handle additions of new devices and removals of unused devices. |
520 | 530 | ||
521 | --------------------------------------------------------------------------- | 531 | --------------------------------------------------------------------------- |
532 | |||
522 | Q: For some reason /dev/hvcs* doesn't map to the same vty-server adapter | 533 | Q: For some reason /dev/hvcs* doesn't map to the same vty-server adapter |
523 | after a reboot. What happened? | 534 | after a reboot. What happened? |
524 | 535 | ||
@@ -533,6 +544,7 @@ on how to determine which vty-server goes with which /dev/hvcs* node. | |||
533 | Hint; look at the sysfs "index" attribute for the vty-server. | 544 | Hint; look at the sysfs "index" attribute for the vty-server. |
534 | 545 | ||
535 | --------------------------------------------------------------------------- | 546 | --------------------------------------------------------------------------- |
547 | |||
536 | Q: Can I use /dev/hvcs* as a conduit to another partition and use a tty | 548 | Q: Can I use /dev/hvcs* as a conduit to another partition and use a tty |
537 | device on that partition as the other end of the pipe? | 549 | device on that partition as the other end of the pipe? |
538 | 550 | ||
@@ -554,7 +566,9 @@ read or write to /dev/hvcs*. Now you have a tty conduit between two | |||
554 | partitions. | 566 | partitions. |
555 | 567 | ||
556 | --------------------------------------------------------------------------- | 568 | --------------------------------------------------------------------------- |
569 | |||
557 | 9. Reporting Bugs: | 570 | 9. Reporting Bugs: |
571 | ================== | ||
558 | 572 | ||
559 | The proper channel for reporting bugs is either through the Linux OS | 573 | The proper channel for reporting bugs is either through the Linux OS |
560 | distribution company that provided your OS or by posting issues to the | 574 | distribution company that provided your OS or by posting issues to the |
diff --git a/Documentation/powerpc/index.rst b/Documentation/powerpc/index.rst new file mode 100644 index 000000000000..549b1cdd77ae --- /dev/null +++ b/Documentation/powerpc/index.rst | |||
@@ -0,0 +1,34 @@ | |||
1 | .. SPDX-License-Identifier: GPL-2.0 | ||
2 | |||
3 | ======= | ||
4 | powerpc | ||
5 | ======= | ||
6 | |||
7 | .. toctree:: | ||
8 | :maxdepth: 1 | ||
9 | |||
10 | bootwrapper | ||
11 | cpu_families | ||
12 | cpu_features | ||
13 | cxl | ||
14 | cxlflash | ||
15 | dawr-power9 | ||
16 | dscr | ||
17 | eeh-pci-error-recovery | ||
18 | firmware-assisted-dump | ||
19 | hvcs | ||
20 | isa-versions | ||
21 | mpc52xx | ||
22 | pci_iov_resource_on_powernv | ||
23 | pmu-ebb | ||
24 | ptrace | ||
25 | qe_firmware | ||
26 | syscall64-abi | ||
27 | transactional_memory | ||
28 | |||
29 | .. only:: subproject and html | ||
30 | |||
31 | Indices | ||
32 | ======= | ||
33 | |||
34 | * :ref:`genindex` | ||
diff --git a/Documentation/powerpc/isa-versions.rst b/Documentation/powerpc/isa-versions.rst index 66c24140ebf1..a363d8c1603c 100644 --- a/Documentation/powerpc/isa-versions.rst +++ b/Documentation/powerpc/isa-versions.rst | |||
@@ -1,13 +1,12 @@ | |||
1 | :orphan: | 1 | ========================== |
2 | |||
3 | CPU to ISA Version Mapping | 2 | CPU to ISA Version Mapping |
4 | ========================== | 3 | ========================== |
5 | 4 | ||
6 | Mapping of some CPU versions to relevant ISA versions. | 5 | Mapping of some CPU versions to relevant ISA versions. |
7 | 6 | ||
8 | ========= ==================== | 7 | ========= ==================================================================== |
9 | CPU Architecture version | 8 | CPU Architecture version |
10 | ========= ==================== | 9 | ========= ==================================================================== |
11 | Power9 Power ISA v3.0B | 10 | Power9 Power ISA v3.0B |
12 | Power8 Power ISA v2.07 | 11 | Power8 Power ISA v2.07 |
13 | Power7 Power ISA v2.06 | 12 | Power7 Power ISA v2.06 |
@@ -24,7 +23,7 @@ PPC970 - PowerPC User Instruction Set Architecture Book I v2.01 | |||
24 | - PowerPC Virtual Environment Architecture Book II v2.01 | 23 | - PowerPC Virtual Environment Architecture Book II v2.01 |
25 | - PowerPC Operating Environment Architecture Book III v2.01 | 24 | - PowerPC Operating Environment Architecture Book III v2.01 |
26 | - Plus Altivec/VMX ~= 2.03 | 25 | - Plus Altivec/VMX ~= 2.03 |
27 | ========= ==================== | 26 | ========= ==================================================================== |
28 | 27 | ||
29 | 28 | ||
30 | Key Features | 29 | Key Features |
@@ -60,9 +59,9 @@ Power5 No | |||
60 | PPC970 No | 59 | PPC970 No |
61 | ========== ==== | 60 | ========== ==== |
62 | 61 | ||
63 | ========== ==================== | 62 | ========== ==================================== |
64 | CPU Transactional Memory | 63 | CPU Transactional Memory |
65 | ========== ==================== | 64 | ========== ==================================== |
66 | Power9 Yes (* see transactional_memory.txt) | 65 | Power9 Yes (* see transactional_memory.txt) |
67 | Power8 Yes | 66 | Power8 Yes |
68 | Power7 No | 67 | Power7 No |
@@ -73,4 +72,4 @@ Power5++ No | |||
73 | Power5+ No | 72 | Power5+ No |
74 | Power5 No | 73 | Power5 No |
75 | PPC970 No | 74 | PPC970 No |
76 | ========== ==================== | 75 | ========== ==================================== |
diff --git a/Documentation/powerpc/mpc52xx.txt b/Documentation/powerpc/mpc52xx.rst index 0d540a31ea1a..8676ac63e077 100644 --- a/Documentation/powerpc/mpc52xx.txt +++ b/Documentation/powerpc/mpc52xx.rst | |||
@@ -1,11 +1,13 @@ | |||
1 | ============================= | ||
1 | Linux 2.6.x on MPC52xx family | 2 | Linux 2.6.x on MPC52xx family |
2 | ----------------------------- | 3 | ============================= |
3 | 4 | ||
4 | For the latest info, go to http://www.246tNt.com/mpc52xx/ | 5 | For the latest info, go to http://www.246tNt.com/mpc52xx/ |
5 | 6 | ||
6 | To compile/use : | 7 | To compile/use : |
7 | 8 | ||
8 | - U-Boot: | 9 | - U-Boot:: |
10 | |||
9 | # <edit Makefile to set ARCH=ppc & CROSS_COMPILE=... ( also EXTRAVERSION | 11 | # <edit Makefile to set ARCH=ppc & CROSS_COMPILE=... ( also EXTRAVERSION |
10 | if you wish to ). | 12 | if you wish to ). |
11 | # make lite5200_defconfig | 13 | # make lite5200_defconfig |
@@ -16,7 +18,8 @@ To compile/use : | |||
16 | => tftpboot 400000 pRamdisk | 18 | => tftpboot 400000 pRamdisk |
17 | => bootm 200000 400000 | 19 | => bootm 200000 400000 |
18 | 20 | ||
19 | - DBug: | 21 | - DBug:: |
22 | |||
20 | # <edit Makefile to set ARCH=ppc & CROSS_COMPILE=... ( also EXTRAVERSION | 23 | # <edit Makefile to set ARCH=ppc & CROSS_COMPILE=... ( also EXTRAVERSION |
21 | if you wish to ). | 24 | if you wish to ). |
22 | # make lite5200_defconfig | 25 | # make lite5200_defconfig |
@@ -28,7 +31,8 @@ To compile/use : | |||
28 | DBug> dn -i zImage.initrd.lite5200 | 31 | DBug> dn -i zImage.initrd.lite5200 |
29 | 32 | ||
30 | 33 | ||
31 | Some remarks : | 34 | Some remarks: |
35 | |||
32 | - The port is named mpc52xxx, and config options are PPC_MPC52xx. The MGT5100 | 36 | - The port is named mpc52xxx, and config options are PPC_MPC52xx. The MGT5100 |
33 | is not supported, and I'm not sure anyone is interesting in working on it | 37 | is not supported, and I'm not sure anyone is interesting in working on it |
34 | so. I didn't took 5xxx because there's apparently a lot of 5xxx that have | 38 | so. I didn't took 5xxx because there's apparently a lot of 5xxx that have |
diff --git a/Documentation/powerpc/pci_iov_resource_on_powernv.txt b/Documentation/powerpc/pci_iov_resource_on_powernv.rst index b55c5cd83f8d..f5a5793e1613 100644 --- a/Documentation/powerpc/pci_iov_resource_on_powernv.txt +++ b/Documentation/powerpc/pci_iov_resource_on_powernv.rst | |||
@@ -1,6 +1,13 @@ | |||
1 | =================================================== | ||
2 | PCI Express I/O Virtualization Resource on Powerenv | ||
3 | =================================================== | ||
4 | |||
1 | Wei Yang <weiyang@linux.vnet.ibm.com> | 5 | Wei Yang <weiyang@linux.vnet.ibm.com> |
6 | |||
2 | Benjamin Herrenschmidt <benh@au1.ibm.com> | 7 | Benjamin Herrenschmidt <benh@au1.ibm.com> |
8 | |||
3 | Bjorn Helgaas <bhelgaas@google.com> | 9 | Bjorn Helgaas <bhelgaas@google.com> |
10 | |||
4 | 26 Aug 2014 | 11 | 26 Aug 2014 |
5 | 12 | ||
6 | This document describes the requirement from hardware for PCI MMIO resource | 13 | This document describes the requirement from hardware for PCI MMIO resource |
@@ -10,6 +17,7 @@ Endpoints and the implementation on P8 (IODA2). The next two sections talks | |||
10 | about considerations on enabling SRIOV on IODA2. | 17 | about considerations on enabling SRIOV on IODA2. |
11 | 18 | ||
12 | 1. Introduction to Partitionable Endpoints | 19 | 1. Introduction to Partitionable Endpoints |
20 | ========================================== | ||
13 | 21 | ||
14 | A Partitionable Endpoint (PE) is a way to group the various resources | 22 | A Partitionable Endpoint (PE) is a way to group the various resources |
15 | associated with a device or a set of devices to provide isolation between | 23 | associated with a device or a set of devices to provide isolation between |
@@ -35,6 +43,7 @@ is a completely separate HW entity that replicates the entire logic, so has | |||
35 | its own set of PEs, etc. | 43 | its own set of PEs, etc. |
36 | 44 | ||
37 | 2. Implementation of Partitionable Endpoints on P8 (IODA2) | 45 | 2. Implementation of Partitionable Endpoints on P8 (IODA2) |
46 | ========================================================== | ||
38 | 47 | ||
39 | P8 supports up to 256 Partitionable Endpoints per PHB. | 48 | P8 supports up to 256 Partitionable Endpoints per PHB. |
40 | 49 | ||
@@ -149,6 +158,7 @@ P8 supports up to 256 Partitionable Endpoints per PHB. | |||
149 | sense, but we haven't done it yet. | 158 | sense, but we haven't done it yet. |
150 | 159 | ||
151 | 3. Considerations for SR-IOV on PowerKVM | 160 | 3. Considerations for SR-IOV on PowerKVM |
161 | ======================================== | ||
152 | 162 | ||
153 | * SR-IOV Background | 163 | * SR-IOV Background |
154 | 164 | ||
@@ -224,7 +234,7 @@ P8 supports up to 256 Partitionable Endpoints per PHB. | |||
224 | IODA supports 256 PEs, so segmented windows contain 256 segments, so if | 234 | IODA supports 256 PEs, so segmented windows contain 256 segments, so if |
225 | total_VFs is less than 256, we have the situation in Figure 1.0, where | 235 | total_VFs is less than 256, we have the situation in Figure 1.0, where |
226 | segments [total_VFs, 255] of the M64 window may map to some MMIO range on | 236 | segments [total_VFs, 255] of the M64 window may map to some MMIO range on |
227 | other devices: | 237 | other devices:: |
228 | 238 | ||
229 | 0 1 total_VFs - 1 | 239 | 0 1 total_VFs - 1 |
230 | +------+------+- -+------+------+ | 240 | +------+------+- -+------+------+ |
@@ -243,7 +253,7 @@ P8 supports up to 256 Partitionable Endpoints per PHB. | |||
243 | Figure 1.0 Direct map VF(n) BAR space | 253 | Figure 1.0 Direct map VF(n) BAR space |
244 | 254 | ||
245 | Our current solution is to allocate 256 segments even if the VF(n) BAR | 255 | Our current solution is to allocate 256 segments even if the VF(n) BAR |
246 | space doesn't need that much, as shown in Figure 1.1: | 256 | space doesn't need that much, as shown in Figure 1.1:: |
247 | 257 | ||
248 | 0 1 total_VFs - 1 255 | 258 | 0 1 total_VFs - 1 255 |
249 | +------+------+- -+------+------+- -+------+------+ | 259 | +------+------+- -+------+------+- -+------+------+ |
@@ -269,6 +279,7 @@ P8 supports up to 256 Partitionable Endpoints per PHB. | |||
269 | responds to segments [total_VFs, 255]. | 279 | responds to segments [total_VFs, 255]. |
270 | 280 | ||
271 | 4. Implications for the Generic PCI Code | 281 | 4. Implications for the Generic PCI Code |
282 | ======================================== | ||
272 | 283 | ||
273 | The PCIe SR-IOV spec requires that the base of the VF(n) BAR space be | 284 | The PCIe SR-IOV spec requires that the base of the VF(n) BAR space be |
274 | aligned to the size of an individual VF BAR. | 285 | aligned to the size of an individual VF BAR. |
diff --git a/Documentation/powerpc/pmu-ebb.txt b/Documentation/powerpc/pmu-ebb.rst index 73cd163dbfb8..4f474758eb55 100644 --- a/Documentation/powerpc/pmu-ebb.txt +++ b/Documentation/powerpc/pmu-ebb.rst | |||
@@ -1,3 +1,4 @@ | |||
1 | ======================== | ||
1 | PMU Event Based Branches | 2 | PMU Event Based Branches |
2 | ======================== | 3 | ======================== |
3 | 4 | ||
diff --git a/Documentation/powerpc/ptrace.rst b/Documentation/powerpc/ptrace.rst new file mode 100644 index 000000000000..864d4b6dddd1 --- /dev/null +++ b/Documentation/powerpc/ptrace.rst | |||
@@ -0,0 +1,156 @@ | |||
1 | ====== | ||
2 | Ptrace | ||
3 | ====== | ||
4 | |||
5 | GDB intends to support the following hardware debug features of BookE | ||
6 | processors: | ||
7 | |||
8 | 4 hardware breakpoints (IAC) | ||
9 | 2 hardware watchpoints (read, write and read-write) (DAC) | ||
10 | 2 value conditions for the hardware watchpoints (DVC) | ||
11 | |||
12 | For that, we need to extend ptrace so that GDB can query and set these | ||
13 | resources. Since we're extending, we're trying to create an interface | ||
14 | that's extendable and that covers both BookE and server processors, so | ||
15 | that GDB doesn't need to special-case each of them. We added the | ||
16 | following 3 new ptrace requests. | ||
17 | |||
18 | 1. PTRACE_PPC_GETHWDEBUGINFO | ||
19 | ============================ | ||
20 | |||
21 | Query for GDB to discover the hardware debug features. The main info to | ||
22 | be returned here is the minimum alignment for the hardware watchpoints. | ||
23 | BookE processors don't have restrictions here, but server processors have | ||
24 | an 8-byte alignment restriction for hardware watchpoints. We'd like to avoid | ||
25 | adding special cases to GDB based on what it sees in AUXV. | ||
26 | |||
27 | Since we're at it, we added other useful info that the kernel can return to | ||
28 | GDB: this query will return the number of hardware breakpoints, hardware | ||
29 | watchpoints and whether it supports a range of addresses and a condition. | ||
30 | The query will fill the following structure provided by the requesting process:: | ||
31 | |||
32 | struct ppc_debug_info { | ||
33 | unit32_t version; | ||
34 | unit32_t num_instruction_bps; | ||
35 | unit32_t num_data_bps; | ||
36 | unit32_t num_condition_regs; | ||
37 | unit32_t data_bp_alignment; | ||
38 | unit32_t sizeof_condition; /* size of the DVC register */ | ||
39 | uint64_t features; /* bitmask of the individual flags */ | ||
40 | }; | ||
41 | |||
42 | features will have bits indicating whether there is support for:: | ||
43 | |||
44 | #define PPC_DEBUG_FEATURE_INSN_BP_RANGE 0x1 | ||
45 | #define PPC_DEBUG_FEATURE_INSN_BP_MASK 0x2 | ||
46 | #define PPC_DEBUG_FEATURE_DATA_BP_RANGE 0x4 | ||
47 | #define PPC_DEBUG_FEATURE_DATA_BP_MASK 0x8 | ||
48 | #define PPC_DEBUG_FEATURE_DATA_BP_DAWR 0x10 | ||
49 | |||
50 | 2. PTRACE_SETHWDEBUG | ||
51 | |||
52 | Sets a hardware breakpoint or watchpoint, according to the provided structure:: | ||
53 | |||
54 | struct ppc_hw_breakpoint { | ||
55 | uint32_t version; | ||
56 | #define PPC_BREAKPOINT_TRIGGER_EXECUTE 0x1 | ||
57 | #define PPC_BREAKPOINT_TRIGGER_READ 0x2 | ||
58 | #define PPC_BREAKPOINT_TRIGGER_WRITE 0x4 | ||
59 | uint32_t trigger_type; /* only some combinations allowed */ | ||
60 | #define PPC_BREAKPOINT_MODE_EXACT 0x0 | ||
61 | #define PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE 0x1 | ||
62 | #define PPC_BREAKPOINT_MODE_RANGE_EXCLUSIVE 0x2 | ||
63 | #define PPC_BREAKPOINT_MODE_MASK 0x3 | ||
64 | uint32_t addr_mode; /* address match mode */ | ||
65 | |||
66 | #define PPC_BREAKPOINT_CONDITION_MODE 0x3 | ||
67 | #define PPC_BREAKPOINT_CONDITION_NONE 0x0 | ||
68 | #define PPC_BREAKPOINT_CONDITION_AND 0x1 | ||
69 | #define PPC_BREAKPOINT_CONDITION_EXACT 0x1 /* different name for the same thing as above */ | ||
70 | #define PPC_BREAKPOINT_CONDITION_OR 0x2 | ||
71 | #define PPC_BREAKPOINT_CONDITION_AND_OR 0x3 | ||
72 | #define PPC_BREAKPOINT_CONDITION_BE_ALL 0x00ff0000 /* byte enable bits */ | ||
73 | #define PPC_BREAKPOINT_CONDITION_BE(n) (1<<((n)+16)) | ||
74 | uint32_t condition_mode; /* break/watchpoint condition flags */ | ||
75 | |||
76 | uint64_t addr; | ||
77 | uint64_t addr2; | ||
78 | uint64_t condition_value; | ||
79 | }; | ||
80 | |||
81 | A request specifies one event, not necessarily just one register to be set. | ||
82 | For instance, if the request is for a watchpoint with a condition, both the | ||
83 | DAC and DVC registers will be set in the same request. | ||
84 | |||
85 | With this GDB can ask for all kinds of hardware breakpoints and watchpoints | ||
86 | that the BookE supports. COMEFROM breakpoints available in server processors | ||
87 | are not contemplated, but that is out of the scope of this work. | ||
88 | |||
89 | ptrace will return an integer (handle) uniquely identifying the breakpoint or | ||
90 | watchpoint just created. This integer will be used in the PTRACE_DELHWDEBUG | ||
91 | request to ask for its removal. Return -ENOSPC if the requested breakpoint | ||
92 | can't be allocated on the registers. | ||
93 | |||
94 | Some examples of using the structure to: | ||
95 | |||
96 | - set a breakpoint in the first breakpoint register:: | ||
97 | |||
98 | p.version = PPC_DEBUG_CURRENT_VERSION; | ||
99 | p.trigger_type = PPC_BREAKPOINT_TRIGGER_EXECUTE; | ||
100 | p.addr_mode = PPC_BREAKPOINT_MODE_EXACT; | ||
101 | p.condition_mode = PPC_BREAKPOINT_CONDITION_NONE; | ||
102 | p.addr = (uint64_t) address; | ||
103 | p.addr2 = 0; | ||
104 | p.condition_value = 0; | ||
105 | |||
106 | - set a watchpoint which triggers on reads in the second watchpoint register:: | ||
107 | |||
108 | p.version = PPC_DEBUG_CURRENT_VERSION; | ||
109 | p.trigger_type = PPC_BREAKPOINT_TRIGGER_READ; | ||
110 | p.addr_mode = PPC_BREAKPOINT_MODE_EXACT; | ||
111 | p.condition_mode = PPC_BREAKPOINT_CONDITION_NONE; | ||
112 | p.addr = (uint64_t) address; | ||
113 | p.addr2 = 0; | ||
114 | p.condition_value = 0; | ||
115 | |||
116 | - set a watchpoint which triggers only with a specific value:: | ||
117 | |||
118 | p.version = PPC_DEBUG_CURRENT_VERSION; | ||
119 | p.trigger_type = PPC_BREAKPOINT_TRIGGER_READ; | ||
120 | p.addr_mode = PPC_BREAKPOINT_MODE_EXACT; | ||
121 | p.condition_mode = PPC_BREAKPOINT_CONDITION_AND | PPC_BREAKPOINT_CONDITION_BE_ALL; | ||
122 | p.addr = (uint64_t) address; | ||
123 | p.addr2 = 0; | ||
124 | p.condition_value = (uint64_t) condition; | ||
125 | |||
126 | - set a ranged hardware breakpoint:: | ||
127 | |||
128 | p.version = PPC_DEBUG_CURRENT_VERSION; | ||
129 | p.trigger_type = PPC_BREAKPOINT_TRIGGER_EXECUTE; | ||
130 | p.addr_mode = PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE; | ||
131 | p.condition_mode = PPC_BREAKPOINT_CONDITION_NONE; | ||
132 | p.addr = (uint64_t) begin_range; | ||
133 | p.addr2 = (uint64_t) end_range; | ||
134 | p.condition_value = 0; | ||
135 | |||
136 | - set a watchpoint in server processors (BookS):: | ||
137 | |||
138 | p.version = 1; | ||
139 | p.trigger_type = PPC_BREAKPOINT_TRIGGER_RW; | ||
140 | p.addr_mode = PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE; | ||
141 | or | ||
142 | p.addr_mode = PPC_BREAKPOINT_MODE_EXACT; | ||
143 | |||
144 | p.condition_mode = PPC_BREAKPOINT_CONDITION_NONE; | ||
145 | p.addr = (uint64_t) begin_range; | ||
146 | /* For PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE addr2 needs to be specified, where | ||
147 | * addr2 - addr <= 8 Bytes. | ||
148 | */ | ||
149 | p.addr2 = (uint64_t) end_range; | ||
150 | p.condition_value = 0; | ||
151 | |||
152 | 3. PTRACE_DELHWDEBUG | ||
153 | |||
154 | Takes an integer which identifies an existing breakpoint or watchpoint | ||
155 | (i.e., the value returned from PTRACE_SETHWDEBUG), and deletes the | ||
156 | corresponding breakpoint or watchpoint.. | ||
diff --git a/Documentation/powerpc/ptrace.txt b/Documentation/powerpc/ptrace.txt deleted file mode 100644 index 99c5ce88d0fe..000000000000 --- a/Documentation/powerpc/ptrace.txt +++ /dev/null | |||
@@ -1,151 +0,0 @@ | |||
1 | GDB intends to support the following hardware debug features of BookE | ||
2 | processors: | ||
3 | |||
4 | 4 hardware breakpoints (IAC) | ||
5 | 2 hardware watchpoints (read, write and read-write) (DAC) | ||
6 | 2 value conditions for the hardware watchpoints (DVC) | ||
7 | |||
8 | For that, we need to extend ptrace so that GDB can query and set these | ||
9 | resources. Since we're extending, we're trying to create an interface | ||
10 | that's extendable and that covers both BookE and server processors, so | ||
11 | that GDB doesn't need to special-case each of them. We added the | ||
12 | following 3 new ptrace requests. | ||
13 | |||
14 | 1. PTRACE_PPC_GETHWDEBUGINFO | ||
15 | |||
16 | Query for GDB to discover the hardware debug features. The main info to | ||
17 | be returned here is the minimum alignment for the hardware watchpoints. | ||
18 | BookE processors don't have restrictions here, but server processors have | ||
19 | an 8-byte alignment restriction for hardware watchpoints. We'd like to avoid | ||
20 | adding special cases to GDB based on what it sees in AUXV. | ||
21 | |||
22 | Since we're at it, we added other useful info that the kernel can return to | ||
23 | GDB: this query will return the number of hardware breakpoints, hardware | ||
24 | watchpoints and whether it supports a range of addresses and a condition. | ||
25 | The query will fill the following structure provided by the requesting process: | ||
26 | |||
27 | struct ppc_debug_info { | ||
28 | unit32_t version; | ||
29 | unit32_t num_instruction_bps; | ||
30 | unit32_t num_data_bps; | ||
31 | unit32_t num_condition_regs; | ||
32 | unit32_t data_bp_alignment; | ||
33 | unit32_t sizeof_condition; /* size of the DVC register */ | ||
34 | uint64_t features; /* bitmask of the individual flags */ | ||
35 | }; | ||
36 | |||
37 | features will have bits indicating whether there is support for: | ||
38 | |||
39 | #define PPC_DEBUG_FEATURE_INSN_BP_RANGE 0x1 | ||
40 | #define PPC_DEBUG_FEATURE_INSN_BP_MASK 0x2 | ||
41 | #define PPC_DEBUG_FEATURE_DATA_BP_RANGE 0x4 | ||
42 | #define PPC_DEBUG_FEATURE_DATA_BP_MASK 0x8 | ||
43 | #define PPC_DEBUG_FEATURE_DATA_BP_DAWR 0x10 | ||
44 | |||
45 | 2. PTRACE_SETHWDEBUG | ||
46 | |||
47 | Sets a hardware breakpoint or watchpoint, according to the provided structure: | ||
48 | |||
49 | struct ppc_hw_breakpoint { | ||
50 | uint32_t version; | ||
51 | #define PPC_BREAKPOINT_TRIGGER_EXECUTE 0x1 | ||
52 | #define PPC_BREAKPOINT_TRIGGER_READ 0x2 | ||
53 | #define PPC_BREAKPOINT_TRIGGER_WRITE 0x4 | ||
54 | uint32_t trigger_type; /* only some combinations allowed */ | ||
55 | #define PPC_BREAKPOINT_MODE_EXACT 0x0 | ||
56 | #define PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE 0x1 | ||
57 | #define PPC_BREAKPOINT_MODE_RANGE_EXCLUSIVE 0x2 | ||
58 | #define PPC_BREAKPOINT_MODE_MASK 0x3 | ||
59 | uint32_t addr_mode; /* address match mode */ | ||
60 | |||
61 | #define PPC_BREAKPOINT_CONDITION_MODE 0x3 | ||
62 | #define PPC_BREAKPOINT_CONDITION_NONE 0x0 | ||
63 | #define PPC_BREAKPOINT_CONDITION_AND 0x1 | ||
64 | #define PPC_BREAKPOINT_CONDITION_EXACT 0x1 /* different name for the same thing as above */ | ||
65 | #define PPC_BREAKPOINT_CONDITION_OR 0x2 | ||
66 | #define PPC_BREAKPOINT_CONDITION_AND_OR 0x3 | ||
67 | #define PPC_BREAKPOINT_CONDITION_BE_ALL 0x00ff0000 /* byte enable bits */ | ||
68 | #define PPC_BREAKPOINT_CONDITION_BE(n) (1<<((n)+16)) | ||
69 | uint32_t condition_mode; /* break/watchpoint condition flags */ | ||
70 | |||
71 | uint64_t addr; | ||
72 | uint64_t addr2; | ||
73 | uint64_t condition_value; | ||
74 | }; | ||
75 | |||
76 | A request specifies one event, not necessarily just one register to be set. | ||
77 | For instance, if the request is for a watchpoint with a condition, both the | ||
78 | DAC and DVC registers will be set in the same request. | ||
79 | |||
80 | With this GDB can ask for all kinds of hardware breakpoints and watchpoints | ||
81 | that the BookE supports. COMEFROM breakpoints available in server processors | ||
82 | are not contemplated, but that is out of the scope of this work. | ||
83 | |||
84 | ptrace will return an integer (handle) uniquely identifying the breakpoint or | ||
85 | watchpoint just created. This integer will be used in the PTRACE_DELHWDEBUG | ||
86 | request to ask for its removal. Return -ENOSPC if the requested breakpoint | ||
87 | can't be allocated on the registers. | ||
88 | |||
89 | Some examples of using the structure to: | ||
90 | |||
91 | - set a breakpoint in the first breakpoint register | ||
92 | |||
93 | p.version = PPC_DEBUG_CURRENT_VERSION; | ||
94 | p.trigger_type = PPC_BREAKPOINT_TRIGGER_EXECUTE; | ||
95 | p.addr_mode = PPC_BREAKPOINT_MODE_EXACT; | ||
96 | p.condition_mode = PPC_BREAKPOINT_CONDITION_NONE; | ||
97 | p.addr = (uint64_t) address; | ||
98 | p.addr2 = 0; | ||
99 | p.condition_value = 0; | ||
100 | |||
101 | - set a watchpoint which triggers on reads in the second watchpoint register | ||
102 | |||
103 | p.version = PPC_DEBUG_CURRENT_VERSION; | ||
104 | p.trigger_type = PPC_BREAKPOINT_TRIGGER_READ; | ||
105 | p.addr_mode = PPC_BREAKPOINT_MODE_EXACT; | ||
106 | p.condition_mode = PPC_BREAKPOINT_CONDITION_NONE; | ||
107 | p.addr = (uint64_t) address; | ||
108 | p.addr2 = 0; | ||
109 | p.condition_value = 0; | ||
110 | |||
111 | - set a watchpoint which triggers only with a specific value | ||
112 | |||
113 | p.version = PPC_DEBUG_CURRENT_VERSION; | ||
114 | p.trigger_type = PPC_BREAKPOINT_TRIGGER_READ; | ||
115 | p.addr_mode = PPC_BREAKPOINT_MODE_EXACT; | ||
116 | p.condition_mode = PPC_BREAKPOINT_CONDITION_AND | PPC_BREAKPOINT_CONDITION_BE_ALL; | ||
117 | p.addr = (uint64_t) address; | ||
118 | p.addr2 = 0; | ||
119 | p.condition_value = (uint64_t) condition; | ||
120 | |||
121 | - set a ranged hardware breakpoint | ||
122 | |||
123 | p.version = PPC_DEBUG_CURRENT_VERSION; | ||
124 | p.trigger_type = PPC_BREAKPOINT_TRIGGER_EXECUTE; | ||
125 | p.addr_mode = PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE; | ||
126 | p.condition_mode = PPC_BREAKPOINT_CONDITION_NONE; | ||
127 | p.addr = (uint64_t) begin_range; | ||
128 | p.addr2 = (uint64_t) end_range; | ||
129 | p.condition_value = 0; | ||
130 | |||
131 | - set a watchpoint in server processors (BookS) | ||
132 | |||
133 | p.version = 1; | ||
134 | p.trigger_type = PPC_BREAKPOINT_TRIGGER_RW; | ||
135 | p.addr_mode = PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE; | ||
136 | or | ||
137 | p.addr_mode = PPC_BREAKPOINT_MODE_EXACT; | ||
138 | |||
139 | p.condition_mode = PPC_BREAKPOINT_CONDITION_NONE; | ||
140 | p.addr = (uint64_t) begin_range; | ||
141 | /* For PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE addr2 needs to be specified, where | ||
142 | * addr2 - addr <= 8 Bytes. | ||
143 | */ | ||
144 | p.addr2 = (uint64_t) end_range; | ||
145 | p.condition_value = 0; | ||
146 | |||
147 | 3. PTRACE_DELHWDEBUG | ||
148 | |||
149 | Takes an integer which identifies an existing breakpoint or watchpoint | ||
150 | (i.e., the value returned from PTRACE_SETHWDEBUG), and deletes the | ||
151 | corresponding breakpoint or watchpoint.. | ||
diff --git a/Documentation/powerpc/qe_firmware.txt b/Documentation/powerpc/qe_firmware.rst index e7ac24aec4ff..42f5103140c9 100644 --- a/Documentation/powerpc/qe_firmware.txt +++ b/Documentation/powerpc/qe_firmware.rst | |||
@@ -1,23 +1,23 @@ | |||
1 | Freescale QUICC Engine Firmware Uploading | 1 | ========================================= |
2 | ----------------------------------------- | 2 | Freescale QUICC Engine Firmware Uploading |
3 | ========================================= | ||
3 | 4 | ||
4 | (c) 2007 Timur Tabi <timur at freescale.com>, | 5 | (c) 2007 Timur Tabi <timur at freescale.com>, |
5 | Freescale Semiconductor | 6 | Freescale Semiconductor |
6 | 7 | ||
7 | Table of Contents | 8 | .. Table of Contents |
8 | ================= | ||
9 | 9 | ||
10 | I - Software License for Firmware | 10 | I - Software License for Firmware |
11 | 11 | ||
12 | II - Microcode Availability | 12 | II - Microcode Availability |
13 | 13 | ||
14 | III - Description and Terminology | 14 | III - Description and Terminology |
15 | 15 | ||
16 | IV - Microcode Programming Details | 16 | IV - Microcode Programming Details |
17 | 17 | ||
18 | V - Firmware Structure Layout | 18 | V - Firmware Structure Layout |
19 | 19 | ||
20 | VI - Sample Code for Creating Firmware Files | 20 | VI - Sample Code for Creating Firmware Files |
21 | 21 | ||
22 | Revision Information | 22 | Revision Information |
23 | ==================== | 23 | ==================== |
@@ -39,7 +39,7 @@ http://opensource.freescale.com. For other firmware files, please contact | |||
39 | your Freescale representative or your operating system vendor. | 39 | your Freescale representative or your operating system vendor. |
40 | 40 | ||
41 | III - Description and Terminology | 41 | III - Description and Terminology |
42 | ================================ | 42 | ================================= |
43 | 43 | ||
44 | In this document, the term 'microcode' refers to the sequence of 32-bit | 44 | In this document, the term 'microcode' refers to the sequence of 32-bit |
45 | integers that compose the actual QE microcode. | 45 | integers that compose the actual QE microcode. |
@@ -89,7 +89,7 @@ being fixed in the RAM package utilizing they should be activated. This data | |||
89 | structure signals the microcode which of these virtual traps is active. | 89 | structure signals the microcode which of these virtual traps is active. |
90 | 90 | ||
91 | This structure contains 6 words that the application should copy to some | 91 | This structure contains 6 words that the application should copy to some |
92 | specific been defined. This table describes the structure. | 92 | specific been defined. This table describes the structure:: |
93 | 93 | ||
94 | --------------------------------------------------------------- | 94 | --------------------------------------------------------------- |
95 | | Offset in | | Destination Offset | Size of | | 95 | | Offset in | | Destination Offset | Size of | |
@@ -119,7 +119,7 @@ Extended Modes | |||
119 | This is a double word bit array (64 bits) that defines special functionality | 119 | This is a double word bit array (64 bits) that defines special functionality |
120 | which has an impact on the software drivers. Each bit has its own impact | 120 | which has an impact on the software drivers. Each bit has its own impact |
121 | and has special instructions for the s/w associated with it. This structure is | 121 | and has special instructions for the s/w associated with it. This structure is |
122 | described in this table: | 122 | described in this table:: |
123 | 123 | ||
124 | ----------------------------------------------------------------------- | 124 | ----------------------------------------------------------------------- |
125 | | Bit # | Name | Description | | 125 | | Bit # | Name | Description | |
@@ -220,7 +220,8 @@ The 'model' field is a 16-bit number that matches the actual SOC. The | |||
220 | 'major' and 'minor' fields are the major and minor revision numbers, | 220 | 'major' and 'minor' fields are the major and minor revision numbers, |
221 | respectively, of the SOC. | 221 | respectively, of the SOC. |
222 | 222 | ||
223 | For example, to match the 8323, revision 1.0: | 223 | For example, to match the 8323, revision 1.0:: |
224 | |||
224 | soc.model = 8323 | 225 | soc.model = 8323 |
225 | soc.major = 1 | 226 | soc.major = 1 |
226 | soc.minor = 0 | 227 | soc.minor = 0 |
@@ -273,10 +274,10 @@ library and available to any driver that calles qe_get_firmware_info(). | |||
273 | 'reserved'. | 274 | 'reserved'. |
274 | 275 | ||
275 | After the last microcode is a 32-bit CRC. It can be calculated using | 276 | After the last microcode is a 32-bit CRC. It can be calculated using |
276 | this algorithm: | 277 | this algorithm:: |
277 | 278 | ||
278 | u32 crc32(const u8 *p, unsigned int len) | 279 | u32 crc32(const u8 *p, unsigned int len) |
279 | { | 280 | { |
280 | unsigned int i; | 281 | unsigned int i; |
281 | u32 crc = 0; | 282 | u32 crc = 0; |
282 | 283 | ||
@@ -286,7 +287,7 @@ u32 crc32(const u8 *p, unsigned int len) | |||
286 | crc = (crc >> 1) ^ ((crc & 1) ? 0xedb88320 : 0); | 287 | crc = (crc >> 1) ^ ((crc & 1) ? 0xedb88320 : 0); |
287 | } | 288 | } |
288 | return crc; | 289 | return crc; |
289 | } | 290 | } |
290 | 291 | ||
291 | VI - Sample Code for Creating Firmware Files | 292 | VI - Sample Code for Creating Firmware Files |
292 | ============================================ | 293 | ============================================ |
diff --git a/Documentation/powerpc/syscall64-abi.txt b/Documentation/powerpc/syscall64-abi.rst index fa716a0d88bd..e49f69f941b9 100644 --- a/Documentation/powerpc/syscall64-abi.txt +++ b/Documentation/powerpc/syscall64-abi.rst | |||
@@ -5,12 +5,12 @@ Power Architecture 64-bit Linux system call ABI | |||
5 | syscall | 5 | syscall |
6 | ======= | 6 | ======= |
7 | 7 | ||
8 | syscall calling sequence[*] matches the Power Architecture 64-bit ELF ABI | 8 | syscall calling sequence\ [1]_ matches the Power Architecture 64-bit ELF ABI |
9 | specification C function calling sequence, including register preservation | 9 | specification C function calling sequence, including register preservation |
10 | rules, with the following differences. | 10 | rules, with the following differences. |
11 | 11 | ||
12 | [*] Some syscalls (typically low-level management functions) may have | 12 | .. [1] Some syscalls (typically low-level management functions) may have |
13 | different calling sequences (e.g., rt_sigreturn). | 13 | different calling sequences (e.g., rt_sigreturn). |
14 | 14 | ||
15 | Parameters and return value | 15 | Parameters and return value |
16 | --------------------------- | 16 | --------------------------- |
@@ -33,12 +33,14 @@ Register preservation rules | |||
33 | Register preservation rules match the ELF ABI calling sequence with the | 33 | Register preservation rules match the ELF ABI calling sequence with the |
34 | following differences: | 34 | following differences: |
35 | 35 | ||
36 | r0: Volatile. (System call number.) | 36 | =========== ============= ======================================== |
37 | r3: Volatile. (Parameter 1, and return value.) | 37 | r0 Volatile (System call number.) |
38 | r4-r8: Volatile. (Parameters 2-6.) | 38 | r3 Volatile (Parameter 1, and return value.) |
39 | cr0: Volatile (cr0.SO is the return error condition) | 39 | r4-r8 Volatile (Parameters 2-6.) |
40 | cr1, cr5-7: Nonvolatile. | 40 | cr0 Volatile (cr0.SO is the return error condition) |
41 | lr: Nonvolatile. | 41 | cr1, cr5-7 Nonvolatile |
42 | lr Nonvolatile | ||
43 | =========== ============= ======================================== | ||
42 | 44 | ||
43 | All floating point and vector data registers as well as control and status | 45 | All floating point and vector data registers as well as control and status |
44 | registers are nonvolatile. | 46 | registers are nonvolatile. |
@@ -90,9 +92,12 @@ The vsyscall may or may not use the caller's stack frame save areas. | |||
90 | 92 | ||
91 | Register preservation rules | 93 | Register preservation rules |
92 | --------------------------- | 94 | --------------------------- |
93 | r0: Volatile. | 95 | |
94 | cr1, cr5-7: Volatile. | 96 | =========== ======== |
95 | lr: Volatile. | 97 | r0 Volatile |
98 | cr1, cr5-7 Volatile | ||
99 | lr Volatile | ||
100 | =========== ======== | ||
96 | 101 | ||
97 | Invocation | 102 | Invocation |
98 | ---------- | 103 | ---------- |
diff --git a/Documentation/powerpc/transactional_memory.txt b/Documentation/powerpc/transactional_memory.rst index 52c023e14f26..09955103acb4 100644 --- a/Documentation/powerpc/transactional_memory.txt +++ b/Documentation/powerpc/transactional_memory.rst | |||
@@ -1,3 +1,4 @@ | |||
1 | ============================ | ||
1 | Transactional Memory support | 2 | Transactional Memory support |
2 | ============================ | 3 | ============================ |
3 | 4 | ||
@@ -17,29 +18,29 @@ instructions are presented to delimit transactions; transactions are | |||
17 | guaranteed to either complete atomically or roll back and undo any partial | 18 | guaranteed to either complete atomically or roll back and undo any partial |
18 | changes. | 19 | changes. |
19 | 20 | ||
20 | A simple transaction looks like this: | 21 | A simple transaction looks like this:: |
21 | 22 | ||
22 | begin_move_money: | 23 | begin_move_money: |
23 | tbegin | 24 | tbegin |
24 | beq abort_handler | 25 | beq abort_handler |
25 | 26 | ||
26 | ld r4, SAVINGS_ACCT(r3) | 27 | ld r4, SAVINGS_ACCT(r3) |
27 | ld r5, CURRENT_ACCT(r3) | 28 | ld r5, CURRENT_ACCT(r3) |
28 | subi r5, r5, 1 | 29 | subi r5, r5, 1 |
29 | addi r4, r4, 1 | 30 | addi r4, r4, 1 |
30 | std r4, SAVINGS_ACCT(r3) | 31 | std r4, SAVINGS_ACCT(r3) |
31 | std r5, CURRENT_ACCT(r3) | 32 | std r5, CURRENT_ACCT(r3) |
32 | 33 | ||
33 | tend | 34 | tend |
34 | 35 | ||
35 | b continue | 36 | b continue |
36 | 37 | ||
37 | abort_handler: | 38 | abort_handler: |
38 | ... test for odd failures ... | 39 | ... test for odd failures ... |
39 | 40 | ||
40 | /* Retry the transaction if it failed because it conflicted with | 41 | /* Retry the transaction if it failed because it conflicted with |
41 | * someone else: */ | 42 | * someone else: */ |
42 | b begin_move_money | 43 | b begin_move_money |
43 | 44 | ||
44 | 45 | ||
45 | The 'tbegin' instruction denotes the start point, and 'tend' the end point. | 46 | The 'tbegin' instruction denotes the start point, and 'tend' the end point. |
@@ -123,7 +124,7 @@ Transaction-aware signal handlers can read the transactional register state | |||
123 | from the second ucontext. This will be necessary for crash handlers to | 124 | from the second ucontext. This will be necessary for crash handlers to |
124 | determine, for example, the address of the instruction causing the SIGSEGV. | 125 | determine, for example, the address of the instruction causing the SIGSEGV. |
125 | 126 | ||
126 | Example signal handler: | 127 | Example signal handler:: |
127 | 128 | ||
128 | void crash_handler(int sig, siginfo_t *si, void *uc) | 129 | void crash_handler(int sig, siginfo_t *si, void *uc) |
129 | { | 130 | { |
@@ -133,9 +134,9 @@ Example signal handler: | |||
133 | if (ucp_link) { | 134 | if (ucp_link) { |
134 | u64 msr = ucp->uc_mcontext.regs->msr; | 135 | u64 msr = ucp->uc_mcontext.regs->msr; |
135 | /* May have transactional ucontext! */ | 136 | /* May have transactional ucontext! */ |
136 | #ifndef __powerpc64__ | 137 | #ifndef __powerpc64__ |
137 | msr |= ((u64)transactional_ucp->uc_mcontext.regs->msr) << 32; | 138 | msr |= ((u64)transactional_ucp->uc_mcontext.regs->msr) << 32; |
138 | #endif | 139 | #endif |
139 | if (MSR_TM_ACTIVE(msr)) { | 140 | if (MSR_TM_ACTIVE(msr)) { |
140 | /* Yes, we crashed during a transaction. Oops. */ | 141 | /* Yes, we crashed during a transaction. Oops. */ |
141 | fprintf(stderr, "Transaction to be restarted at 0x%llx, but " | 142 | fprintf(stderr, "Transaction to be restarted at 0x%llx, but " |
@@ -176,6 +177,7 @@ Failure cause codes used by kernel | |||
176 | These are defined in <asm/reg.h>, and distinguish different reasons why the | 177 | These are defined in <asm/reg.h>, and distinguish different reasons why the |
177 | kernel aborted a transaction: | 178 | kernel aborted a transaction: |
178 | 179 | ||
180 | ====================== ================================ | ||
179 | TM_CAUSE_RESCHED Thread was rescheduled. | 181 | TM_CAUSE_RESCHED Thread was rescheduled. |
180 | TM_CAUSE_TLBI Software TLB invalid. | 182 | TM_CAUSE_TLBI Software TLB invalid. |
181 | TM_CAUSE_FAC_UNAV FP/VEC/VSX unavailable trap. | 183 | TM_CAUSE_FAC_UNAV FP/VEC/VSX unavailable trap. |
@@ -184,6 +186,7 @@ kernel aborted a transaction: | |||
184 | TM_CAUSE_MISC Currently unused. | 186 | TM_CAUSE_MISC Currently unused. |
185 | TM_CAUSE_ALIGNMENT Alignment fault. | 187 | TM_CAUSE_ALIGNMENT Alignment fault. |
186 | TM_CAUSE_EMULATE Emulation that touched memory. | 188 | TM_CAUSE_EMULATE Emulation that touched memory. |
189 | ====================== ================================ | ||
187 | 190 | ||
188 | These can be checked by the user program's abort handler as TEXASR[0:7]. If | 191 | These can be checked by the user program's abort handler as TEXASR[0:7]. If |
189 | bit 7 is set, it indicates that the error is consider persistent. For example | 192 | bit 7 is set, it indicates that the error is consider persistent. For example |
@@ -203,7 +206,7 @@ POWER9 | |||
203 | ====== | 206 | ====== |
204 | 207 | ||
205 | TM on POWER9 has issues with storing the complete register state. This | 208 | TM on POWER9 has issues with storing the complete register state. This |
206 | is described in this commit: | 209 | is described in this commit:: |
207 | 210 | ||
208 | commit 4bb3c7a0208fc13ca70598efd109901a7cd45ae7 | 211 | commit 4bb3c7a0208fc13ca70598efd109901a7cd45ae7 |
209 | Author: Paul Mackerras <paulus@ozlabs.org> | 212 | Author: Paul Mackerras <paulus@ozlabs.org> |
diff --git a/Documentation/process/conf.py b/Documentation/process/conf.py deleted file mode 100644 index 1b01a80ad9ce..000000000000 --- a/Documentation/process/conf.py +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | # -*- coding: utf-8; mode: python -*- | ||
2 | |||
3 | project = 'Linux Kernel Development Documentation' | ||
4 | |||
5 | tags.add("subproject") | ||
6 | |||
7 | latex_documents = [ | ||
8 | ('index', 'process.tex', 'Linux Kernel Development Documentation', | ||
9 | 'The kernel development community', 'manual'), | ||
10 | ] | ||
diff --git a/Documentation/process/deprecated.rst b/Documentation/process/deprecated.rst index 49e0f64a3427..053b24a6dd38 100644 --- a/Documentation/process/deprecated.rst +++ b/Documentation/process/deprecated.rst | |||
@@ -119,3 +119,17 @@ array may exceed the remaining memory in the stack segment. This could | |||
119 | lead to a crash, possible overwriting sensitive contents at the end of the | 119 | lead to a crash, possible overwriting sensitive contents at the end of the |
120 | stack (when built without `CONFIG_THREAD_INFO_IN_TASK=y`), or overwriting | 120 | stack (when built without `CONFIG_THREAD_INFO_IN_TASK=y`), or overwriting |
121 | memory adjacent to the stack (when built without `CONFIG_VMAP_STACK=y`) | 121 | memory adjacent to the stack (when built without `CONFIG_VMAP_STACK=y`) |
122 | |||
123 | Implicit switch case fall-through | ||
124 | --------------------------------- | ||
125 | The C language allows switch cases to "fall through" when | ||
126 | a "break" statement is missing at the end of a case. This, | ||
127 | however, introduces ambiguity in the code, as it's not always | ||
128 | clear if the missing break is intentional or a bug. As there | ||
129 | have been a long list of flaws `due to missing "break" statements | ||
130 | <https://cwe.mitre.org/data/definitions/484.html>`_, we no longer allow | ||
131 | "implicit fall-through". In order to identify an intentional fall-through | ||
132 | case, we have adopted the marking used by static analyzers: a comment | ||
133 | saying `/* Fall through */`. Once the C++17 `__attribute__((fallthrough))` | ||
134 | is more widely handled by C compilers, static analyzers, and IDEs, we can | ||
135 | switch to using that instead. | ||
diff --git a/Documentation/s390/vfio-ccw.rst b/Documentation/s390/vfio-ccw.rst index 1e210c6afa88..fca9c4f5bd9c 100644 --- a/Documentation/s390/vfio-ccw.rst +++ b/Documentation/s390/vfio-ccw.rst | |||
@@ -180,6 +180,13 @@ The process of how these work together. | |||
180 | add it to an iommu_group and a vfio_group. Then we could pass through | 180 | add it to an iommu_group and a vfio_group. Then we could pass through |
181 | the mdev to a guest. | 181 | the mdev to a guest. |
182 | 182 | ||
183 | |||
184 | VFIO-CCW Regions | ||
185 | ---------------- | ||
186 | |||
187 | The vfio-ccw driver exposes MMIO regions to accept requests from and return | ||
188 | results to userspace. | ||
189 | |||
183 | vfio-ccw I/O region | 190 | vfio-ccw I/O region |
184 | ------------------- | 191 | ------------------- |
185 | 192 | ||
@@ -205,6 +212,25 @@ irb_area stores the I/O result. | |||
205 | 212 | ||
206 | ret_code stores a return code for each access of the region. | 213 | ret_code stores a return code for each access of the region. |
207 | 214 | ||
215 | This region is always available. | ||
216 | |||
217 | vfio-ccw cmd region | ||
218 | ------------------- | ||
219 | |||
220 | The vfio-ccw cmd region is used to accept asynchronous instructions | ||
221 | from userspace:: | ||
222 | |||
223 | #define VFIO_CCW_ASYNC_CMD_HSCH (1 << 0) | ||
224 | #define VFIO_CCW_ASYNC_CMD_CSCH (1 << 1) | ||
225 | struct ccw_cmd_region { | ||
226 | __u32 command; | ||
227 | __u32 ret_code; | ||
228 | } __packed; | ||
229 | |||
230 | This region is exposed via region type VFIO_REGION_SUBTYPE_CCW_ASYNC_CMD. | ||
231 | |||
232 | Currently, CLEAR SUBCHANNEL and HALT SUBCHANNEL use this region. | ||
233 | |||
208 | vfio-ccw operation details | 234 | vfio-ccw operation details |
209 | -------------------------- | 235 | -------------------------- |
210 | 236 | ||
@@ -306,9 +332,8 @@ Together with the corresponding work in QEMU, we can bring the passed | |||
306 | through DASD/ECKD device online in a guest now and use it as a block | 332 | through DASD/ECKD device online in a guest now and use it as a block |
307 | device. | 333 | device. |
308 | 334 | ||
309 | While the current code allows the guest to start channel programs via | 335 | The current code allows the guest to start channel programs via |
310 | START SUBCHANNEL, support for HALT SUBCHANNEL or CLEAR SUBCHANNEL is | 336 | START SUBCHANNEL, and to issue HALT SUBCHANNEL and CLEAR SUBCHANNEL. |
311 | not yet implemented. | ||
312 | 337 | ||
313 | vfio-ccw supports classic (command mode) channel I/O only. Transport | 338 | vfio-ccw supports classic (command mode) channel I/O only. Transport |
314 | mode (HPF) is not supported. | 339 | mode (HPF) is not supported. |
diff --git a/Documentation/sh/conf.py b/Documentation/sh/conf.py deleted file mode 100644 index 1eb684a13ac8..000000000000 --- a/Documentation/sh/conf.py +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | # -*- coding: utf-8; mode: python -*- | ||
2 | |||
3 | project = "SuperH architecture implementation manual" | ||
4 | |||
5 | tags.add("subproject") | ||
6 | |||
7 | latex_documents = [ | ||
8 | ('index', 'sh.tex', project, | ||
9 | 'The kernel development community', 'manual'), | ||
10 | ] | ||
diff --git a/Documentation/sound/conf.py b/Documentation/sound/conf.py deleted file mode 100644 index 3f1fc5e74e7b..000000000000 --- a/Documentation/sound/conf.py +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | # -*- coding: utf-8; mode: python -*- | ||
2 | |||
3 | project = "Linux Sound Subsystem Documentation" | ||
4 | |||
5 | tags.add("subproject") | ||
6 | |||
7 | latex_documents = [ | ||
8 | ('index', 'sound.tex', project, | ||
9 | 'The kernel development community', 'manual'), | ||
10 | ] | ||
diff --git a/Documentation/sphinx/load_config.py b/Documentation/sphinx/load_config.py index 301a21aa4f63..eeb394b39e2c 100644 --- a/Documentation/sphinx/load_config.py +++ b/Documentation/sphinx/load_config.py | |||
@@ -21,6 +21,29 @@ def loadConfig(namespace): | |||
21 | and os.path.normpath(namespace["__file__"]) != os.path.normpath(config_file) ): | 21 | and os.path.normpath(namespace["__file__"]) != os.path.normpath(config_file) ): |
22 | config_file = os.path.abspath(config_file) | 22 | config_file = os.path.abspath(config_file) |
23 | 23 | ||
24 | # Let's avoid one conf.py file just due to latex_documents | ||
25 | start = config_file.find('Documentation/') | ||
26 | if start >= 0: | ||
27 | start = config_file.find('/', start + 1) | ||
28 | |||
29 | end = config_file.rfind('/') | ||
30 | if start >= 0 and end > 0: | ||
31 | dir = config_file[start + 1:end] | ||
32 | |||
33 | print("source directory: %s" % dir) | ||
34 | new_latex_docs = [] | ||
35 | latex_documents = namespace['latex_documents'] | ||
36 | |||
37 | for l in latex_documents: | ||
38 | if l[0].find(dir + '/') == 0: | ||
39 | has = True | ||
40 | fn = l[0][len(dir) + 1:] | ||
41 | new_latex_docs.append((fn, l[1], l[2], l[3], l[4])) | ||
42 | break | ||
43 | |||
44 | namespace['latex_documents'] = new_latex_docs | ||
45 | |||
46 | # If there is an extra conf.py file, load it | ||
24 | if os.path.isfile(config_file): | 47 | if os.path.isfile(config_file): |
25 | sys.stdout.write("load additional sphinx-config: %s\n" % config_file) | 48 | sys.stdout.write("load additional sphinx-config: %s\n" % config_file) |
26 | config = namespace.copy() | 49 | config = namespace.copy() |
@@ -29,4 +52,6 @@ def loadConfig(namespace): | |||
29 | del config['__file__'] | 52 | del config['__file__'] |
30 | namespace.update(config) | 53 | namespace.update(config) |
31 | else: | 54 | else: |
32 | sys.stderr.write("WARNING: additional sphinx-config not found: %s\n" % config_file) | 55 | config = namespace.copy() |
56 | config['tags'].add("subproject") | ||
57 | namespace.update(config) | ||
diff --git a/Documentation/translations/it_IT/doc-guide/sphinx.rst b/Documentation/translations/it_IT/doc-guide/sphinx.rst index 1739cba8863e..f1ad4504b734 100644 --- a/Documentation/translations/it_IT/doc-guide/sphinx.rst +++ b/Documentation/translations/it_IT/doc-guide/sphinx.rst | |||
@@ -242,8 +242,9 @@ del kernel: | |||
242 | * Per inserire blocchi di testo con caratteri a dimensione fissa (codici di | 242 | * Per inserire blocchi di testo con caratteri a dimensione fissa (codici di |
243 | esempio, casi d'uso, eccetera): utilizzate ``::`` quando non è necessario | 243 | esempio, casi d'uso, eccetera): utilizzate ``::`` quando non è necessario |
244 | evidenziare la sintassi, specialmente per piccoli frammenti; invece, | 244 | evidenziare la sintassi, specialmente per piccoli frammenti; invece, |
245 | utilizzate ``.. code-block:: <language>`` per blocchi di più lunghi che | 245 | utilizzate ``.. code-block:: <language>`` per blocchi più lunghi che |
246 | potranno beneficiare dell'avere la sintassi evidenziata. | 246 | beneficeranno della sintassi evidenziata. Per un breve pezzo di codice da |
247 | inserire nel testo, usate \`\`. | ||
247 | 248 | ||
248 | 249 | ||
249 | Il dominio C | 250 | Il dominio C |
@@ -267,12 +268,14 @@ molto comune come ``open`` o ``ioctl``: | |||
267 | 268 | ||
268 | Il nome della funzione (per esempio ioctl) rimane nel testo ma il nome del suo | 269 | Il nome della funzione (per esempio ioctl) rimane nel testo ma il nome del suo |
269 | riferimento cambia da ``ioctl`` a ``VIDIOC_LOG_STATUS``. Anche la voce | 270 | riferimento cambia da ``ioctl`` a ``VIDIOC_LOG_STATUS``. Anche la voce |
270 | nell'indice cambia in ``VIDIOC_LOG_STATUS`` e si potrà quindi fare riferimento | 271 | nell'indice cambia in ``VIDIOC_LOG_STATUS``. |
271 | a questa funzione scrivendo: | 272 | |
272 | 273 | Notate che per una funzione non c'è bisogno di usare ``c:func:`` per generarne | |
273 | .. code-block:: rst | 274 | i riferimenti nella documentazione. Grazie a qualche magica estensione a |
274 | 275 | Sphinx, il sistema di generazione della documentazione trasformerà | |
275 | :c:func:`VIDIOC_LOG_STATUS` | 276 | automaticamente un riferimento ad una ``funzione()`` in un riferimento |
277 | incrociato quando questa ha una voce nell'indice. Se trovate degli usi di | ||
278 | ``c:func:`` nella documentazione del kernel, sentitevi liberi di rimuoverli. | ||
276 | 279 | ||
277 | 280 | ||
278 | Tabelle a liste | 281 | Tabelle a liste |
diff --git a/Documentation/translations/it_IT/process/index.rst b/Documentation/translations/it_IT/process/index.rst index 2eda85d5cd1e..012de0f3154a 100644 --- a/Documentation/translations/it_IT/process/index.rst +++ b/Documentation/translations/it_IT/process/index.rst | |||
@@ -27,6 +27,7 @@ Di seguito le guide che ogni sviluppatore dovrebbe leggere. | |||
27 | code-of-conduct | 27 | code-of-conduct |
28 | development-process | 28 | development-process |
29 | submitting-patches | 29 | submitting-patches |
30 | programming-language | ||
30 | coding-style | 31 | coding-style |
31 | maintainer-pgp-guide | 32 | maintainer-pgp-guide |
32 | email-clients | 33 | email-clients |
diff --git a/Documentation/translations/it_IT/process/kernel-docs.rst b/Documentation/translations/it_IT/process/kernel-docs.rst index 7bd70d661737..38e0a955121a 100644 --- a/Documentation/translations/it_IT/process/kernel-docs.rst +++ b/Documentation/translations/it_IT/process/kernel-docs.rst | |||
@@ -1,6 +1,7 @@ | |||
1 | .. include:: ../disclaimer-ita.rst | 1 | .. include:: ../disclaimer-ita.rst |
2 | 2 | ||
3 | :Original: :ref:`Documentation/process/kernel-docs.rst <kernel_docs>` | 3 | :Original: :ref:`Documentation/process/kernel-docs.rst <kernel_docs>` |
4 | :Translator: Federico Vaga <federico.vaga@vaga.pv.it> | ||
4 | 5 | ||
5 | 6 | ||
6 | .. _it_kernel_docs: | 7 | .. _it_kernel_docs: |
@@ -8,6 +9,10 @@ | |||
8 | Indice di documenti per le persone interessate a capire e/o scrivere per il kernel Linux | 9 | Indice di documenti per le persone interessate a capire e/o scrivere per il kernel Linux |
9 | ======================================================================================== | 10 | ======================================================================================== |
10 | 11 | ||
11 | .. warning:: | 12 | .. note:: |
12 | 13 | Questo documento contiene riferimenti a documenti in lingua inglese; inoltre | |
13 | TODO ancora da tradurre | 14 | utilizza dai campi *ReStructuredText* di supporto alla ricerca e che per |
15 | questo motivo è meglio non tradurre al fine di garantirne un corretto | ||
16 | utilizzo. | ||
17 | Per questi motivi il documento non verrà tradotto. Per favore fate | ||
18 | riferimento al documento originale in lingua inglese. | ||
diff --git a/Documentation/translations/it_IT/process/maintainer-pgp-guide.rst b/Documentation/translations/it_IT/process/maintainer-pgp-guide.rst index 276db0e37f43..118fb4153e8f 100644 --- a/Documentation/translations/it_IT/process/maintainer-pgp-guide.rst +++ b/Documentation/translations/it_IT/process/maintainer-pgp-guide.rst | |||
@@ -248,7 +248,10 @@ possano ricevere la vostra nuova sottochiave:: | |||
248 | kernel. | 248 | kernel. |
249 | 249 | ||
250 | Se per qualche ragione preferite rimanere con sottochiavi RSA, nel comando | 250 | Se per qualche ragione preferite rimanere con sottochiavi RSA, nel comando |
251 | precedente, sostituite "ed25519" con "rsa2048". | 251 | precedente, sostituite "ed25519" con "rsa2048". In aggiunta, se avete |
252 | intenzione di usare un dispositivo hardware che non supporta le chiavi | ||
253 | ED25519 ECC, come la Nitrokey Pro o la Yubikey, allora dovreste usare | ||
254 | "nistp256" al posto di "ed25519". | ||
252 | 255 | ||
253 | Copia di riserva della chiave primaria per gestire il recupero da disastro | 256 | Copia di riserva della chiave primaria per gestire il recupero da disastro |
254 | -------------------------------------------------------------------------- | 257 | -------------------------------------------------------------------------- |
@@ -449,23 +452,27 @@ implementi le funzionalità delle smartcard. Sul mercato ci sono diverse | |||
449 | soluzioni disponibili: | 452 | soluzioni disponibili: |
450 | 453 | ||
451 | - `Nitrokey Start`_: è Open hardware e Free Software, è basata sul progetto | 454 | - `Nitrokey Start`_: è Open hardware e Free Software, è basata sul progetto |
452 | `GnuK`_ della FSIJ. Ha il supporto per chiavi ECC, ma meno funzionalità di | 455 | `GnuK`_ della FSIJ. Questo è uno dei pochi dispositivi a supportare le chiavi |
453 | sicurezza (come la resistenza alla manomissione o alcuni attacchi ad un | 456 | ECC ED25519, ma offre meno funzionalità di sicurezza (come la resistenza |
454 | canale laterale). | 457 | alla manomissione o alcuni attacchi ad un canale laterale). |
455 | - `Nitrokey Pro`_: è simile alla Nitrokey Start, ma è più resistente alla | 458 | - `Nitrokey Pro`_: è simile alla Nitrokey Start, ma è più resistente alla |
456 | manomissione e offre più funzionalità di sicurezza, ma l'ECC. | 459 | manomissione e offre più funzionalità di sicurezza. La Pro 2 supporta la |
457 | - `Yubikey 4`_: l'hardware e il software sono proprietari, ma è più economica | 460 | crittografia ECC (NISTP). |
461 | - `Yubikey 5`_: l'hardware e il software sono proprietari, ma è più economica | ||
458 | della Nitrokey Pro ed è venduta anche con porta USB-C il che è utile con i | 462 | della Nitrokey Pro ed è venduta anche con porta USB-C il che è utile con i |
459 | computer portatili più recenti. In aggiunta, offre altre funzionalità di | 463 | computer portatili più recenti. In aggiunta, offre altre funzionalità di |
460 | sicurezza come FIDO, U2F, ma non l'ECC | 464 | sicurezza come FIDO, U2F, e ora supporta anche le chiavi ECC (NISTP) |
461 | 465 | ||
462 | `Su LWN c'è una buona recensione`_ dei modelli elencati qui sopra e altri. | 466 | `Su LWN c'è una buona recensione`_ dei modelli elencati qui sopra e altri. |
467 | La scelta dipenderà dal costo, dalla disponibilità nella vostra area | ||
468 | geografica e vostre considerazioni sull'hardware aperto/proprietario. | ||
469 | |||
463 | Se volete usare chiavi ECC, la vostra migliore scelta sul mercato è la | 470 | Se volete usare chiavi ECC, la vostra migliore scelta sul mercato è la |
464 | Nitrokey Start. | 471 | Nitrokey Start. |
465 | 472 | ||
466 | .. _`Nitrokey Start`: https://shop.nitrokey.com/shop/product/nitrokey-start-6 | 473 | .. _`Nitrokey Start`: https://shop.nitrokey.com/shop/product/nitrokey-start-6 |
467 | .. _`Nitrokey Pro`: https://shop.nitrokey.com/shop/product/nitrokey-pro-3 | 474 | .. _`Nitrokey Pro 2`: https://shop.nitrokey.com/shop/product/nitrokey-pro-2-3 |
468 | .. _`Yubikey 4`: https://www.yubico.com/product/yubikey-4-series/ | 475 | .. _`Yubikey 5`: https://www.yubico.com/product/yubikey-5-overview/ |
469 | .. _Gnuk: http://www.fsij.org/doc-gnuk/ | 476 | .. _Gnuk: http://www.fsij.org/doc-gnuk/ |
470 | .. _`Su LWN c'è una buona recensione`: https://lwn.net/Articles/736231/ | 477 | .. _`Su LWN c'è una buona recensione`: https://lwn.net/Articles/736231/ |
471 | 478 | ||
diff --git a/Documentation/translations/it_IT/process/programming-language.rst b/Documentation/translations/it_IT/process/programming-language.rst new file mode 100644 index 000000000000..f4b006395849 --- /dev/null +++ b/Documentation/translations/it_IT/process/programming-language.rst | |||
@@ -0,0 +1,51 @@ | |||
1 | .. include:: ../disclaimer-ita.rst | ||
2 | |||
3 | :Original: :ref:`Documentation/process/programming-language.rst <programming_language>` | ||
4 | :Translator: Federico Vaga <federico.vaga@vaga.pv.it> | ||
5 | |||
6 | .. _it_programming_language: | ||
7 | |||
8 | Linguaggio di programmazione | ||
9 | ============================ | ||
10 | |||
11 | Il kernel è scritto nel linguaggio di programmazione C [c-language]_. | ||
12 | Più precisamente, il kernel viene compilato con ``gcc`` [gcc]_ usando | ||
13 | l'opzione ``-std=gnu89`` [gcc-c-dialect-options]_: il dialetto GNU | ||
14 | dello standard ISO C90 (con l'aggiunta di alcune funzionalità da C99) | ||
15 | |||
16 | Questo dialetto contiene diverse estensioni al linguaggio [gnu-extensions]_, | ||
17 | e molte di queste vengono usate sistematicamente dal kernel. | ||
18 | |||
19 | Il kernel offre un certo livello di supporto per la compilazione con ``clang`` | ||
20 | [clang]_ e ``icc`` [icc]_ su diverse architetture, tuttavia in questo momento | ||
21 | il supporto non è completo e richiede delle patch aggiuntive. | ||
22 | |||
23 | Attributi | ||
24 | --------- | ||
25 | |||
26 | Una delle estensioni più comuni e usate nel kernel sono gli attributi | ||
27 | [gcc-attribute-syntax]_. Gli attributi permettono di aggiungere una semantica, | ||
28 | definita dell'implementazione, alle entità del linguaggio (come le variabili, | ||
29 | le funzioni o i tipi) senza dover fare importanti modifiche sintattiche al | ||
30 | linguaggio stesso (come l'aggiunta di nuove parole chiave) [n2049]_. | ||
31 | |||
32 | In alcuni casi, gli attributi sono opzionali (ovvero un compilatore che non | ||
33 | dovesse supportarli dovrebbe produrre comunque codice corretto, anche se | ||
34 | più lento o che non esegue controlli aggiuntivi durante la compilazione). | ||
35 | |||
36 | Il kernel definisce alcune pseudo parole chiave (per esempio ``__pure``) | ||
37 | in alternativa alla sintassi GNU per gli attributi (per esempio | ||
38 | ``__attribute__((__pure__))``) allo scopo di mostrare quali funzionalità si | ||
39 | possono usare e/o per accorciare il codice. | ||
40 | |||
41 | Per maggiori informazioni consultate il file d'intestazione | ||
42 | ``include/linux/compiler_attributes.h``. | ||
43 | |||
44 | .. [c-language] http://www.open-std.org/jtc1/sc22/wg14/www/standards | ||
45 | .. [gcc] https://gcc.gnu.org | ||
46 | .. [clang] https://clang.llvm.org | ||
47 | .. [icc] https://software.intel.com/en-us/c-compilers | ||
48 | .. [gcc-c-dialect-options] https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html | ||
49 | .. [gnu-extensions] https://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html | ||
50 | .. [gcc-attribute-syntax] https://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html | ||
51 | .. [n2049] http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2049.pdf | ||
diff --git a/Documentation/translations/ko_KR/memory-barriers.txt b/Documentation/translations/ko_KR/memory-barriers.txt index a33c2a536542..2774624ee843 100644 --- a/Documentation/translations/ko_KR/memory-barriers.txt +++ b/Documentation/translations/ko_KR/memory-barriers.txt | |||
@@ -569,7 +569,7 @@ ACQUIRE 는 해당 오í¼ë ˆì´ì…˜ì˜ 로드 부분ì—ë§Œ ì ìš©ë˜ê³ RELEASE ë | |||
569 | 569 | ||
570 | [*] 버스 ë§ˆìŠ¤í„°ë§ DMA 와 ì¼ê´€ì„±ì— 대해서는 다ìŒì„ ì°¸ê³ í•˜ì‹œê¸° ë°”ëžë‹ˆë‹¤: | 570 | [*] 버스 ë§ˆìŠ¤í„°ë§ DMA 와 ì¼ê´€ì„±ì— 대해서는 다ìŒì„ ì°¸ê³ í•˜ì‹œê¸° ë°”ëžë‹ˆë‹¤: |
571 | 571 | ||
572 | Documentation/PCI/pci.rst | 572 | Documentation/driver-api/pci/pci.rst |
573 | Documentation/DMA-API-HOWTO.txt | 573 | Documentation/DMA-API-HOWTO.txt |
574 | Documentation/DMA-API.txt | 574 | Documentation/DMA-API.txt |
575 | 575 | ||
diff --git a/Documentation/userspace-api/conf.py b/Documentation/userspace-api/conf.py deleted file mode 100644 index 2eaf59f844e5..000000000000 --- a/Documentation/userspace-api/conf.py +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | # -*- coding: utf-8; mode: python -*- | ||
2 | |||
3 | project = "The Linux kernel user-space API guide" | ||
4 | |||
5 | tags.add("subproject") | ||
6 | |||
7 | latex_documents = [ | ||
8 | ('index', 'userspace-api.tex', project, | ||
9 | 'The kernel development community', 'manual'), | ||
10 | ] | ||
diff --git a/Documentation/virtual/index.rst b/Documentation/virt/index.rst index 062ffb527043..062ffb527043 100644 --- a/Documentation/virtual/index.rst +++ b/Documentation/virt/index.rst | |||
diff --git a/Documentation/virtual/kvm/amd-memory-encryption.rst b/Documentation/virt/kvm/amd-memory-encryption.rst index d18c97b4e140..d18c97b4e140 100644 --- a/Documentation/virtual/kvm/amd-memory-encryption.rst +++ b/Documentation/virt/kvm/amd-memory-encryption.rst | |||
diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virt/kvm/api.txt index e54a3f51ddc5..2d067767b617 100644 --- a/Documentation/virtual/kvm/api.txt +++ b/Documentation/virt/kvm/api.txt | |||
@@ -3781,7 +3781,7 @@ encrypted VMs. | |||
3781 | 3781 | ||
3782 | Currently, this ioctl is used for issuing Secure Encrypted Virtualization | 3782 | Currently, this ioctl is used for issuing Secure Encrypted Virtualization |
3783 | (SEV) commands on AMD Processors. The SEV commands are defined in | 3783 | (SEV) commands on AMD Processors. The SEV commands are defined in |
3784 | Documentation/virtual/kvm/amd-memory-encryption.rst. | 3784 | Documentation/virt/kvm/amd-memory-encryption.rst. |
3785 | 3785 | ||
3786 | 4.111 KVM_MEMORY_ENCRYPT_REG_REGION | 3786 | 4.111 KVM_MEMORY_ENCRYPT_REG_REGION |
3787 | 3787 | ||
diff --git a/Documentation/virtual/kvm/arm/hyp-abi.txt b/Documentation/virt/kvm/arm/hyp-abi.txt index a20a0bee268d..a20a0bee268d 100644 --- a/Documentation/virtual/kvm/arm/hyp-abi.txt +++ b/Documentation/virt/kvm/arm/hyp-abi.txt | |||
diff --git a/Documentation/virtual/kvm/arm/psci.txt b/Documentation/virt/kvm/arm/psci.txt index 559586fc9d37..559586fc9d37 100644 --- a/Documentation/virtual/kvm/arm/psci.txt +++ b/Documentation/virt/kvm/arm/psci.txt | |||
diff --git a/Documentation/virtual/kvm/cpuid.rst b/Documentation/virt/kvm/cpuid.rst index 01b081f6e7ea..01b081f6e7ea 100644 --- a/Documentation/virtual/kvm/cpuid.rst +++ b/Documentation/virt/kvm/cpuid.rst | |||
diff --git a/Documentation/virtual/kvm/devices/README b/Documentation/virt/kvm/devices/README index 34a69834124a..34a69834124a 100644 --- a/Documentation/virtual/kvm/devices/README +++ b/Documentation/virt/kvm/devices/README | |||
diff --git a/Documentation/virtual/kvm/devices/arm-vgic-its.txt b/Documentation/virt/kvm/devices/arm-vgic-its.txt index eeaa95b893a8..eeaa95b893a8 100644 --- a/Documentation/virtual/kvm/devices/arm-vgic-its.txt +++ b/Documentation/virt/kvm/devices/arm-vgic-its.txt | |||
diff --git a/Documentation/virtual/kvm/devices/arm-vgic-v3.txt b/Documentation/virt/kvm/devices/arm-vgic-v3.txt index ff290b43c8e5..ff290b43c8e5 100644 --- a/Documentation/virtual/kvm/devices/arm-vgic-v3.txt +++ b/Documentation/virt/kvm/devices/arm-vgic-v3.txt | |||
diff --git a/Documentation/virtual/kvm/devices/arm-vgic.txt b/Documentation/virt/kvm/devices/arm-vgic.txt index 97b6518148f8..97b6518148f8 100644 --- a/Documentation/virtual/kvm/devices/arm-vgic.txt +++ b/Documentation/virt/kvm/devices/arm-vgic.txt | |||
diff --git a/Documentation/virtual/kvm/devices/mpic.txt b/Documentation/virt/kvm/devices/mpic.txt index 8257397adc3c..8257397adc3c 100644 --- a/Documentation/virtual/kvm/devices/mpic.txt +++ b/Documentation/virt/kvm/devices/mpic.txt | |||
diff --git a/Documentation/virtual/kvm/devices/s390_flic.txt b/Documentation/virt/kvm/devices/s390_flic.txt index a4e20a090174..a4e20a090174 100644 --- a/Documentation/virtual/kvm/devices/s390_flic.txt +++ b/Documentation/virt/kvm/devices/s390_flic.txt | |||
diff --git a/Documentation/virtual/kvm/devices/vcpu.txt b/Documentation/virt/kvm/devices/vcpu.txt index 2b5dab16c4f2..2b5dab16c4f2 100644 --- a/Documentation/virtual/kvm/devices/vcpu.txt +++ b/Documentation/virt/kvm/devices/vcpu.txt | |||
diff --git a/Documentation/virtual/kvm/devices/vfio.txt b/Documentation/virt/kvm/devices/vfio.txt index 528c77c8022c..528c77c8022c 100644 --- a/Documentation/virtual/kvm/devices/vfio.txt +++ b/Documentation/virt/kvm/devices/vfio.txt | |||
diff --git a/Documentation/virtual/kvm/devices/vm.txt b/Documentation/virt/kvm/devices/vm.txt index 4ffb82b02468..4ffb82b02468 100644 --- a/Documentation/virtual/kvm/devices/vm.txt +++ b/Documentation/virt/kvm/devices/vm.txt | |||
diff --git a/Documentation/virtual/kvm/devices/xics.txt b/Documentation/virt/kvm/devices/xics.txt index 42864935ac5d..42864935ac5d 100644 --- a/Documentation/virtual/kvm/devices/xics.txt +++ b/Documentation/virt/kvm/devices/xics.txt | |||
diff --git a/Documentation/virtual/kvm/devices/xive.txt b/Documentation/virt/kvm/devices/xive.txt index 9a24a4525253..9a24a4525253 100644 --- a/Documentation/virtual/kvm/devices/xive.txt +++ b/Documentation/virt/kvm/devices/xive.txt | |||
diff --git a/Documentation/virtual/kvm/halt-polling.txt b/Documentation/virt/kvm/halt-polling.txt index 4f791b128dd2..4f791b128dd2 100644 --- a/Documentation/virtual/kvm/halt-polling.txt +++ b/Documentation/virt/kvm/halt-polling.txt | |||
diff --git a/Documentation/virtual/kvm/hypercalls.txt b/Documentation/virt/kvm/hypercalls.txt index da210651f714..5f6d291bd004 100644 --- a/Documentation/virtual/kvm/hypercalls.txt +++ b/Documentation/virt/kvm/hypercalls.txt | |||
@@ -18,7 +18,7 @@ S390: | |||
18 | number in R1. | 18 | number in R1. |
19 | 19 | ||
20 | For further information on the S390 diagnose call as supported by KVM, | 20 | For further information on the S390 diagnose call as supported by KVM, |
21 | refer to Documentation/virtual/kvm/s390-diag.txt. | 21 | refer to Documentation/virt/kvm/s390-diag.txt. |
22 | 22 | ||
23 | PowerPC: | 23 | PowerPC: |
24 | It uses R3-R10 and hypercall number in R11. R4-R11 are used as output registers. | 24 | It uses R3-R10 and hypercall number in R11. R4-R11 are used as output registers. |
@@ -26,7 +26,7 @@ S390: | |||
26 | 26 | ||
27 | KVM hypercalls uses 4 byte opcode, that are patched with 'hypercall-instructions' | 27 | KVM hypercalls uses 4 byte opcode, that are patched with 'hypercall-instructions' |
28 | property inside the device tree's /hypervisor node. | 28 | property inside the device tree's /hypervisor node. |
29 | For more information refer to Documentation/virtual/kvm/ppc-pv.txt | 29 | For more information refer to Documentation/virt/kvm/ppc-pv.txt |
30 | 30 | ||
31 | MIPS: | 31 | MIPS: |
32 | KVM hypercalls use the HYPCALL instruction with code 0 and the hypercall | 32 | KVM hypercalls use the HYPCALL instruction with code 0 and the hypercall |
diff --git a/Documentation/virtual/kvm/index.rst b/Documentation/virt/kvm/index.rst index 0b206a06f5be..ada224a511fe 100644 --- a/Documentation/virtual/kvm/index.rst +++ b/Documentation/virt/kvm/index.rst | |||
@@ -9,3 +9,4 @@ KVM | |||
9 | 9 | ||
10 | amd-memory-encryption | 10 | amd-memory-encryption |
11 | cpuid | 11 | cpuid |
12 | vcpu-requests | ||
diff --git a/Documentation/virtual/kvm/locking.txt b/Documentation/virt/kvm/locking.txt index 635cd6eaf714..635cd6eaf714 100644 --- a/Documentation/virtual/kvm/locking.txt +++ b/Documentation/virt/kvm/locking.txt | |||
diff --git a/Documentation/virtual/kvm/mmu.txt b/Documentation/virt/kvm/mmu.txt index 2efe0efc516e..1b9880dfba0a 100644 --- a/Documentation/virtual/kvm/mmu.txt +++ b/Documentation/virt/kvm/mmu.txt | |||
@@ -298,7 +298,7 @@ Handling a page fault is performed as follows: | |||
298 | vcpu->arch.mmio_gfn, and call the emulator | 298 | vcpu->arch.mmio_gfn, and call the emulator |
299 | - If both P bit and R/W bit of error code are set, this could possibly | 299 | - If both P bit and R/W bit of error code are set, this could possibly |
300 | be handled as a "fast page fault" (fixed without taking the MMU lock). See | 300 | be handled as a "fast page fault" (fixed without taking the MMU lock). See |
301 | the description in Documentation/virtual/kvm/locking.txt. | 301 | the description in Documentation/virt/kvm/locking.txt. |
302 | - if needed, walk the guest page tables to determine the guest translation | 302 | - if needed, walk the guest page tables to determine the guest translation |
303 | (gva->gpa or ngpa->gpa) | 303 | (gva->gpa or ngpa->gpa) |
304 | - if permissions are insufficient, reflect the fault back to the guest | 304 | - if permissions are insufficient, reflect the fault back to the guest |
diff --git a/Documentation/virtual/kvm/msr.txt b/Documentation/virt/kvm/msr.txt index df1f4338b3ca..df1f4338b3ca 100644 --- a/Documentation/virtual/kvm/msr.txt +++ b/Documentation/virt/kvm/msr.txt | |||
diff --git a/Documentation/virtual/kvm/nested-vmx.txt b/Documentation/virt/kvm/nested-vmx.txt index 97eb1353e962..97eb1353e962 100644 --- a/Documentation/virtual/kvm/nested-vmx.txt +++ b/Documentation/virt/kvm/nested-vmx.txt | |||
diff --git a/Documentation/virtual/kvm/ppc-pv.txt b/Documentation/virt/kvm/ppc-pv.txt index e26115ce4258..e26115ce4258 100644 --- a/Documentation/virtual/kvm/ppc-pv.txt +++ b/Documentation/virt/kvm/ppc-pv.txt | |||
diff --git a/Documentation/virtual/kvm/review-checklist.txt b/Documentation/virt/kvm/review-checklist.txt index a83b27635fdd..499af499e296 100644 --- a/Documentation/virtual/kvm/review-checklist.txt +++ b/Documentation/virt/kvm/review-checklist.txt | |||
@@ -7,7 +7,7 @@ Review checklist for kvm patches | |||
7 | 2. Patches should be against kvm.git master branch. | 7 | 2. Patches should be against kvm.git master branch. |
8 | 8 | ||
9 | 3. If the patch introduces or modifies a new userspace API: | 9 | 3. If the patch introduces or modifies a new userspace API: |
10 | - the API must be documented in Documentation/virtual/kvm/api.txt | 10 | - the API must be documented in Documentation/virt/kvm/api.txt |
11 | - the API must be discoverable using KVM_CHECK_EXTENSION | 11 | - the API must be discoverable using KVM_CHECK_EXTENSION |
12 | 12 | ||
13 | 4. New state must include support for save/restore. | 13 | 4. New state must include support for save/restore. |
diff --git a/Documentation/virtual/kvm/s390-diag.txt b/Documentation/virt/kvm/s390-diag.txt index 7c52e5f8b210..7c52e5f8b210 100644 --- a/Documentation/virtual/kvm/s390-diag.txt +++ b/Documentation/virt/kvm/s390-diag.txt | |||
diff --git a/Documentation/virtual/kvm/timekeeping.txt b/Documentation/virt/kvm/timekeeping.txt index 76808a17ad84..76808a17ad84 100644 --- a/Documentation/virtual/kvm/timekeeping.txt +++ b/Documentation/virt/kvm/timekeeping.txt | |||
diff --git a/Documentation/virtual/kvm/vcpu-requests.rst b/Documentation/virt/kvm/vcpu-requests.rst index 5feb3706a7ae..5feb3706a7ae 100644 --- a/Documentation/virtual/kvm/vcpu-requests.rst +++ b/Documentation/virt/kvm/vcpu-requests.rst | |||
diff --git a/Documentation/virtual/paravirt_ops.rst b/Documentation/virt/paravirt_ops.rst index 6b789d27cead..6b789d27cead 100644 --- a/Documentation/virtual/paravirt_ops.rst +++ b/Documentation/virt/paravirt_ops.rst | |||
diff --git a/Documentation/virtual/uml/UserModeLinux-HOWTO.txt b/Documentation/virt/uml/UserModeLinux-HOWTO.txt index 87b80f589e1c..87b80f589e1c 100644 --- a/Documentation/virtual/uml/UserModeLinux-HOWTO.txt +++ b/Documentation/virt/uml/UserModeLinux-HOWTO.txt | |||
diff --git a/Documentation/vm/conf.py b/Documentation/vm/conf.py deleted file mode 100644 index 3b0b601af558..000000000000 --- a/Documentation/vm/conf.py +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | # -*- coding: utf-8; mode: python -*- | ||
2 | |||
3 | project = "Linux Memory Management Documentation" | ||
4 | |||
5 | tags.add("subproject") | ||
6 | |||
7 | latex_documents = [ | ||
8 | ('index', 'memory-management.tex', project, | ||
9 | 'The kernel development community', 'manual'), | ||
10 | ] | ||
diff --git a/Documentation/watchdog/hpwdt.rst b/Documentation/watchdog/hpwdt.rst index c165d92cfd12..c824cd7f6e32 100644 --- a/Documentation/watchdog/hpwdt.rst +++ b/Documentation/watchdog/hpwdt.rst | |||
@@ -63,7 +63,7 @@ Last reviewed: 08/20/2018 | |||
63 | and loop forever. This is generally not what a watchdog user wants. | 63 | and loop forever. This is generally not what a watchdog user wants. |
64 | 64 | ||
65 | For those wishing to learn more please see: | 65 | For those wishing to learn more please see: |
66 | Documentation/kdump/kdump.rst | 66 | Documentation/admin-guide/kdump/kdump.rst |
67 | Documentation/admin-guide/kernel-parameters.txt (panic=) | 67 | Documentation/admin-guide/kernel-parameters.txt (panic=) |
68 | Your Linux Distribution specific documentation. | 68 | Your Linux Distribution specific documentation. |
69 | 69 | ||
diff --git a/Documentation/x86/conf.py b/Documentation/x86/conf.py deleted file mode 100644 index 33c5c3142e20..000000000000 --- a/Documentation/x86/conf.py +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | # -*- coding: utf-8; mode: python -*- | ||
2 | |||
3 | project = "X86 architecture specific documentation" | ||
4 | |||
5 | tags.add("subproject") | ||
6 | |||
7 | latex_documents = [ | ||
8 | ('index', 'x86.tex', project, | ||
9 | 'The kernel development community', 'manual'), | ||
10 | ] | ||
diff --git a/MAINTAINERS b/MAINTAINERS index bab0ca437e31..3a5ef62c9dd1 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -899,7 +899,7 @@ L: linux-iio@vger.kernel.org | |||
899 | W: http://ez.analog.com/community/linux-device-drivers | 899 | W: http://ez.analog.com/community/linux-device-drivers |
900 | S: Supported | 900 | S: Supported |
901 | F: drivers/iio/adc/ad7124.c | 901 | F: drivers/iio/adc/ad7124.c |
902 | F: Documentation/devicetree/bindings/iio/adc/adi,ad7124.txt | 902 | F: Documentation/devicetree/bindings/iio/adc/adi,ad7124.yaml |
903 | 903 | ||
904 | ANALOG DEVICES INC AD7606 DRIVER | 904 | ANALOG DEVICES INC AD7606 DRIVER |
905 | M: Stefan Popa <stefan.popa@analog.com> | 905 | M: Stefan Popa <stefan.popa@analog.com> |
@@ -1194,7 +1194,7 @@ F: include/uapi/linux/if_arcnet.h | |||
1194 | 1194 | ||
1195 | ARM ARCHITECTED TIMER DRIVER | 1195 | ARM ARCHITECTED TIMER DRIVER |
1196 | M: Mark Rutland <mark.rutland@arm.com> | 1196 | M: Mark Rutland <mark.rutland@arm.com> |
1197 | M: Marc Zyngier <marc.zyngier@arm.com> | 1197 | M: Marc Zyngier <maz@kernel.org> |
1198 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) | 1198 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) |
1199 | S: Maintained | 1199 | S: Maintained |
1200 | F: arch/arm/include/asm/arch_timer.h | 1200 | F: arch/arm/include/asm/arch_timer.h |
@@ -4190,7 +4190,7 @@ M: Jens Axboe <axboe@kernel.dk> | |||
4190 | L: cgroups@vger.kernel.org | 4190 | L: cgroups@vger.kernel.org |
4191 | L: linux-block@vger.kernel.org | 4191 | L: linux-block@vger.kernel.org |
4192 | T: git git://git.kernel.dk/linux-block | 4192 | T: git git://git.kernel.dk/linux-block |
4193 | F: Documentation/cgroup-v1/blkio-controller.rst | 4193 | F: Documentation/admin-guide/cgroup-v1/blkio-controller.rst |
4194 | F: block/blk-cgroup.c | 4194 | F: block/blk-cgroup.c |
4195 | F: include/linux/blk-cgroup.h | 4195 | F: include/linux/blk-cgroup.h |
4196 | F: block/blk-throttle.c | 4196 | F: block/blk-throttle.c |
@@ -4469,7 +4469,7 @@ F: arch/powerpc/platforms/powernv/pci-cxl.c | |||
4469 | F: drivers/misc/cxl/ | 4469 | F: drivers/misc/cxl/ |
4470 | F: include/misc/cxl* | 4470 | F: include/misc/cxl* |
4471 | F: include/uapi/misc/cxl.h | 4471 | F: include/uapi/misc/cxl.h |
4472 | F: Documentation/powerpc/cxl.txt | 4472 | F: Documentation/powerpc/cxl.rst |
4473 | F: Documentation/ABI/testing/sysfs-class-cxl | 4473 | F: Documentation/ABI/testing/sysfs-class-cxl |
4474 | 4474 | ||
4475 | CXLFLASH (IBM Coherent Accelerator Processor Interface CAPI Flash) SCSI DRIVER | 4475 | CXLFLASH (IBM Coherent Accelerator Processor Interface CAPI Flash) SCSI DRIVER |
@@ -4480,7 +4480,7 @@ L: linux-scsi@vger.kernel.org | |||
4480 | S: Supported | 4480 | S: Supported |
4481 | F: drivers/scsi/cxlflash/ | 4481 | F: drivers/scsi/cxlflash/ |
4482 | F: include/uapi/scsi/cxlflash_ioctl.h | 4482 | F: include/uapi/scsi/cxlflash_ioctl.h |
4483 | F: Documentation/powerpc/cxlflash.txt | 4483 | F: Documentation/powerpc/cxlflash.rst |
4484 | 4484 | ||
4485 | CYBERPRO FB DRIVER | 4485 | CYBERPRO FB DRIVER |
4486 | M: Russell King <linux@armlinux.org.uk> | 4486 | M: Russell King <linux@armlinux.org.uk> |
@@ -6856,7 +6856,7 @@ R: Sagi Shahar <sagis@google.com> | |||
6856 | R: Jon Olson <jonolson@google.com> | 6856 | R: Jon Olson <jonolson@google.com> |
6857 | L: netdev@vger.kernel.org | 6857 | L: netdev@vger.kernel.org |
6858 | S: Supported | 6858 | S: Supported |
6859 | F: Documentation/networking/device_drivers/google/gve.txt | 6859 | F: Documentation/networking/device_drivers/google/gve.rst |
6860 | F: drivers/net/ethernet/google | 6860 | F: drivers/net/ethernet/google |
6861 | 6861 | ||
6862 | GPD POCKET FAN DRIVER | 6862 | GPD POCKET FAN DRIVER |
@@ -8490,7 +8490,7 @@ S: Obsolete | |||
8490 | F: include/uapi/linux/ipx.h | 8490 | F: include/uapi/linux/ipx.h |
8491 | 8491 | ||
8492 | IRQ DOMAINS (IRQ NUMBER MAPPING LIBRARY) | 8492 | IRQ DOMAINS (IRQ NUMBER MAPPING LIBRARY) |
8493 | M: Marc Zyngier <marc.zyngier@arm.com> | 8493 | M: Marc Zyngier <maz@kernel.org> |
8494 | S: Maintained | 8494 | S: Maintained |
8495 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq/core | 8495 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq/core |
8496 | F: Documentation/IRQ-domain.txt | 8496 | F: Documentation/IRQ-domain.txt |
@@ -8508,7 +8508,7 @@ F: kernel/irq/ | |||
8508 | IRQCHIP DRIVERS | 8508 | IRQCHIP DRIVERS |
8509 | M: Thomas Gleixner <tglx@linutronix.de> | 8509 | M: Thomas Gleixner <tglx@linutronix.de> |
8510 | M: Jason Cooper <jason@lakedaemon.net> | 8510 | M: Jason Cooper <jason@lakedaemon.net> |
8511 | M: Marc Zyngier <marc.zyngier@arm.com> | 8511 | M: Marc Zyngier <maz@kernel.org> |
8512 | L: linux-kernel@vger.kernel.org | 8512 | L: linux-kernel@vger.kernel.org |
8513 | S: Maintained | 8513 | S: Maintained |
8514 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq/core | 8514 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq/core |
@@ -8808,7 +8808,7 @@ L: kvm@vger.kernel.org | |||
8808 | W: http://www.linux-kvm.org | 8808 | W: http://www.linux-kvm.org |
8809 | T: git git://git.kernel.org/pub/scm/virt/kvm/kvm.git | 8809 | T: git git://git.kernel.org/pub/scm/virt/kvm/kvm.git |
8810 | S: Supported | 8810 | S: Supported |
8811 | F: Documentation/virtual/kvm/ | 8811 | F: Documentation/virt/kvm/ |
8812 | F: include/trace/events/kvm.h | 8812 | F: include/trace/events/kvm.h |
8813 | F: include/uapi/asm-generic/kvm* | 8813 | F: include/uapi/asm-generic/kvm* |
8814 | F: include/uapi/linux/kvm* | 8814 | F: include/uapi/linux/kvm* |
@@ -8828,10 +8828,10 @@ F: arch/x86/include/asm/svm.h | |||
8828 | F: arch/x86/kvm/svm.c | 8828 | F: arch/x86/kvm/svm.c |
8829 | 8829 | ||
8830 | KERNEL VIRTUAL MACHINE FOR ARM/ARM64 (KVM/arm, KVM/arm64) | 8830 | KERNEL VIRTUAL MACHINE FOR ARM/ARM64 (KVM/arm, KVM/arm64) |
8831 | M: Marc Zyngier <marc.zyngier@arm.com> | 8831 | M: Marc Zyngier <maz@kernel.org> |
8832 | R: James Morse <james.morse@arm.com> | 8832 | R: James Morse <james.morse@arm.com> |
8833 | R: Julien Thierry <julien.thierry@arm.com> | 8833 | R: Julien Thierry <julien.thierry.kdev@gmail.com> |
8834 | R: Suzuki K Pouloze <suzuki.poulose@arm.com> | 8834 | R: Suzuki K Poulose <suzuki.poulose@arm.com> |
8835 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) | 8835 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) |
8836 | L: kvmarm@lists.cs.columbia.edu | 8836 | L: kvmarm@lists.cs.columbia.edu |
8837 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git | 8837 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git |
@@ -12137,7 +12137,7 @@ M: Thomas Hellstrom <thellstrom@vmware.com> | |||
12137 | M: "VMware, Inc." <pv-drivers@vmware.com> | 12137 | M: "VMware, Inc." <pv-drivers@vmware.com> |
12138 | L: virtualization@lists.linux-foundation.org | 12138 | L: virtualization@lists.linux-foundation.org |
12139 | S: Supported | 12139 | S: Supported |
12140 | F: Documentation/virtual/paravirt_ops.txt | 12140 | F: Documentation/virt/paravirt_ops.rst |
12141 | F: arch/*/kernel/paravirt* | 12141 | F: arch/*/kernel/paravirt* |
12142 | F: arch/*/include/asm/paravirt*.h | 12142 | F: arch/*/include/asm/paravirt*.h |
12143 | F: include/linux/hypervisor.h | 12143 | F: include/linux/hypervisor.h |
@@ -12394,7 +12394,7 @@ F: Documentation/PCI/pci-error-recovery.rst | |||
12394 | F: drivers/pci/pcie/aer.c | 12394 | F: drivers/pci/pcie/aer.c |
12395 | F: drivers/pci/pcie/dpc.c | 12395 | F: drivers/pci/pcie/dpc.c |
12396 | F: drivers/pci/pcie/err.c | 12396 | F: drivers/pci/pcie/err.c |
12397 | F: Documentation/powerpc/eeh-pci-error-recovery.txt | 12397 | F: Documentation/powerpc/eeh-pci-error-recovery.rst |
12398 | F: arch/powerpc/kernel/eeh*.c | 12398 | F: arch/powerpc/kernel/eeh*.c |
12399 | F: arch/powerpc/platforms/*/eeh*.c | 12399 | F: arch/powerpc/platforms/*/eeh*.c |
12400 | F: arch/powerpc/include/*/eeh*.h | 12400 | F: arch/powerpc/include/*/eeh*.h |
@@ -13726,6 +13726,7 @@ F: drivers/mtd/nand/raw/r852.c | |||
13726 | F: drivers/mtd/nand/raw/r852.h | 13726 | F: drivers/mtd/nand/raw/r852.h |
13727 | 13727 | ||
13728 | RISC-V ARCHITECTURE | 13728 | RISC-V ARCHITECTURE |
13729 | M: Paul Walmsley <paul.walmsley@sifive.com> | ||
13729 | M: Palmer Dabbelt <palmer@sifive.com> | 13730 | M: Palmer Dabbelt <palmer@sifive.com> |
13730 | M: Albert Ou <aou@eecs.berkeley.edu> | 13731 | M: Albert Ou <aou@eecs.berkeley.edu> |
13731 | L: linux-riscv@lists.infradead.org | 13732 | L: linux-riscv@lists.infradead.org |
@@ -13948,7 +13949,6 @@ F: drivers/pci/hotplug/s390_pci_hpc.c | |||
13948 | 13949 | ||
13949 | S390 VFIO-CCW DRIVER | 13950 | S390 VFIO-CCW DRIVER |
13950 | M: Cornelia Huck <cohuck@redhat.com> | 13951 | M: Cornelia Huck <cohuck@redhat.com> |
13951 | M: Farhan Ali <alifm@linux.ibm.com> | ||
13952 | M: Eric Farman <farman@linux.ibm.com> | 13952 | M: Eric Farman <farman@linux.ibm.com> |
13953 | R: Halil Pasic <pasic@linux.ibm.com> | 13953 | R: Halil Pasic <pasic@linux.ibm.com> |
13954 | L: linux-s390@vger.kernel.org | 13954 | L: linux-s390@vger.kernel.org |
@@ -16861,7 +16861,7 @@ W: http://user-mode-linux.sourceforge.net | |||
16861 | Q: https://patchwork.ozlabs.org/project/linux-um/list/ | 16861 | Q: https://patchwork.ozlabs.org/project/linux-um/list/ |
16862 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml.git | 16862 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml.git |
16863 | S: Maintained | 16863 | S: Maintained |
16864 | F: Documentation/virtual/uml/ | 16864 | F: Documentation/virt/uml/ |
16865 | F: arch/um/ | 16865 | F: arch/um/ |
16866 | F: arch/x86/um/ | 16866 | F: arch/x86/um/ |
16867 | F: fs/hostfs/ | 16867 | F: fs/hostfs/ |
@@ -17130,7 +17130,7 @@ F: drivers/virtio/virtio_input.c | |||
17130 | F: include/uapi/linux/virtio_input.h | 17130 | F: include/uapi/linux/virtio_input.h |
17131 | 17131 | ||
17132 | VIRTIO IOMMU DRIVER | 17132 | VIRTIO IOMMU DRIVER |
17133 | M: Jean-Philippe Brucker <jean-philippe.brucker@arm.com> | 17133 | M: Jean-Philippe Brucker <jean-philippe@linaro.org> |
17134 | L: virtualization@lists.linux-foundation.org | 17134 | L: virtualization@lists.linux-foundation.org |
17135 | S: Maintained | 17135 | S: Maintained |
17136 | F: drivers/iommu/virtio-iommu.c | 17136 | F: drivers/iommu/virtio-iommu.c |
@@ -17179,7 +17179,6 @@ F: drivers/vme/ | |||
17179 | F: include/linux/vme* | 17179 | F: include/linux/vme* |
17180 | 17180 | ||
17181 | VMWARE BALLOON DRIVER | 17181 | VMWARE BALLOON DRIVER |
17182 | M: Julien Freche <jfreche@vmware.com> | ||
17183 | M: Nadav Amit <namit@vmware.com> | 17182 | M: Nadav Amit <namit@vmware.com> |
17184 | M: "VMware, Inc." <pv-drivers@vmware.com> | 17183 | M: "VMware, Inc." <pv-drivers@vmware.com> |
17185 | L: linux-kernel@vger.kernel.org | 17184 | L: linux-kernel@vger.kernel.org |
@@ -2,7 +2,7 @@ | |||
2 | VERSION = 5 | 2 | VERSION = 5 |
3 | PATCHLEVEL = 3 | 3 | PATCHLEVEL = 3 |
4 | SUBLEVEL = 0 | 4 | SUBLEVEL = 0 |
5 | EXTRAVERSION = -rc1 | 5 | EXTRAVERSION = -rc2 |
6 | NAME = Bobtail Squid | 6 | NAME = Bobtail Squid |
7 | 7 | ||
8 | # *DOCUMENTATION* | 8 | # *DOCUMENTATION* |
@@ -843,6 +843,9 @@ NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include) | |||
843 | # warn about C99 declaration after statement | 843 | # warn about C99 declaration after statement |
844 | KBUILD_CFLAGS += -Wdeclaration-after-statement | 844 | KBUILD_CFLAGS += -Wdeclaration-after-statement |
845 | 845 | ||
846 | # Warn about unmarked fall-throughs in switch statement. | ||
847 | KBUILD_CFLAGS += $(call cc-option,-Wimplicit-fallthrough=3,) | ||
848 | |||
846 | # Variable Length Arrays (VLAs) should not be used anywhere in the kernel | 849 | # Variable Length Arrays (VLAs) should not be used anywhere in the kernel |
847 | KBUILD_CFLAGS += -Wvla | 850 | KBUILD_CFLAGS += -Wvla |
848 | 851 | ||
diff --git a/arch/Kconfig b/arch/Kconfig index a7b57dd42c26..c7efbc018f4f 100644 --- a/arch/Kconfig +++ b/arch/Kconfig | |||
@@ -103,7 +103,7 @@ config STATIC_KEYS_SELFTEST | |||
103 | config OPTPROBES | 103 | config OPTPROBES |
104 | def_bool y | 104 | def_bool y |
105 | depends on KPROBES && HAVE_OPTPROBES | 105 | depends on KPROBES && HAVE_OPTPROBES |
106 | select TASKS_RCU if PREEMPT | 106 | select TASKS_RCU if PREEMPTION |
107 | 107 | ||
108 | config KPROBES_ON_FTRACE | 108 | config KPROBES_ON_FTRACE |
109 | def_bool y | 109 | def_bool y |
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index c929bea9a9ff..85710e078afb 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug | |||
@@ -1535,7 +1535,6 @@ config DEBUG_LL_INCLUDE | |||
1535 | DEBUG_IMX7D_UART | 1535 | DEBUG_IMX7D_UART |
1536 | default "debug/ks8695.S" if DEBUG_KS8695_UART | 1536 | default "debug/ks8695.S" if DEBUG_KS8695_UART |
1537 | default "debug/msm.S" if DEBUG_QCOM_UARTDM | 1537 | default "debug/msm.S" if DEBUG_QCOM_UARTDM |
1538 | default "debug/netx.S" if DEBUG_NETX_UART | ||
1539 | default "debug/omap2plus.S" if DEBUG_OMAP2PLUS_UART | 1538 | default "debug/omap2plus.S" if DEBUG_OMAP2PLUS_UART |
1540 | default "debug/renesas-scif.S" if DEBUG_R7S72100_SCIF2 | 1539 | default "debug/renesas-scif.S" if DEBUG_R7S72100_SCIF2 |
1541 | default "debug/renesas-scif.S" if DEBUG_RCAR_GEN1_SCIF0 | 1540 | default "debug/renesas-scif.S" if DEBUG_RCAR_GEN1_SCIF0 |
@@ -1575,7 +1574,6 @@ config DEBUG_UART_8250 | |||
1575 | 1574 | ||
1576 | config DEBUG_UART_PHYS | 1575 | config DEBUG_UART_PHYS |
1577 | hex "Physical base address of debug UART" | 1576 | hex "Physical base address of debug UART" |
1578 | default 0x00100a00 if DEBUG_NETX_UART | ||
1579 | default 0x01c20000 if DEBUG_DAVINCI_DMx_UART0 | 1577 | default 0x01c20000 if DEBUG_DAVINCI_DMx_UART0 |
1580 | default 0x01c28000 if DEBUG_SUNXI_UART0 | 1578 | default 0x01c28000 if DEBUG_SUNXI_UART0 |
1581 | default 0x01c28400 if DEBUG_SUNXI_UART1 | 1579 | default 0x01c28400 if DEBUG_SUNXI_UART1 |
@@ -1700,7 +1698,6 @@ config DEBUG_UART_PHYS | |||
1700 | DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \ | 1698 | DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \ |
1701 | DEBUG_LL_UART_EFM32 || \ | 1699 | DEBUG_LL_UART_EFM32 || \ |
1702 | DEBUG_UART_8250 || DEBUG_UART_PL01X || DEBUG_MESON_UARTAO || \ | 1700 | DEBUG_UART_8250 || DEBUG_UART_PL01X || DEBUG_MESON_UARTAO || \ |
1703 | DEBUG_NETX_UART || \ | ||
1704 | DEBUG_QCOM_UARTDM || DEBUG_R7S72100_SCIF2 || \ | 1701 | DEBUG_QCOM_UARTDM || DEBUG_R7S72100_SCIF2 || \ |
1705 | DEBUG_RCAR_GEN1_SCIF0 || DEBUG_RCAR_GEN1_SCIF2 || \ | 1702 | DEBUG_RCAR_GEN1_SCIF0 || DEBUG_RCAR_GEN1_SCIF2 || \ |
1706 | DEBUG_RCAR_GEN2_SCIF0 || DEBUG_RCAR_GEN2_SCIF1 || \ | 1703 | DEBUG_RCAR_GEN2_SCIF0 || DEBUG_RCAR_GEN2_SCIF1 || \ |
@@ -1717,7 +1714,6 @@ config DEBUG_UART_VIRT | |||
1717 | default 0xc881f000 if DEBUG_RV1108_UART2 | 1714 | default 0xc881f000 if DEBUG_RV1108_UART2 |
1718 | default 0xc8821000 if DEBUG_RV1108_UART1 | 1715 | default 0xc8821000 if DEBUG_RV1108_UART1 |
1719 | default 0xc8912000 if DEBUG_RV1108_UART0 | 1716 | default 0xc8912000 if DEBUG_RV1108_UART0 |
1720 | default 0xe0000a00 if DEBUG_NETX_UART | ||
1721 | default 0xe0010fe0 if ARCH_RPC | 1717 | default 0xe0010fe0 if ARCH_RPC |
1722 | default 0xf0000be0 if ARCH_EBSA110 | 1718 | default 0xf0000be0 if ARCH_EBSA110 |
1723 | default 0xf0010000 if DEBUG_ASM9260_UART | 1719 | default 0xf0010000 if DEBUG_ASM9260_UART |
@@ -1822,7 +1818,6 @@ config DEBUG_UART_VIRT | |||
1822 | default DEBUG_UART_PHYS if !MMU | 1818 | default DEBUG_UART_PHYS if !MMU |
1823 | depends on DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \ | 1819 | depends on DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \ |
1824 | DEBUG_UART_8250 || DEBUG_UART_PL01X || DEBUG_MESON_UARTAO || \ | 1820 | DEBUG_UART_8250 || DEBUG_UART_PL01X || DEBUG_MESON_UARTAO || \ |
1825 | DEBUG_NETX_UART || \ | ||
1826 | DEBUG_QCOM_UARTDM || DEBUG_S3C24XX_UART || \ | 1821 | DEBUG_QCOM_UARTDM || DEBUG_S3C24XX_UART || \ |
1827 | DEBUG_S3C64XX_UART || \ | 1822 | DEBUG_S3C64XX_UART || \ |
1828 | DEBUG_BCM63XX_UART || DEBUG_ASM9260_UART || \ | 1823 | DEBUG_BCM63XX_UART || DEBUG_ASM9260_UART || \ |
diff --git a/arch/arm/boot/dts/bcm47094-linksys-panamera.dts b/arch/arm/boot/dts/bcm47094-linksys-panamera.dts index 18d0ae46e76c..0faae8950375 100644 --- a/arch/arm/boot/dts/bcm47094-linksys-panamera.dts +++ b/arch/arm/boot/dts/bcm47094-linksys-panamera.dts | |||
@@ -124,6 +124,9 @@ | |||
124 | }; | 124 | }; |
125 | 125 | ||
126 | mdio-bus-mux { | 126 | mdio-bus-mux { |
127 | #address-cells = <1>; | ||
128 | #size-cells = <0>; | ||
129 | |||
127 | /* BIT(9) = 1 => external mdio */ | 130 | /* BIT(9) = 1 => external mdio */ |
128 | mdio_ext: mdio@200 { | 131 | mdio_ext: mdio@200 { |
129 | reg = <0x200>; | 132 | reg = <0x200>; |
diff --git a/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi b/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi index cbe61b61a212..c2a9dd57e56a 100644 --- a/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi +++ b/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi | |||
@@ -112,7 +112,7 @@ | |||
112 | }; | 112 | }; |
113 | 113 | ||
114 | &i2c2 { | 114 | &i2c2 { |
115 | clock_frequency = <100000>; | 115 | clock-frequency = <100000>; |
116 | pinctrl-names = "default"; | 116 | pinctrl-names = "default"; |
117 | pinctrl-0 = <&pinctrl_i2c2>; | 117 | pinctrl-0 = <&pinctrl_i2c2>; |
118 | status = "okay"; | 118 | status = "okay"; |
diff --git a/arch/arm/boot/dts/imx6ul-geam.dts b/arch/arm/boot/dts/imx6ul-geam.dts index 21ddd359d3ed..9f63706383a7 100644 --- a/arch/arm/boot/dts/imx6ul-geam.dts +++ b/arch/arm/boot/dts/imx6ul-geam.dts | |||
@@ -156,7 +156,7 @@ | |||
156 | }; | 156 | }; |
157 | 157 | ||
158 | &i2c2 { | 158 | &i2c2 { |
159 | clock_frequency = <100000>; | 159 | clock-frequency = <100000>; |
160 | pinctrl-names = "default"; | 160 | pinctrl-names = "default"; |
161 | pinctrl-0 = <&pinctrl_i2c2>; | 161 | pinctrl-0 = <&pinctrl_i2c2>; |
162 | status = "okay"; | 162 | status = "okay"; |
diff --git a/arch/arm/boot/dts/imx6ul-isiot.dtsi b/arch/arm/boot/dts/imx6ul-isiot.dtsi index b26d4f57c655..cc9adce638f5 100644 --- a/arch/arm/boot/dts/imx6ul-isiot.dtsi +++ b/arch/arm/boot/dts/imx6ul-isiot.dtsi | |||
@@ -148,7 +148,7 @@ | |||
148 | }; | 148 | }; |
149 | 149 | ||
150 | &i2c2 { | 150 | &i2c2 { |
151 | clock_frequency = <100000>; | 151 | clock-frequency = <100000>; |
152 | pinctrl-names = "default"; | 152 | pinctrl-names = "default"; |
153 | pinctrl-0 = <&pinctrl_i2c2>; | 153 | pinctrl-0 = <&pinctrl_i2c2>; |
154 | status = "okay"; | 154 | status = "okay"; |
diff --git a/arch/arm/boot/dts/imx6ul-pico-hobbit.dts b/arch/arm/boot/dts/imx6ul-pico-hobbit.dts index 39eeeddac39e..09f7ffa9ad8c 100644 --- a/arch/arm/boot/dts/imx6ul-pico-hobbit.dts +++ b/arch/arm/boot/dts/imx6ul-pico-hobbit.dts | |||
@@ -43,7 +43,7 @@ | |||
43 | }; | 43 | }; |
44 | 44 | ||
45 | &i2c2 { | 45 | &i2c2 { |
46 | clock_frequency = <100000>; | 46 | clock-frequency = <100000>; |
47 | pinctrl-names = "default"; | 47 | pinctrl-names = "default"; |
48 | pinctrl-0 = <&pinctrl_i2c2>; | 48 | pinctrl-0 = <&pinctrl_i2c2>; |
49 | status = "okay"; | 49 | status = "okay"; |
diff --git a/arch/arm/boot/dts/imx6ul-pico-pi.dts b/arch/arm/boot/dts/imx6ul-pico-pi.dts index de07357b27fc..6cd7d5877d20 100644 --- a/arch/arm/boot/dts/imx6ul-pico-pi.dts +++ b/arch/arm/boot/dts/imx6ul-pico-pi.dts | |||
@@ -43,7 +43,7 @@ | |||
43 | }; | 43 | }; |
44 | 44 | ||
45 | &i2c2 { | 45 | &i2c2 { |
46 | clock_frequency = <100000>; | 46 | clock-frequency = <100000>; |
47 | pinctrl-names = "default"; | 47 | pinctrl-names = "default"; |
48 | pinctrl-0 = <&pinctrl_i2c2>; | 48 | pinctrl-0 = <&pinctrl_i2c2>; |
49 | status = "okay"; | 49 | status = "okay"; |
@@ -58,7 +58,7 @@ | |||
58 | }; | 58 | }; |
59 | 59 | ||
60 | &i2c3 { | 60 | &i2c3 { |
61 | clock_frequency = <100000>; | 61 | clock-frequency = <100000>; |
62 | pinctrl-names = "default"; | 62 | pinctrl-names = "default"; |
63 | pinctrl-0 = <&pinctrl_i2c3>; | 63 | pinctrl-0 = <&pinctrl_i2c3>; |
64 | status = "okay"; | 64 | status = "okay"; |
diff --git a/arch/arm/boot/dts/imx7ulp.dtsi b/arch/arm/boot/dts/imx7ulp.dtsi index 992747a57442..56907bb4b329 100644 --- a/arch/arm/boot/dts/imx7ulp.dtsi +++ b/arch/arm/boot/dts/imx7ulp.dtsi | |||
@@ -186,7 +186,7 @@ | |||
186 | reg = <0x40330200 0x200>; | 186 | reg = <0x40330200 0x200>; |
187 | }; | 187 | }; |
188 | 188 | ||
189 | usbphy1: usb-phy@0x40350000 { | 189 | usbphy1: usb-phy@40350000 { |
190 | compatible = "fsl,imx7ulp-usbphy", "fsl,imx6ul-usbphy"; | 190 | compatible = "fsl,imx7ulp-usbphy", "fsl,imx6ul-usbphy"; |
191 | reg = <0x40350000 0x1000>; | 191 | reg = <0x40350000 0x1000>; |
192 | interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>; | 192 | interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>; |
diff --git a/arch/arm/configs/u8500_defconfig b/arch/arm/configs/u8500_defconfig index e6b98b6eb88d..822cddfbf1af 100644 --- a/arch/arm/configs/u8500_defconfig +++ b/arch/arm/configs/u8500_defconfig | |||
@@ -4,17 +4,9 @@ CONFIG_NO_HZ_IDLE=y | |||
4 | CONFIG_HIGH_RES_TIMERS=y | 4 | CONFIG_HIGH_RES_TIMERS=y |
5 | CONFIG_BLK_DEV_INITRD=y | 5 | CONFIG_BLK_DEV_INITRD=y |
6 | CONFIG_KALLSYMS_ALL=y | 6 | CONFIG_KALLSYMS_ALL=y |
7 | CONFIG_MODULES=y | ||
8 | CONFIG_MODULE_UNLOAD=y | ||
9 | # CONFIG_BLK_DEV_BSG is not set | ||
10 | CONFIG_PARTITION_ADVANCED=y | ||
11 | CONFIG_ARCH_U8500=y | 7 | CONFIG_ARCH_U8500=y |
12 | CONFIG_MACH_HREFV60=y | ||
13 | CONFIG_MACH_SNOWBALL=y | ||
14 | CONFIG_SMP=y | 8 | CONFIG_SMP=y |
15 | CONFIG_NR_CPUS=2 | 9 | CONFIG_NR_CPUS=2 |
16 | CONFIG_PREEMPT=y | ||
17 | CONFIG_AEABI=y | ||
18 | CONFIG_HIGHMEM=y | 10 | CONFIG_HIGHMEM=y |
19 | CONFIG_ARM_APPENDED_DTB=y | 11 | CONFIG_ARM_APPENDED_DTB=y |
20 | CONFIG_ARM_ATAG_DTB_COMPAT=y | 12 | CONFIG_ARM_ATAG_DTB_COMPAT=y |
@@ -25,6 +17,11 @@ CONFIG_CPU_IDLE=y | |||
25 | CONFIG_ARM_U8500_CPUIDLE=y | 17 | CONFIG_ARM_U8500_CPUIDLE=y |
26 | CONFIG_VFP=y | 18 | CONFIG_VFP=y |
27 | CONFIG_NEON=y | 19 | CONFIG_NEON=y |
20 | CONFIG_MODULES=y | ||
21 | CONFIG_MODULE_UNLOAD=y | ||
22 | # CONFIG_BLK_DEV_BSG is not set | ||
23 | CONFIG_PARTITION_ADVANCED=y | ||
24 | CONFIG_CMA=y | ||
28 | CONFIG_NET=y | 25 | CONFIG_NET=y |
29 | CONFIG_PACKET=y | 26 | CONFIG_PACKET=y |
30 | CONFIG_UNIX=y | 27 | CONFIG_UNIX=y |
@@ -47,7 +44,6 @@ CONFIG_SMSC911X=y | |||
47 | CONFIG_SMSC_PHY=y | 44 | CONFIG_SMSC_PHY=y |
48 | CONFIG_CW1200=y | 45 | CONFIG_CW1200=y |
49 | CONFIG_CW1200_WLAN_SDIO=y | 46 | CONFIG_CW1200_WLAN_SDIO=y |
50 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | ||
51 | CONFIG_INPUT_EVDEV=y | 47 | CONFIG_INPUT_EVDEV=y |
52 | # CONFIG_KEYBOARD_ATKBD is not set | 48 | # CONFIG_KEYBOARD_ATKBD is not set |
53 | CONFIG_KEYBOARD_GPIO=y | 49 | CONFIG_KEYBOARD_GPIO=y |
@@ -63,7 +59,6 @@ CONFIG_RMI4_CORE=y | |||
63 | CONFIG_RMI4_I2C=y | 59 | CONFIG_RMI4_I2C=y |
64 | CONFIG_RMI4_F11=y | 60 | CONFIG_RMI4_F11=y |
65 | # CONFIG_SERIO is not set | 61 | # CONFIG_SERIO is not set |
66 | CONFIG_VT_HW_CONSOLE_BINDING=y | ||
67 | # CONFIG_LEGACY_PTYS is not set | 62 | # CONFIG_LEGACY_PTYS is not set |
68 | CONFIG_SERIAL_AMBA_PL011=y | 63 | CONFIG_SERIAL_AMBA_PL011=y |
69 | CONFIG_SERIAL_AMBA_PL011_CONSOLE=y | 64 | CONFIG_SERIAL_AMBA_PL011_CONSOLE=y |
@@ -72,6 +67,7 @@ CONFIG_SPI=y | |||
72 | CONFIG_SPI_PL022=y | 67 | CONFIG_SPI_PL022=y |
73 | CONFIG_GPIO_STMPE=y | 68 | CONFIG_GPIO_STMPE=y |
74 | CONFIG_GPIO_TC3589X=y | 69 | CONFIG_GPIO_TC3589X=y |
70 | CONFIG_SENSORS_IIO_HWMON=y | ||
75 | CONFIG_THERMAL=y | 71 | CONFIG_THERMAL=y |
76 | CONFIG_CPU_THERMAL=y | 72 | CONFIG_CPU_THERMAL=y |
77 | CONFIG_WATCHDOG=y | 73 | CONFIG_WATCHDOG=y |
@@ -79,6 +75,13 @@ CONFIG_MFD_STMPE=y | |||
79 | CONFIG_MFD_TC3589X=y | 75 | CONFIG_MFD_TC3589X=y |
80 | CONFIG_REGULATOR_AB8500=y | 76 | CONFIG_REGULATOR_AB8500=y |
81 | CONFIG_REGULATOR_GPIO=y | 77 | CONFIG_REGULATOR_GPIO=y |
78 | CONFIG_DRM=y | ||
79 | CONFIG_DRM_PANEL_SAMSUNG_S6D16D0=y | ||
80 | CONFIG_DRM_LIMA=y | ||
81 | CONFIG_DRM_MCDE=y | ||
82 | CONFIG_BACKLIGHT_CLASS_DEVICE=y | ||
83 | CONFIG_BACKLIGHT_GENERIC=m | ||
84 | CONFIG_LOGO=y | ||
82 | CONFIG_SOUND=y | 85 | CONFIG_SOUND=y |
83 | CONFIG_SND=y | 86 | CONFIG_SND=y |
84 | CONFIG_SND_SOC=y | 87 | CONFIG_SND_SOC=y |
@@ -87,6 +90,7 @@ CONFIG_SND_SOC_UX500_MACH_MOP500=y | |||
87 | CONFIG_USB=y | 90 | CONFIG_USB=y |
88 | CONFIG_USB_MUSB_HDRC=y | 91 | CONFIG_USB_MUSB_HDRC=y |
89 | CONFIG_USB_MUSB_UX500=y | 92 | CONFIG_USB_MUSB_UX500=y |
93 | CONFIG_MUSB_PIO_ONLY=y | ||
90 | CONFIG_AB8500_USB=y | 94 | CONFIG_AB8500_USB=y |
91 | CONFIG_USB_GADGET=y | 95 | CONFIG_USB_GADGET=y |
92 | CONFIG_USB_ETH=m | 96 | CONFIG_USB_ETH=m |
@@ -103,6 +107,7 @@ CONFIG_RTC_DRV_AB8500=y | |||
103 | CONFIG_RTC_DRV_PL031=y | 107 | CONFIG_RTC_DRV_PL031=y |
104 | CONFIG_DMADEVICES=y | 108 | CONFIG_DMADEVICES=y |
105 | CONFIG_STE_DMA40=y | 109 | CONFIG_STE_DMA40=y |
110 | CONFIG_HWSPINLOCK=y | ||
106 | CONFIG_HSEM_U8500=y | 111 | CONFIG_HSEM_U8500=y |
107 | CONFIG_IIO=y | 112 | CONFIG_IIO=y |
108 | CONFIG_IIO_SW_TRIGGER=y | 113 | CONFIG_IIO_SW_TRIGGER=y |
@@ -126,20 +131,19 @@ CONFIG_NFS_FS=y | |||
126 | CONFIG_ROOT_NFS=y | 131 | CONFIG_ROOT_NFS=y |
127 | CONFIG_NLS_CODEPAGE_437=y | 132 | CONFIG_NLS_CODEPAGE_437=y |
128 | CONFIG_NLS_ISO8859_1=y | 133 | CONFIG_NLS_ISO8859_1=y |
134 | CONFIG_CRYPTO_DEV_UX500=y | ||
135 | CONFIG_CRYPTO_DEV_UX500_CRYP=y | ||
136 | CONFIG_CRYPTO_DEV_UX500_HASH=y | ||
137 | CONFIG_CRYPTO_DEV_UX500_DEBUG=y | ||
129 | CONFIG_PRINTK_TIME=y | 138 | CONFIG_PRINTK_TIME=y |
130 | CONFIG_DEBUG_INFO=y | 139 | CONFIG_DEBUG_INFO=y |
131 | CONFIG_DEBUG_FS=y | 140 | CONFIG_DEBUG_FS=y |
132 | CONFIG_MAGIC_SYSRQ=y | 141 | CONFIG_MAGIC_SYSRQ=y |
133 | CONFIG_DEBUG_KERNEL=y | 142 | CONFIG_DEBUG_KERNEL=y |
134 | # CONFIG_SCHED_DEBUG is not set | 143 | # CONFIG_SCHED_DEBUG is not set |
135 | # CONFIG_DEBUG_PREEMPT is not set | ||
136 | # CONFIG_FTRACE is not set | 144 | # CONFIG_FTRACE is not set |
137 | CONFIG_DEBUG_USER=y | 145 | CONFIG_DEBUG_USER=y |
138 | CONFIG_CORESIGHT=y | 146 | CONFIG_CORESIGHT=y |
139 | CONFIG_CORESIGHT_SINK_TPIU=y | 147 | CONFIG_CORESIGHT_SINK_TPIU=y |
140 | CONFIG_CORESIGHT_SINK_ETBV10=y | 148 | CONFIG_CORESIGHT_SINK_ETBV10=y |
141 | CONFIG_CORESIGHT_SOURCE_ETM3X=y | 149 | CONFIG_CORESIGHT_SOURCE_ETM3X=y |
142 | CONFIG_CRYPTO_DEV_UX500=y | ||
143 | CONFIG_CRYPTO_DEV_UX500_CRYP=y | ||
144 | CONFIG_CRYPTO_DEV_UX500_HASH=y | ||
145 | CONFIG_CRYPTO_DEV_UX500_DEBUG=y | ||
diff --git a/arch/arm/mach-davinci/sleep.S b/arch/arm/mach-davinci/sleep.S index 05d03f09ff54..71262dcdbca3 100644 --- a/arch/arm/mach-davinci/sleep.S +++ b/arch/arm/mach-davinci/sleep.S | |||
@@ -24,6 +24,7 @@ | |||
24 | #define DEEPSLEEP_SLEEPENABLE_BIT BIT(31) | 24 | #define DEEPSLEEP_SLEEPENABLE_BIT BIT(31) |
25 | 25 | ||
26 | .text | 26 | .text |
27 | .arch armv5te | ||
27 | /* | 28 | /* |
28 | * Move DaVinci into deep sleep state | 29 | * Move DaVinci into deep sleep state |
29 | * | 30 | * |
diff --git a/arch/arm/mach-netx/Kconfig b/arch/arm/mach-netx/Kconfig deleted file mode 100644 index 1e5d9c870784..000000000000 --- a/arch/arm/mach-netx/Kconfig +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0-only | ||
2 | menu "NetX Implementations" | ||
3 | depends on ARCH_NETX | ||
4 | |||
5 | config MACH_NXDKN | ||
6 | bool "Enable Hilscher nxdkn Eval Board support" | ||
7 | help | ||
8 | Board support for the Hilscher NetX Eval Board | ||
9 | |||
10 | config MACH_NXDB500 | ||
11 | bool "Enable Hilscher nxdb500 Eval Board support" | ||
12 | select ARM_AMBA | ||
13 | help | ||
14 | Board support for the Hilscher nxdb500 Eval Board | ||
15 | |||
16 | config MACH_NXEB500HMI | ||
17 | bool "Enable Hilscher nxeb500hmi Eval Board support" | ||
18 | select ARM_AMBA | ||
19 | help | ||
20 | Board support for the Hilscher nxeb500hmi Eval Board | ||
21 | |||
22 | endmenu | ||
diff --git a/arch/arm/mach-netx/Makefile b/arch/arm/mach-netx/Makefile deleted file mode 100644 index 44ea83f7d9c2..000000000000 --- a/arch/arm/mach-netx/Makefile +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0-only | ||
2 | # | ||
3 | # Makefile for the linux kernel. | ||
4 | # | ||
5 | |||
6 | # Object file lists. | ||
7 | |||
8 | obj-y += time.o generic.o pfifo.o xc.o | ||
9 | |||
10 | # Specific board support | ||
11 | obj-$(CONFIG_MACH_NXDKN) += nxdkn.o | ||
12 | obj-$(CONFIG_MACH_NXDB500) += nxdb500.o fb.o | ||
13 | obj-$(CONFIG_MACH_NXEB500HMI) += nxeb500hmi.o fb.o | ||
diff --git a/arch/arm/mach-netx/Makefile.boot b/arch/arm/mach-netx/Makefile.boot deleted file mode 100644 index 2eb23c0cb6b0..000000000000 --- a/arch/arm/mach-netx/Makefile.boot +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0-only | ||
2 | zreladdr-y += 0x80008000 | ||
3 | |||
diff --git a/arch/arm/mach-netx/fb.c b/arch/arm/mach-netx/fb.c deleted file mode 100644 index 2dc80db07390..000000000000 --- a/arch/arm/mach-netx/fb.c +++ /dev/null | |||
@@ -1,65 +0,0 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0-only | ||
2 | /* | ||
3 | * arch/arm/mach-netx/fb.c | ||
4 | * | ||
5 | * Copyright (c) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix | ||
6 | */ | ||
7 | |||
8 | #include <linux/device.h> | ||
9 | #include <linux/init.h> | ||
10 | #include <linux/dma-mapping.h> | ||
11 | #include <linux/amba/bus.h> | ||
12 | #include <linux/amba/clcd.h> | ||
13 | #include <linux/err.h> | ||
14 | #include <linux/gfp.h> | ||
15 | |||
16 | #include <asm/irq.h> | ||
17 | |||
18 | #include <mach/netx-regs.h> | ||
19 | #include <mach/hardware.h> | ||
20 | |||
21 | static struct clcd_panel *netx_panel; | ||
22 | |||
23 | void netx_clcd_enable(struct clcd_fb *fb) | ||
24 | { | ||
25 | } | ||
26 | |||
27 | int netx_clcd_setup(struct clcd_fb *fb) | ||
28 | { | ||
29 | dma_addr_t dma; | ||
30 | |||
31 | fb->panel = netx_panel; | ||
32 | |||
33 | fb->fb.screen_base = dma_alloc_wc(&fb->dev->dev, 1024 * 1024, &dma, | ||
34 | GFP_KERNEL); | ||
35 | if (!fb->fb.screen_base) { | ||
36 | printk(KERN_ERR "CLCD: unable to map framebuffer\n"); | ||
37 | return -ENOMEM; | ||
38 | } | ||
39 | |||
40 | fb->fb.fix.smem_start = dma; | ||
41 | fb->fb.fix.smem_len = 1024*1024; | ||
42 | |||
43 | return 0; | ||
44 | } | ||
45 | |||
46 | int netx_clcd_mmap(struct clcd_fb *fb, struct vm_area_struct *vma) | ||
47 | { | ||
48 | return dma_mmap_wc(&fb->dev->dev, vma, fb->fb.screen_base, | ||
49 | fb->fb.fix.smem_start, fb->fb.fix.smem_len); | ||
50 | } | ||
51 | |||
52 | void netx_clcd_remove(struct clcd_fb *fb) | ||
53 | { | ||
54 | dma_free_wc(&fb->dev->dev, fb->fb.fix.smem_len, fb->fb.screen_base, | ||
55 | fb->fb.fix.smem_start); | ||
56 | } | ||
57 | |||
58 | static AMBA_AHB_DEVICE(fb, "fb", 0, 0x00104000, { NETX_IRQ_LCD }, NULL); | ||
59 | |||
60 | int netx_fb_init(struct clcd_board *board, struct clcd_panel *panel) | ||
61 | { | ||
62 | netx_panel = panel; | ||
63 | fb_device.dev.platform_data = board; | ||
64 | return amba_device_register(&fb_device, &iomem_resource); | ||
65 | } | ||
diff --git a/arch/arm/mach-netx/fb.h b/arch/arm/mach-netx/fb.h deleted file mode 100644 index 5cdc01fc3c86..000000000000 --- a/arch/arm/mach-netx/fb.h +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0-only */ | ||
2 | /* | ||
3 | * arch/arm/mach-netx/fb.h | ||
4 | * | ||
5 | * Copyright (c) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix | ||
6 | */ | ||
7 | |||
8 | void netx_clcd_enable(struct clcd_fb *fb); | ||
9 | int netx_clcd_setup(struct clcd_fb *fb); | ||
10 | int netx_clcd_mmap(struct clcd_fb *fb, struct vm_area_struct *vma); | ||
11 | void netx_clcd_remove(struct clcd_fb *fb); | ||
12 | int netx_fb_init(struct clcd_board *board, struct clcd_panel *panel); | ||
diff --git a/arch/arm/mach-netx/generic.c b/arch/arm/mach-netx/generic.c deleted file mode 100644 index 88881fd45e9f..000000000000 --- a/arch/arm/mach-netx/generic.c +++ /dev/null | |||
@@ -1,182 +0,0 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0-only | ||
2 | /* | ||
3 | * arch/arm/mach-netx/generic.c | ||
4 | * | ||
5 | * Copyright (C) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix | ||
6 | */ | ||
7 | |||
8 | #include <linux/device.h> | ||
9 | #include <linux/init.h> | ||
10 | #include <linux/kernel.h> | ||
11 | #include <linux/module.h> | ||
12 | #include <linux/platform_device.h> | ||
13 | #include <linux/io.h> | ||
14 | #include <linux/irqchip/arm-vic.h> | ||
15 | #include <linux/reboot.h> | ||
16 | #include <mach/hardware.h> | ||
17 | #include <asm/mach/map.h> | ||
18 | #include <mach/netx-regs.h> | ||
19 | #include <asm/mach/irq.h> | ||
20 | |||
21 | static struct map_desc netx_io_desc[] __initdata = { | ||
22 | { | ||
23 | .virtual = NETX_IO_VIRT, | ||
24 | .pfn = __phys_to_pfn(NETX_IO_PHYS), | ||
25 | .length = NETX_IO_SIZE, | ||
26 | .type = MT_DEVICE | ||
27 | } | ||
28 | }; | ||
29 | |||
30 | void __init netx_map_io(void) | ||
31 | { | ||
32 | iotable_init(netx_io_desc, ARRAY_SIZE(netx_io_desc)); | ||
33 | } | ||
34 | |||
35 | static struct resource netx_rtc_resources[] = { | ||
36 | [0] = { | ||
37 | .start = 0x00101200, | ||
38 | .end = 0x00101220, | ||
39 | .flags = IORESOURCE_MEM, | ||
40 | }, | ||
41 | }; | ||
42 | |||
43 | static struct platform_device netx_rtc_device = { | ||
44 | .name = "netx-rtc", | ||
45 | .id = 0, | ||
46 | .num_resources = ARRAY_SIZE(netx_rtc_resources), | ||
47 | .resource = netx_rtc_resources, | ||
48 | }; | ||
49 | |||
50 | static struct platform_device *devices[] __initdata = { | ||
51 | &netx_rtc_device, | ||
52 | }; | ||
53 | |||
54 | #if 0 | ||
55 | #define DEBUG_IRQ(fmt...) printk(fmt) | ||
56 | #else | ||
57 | #define DEBUG_IRQ(fmt...) while (0) {} | ||
58 | #endif | ||
59 | |||
60 | static void netx_hif_demux_handler(struct irq_desc *desc) | ||
61 | { | ||
62 | unsigned int irq = NETX_IRQ_HIF_CHAINED(0); | ||
63 | unsigned int stat; | ||
64 | |||
65 | stat = ((readl(NETX_DPMAS_INT_EN) & | ||
66 | readl(NETX_DPMAS_INT_STAT)) >> 24) & 0x1f; | ||
67 | |||
68 | while (stat) { | ||
69 | if (stat & 1) { | ||
70 | DEBUG_IRQ("handling irq %d\n", irq); | ||
71 | generic_handle_irq(irq); | ||
72 | } | ||
73 | irq++; | ||
74 | stat >>= 1; | ||
75 | } | ||
76 | } | ||
77 | |||
78 | static int | ||
79 | netx_hif_irq_type(struct irq_data *d, unsigned int type) | ||
80 | { | ||
81 | unsigned int val, irq; | ||
82 | |||
83 | val = readl(NETX_DPMAS_IF_CONF1); | ||
84 | |||
85 | irq = d->irq - NETX_IRQ_HIF_CHAINED(0); | ||
86 | |||
87 | if (type & IRQ_TYPE_EDGE_RISING) { | ||
88 | DEBUG_IRQ("rising edges\n"); | ||
89 | val |= (1 << 26) << irq; | ||
90 | } | ||
91 | if (type & IRQ_TYPE_EDGE_FALLING) { | ||
92 | DEBUG_IRQ("falling edges\n"); | ||
93 | val &= ~((1 << 26) << irq); | ||
94 | } | ||
95 | if (type & IRQ_TYPE_LEVEL_LOW) { | ||
96 | DEBUG_IRQ("low level\n"); | ||
97 | val &= ~((1 << 26) << irq); | ||
98 | } | ||
99 | if (type & IRQ_TYPE_LEVEL_HIGH) { | ||
100 | DEBUG_IRQ("high level\n"); | ||
101 | val |= (1 << 26) << irq; | ||
102 | } | ||
103 | |||
104 | writel(val, NETX_DPMAS_IF_CONF1); | ||
105 | |||
106 | return 0; | ||
107 | } | ||
108 | |||
109 | static void | ||
110 | netx_hif_ack_irq(struct irq_data *d) | ||
111 | { | ||
112 | unsigned int val, irq; | ||
113 | |||
114 | irq = d->irq - NETX_IRQ_HIF_CHAINED(0); | ||
115 | writel((1 << 24) << irq, NETX_DPMAS_INT_STAT); | ||
116 | |||
117 | val = readl(NETX_DPMAS_INT_EN); | ||
118 | val &= ~((1 << 24) << irq); | ||
119 | writel(val, NETX_DPMAS_INT_EN); | ||
120 | |||
121 | DEBUG_IRQ("%s: irq %d\n", __func__, d->irq); | ||
122 | } | ||
123 | |||
124 | static void | ||
125 | netx_hif_mask_irq(struct irq_data *d) | ||
126 | { | ||
127 | unsigned int val, irq; | ||
128 | |||
129 | irq = d->irq - NETX_IRQ_HIF_CHAINED(0); | ||
130 | val = readl(NETX_DPMAS_INT_EN); | ||
131 | val &= ~((1 << 24) << irq); | ||
132 | writel(val, NETX_DPMAS_INT_EN); | ||
133 | DEBUG_IRQ("%s: irq %d\n", __func__, d->irq); | ||
134 | } | ||
135 | |||
136 | static void | ||
137 | netx_hif_unmask_irq(struct irq_data *d) | ||
138 | { | ||
139 | unsigned int val, irq; | ||
140 | |||
141 | irq = d->irq - NETX_IRQ_HIF_CHAINED(0); | ||
142 | val = readl(NETX_DPMAS_INT_EN); | ||
143 | val |= (1 << 24) << irq; | ||
144 | writel(val, NETX_DPMAS_INT_EN); | ||
145 | DEBUG_IRQ("%s: irq %d\n", __func__, d->irq); | ||
146 | } | ||
147 | |||
148 | static struct irq_chip netx_hif_chip = { | ||
149 | .irq_ack = netx_hif_ack_irq, | ||
150 | .irq_mask = netx_hif_mask_irq, | ||
151 | .irq_unmask = netx_hif_unmask_irq, | ||
152 | .irq_set_type = netx_hif_irq_type, | ||
153 | }; | ||
154 | |||
155 | void __init netx_init_irq(void) | ||
156 | { | ||
157 | int irq; | ||
158 | |||
159 | vic_init(io_p2v(NETX_PA_VIC), NETX_IRQ_VIC_START, ~0, 0); | ||
160 | |||
161 | for (irq = NETX_IRQ_HIF_CHAINED(0); irq <= NETX_IRQ_HIF_LAST; irq++) { | ||
162 | irq_set_chip_and_handler(irq, &netx_hif_chip, | ||
163 | handle_level_irq); | ||
164 | irq_clear_status_flags(irq, IRQ_NOREQUEST); | ||
165 | } | ||
166 | |||
167 | writel(NETX_DPMAS_INT_EN_GLB_EN, NETX_DPMAS_INT_EN); | ||
168 | irq_set_chained_handler(NETX_IRQ_HIF, netx_hif_demux_handler); | ||
169 | } | ||
170 | |||
171 | static int __init netx_init(void) | ||
172 | { | ||
173 | return platform_add_devices(devices, ARRAY_SIZE(devices)); | ||
174 | } | ||
175 | |||
176 | subsys_initcall(netx_init); | ||
177 | |||
178 | void netx_restart(enum reboot_mode mode, const char *cmd) | ||
179 | { | ||
180 | writel(NETX_SYSTEM_RES_CR_FIRMW_RES_EN | NETX_SYSTEM_RES_CR_FIRMW_RES, | ||
181 | NETX_SYSTEM_RES_CR); | ||
182 | } | ||
diff --git a/arch/arm/mach-netx/generic.h b/arch/arm/mach-netx/generic.h deleted file mode 100644 index 223e304574a5..000000000000 --- a/arch/arm/mach-netx/generic.h +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0-only */ | ||
2 | /* | ||
3 | * arch/arm/mach-netx/generic.h | ||
4 | * | ||
5 | * Copyright (c) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix | ||
6 | */ | ||
7 | |||
8 | #include <linux/reboot.h> | ||
9 | |||
10 | extern void __init netx_map_io(void); | ||
11 | extern void __init netx_init_irq(void); | ||
12 | extern void netx_restart(enum reboot_mode, const char *); | ||
13 | |||
14 | extern void netx_timer_init(void); | ||
diff --git a/arch/arm/mach-netx/include/mach/hardware.h b/arch/arm/mach-netx/include/mach/hardware.h deleted file mode 100644 index 84253993d1e0..000000000000 --- a/arch/arm/mach-netx/include/mach/hardware.h +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0-only */ | ||
2 | /* | ||
3 | * arch/arm/mach-netx/include/mach/hardware.h | ||
4 | * | ||
5 | * Copyright (C) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix | ||
6 | */ | ||
7 | #ifndef __ASM_ARCH_HARDWARE_H | ||
8 | #define __ASM_ARCH_HARDWARE_H | ||
9 | |||
10 | #define NETX_IO_PHYS 0x00100000 | ||
11 | #define NETX_IO_VIRT 0xe0000000 | ||
12 | #define NETX_IO_SIZE 0x00100000 | ||
13 | |||
14 | #define SRAM_INTERNAL_PHYS_0 0x00000 | ||
15 | #define SRAM_INTERNAL_PHYS_1 0x08000 | ||
16 | #define SRAM_INTERNAL_PHYS_2 0x10000 | ||
17 | #define SRAM_INTERNAL_PHYS_3 0x18000 | ||
18 | #define SRAM_INTERNAL_PHYS(no) ((no) * 0x8000) | ||
19 | |||
20 | #define XPEC_MEM_SIZE 0x4000 | ||
21 | #define XMAC_MEM_SIZE 0x1000 | ||
22 | #define SRAM_MEM_SIZE 0x8000 | ||
23 | |||
24 | #define io_p2v(x) IOMEM((x) - NETX_IO_PHYS + NETX_IO_VIRT) | ||
25 | #define io_v2p(x) ((x) - NETX_IO_VIRT + NETX_IO_PHYS) | ||
26 | |||
27 | #endif | ||
diff --git a/arch/arm/mach-netx/include/mach/irqs.h b/arch/arm/mach-netx/include/mach/irqs.h deleted file mode 100644 index 540c92104fe8..000000000000 --- a/arch/arm/mach-netx/include/mach/irqs.h +++ /dev/null | |||
@@ -1,58 +0,0 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0-only */ | ||
2 | /* | ||
3 | * arch/arm/mach-netx/include/mach/irqs.h | ||
4 | * | ||
5 | * Copyright (C) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix | ||
6 | */ | ||
7 | |||
8 | #define NETX_IRQ_VIC_START 64 | ||
9 | #define NETX_IRQ_SOFTINT (NETX_IRQ_VIC_START + 0) | ||
10 | #define NETX_IRQ_TIMER0 (NETX_IRQ_VIC_START + 1) | ||
11 | #define NETX_IRQ_TIMER1 (NETX_IRQ_VIC_START + 2) | ||
12 | #define NETX_IRQ_TIMER2 (NETX_IRQ_VIC_START + 3) | ||
13 | #define NETX_IRQ_SYSTIME_NS (NETX_IRQ_VIC_START + 4) | ||
14 | #define NETX_IRQ_SYSTIME_S (NETX_IRQ_VIC_START + 5) | ||
15 | #define NETX_IRQ_GPIO_15 (NETX_IRQ_VIC_START + 6) | ||
16 | #define NETX_IRQ_WATCHDOG (NETX_IRQ_VIC_START + 7) | ||
17 | #define NETX_IRQ_UART0 (NETX_IRQ_VIC_START + 8) | ||
18 | #define NETX_IRQ_UART1 (NETX_IRQ_VIC_START + 9) | ||
19 | #define NETX_IRQ_UART2 (NETX_IRQ_VIC_START + 10) | ||
20 | #define NETX_IRQ_USB (NETX_IRQ_VIC_START + 11) | ||
21 | #define NETX_IRQ_SPI (NETX_IRQ_VIC_START + 12) | ||
22 | #define NETX_IRQ_I2C (NETX_IRQ_VIC_START + 13) | ||
23 | #define NETX_IRQ_LCD (NETX_IRQ_VIC_START + 14) | ||
24 | #define NETX_IRQ_HIF (NETX_IRQ_VIC_START + 15) | ||
25 | #define NETX_IRQ_GPIO_0_14 (NETX_IRQ_VIC_START + 16) | ||
26 | #define NETX_IRQ_XPEC0 (NETX_IRQ_VIC_START + 17) | ||
27 | #define NETX_IRQ_XPEC1 (NETX_IRQ_VIC_START + 18) | ||
28 | #define NETX_IRQ_XPEC2 (NETX_IRQ_VIC_START + 19) | ||
29 | #define NETX_IRQ_XPEC3 (NETX_IRQ_VIC_START + 20) | ||
30 | #define NETX_IRQ_XPEC(no) (NETX_IRQ_VIC_START + 17 + (no)) | ||
31 | #define NETX_IRQ_MSYNC0 (NETX_IRQ_VIC_START + 21) | ||
32 | #define NETX_IRQ_MSYNC1 (NETX_IRQ_VIC_START + 22) | ||
33 | #define NETX_IRQ_MSYNC2 (NETX_IRQ_VIC_START + 23) | ||
34 | #define NETX_IRQ_MSYNC3 (NETX_IRQ_VIC_START + 24) | ||
35 | #define NETX_IRQ_IRQ_PHY (NETX_IRQ_VIC_START + 25) | ||
36 | #define NETX_IRQ_ISO_AREA (NETX_IRQ_VIC_START + 26) | ||
37 | /* int 27 is reserved */ | ||
38 | /* int 28 is reserved */ | ||
39 | #define NETX_IRQ_TIMER3 (NETX_IRQ_VIC_START + 29) | ||
40 | #define NETX_IRQ_TIMER4 (NETX_IRQ_VIC_START + 30) | ||
41 | /* int 31 is reserved */ | ||
42 | |||
43 | #define NETX_IRQS (NETX_IRQ_VIC_START + 32) | ||
44 | |||
45 | /* for multiplexed irqs on gpio 0..14 */ | ||
46 | #define NETX_IRQ_GPIO(x) (NETX_IRQS + (x)) | ||
47 | #define NETX_IRQ_GPIO_LAST NETX_IRQ_GPIO(14) | ||
48 | |||
49 | /* Host interface interrupts */ | ||
50 | #define NETX_IRQ_HIF_CHAINED(x) (NETX_IRQ_GPIO_LAST + 1 + (x)) | ||
51 | #define NETX_IRQ_HIF_PIO35 NETX_IRQ_HIF_CHAINED(0) | ||
52 | #define NETX_IRQ_HIF_PIO36 NETX_IRQ_HIF_CHAINED(1) | ||
53 | #define NETX_IRQ_HIF_PIO40 NETX_IRQ_HIF_CHAINED(2) | ||
54 | #define NETX_IRQ_HIF_PIO47 NETX_IRQ_HIF_CHAINED(3) | ||
55 | #define NETX_IRQ_HIF_PIO72 NETX_IRQ_HIF_CHAINED(4) | ||
56 | #define NETX_IRQ_HIF_LAST NETX_IRQ_HIF_CHAINED(4) | ||
57 | |||
58 | #define NR_IRQS (NETX_IRQ_HIF_LAST + 1) | ||
diff --git a/arch/arm/mach-netx/include/mach/netx-regs.h b/arch/arm/mach-netx/include/mach/netx-regs.h deleted file mode 100644 index 7c356a6ab80b..000000000000 --- a/arch/arm/mach-netx/include/mach/netx-regs.h +++ /dev/null | |||
@@ -1,420 +0,0 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0-only */ | ||
2 | /* | ||
3 | * arch/arm/mach-netx/include/mach/netx-regs.h | ||
4 | * | ||
5 | * Copyright (c) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix | ||
6 | */ | ||
7 | |||
8 | #ifndef __ASM_ARCH_NETX_REGS_H | ||
9 | #define __ASM_ARCH_NETX_REGS_H | ||
10 | |||
11 | /* offsets relative to the beginning of the io space */ | ||
12 | #define NETX_OFS_SYSTEM 0x00000 | ||
13 | #define NETX_OFS_MEMCR 0x00100 | ||
14 | #define NETX_OFS_DPMAS 0x03000 | ||
15 | #define NETX_OFS_GPIO 0x00800 | ||
16 | #define NETX_OFS_PIO 0x00900 | ||
17 | #define NETX_OFS_UART0 0x00a00 | ||
18 | #define NETX_OFS_UART1 0x00a40 | ||
19 | #define NETX_OFS_UART2 0x00a80 | ||
20 | #define NETX_OF_MIIMU 0x00b00 | ||
21 | #define NETX_OFS_SPI 0x00c00 | ||
22 | #define NETX_OFS_I2C 0x00d00 | ||
23 | #define NETX_OFS_SYSTIME 0x01100 | ||
24 | #define NETX_OFS_RTC 0x01200 | ||
25 | #define NETX_OFS_EXTBUS 0x03600 | ||
26 | #define NETX_OFS_LCD 0x04000 | ||
27 | #define NETX_OFS_USB 0x20000 | ||
28 | #define NETX_OFS_XMAC0 0x60000 | ||
29 | #define NETX_OFS_XMAC1 0x61000 | ||
30 | #define NETX_OFS_XMAC2 0x62000 | ||
31 | #define NETX_OFS_XMAC3 0x63000 | ||
32 | #define NETX_OFS_XMAC(no) (0x60000 + (no) * 0x1000) | ||
33 | #define NETX_OFS_PFIFO 0x64000 | ||
34 | #define NETX_OFS_XPEC0 0x70000 | ||
35 | #define NETX_OFS_XPEC1 0x74000 | ||
36 | #define NETX_OFS_XPEC2 0x78000 | ||
37 | #define NETX_OFS_XPEC3 0x7c000 | ||
38 | #define NETX_OFS_XPEC(no) (0x70000 + (no) * 0x4000) | ||
39 | #define NETX_OFS_VIC 0xff000 | ||
40 | |||
41 | /* physical addresses */ | ||
42 | #define NETX_PA_SYSTEM (NETX_IO_PHYS + NETX_OFS_SYSTEM) | ||
43 | #define NETX_PA_MEMCR (NETX_IO_PHYS + NETX_OFS_MEMCR) | ||
44 | #define NETX_PA_DPMAS (NETX_IO_PHYS + NETX_OFS_DPMAS) | ||
45 | #define NETX_PA_GPIO (NETX_IO_PHYS + NETX_OFS_GPIO) | ||
46 | #define NETX_PA_PIO (NETX_IO_PHYS + NETX_OFS_PIO) | ||
47 | #define NETX_PA_UART0 (NETX_IO_PHYS + NETX_OFS_UART0) | ||
48 | #define NETX_PA_UART1 (NETX_IO_PHYS + NETX_OFS_UART1) | ||
49 | #define NETX_PA_UART2 (NETX_IO_PHYS + NETX_OFS_UART2) | ||
50 | #define NETX_PA_MIIMU (NETX_IO_PHYS + NETX_OF_MIIMU) | ||
51 | #define NETX_PA_SPI (NETX_IO_PHYS + NETX_OFS_SPI) | ||
52 | #define NETX_PA_I2C (NETX_IO_PHYS + NETX_OFS_I2C) | ||
53 | #define NETX_PA_SYSTIME (NETX_IO_PHYS + NETX_OFS_SYSTIME) | ||
54 | #define NETX_PA_RTC (NETX_IO_PHYS + NETX_OFS_RTC) | ||
55 | #define NETX_PA_EXTBUS (NETX_IO_PHYS + NETX_OFS_EXTBUS) | ||
56 | #define NETX_PA_LCD (NETX_IO_PHYS + NETX_OFS_LCD) | ||
57 | #define NETX_PA_USB (NETX_IO_PHYS + NETX_OFS_USB) | ||
58 | #define NETX_PA_XMAC0 (NETX_IO_PHYS + NETX_OFS_XMAC0) | ||
59 | #define NETX_PA_XMAC1 (NETX_IO_PHYS + NETX_OFS_XMAC1) | ||
60 | #define NETX_PA_XMAC2 (NETX_IO_PHYS + NETX_OFS_XMAC2) | ||
61 | #define NETX_PA_XMAC3 (NETX_IO_PHYS + NETX_OFS_XMAC3) | ||
62 | #define NETX_PA_XMAC(no) (NETX_IO_PHYS + NETX_OFS_XMAC(no)) | ||
63 | #define NETX_PA_PFIFO (NETX_IO_PHYS + NETX_OFS_PFIFO) | ||
64 | #define NETX_PA_XPEC0 (NETX_IO_PHYS + NETX_OFS_XPEC0) | ||
65 | #define NETX_PA_XPEC1 (NETX_IO_PHYS + NETX_OFS_XPEC1) | ||
66 | #define NETX_PA_XPEC2 (NETX_IO_PHYS + NETX_OFS_XPEC2) | ||
67 | #define NETX_PA_XPEC3 (NETX_IO_PHYS + NETX_OFS_XPEC3) | ||
68 | #define NETX_PA_XPEC(no) (NETX_IO_PHYS + NETX_OFS_XPEC(no)) | ||
69 | #define NETX_PA_VIC (NETX_IO_PHYS + NETX_OFS_VIC) | ||
70 | |||
71 | /* virtual addresses */ | ||
72 | #define NETX_VA_SYSTEM (NETX_IO_VIRT + NETX_OFS_SYSTEM) | ||
73 | #define NETX_VA_MEMCR (NETX_IO_VIRT + NETX_OFS_MEMCR) | ||
74 | #define NETX_VA_DPMAS (NETX_IO_VIRT + NETX_OFS_DPMAS) | ||
75 | #define NETX_VA_GPIO (NETX_IO_VIRT + NETX_OFS_GPIO) | ||
76 | #define NETX_VA_PIO (NETX_IO_VIRT + NETX_OFS_PIO) | ||
77 | #define NETX_VA_UART0 (NETX_IO_VIRT + NETX_OFS_UART0) | ||
78 | #define NETX_VA_UART1 (NETX_IO_VIRT + NETX_OFS_UART1) | ||
79 | #define NETX_VA_UART2 (NETX_IO_VIRT + NETX_OFS_UART2) | ||
80 | #define NETX_VA_MIIMU (NETX_IO_VIRT + NETX_OF_MIIMU) | ||
81 | #define NETX_VA_SPI (NETX_IO_VIRT + NETX_OFS_SPI) | ||
82 | #define NETX_VA_I2C (NETX_IO_VIRT + NETX_OFS_I2C) | ||
83 | #define NETX_VA_SYSTIME (NETX_IO_VIRT + NETX_OFS_SYSTIME) | ||
84 | #define NETX_VA_RTC (NETX_IO_VIRT + NETX_OFS_RTC) | ||
85 | #define NETX_VA_EXTBUS (NETX_IO_VIRT + NETX_OFS_EXTBUS) | ||
86 | #define NETX_VA_LCD (NETX_IO_VIRT + NETX_OFS_LCD) | ||
87 | #define NETX_VA_USB (NETX_IO_VIRT + NETX_OFS_USB) | ||
88 | #define NETX_VA_XMAC0 (NETX_IO_VIRT + NETX_OFS_XMAC0) | ||
89 | #define NETX_VA_XMAC1 (NETX_IO_VIRT + NETX_OFS_XMAC1) | ||
90 | #define NETX_VA_XMAC2 (NETX_IO_VIRT + NETX_OFS_XMAC2) | ||
91 | #define NETX_VA_XMAC3 (NETX_IO_VIRT + NETX_OFS_XMAC3) | ||
92 | #define NETX_VA_XMAC(no) (NETX_IO_VIRT + NETX_OFS_XMAC(no)) | ||
93 | #define NETX_VA_PFIFO (NETX_IO_VIRT + NETX_OFS_PFIFO) | ||
94 | #define NETX_VA_XPEC0 (NETX_IO_VIRT + NETX_OFS_XPEC0) | ||
95 | #define NETX_VA_XPEC1 (NETX_IO_VIRT + NETX_OFS_XPEC1) | ||
96 | #define NETX_VA_XPEC2 (NETX_IO_VIRT + NETX_OFS_XPEC2) | ||
97 | #define NETX_VA_XPEC3 (NETX_IO_VIRT + NETX_OFS_XPEC3) | ||
98 | #define NETX_VA_XPEC(no) (NETX_IO_VIRT + NETX_OFS_XPEC(no)) | ||
99 | #define NETX_VA_VIC (NETX_IO_VIRT + NETX_OFS_VIC) | ||
100 | |||
101 | /********************************* | ||
102 | * System functions * | ||
103 | *********************************/ | ||
104 | |||
105 | /* Registers */ | ||
106 | #define NETX_SYSTEM_REG(ofs) IOMEM(NETX_VA_SYSTEM + (ofs)) | ||
107 | #define NETX_SYSTEM_BOO_SR NETX_SYSTEM_REG(0x00) | ||
108 | #define NETX_SYSTEM_IOC_CR NETX_SYSTEM_REG(0x04) | ||
109 | #define NETX_SYSTEM_IOC_MR NETX_SYSTEM_REG(0x08) | ||
110 | |||
111 | /* FIXME: Docs are not consistent */ | ||
112 | /* #define NETX_SYSTEM_RES_CR NETX_SYSTEM_REG(0x08) */ | ||
113 | #define NETX_SYSTEM_RES_CR NETX_SYSTEM_REG(0x0c) | ||
114 | |||
115 | #define NETX_SYSTEM_PHY_CONTROL NETX_SYSTEM_REG(0x10) | ||
116 | #define NETX_SYSTEM_REV NETX_SYSTEM_REG(0x34) | ||
117 | #define NETX_SYSTEM_IOC_ACCESS_KEY NETX_SYSTEM_REG(0x70) | ||
118 | #define NETX_SYSTEM_WDG_TR NETX_SYSTEM_REG(0x200) | ||
119 | #define NETX_SYSTEM_WDG_CTR NETX_SYSTEM_REG(0x204) | ||
120 | #define NETX_SYSTEM_WDG_IRQ_TIMEOUT NETX_SYSTEM_REG(0x208) | ||
121 | #define NETX_SYSTEM_WDG_RES_TIMEOUT NETX_SYSTEM_REG(0x20c) | ||
122 | |||
123 | /* Bits */ | ||
124 | #define NETX_SYSTEM_RES_CR_RSTIN (1<<0) | ||
125 | #define NETX_SYSTEM_RES_CR_WDG_RES (1<<1) | ||
126 | #define NETX_SYSTEM_RES_CR_HOST_RES (1<<2) | ||
127 | #define NETX_SYSTEM_RES_CR_FIRMW_RES (1<<3) | ||
128 | #define NETX_SYSTEM_RES_CR_XPEC0_RES (1<<4) | ||
129 | #define NETX_SYSTEM_RES_CR_XPEC1_RES (1<<5) | ||
130 | #define NETX_SYSTEM_RES_CR_XPEC2_RES (1<<6) | ||
131 | #define NETX_SYSTEM_RES_CR_XPEC3_RES (1<<7) | ||
132 | #define NETX_SYSTEM_RES_CR_DIS_XPEC0_RES (1<<16) | ||
133 | #define NETX_SYSTEM_RES_CR_DIS_XPEC1_RES (1<<17) | ||
134 | #define NETX_SYSTEM_RES_CR_DIS_XPEC2_RES (1<<18) | ||
135 | #define NETX_SYSTEM_RES_CR_DIS_XPEC3_RES (1<<19) | ||
136 | #define NETX_SYSTEM_RES_CR_FIRMW_FLG0 (1<<20) | ||
137 | #define NETX_SYSTEM_RES_CR_FIRMW_FLG1 (1<<21) | ||
138 | #define NETX_SYSTEM_RES_CR_FIRMW_FLG2 (1<<22) | ||
139 | #define NETX_SYSTEM_RES_CR_FIRMW_FLG3 (1<<23) | ||
140 | #define NETX_SYSTEM_RES_CR_FIRMW_RES_EN (1<<24) | ||
141 | #define NETX_SYSTEM_RES_CR_RSTOUT (1<<25) | ||
142 | #define NETX_SYSTEM_RES_CR_EN_RSTOUT (1<<26) | ||
143 | |||
144 | #define PHY_CONTROL_RESET (1<<31) | ||
145 | #define PHY_CONTROL_SIM_BYP (1<<30) | ||
146 | #define PHY_CONTROL_CLK_XLATIN (1<<29) | ||
147 | #define PHY_CONTROL_PHY1_EN (1<<21) | ||
148 | #define PHY_CONTROL_PHY1_NP_MSG_CODE | ||
149 | #define PHY_CONTROL_PHY1_AUTOMDIX (1<<17) | ||
150 | #define PHY_CONTROL_PHY1_FIXMODE (1<<16) | ||
151 | #define PHY_CONTROL_PHY1_MODE(mode) (((mode) & 0x7) << 13) | ||
152 | #define PHY_CONTROL_PHY0_EN (1<<12) | ||
153 | #define PHY_CONTROL_PHY0_NP_MSG_CODE | ||
154 | #define PHY_CONTROL_PHY0_AUTOMDIX (1<<8) | ||
155 | #define PHY_CONTROL_PHY0_FIXMODE (1<<7) | ||
156 | #define PHY_CONTROL_PHY0_MODE(mode) (((mode) & 0x7) << 4) | ||
157 | #define PHY_CONTROL_PHY_ADDRESS(adr) ((adr) & 0xf) | ||
158 | |||
159 | #define PHY_MODE_10BASE_T_HALF 0 | ||
160 | #define PHY_MODE_10BASE_T_FULL 1 | ||
161 | #define PHY_MODE_100BASE_TX_FX_FULL 2 | ||
162 | #define PHY_MODE_100BASE_TX_FX_HALF 3 | ||
163 | #define PHY_MODE_100BASE_TX_HALF 4 | ||
164 | #define PHY_MODE_REPEATER 5 | ||
165 | #define PHY_MODE_POWER_DOWN 6 | ||
166 | #define PHY_MODE_ALL 7 | ||
167 | |||
168 | /* Bits */ | ||
169 | #define VECT_CNTL_ENABLE (1 << 5) | ||
170 | |||
171 | /******************************* | ||
172 | * GPIO and timer module * | ||
173 | *******************************/ | ||
174 | |||
175 | /* Registers */ | ||
176 | #define NETX_GPIO_REG(ofs) IOMEM(NETX_VA_GPIO + (ofs)) | ||
177 | #define NETX_GPIO_CFG(gpio) NETX_GPIO_REG(0x0 + ((gpio)<<2)) | ||
178 | #define NETX_GPIO_THRESHOLD_CAPTURE(gpio) NETX_GPIO_REG(0x40 + ((gpio)<<2)) | ||
179 | #define NETX_GPIO_COUNTER_CTRL(counter) NETX_GPIO_REG(0x80 + ((counter)<<2)) | ||
180 | #define NETX_GPIO_COUNTER_MAX(counter) NETX_GPIO_REG(0x94 + ((counter)<<2)) | ||
181 | #define NETX_GPIO_COUNTER_CURRENT(counter) NETX_GPIO_REG(0xa8 + ((counter)<<2)) | ||
182 | #define NETX_GPIO_IRQ_ENABLE NETX_GPIO_REG(0xbc) | ||
183 | #define NETX_GPIO_IRQ_DISABLE NETX_GPIO_REG(0xc0) | ||
184 | #define NETX_GPIO_SYSTIME_NS_CMP NETX_GPIO_REG(0xc4) | ||
185 | #define NETX_GPIO_LINE NETX_GPIO_REG(0xc8) | ||
186 | #define NETX_GPIO_IRQ NETX_GPIO_REG(0xd0) | ||
187 | |||
188 | /* Bits */ | ||
189 | #define NETX_GPIO_CFG_IOCFG_GP_INPUT (0x0) | ||
190 | #define NETX_GPIO_CFG_IOCFG_GP_OUTPUT (0x1) | ||
191 | #define NETX_GPIO_CFG_IOCFG_GP_UART (0x2) | ||
192 | #define NETX_GPIO_CFG_INV (1<<2) | ||
193 | #define NETX_GPIO_CFG_MODE_INPUT_READ (0<<3) | ||
194 | #define NETX_GPIO_CFG_MODE_INPUT_CAPTURE_CONT_RISING (1<<3) | ||
195 | #define NETX_GPIO_CFG_MODE_INPUT_CAPTURE_ONCE_RISING (2<<3) | ||
196 | #define NETX_GPIO_CFG_MODE_INPUT_CAPTURE_HIGH_LEVEL (3<<3) | ||
197 | #define NETX_GPIO_CFG_COUNT_REF_COUNTER0 (0<<5) | ||
198 | #define NETX_GPIO_CFG_COUNT_REF_COUNTER1 (1<<5) | ||
199 | #define NETX_GPIO_CFG_COUNT_REF_COUNTER2 (2<<5) | ||
200 | #define NETX_GPIO_CFG_COUNT_REF_COUNTER3 (3<<5) | ||
201 | #define NETX_GPIO_CFG_COUNT_REF_COUNTER4 (4<<5) | ||
202 | #define NETX_GPIO_CFG_COUNT_REF_SYSTIME (7<<5) | ||
203 | |||
204 | #define NETX_GPIO_COUNTER_CTRL_RUN (1<<0) | ||
205 | #define NETX_GPIO_COUNTER_CTRL_SYM (1<<1) | ||
206 | #define NETX_GPIO_COUNTER_CTRL_ONCE (1<<2) | ||
207 | #define NETX_GPIO_COUNTER_CTRL_IRQ_EN (1<<3) | ||
208 | #define NETX_GPIO_COUNTER_CTRL_CNT_EVENT (1<<4) | ||
209 | #define NETX_GPIO_COUNTER_CTRL_RST_EN (1<<5) | ||
210 | #define NETX_GPIO_COUNTER_CTRL_SEL_EVENT (1<<6) | ||
211 | #define NETX_GPIO_COUNTER_CTRL_GPIO_REF /* FIXME */ | ||
212 | |||
213 | #define GPIO_BIT(gpio) (1<<(gpio)) | ||
214 | #define COUNTER_BIT(counter) ((1<<16)<<(counter)) | ||
215 | |||
216 | /******************************* | ||
217 | * PIO * | ||
218 | *******************************/ | ||
219 | |||
220 | /* Registers */ | ||
221 | #define NETX_PIO_REG(ofs) IOMEM(NETX_VA_PIO + (ofs)) | ||
222 | #define NETX_PIO_INPIO NETX_PIO_REG(0x0) | ||
223 | #define NETX_PIO_OUTPIO NETX_PIO_REG(0x4) | ||
224 | #define NETX_PIO_OEPIO NETX_PIO_REG(0x8) | ||
225 | |||
226 | /******************************* | ||
227 | * MII Unit * | ||
228 | *******************************/ | ||
229 | |||
230 | /* Registers */ | ||
231 | #define NETX_MIIMU IOMEM(NETX_VA_MIIMU) | ||
232 | |||
233 | /* Bits */ | ||
234 | #define MIIMU_SNRDY (1<<0) | ||
235 | #define MIIMU_PREAMBLE (1<<1) | ||
236 | #define MIIMU_OPMODE_WRITE (1<<2) | ||
237 | #define MIIMU_MDC_PERIOD (1<<3) | ||
238 | #define MIIMU_PHY_NRES (1<<4) | ||
239 | #define MIIMU_RTA (1<<5) | ||
240 | #define MIIMU_REGADDR(adr) (((adr) & 0x1f) << 6) | ||
241 | #define MIIMU_PHYADDR(adr) (((adr) & 0x1f) << 11) | ||
242 | #define MIIMU_DATA(data) (((data) & 0xffff) << 16) | ||
243 | |||
244 | /******************************* | ||
245 | * xmac / xpec * | ||
246 | *******************************/ | ||
247 | |||
248 | /* XPEC register offsets relative to NETX_VA_XPEC(no) */ | ||
249 | #define NETX_XPEC_R0_OFS 0x00 | ||
250 | #define NETX_XPEC_R1_OFS 0x04 | ||
251 | #define NETX_XPEC_R2_OFS 0x08 | ||
252 | #define NETX_XPEC_R3_OFS 0x0c | ||
253 | #define NETX_XPEC_R4_OFS 0x10 | ||
254 | #define NETX_XPEC_R5_OFS 0x14 | ||
255 | #define NETX_XPEC_R6_OFS 0x18 | ||
256 | #define NETX_XPEC_R7_OFS 0x1c | ||
257 | #define NETX_XPEC_RANGE01_OFS 0x20 | ||
258 | #define NETX_XPEC_RANGE23_OFS 0x24 | ||
259 | #define NETX_XPEC_RANGE45_OFS 0x28 | ||
260 | #define NETX_XPEC_RANGE67_OFS 0x2c | ||
261 | #define NETX_XPEC_PC_OFS 0x48 | ||
262 | #define NETX_XPEC_TIMER_OFS(timer) (0x30 + ((timer)<<2)) | ||
263 | #define NETX_XPEC_IRQ_OFS 0x8c | ||
264 | #define NETX_XPEC_SYSTIME_NS_OFS 0x90 | ||
265 | #define NETX_XPEC_FIFO_DATA_OFS 0x94 | ||
266 | #define NETX_XPEC_SYSTIME_S_OFS 0x98 | ||
267 | #define NETX_XPEC_ADC_OFS 0x9c | ||
268 | #define NETX_XPEC_URX_COUNT_OFS 0x40 | ||
269 | #define NETX_XPEC_UTX_COUNT_OFS 0x44 | ||
270 | #define NETX_XPEC_PC_OFS 0x48 | ||
271 | #define NETX_XPEC_ZERO_OFS 0x4c | ||
272 | #define NETX_XPEC_STATCFG_OFS 0x50 | ||
273 | #define NETX_XPEC_EC_MASKA_OFS 0x54 | ||
274 | #define NETX_XPEC_EC_MASKB_OFS 0x58 | ||
275 | #define NETX_XPEC_EC_MASK0_OFS 0x5c | ||
276 | #define NETX_XPEC_EC_MASK8_OFS 0x7c | ||
277 | #define NETX_XPEC_EC_MASK9_OFS 0x80 | ||
278 | #define NETX_XPEC_XPU_HOLD_PC_OFS 0x100 | ||
279 | #define NETX_XPEC_RAM_START_OFS 0x2000 | ||
280 | |||
281 | /* Bits */ | ||
282 | #define XPU_HOLD_PC (1<<0) | ||
283 | |||
284 | /* XMAC register offsets relative to NETX_VA_XMAC(no) */ | ||
285 | #define NETX_XMAC_RPU_PROGRAM_START_OFS 0x000 | ||
286 | #define NETX_XMAC_RPU_PROGRAM_END_OFS 0x3ff | ||
287 | #define NETX_XMAC_TPU_PROGRAM_START_OFS 0x400 | ||
288 | #define NETX_XMAC_TPU_PROGRAM_END_OFS 0x7ff | ||
289 | #define NETX_XMAC_RPU_HOLD_PC_OFS 0xa00 | ||
290 | #define NETX_XMAC_TPU_HOLD_PC_OFS 0xa04 | ||
291 | #define NETX_XMAC_STATUS_SHARED0_OFS 0x840 | ||
292 | #define NETX_XMAC_CONFIG_SHARED0_OFS 0x844 | ||
293 | #define NETX_XMAC_STATUS_SHARED1_OFS 0x848 | ||
294 | #define NETX_XMAC_CONFIG_SHARED1_OFS 0x84c | ||
295 | #define NETX_XMAC_STATUS_SHARED2_OFS 0x850 | ||
296 | #define NETX_XMAC_CONFIG_SHARED2_OFS 0x854 | ||
297 | #define NETX_XMAC_STATUS_SHARED3_OFS 0x858 | ||
298 | #define NETX_XMAC_CONFIG_SHARED3_OFS 0x85c | ||
299 | |||
300 | #define RPU_HOLD_PC (1<<15) | ||
301 | #define TPU_HOLD_PC (1<<15) | ||
302 | |||
303 | /******************************* | ||
304 | * Pointer FIFO * | ||
305 | *******************************/ | ||
306 | |||
307 | /* Registers */ | ||
308 | #define NETX_PFIFO_REG(ofs) IOMEM(NETX_VA_PFIFO + (ofs)) | ||
309 | #define NETX_PFIFO_BASE(pfifo) NETX_PFIFO_REG(0x00 + ((pfifo)<<2)) | ||
310 | #define NETX_PFIFO_BORDER_BASE(pfifo) NETX_PFIFO_REG(0x80 + ((pfifo)<<2)) | ||
311 | #define NETX_PFIFO_RESET NETX_PFIFO_REG(0x100) | ||
312 | #define NETX_PFIFO_FULL NETX_PFIFO_REG(0x104) | ||
313 | #define NETX_PFIFO_EMPTY NETX_PFIFO_REG(0x108) | ||
314 | #define NETX_PFIFO_OVEFLOW NETX_PFIFO_REG(0x10c) | ||
315 | #define NETX_PFIFO_UNDERRUN NETX_PFIFO_REG(0x110) | ||
316 | #define NETX_PFIFO_FILL_LEVEL(pfifo) NETX_PFIFO_REG(0x180 + ((pfifo)<<2)) | ||
317 | #define NETX_PFIFO_XPEC_ISR(xpec) NETX_PFIFO_REG(0x400 + ((xpec) << 2)) | ||
318 | |||
319 | |||
320 | /******************************* | ||
321 | * Memory Controller * | ||
322 | *******************************/ | ||
323 | |||
324 | /* Registers */ | ||
325 | #define NETX_MEMCR_REG(ofs) IOMEM(NETX_VA_MEMCR + (ofs)) | ||
326 | #define NETX_MEMCR_SRAM_CTRL(cs) NETX_MEMCR_REG(0x0 + 4 * (cs)) /* SRAM for CS 0..2 */ | ||
327 | #define NETX_MEMCR_SDRAM_CFG_CTRL NETX_MEMCR_REG(0x40) | ||
328 | #define NETX_MEMCR_SDRAM_TIMING_CTRL NETX_MEMCR_REG(0x44) | ||
329 | #define NETX_MEMCR_SDRAM_MODE NETX_MEMCR_REG(0x48) | ||
330 | #define NETX_MEMCR_SDRAM_EXT_MODE NETX_MEMCR_REG(0x4c) | ||
331 | #define NETX_MEMCR_PRIO_TIMESLOT_CTRL NETX_MEMCR_REG(0x80) | ||
332 | #define NETX_MEMCR_PRIO_ACCESS_CTRL NETX_MEMCR_REG(0x84) | ||
333 | |||
334 | /* Bits */ | ||
335 | #define NETX_MEMCR_SRAM_CTRL_WIDTHEXTMEM(x) (((x) & 0x3) << 24) | ||
336 | #define NETX_MEMCR_SRAM_CTRL_WSPOSTPAUSEEXTMEM(x) (((x) & 0x3) << 16) | ||
337 | #define NETX_MEMCR_SRAM_CTRL_WSPREPASEEXTMEM(x) (((x) & 0x3) << 8) | ||
338 | #define NETX_MEMCR_SRAM_CTRL_WSEXTMEM(x) (((x) & 0x1f) << 0) | ||
339 | |||
340 | |||
341 | /******************************* | ||
342 | * Dual Port Memory * | ||
343 | *******************************/ | ||
344 | |||
345 | /* Registers */ | ||
346 | #define NETX_DPMAS_REG(ofs) IOMEM(NETX_VA_DPMAS + (ofs)) | ||
347 | #define NETX_DPMAS_SYS_STAT NETX_DPMAS_REG(0x4d8) | ||
348 | #define NETX_DPMAS_INT_STAT NETX_DPMAS_REG(0x4e0) | ||
349 | #define NETX_DPMAS_INT_EN NETX_DPMAS_REG(0x4f0) | ||
350 | #define NETX_DPMAS_IF_CONF0 NETX_DPMAS_REG(0x608) | ||
351 | #define NETX_DPMAS_IF_CONF1 NETX_DPMAS_REG(0x60c) | ||
352 | #define NETX_DPMAS_EXT_CONFIG(cs) NETX_DPMAS_REG(0x610 + 4 * (cs)) | ||
353 | #define NETX_DPMAS_IO_MODE0 NETX_DPMAS_REG(0x620) /* I/O 32..63 */ | ||
354 | #define NETX_DPMAS_DRV_EN0 NETX_DPMAS_REG(0x624) | ||
355 | #define NETX_DPMAS_DATA0 NETX_DPMAS_REG(0x628) | ||
356 | #define NETX_DPMAS_IO_MODE1 NETX_DPMAS_REG(0x630) /* I/O 64..84 */ | ||
357 | #define NETX_DPMAS_DRV_EN1 NETX_DPMAS_REG(0x634) | ||
358 | #define NETX_DPMAS_DATA1 NETX_DPMAS_REG(0x638) | ||
359 | |||
360 | /* Bits */ | ||
361 | #define NETX_DPMAS_INT_EN_GLB_EN (1<<31) | ||
362 | #define NETX_DPMAS_INT_EN_MEM_LCK (1<<30) | ||
363 | #define NETX_DPMAS_INT_EN_WDG (1<<29) | ||
364 | #define NETX_DPMAS_INT_EN_PIO72 (1<<28) | ||
365 | #define NETX_DPMAS_INT_EN_PIO47 (1<<27) | ||
366 | #define NETX_DPMAS_INT_EN_PIO40 (1<<26) | ||
367 | #define NETX_DPMAS_INT_EN_PIO36 (1<<25) | ||
368 | #define NETX_DPMAS_INT_EN_PIO35 (1<<24) | ||
369 | |||
370 | #define NETX_DPMAS_IF_CONF0_HIF_DISABLED (0<<28) | ||
371 | #define NETX_DPMAS_IF_CONF0_HIF_EXT_BUS (1<<28) | ||
372 | #define NETX_DPMAS_IF_CONF0_HIF_UP_8BIT (2<<28) | ||
373 | #define NETX_DPMAS_IF_CONF0_HIF_UP_16BIT (3<<28) | ||
374 | #define NETX_DPMAS_IF_CONF0_HIF_IO (4<<28) | ||
375 | #define NETX_DPMAS_IF_CONF0_WAIT_DRV_PP (1<<14) | ||
376 | #define NETX_DPMAS_IF_CONF0_WAIT_DRV_OD (2<<14) | ||
377 | #define NETX_DPMAS_IF_CONF0_WAIT_DRV_TRI (3<<14) | ||
378 | |||
379 | #define NETX_DPMAS_IF_CONF1_IRQ_POL_PIO35 (1<<26) | ||
380 | #define NETX_DPMAS_IF_CONF1_IRQ_POL_PIO36 (1<<27) | ||
381 | #define NETX_DPMAS_IF_CONF1_IRQ_POL_PIO40 (1<<28) | ||
382 | #define NETX_DPMAS_IF_CONF1_IRQ_POL_PIO47 (1<<29) | ||
383 | #define NETX_DPMAS_IF_CONF1_IRQ_POL_PIO72 (1<<30) | ||
384 | |||
385 | #define NETX_EXT_CONFIG_TALEWIDTH(x) (((x) & 0x7) << 29) | ||
386 | #define NETX_EXT_CONFIG_TADRHOLD(x) (((x) & 0x7) << 26) | ||
387 | #define NETX_EXT_CONFIG_TCSON(x) (((x) & 0x7) << 23) | ||
388 | #define NETX_EXT_CONFIG_TRDON(x) (((x) & 0x7) << 20) | ||
389 | #define NETX_EXT_CONFIG_TWRON(x) (((x) & 0x7) << 17) | ||
390 | #define NETX_EXT_CONFIG_TWROFF(x) (((x) & 0x1f) << 12) | ||
391 | #define NETX_EXT_CONFIG_TRDWRCYC(x) (((x) & 0x1f) << 7) | ||
392 | #define NETX_EXT_CONFIG_WAIT_POL (1<<6) | ||
393 | #define NETX_EXT_CONFIG_WAIT_EN (1<<5) | ||
394 | #define NETX_EXT_CONFIG_NRD_MODE (1<<4) | ||
395 | #define NETX_EXT_CONFIG_DS_MODE (1<<3) | ||
396 | #define NETX_EXT_CONFIG_NWR_MODE (1<<2) | ||
397 | #define NETX_EXT_CONFIG_16BIT (1<<1) | ||
398 | #define NETX_EXT_CONFIG_CS_ENABLE (1<<0) | ||
399 | |||
400 | #define NETX_DPMAS_IO_MODE0_WRL (1<<13) | ||
401 | #define NETX_DPMAS_IO_MODE0_WAIT (1<<14) | ||
402 | #define NETX_DPMAS_IO_MODE0_READY (1<<15) | ||
403 | #define NETX_DPMAS_IO_MODE0_CS0 (1<<19) | ||
404 | #define NETX_DPMAS_IO_MODE0_EXTRD (1<<20) | ||
405 | |||
406 | #define NETX_DPMAS_IO_MODE1_CS2 (1<<15) | ||
407 | #define NETX_DPMAS_IO_MODE1_CS1 (1<<16) | ||
408 | #define NETX_DPMAS_IO_MODE1_SAMPLE_NPOR (0<<30) | ||
409 | #define NETX_DPMAS_IO_MODE1_SAMPLE_100MHZ (1<<30) | ||
410 | #define NETX_DPMAS_IO_MODE1_SAMPLE_NPIO36 (2<<30) | ||
411 | #define NETX_DPMAS_IO_MODE1_SAMPLE_PIO36 (3<<30) | ||
412 | |||
413 | /******************************* | ||
414 | * I2C * | ||
415 | *******************************/ | ||
416 | #define NETX_I2C_REG(ofs) IOMEM(NETX_VA_I2C, (ofs)) | ||
417 | #define NETX_I2C_CTRL NETX_I2C_REG(0x0) | ||
418 | #define NETX_I2C_DATA NETX_I2C_REG(0x4) | ||
419 | |||
420 | #endif /* __ASM_ARCH_NETX_REGS_H */ | ||
diff --git a/arch/arm/mach-netx/include/mach/pfifo.h b/arch/arm/mach-netx/include/mach/pfifo.h deleted file mode 100644 index de23180bc937..000000000000 --- a/arch/arm/mach-netx/include/mach/pfifo.h +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0-only */ | ||
2 | /* | ||
3 | * arch/arm/mach-netx/include/mach/pfifo.h | ||
4 | * | ||
5 | * Copyright (c) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix | ||
6 | */ | ||
7 | |||
8 | |||
9 | #ifndef ASM_ARCH_PFIFO_H | ||
10 | #define ASM_ARCH_PFIFO_H | ||
11 | |||
12 | static inline int pfifo_push(int no, unsigned int pointer) | ||
13 | { | ||
14 | writel(pointer, NETX_PFIFO_BASE(no)); | ||
15 | return 0; | ||
16 | } | ||
17 | |||
18 | static inline unsigned int pfifo_pop(int no) | ||
19 | { | ||
20 | return readl(NETX_PFIFO_BASE(no)); | ||
21 | } | ||
22 | |||
23 | static inline int pfifo_fill_level(int no) | ||
24 | { | ||
25 | |||
26 | return readl(NETX_PFIFO_FILL_LEVEL(no)); | ||
27 | } | ||
28 | |||
29 | static inline int pfifo_full(int no) | ||
30 | { | ||
31 | return readl(NETX_PFIFO_FULL) & (1<<no) ? 1 : 0; | ||
32 | } | ||
33 | |||
34 | static inline int pfifo_empty(int no) | ||
35 | { | ||
36 | return readl(NETX_PFIFO_EMPTY) & (1<<no) ? 1 : 0; | ||
37 | } | ||
38 | |||
39 | int pfifo_request(unsigned int pfifo_mask); | ||
40 | void pfifo_free(unsigned int pfifo_mask); | ||
41 | |||
42 | #endif /* ASM_ARCH_PFIFO_H */ | ||
diff --git a/arch/arm/mach-netx/include/mach/uncompress.h b/arch/arm/mach-netx/include/mach/uncompress.h deleted file mode 100644 index edc1ac997eab..000000000000 --- a/arch/arm/mach-netx/include/mach/uncompress.h +++ /dev/null | |||
@@ -1,63 +0,0 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0-only */ | ||
2 | /* | ||
3 | * arch/arm/mach-netx/include/mach/uncompress.h | ||
4 | * | ||
5 | * Copyright (C) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix | ||
6 | */ | ||
7 | |||
8 | /* | ||
9 | * The following code assumes the serial port has already been | ||
10 | * initialized by the bootloader. We search for the first enabled | ||
11 | * port in the most probable order. If you didn't setup a port in | ||
12 | * your bootloader then nothing will appear (which might be desired). | ||
13 | * | ||
14 | * This does not append a newline | ||
15 | */ | ||
16 | |||
17 | #define REG(x) (*(volatile unsigned long *)(x)) | ||
18 | |||
19 | #define UART1_BASE 0x100a00 | ||
20 | #define UART2_BASE 0x100a80 | ||
21 | |||
22 | #define UART_DR 0x0 | ||
23 | |||
24 | #define UART_CR 0x14 | ||
25 | #define CR_UART_EN (1<<0) | ||
26 | |||
27 | #define UART_FR 0x18 | ||
28 | #define FR_BUSY (1<<3) | ||
29 | #define FR_TXFF (1<<5) | ||
30 | |||
31 | static inline void putc(char c) | ||
32 | { | ||
33 | unsigned long base; | ||
34 | |||
35 | if (REG(UART1_BASE + UART_CR) & CR_UART_EN) | ||
36 | base = UART1_BASE; | ||
37 | else if (REG(UART2_BASE + UART_CR) & CR_UART_EN) | ||
38 | base = UART2_BASE; | ||
39 | else | ||
40 | return; | ||
41 | |||
42 | while (REG(base + UART_FR) & FR_TXFF); | ||
43 | REG(base + UART_DR) = c; | ||
44 | } | ||
45 | |||
46 | static inline void flush(void) | ||
47 | { | ||
48 | unsigned long base; | ||
49 | |||
50 | if (REG(UART1_BASE + UART_CR) & CR_UART_EN) | ||
51 | base = UART1_BASE; | ||
52 | else if (REG(UART2_BASE + UART_CR) & CR_UART_EN) | ||
53 | base = UART2_BASE; | ||
54 | else | ||
55 | return; | ||
56 | |||
57 | while (REG(base + UART_FR) & FR_BUSY); | ||
58 | } | ||
59 | |||
60 | /* | ||
61 | * nothing to do | ||
62 | */ | ||
63 | #define arch_decomp_setup() | ||
diff --git a/arch/arm/mach-netx/include/mach/xc.h b/arch/arm/mach-netx/include/mach/xc.h deleted file mode 100644 index 465d5e250ab8..000000000000 --- a/arch/arm/mach-netx/include/mach/xc.h +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0-only */ | ||
2 | /* | ||
3 | * arch/arm/mach-netx/include/mach/xc.h | ||
4 | * | ||
5 | * Copyright (C) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix | ||
6 | */ | ||
7 | |||
8 | #ifndef __ASM_ARCH_XC_H | ||
9 | #define __ASM_ARCH_XC_H | ||
10 | |||
11 | struct xc { | ||
12 | int no; | ||
13 | unsigned int type; | ||
14 | unsigned int version; | ||
15 | void __iomem *xpec_base; | ||
16 | void __iomem *xmac_base; | ||
17 | void __iomem *sram_base; | ||
18 | int irq; | ||
19 | struct device *dev; | ||
20 | }; | ||
21 | |||
22 | int xc_reset(struct xc *x); | ||
23 | int xc_stop(struct xc* x); | ||
24 | int xc_start(struct xc *x); | ||
25 | int xc_running(struct xc *x); | ||
26 | int xc_request_firmware(struct xc* x); | ||
27 | struct xc* request_xc(int xcno, struct device *dev); | ||
28 | void free_xc(struct xc *x); | ||
29 | |||
30 | #endif /* __ASM_ARCH_XC_H */ | ||
diff --git a/arch/arm/mach-netx/nxdb500.c b/arch/arm/mach-netx/nxdb500.c deleted file mode 100644 index ad5e6747b834..000000000000 --- a/arch/arm/mach-netx/nxdb500.c +++ /dev/null | |||
@@ -1,197 +0,0 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0-only | ||
2 | /* | ||
3 | * arch/arm/mach-netx/nxdb500.c | ||
4 | * | ||
5 | * Copyright (c) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix | ||
6 | */ | ||
7 | |||
8 | #include <linux/dma-mapping.h> | ||
9 | #include <linux/init.h> | ||
10 | #include <linux/interrupt.h> | ||
11 | #include <linux/mtd/plat-ram.h> | ||
12 | #include <linux/platform_device.h> | ||
13 | #include <linux/amba/bus.h> | ||
14 | #include <linux/amba/clcd.h> | ||
15 | |||
16 | #include <mach/hardware.h> | ||
17 | #include <asm/mach-types.h> | ||
18 | #include <asm/mach/arch.h> | ||
19 | #include <mach/netx-regs.h> | ||
20 | #include <linux/platform_data/eth-netx.h> | ||
21 | |||
22 | #include "generic.h" | ||
23 | #include "fb.h" | ||
24 | |||
25 | static struct clcd_panel qvga = { | ||
26 | .mode = { | ||
27 | .name = "QVGA", | ||
28 | .refresh = 60, | ||
29 | .xres = 240, | ||
30 | .yres = 320, | ||
31 | .pixclock = 187617, | ||
32 | .left_margin = 6, | ||
33 | .right_margin = 26, | ||
34 | .upper_margin = 0, | ||
35 | .lower_margin = 6, | ||
36 | .hsync_len = 6, | ||
37 | .vsync_len = 1, | ||
38 | .sync = 0, | ||
39 | .vmode = FB_VMODE_NONINTERLACED, | ||
40 | }, | ||
41 | .width = -1, | ||
42 | .height = -1, | ||
43 | .tim2 = 16, | ||
44 | .cntl = CNTL_LCDTFT | CNTL_BGR, | ||
45 | .bpp = 16, | ||
46 | .grayscale = 0, | ||
47 | }; | ||
48 | |||
49 | static inline int nxdb500_check(struct clcd_fb *fb, struct fb_var_screeninfo *var) | ||
50 | { | ||
51 | var->green.length = 5; | ||
52 | var->green.msb_right = 0; | ||
53 | |||
54 | return clcdfb_check(fb, var); | ||
55 | } | ||
56 | |||
57 | static int nxdb500_clcd_setup(struct clcd_fb *fb) | ||
58 | { | ||
59 | unsigned int val; | ||
60 | |||
61 | fb->fb.var.green.length = 5; | ||
62 | fb->fb.var.green.msb_right = 0; | ||
63 | |||
64 | /* enable asic control */ | ||
65 | val = readl(NETX_SYSTEM_IOC_ACCESS_KEY); | ||
66 | writel(val, NETX_SYSTEM_IOC_ACCESS_KEY); | ||
67 | |||
68 | writel(3, NETX_SYSTEM_IOC_CR); | ||
69 | |||
70 | val = readl(NETX_PIO_OUTPIO); | ||
71 | writel(val | 1, NETX_PIO_OUTPIO); | ||
72 | |||
73 | val = readl(NETX_PIO_OEPIO); | ||
74 | writel(val | 1, NETX_PIO_OEPIO); | ||
75 | return netx_clcd_setup(fb); | ||
76 | } | ||
77 | |||
78 | static struct clcd_board clcd_data = { | ||
79 | .name = "netX", | ||
80 | .check = nxdb500_check, | ||
81 | .decode = clcdfb_decode, | ||
82 | .enable = netx_clcd_enable, | ||
83 | .setup = nxdb500_clcd_setup, | ||
84 | .mmap = netx_clcd_mmap, | ||
85 | .remove = netx_clcd_remove, | ||
86 | }; | ||
87 | |||
88 | static struct netxeth_platform_data eth0_platform_data = { | ||
89 | .xcno = 0, | ||
90 | }; | ||
91 | |||
92 | static struct platform_device netx_eth0_device = { | ||
93 | .name = "netx-eth", | ||
94 | .id = 0, | ||
95 | .num_resources = 0, | ||
96 | .resource = NULL, | ||
97 | .dev = { | ||
98 | .platform_data = ð0_platform_data, | ||
99 | } | ||
100 | }; | ||
101 | |||
102 | static struct netxeth_platform_data eth1_platform_data = { | ||
103 | .xcno = 1, | ||
104 | }; | ||
105 | |||
106 | static struct platform_device netx_eth1_device = { | ||
107 | .name = "netx-eth", | ||
108 | .id = 1, | ||
109 | .num_resources = 0, | ||
110 | .resource = NULL, | ||
111 | .dev = { | ||
112 | .platform_data = ð1_platform_data, | ||
113 | } | ||
114 | }; | ||
115 | |||
116 | static struct resource netx_uart0_resources[] = { | ||
117 | [0] = { | ||
118 | .start = 0x00100A00, | ||
119 | .end = 0x00100A3F, | ||
120 | .flags = IORESOURCE_MEM, | ||
121 | }, | ||
122 | [1] = { | ||
123 | .start = (NETX_IRQ_UART0), | ||
124 | .end = (NETX_IRQ_UART0), | ||
125 | .flags = IORESOURCE_IRQ, | ||
126 | }, | ||
127 | }; | ||
128 | |||
129 | static struct platform_device netx_uart0_device = { | ||
130 | .name = "netx-uart", | ||
131 | .id = 0, | ||
132 | .num_resources = ARRAY_SIZE(netx_uart0_resources), | ||
133 | .resource = netx_uart0_resources, | ||
134 | }; | ||
135 | |||
136 | static struct resource netx_uart1_resources[] = { | ||
137 | [0] = { | ||
138 | .start = 0x00100A40, | ||
139 | .end = 0x00100A7F, | ||
140 | .flags = IORESOURCE_MEM, | ||
141 | }, | ||
142 | [1] = { | ||
143 | .start = (NETX_IRQ_UART1), | ||
144 | .end = (NETX_IRQ_UART1), | ||
145 | .flags = IORESOURCE_IRQ, | ||
146 | }, | ||
147 | }; | ||
148 | |||
149 | static struct platform_device netx_uart1_device = { | ||
150 | .name = "netx-uart", | ||
151 | .id = 1, | ||
152 | .num_resources = ARRAY_SIZE(netx_uart1_resources), | ||
153 | .resource = netx_uart1_resources, | ||
154 | }; | ||
155 | |||
156 | static struct resource netx_uart2_resources[] = { | ||
157 | [0] = { | ||
158 | .start = 0x00100A80, | ||
159 | .end = 0x00100ABF, | ||
160 | .flags = IORESOURCE_MEM, | ||
161 | }, | ||
162 | [1] = { | ||
163 | .start = (NETX_IRQ_UART2), | ||
164 | .end = (NETX_IRQ_UART2), | ||
165 | .flags = IORESOURCE_IRQ, | ||
166 | }, | ||
167 | }; | ||
168 | |||
169 | static struct platform_device netx_uart2_device = { | ||
170 | .name = "netx-uart", | ||
171 | .id = 2, | ||
172 | .num_resources = ARRAY_SIZE(netx_uart2_resources), | ||
173 | .resource = netx_uart2_resources, | ||
174 | }; | ||
175 | |||
176 | static struct platform_device *devices[] __initdata = { | ||
177 | &netx_eth0_device, | ||
178 | &netx_eth1_device, | ||
179 | &netx_uart0_device, | ||
180 | &netx_uart1_device, | ||
181 | &netx_uart2_device, | ||
182 | }; | ||
183 | |||
184 | static void __init nxdb500_init(void) | ||
185 | { | ||
186 | netx_fb_init(&clcd_data, &qvga); | ||
187 | platform_add_devices(devices, ARRAY_SIZE(devices)); | ||
188 | } | ||
189 | |||
190 | MACHINE_START(NXDB500, "Hilscher nxdb500") | ||
191 | .atag_offset = 0x100, | ||
192 | .map_io = netx_map_io, | ||
193 | .init_irq = netx_init_irq, | ||
194 | .init_time = netx_timer_init, | ||
195 | .init_machine = nxdb500_init, | ||
196 | .restart = netx_restart, | ||
197 | MACHINE_END | ||
diff --git a/arch/arm/mach-netx/nxdkn.c b/arch/arm/mach-netx/nxdkn.c deleted file mode 100644 index 917381559628..000000000000 --- a/arch/arm/mach-netx/nxdkn.c +++ /dev/null | |||
@@ -1,90 +0,0 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0-only | ||
2 | /* | ||
3 | * arch/arm/mach-netx/nxdkn.c | ||
4 | * | ||
5 | * Copyright (c) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix | ||
6 | */ | ||
7 | |||
8 | #include <linux/dma-mapping.h> | ||
9 | #include <linux/init.h> | ||
10 | #include <linux/interrupt.h> | ||
11 | #include <linux/mtd/plat-ram.h> | ||
12 | #include <linux/platform_device.h> | ||
13 | #include <linux/amba/bus.h> | ||
14 | #include <linux/amba/clcd.h> | ||
15 | |||
16 | #include <mach/hardware.h> | ||
17 | #include <asm/mach-types.h> | ||
18 | #include <asm/mach/arch.h> | ||
19 | #include <mach/netx-regs.h> | ||
20 | #include <linux/platform_data/eth-netx.h> | ||
21 | |||
22 | #include "generic.h" | ||
23 | |||
24 | static struct netxeth_platform_data eth0_platform_data = { | ||
25 | .xcno = 0, | ||
26 | }; | ||
27 | |||
28 | static struct platform_device nxdkn_eth0_device = { | ||
29 | .name = "netx-eth", | ||
30 | .id = 0, | ||
31 | .num_resources = 0, | ||
32 | .resource = NULL, | ||
33 | .dev = { | ||
34 | .platform_data = ð0_platform_data, | ||
35 | } | ||
36 | }; | ||
37 | |||
38 | static struct netxeth_platform_data eth1_platform_data = { | ||
39 | .xcno = 1, | ||
40 | }; | ||
41 | |||
42 | static struct platform_device nxdkn_eth1_device = { | ||
43 | .name = "netx-eth", | ||
44 | .id = 1, | ||
45 | .num_resources = 0, | ||
46 | .resource = NULL, | ||
47 | .dev = { | ||
48 | .platform_data = ð1_platform_data, | ||
49 | } | ||
50 | }; | ||
51 | |||
52 | static struct resource netx_uart0_resources[] = { | ||
53 | [0] = { | ||
54 | .start = 0x00100A00, | ||
55 | .end = 0x00100A3F, | ||
56 | .flags = IORESOURCE_MEM, | ||
57 | }, | ||
58 | [1] = { | ||
59 | .start = (NETX_IRQ_UART0), | ||
60 | .end = (NETX_IRQ_UART0), | ||
61 | .flags = IORESOURCE_IRQ, | ||
62 | }, | ||
63 | }; | ||
64 | |||
65 | static struct platform_device netx_uart0_device = { | ||
66 | .name = "netx-uart", | ||
67 | .id = 0, | ||
68 | .num_resources = ARRAY_SIZE(netx_uart0_resources), | ||
69 | .resource = netx_uart0_resources, | ||
70 | }; | ||
71 | |||
72 | static struct platform_device *devices[] __initdata = { | ||
73 | &nxdkn_eth0_device, | ||
74 | &nxdkn_eth1_device, | ||
75 | &netx_uart0_device, | ||
76 | }; | ||
77 | |||
78 | static void __init nxdkn_init(void) | ||
79 | { | ||
80 | platform_add_devices(devices, ARRAY_SIZE(devices)); | ||
81 | } | ||
82 | |||
83 | MACHINE_START(NXDKN, "Hilscher nxdkn") | ||
84 | .atag_offset = 0x100, | ||
85 | .map_io = netx_map_io, | ||
86 | .init_irq = netx_init_irq, | ||
87 | .init_time = netx_timer_init, | ||
88 | .init_machine = nxdkn_init, | ||
89 | .restart = netx_restart, | ||
90 | MACHINE_END | ||
diff --git a/arch/arm/mach-netx/nxeb500hmi.c b/arch/arm/mach-netx/nxeb500hmi.c deleted file mode 100644 index aa0d5b2ca712..000000000000 --- a/arch/arm/mach-netx/nxeb500hmi.c +++ /dev/null | |||
@@ -1,174 +0,0 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0-only | ||
2 | /* | ||
3 | * arch/arm/mach-netx/nxeb500hmi.c | ||
4 | * | ||
5 | * Copyright (c) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix | ||
6 | */ | ||
7 | |||
8 | #include <linux/dma-mapping.h> | ||
9 | #include <linux/init.h> | ||
10 | #include <linux/interrupt.h> | ||
11 | #include <linux/mtd/plat-ram.h> | ||
12 | #include <linux/platform_device.h> | ||
13 | #include <linux/amba/bus.h> | ||
14 | #include <linux/amba/clcd.h> | ||
15 | |||
16 | #include <mach/hardware.h> | ||
17 | #include <asm/mach-types.h> | ||
18 | #include <asm/mach/arch.h> | ||
19 | #include <mach/netx-regs.h> | ||
20 | #include <linux/platform_data/eth-netx.h> | ||
21 | |||
22 | #include "generic.h" | ||
23 | #include "fb.h" | ||
24 | |||
25 | static struct clcd_panel qvga = { | ||
26 | .mode = { | ||
27 | .name = "QVGA", | ||
28 | .refresh = 60, | ||
29 | .xres = 240, | ||
30 | .yres = 320, | ||
31 | .pixclock = 187617, | ||
32 | .left_margin = 6, | ||
33 | .right_margin = 26, | ||
34 | .upper_margin = 0, | ||
35 | .lower_margin = 6, | ||
36 | .hsync_len = 6, | ||
37 | .vsync_len = 1, | ||
38 | .sync = 0, | ||
39 | .vmode = FB_VMODE_NONINTERLACED, | ||
40 | }, | ||
41 | .width = -1, | ||
42 | .height = -1, | ||
43 | .tim2 = 16, | ||
44 | .cntl = CNTL_LCDTFT | CNTL_BGR, | ||
45 | .bpp = 16, | ||
46 | .grayscale = 0, | ||
47 | }; | ||
48 | |||
49 | static inline int nxeb500hmi_check(struct clcd_fb *fb, struct fb_var_screeninfo *var) | ||
50 | { | ||
51 | var->green.length = 5; | ||
52 | var->green.msb_right = 0; | ||
53 | |||
54 | return clcdfb_check(fb, var); | ||
55 | } | ||
56 | |||
57 | static int nxeb500hmi_clcd_setup(struct clcd_fb *fb) | ||
58 | { | ||
59 | unsigned int val; | ||
60 | |||
61 | fb->fb.var.green.length = 5; | ||
62 | fb->fb.var.green.msb_right = 0; | ||
63 | |||
64 | /* enable asic control */ | ||
65 | val = readl(NETX_SYSTEM_IOC_ACCESS_KEY); | ||
66 | writel(val, NETX_SYSTEM_IOC_ACCESS_KEY); | ||
67 | |||
68 | writel(3, NETX_SYSTEM_IOC_CR); | ||
69 | |||
70 | /* GPIO 14 is used for display enable on newer boards */ | ||
71 | writel(9, NETX_GPIO_CFG(14)); | ||
72 | |||
73 | val = readl(NETX_PIO_OUTPIO); | ||
74 | writel(val | 1, NETX_PIO_OUTPIO); | ||
75 | |||
76 | val = readl(NETX_PIO_OEPIO); | ||
77 | writel(val | 1, NETX_PIO_OEPIO); | ||
78 | return netx_clcd_setup(fb); | ||
79 | } | ||
80 | |||
81 | static struct clcd_board clcd_data = { | ||
82 | .name = "netX", | ||
83 | .check = nxeb500hmi_check, | ||
84 | .decode = clcdfb_decode, | ||
85 | .enable = netx_clcd_enable, | ||
86 | .setup = nxeb500hmi_clcd_setup, | ||
87 | .mmap = netx_clcd_mmap, | ||
88 | .remove = netx_clcd_remove, | ||
89 | }; | ||
90 | |||
91 | static struct netxeth_platform_data eth0_platform_data = { | ||
92 | .xcno = 0, | ||
93 | }; | ||
94 | |||
95 | static struct platform_device netx_eth0_device = { | ||
96 | .name = "netx-eth", | ||
97 | .id = 0, | ||
98 | .num_resources = 0, | ||
99 | .resource = NULL, | ||
100 | .dev = { | ||
101 | .platform_data = ð0_platform_data, | ||
102 | } | ||
103 | }; | ||
104 | |||
105 | static struct netxeth_platform_data eth1_platform_data = { | ||
106 | .xcno = 1, | ||
107 | }; | ||
108 | |||
109 | static struct platform_device netx_eth1_device = { | ||
110 | .name = "netx-eth", | ||
111 | .id = 1, | ||
112 | .num_resources = 0, | ||
113 | .resource = NULL, | ||
114 | .dev = { | ||
115 | .platform_data = ð1_platform_data, | ||
116 | } | ||
117 | }; | ||
118 | |||
119 | static struct resource netx_cf_resources[] = { | ||
120 | [0] = { | ||
121 | .start = 0x20000000, | ||
122 | .end = 0x25ffffff, | ||
123 | .flags = IORESOURCE_MEM | IORESOURCE_MEM_8AND16BIT, | ||
124 | }, | ||
125 | }; | ||
126 | |||
127 | static struct platform_device netx_cf_device = { | ||
128 | .name = "netx-cf", | ||
129 | .id = 0, | ||
130 | .resource = netx_cf_resources, | ||
131 | .num_resources = ARRAY_SIZE(netx_cf_resources), | ||
132 | }; | ||
133 | |||
134 | static struct resource netx_uart0_resources[] = { | ||
135 | [0] = { | ||
136 | .start = 0x00100A00, | ||
137 | .end = 0x00100A3F, | ||
138 | .flags = IORESOURCE_MEM, | ||
139 | }, | ||
140 | [1] = { | ||
141 | .start = (NETX_IRQ_UART0), | ||
142 | .end = (NETX_IRQ_UART0), | ||
143 | .flags = IORESOURCE_IRQ, | ||
144 | }, | ||
145 | }; | ||
146 | |||
147 | static struct platform_device netx_uart0_device = { | ||
148 | .name = "netx-uart", | ||
149 | .id = 0, | ||
150 | .num_resources = ARRAY_SIZE(netx_uart0_resources), | ||
151 | .resource = netx_uart0_resources, | ||
152 | }; | ||
153 | |||
154 | static struct platform_device *devices[] __initdata = { | ||
155 | &netx_eth0_device, | ||
156 | &netx_eth1_device, | ||
157 | &netx_cf_device, | ||
158 | &netx_uart0_device, | ||
159 | }; | ||
160 | |||
161 | static void __init nxeb500hmi_init(void) | ||
162 | { | ||
163 | netx_fb_init(&clcd_data, &qvga); | ||
164 | platform_add_devices(devices, ARRAY_SIZE(devices)); | ||
165 | } | ||
166 | |||
167 | MACHINE_START(NXEB500HMI, "Hilscher nxeb500hmi") | ||
168 | .atag_offset = 0x100, | ||
169 | .map_io = netx_map_io, | ||
170 | .init_irq = netx_init_irq, | ||
171 | .init_time = netx_timer_init, | ||
172 | .init_machine = nxeb500hmi_init, | ||
173 | .restart = netx_restart, | ||
174 | MACHINE_END | ||
diff --git a/arch/arm/mach-netx/pfifo.c b/arch/arm/mach-netx/pfifo.c deleted file mode 100644 index 2e5cc777329f..000000000000 --- a/arch/arm/mach-netx/pfifo.c +++ /dev/null | |||
@@ -1,56 +0,0 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0-only | ||
2 | /* | ||
3 | * arch/arm/mach-netx/pfifo.c | ||
4 | * | ||
5 | * Copyright (c) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix | ||
6 | */ | ||
7 | |||
8 | #include <linux/init.h> | ||
9 | #include <linux/module.h> | ||
10 | #include <linux/mutex.h> | ||
11 | #include <linux/io.h> | ||
12 | |||
13 | #include <mach/hardware.h> | ||
14 | #include <mach/netx-regs.h> | ||
15 | #include <mach/pfifo.h> | ||
16 | |||
17 | static DEFINE_MUTEX(pfifo_lock); | ||
18 | |||
19 | static unsigned int pfifo_used = 0; | ||
20 | |||
21 | int pfifo_request(unsigned int pfifo_mask) | ||
22 | { | ||
23 | int err = 0; | ||
24 | unsigned int val; | ||
25 | |||
26 | mutex_lock(&pfifo_lock); | ||
27 | |||
28 | if (pfifo_mask & pfifo_used) { | ||
29 | err = -EBUSY; | ||
30 | goto out; | ||
31 | } | ||
32 | |||
33 | pfifo_used |= pfifo_mask; | ||
34 | |||
35 | val = readl(NETX_PFIFO_RESET); | ||
36 | writel(val | pfifo_mask, NETX_PFIFO_RESET); | ||
37 | writel(val, NETX_PFIFO_RESET); | ||
38 | |||
39 | out: | ||
40 | mutex_unlock(&pfifo_lock); | ||
41 | return err; | ||
42 | } | ||
43 | |||
44 | void pfifo_free(unsigned int pfifo_mask) | ||
45 | { | ||
46 | mutex_lock(&pfifo_lock); | ||
47 | pfifo_used &= ~pfifo_mask; | ||
48 | mutex_unlock(&pfifo_lock); | ||
49 | } | ||
50 | |||
51 | EXPORT_SYMBOL(pfifo_push); | ||
52 | EXPORT_SYMBOL(pfifo_pop); | ||
53 | EXPORT_SYMBOL(pfifo_fill_level); | ||
54 | EXPORT_SYMBOL(pfifo_empty); | ||
55 | EXPORT_SYMBOL(pfifo_request); | ||
56 | EXPORT_SYMBOL(pfifo_free); | ||
diff --git a/arch/arm/mach-netx/time.c b/arch/arm/mach-netx/time.c deleted file mode 100644 index d9defa1ab605..000000000000 --- a/arch/arm/mach-netx/time.c +++ /dev/null | |||
@@ -1,141 +0,0 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0-only | ||
2 | /* | ||
3 | * arch/arm/mach-netx/time.c | ||
4 | * | ||
5 | * Copyright (c) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix | ||
6 | */ | ||
7 | |||
8 | #include <linux/init.h> | ||
9 | #include <linux/interrupt.h> | ||
10 | #include <linux/irq.h> | ||
11 | #include <linux/clocksource.h> | ||
12 | #include <linux/clockchips.h> | ||
13 | #include <linux/io.h> | ||
14 | |||
15 | #include <mach/hardware.h> | ||
16 | #include <asm/mach/time.h> | ||
17 | #include <mach/netx-regs.h> | ||
18 | |||
19 | #define NETX_CLOCK_FREQ 100000000 | ||
20 | #define NETX_LATCH DIV_ROUND_CLOSEST(NETX_CLOCK_FREQ, HZ) | ||
21 | |||
22 | #define TIMER_CLOCKEVENT 0 | ||
23 | #define TIMER_CLOCKSOURCE 1 | ||
24 | |||
25 | static inline void timer_shutdown(struct clock_event_device *evt) | ||
26 | { | ||
27 | /* disable timer */ | ||
28 | writel(0, NETX_GPIO_COUNTER_CTRL(TIMER_CLOCKEVENT)); | ||
29 | } | ||
30 | |||
31 | static int netx_shutdown(struct clock_event_device *evt) | ||
32 | { | ||
33 | timer_shutdown(evt); | ||
34 | |||
35 | return 0; | ||
36 | } | ||
37 | |||
38 | static int netx_set_oneshot(struct clock_event_device *evt) | ||
39 | { | ||
40 | u32 tmode = NETX_GPIO_COUNTER_CTRL_IRQ_EN | NETX_GPIO_COUNTER_CTRL_RUN; | ||
41 | |||
42 | timer_shutdown(evt); | ||
43 | writel(0, NETX_GPIO_COUNTER_MAX(TIMER_CLOCKEVENT)); | ||
44 | writel(tmode, NETX_GPIO_COUNTER_CTRL(TIMER_CLOCKEVENT)); | ||
45 | |||
46 | return 0; | ||
47 | } | ||
48 | |||
49 | static int netx_set_periodic(struct clock_event_device *evt) | ||
50 | { | ||
51 | u32 tmode = NETX_GPIO_COUNTER_CTRL_RST_EN | | ||
52 | NETX_GPIO_COUNTER_CTRL_IRQ_EN | NETX_GPIO_COUNTER_CTRL_RUN; | ||
53 | |||
54 | timer_shutdown(evt); | ||
55 | writel(NETX_LATCH, NETX_GPIO_COUNTER_MAX(TIMER_CLOCKEVENT)); | ||
56 | writel(tmode, NETX_GPIO_COUNTER_CTRL(TIMER_CLOCKEVENT)); | ||
57 | |||
58 | return 0; | ||
59 | } | ||
60 | |||
61 | static int netx_set_next_event(unsigned long evt, | ||
62 | struct clock_event_device *clk) | ||
63 | { | ||
64 | writel(0 - evt, NETX_GPIO_COUNTER_CURRENT(TIMER_CLOCKEVENT)); | ||
65 | return 0; | ||
66 | } | ||
67 | |||
68 | static struct clock_event_device netx_clockevent = { | ||
69 | .name = "netx-timer" __stringify(TIMER_CLOCKEVENT), | ||
70 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, | ||
71 | .set_next_event = netx_set_next_event, | ||
72 | .set_state_shutdown = netx_shutdown, | ||
73 | .set_state_periodic = netx_set_periodic, | ||
74 | .set_state_oneshot = netx_set_oneshot, | ||
75 | .tick_resume = netx_shutdown, | ||
76 | }; | ||
77 | |||
78 | /* | ||
79 | * IRQ handler for the timer | ||
80 | */ | ||
81 | static irqreturn_t | ||
82 | netx_timer_interrupt(int irq, void *dev_id) | ||
83 | { | ||
84 | struct clock_event_device *evt = &netx_clockevent; | ||
85 | |||
86 | /* acknowledge interrupt */ | ||
87 | writel(COUNTER_BIT(0), NETX_GPIO_IRQ); | ||
88 | |||
89 | evt->event_handler(evt); | ||
90 | |||
91 | return IRQ_HANDLED; | ||
92 | } | ||
93 | |||
94 | static struct irqaction netx_timer_irq = { | ||
95 | .name = "NetX Timer Tick", | ||
96 | .flags = IRQF_TIMER | IRQF_IRQPOLL, | ||
97 | .handler = netx_timer_interrupt, | ||
98 | }; | ||
99 | |||
100 | /* | ||
101 | * Set up timer interrupt | ||
102 | */ | ||
103 | void __init netx_timer_init(void) | ||
104 | { | ||
105 | /* disable timer initially */ | ||
106 | writel(0, NETX_GPIO_COUNTER_CTRL(0)); | ||
107 | |||
108 | /* Reset the timer value to zero */ | ||
109 | writel(0, NETX_GPIO_COUNTER_CURRENT(0)); | ||
110 | |||
111 | writel(NETX_LATCH, NETX_GPIO_COUNTER_MAX(0)); | ||
112 | |||
113 | /* acknowledge interrupt */ | ||
114 | writel(COUNTER_BIT(0), NETX_GPIO_IRQ); | ||
115 | |||
116 | /* Enable the interrupt in the specific timer | ||
117 | * register and start timer | ||
118 | */ | ||
119 | writel(COUNTER_BIT(0), NETX_GPIO_IRQ_ENABLE); | ||
120 | writel(NETX_GPIO_COUNTER_CTRL_IRQ_EN | NETX_GPIO_COUNTER_CTRL_RUN, | ||
121 | NETX_GPIO_COUNTER_CTRL(0)); | ||
122 | |||
123 | setup_irq(NETX_IRQ_TIMER0, &netx_timer_irq); | ||
124 | |||
125 | /* Setup timer one for clocksource */ | ||
126 | writel(0, NETX_GPIO_COUNTER_CTRL(TIMER_CLOCKSOURCE)); | ||
127 | writel(0, NETX_GPIO_COUNTER_CURRENT(TIMER_CLOCKSOURCE)); | ||
128 | writel(0xffffffff, NETX_GPIO_COUNTER_MAX(TIMER_CLOCKSOURCE)); | ||
129 | |||
130 | writel(NETX_GPIO_COUNTER_CTRL_RUN, | ||
131 | NETX_GPIO_COUNTER_CTRL(TIMER_CLOCKSOURCE)); | ||
132 | |||
133 | clocksource_mmio_init(NETX_GPIO_COUNTER_CURRENT(TIMER_CLOCKSOURCE), | ||
134 | "netx_timer", NETX_CLOCK_FREQ, 200, 32, clocksource_mmio_readl_up); | ||
135 | |||
136 | /* with max_delta_ns >= delta2ns(0x800) the system currently runs fine. | ||
137 | * Adding some safety ... */ | ||
138 | netx_clockevent.cpumask = cpumask_of(0); | ||
139 | clockevents_config_and_register(&netx_clockevent, NETX_CLOCK_FREQ, | ||
140 | 0xa00, 0xfffffffe); | ||
141 | } | ||
diff --git a/arch/arm/mach-netx/xc.c b/arch/arm/mach-netx/xc.c deleted file mode 100644 index 885a618b2651..000000000000 --- a/arch/arm/mach-netx/xc.c +++ /dev/null | |||
@@ -1,246 +0,0 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0-only | ||
2 | /* | ||
3 | * arch/arm/mach-netx/xc.c | ||
4 | * | ||
5 | * Copyright (c) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix | ||
6 | */ | ||
7 | |||
8 | #include <linux/init.h> | ||
9 | #include <linux/device.h> | ||
10 | #include <linux/firmware.h> | ||
11 | #include <linux/mutex.h> | ||
12 | #include <linux/slab.h> | ||
13 | #include <linux/io.h> | ||
14 | #include <linux/export.h> | ||
15 | |||
16 | #include <mach/hardware.h> | ||
17 | #include <mach/irqs.h> | ||
18 | #include <mach/netx-regs.h> | ||
19 | |||
20 | #include <mach/xc.h> | ||
21 | |||
22 | static DEFINE_MUTEX(xc_lock); | ||
23 | |||
24 | static int xc_in_use = 0; | ||
25 | |||
26 | struct fw_desc { | ||
27 | unsigned int ofs; | ||
28 | unsigned int size; | ||
29 | unsigned int patch_ofs; | ||
30 | unsigned int patch_entries; | ||
31 | }; | ||
32 | |||
33 | struct fw_header { | ||
34 | unsigned int magic; | ||
35 | unsigned int type; | ||
36 | unsigned int version; | ||
37 | unsigned int reserved[5]; | ||
38 | struct fw_desc fw_desc[3]; | ||
39 | } __attribute__ ((packed)); | ||
40 | |||
41 | int xc_stop(struct xc *x) | ||
42 | { | ||
43 | writel(RPU_HOLD_PC, x->xmac_base + NETX_XMAC_RPU_HOLD_PC_OFS); | ||
44 | writel(TPU_HOLD_PC, x->xmac_base + NETX_XMAC_TPU_HOLD_PC_OFS); | ||
45 | writel(XPU_HOLD_PC, x->xpec_base + NETX_XPEC_XPU_HOLD_PC_OFS); | ||
46 | return 0; | ||
47 | } | ||
48 | |||
49 | int xc_start(struct xc *x) | ||
50 | { | ||
51 | writel(0, x->xmac_base + NETX_XMAC_RPU_HOLD_PC_OFS); | ||
52 | writel(0, x->xmac_base + NETX_XMAC_TPU_HOLD_PC_OFS); | ||
53 | writel(0, x->xpec_base + NETX_XPEC_XPU_HOLD_PC_OFS); | ||
54 | return 0; | ||
55 | } | ||
56 | |||
57 | int xc_running(struct xc *x) | ||
58 | { | ||
59 | return (readl(x->xmac_base + NETX_XMAC_RPU_HOLD_PC_OFS) & RPU_HOLD_PC) | ||
60 | || (readl(x->xmac_base + NETX_XMAC_TPU_HOLD_PC_OFS) & TPU_HOLD_PC) | ||
61 | || (readl(x->xpec_base + NETX_XPEC_XPU_HOLD_PC_OFS) & XPU_HOLD_PC) ? | ||
62 | 0 : 1; | ||
63 | } | ||
64 | |||
65 | int xc_reset(struct xc *x) | ||
66 | { | ||
67 | writel(0, x->xpec_base + NETX_XPEC_PC_OFS); | ||
68 | return 0; | ||
69 | } | ||
70 | |||
71 | static int xc_check_ptr(struct xc *x, unsigned long adr, unsigned int size) | ||
72 | { | ||
73 | if (adr >= NETX_PA_XMAC(x->no) && | ||
74 | adr + size < NETX_PA_XMAC(x->no) + XMAC_MEM_SIZE) | ||
75 | return 0; | ||
76 | |||
77 | if (adr >= NETX_PA_XPEC(x->no) && | ||
78 | adr + size < NETX_PA_XPEC(x->no) + XPEC_MEM_SIZE) | ||
79 | return 0; | ||
80 | |||
81 | dev_err(x->dev, "Illegal pointer in firmware found. aborting\n"); | ||
82 | |||
83 | return -1; | ||
84 | } | ||
85 | |||
86 | static int xc_patch(struct xc *x, const void *patch, int count) | ||
87 | { | ||
88 | unsigned int val, adr; | ||
89 | const unsigned int *data = patch; | ||
90 | |||
91 | int i; | ||
92 | for (i = 0; i < count; i++) { | ||
93 | adr = *data++; | ||
94 | val = *data++; | ||
95 | if (xc_check_ptr(x, adr, 4) < 0) | ||
96 | return -EINVAL; | ||
97 | |||
98 | writel(val, (void __iomem *)io_p2v(adr)); | ||
99 | } | ||
100 | return 0; | ||
101 | } | ||
102 | |||
103 | int xc_request_firmware(struct xc *x) | ||
104 | { | ||
105 | int ret; | ||
106 | char name[16]; | ||
107 | const struct firmware *fw; | ||
108 | struct fw_header *head; | ||
109 | unsigned int size; | ||
110 | int i; | ||
111 | const void *src; | ||
112 | unsigned long dst; | ||
113 | |||
114 | sprintf(name, "xc%d.bin", x->no); | ||
115 | |||
116 | ret = request_firmware(&fw, name, x->dev); | ||
117 | |||
118 | if (ret < 0) { | ||
119 | dev_err(x->dev, "request_firmware failed\n"); | ||
120 | return ret; | ||
121 | } | ||
122 | |||
123 | head = (struct fw_header *)fw->data; | ||
124 | if (head->magic != 0x4e657458) { | ||
125 | if (head->magic == 0x5874654e) { | ||
126 | dev_err(x->dev, | ||
127 | "firmware magic is 'XteN'. Endianness problems?\n"); | ||
128 | ret = -ENODEV; | ||
129 | goto exit_release_firmware; | ||
130 | } | ||
131 | dev_err(x->dev, "unrecognized firmware magic 0x%08x\n", | ||
132 | head->magic); | ||
133 | ret = -ENODEV; | ||
134 | goto exit_release_firmware; | ||
135 | } | ||
136 | |||
137 | x->type = head->type; | ||
138 | x->version = head->version; | ||
139 | |||
140 | ret = -EINVAL; | ||
141 | |||
142 | for (i = 0; i < 3; i++) { | ||
143 | src = fw->data + head->fw_desc[i].ofs; | ||
144 | dst = *(unsigned int *)src; | ||
145 | src += sizeof (unsigned int); | ||
146 | size = head->fw_desc[i].size - sizeof (unsigned int); | ||
147 | |||
148 | if (xc_check_ptr(x, dst, size)) | ||
149 | goto exit_release_firmware; | ||
150 | |||
151 | memcpy((void *)io_p2v(dst), src, size); | ||
152 | |||
153 | src = fw->data + head->fw_desc[i].patch_ofs; | ||
154 | size = head->fw_desc[i].patch_entries; | ||
155 | ret = xc_patch(x, src, size); | ||
156 | if (ret < 0) | ||
157 | goto exit_release_firmware; | ||
158 | } | ||
159 | |||
160 | ret = 0; | ||
161 | |||
162 | exit_release_firmware: | ||
163 | release_firmware(fw); | ||
164 | |||
165 | return ret; | ||
166 | } | ||
167 | |||
168 | struct xc *request_xc(int xcno, struct device *dev) | ||
169 | { | ||
170 | struct xc *x = NULL; | ||
171 | |||
172 | mutex_lock(&xc_lock); | ||
173 | |||
174 | if (xcno > 3) | ||
175 | goto exit; | ||
176 | if (xc_in_use & (1 << xcno)) | ||
177 | goto exit; | ||
178 | |||
179 | x = kmalloc(sizeof (struct xc), GFP_KERNEL); | ||
180 | if (!x) | ||
181 | goto exit; | ||
182 | |||
183 | if (!request_mem_region | ||
184 | (NETX_PA_XPEC(xcno), XPEC_MEM_SIZE, kobject_name(&dev->kobj))) | ||
185 | goto exit_free; | ||
186 | |||
187 | if (!request_mem_region | ||
188 | (NETX_PA_XMAC(xcno), XMAC_MEM_SIZE, kobject_name(&dev->kobj))) | ||
189 | goto exit_release_1; | ||
190 | |||
191 | if (!request_mem_region | ||
192 | (SRAM_INTERNAL_PHYS(xcno), SRAM_MEM_SIZE, kobject_name(&dev->kobj))) | ||
193 | goto exit_release_2; | ||
194 | |||
195 | x->xpec_base = (void * __iomem)io_p2v(NETX_PA_XPEC(xcno)); | ||
196 | x->xmac_base = (void * __iomem)io_p2v(NETX_PA_XMAC(xcno)); | ||
197 | x->sram_base = ioremap(SRAM_INTERNAL_PHYS(xcno), SRAM_MEM_SIZE); | ||
198 | if (!x->sram_base) | ||
199 | goto exit_release_3; | ||
200 | |||
201 | x->irq = NETX_IRQ_XPEC(xcno); | ||
202 | |||
203 | x->no = xcno; | ||
204 | x->dev = dev; | ||
205 | |||
206 | xc_in_use |= (1 << xcno); | ||
207 | |||
208 | goto exit; | ||
209 | |||
210 | exit_release_3: | ||
211 | release_mem_region(SRAM_INTERNAL_PHYS(xcno), SRAM_MEM_SIZE); | ||
212 | exit_release_2: | ||
213 | release_mem_region(NETX_PA_XMAC(xcno), XMAC_MEM_SIZE); | ||
214 | exit_release_1: | ||
215 | release_mem_region(NETX_PA_XPEC(xcno), XPEC_MEM_SIZE); | ||
216 | exit_free: | ||
217 | kfree(x); | ||
218 | x = NULL; | ||
219 | exit: | ||
220 | mutex_unlock(&xc_lock); | ||
221 | return x; | ||
222 | } | ||
223 | |||
224 | void free_xc(struct xc *x) | ||
225 | { | ||
226 | int xcno = x->no; | ||
227 | |||
228 | mutex_lock(&xc_lock); | ||
229 | |||
230 | iounmap(x->sram_base); | ||
231 | release_mem_region(SRAM_INTERNAL_PHYS(xcno), SRAM_MEM_SIZE); | ||
232 | release_mem_region(NETX_PA_XMAC(xcno), XMAC_MEM_SIZE); | ||
233 | release_mem_region(NETX_PA_XPEC(xcno), XPEC_MEM_SIZE); | ||
234 | xc_in_use &= ~(1 << x->no); | ||
235 | kfree(x); | ||
236 | |||
237 | mutex_unlock(&xc_lock); | ||
238 | } | ||
239 | |||
240 | EXPORT_SYMBOL(free_xc); | ||
241 | EXPORT_SYMBOL(request_xc); | ||
242 | EXPORT_SYMBOL(xc_request_firmware); | ||
243 | EXPORT_SYMBOL(xc_reset); | ||
244 | EXPORT_SYMBOL(xc_running); | ||
245 | EXPORT_SYMBOL(xc_start); | ||
246 | EXPORT_SYMBOL(xc_stop); | ||
diff --git a/arch/arm64/boot/dts/freescale/imx8mm-pinfunc.h b/arch/arm64/boot/dts/freescale/imx8mm-pinfunc.h index e25f7fcd7997..cffa8991880d 100644 --- a/arch/arm64/boot/dts/freescale/imx8mm-pinfunc.h +++ b/arch/arm64/boot/dts/freescale/imx8mm-pinfunc.h | |||
@@ -462,7 +462,7 @@ | |||
462 | #define MX8MM_IOMUXC_SAI3_RXFS_GPIO4_IO28 0x1CC 0x434 0x000 0x5 0x0 | 462 | #define MX8MM_IOMUXC_SAI3_RXFS_GPIO4_IO28 0x1CC 0x434 0x000 0x5 0x0 |
463 | #define MX8MM_IOMUXC_SAI3_RXFS_TPSMP_HTRANS0 0x1CC 0x434 0x000 0x7 0x0 | 463 | #define MX8MM_IOMUXC_SAI3_RXFS_TPSMP_HTRANS0 0x1CC 0x434 0x000 0x7 0x0 |
464 | #define MX8MM_IOMUXC_SAI3_RXC_SAI3_RX_BCLK 0x1D0 0x438 0x000 0x0 0x0 | 464 | #define MX8MM_IOMUXC_SAI3_RXC_SAI3_RX_BCLK 0x1D0 0x438 0x000 0x0 0x0 |
465 | #define MX8MM_IOMUXC_SAI3_RXC_GPT1_CAPTURE2 0x1D0 0x438 0x000 0x1 0x0 | 465 | #define MX8MM_IOMUXC_SAI3_RXC_GPT1_CLK 0x1D0 0x438 0x000 0x1 0x0 |
466 | #define MX8MM_IOMUXC_SAI3_RXC_SAI5_RX_BCLK 0x1D0 0x438 0x4D0 0x2 0x2 | 466 | #define MX8MM_IOMUXC_SAI3_RXC_SAI5_RX_BCLK 0x1D0 0x438 0x4D0 0x2 0x2 |
467 | #define MX8MM_IOMUXC_SAI3_RXC_GPIO4_IO29 0x1D0 0x438 0x000 0x5 0x0 | 467 | #define MX8MM_IOMUXC_SAI3_RXC_GPIO4_IO29 0x1D0 0x438 0x000 0x5 0x0 |
468 | #define MX8MM_IOMUXC_SAI3_RXC_TPSMP_HTRANS1 0x1D0 0x438 0x000 0x7 0x0 | 468 | #define MX8MM_IOMUXC_SAI3_RXC_TPSMP_HTRANS1 0x1D0 0x438 0x000 0x7 0x0 |
@@ -472,7 +472,7 @@ | |||
472 | #define MX8MM_IOMUXC_SAI3_RXD_GPIO4_IO30 0x1D4 0x43C 0x000 0x5 0x0 | 472 | #define MX8MM_IOMUXC_SAI3_RXD_GPIO4_IO30 0x1D4 0x43C 0x000 0x5 0x0 |
473 | #define MX8MM_IOMUXC_SAI3_RXD_TPSMP_HDATA0 0x1D4 0x43C 0x000 0x7 0x0 | 473 | #define MX8MM_IOMUXC_SAI3_RXD_TPSMP_HDATA0 0x1D4 0x43C 0x000 0x7 0x0 |
474 | #define MX8MM_IOMUXC_SAI3_TXFS_SAI3_TX_SYNC 0x1D8 0x440 0x000 0x0 0x0 | 474 | #define MX8MM_IOMUXC_SAI3_TXFS_SAI3_TX_SYNC 0x1D8 0x440 0x000 0x0 0x0 |
475 | #define MX8MM_IOMUXC_SAI3_TXFS_GPT1_CLK 0x1D8 0x440 0x000 0x1 0x0 | 475 | #define MX8MM_IOMUXC_SAI3_TXFS_GPT1_CAPTURE2 0x1D8 0x440 0x000 0x1 0x0 |
476 | #define MX8MM_IOMUXC_SAI3_TXFS_SAI5_RX_DATA1 0x1D8 0x440 0x4D8 0x2 0x2 | 476 | #define MX8MM_IOMUXC_SAI3_TXFS_SAI5_RX_DATA1 0x1D8 0x440 0x4D8 0x2 0x2 |
477 | #define MX8MM_IOMUXC_SAI3_TXFS_GPIO4_IO31 0x1D8 0x440 0x000 0x5 0x0 | 477 | #define MX8MM_IOMUXC_SAI3_TXFS_GPIO4_IO31 0x1D8 0x440 0x000 0x5 0x0 |
478 | #define MX8MM_IOMUXC_SAI3_TXFS_TPSMP_HDATA1 0x1D8 0x440 0x000 0x7 0x0 | 478 | #define MX8MM_IOMUXC_SAI3_TXFS_TPSMP_HDATA1 0x1D8 0x440 0x000 0x7 0x0 |
diff --git a/arch/arm64/boot/dts/freescale/imx8mq.dtsi b/arch/arm64/boot/dts/freescale/imx8mq.dtsi index d09b808eff87..52aae341d0da 100644 --- a/arch/arm64/boot/dts/freescale/imx8mq.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mq.dtsi | |||
@@ -715,8 +715,7 @@ | |||
715 | 715 | ||
716 | sai2: sai@308b0000 { | 716 | sai2: sai@308b0000 { |
717 | #sound-dai-cells = <0>; | 717 | #sound-dai-cells = <0>; |
718 | compatible = "fsl,imx8mq-sai", | 718 | compatible = "fsl,imx8mq-sai"; |
719 | "fsl,imx6sx-sai"; | ||
720 | reg = <0x308b0000 0x10000>; | 719 | reg = <0x308b0000 0x10000>; |
721 | interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>; | 720 | interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>; |
722 | clocks = <&clk IMX8MQ_CLK_SAI2_IPG>, | 721 | clocks = <&clk IMX8MQ_CLK_SAI2_IPG>, |
diff --git a/arch/arm64/include/asm/elf.h b/arch/arm64/include/asm/elf.h index 3c7037c6ba9b..b618017205a3 100644 --- a/arch/arm64/include/asm/elf.h +++ b/arch/arm64/include/asm/elf.h | |||
@@ -202,7 +202,7 @@ typedef compat_elf_greg_t compat_elf_gregset_t[COMPAT_ELF_NGREG]; | |||
202 | ({ \ | 202 | ({ \ |
203 | set_thread_flag(TIF_32BIT); \ | 203 | set_thread_flag(TIF_32BIT); \ |
204 | }) | 204 | }) |
205 | #ifdef CONFIG_GENERIC_COMPAT_VDSO | 205 | #ifdef CONFIG_COMPAT_VDSO |
206 | #define COMPAT_ARCH_DLINFO \ | 206 | #define COMPAT_ARCH_DLINFO \ |
207 | do { \ | 207 | do { \ |
208 | /* \ | 208 | /* \ |
diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index 87a4b2ddc1a1..3f5461f7b560 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h | |||
@@ -301,7 +301,6 @@ static inline int pte_same(pte_t pte_a, pte_t pte_b) | |||
301 | /* | 301 | /* |
302 | * Huge pte definitions. | 302 | * Huge pte definitions. |
303 | */ | 303 | */ |
304 | #define pte_huge(pte) (!(pte_val(pte) & PTE_TABLE_BIT)) | ||
305 | #define pte_mkhuge(pte) (__pte(pte_val(pte) & ~PTE_TABLE_BIT)) | 304 | #define pte_mkhuge(pte) (__pte(pte_val(pte) & ~PTE_TABLE_BIT)) |
306 | 305 | ||
307 | /* | 306 | /* |
diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h index fd5b1a4efc70..844e2964b0f5 100644 --- a/arch/arm64/include/asm/processor.h +++ b/arch/arm64/include/asm/processor.h | |||
@@ -193,6 +193,16 @@ static inline void start_thread_common(struct pt_regs *regs, unsigned long pc) | |||
193 | regs->pmr_save = GIC_PRIO_IRQON; | 193 | regs->pmr_save = GIC_PRIO_IRQON; |
194 | } | 194 | } |
195 | 195 | ||
196 | static inline void set_ssbs_bit(struct pt_regs *regs) | ||
197 | { | ||
198 | regs->pstate |= PSR_SSBS_BIT; | ||
199 | } | ||
200 | |||
201 | static inline void set_compat_ssbs_bit(struct pt_regs *regs) | ||
202 | { | ||
203 | regs->pstate |= PSR_AA32_SSBS_BIT; | ||
204 | } | ||
205 | |||
196 | static inline void start_thread(struct pt_regs *regs, unsigned long pc, | 206 | static inline void start_thread(struct pt_regs *regs, unsigned long pc, |
197 | unsigned long sp) | 207 | unsigned long sp) |
198 | { | 208 | { |
@@ -200,7 +210,7 @@ static inline void start_thread(struct pt_regs *regs, unsigned long pc, | |||
200 | regs->pstate = PSR_MODE_EL0t; | 210 | regs->pstate = PSR_MODE_EL0t; |
201 | 211 | ||
202 | if (arm64_get_ssbd_state() != ARM64_SSBD_FORCE_ENABLE) | 212 | if (arm64_get_ssbd_state() != ARM64_SSBD_FORCE_ENABLE) |
203 | regs->pstate |= PSR_SSBS_BIT; | 213 | set_ssbs_bit(regs); |
204 | 214 | ||
205 | regs->sp = sp; | 215 | regs->sp = sp; |
206 | } | 216 | } |
@@ -219,7 +229,7 @@ static inline void compat_start_thread(struct pt_regs *regs, unsigned long pc, | |||
219 | #endif | 229 | #endif |
220 | 230 | ||
221 | if (arm64_get_ssbd_state() != ARM64_SSBD_FORCE_ENABLE) | 231 | if (arm64_get_ssbd_state() != ARM64_SSBD_FORCE_ENABLE) |
222 | regs->pstate |= PSR_AA32_SSBS_BIT; | 232 | set_compat_ssbs_bit(regs); |
223 | 233 | ||
224 | regs->compat_sp = sp; | 234 | regs->compat_sp = sp; |
225 | } | 235 | } |
diff --git a/arch/arm64/include/asm/stacktrace.h b/arch/arm64/include/asm/stacktrace.h index df45af931459..4d9b1f48dc39 100644 --- a/arch/arm64/include/asm/stacktrace.h +++ b/arch/arm64/include/asm/stacktrace.h | |||
@@ -8,19 +8,12 @@ | |||
8 | #include <linux/percpu.h> | 8 | #include <linux/percpu.h> |
9 | #include <linux/sched.h> | 9 | #include <linux/sched.h> |
10 | #include <linux/sched/task_stack.h> | 10 | #include <linux/sched/task_stack.h> |
11 | #include <linux/types.h> | ||
11 | 12 | ||
12 | #include <asm/memory.h> | 13 | #include <asm/memory.h> |
13 | #include <asm/ptrace.h> | 14 | #include <asm/ptrace.h> |
14 | #include <asm/sdei.h> | 15 | #include <asm/sdei.h> |
15 | 16 | ||
16 | struct stackframe { | ||
17 | unsigned long fp; | ||
18 | unsigned long pc; | ||
19 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
20 | int graph; | ||
21 | #endif | ||
22 | }; | ||
23 | |||
24 | enum stack_type { | 17 | enum stack_type { |
25 | STACK_TYPE_UNKNOWN, | 18 | STACK_TYPE_UNKNOWN, |
26 | STACK_TYPE_TASK, | 19 | STACK_TYPE_TASK, |
@@ -28,6 +21,7 @@ enum stack_type { | |||
28 | STACK_TYPE_OVERFLOW, | 21 | STACK_TYPE_OVERFLOW, |
29 | STACK_TYPE_SDEI_NORMAL, | 22 | STACK_TYPE_SDEI_NORMAL, |
30 | STACK_TYPE_SDEI_CRITICAL, | 23 | STACK_TYPE_SDEI_CRITICAL, |
24 | __NR_STACK_TYPES | ||
31 | }; | 25 | }; |
32 | 26 | ||
33 | struct stack_info { | 27 | struct stack_info { |
@@ -36,6 +30,37 @@ struct stack_info { | |||
36 | enum stack_type type; | 30 | enum stack_type type; |
37 | }; | 31 | }; |
38 | 32 | ||
33 | /* | ||
34 | * A snapshot of a frame record or fp/lr register values, along with some | ||
35 | * accounting information necessary for robust unwinding. | ||
36 | * | ||
37 | * @fp: The fp value in the frame record (or the real fp) | ||
38 | * @pc: The fp value in the frame record (or the real lr) | ||
39 | * | ||
40 | * @stacks_done: Stacks which have been entirely unwound, for which it is no | ||
41 | * longer valid to unwind to. | ||
42 | * | ||
43 | * @prev_fp: The fp that pointed to this frame record, or a synthetic value | ||
44 | * of 0. This is used to ensure that within a stack, each | ||
45 | * subsequent frame record is at an increasing address. | ||
46 | * @prev_type: The type of stack this frame record was on, or a synthetic | ||
47 | * value of STACK_TYPE_UNKNOWN. This is used to detect a | ||
48 | * transition from one stack to another. | ||
49 | * | ||
50 | * @graph: When FUNCTION_GRAPH_TRACER is selected, holds the index of a | ||
51 | * replacement lr value in the ftrace graph stack. | ||
52 | */ | ||
53 | struct stackframe { | ||
54 | unsigned long fp; | ||
55 | unsigned long pc; | ||
56 | DECLARE_BITMAP(stacks_done, __NR_STACK_TYPES); | ||
57 | unsigned long prev_fp; | ||
58 | enum stack_type prev_type; | ||
59 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
60 | int graph; | ||
61 | #endif | ||
62 | }; | ||
63 | |||
39 | extern int unwind_frame(struct task_struct *tsk, struct stackframe *frame); | 64 | extern int unwind_frame(struct task_struct *tsk, struct stackframe *frame); |
40 | extern void walk_stackframe(struct task_struct *tsk, struct stackframe *frame, | 65 | extern void walk_stackframe(struct task_struct *tsk, struct stackframe *frame, |
41 | int (*fn)(struct stackframe *, void *), void *data); | 66 | int (*fn)(struct stackframe *, void *), void *data); |
@@ -64,8 +89,9 @@ static inline bool on_irq_stack(unsigned long sp, | |||
64 | return true; | 89 | return true; |
65 | } | 90 | } |
66 | 91 | ||
67 | static inline bool on_task_stack(struct task_struct *tsk, unsigned long sp, | 92 | static inline bool on_task_stack(const struct task_struct *tsk, |
68 | struct stack_info *info) | 93 | unsigned long sp, |
94 | struct stack_info *info) | ||
69 | { | 95 | { |
70 | unsigned long low = (unsigned long)task_stack_page(tsk); | 96 | unsigned long low = (unsigned long)task_stack_page(tsk); |
71 | unsigned long high = low + THREAD_SIZE; | 97 | unsigned long high = low + THREAD_SIZE; |
@@ -112,10 +138,13 @@ static inline bool on_overflow_stack(unsigned long sp, | |||
112 | * We can only safely access per-cpu stacks from current in a non-preemptible | 138 | * We can only safely access per-cpu stacks from current in a non-preemptible |
113 | * context. | 139 | * context. |
114 | */ | 140 | */ |
115 | static inline bool on_accessible_stack(struct task_struct *tsk, | 141 | static inline bool on_accessible_stack(const struct task_struct *tsk, |
116 | unsigned long sp, | 142 | unsigned long sp, |
117 | struct stack_info *info) | 143 | struct stack_info *info) |
118 | { | 144 | { |
145 | if (info) | ||
146 | info->type = STACK_TYPE_UNKNOWN; | ||
147 | |||
119 | if (on_task_stack(tsk, sp, info)) | 148 | if (on_task_stack(tsk, sp, info)) |
120 | return true; | 149 | return true; |
121 | if (tsk != current || preemptible()) | 150 | if (tsk != current || preemptible()) |
@@ -130,4 +159,27 @@ static inline bool on_accessible_stack(struct task_struct *tsk, | |||
130 | return false; | 159 | return false; |
131 | } | 160 | } |
132 | 161 | ||
162 | static inline void start_backtrace(struct stackframe *frame, | ||
163 | unsigned long fp, unsigned long pc) | ||
164 | { | ||
165 | frame->fp = fp; | ||
166 | frame->pc = pc; | ||
167 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
168 | frame->graph = 0; | ||
169 | #endif | ||
170 | |||
171 | /* | ||
172 | * Prime the first unwind. | ||
173 | * | ||
174 | * In unwind_frame() we'll check that the FP points to a valid stack, | ||
175 | * which can't be STACK_TYPE_UNKNOWN, and the first unwind will be | ||
176 | * treated as a transition to whichever stack that happens to be. The | ||
177 | * prev_fp value won't be used, but we set it to 0 such that it is | ||
178 | * definitely not an accessible stack address. | ||
179 | */ | ||
180 | bitmap_zero(frame->stacks_done, __NR_STACK_TYPES); | ||
181 | frame->prev_fp = 0; | ||
182 | frame->prev_type = STACK_TYPE_UNKNOWN; | ||
183 | } | ||
184 | |||
133 | #endif /* __ASM_STACKTRACE_H */ | 185 | #endif /* __ASM_STACKTRACE_H */ |
diff --git a/arch/arm64/include/uapi/asm/bpf_perf_event.h b/arch/arm64/include/uapi/asm/bpf_perf_event.h index b551b741653d..5e1e648aeec4 100644 --- a/arch/arm64/include/uapi/asm/bpf_perf_event.h +++ b/arch/arm64/include/uapi/asm/bpf_perf_event.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
2 | #ifndef _UAPI__ASM_BPF_PERF_EVENT_H__ | 2 | #ifndef _UAPI__ASM_BPF_PERF_EVENT_H__ |
3 | #define _UAPI__ASM_BPF_PERF_EVENT_H__ | 3 | #define _UAPI__ASM_BPF_PERF_EVENT_H__ |
4 | 4 | ||
diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S index 9cdc4592da3e..320a30dbe35e 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S | |||
@@ -586,10 +586,8 @@ el1_sync: | |||
586 | b.eq el1_ia | 586 | b.eq el1_ia |
587 | cmp x24, #ESR_ELx_EC_SYS64 // configurable trap | 587 | cmp x24, #ESR_ELx_EC_SYS64 // configurable trap |
588 | b.eq el1_undef | 588 | b.eq el1_undef |
589 | cmp x24, #ESR_ELx_EC_SP_ALIGN // stack alignment exception | ||
590 | b.eq el1_sp_pc | ||
591 | cmp x24, #ESR_ELx_EC_PC_ALIGN // pc alignment exception | 589 | cmp x24, #ESR_ELx_EC_PC_ALIGN // pc alignment exception |
592 | b.eq el1_sp_pc | 590 | b.eq el1_pc |
593 | cmp x24, #ESR_ELx_EC_UNKNOWN // unknown exception in EL1 | 591 | cmp x24, #ESR_ELx_EC_UNKNOWN // unknown exception in EL1 |
594 | b.eq el1_undef | 592 | b.eq el1_undef |
595 | cmp x24, #ESR_ELx_EC_BREAKPT_CUR // debug exception in EL1 | 593 | cmp x24, #ESR_ELx_EC_BREAKPT_CUR // debug exception in EL1 |
@@ -611,9 +609,11 @@ el1_da: | |||
611 | bl do_mem_abort | 609 | bl do_mem_abort |
612 | 610 | ||
613 | kernel_exit 1 | 611 | kernel_exit 1 |
614 | el1_sp_pc: | 612 | el1_pc: |
615 | /* | 613 | /* |
616 | * Stack or PC alignment exception handling | 614 | * PC alignment exception handling. We don't handle SP alignment faults, |
615 | * since we will have hit a recursive exception when trying to push the | ||
616 | * initial pt_regs. | ||
617 | */ | 617 | */ |
618 | mrs x0, far_el1 | 618 | mrs x0, far_el1 |
619 | inherit_daif pstate=x23, tmp=x2 | 619 | inherit_daif pstate=x23, tmp=x2 |
@@ -732,9 +732,9 @@ el0_sync: | |||
732 | ccmp x24, #ESR_ELx_EC_WFx, #4, ne | 732 | ccmp x24, #ESR_ELx_EC_WFx, #4, ne |
733 | b.eq el0_sys | 733 | b.eq el0_sys |
734 | cmp x24, #ESR_ELx_EC_SP_ALIGN // stack alignment exception | 734 | cmp x24, #ESR_ELx_EC_SP_ALIGN // stack alignment exception |
735 | b.eq el0_sp_pc | 735 | b.eq el0_sp |
736 | cmp x24, #ESR_ELx_EC_PC_ALIGN // pc alignment exception | 736 | cmp x24, #ESR_ELx_EC_PC_ALIGN // pc alignment exception |
737 | b.eq el0_sp_pc | 737 | b.eq el0_pc |
738 | cmp x24, #ESR_ELx_EC_UNKNOWN // unknown exception in EL0 | 738 | cmp x24, #ESR_ELx_EC_UNKNOWN // unknown exception in EL0 |
739 | b.eq el0_undef | 739 | b.eq el0_undef |
740 | cmp x24, #ESR_ELx_EC_BREAKPT_LOW // debug exception in EL0 | 740 | cmp x24, #ESR_ELx_EC_BREAKPT_LOW // debug exception in EL0 |
@@ -758,7 +758,7 @@ el0_sync_compat: | |||
758 | cmp x24, #ESR_ELx_EC_FP_EXC32 // FP/ASIMD exception | 758 | cmp x24, #ESR_ELx_EC_FP_EXC32 // FP/ASIMD exception |
759 | b.eq el0_fpsimd_exc | 759 | b.eq el0_fpsimd_exc |
760 | cmp x24, #ESR_ELx_EC_PC_ALIGN // pc alignment exception | 760 | cmp x24, #ESR_ELx_EC_PC_ALIGN // pc alignment exception |
761 | b.eq el0_sp_pc | 761 | b.eq el0_pc |
762 | cmp x24, #ESR_ELx_EC_UNKNOWN // unknown exception in EL0 | 762 | cmp x24, #ESR_ELx_EC_UNKNOWN // unknown exception in EL0 |
763 | b.eq el0_undef | 763 | b.eq el0_undef |
764 | cmp x24, #ESR_ELx_EC_CP15_32 // CP15 MRC/MCR trap | 764 | cmp x24, #ESR_ELx_EC_CP15_32 // CP15 MRC/MCR trap |
@@ -858,11 +858,15 @@ el0_fpsimd_exc: | |||
858 | mov x1, sp | 858 | mov x1, sp |
859 | bl do_fpsimd_exc | 859 | bl do_fpsimd_exc |
860 | b ret_to_user | 860 | b ret_to_user |
861 | el0_sp: | ||
862 | ldr x26, [sp, #S_SP] | ||
863 | b el0_sp_pc | ||
864 | el0_pc: | ||
865 | mrs x26, far_el1 | ||
861 | el0_sp_pc: | 866 | el0_sp_pc: |
862 | /* | 867 | /* |
863 | * Stack or PC alignment exception handling | 868 | * Stack or PC alignment exception handling |
864 | */ | 869 | */ |
865 | mrs x26, far_el1 | ||
866 | gic_prio_kentry_setup tmp=x0 | 870 | gic_prio_kentry_setup tmp=x0 |
867 | enable_da_f | 871 | enable_da_f |
868 | #ifdef CONFIG_TRACE_IRQFLAGS | 872 | #ifdef CONFIG_TRACE_IRQFLAGS |
diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c index eec4776ae5f0..37d3912cfe06 100644 --- a/arch/arm64/kernel/fpsimd.c +++ b/arch/arm64/kernel/fpsimd.c | |||
@@ -406,6 +406,18 @@ static __uint128_t arm64_cpu_to_le128(__uint128_t x) | |||
406 | 406 | ||
407 | #define arm64_le128_to_cpu(x) arm64_cpu_to_le128(x) | 407 | #define arm64_le128_to_cpu(x) arm64_cpu_to_le128(x) |
408 | 408 | ||
409 | static void __fpsimd_to_sve(void *sst, struct user_fpsimd_state const *fst, | ||
410 | unsigned int vq) | ||
411 | { | ||
412 | unsigned int i; | ||
413 | __uint128_t *p; | ||
414 | |||
415 | for (i = 0; i < SVE_NUM_ZREGS; ++i) { | ||
416 | p = (__uint128_t *)ZREG(sst, vq, i); | ||
417 | *p = arm64_cpu_to_le128(fst->vregs[i]); | ||
418 | } | ||
419 | } | ||
420 | |||
409 | /* | 421 | /* |
410 | * Transfer the FPSIMD state in task->thread.uw.fpsimd_state to | 422 | * Transfer the FPSIMD state in task->thread.uw.fpsimd_state to |
411 | * task->thread.sve_state. | 423 | * task->thread.sve_state. |
@@ -423,17 +435,12 @@ static void fpsimd_to_sve(struct task_struct *task) | |||
423 | unsigned int vq; | 435 | unsigned int vq; |
424 | void *sst = task->thread.sve_state; | 436 | void *sst = task->thread.sve_state; |
425 | struct user_fpsimd_state const *fst = &task->thread.uw.fpsimd_state; | 437 | struct user_fpsimd_state const *fst = &task->thread.uw.fpsimd_state; |
426 | unsigned int i; | ||
427 | __uint128_t *p; | ||
428 | 438 | ||
429 | if (!system_supports_sve()) | 439 | if (!system_supports_sve()) |
430 | return; | 440 | return; |
431 | 441 | ||
432 | vq = sve_vq_from_vl(task->thread.sve_vl); | 442 | vq = sve_vq_from_vl(task->thread.sve_vl); |
433 | for (i = 0; i < 32; ++i) { | 443 | __fpsimd_to_sve(sst, fst, vq); |
434 | p = (__uint128_t *)ZREG(sst, vq, i); | ||
435 | *p = arm64_cpu_to_le128(fst->vregs[i]); | ||
436 | } | ||
437 | } | 444 | } |
438 | 445 | ||
439 | /* | 446 | /* |
@@ -459,7 +466,7 @@ static void sve_to_fpsimd(struct task_struct *task) | |||
459 | return; | 466 | return; |
460 | 467 | ||
461 | vq = sve_vq_from_vl(task->thread.sve_vl); | 468 | vq = sve_vq_from_vl(task->thread.sve_vl); |
462 | for (i = 0; i < 32; ++i) { | 469 | for (i = 0; i < SVE_NUM_ZREGS; ++i) { |
463 | p = (__uint128_t const *)ZREG(sst, vq, i); | 470 | p = (__uint128_t const *)ZREG(sst, vq, i); |
464 | fst->vregs[i] = arm64_le128_to_cpu(*p); | 471 | fst->vregs[i] = arm64_le128_to_cpu(*p); |
465 | } | 472 | } |
@@ -550,8 +557,6 @@ void sve_sync_from_fpsimd_zeropad(struct task_struct *task) | |||
550 | unsigned int vq; | 557 | unsigned int vq; |
551 | void *sst = task->thread.sve_state; | 558 | void *sst = task->thread.sve_state; |
552 | struct user_fpsimd_state const *fst = &task->thread.uw.fpsimd_state; | 559 | struct user_fpsimd_state const *fst = &task->thread.uw.fpsimd_state; |
553 | unsigned int i; | ||
554 | __uint128_t *p; | ||
555 | 560 | ||
556 | if (!test_tsk_thread_flag(task, TIF_SVE)) | 561 | if (!test_tsk_thread_flag(task, TIF_SVE)) |
557 | return; | 562 | return; |
@@ -559,11 +564,7 @@ void sve_sync_from_fpsimd_zeropad(struct task_struct *task) | |||
559 | vq = sve_vq_from_vl(task->thread.sve_vl); | 564 | vq = sve_vq_from_vl(task->thread.sve_vl); |
560 | 565 | ||
561 | memset(sst, 0, SVE_SIG_REGS_SIZE(vq)); | 566 | memset(sst, 0, SVE_SIG_REGS_SIZE(vq)); |
562 | 567 | __fpsimd_to_sve(sst, fst, vq); | |
563 | for (i = 0; i < 32; ++i) { | ||
564 | p = (__uint128_t *)ZREG(sst, vq, i); | ||
565 | *p = arm64_cpu_to_le128(fst->vregs[i]); | ||
566 | } | ||
567 | } | 568 | } |
568 | 569 | ||
569 | int sve_set_vector_length(struct task_struct *task, | 570 | int sve_set_vector_length(struct task_struct *task, |
diff --git a/arch/arm64/kernel/perf_callchain.c b/arch/arm64/kernel/perf_callchain.c index 9d63514b9836..b0e03e052dd1 100644 --- a/arch/arm64/kernel/perf_callchain.c +++ b/arch/arm64/kernel/perf_callchain.c | |||
@@ -154,12 +154,7 @@ void perf_callchain_kernel(struct perf_callchain_entry_ctx *entry, | |||
154 | return; | 154 | return; |
155 | } | 155 | } |
156 | 156 | ||
157 | frame.fp = regs->regs[29]; | 157 | start_backtrace(&frame, regs->regs[29], regs->pc); |
158 | frame.pc = regs->pc; | ||
159 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
160 | frame.graph = 0; | ||
161 | #endif | ||
162 | |||
163 | walk_stackframe(current, &frame, callchain_trace, entry); | 158 | walk_stackframe(current, &frame, callchain_trace, entry); |
164 | } | 159 | } |
165 | 160 | ||
diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c index 6a869d9f304f..f674f28df663 100644 --- a/arch/arm64/kernel/process.c +++ b/arch/arm64/kernel/process.c | |||
@@ -398,7 +398,7 @@ int copy_thread(unsigned long clone_flags, unsigned long stack_start, | |||
398 | childregs->pstate |= PSR_UAO_BIT; | 398 | childregs->pstate |= PSR_UAO_BIT; |
399 | 399 | ||
400 | if (arm64_get_ssbd_state() == ARM64_SSBD_FORCE_DISABLE) | 400 | if (arm64_get_ssbd_state() == ARM64_SSBD_FORCE_DISABLE) |
401 | childregs->pstate |= PSR_SSBS_BIT; | 401 | set_ssbs_bit(childregs); |
402 | 402 | ||
403 | if (system_uses_irq_prio_masking()) | 403 | if (system_uses_irq_prio_masking()) |
404 | childregs->pmr_save = GIC_PRIO_IRQON; | 404 | childregs->pmr_save = GIC_PRIO_IRQON; |
@@ -443,6 +443,32 @@ void uao_thread_switch(struct task_struct *next) | |||
443 | } | 443 | } |
444 | 444 | ||
445 | /* | 445 | /* |
446 | * Force SSBS state on context-switch, since it may be lost after migrating | ||
447 | * from a CPU which treats the bit as RES0 in a heterogeneous system. | ||
448 | */ | ||
449 | static void ssbs_thread_switch(struct task_struct *next) | ||
450 | { | ||
451 | struct pt_regs *regs = task_pt_regs(next); | ||
452 | |||
453 | /* | ||
454 | * Nothing to do for kernel threads, but 'regs' may be junk | ||
455 | * (e.g. idle task) so check the flags and bail early. | ||
456 | */ | ||
457 | if (unlikely(next->flags & PF_KTHREAD)) | ||
458 | return; | ||
459 | |||
460 | /* If the mitigation is enabled, then we leave SSBS clear. */ | ||
461 | if ((arm64_get_ssbd_state() == ARM64_SSBD_FORCE_ENABLE) || | ||
462 | test_tsk_thread_flag(next, TIF_SSBD)) | ||
463 | return; | ||
464 | |||
465 | if (compat_user_mode(regs)) | ||
466 | set_compat_ssbs_bit(regs); | ||
467 | else if (user_mode(regs)) | ||
468 | set_ssbs_bit(regs); | ||
469 | } | ||
470 | |||
471 | /* | ||
446 | * We store our current task in sp_el0, which is clobbered by userspace. Keep a | 472 | * We store our current task in sp_el0, which is clobbered by userspace. Keep a |
447 | * shadow copy so that we can restore this upon entry from userspace. | 473 | * shadow copy so that we can restore this upon entry from userspace. |
448 | * | 474 | * |
@@ -471,6 +497,7 @@ __notrace_funcgraph struct task_struct *__switch_to(struct task_struct *prev, | |||
471 | entry_task_switch(next); | 497 | entry_task_switch(next); |
472 | uao_thread_switch(next); | 498 | uao_thread_switch(next); |
473 | ptrauth_thread_switch(next); | 499 | ptrauth_thread_switch(next); |
500 | ssbs_thread_switch(next); | ||
474 | 501 | ||
475 | /* | 502 | /* |
476 | * Complete any pending TLB or cache maintenance on this CPU in case | 503 | * Complete any pending TLB or cache maintenance on this CPU in case |
@@ -498,11 +525,8 @@ unsigned long get_wchan(struct task_struct *p) | |||
498 | if (!stack_page) | 525 | if (!stack_page) |
499 | return 0; | 526 | return 0; |
500 | 527 | ||
501 | frame.fp = thread_saved_fp(p); | 528 | start_backtrace(&frame, thread_saved_fp(p), thread_saved_pc(p)); |
502 | frame.pc = thread_saved_pc(p); | 529 | |
503 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
504 | frame.graph = 0; | ||
505 | #endif | ||
506 | do { | 530 | do { |
507 | if (unwind_frame(p, &frame)) | 531 | if (unwind_frame(p, &frame)) |
508 | goto out; | 532 | goto out; |
diff --git a/arch/arm64/kernel/return_address.c b/arch/arm64/kernel/return_address.c index b21cba90f82d..c4ae647d2306 100644 --- a/arch/arm64/kernel/return_address.c +++ b/arch/arm64/kernel/return_address.c | |||
@@ -38,12 +38,9 @@ void *return_address(unsigned int level) | |||
38 | data.level = level + 2; | 38 | data.level = level + 2; |
39 | data.addr = NULL; | 39 | data.addr = NULL; |
40 | 40 | ||
41 | frame.fp = (unsigned long)__builtin_frame_address(0); | 41 | start_backtrace(&frame, |
42 | frame.pc = (unsigned long)return_address; /* dummy */ | 42 | (unsigned long)__builtin_frame_address(0), |
43 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | 43 | (unsigned long)return_address); |
44 | frame.graph = 0; | ||
45 | #endif | ||
46 | |||
47 | walk_stackframe(current, &frame, save_return_addr, &data); | 44 | walk_stackframe(current, &frame, save_return_addr, &data); |
48 | 45 | ||
49 | if (!data.level) | 46 | if (!data.level) |
diff --git a/arch/arm64/kernel/stacktrace.c b/arch/arm64/kernel/stacktrace.c index 62d395151abe..2b160ae594eb 100644 --- a/arch/arm64/kernel/stacktrace.c +++ b/arch/arm64/kernel/stacktrace.c | |||
@@ -29,9 +29,18 @@ | |||
29 | * ldp x29, x30, [sp] | 29 | * ldp x29, x30, [sp] |
30 | * add sp, sp, #0x10 | 30 | * add sp, sp, #0x10 |
31 | */ | 31 | */ |
32 | |||
33 | /* | ||
34 | * Unwind from one frame record (A) to the next frame record (B). | ||
35 | * | ||
36 | * We terminate early if the location of B indicates a malformed chain of frame | ||
37 | * records (e.g. a cycle), determined based on the location and fp value of A | ||
38 | * and the location (but not the fp value) of B. | ||
39 | */ | ||
32 | int notrace unwind_frame(struct task_struct *tsk, struct stackframe *frame) | 40 | int notrace unwind_frame(struct task_struct *tsk, struct stackframe *frame) |
33 | { | 41 | { |
34 | unsigned long fp = frame->fp; | 42 | unsigned long fp = frame->fp; |
43 | struct stack_info info; | ||
35 | 44 | ||
36 | if (fp & 0xf) | 45 | if (fp & 0xf) |
37 | return -EINVAL; | 46 | return -EINVAL; |
@@ -39,11 +48,40 @@ int notrace unwind_frame(struct task_struct *tsk, struct stackframe *frame) | |||
39 | if (!tsk) | 48 | if (!tsk) |
40 | tsk = current; | 49 | tsk = current; |
41 | 50 | ||
42 | if (!on_accessible_stack(tsk, fp, NULL)) | 51 | if (!on_accessible_stack(tsk, fp, &info)) |
52 | return -EINVAL; | ||
53 | |||
54 | if (test_bit(info.type, frame->stacks_done)) | ||
43 | return -EINVAL; | 55 | return -EINVAL; |
44 | 56 | ||
57 | /* | ||
58 | * As stacks grow downward, any valid record on the same stack must be | ||
59 | * at a strictly higher address than the prior record. | ||
60 | * | ||
61 | * Stacks can nest in several valid orders, e.g. | ||
62 | * | ||
63 | * TASK -> IRQ -> OVERFLOW -> SDEI_NORMAL | ||
64 | * TASK -> SDEI_NORMAL -> SDEI_CRITICAL -> OVERFLOW | ||
65 | * | ||
66 | * ... but the nesting itself is strict. Once we transition from one | ||
67 | * stack to another, it's never valid to unwind back to that first | ||
68 | * stack. | ||
69 | */ | ||
70 | if (info.type == frame->prev_type) { | ||
71 | if (fp <= frame->prev_fp) | ||
72 | return -EINVAL; | ||
73 | } else { | ||
74 | set_bit(frame->prev_type, frame->stacks_done); | ||
75 | } | ||
76 | |||
77 | /* | ||
78 | * Record this frame record's values and location. The prev_fp and | ||
79 | * prev_type are only meaningful to the next unwind_frame() invocation. | ||
80 | */ | ||
45 | frame->fp = READ_ONCE_NOCHECK(*(unsigned long *)(fp)); | 81 | frame->fp = READ_ONCE_NOCHECK(*(unsigned long *)(fp)); |
46 | frame->pc = READ_ONCE_NOCHECK(*(unsigned long *)(fp + 8)); | 82 | frame->pc = READ_ONCE_NOCHECK(*(unsigned long *)(fp + 8)); |
83 | frame->prev_fp = fp; | ||
84 | frame->prev_type = info.type; | ||
47 | 85 | ||
48 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | 86 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER |
49 | if (tsk->ret_stack && | 87 | if (tsk->ret_stack && |
@@ -122,12 +160,7 @@ void save_stack_trace_regs(struct pt_regs *regs, struct stack_trace *trace) | |||
122 | data.skip = trace->skip; | 160 | data.skip = trace->skip; |
123 | data.no_sched_functions = 0; | 161 | data.no_sched_functions = 0; |
124 | 162 | ||
125 | frame.fp = regs->regs[29]; | 163 | start_backtrace(&frame, regs->regs[29], regs->pc); |
126 | frame.pc = regs->pc; | ||
127 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
128 | frame.graph = 0; | ||
129 | #endif | ||
130 | |||
131 | walk_stackframe(current, &frame, save_trace, &data); | 164 | walk_stackframe(current, &frame, save_trace, &data); |
132 | } | 165 | } |
133 | EXPORT_SYMBOL_GPL(save_stack_trace_regs); | 166 | EXPORT_SYMBOL_GPL(save_stack_trace_regs); |
@@ -146,17 +179,15 @@ static noinline void __save_stack_trace(struct task_struct *tsk, | |||
146 | data.no_sched_functions = nosched; | 179 | data.no_sched_functions = nosched; |
147 | 180 | ||
148 | if (tsk != current) { | 181 | if (tsk != current) { |
149 | frame.fp = thread_saved_fp(tsk); | 182 | start_backtrace(&frame, thread_saved_fp(tsk), |
150 | frame.pc = thread_saved_pc(tsk); | 183 | thread_saved_pc(tsk)); |
151 | } else { | 184 | } else { |
152 | /* We don't want this function nor the caller */ | 185 | /* We don't want this function nor the caller */ |
153 | data.skip += 2; | 186 | data.skip += 2; |
154 | frame.fp = (unsigned long)__builtin_frame_address(0); | 187 | start_backtrace(&frame, |
155 | frame.pc = (unsigned long)__save_stack_trace; | 188 | (unsigned long)__builtin_frame_address(0), |
189 | (unsigned long)__save_stack_trace); | ||
156 | } | 190 | } |
157 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
158 | frame.graph = 0; | ||
159 | #endif | ||
160 | 191 | ||
161 | walk_stackframe(tsk, &frame, save_trace, &data); | 192 | walk_stackframe(tsk, &frame, save_trace, &data); |
162 | 193 | ||
diff --git a/arch/arm64/kernel/time.c b/arch/arm64/kernel/time.c index 9f25aedeac9d..0b2946414dc9 100644 --- a/arch/arm64/kernel/time.c +++ b/arch/arm64/kernel/time.c | |||
@@ -38,11 +38,8 @@ unsigned long profile_pc(struct pt_regs *regs) | |||
38 | if (!in_lock_functions(regs->pc)) | 38 | if (!in_lock_functions(regs->pc)) |
39 | return regs->pc; | 39 | return regs->pc; |
40 | 40 | ||
41 | frame.fp = regs->regs[29]; | 41 | start_backtrace(&frame, regs->regs[29], regs->pc); |
42 | frame.pc = regs->pc; | 42 | |
43 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
44 | frame.graph = 0; | ||
45 | #endif | ||
46 | do { | 43 | do { |
47 | int ret = unwind_frame(NULL, &frame); | 44 | int ret = unwind_frame(NULL, &frame); |
48 | if (ret < 0) | 45 | if (ret < 0) |
diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c index 8c03456dade6..d3313797cca9 100644 --- a/arch/arm64/kernel/traps.c +++ b/arch/arm64/kernel/traps.c | |||
@@ -100,18 +100,17 @@ void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk) | |||
100 | return; | 100 | return; |
101 | 101 | ||
102 | if (tsk == current) { | 102 | if (tsk == current) { |
103 | frame.fp = (unsigned long)__builtin_frame_address(0); | 103 | start_backtrace(&frame, |
104 | frame.pc = (unsigned long)dump_backtrace; | 104 | (unsigned long)__builtin_frame_address(0), |
105 | (unsigned long)dump_backtrace); | ||
105 | } else { | 106 | } else { |
106 | /* | 107 | /* |
107 | * task blocked in __switch_to | 108 | * task blocked in __switch_to |
108 | */ | 109 | */ |
109 | frame.fp = thread_saved_fp(tsk); | 110 | start_backtrace(&frame, |
110 | frame.pc = thread_saved_pc(tsk); | 111 | thread_saved_fp(tsk), |
112 | thread_saved_pc(tsk)); | ||
111 | } | 113 | } |
112 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
113 | frame.graph = 0; | ||
114 | #endif | ||
115 | 114 | ||
116 | printk("Call trace:\n"); | 115 | printk("Call trace:\n"); |
117 | do { | 116 | do { |
diff --git a/arch/arm64/kernel/vdso/Makefile b/arch/arm64/kernel/vdso/Makefile index 4ab863045188..dd2514bb1511 100644 --- a/arch/arm64/kernel/vdso/Makefile +++ b/arch/arm64/kernel/vdso/Makefile | |||
@@ -32,10 +32,10 @@ UBSAN_SANITIZE := n | |||
32 | OBJECT_FILES_NON_STANDARD := y | 32 | OBJECT_FILES_NON_STANDARD := y |
33 | KCOV_INSTRUMENT := n | 33 | KCOV_INSTRUMENT := n |
34 | 34 | ||
35 | ifeq ($(c-gettimeofday-y),) | ||
36 | CFLAGS_vgettimeofday.o = -O2 -mcmodel=tiny | 35 | CFLAGS_vgettimeofday.o = -O2 -mcmodel=tiny |
37 | else | 36 | |
38 | CFLAGS_vgettimeofday.o = -O2 -mcmodel=tiny -include $(c-gettimeofday-y) | 37 | ifneq ($(c-gettimeofday-y),) |
38 | CFLAGS_vgettimeofday.o += -include $(c-gettimeofday-y) | ||
39 | endif | 39 | endif |
40 | 40 | ||
41 | # Clang versions less than 8 do not support -mcmodel=tiny | 41 | # Clang versions less than 8 do not support -mcmodel=tiny |
@@ -57,8 +57,7 @@ $(obj)/vdso.o : $(obj)/vdso.so | |||
57 | 57 | ||
58 | # Link rule for the .so file, .lds has to be first | 58 | # Link rule for the .so file, .lds has to be first |
59 | $(obj)/vdso.so.dbg: $(obj)/vdso.lds $(obj-vdso) FORCE | 59 | $(obj)/vdso.so.dbg: $(obj)/vdso.lds $(obj-vdso) FORCE |
60 | $(call if_changed,ld) | 60 | $(call if_changed,vdsold_and_vdso_check) |
61 | $(call if_changed,vdso_check) | ||
62 | 61 | ||
63 | # Strip rule for the .so file | 62 | # Strip rule for the .so file |
64 | $(obj)/%.so: OBJCOPYFLAGS := -S | 63 | $(obj)/%.so: OBJCOPYFLAGS := -S |
@@ -74,8 +73,8 @@ include/generated/vdso-offsets.h: $(obj)/vdso.so.dbg FORCE | |||
74 | $(call if_changed,vdsosym) | 73 | $(call if_changed,vdsosym) |
75 | 74 | ||
76 | # Actual build commands | 75 | # Actual build commands |
77 | quiet_cmd_vdsocc = VDSOCC $@ | 76 | quiet_cmd_vdsold_and_vdso_check = LD $@ |
78 | cmd_vdsocc = $(CC) $(a_flags) $(c_flags) -c -o $@ $< | 77 | cmd_vdsold_and_vdso_check = $(cmd_ld); $(cmd_vdso_check) |
79 | 78 | ||
80 | # Install commands for the unstripped file | 79 | # Install commands for the unstripped file |
81 | quiet_cmd_vdso_install = INSTALL $@ | 80 | quiet_cmd_vdso_install = INSTALL $@ |
diff --git a/arch/arm64/kernel/vdso32/Makefile b/arch/arm64/kernel/vdso32/Makefile index 60a4c6239712..1fba0776ed40 100644 --- a/arch/arm64/kernel/vdso32/Makefile +++ b/arch/arm64/kernel/vdso32/Makefile | |||
@@ -144,8 +144,7 @@ $(obj)/vdso.so.dbg: $(obj)/vdso.so.raw $(obj)/$(munge) FORCE | |||
144 | 144 | ||
145 | # Link rule for the .so file, .lds has to be first | 145 | # Link rule for the .so file, .lds has to be first |
146 | $(obj)/vdso.so.raw: $(src)/vdso.lds $(obj-vdso) FORCE | 146 | $(obj)/vdso.so.raw: $(src)/vdso.lds $(obj-vdso) FORCE |
147 | $(call if_changed,vdsold) | 147 | $(call if_changed,vdsold_and_vdso_check) |
148 | $(call if_changed,vdso_check) | ||
149 | 148 | ||
150 | # Compilation rules for the vDSO sources | 149 | # Compilation rules for the vDSO sources |
151 | $(c-obj-vdso): %.o: %.c FORCE | 150 | $(c-obj-vdso): %.o: %.c FORCE |
@@ -156,14 +155,17 @@ $(asm-obj-vdso): %.o: %.S FORCE | |||
156 | $(call if_changed_dep,vdsoas) | 155 | $(call if_changed_dep,vdsoas) |
157 | 156 | ||
158 | # Actual build commands | 157 | # Actual build commands |
159 | quiet_cmd_vdsold = VDSOL $@ | 158 | quiet_cmd_vdsold_and_vdso_check = LD32 $@ |
159 | cmd_vdsold_and_vdso_check = $(cmd_vdsold); $(cmd_vdso_check) | ||
160 | |||
161 | quiet_cmd_vdsold = LD32 $@ | ||
160 | cmd_vdsold = $(COMPATCC) -Wp,-MD,$(depfile) $(VDSO_LDFLAGS) \ | 162 | cmd_vdsold = $(COMPATCC) -Wp,-MD,$(depfile) $(VDSO_LDFLAGS) \ |
161 | -Wl,-T $(filter %.lds,$^) $(filter %.o,$^) -o $@ | 163 | -Wl,-T $(filter %.lds,$^) $(filter %.o,$^) -o $@ |
162 | quiet_cmd_vdsocc = VDSOC $@ | 164 | quiet_cmd_vdsocc = CC32 $@ |
163 | cmd_vdsocc = $(COMPATCC) -Wp,-MD,$(depfile) $(VDSO_CFLAGS) -c -o $@ $< | 165 | cmd_vdsocc = $(COMPATCC) -Wp,-MD,$(depfile) $(VDSO_CFLAGS) -c -o $@ $< |
164 | quiet_cmd_vdsocc_gettimeofday = VDSOC_GTD $@ | 166 | quiet_cmd_vdsocc_gettimeofday = CC32 $@ |
165 | cmd_vdsocc_gettimeofday = $(COMPATCC) -Wp,-MD,$(depfile) $(VDSO_CFLAGS) $(VDSO_CFLAGS_gettimeofday_o) -c -o $@ $< | 167 | cmd_vdsocc_gettimeofday = $(COMPATCC) -Wp,-MD,$(depfile) $(VDSO_CFLAGS) $(VDSO_CFLAGS_gettimeofday_o) -c -o $@ $< |
166 | quiet_cmd_vdsoas = VDSOA $@ | 168 | quiet_cmd_vdsoas = AS32 $@ |
167 | cmd_vdsoas = $(COMPATCC) -Wp,-MD,$(depfile) $(VDSO_AFLAGS) -c -o $@ $< | 169 | cmd_vdsoas = $(COMPATCC) -Wp,-MD,$(depfile) $(VDSO_AFLAGS) -c -o $@ $< |
168 | 170 | ||
169 | quiet_cmd_vdsomunge = MUNGE $@ | 171 | quiet_cmd_vdsomunge = MUNGE $@ |
diff --git a/arch/csky/include/uapi/asm/byteorder.h b/arch/csky/include/uapi/asm/byteorder.h index b079ec715cdf..d150cd664873 100644 --- a/arch/csky/include/uapi/asm/byteorder.h +++ b/arch/csky/include/uapi/asm/byteorder.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
2 | // Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd. | 2 | // Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd. |
3 | 3 | ||
4 | #ifndef __ASM_CSKY_BYTEORDER_H | 4 | #ifndef __ASM_CSKY_BYTEORDER_H |
diff --git a/arch/csky/include/uapi/asm/cachectl.h b/arch/csky/include/uapi/asm/cachectl.h index ddf2f39aa925..ed7fad1ea20d 100644 --- a/arch/csky/include/uapi/asm/cachectl.h +++ b/arch/csky/include/uapi/asm/cachectl.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
2 | 2 | ||
3 | #ifndef __ASM_CSKY_CACHECTL_H | 3 | #ifndef __ASM_CSKY_CACHECTL_H |
4 | #define __ASM_CSKY_CACHECTL_H | 4 | #define __ASM_CSKY_CACHECTL_H |
diff --git a/arch/csky/include/uapi/asm/perf_regs.h b/arch/csky/include/uapi/asm/perf_regs.h index ee323d818592..49d4e147a559 100644 --- a/arch/csky/include/uapi/asm/perf_regs.h +++ b/arch/csky/include/uapi/asm/perf_regs.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
2 | // Copyright (C) 2019 Hangzhou C-SKY Microsystems co.,ltd. | 2 | // Copyright (C) 2019 Hangzhou C-SKY Microsystems co.,ltd. |
3 | 3 | ||
4 | #ifndef _ASM_CSKY_PERF_REGS_H | 4 | #ifndef _ASM_CSKY_PERF_REGS_H |
diff --git a/arch/csky/include/uapi/asm/ptrace.h b/arch/csky/include/uapi/asm/ptrace.h index 4e248d5b86ef..66b2268e324e 100644 --- a/arch/csky/include/uapi/asm/ptrace.h +++ b/arch/csky/include/uapi/asm/ptrace.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
2 | // Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd. | 2 | // Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd. |
3 | 3 | ||
4 | #ifndef _CSKY_PTRACE_H | 4 | #ifndef _CSKY_PTRACE_H |
diff --git a/arch/csky/include/uapi/asm/sigcontext.h b/arch/csky/include/uapi/asm/sigcontext.h index e81e7ff11e36..670c020f2cb8 100644 --- a/arch/csky/include/uapi/asm/sigcontext.h +++ b/arch/csky/include/uapi/asm/sigcontext.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
2 | // Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd. | 2 | // Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd. |
3 | 3 | ||
4 | #ifndef __ASM_CSKY_SIGCONTEXT_H | 4 | #ifndef __ASM_CSKY_SIGCONTEXT_H |
diff --git a/arch/csky/include/uapi/asm/unistd.h b/arch/csky/include/uapi/asm/unistd.h index ec60e49cea66..211c983c7282 100644 --- a/arch/csky/include/uapi/asm/unistd.h +++ b/arch/csky/include/uapi/asm/unistd.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
2 | // Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd. | 2 | // Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd. |
3 | 3 | ||
4 | #define __ARCH_WANT_SYS_CLONE | 4 | #define __ARCH_WANT_SYS_CLONE |
diff --git a/arch/nds32/include/uapi/asm/auxvec.h b/arch/nds32/include/uapi/asm/auxvec.h index b5d58ea8decb..bc0b92ab8c15 100644 --- a/arch/nds32/include/uapi/asm/auxvec.h +++ b/arch/nds32/include/uapi/asm/auxvec.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
2 | // Copyright (C) 2005-2017 Andes Technology Corporation | 2 | // Copyright (C) 2005-2017 Andes Technology Corporation |
3 | 3 | ||
4 | #ifndef __ASM_AUXVEC_H | 4 | #ifndef __ASM_AUXVEC_H |
diff --git a/arch/nds32/include/uapi/asm/byteorder.h b/arch/nds32/include/uapi/asm/byteorder.h index 511e653c709d..c264ef12c49c 100644 --- a/arch/nds32/include/uapi/asm/byteorder.h +++ b/arch/nds32/include/uapi/asm/byteorder.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
2 | // Copyright (C) 2005-2017 Andes Technology Corporation | 2 | // Copyright (C) 2005-2017 Andes Technology Corporation |
3 | 3 | ||
4 | #ifndef __NDS32_BYTEORDER_H__ | 4 | #ifndef __NDS32_BYTEORDER_H__ |
diff --git a/arch/nds32/include/uapi/asm/cachectl.h b/arch/nds32/include/uapi/asm/cachectl.h index 73793662815c..31b9b439d819 100644 --- a/arch/nds32/include/uapi/asm/cachectl.h +++ b/arch/nds32/include/uapi/asm/cachectl.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
2 | // Copyright (C) 1994, 1995, 1996 by Ralf Baechle | 2 | // Copyright (C) 1994, 1995, 1996 by Ralf Baechle |
3 | // Copyright (C) 2005-2017 Andes Technology Corporation | 3 | // Copyright (C) 2005-2017 Andes Technology Corporation |
4 | #ifndef _ASM_CACHECTL | 4 | #ifndef _ASM_CACHECTL |
diff --git a/arch/nds32/include/uapi/asm/fp_udfiex_crtl.h b/arch/nds32/include/uapi/asm/fp_udfiex_crtl.h index d54a5d6c6538..f17396db16ec 100644 --- a/arch/nds32/include/uapi/asm/fp_udfiex_crtl.h +++ b/arch/nds32/include/uapi/asm/fp_udfiex_crtl.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
2 | /* Copyright (C) 2005-2019 Andes Technology Corporation */ | 2 | /* Copyright (C) 2005-2019 Andes Technology Corporation */ |
3 | #ifndef _FP_UDF_IEX_CRTL_H | 3 | #ifndef _FP_UDF_IEX_CRTL_H |
4 | #define _FP_UDF_IEX_CRTL_H | 4 | #define _FP_UDF_IEX_CRTL_H |
diff --git a/arch/nds32/include/uapi/asm/param.h b/arch/nds32/include/uapi/asm/param.h index 2977534a6bd3..48d00328d328 100644 --- a/arch/nds32/include/uapi/asm/param.h +++ b/arch/nds32/include/uapi/asm/param.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
2 | // Copyright (C) 2005-2017 Andes Technology Corporation | 2 | // Copyright (C) 2005-2017 Andes Technology Corporation |
3 | 3 | ||
4 | #ifndef __ASM_NDS32_PARAM_H | 4 | #ifndef __ASM_NDS32_PARAM_H |
diff --git a/arch/nds32/include/uapi/asm/ptrace.h b/arch/nds32/include/uapi/asm/ptrace.h index 1a6e01c00e6f..d76217c7c010 100644 --- a/arch/nds32/include/uapi/asm/ptrace.h +++ b/arch/nds32/include/uapi/asm/ptrace.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
2 | // Copyright (C) 2005-2017 Andes Technology Corporation | 2 | // Copyright (C) 2005-2017 Andes Technology Corporation |
3 | 3 | ||
4 | #ifndef __UAPI_ASM_NDS32_PTRACE_H | 4 | #ifndef __UAPI_ASM_NDS32_PTRACE_H |
diff --git a/arch/nds32/include/uapi/asm/sigcontext.h b/arch/nds32/include/uapi/asm/sigcontext.h index dc89af7ddcc3..6c1e6648878f 100644 --- a/arch/nds32/include/uapi/asm/sigcontext.h +++ b/arch/nds32/include/uapi/asm/sigcontext.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
2 | // Copyright (C) 2005-2017 Andes Technology Corporation | 2 | // Copyright (C) 2005-2017 Andes Technology Corporation |
3 | 3 | ||
4 | #ifndef _ASMNDS32_SIGCONTEXT_H | 4 | #ifndef _ASMNDS32_SIGCONTEXT_H |
diff --git a/arch/nds32/include/uapi/asm/unistd.h b/arch/nds32/include/uapi/asm/unistd.h index a0b2f7b9c0f2..410795e280fe 100644 --- a/arch/nds32/include/uapi/asm/unistd.h +++ b/arch/nds32/include/uapi/asm/unistd.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
2 | // Copyright (C) 2005-2017 Andes Technology Corporation | 2 | // Copyright (C) 2005-2017 Andes Technology Corporation |
3 | 3 | ||
4 | #define __ARCH_WANT_STAT64 | 4 | #define __ARCH_WANT_STAT64 |
diff --git a/arch/parisc/include/asm/kprobes.h b/arch/parisc/include/asm/kprobes.h index e09cf2deeafe..904034da4974 100644 --- a/arch/parisc/include/asm/kprobes.h +++ b/arch/parisc/include/asm/kprobes.h | |||
@@ -50,6 +50,10 @@ struct kprobe_ctlblk { | |||
50 | 50 | ||
51 | int __kprobes parisc_kprobe_break_handler(struct pt_regs *regs); | 51 | int __kprobes parisc_kprobe_break_handler(struct pt_regs *regs); |
52 | int __kprobes parisc_kprobe_ss_handler(struct pt_regs *regs); | 52 | int __kprobes parisc_kprobe_ss_handler(struct pt_regs *regs); |
53 | static inline int kprobe_fault_handler(struct pt_regs *regs, int trapnr) | ||
54 | { | ||
55 | return 0; | ||
56 | } | ||
53 | 57 | ||
54 | #endif /* CONFIG_KPROBES */ | 58 | #endif /* CONFIG_KPROBES */ |
55 | #endif /* _PARISC_KPROBES_H */ | 59 | #endif /* _PARISC_KPROBES_H */ |
diff --git a/arch/parisc/kernel/pacache.S b/arch/parisc/kernel/pacache.S index ba67893a1d72..df46b0e5a915 100644 --- a/arch/parisc/kernel/pacache.S +++ b/arch/parisc/kernel/pacache.S | |||
@@ -63,7 +63,7 @@ ENTRY_CFI(flush_tlb_all_local) | |||
63 | 63 | ||
64 | /* Flush Instruction Tlb */ | 64 | /* Flush Instruction Tlb */ |
65 | 65 | ||
66 | LDREG ITLB_SID_BASE(%r1), %r20 | 66 | 88: LDREG ITLB_SID_BASE(%r1), %r20 |
67 | LDREG ITLB_SID_STRIDE(%r1), %r21 | 67 | LDREG ITLB_SID_STRIDE(%r1), %r21 |
68 | LDREG ITLB_SID_COUNT(%r1), %r22 | 68 | LDREG ITLB_SID_COUNT(%r1), %r22 |
69 | LDREG ITLB_OFF_BASE(%r1), %arg0 | 69 | LDREG ITLB_OFF_BASE(%r1), %arg0 |
@@ -103,6 +103,7 @@ fitonemiddle: /* Loop if LOOP = 1 */ | |||
103 | add %r21, %r20, %r20 /* increment space */ | 103 | add %r21, %r20, %r20 /* increment space */ |
104 | 104 | ||
105 | fitdone: | 105 | fitdone: |
106 | ALTERNATIVE(88b, fitdone, ALT_COND_NO_SPLIT_TLB, INSN_NOP) | ||
106 | 107 | ||
107 | /* Flush Data Tlb */ | 108 | /* Flush Data Tlb */ |
108 | 109 | ||
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index d8dcd8820369..77f6ebf97113 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig | |||
@@ -121,6 +121,7 @@ config PPC | |||
121 | select ARCH_32BIT_OFF_T if PPC32 | 121 | select ARCH_32BIT_OFF_T if PPC32 |
122 | select ARCH_HAS_DEBUG_VIRTUAL | 122 | select ARCH_HAS_DEBUG_VIRTUAL |
123 | select ARCH_HAS_DEVMEM_IS_ALLOWED | 123 | select ARCH_HAS_DEVMEM_IS_ALLOWED |
124 | select ARCH_HAS_DMA_MMAP_PGPROT | ||
124 | select ARCH_HAS_ELF_RANDOMIZE | 125 | select ARCH_HAS_ELF_RANDOMIZE |
125 | select ARCH_HAS_FORTIFY_SOURCE | 126 | select ARCH_HAS_FORTIFY_SOURCE |
126 | select ARCH_HAS_GCOV_PROFILE_ALL | 127 | select ARCH_HAS_GCOV_PROFILE_ALL |
diff --git a/arch/powerpc/include/asm/hvcall.h b/arch/powerpc/include/asm/hvcall.h index 463c63a9fcf1..11112023e327 100644 --- a/arch/powerpc/include/asm/hvcall.h +++ b/arch/powerpc/include/asm/hvcall.h | |||
@@ -302,9 +302,14 @@ | |||
302 | #define H_SCM_UNBIND_MEM 0x3F0 | 302 | #define H_SCM_UNBIND_MEM 0x3F0 |
303 | #define H_SCM_QUERY_BLOCK_MEM_BINDING 0x3F4 | 303 | #define H_SCM_QUERY_BLOCK_MEM_BINDING 0x3F4 |
304 | #define H_SCM_QUERY_LOGICAL_MEM_BINDING 0x3F8 | 304 | #define H_SCM_QUERY_LOGICAL_MEM_BINDING 0x3F8 |
305 | #define H_SCM_MEM_QUERY 0x3FC | 305 | #define H_SCM_UNBIND_ALL 0x3FC |
306 | #define H_SCM_BLOCK_CLEAR 0x400 | 306 | #define H_SCM_HEALTH 0x400 |
307 | #define MAX_HCALL_OPCODE H_SCM_BLOCK_CLEAR | 307 | #define H_SCM_PERFORMANCE_STATS 0x418 |
308 | #define MAX_HCALL_OPCODE H_SCM_PERFORMANCE_STATS | ||
309 | |||
310 | /* Scope args for H_SCM_UNBIND_ALL */ | ||
311 | #define H_UNBIND_SCOPE_ALL (0x1) | ||
312 | #define H_UNBIND_SCOPE_DRC (0x2) | ||
308 | 313 | ||
309 | /* H_VIOCTL functions */ | 314 | /* H_VIOCTL functions */ |
310 | #define H_GET_VIOA_DUMP_SIZE 0x01 | 315 | #define H_GET_VIOA_DUMP_SIZE 0x01 |
diff --git a/arch/powerpc/include/asm/pmc.h b/arch/powerpc/include/asm/pmc.h index dc9a1ca70edf..c6bbe9778d3c 100644 --- a/arch/powerpc/include/asm/pmc.h +++ b/arch/powerpc/include/asm/pmc.h | |||
@@ -27,11 +27,10 @@ static inline void ppc_set_pmu_inuse(int inuse) | |||
27 | #ifdef CONFIG_PPC_PSERIES | 27 | #ifdef CONFIG_PPC_PSERIES |
28 | get_lppaca()->pmcregs_in_use = inuse; | 28 | get_lppaca()->pmcregs_in_use = inuse; |
29 | #endif | 29 | #endif |
30 | } else { | 30 | } |
31 | #ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE | 31 | #ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE |
32 | get_paca()->pmcregs_in_use = inuse; | 32 | get_paca()->pmcregs_in_use = inuse; |
33 | #endif | 33 | #endif |
34 | } | ||
35 | #endif | 34 | #endif |
36 | } | 35 | } |
37 | 36 | ||
diff --git a/arch/powerpc/include/uapi/asm/bpf_perf_event.h b/arch/powerpc/include/uapi/asm/bpf_perf_event.h index b551b741653d..5e1e648aeec4 100644 --- a/arch/powerpc/include/uapi/asm/bpf_perf_event.h +++ b/arch/powerpc/include/uapi/asm/bpf_perf_event.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
2 | #ifndef _UAPI__ASM_BPF_PERF_EVENT_H__ | 2 | #ifndef _UAPI__ASM_BPF_PERF_EVENT_H__ |
3 | #define _UAPI__ASM_BPF_PERF_EVENT_H__ | 3 | #define _UAPI__ASM_BPF_PERF_EVENT_H__ |
4 | 4 | ||
diff --git a/arch/powerpc/include/uapi/asm/kvm_para.h b/arch/powerpc/include/uapi/asm/kvm_para.h index 01555c6ae0f5..be48c2215fa2 100644 --- a/arch/powerpc/include/uapi/asm/kvm_para.h +++ b/arch/powerpc/include/uapi/asm/kvm_para.h | |||
@@ -31,7 +31,7 @@ | |||
31 | * Struct fields are always 32 or 64 bit aligned, depending on them being 32 | 31 | * Struct fields are always 32 or 64 bit aligned, depending on them being 32 |
32 | * or 64 bit wide respectively. | 32 | * or 64 bit wide respectively. |
33 | * | 33 | * |
34 | * See Documentation/virtual/kvm/ppc-pv.txt | 34 | * See Documentation/virt/kvm/ppc-pv.txt |
35 | */ | 35 | */ |
36 | struct kvm_vcpu_arch_shared { | 36 | struct kvm_vcpu_arch_shared { |
37 | __u64 scratch1; | 37 | __u64 scratch1; |
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile index 56dfa7a2a6f2..ea0c69236789 100644 --- a/arch/powerpc/kernel/Makefile +++ b/arch/powerpc/kernel/Makefile | |||
@@ -49,7 +49,8 @@ obj-y := cputable.o ptrace.o syscalls.o \ | |||
49 | signal.o sysfs.o cacheinfo.o time.o \ | 49 | signal.o sysfs.o cacheinfo.o time.o \ |
50 | prom.o traps.o setup-common.o \ | 50 | prom.o traps.o setup-common.o \ |
51 | udbg.o misc.o io.o misc_$(BITS).o \ | 51 | udbg.o misc.o io.o misc_$(BITS).o \ |
52 | of_platform.o prom_parse.o | 52 | of_platform.o prom_parse.o \ |
53 | dma-common.o | ||
53 | obj-$(CONFIG_PPC64) += setup_64.o sys_ppc32.o \ | 54 | obj-$(CONFIG_PPC64) += setup_64.o sys_ppc32.o \ |
54 | signal_64.o ptrace32.o \ | 55 | signal_64.o ptrace32.o \ |
55 | paca.o nvram_64.o firmware.o | 56 | paca.o nvram_64.o firmware.o |
diff --git a/arch/powerpc/kernel/dma-common.c b/arch/powerpc/kernel/dma-common.c new file mode 100644 index 000000000000..dc7ef6b17b69 --- /dev/null +++ b/arch/powerpc/kernel/dma-common.c | |||
@@ -0,0 +1,17 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
2 | /* | ||
3 | * Contains common dma routines for all powerpc platforms. | ||
4 | * | ||
5 | * Copyright (C) 2019 Shawn Anastasio. | ||
6 | */ | ||
7 | |||
8 | #include <linux/mm.h> | ||
9 | #include <linux/dma-noncoherent.h> | ||
10 | |||
11 | pgprot_t arch_dma_mmap_pgprot(struct device *dev, pgprot_t prot, | ||
12 | unsigned long attrs) | ||
13 | { | ||
14 | if (!dev_is_dma_coherent(dev)) | ||
15 | return pgprot_noncached(prot); | ||
16 | return prot; | ||
17 | } | ||
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index eee5bef736c8..6ba3cc2ef8ab 100644 --- a/arch/powerpc/kernel/exceptions-64s.S +++ b/arch/powerpc/kernel/exceptions-64s.S | |||
@@ -1531,7 +1531,7 @@ EXC_COMMON(trap_0b_common, 0xb00, unknown_exception) | |||
1531 | * | 1531 | * |
1532 | * Call convention: | 1532 | * Call convention: |
1533 | * | 1533 | * |
1534 | * syscall register convention is in Documentation/powerpc/syscall64-abi.txt | 1534 | * syscall register convention is in Documentation/powerpc/syscall64-abi.rst |
1535 | * | 1535 | * |
1536 | * For hypercalls, the register convention is as follows: | 1536 | * For hypercalls, the register convention is as follows: |
1537 | * r0 volatile | 1537 | * r0 volatile |
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c index f50b708d6d77..98600b276f76 100644 --- a/arch/powerpc/kernel/signal_32.c +++ b/arch/powerpc/kernel/signal_32.c | |||
@@ -1198,6 +1198,9 @@ SYSCALL_DEFINE0(rt_sigreturn) | |||
1198 | goto bad; | 1198 | goto bad; |
1199 | 1199 | ||
1200 | if (MSR_TM_ACTIVE(msr_hi<<32)) { | 1200 | if (MSR_TM_ACTIVE(msr_hi<<32)) { |
1201 | /* Trying to start TM on non TM system */ | ||
1202 | if (!cpu_has_feature(CPU_FTR_TM)) | ||
1203 | goto bad; | ||
1201 | /* We only recheckpoint on return if we're | 1204 | /* We only recheckpoint on return if we're |
1202 | * transaction. | 1205 | * transaction. |
1203 | */ | 1206 | */ |
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c index 2f80e270c7b0..117515564ec7 100644 --- a/arch/powerpc/kernel/signal_64.c +++ b/arch/powerpc/kernel/signal_64.c | |||
@@ -771,6 +771,11 @@ SYSCALL_DEFINE0(rt_sigreturn) | |||
771 | if (MSR_TM_ACTIVE(msr)) { | 771 | if (MSR_TM_ACTIVE(msr)) { |
772 | /* We recheckpoint on return. */ | 772 | /* We recheckpoint on return. */ |
773 | struct ucontext __user *uc_transact; | 773 | struct ucontext __user *uc_transact; |
774 | |||
775 | /* Trying to start TM on non TM system */ | ||
776 | if (!cpu_has_feature(CPU_FTR_TM)) | ||
777 | goto badframe; | ||
778 | |||
774 | if (__get_user(uc_transact, &uc->uc_link)) | 779 | if (__get_user(uc_transact, &uc->uc_link)) |
775 | goto badframe; | 780 | goto badframe; |
776 | if (restore_tm_sigcontexts(current, &uc->uc_mcontext, | 781 | if (restore_tm_sigcontexts(current, &uc->uc_mcontext, |
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c index ec1804f822af..cde3f5a4b3e4 100644 --- a/arch/powerpc/kvm/book3s_hv.c +++ b/arch/powerpc/kvm/book3s_hv.c | |||
@@ -3569,9 +3569,18 @@ int kvmhv_p9_guest_entry(struct kvm_vcpu *vcpu, u64 time_limit, | |||
3569 | mtspr(SPRN_DEC, vcpu->arch.dec_expires - mftb()); | 3569 | mtspr(SPRN_DEC, vcpu->arch.dec_expires - mftb()); |
3570 | 3570 | ||
3571 | if (kvmhv_on_pseries()) { | 3571 | if (kvmhv_on_pseries()) { |
3572 | /* | ||
3573 | * We need to save and restore the guest visible part of the | ||
3574 | * psscr (i.e. using SPRN_PSSCR_PR) since the hypervisor | ||
3575 | * doesn't do this for us. Note only required if pseries since | ||
3576 | * this is done in kvmhv_load_hv_regs_and_go() below otherwise. | ||
3577 | */ | ||
3578 | unsigned long host_psscr; | ||
3572 | /* call our hypervisor to load up HV regs and go */ | 3579 | /* call our hypervisor to load up HV regs and go */ |
3573 | struct hv_guest_state hvregs; | 3580 | struct hv_guest_state hvregs; |
3574 | 3581 | ||
3582 | host_psscr = mfspr(SPRN_PSSCR_PR); | ||
3583 | mtspr(SPRN_PSSCR_PR, vcpu->arch.psscr); | ||
3575 | kvmhv_save_hv_regs(vcpu, &hvregs); | 3584 | kvmhv_save_hv_regs(vcpu, &hvregs); |
3576 | hvregs.lpcr = lpcr; | 3585 | hvregs.lpcr = lpcr; |
3577 | vcpu->arch.regs.msr = vcpu->arch.shregs.msr; | 3586 | vcpu->arch.regs.msr = vcpu->arch.shregs.msr; |
@@ -3590,6 +3599,8 @@ int kvmhv_p9_guest_entry(struct kvm_vcpu *vcpu, u64 time_limit, | |||
3590 | vcpu->arch.shregs.msr = vcpu->arch.regs.msr; | 3599 | vcpu->arch.shregs.msr = vcpu->arch.regs.msr; |
3591 | vcpu->arch.shregs.dar = mfspr(SPRN_DAR); | 3600 | vcpu->arch.shregs.dar = mfspr(SPRN_DAR); |
3592 | vcpu->arch.shregs.dsisr = mfspr(SPRN_DSISR); | 3601 | vcpu->arch.shregs.dsisr = mfspr(SPRN_DSISR); |
3602 | vcpu->arch.psscr = mfspr(SPRN_PSSCR_PR); | ||
3603 | mtspr(SPRN_PSSCR_PR, host_psscr); | ||
3593 | 3604 | ||
3594 | /* H_CEDE has to be handled now, not later */ | 3605 | /* H_CEDE has to be handled now, not later */ |
3595 | if (trap == BOOK3S_INTERRUPT_SYSCALL && !vcpu->arch.nested && | 3606 | if (trap == BOOK3S_INTERRUPT_SYSCALL && !vcpu->arch.nested && |
@@ -3654,6 +3665,8 @@ int kvmhv_p9_guest_entry(struct kvm_vcpu *vcpu, u64 time_limit, | |||
3654 | vcpu->arch.vpa.dirty = 1; | 3665 | vcpu->arch.vpa.dirty = 1; |
3655 | save_pmu = lp->pmcregs_in_use; | 3666 | save_pmu = lp->pmcregs_in_use; |
3656 | } | 3667 | } |
3668 | /* Must save pmu if this guest is capable of running nested guests */ | ||
3669 | save_pmu |= nesting_enabled(vcpu->kvm); | ||
3657 | 3670 | ||
3658 | kvmhv_save_guest_pmu(vcpu, save_pmu); | 3671 | kvmhv_save_guest_pmu(vcpu, save_pmu); |
3659 | 3672 | ||
diff --git a/arch/powerpc/kvm/book3s_xive.c b/arch/powerpc/kvm/book3s_xive.c index 6ca0d7376a9f..e3ba67095895 100644 --- a/arch/powerpc/kvm/book3s_xive.c +++ b/arch/powerpc/kvm/book3s_xive.c | |||
@@ -1986,10 +1986,8 @@ static int kvmppc_xive_create(struct kvm_device *dev, u32 type) | |||
1986 | 1986 | ||
1987 | xive->single_escalation = xive_native_has_single_escalation(); | 1987 | xive->single_escalation = xive_native_has_single_escalation(); |
1988 | 1988 | ||
1989 | if (ret) { | 1989 | if (ret) |
1990 | kfree(xive); | ||
1991 | return ret; | 1990 | return ret; |
1992 | } | ||
1993 | 1991 | ||
1994 | return 0; | 1992 | return 0; |
1995 | } | 1993 | } |
diff --git a/arch/powerpc/kvm/book3s_xive_native.c b/arch/powerpc/kvm/book3s_xive_native.c index 5596c8ec221a..a998823f68a3 100644 --- a/arch/powerpc/kvm/book3s_xive_native.c +++ b/arch/powerpc/kvm/book3s_xive_native.c | |||
@@ -1090,9 +1090,9 @@ static int kvmppc_xive_native_create(struct kvm_device *dev, u32 type) | |||
1090 | xive->ops = &kvmppc_xive_native_ops; | 1090 | xive->ops = &kvmppc_xive_native_ops; |
1091 | 1091 | ||
1092 | if (ret) | 1092 | if (ret) |
1093 | kfree(xive); | 1093 | return ret; |
1094 | 1094 | ||
1095 | return ret; | 1095 | return 0; |
1096 | } | 1096 | } |
1097 | 1097 | ||
1098 | /* | 1098 | /* |
diff --git a/arch/powerpc/mm/book3s64/hash_utils.c b/arch/powerpc/mm/book3s64/hash_utils.c index 9a5963e07a82..b8ad14bb1170 100644 --- a/arch/powerpc/mm/book3s64/hash_utils.c +++ b/arch/powerpc/mm/book3s64/hash_utils.c | |||
@@ -1899,11 +1899,20 @@ void hash__setup_initial_memory_limit(phys_addr_t first_memblock_base, | |||
1899 | * | 1899 | * |
1900 | * For guests on platforms before POWER9, we clamp the it limit to 1G | 1900 | * For guests on platforms before POWER9, we clamp the it limit to 1G |
1901 | * to avoid some funky things such as RTAS bugs etc... | 1901 | * to avoid some funky things such as RTAS bugs etc... |
1902 | * | ||
1903 | * On POWER9 we limit to 1TB in case the host erroneously told us that | ||
1904 | * the RMA was >1TB. Effective address bits 0:23 are treated as zero | ||
1905 | * (meaning the access is aliased to zero i.e. addr = addr % 1TB) | ||
1906 | * for virtual real mode addressing and so it doesn't make sense to | ||
1907 | * have an area larger than 1TB as it can't be addressed. | ||
1902 | */ | 1908 | */ |
1903 | if (!early_cpu_has_feature(CPU_FTR_HVMODE)) { | 1909 | if (!early_cpu_has_feature(CPU_FTR_HVMODE)) { |
1904 | ppc64_rma_size = first_memblock_size; | 1910 | ppc64_rma_size = first_memblock_size; |
1905 | if (!early_cpu_has_feature(CPU_FTR_ARCH_300)) | 1911 | if (!early_cpu_has_feature(CPU_FTR_ARCH_300)) |
1906 | ppc64_rma_size = min_t(u64, ppc64_rma_size, 0x40000000); | 1912 | ppc64_rma_size = min_t(u64, ppc64_rma_size, 0x40000000); |
1913 | else | ||
1914 | ppc64_rma_size = min_t(u64, ppc64_rma_size, | ||
1915 | 1UL << SID_SHIFT_1T); | ||
1907 | 1916 | ||
1908 | /* Finally limit subsequent allocations */ | 1917 | /* Finally limit subsequent allocations */ |
1909 | memblock_set_current_limit(ppc64_rma_size); | 1918 | memblock_set_current_limit(ppc64_rma_size); |
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c index 9259337d7374..9191a66b3bc5 100644 --- a/arch/powerpc/mm/mem.c +++ b/arch/powerpc/mm/mem.c | |||
@@ -239,7 +239,7 @@ void __init paging_init(void) | |||
239 | 239 | ||
240 | #ifdef CONFIG_ZONE_DMA | 240 | #ifdef CONFIG_ZONE_DMA |
241 | max_zone_pfns[ZONE_DMA] = min(max_low_pfn, | 241 | max_zone_pfns[ZONE_DMA] = min(max_low_pfn, |
242 | ((1UL << ARCH_ZONE_DMA_BITS) - 1) >> PAGE_SHIFT); | 242 | 1UL << (ARCH_ZONE_DMA_BITS - PAGE_SHIFT)); |
243 | #endif | 243 | #endif |
244 | max_zone_pfns[ZONE_NORMAL] = max_low_pfn; | 244 | max_zone_pfns[ZONE_NORMAL] = max_low_pfn; |
245 | #ifdef CONFIG_HIGHMEM | 245 | #ifdef CONFIG_HIGHMEM |
diff --git a/arch/powerpc/platforms/pseries/papr_scm.c b/arch/powerpc/platforms/pseries/papr_scm.c index c8ec670ee924..2c07908359b2 100644 --- a/arch/powerpc/platforms/pseries/papr_scm.c +++ b/arch/powerpc/platforms/pseries/papr_scm.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/sched.h> | 11 | #include <linux/sched.h> |
12 | #include <linux/libnvdimm.h> | 12 | #include <linux/libnvdimm.h> |
13 | #include <linux/platform_device.h> | 13 | #include <linux/platform_device.h> |
14 | #include <linux/delay.h> | ||
14 | 15 | ||
15 | #include <asm/plpar_wrappers.h> | 16 | #include <asm/plpar_wrappers.h> |
16 | 17 | ||
@@ -43,8 +44,9 @@ struct papr_scm_priv { | |||
43 | static int drc_pmem_bind(struct papr_scm_priv *p) | 44 | static int drc_pmem_bind(struct papr_scm_priv *p) |
44 | { | 45 | { |
45 | unsigned long ret[PLPAR_HCALL_BUFSIZE]; | 46 | unsigned long ret[PLPAR_HCALL_BUFSIZE]; |
46 | uint64_t rc, token; | ||
47 | uint64_t saved = 0; | 47 | uint64_t saved = 0; |
48 | uint64_t token; | ||
49 | int64_t rc; | ||
48 | 50 | ||
49 | /* | 51 | /* |
50 | * When the hypervisor cannot map all the requested memory in a single | 52 | * When the hypervisor cannot map all the requested memory in a single |
@@ -64,6 +66,10 @@ static int drc_pmem_bind(struct papr_scm_priv *p) | |||
64 | } while (rc == H_BUSY); | 66 | } while (rc == H_BUSY); |
65 | 67 | ||
66 | if (rc) { | 68 | if (rc) { |
69 | /* H_OVERLAP needs a separate error path */ | ||
70 | if (rc == H_OVERLAP) | ||
71 | return -EBUSY; | ||
72 | |||
67 | dev_err(&p->pdev->dev, "bind err: %lld\n", rc); | 73 | dev_err(&p->pdev->dev, "bind err: %lld\n", rc); |
68 | return -ENXIO; | 74 | return -ENXIO; |
69 | } | 75 | } |
@@ -78,22 +84,36 @@ static int drc_pmem_bind(struct papr_scm_priv *p) | |||
78 | static int drc_pmem_unbind(struct papr_scm_priv *p) | 84 | static int drc_pmem_unbind(struct papr_scm_priv *p) |
79 | { | 85 | { |
80 | unsigned long ret[PLPAR_HCALL_BUFSIZE]; | 86 | unsigned long ret[PLPAR_HCALL_BUFSIZE]; |
81 | uint64_t rc, token; | 87 | uint64_t token = 0; |
88 | int64_t rc; | ||
82 | 89 | ||
83 | token = 0; | 90 | dev_dbg(&p->pdev->dev, "unbind drc %x\n", p->drc_index); |
84 | 91 | ||
85 | /* NB: unbind has the same retry requirements mentioned above */ | 92 | /* NB: unbind has the same retry requirements as drc_pmem_bind() */ |
86 | do { | 93 | do { |
87 | rc = plpar_hcall(H_SCM_UNBIND_MEM, ret, p->drc_index, | 94 | |
88 | p->bound_addr, p->blocks, token); | 95 | /* Unbind of all SCM resources associated with drcIndex */ |
96 | rc = plpar_hcall(H_SCM_UNBIND_ALL, ret, H_UNBIND_SCOPE_DRC, | ||
97 | p->drc_index, token); | ||
89 | token = ret[0]; | 98 | token = ret[0]; |
90 | cond_resched(); | 99 | |
100 | /* Check if we are stalled for some time */ | ||
101 | if (H_IS_LONG_BUSY(rc)) { | ||
102 | msleep(get_longbusy_msecs(rc)); | ||
103 | rc = H_BUSY; | ||
104 | } else if (rc == H_BUSY) { | ||
105 | cond_resched(); | ||
106 | } | ||
107 | |||
91 | } while (rc == H_BUSY); | 108 | } while (rc == H_BUSY); |
92 | 109 | ||
93 | if (rc) | 110 | if (rc) |
94 | dev_err(&p->pdev->dev, "unbind error: %lld\n", rc); | 111 | dev_err(&p->pdev->dev, "unbind error: %lld\n", rc); |
112 | else | ||
113 | dev_dbg(&p->pdev->dev, "unbind drc %x complete\n", | ||
114 | p->drc_index); | ||
95 | 115 | ||
96 | return !!rc; | 116 | return rc == H_SUCCESS ? 0 : -ENXIO; |
97 | } | 117 | } |
98 | 118 | ||
99 | static int papr_scm_meta_get(struct papr_scm_priv *p, | 119 | static int papr_scm_meta_get(struct papr_scm_priv *p, |
@@ -389,6 +409,14 @@ static int papr_scm_probe(struct platform_device *pdev) | |||
389 | 409 | ||
390 | /* request the hypervisor to bind this region to somewhere in memory */ | 410 | /* request the hypervisor to bind this region to somewhere in memory */ |
391 | rc = drc_pmem_bind(p); | 411 | rc = drc_pmem_bind(p); |
412 | |||
413 | /* If phyp says drc memory still bound then force unbound and retry */ | ||
414 | if (rc == -EBUSY) { | ||
415 | dev_warn(&pdev->dev, "Retrying bind after unbinding\n"); | ||
416 | drc_pmem_unbind(p); | ||
417 | rc = drc_pmem_bind(p); | ||
418 | } | ||
419 | |||
392 | if (rc) | 420 | if (rc) |
393 | goto err; | 421 | goto err; |
394 | 422 | ||
diff --git a/arch/powerpc/sysdev/xive/common.c b/arch/powerpc/sysdev/xive/common.c index 082c7e1c20f0..1cdb39575eae 100644 --- a/arch/powerpc/sysdev/xive/common.c +++ b/arch/powerpc/sysdev/xive/common.c | |||
@@ -479,7 +479,7 @@ static int xive_find_target_in_mask(const struct cpumask *mask, | |||
479 | * Now go through the entire mask until we find a valid | 479 | * Now go through the entire mask until we find a valid |
480 | * target. | 480 | * target. |
481 | */ | 481 | */ |
482 | for (;;) { | 482 | do { |
483 | /* | 483 | /* |
484 | * We re-check online as the fallback case passes us | 484 | * We re-check online as the fallback case passes us |
485 | * an untested affinity mask | 485 | * an untested affinity mask |
@@ -487,12 +487,11 @@ static int xive_find_target_in_mask(const struct cpumask *mask, | |||
487 | if (cpu_online(cpu) && xive_try_pick_target(cpu)) | 487 | if (cpu_online(cpu) && xive_try_pick_target(cpu)) |
488 | return cpu; | 488 | return cpu; |
489 | cpu = cpumask_next(cpu, mask); | 489 | cpu = cpumask_next(cpu, mask); |
490 | if (cpu == first) | ||
491 | break; | ||
492 | /* Wrap around */ | 490 | /* Wrap around */ |
493 | if (cpu >= nr_cpu_ids) | 491 | if (cpu >= nr_cpu_ids) |
494 | cpu = cpumask_first(mask); | 492 | cpu = cpumask_first(mask); |
495 | } | 493 | } while (cpu != first); |
494 | |||
496 | return -1; | 495 | return -1; |
497 | } | 496 | } |
498 | 497 | ||
diff --git a/arch/riscv/boot/dts/sifive/fu540-c000.dtsi b/arch/riscv/boot/dts/sifive/fu540-c000.dtsi index 40983491b95f..9bf63f0ab253 100644 --- a/arch/riscv/boot/dts/sifive/fu540-c000.dtsi +++ b/arch/riscv/boot/dts/sifive/fu540-c000.dtsi | |||
@@ -217,5 +217,20 @@ | |||
217 | #size-cells = <0>; | 217 | #size-cells = <0>; |
218 | status = "disabled"; | 218 | status = "disabled"; |
219 | }; | 219 | }; |
220 | eth0: ethernet@10090000 { | ||
221 | compatible = "sifive,fu540-c000-gem"; | ||
222 | interrupt-parent = <&plic0>; | ||
223 | interrupts = <53>; | ||
224 | reg = <0x0 0x10090000 0x0 0x2000 | ||
225 | 0x0 0x100a0000 0x0 0x1000>; | ||
226 | local-mac-address = [00 00 00 00 00 00]; | ||
227 | clock-names = "pclk", "hclk"; | ||
228 | clocks = <&prci PRCI_CLK_GEMGXLPLL>, | ||
229 | <&prci PRCI_CLK_GEMGXLPLL>; | ||
230 | #address-cells = <1>; | ||
231 | #size-cells = <0>; | ||
232 | status = "disabled"; | ||
233 | }; | ||
234 | |||
220 | }; | 235 | }; |
221 | }; | 236 | }; |
diff --git a/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts index 0b55c53c08c7..93d68cbd64fe 100644 --- a/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts +++ b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts | |||
@@ -76,3 +76,12 @@ | |||
76 | disable-wp; | 76 | disable-wp; |
77 | }; | 77 | }; |
78 | }; | 78 | }; |
79 | |||
80 | ð0 { | ||
81 | status = "okay"; | ||
82 | phy-mode = "gmii"; | ||
83 | phy-handle = <&phy0>; | ||
84 | phy0: ethernet-phy@0 { | ||
85 | reg = <0>; | ||
86 | }; | ||
87 | }; | ||
diff --git a/arch/riscv/include/asm/Kbuild b/arch/riscv/include/asm/Kbuild index 1efaeddf1e4b..16970f246860 100644 --- a/arch/riscv/include/asm/Kbuild +++ b/arch/riscv/include/asm/Kbuild | |||
@@ -22,6 +22,7 @@ generic-y += kvm_para.h | |||
22 | generic-y += local.h | 22 | generic-y += local.h |
23 | generic-y += local64.h | 23 | generic-y += local64.h |
24 | generic-y += mm-arch-hooks.h | 24 | generic-y += mm-arch-hooks.h |
25 | generic-y += msi.h | ||
25 | generic-y += percpu.h | 26 | generic-y += percpu.h |
26 | generic-y += preempt.h | 27 | generic-y += preempt.h |
27 | generic-y += sections.h | 28 | generic-y += sections.h |
diff --git a/arch/riscv/include/uapi/asm/auxvec.h b/arch/riscv/include/uapi/asm/auxvec.h index 62716653554b..d86cb17bbabe 100644 --- a/arch/riscv/include/uapi/asm/auxvec.h +++ b/arch/riscv/include/uapi/asm/auxvec.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0-only */ | 1 | /* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */ |
2 | /* | 2 | /* |
3 | * Copyright (C) 2012 ARM Ltd. | 3 | * Copyright (C) 2012 ARM Ltd. |
4 | * Copyright (C) 2015 Regents of the University of California | 4 | * Copyright (C) 2015 Regents of the University of California |
diff --git a/arch/riscv/include/uapi/asm/bitsperlong.h b/arch/riscv/include/uapi/asm/bitsperlong.h index 0b9b58b57ff6..7d0b32e3b701 100644 --- a/arch/riscv/include/uapi/asm/bitsperlong.h +++ b/arch/riscv/include/uapi/asm/bitsperlong.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0-only */ | 1 | /* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */ |
2 | /* | 2 | /* |
3 | * Copyright (C) 2012 ARM Ltd. | 3 | * Copyright (C) 2012 ARM Ltd. |
4 | * Copyright (C) 2015 Regents of the University of California | 4 | * Copyright (C) 2015 Regents of the University of California |
diff --git a/arch/riscv/include/uapi/asm/byteorder.h b/arch/riscv/include/uapi/asm/byteorder.h index 1920debc09c0..f671e16bf6af 100644 --- a/arch/riscv/include/uapi/asm/byteorder.h +++ b/arch/riscv/include/uapi/asm/byteorder.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0-only */ | 1 | /* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */ |
2 | /* | 2 | /* |
3 | * Copyright (C) 2012 ARM Ltd. | 3 | * Copyright (C) 2012 ARM Ltd. |
4 | * Copyright (C) 2015 Regents of the University of California | 4 | * Copyright (C) 2015 Regents of the University of California |
diff --git a/arch/riscv/include/uapi/asm/hwcap.h b/arch/riscv/include/uapi/asm/hwcap.h index 7d786145183b..4e7646077056 100644 --- a/arch/riscv/include/uapi/asm/hwcap.h +++ b/arch/riscv/include/uapi/asm/hwcap.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0-only */ | 1 | /* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */ |
2 | /* | 2 | /* |
3 | * Copied from arch/arm64/include/asm/hwcap.h | 3 | * Copied from arch/arm64/include/asm/hwcap.h |
4 | * | 4 | * |
diff --git a/arch/riscv/include/uapi/asm/ptrace.h b/arch/riscv/include/uapi/asm/ptrace.h index 92d8f7cd8f84..882547f6bd5c 100644 --- a/arch/riscv/include/uapi/asm/ptrace.h +++ b/arch/riscv/include/uapi/asm/ptrace.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0-only */ | 1 | /* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */ |
2 | /* | 2 | /* |
3 | * Copyright (C) 2012 Regents of the University of California | 3 | * Copyright (C) 2012 Regents of the University of California |
4 | */ | 4 | */ |
diff --git a/arch/riscv/include/uapi/asm/sigcontext.h b/arch/riscv/include/uapi/asm/sigcontext.h index 053f809e52ce..84f2dfcfdbce 100644 --- a/arch/riscv/include/uapi/asm/sigcontext.h +++ b/arch/riscv/include/uapi/asm/sigcontext.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0-only */ | 1 | /* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */ |
2 | /* | 2 | /* |
3 | * Copyright (C) 2012 Regents of the University of California | 3 | * Copyright (C) 2012 Regents of the University of California |
4 | */ | 4 | */ |
diff --git a/arch/riscv/include/uapi/asm/ucontext.h b/arch/riscv/include/uapi/asm/ucontext.h index b58e00cee2ec..411dd7b52ed6 100644 --- a/arch/riscv/include/uapi/asm/ucontext.h +++ b/arch/riscv/include/uapi/asm/ucontext.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0-only */ | 1 | /* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */ |
2 | /* | 2 | /* |
3 | * Copyright (C) 2012 ARM Ltd. | 3 | * Copyright (C) 2012 ARM Ltd. |
4 | * Copyright (C) 2017 SiFive, Inc. | 4 | * Copyright (C) 2017 SiFive, Inc. |
diff --git a/arch/riscv/include/uapi/asm/unistd.h b/arch/riscv/include/uapi/asm/unistd.h index 0e2eeeb1fd27..13ce76cc5aff 100644 --- a/arch/riscv/include/uapi/asm/unistd.h +++ b/arch/riscv/include/uapi/asm/unistd.h | |||
@@ -18,6 +18,7 @@ | |||
18 | #ifdef __LP64__ | 18 | #ifdef __LP64__ |
19 | #define __ARCH_WANT_NEW_STAT | 19 | #define __ARCH_WANT_NEW_STAT |
20 | #define __ARCH_WANT_SET_GET_RLIMIT | 20 | #define __ARCH_WANT_SET_GET_RLIMIT |
21 | #define __ARCH_WANT_SYS_CLONE3 | ||
21 | #endif /* __LP64__ */ | 22 | #endif /* __LP64__ */ |
22 | 23 | ||
23 | #include <asm-generic/unistd.h> | 24 | #include <asm-generic/unistd.h> |
diff --git a/arch/s390/boot/Makefile b/arch/s390/boot/Makefile index 7cba96e7587b..4cf0bddb7d92 100644 --- a/arch/s390/boot/Makefile +++ b/arch/s390/boot/Makefile | |||
@@ -36,7 +36,7 @@ CFLAGS_sclp_early_core.o += -I$(srctree)/drivers/s390/char | |||
36 | 36 | ||
37 | obj-y := head.o als.o startup.o mem_detect.o ipl_parm.o ipl_report.o | 37 | obj-y := head.o als.o startup.o mem_detect.o ipl_parm.o ipl_report.o |
38 | obj-y += string.o ebcdic.o sclp_early_core.o mem.o ipl_vmparm.o cmdline.o | 38 | obj-y += string.o ebcdic.o sclp_early_core.o mem.o ipl_vmparm.o cmdline.o |
39 | obj-y += ctype.o text_dma.o | 39 | obj-y += version.o ctype.o text_dma.o |
40 | obj-$(CONFIG_PROTECTED_VIRTUALIZATION_GUEST) += uv.o | 40 | obj-$(CONFIG_PROTECTED_VIRTUALIZATION_GUEST) += uv.o |
41 | obj-$(CONFIG_RELOCATABLE) += machine_kexec_reloc.o | 41 | obj-$(CONFIG_RELOCATABLE) += machine_kexec_reloc.o |
42 | obj-$(CONFIG_RANDOMIZE_BASE) += kaslr.o | 42 | obj-$(CONFIG_RANDOMIZE_BASE) += kaslr.o |
diff --git a/arch/s390/boot/boot.h b/arch/s390/boot/boot.h index ad57c2205a71..082905d97309 100644 --- a/arch/s390/boot/boot.h +++ b/arch/s390/boot/boot.h | |||
@@ -12,6 +12,7 @@ void print_missing_facilities(void); | |||
12 | unsigned long get_random_base(unsigned long safe_addr); | 12 | unsigned long get_random_base(unsigned long safe_addr); |
13 | 13 | ||
14 | extern int kaslr_enabled; | 14 | extern int kaslr_enabled; |
15 | extern const char kernel_version[]; | ||
15 | 16 | ||
16 | unsigned long read_ipl_report(unsigned long safe_offset); | 17 | unsigned long read_ipl_report(unsigned long safe_offset); |
17 | 18 | ||
diff --git a/arch/s390/boot/head.S b/arch/s390/boot/head.S index 028aab03a9e7..2087bed6e60f 100644 --- a/arch/s390/boot/head.S +++ b/arch/s390/boot/head.S | |||
@@ -361,6 +361,7 @@ ENTRY(startup_kdump) | |||
361 | .quad 0 # INITRD_SIZE | 361 | .quad 0 # INITRD_SIZE |
362 | .quad 0 # OLDMEM_BASE | 362 | .quad 0 # OLDMEM_BASE |
363 | .quad 0 # OLDMEM_SIZE | 363 | .quad 0 # OLDMEM_SIZE |
364 | .quad kernel_version # points to kernel version string | ||
364 | 365 | ||
365 | .org COMMAND_LINE | 366 | .org COMMAND_LINE |
366 | .byte "root=/dev/ram0 ro" | 367 | .byte "root=/dev/ram0 ro" |
diff --git a/arch/s390/boot/version.c b/arch/s390/boot/version.c new file mode 100644 index 000000000000..d32e58bdda6a --- /dev/null +++ b/arch/s390/boot/version.c | |||
@@ -0,0 +1,7 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
2 | #include <generated/utsrelease.h> | ||
3 | #include <generated/compile.h> | ||
4 | #include "boot.h" | ||
5 | |||
6 | const char kernel_version[] = UTS_RELEASE | ||
7 | " (" LINUX_COMPILE_BY "@" LINUX_COMPILE_HOST ") " UTS_VERSION; | ||
diff --git a/arch/s390/hypfs/hypfs_vm.c b/arch/s390/hypfs/hypfs_vm.c index 42f2375c203e..e1fcc03159ef 100644 --- a/arch/s390/hypfs/hypfs_vm.c +++ b/arch/s390/hypfs/hypfs_vm.c | |||
@@ -118,7 +118,7 @@ do { \ | |||
118 | return PTR_ERR(rc); \ | 118 | return PTR_ERR(rc); \ |
119 | } while(0) | 119 | } while(0) |
120 | 120 | ||
121 | static int hpyfs_vm_create_guest(struct dentry *systems_dir, | 121 | static int hypfs_vm_create_guest(struct dentry *systems_dir, |
122 | struct diag2fc_data *data) | 122 | struct diag2fc_data *data) |
123 | { | 123 | { |
124 | char guest_name[NAME_LEN + 1] = {}; | 124 | char guest_name[NAME_LEN + 1] = {}; |
@@ -219,7 +219,7 @@ int hypfs_vm_create_files(struct dentry *root) | |||
219 | } | 219 | } |
220 | 220 | ||
221 | for (i = 0; i < count; i++) { | 221 | for (i = 0; i < count; i++) { |
222 | rc = hpyfs_vm_create_guest(dir, &(data[i])); | 222 | rc = hypfs_vm_create_guest(dir, &(data[i])); |
223 | if (rc) | 223 | if (rc) |
224 | goto failed; | 224 | goto failed; |
225 | } | 225 | } |
diff --git a/arch/s390/include/asm/bitops.h b/arch/s390/include/asm/bitops.h index 9900d655014c..b8833ac983fa 100644 --- a/arch/s390/include/asm/bitops.h +++ b/arch/s390/include/asm/bitops.h | |||
@@ -35,6 +35,7 @@ | |||
35 | 35 | ||
36 | #include <linux/typecheck.h> | 36 | #include <linux/typecheck.h> |
37 | #include <linux/compiler.h> | 37 | #include <linux/compiler.h> |
38 | #include <linux/types.h> | ||
38 | #include <asm/atomic_ops.h> | 39 | #include <asm/atomic_ops.h> |
39 | #include <asm/barrier.h> | 40 | #include <asm/barrier.h> |
40 | 41 | ||
@@ -55,7 +56,7 @@ __bitops_byte(unsigned long nr, volatile unsigned long *ptr) | |||
55 | return ((unsigned char *)ptr) + ((nr ^ (BITS_PER_LONG - 8)) >> 3); | 56 | return ((unsigned char *)ptr) + ((nr ^ (BITS_PER_LONG - 8)) >> 3); |
56 | } | 57 | } |
57 | 58 | ||
58 | static inline void set_bit(unsigned long nr, volatile unsigned long *ptr) | 59 | static inline void arch_set_bit(unsigned long nr, volatile unsigned long *ptr) |
59 | { | 60 | { |
60 | unsigned long *addr = __bitops_word(nr, ptr); | 61 | unsigned long *addr = __bitops_word(nr, ptr); |
61 | unsigned long mask; | 62 | unsigned long mask; |
@@ -76,7 +77,7 @@ static inline void set_bit(unsigned long nr, volatile unsigned long *ptr) | |||
76 | __atomic64_or(mask, (long *)addr); | 77 | __atomic64_or(mask, (long *)addr); |
77 | } | 78 | } |
78 | 79 | ||
79 | static inline void clear_bit(unsigned long nr, volatile unsigned long *ptr) | 80 | static inline void arch_clear_bit(unsigned long nr, volatile unsigned long *ptr) |
80 | { | 81 | { |
81 | unsigned long *addr = __bitops_word(nr, ptr); | 82 | unsigned long *addr = __bitops_word(nr, ptr); |
82 | unsigned long mask; | 83 | unsigned long mask; |
@@ -97,7 +98,8 @@ static inline void clear_bit(unsigned long nr, volatile unsigned long *ptr) | |||
97 | __atomic64_and(mask, (long *)addr); | 98 | __atomic64_and(mask, (long *)addr); |
98 | } | 99 | } |
99 | 100 | ||
100 | static inline void change_bit(unsigned long nr, volatile unsigned long *ptr) | 101 | static inline void arch_change_bit(unsigned long nr, |
102 | volatile unsigned long *ptr) | ||
101 | { | 103 | { |
102 | unsigned long *addr = __bitops_word(nr, ptr); | 104 | unsigned long *addr = __bitops_word(nr, ptr); |
103 | unsigned long mask; | 105 | unsigned long mask; |
@@ -118,8 +120,8 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *ptr) | |||
118 | __atomic64_xor(mask, (long *)addr); | 120 | __atomic64_xor(mask, (long *)addr); |
119 | } | 121 | } |
120 | 122 | ||
121 | static inline int | 123 | static inline bool arch_test_and_set_bit(unsigned long nr, |
122 | test_and_set_bit(unsigned long nr, volatile unsigned long *ptr) | 124 | volatile unsigned long *ptr) |
123 | { | 125 | { |
124 | unsigned long *addr = __bitops_word(nr, ptr); | 126 | unsigned long *addr = __bitops_word(nr, ptr); |
125 | unsigned long old, mask; | 127 | unsigned long old, mask; |
@@ -129,8 +131,8 @@ test_and_set_bit(unsigned long nr, volatile unsigned long *ptr) | |||
129 | return (old & mask) != 0; | 131 | return (old & mask) != 0; |
130 | } | 132 | } |
131 | 133 | ||
132 | static inline int | 134 | static inline bool arch_test_and_clear_bit(unsigned long nr, |
133 | test_and_clear_bit(unsigned long nr, volatile unsigned long *ptr) | 135 | volatile unsigned long *ptr) |
134 | { | 136 | { |
135 | unsigned long *addr = __bitops_word(nr, ptr); | 137 | unsigned long *addr = __bitops_word(nr, ptr); |
136 | unsigned long old, mask; | 138 | unsigned long old, mask; |
@@ -140,8 +142,8 @@ test_and_clear_bit(unsigned long nr, volatile unsigned long *ptr) | |||
140 | return (old & ~mask) != 0; | 142 | return (old & ~mask) != 0; |
141 | } | 143 | } |
142 | 144 | ||
143 | static inline int | 145 | static inline bool arch_test_and_change_bit(unsigned long nr, |
144 | test_and_change_bit(unsigned long nr, volatile unsigned long *ptr) | 146 | volatile unsigned long *ptr) |
145 | { | 147 | { |
146 | unsigned long *addr = __bitops_word(nr, ptr); | 148 | unsigned long *addr = __bitops_word(nr, ptr); |
147 | unsigned long old, mask; | 149 | unsigned long old, mask; |
@@ -151,30 +153,31 @@ test_and_change_bit(unsigned long nr, volatile unsigned long *ptr) | |||
151 | return (old & mask) != 0; | 153 | return (old & mask) != 0; |
152 | } | 154 | } |
153 | 155 | ||
154 | static inline void __set_bit(unsigned long nr, volatile unsigned long *ptr) | 156 | static inline void arch___set_bit(unsigned long nr, volatile unsigned long *ptr) |
155 | { | 157 | { |
156 | unsigned char *addr = __bitops_byte(nr, ptr); | 158 | unsigned char *addr = __bitops_byte(nr, ptr); |
157 | 159 | ||
158 | *addr |= 1 << (nr & 7); | 160 | *addr |= 1 << (nr & 7); |
159 | } | 161 | } |
160 | 162 | ||
161 | static inline void | 163 | static inline void arch___clear_bit(unsigned long nr, |
162 | __clear_bit(unsigned long nr, volatile unsigned long *ptr) | 164 | volatile unsigned long *ptr) |
163 | { | 165 | { |
164 | unsigned char *addr = __bitops_byte(nr, ptr); | 166 | unsigned char *addr = __bitops_byte(nr, ptr); |
165 | 167 | ||
166 | *addr &= ~(1 << (nr & 7)); | 168 | *addr &= ~(1 << (nr & 7)); |
167 | } | 169 | } |
168 | 170 | ||
169 | static inline void __change_bit(unsigned long nr, volatile unsigned long *ptr) | 171 | static inline void arch___change_bit(unsigned long nr, |
172 | volatile unsigned long *ptr) | ||
170 | { | 173 | { |
171 | unsigned char *addr = __bitops_byte(nr, ptr); | 174 | unsigned char *addr = __bitops_byte(nr, ptr); |
172 | 175 | ||
173 | *addr ^= 1 << (nr & 7); | 176 | *addr ^= 1 << (nr & 7); |
174 | } | 177 | } |
175 | 178 | ||
176 | static inline int | 179 | static inline bool arch___test_and_set_bit(unsigned long nr, |
177 | __test_and_set_bit(unsigned long nr, volatile unsigned long *ptr) | 180 | volatile unsigned long *ptr) |
178 | { | 181 | { |
179 | unsigned char *addr = __bitops_byte(nr, ptr); | 182 | unsigned char *addr = __bitops_byte(nr, ptr); |
180 | unsigned char ch; | 183 | unsigned char ch; |
@@ -184,8 +187,8 @@ __test_and_set_bit(unsigned long nr, volatile unsigned long *ptr) | |||
184 | return (ch >> (nr & 7)) & 1; | 187 | return (ch >> (nr & 7)) & 1; |
185 | } | 188 | } |
186 | 189 | ||
187 | static inline int | 190 | static inline bool arch___test_and_clear_bit(unsigned long nr, |
188 | __test_and_clear_bit(unsigned long nr, volatile unsigned long *ptr) | 191 | volatile unsigned long *ptr) |
189 | { | 192 | { |
190 | unsigned char *addr = __bitops_byte(nr, ptr); | 193 | unsigned char *addr = __bitops_byte(nr, ptr); |
191 | unsigned char ch; | 194 | unsigned char ch; |
@@ -195,8 +198,8 @@ __test_and_clear_bit(unsigned long nr, volatile unsigned long *ptr) | |||
195 | return (ch >> (nr & 7)) & 1; | 198 | return (ch >> (nr & 7)) & 1; |
196 | } | 199 | } |
197 | 200 | ||
198 | static inline int | 201 | static inline bool arch___test_and_change_bit(unsigned long nr, |
199 | __test_and_change_bit(unsigned long nr, volatile unsigned long *ptr) | 202 | volatile unsigned long *ptr) |
200 | { | 203 | { |
201 | unsigned char *addr = __bitops_byte(nr, ptr); | 204 | unsigned char *addr = __bitops_byte(nr, ptr); |
202 | unsigned char ch; | 205 | unsigned char ch; |
@@ -206,7 +209,8 @@ __test_and_change_bit(unsigned long nr, volatile unsigned long *ptr) | |||
206 | return (ch >> (nr & 7)) & 1; | 209 | return (ch >> (nr & 7)) & 1; |
207 | } | 210 | } |
208 | 211 | ||
209 | static inline int test_bit(unsigned long nr, const volatile unsigned long *ptr) | 212 | static inline bool arch_test_bit(unsigned long nr, |
213 | const volatile unsigned long *ptr) | ||
210 | { | 214 | { |
211 | const volatile unsigned char *addr; | 215 | const volatile unsigned char *addr; |
212 | 216 | ||
@@ -215,28 +219,30 @@ static inline int test_bit(unsigned long nr, const volatile unsigned long *ptr) | |||
215 | return (*addr >> (nr & 7)) & 1; | 219 | return (*addr >> (nr & 7)) & 1; |
216 | } | 220 | } |
217 | 221 | ||
218 | static inline int test_and_set_bit_lock(unsigned long nr, | 222 | static inline bool arch_test_and_set_bit_lock(unsigned long nr, |
219 | volatile unsigned long *ptr) | 223 | volatile unsigned long *ptr) |
220 | { | 224 | { |
221 | if (test_bit(nr, ptr)) | 225 | if (arch_test_bit(nr, ptr)) |
222 | return 1; | 226 | return 1; |
223 | return test_and_set_bit(nr, ptr); | 227 | return arch_test_and_set_bit(nr, ptr); |
224 | } | 228 | } |
225 | 229 | ||
226 | static inline void clear_bit_unlock(unsigned long nr, | 230 | static inline void arch_clear_bit_unlock(unsigned long nr, |
227 | volatile unsigned long *ptr) | 231 | volatile unsigned long *ptr) |
228 | { | 232 | { |
229 | smp_mb__before_atomic(); | 233 | smp_mb__before_atomic(); |
230 | clear_bit(nr, ptr); | 234 | arch_clear_bit(nr, ptr); |
231 | } | 235 | } |
232 | 236 | ||
233 | static inline void __clear_bit_unlock(unsigned long nr, | 237 | static inline void arch___clear_bit_unlock(unsigned long nr, |
234 | volatile unsigned long *ptr) | 238 | volatile unsigned long *ptr) |
235 | { | 239 | { |
236 | smp_mb(); | 240 | smp_mb(); |
237 | __clear_bit(nr, ptr); | 241 | arch___clear_bit(nr, ptr); |
238 | } | 242 | } |
239 | 243 | ||
244 | #include <asm-generic/bitops-instrumented.h> | ||
245 | |||
240 | /* | 246 | /* |
241 | * Functions which use MSB0 bit numbering. | 247 | * Functions which use MSB0 bit numbering. |
242 | * The bits are numbered: | 248 | * The bits are numbered: |
@@ -261,7 +267,8 @@ static inline void clear_bit_inv(unsigned long nr, volatile unsigned long *ptr) | |||
261 | return clear_bit(nr ^ (BITS_PER_LONG - 1), ptr); | 267 | return clear_bit(nr ^ (BITS_PER_LONG - 1), ptr); |
262 | } | 268 | } |
263 | 269 | ||
264 | static inline int test_and_clear_bit_inv(unsigned long nr, volatile unsigned long *ptr) | 270 | static inline bool test_and_clear_bit_inv(unsigned long nr, |
271 | volatile unsigned long *ptr) | ||
265 | { | 272 | { |
266 | return test_and_clear_bit(nr ^ (BITS_PER_LONG - 1), ptr); | 273 | return test_and_clear_bit(nr ^ (BITS_PER_LONG - 1), ptr); |
267 | } | 274 | } |
@@ -276,8 +283,8 @@ static inline void __clear_bit_inv(unsigned long nr, volatile unsigned long *ptr | |||
276 | return __clear_bit(nr ^ (BITS_PER_LONG - 1), ptr); | 283 | return __clear_bit(nr ^ (BITS_PER_LONG - 1), ptr); |
277 | } | 284 | } |
278 | 285 | ||
279 | static inline int test_bit_inv(unsigned long nr, | 286 | static inline bool test_bit_inv(unsigned long nr, |
280 | const volatile unsigned long *ptr) | 287 | const volatile unsigned long *ptr) |
281 | { | 288 | { |
282 | return test_bit(nr ^ (BITS_PER_LONG - 1), ptr); | 289 | return test_bit(nr ^ (BITS_PER_LONG - 1), ptr); |
283 | } | 290 | } |
diff --git a/arch/s390/include/asm/page.h b/arch/s390/include/asm/page.h index a4d38092530a..823578c6b9e2 100644 --- a/arch/s390/include/asm/page.h +++ b/arch/s390/include/asm/page.h | |||
@@ -177,6 +177,8 @@ static inline int devmem_is_allowed(unsigned long pfn) | |||
177 | #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | \ | 177 | #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | \ |
178 | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) | 178 | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) |
179 | 179 | ||
180 | #define ARCH_ZONE_DMA_BITS 31 | ||
181 | |||
180 | #include <asm-generic/memory_model.h> | 182 | #include <asm-generic/memory_model.h> |
181 | #include <asm-generic/getorder.h> | 183 | #include <asm-generic/getorder.h> |
182 | 184 | ||
diff --git a/arch/s390/include/asm/setup.h b/arch/s390/include/asm/setup.h index 82deb8fc8319..c5cfff7b1f91 100644 --- a/arch/s390/include/asm/setup.h +++ b/arch/s390/include/asm/setup.h | |||
@@ -54,6 +54,7 @@ | |||
54 | #define INITRD_SIZE_OFFSET 0x10410 | 54 | #define INITRD_SIZE_OFFSET 0x10410 |
55 | #define OLDMEM_BASE_OFFSET 0x10418 | 55 | #define OLDMEM_BASE_OFFSET 0x10418 |
56 | #define OLDMEM_SIZE_OFFSET 0x10420 | 56 | #define OLDMEM_SIZE_OFFSET 0x10420 |
57 | #define KERNEL_VERSION_OFFSET 0x10428 | ||
57 | #define COMMAND_LINE_OFFSET 0x10480 | 58 | #define COMMAND_LINE_OFFSET 0x10480 |
58 | 59 | ||
59 | #ifndef __ASSEMBLY__ | 60 | #ifndef __ASSEMBLY__ |
@@ -74,7 +75,8 @@ struct parmarea { | |||
74 | unsigned long initrd_size; /* 0x10410 */ | 75 | unsigned long initrd_size; /* 0x10410 */ |
75 | unsigned long oldmem_base; /* 0x10418 */ | 76 | unsigned long oldmem_base; /* 0x10418 */ |
76 | unsigned long oldmem_size; /* 0x10420 */ | 77 | unsigned long oldmem_size; /* 0x10420 */ |
77 | char pad1[0x10480 - 0x10428]; /* 0x10428 - 0x10480 */ | 78 | unsigned long kernel_version; /* 0x10428 */ |
79 | char pad1[0x10480 - 0x10430]; /* 0x10430 - 0x10480 */ | ||
78 | char command_line[ARCH_COMMAND_LINE_SIZE]; /* 0x10480 */ | 80 | char command_line[ARCH_COMMAND_LINE_SIZE]; /* 0x10480 */ |
79 | }; | 81 | }; |
80 | 82 | ||
diff --git a/arch/s390/include/asm/unistd.h b/arch/s390/include/asm/unistd.h index b6755685c7b8..9e9f75ef046a 100644 --- a/arch/s390/include/asm/unistd.h +++ b/arch/s390/include/asm/unistd.h | |||
@@ -34,5 +34,6 @@ | |||
34 | #define __ARCH_WANT_SYS_FORK | 34 | #define __ARCH_WANT_SYS_FORK |
35 | #define __ARCH_WANT_SYS_VFORK | 35 | #define __ARCH_WANT_SYS_VFORK |
36 | #define __ARCH_WANT_SYS_CLONE | 36 | #define __ARCH_WANT_SYS_CLONE |
37 | #define __ARCH_WANT_SYS_CLONE3 | ||
37 | 38 | ||
38 | #endif /* _ASM_S390_UNISTD_H_ */ | 39 | #endif /* _ASM_S390_UNISTD_H_ */ |
diff --git a/arch/s390/include/uapi/asm/bpf_perf_event.h b/arch/s390/include/uapi/asm/bpf_perf_event.h index cefe7c7cd4f6..3ed42ff6da94 100644 --- a/arch/s390/include/uapi/asm/bpf_perf_event.h +++ b/arch/s390/include/uapi/asm/bpf_perf_event.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
2 | #ifndef _UAPI__ASM_BPF_PERF_EVENT_H__ | 2 | #ifndef _UAPI__ASM_BPF_PERF_EVENT_H__ |
3 | #define _UAPI__ASM_BPF_PERF_EVENT_H__ | 3 | #define _UAPI__ASM_BPF_PERF_EVENT_H__ |
4 | 4 | ||
diff --git a/arch/s390/include/uapi/asm/ipl.h b/arch/s390/include/uapi/asm/ipl.h index fd32b1cd80d2..451ba7d08905 100644 --- a/arch/s390/include/uapi/asm/ipl.h +++ b/arch/s390/include/uapi/asm/ipl.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
2 | #ifndef _ASM_S390_UAPI_IPL_H | 2 | #ifndef _ASM_S390_UAPI_IPL_H |
3 | #define _ASM_S390_UAPI_IPL_H | 3 | #define _ASM_S390_UAPI_IPL_H |
4 | 4 | ||
diff --git a/arch/s390/include/uapi/asm/zcrypt.h b/arch/s390/include/uapi/asm/zcrypt.h index 494c34c50716..8c5755f41dde 100644 --- a/arch/s390/include/uapi/asm/zcrypt.h +++ b/arch/s390/include/uapi/asm/zcrypt.h | |||
@@ -20,6 +20,7 @@ | |||
20 | 20 | ||
21 | #include <linux/ioctl.h> | 21 | #include <linux/ioctl.h> |
22 | #include <linux/compiler.h> | 22 | #include <linux/compiler.h> |
23 | #include <linux/types.h> | ||
23 | 24 | ||
24 | /* Name of the zcrypt device driver. */ | 25 | /* Name of the zcrypt device driver. */ |
25 | #define ZCRYPT_NAME "zcrypt" | 26 | #define ZCRYPT_NAME "zcrypt" |
@@ -160,17 +161,17 @@ struct ica_xcRB { | |||
160 | * @payload_len: Payload length | 161 | * @payload_len: Payload length |
161 | */ | 162 | */ |
162 | struct ep11_cprb { | 163 | struct ep11_cprb { |
163 | uint16_t cprb_len; | 164 | __u16 cprb_len; |
164 | unsigned char cprb_ver_id; | 165 | unsigned char cprb_ver_id; |
165 | unsigned char pad_000[2]; | 166 | unsigned char pad_000[2]; |
166 | unsigned char flags; | 167 | unsigned char flags; |
167 | unsigned char func_id[2]; | 168 | unsigned char func_id[2]; |
168 | uint32_t source_id; | 169 | __u32 source_id; |
169 | uint32_t target_id; | 170 | __u32 target_id; |
170 | uint32_t ret_code; | 171 | __u32 ret_code; |
171 | uint32_t reserved1; | 172 | __u32 reserved1; |
172 | uint32_t reserved2; | 173 | __u32 reserved2; |
173 | uint32_t payload_len; | 174 | __u32 payload_len; |
174 | } __attribute__((packed)); | 175 | } __attribute__((packed)); |
175 | 176 | ||
176 | /** | 177 | /** |
@@ -179,8 +180,8 @@ struct ep11_cprb { | |||
179 | * @dom_id: Usage domain id | 180 | * @dom_id: Usage domain id |
180 | */ | 181 | */ |
181 | struct ep11_target_dev { | 182 | struct ep11_target_dev { |
182 | uint16_t ap_id; | 183 | __u16 ap_id; |
183 | uint16_t dom_id; | 184 | __u16 dom_id; |
184 | }; | 185 | }; |
185 | 186 | ||
186 | /** | 187 | /** |
@@ -195,14 +196,14 @@ struct ep11_target_dev { | |||
195 | * @resp: Addr to response block | 196 | * @resp: Addr to response block |
196 | */ | 197 | */ |
197 | struct ep11_urb { | 198 | struct ep11_urb { |
198 | uint16_t targets_num; | 199 | __u16 targets_num; |
199 | uint64_t targets; | 200 | __u64 targets; |
200 | uint64_t weight; | 201 | __u64 weight; |
201 | uint64_t req_no; | 202 | __u64 req_no; |
202 | uint64_t req_len; | 203 | __u64 req_len; |
203 | uint64_t req; | 204 | __u64 req; |
204 | uint64_t resp_len; | 205 | __u64 resp_len; |
205 | uint64_t resp; | 206 | __u64 resp; |
206 | } __attribute__((packed)); | 207 | } __attribute__((packed)); |
207 | 208 | ||
208 | /** | 209 | /** |
diff --git a/arch/s390/kernel/syscalls/syscall.tbl b/arch/s390/kernel/syscalls/syscall.tbl index a90d3e945445..3054e9c035a3 100644 --- a/arch/s390/kernel/syscalls/syscall.tbl +++ b/arch/s390/kernel/syscalls/syscall.tbl | |||
@@ -437,4 +437,4 @@ | |||
437 | 432 common fsmount sys_fsmount sys_fsmount | 437 | 432 common fsmount sys_fsmount sys_fsmount |
438 | 433 common fspick sys_fspick sys_fspick | 438 | 433 common fspick sys_fspick sys_fspick |
439 | 434 common pidfd_open sys_pidfd_open sys_pidfd_open | 439 | 434 common pidfd_open sys_pidfd_open sys_pidfd_open |
440 | # 435 reserved for clone3 | 440 | 435 common clone3 sys_clone3 sys_clone3 |
diff --git a/arch/s390/mm/pgalloc.c b/arch/s390/mm/pgalloc.c index 99e06213a22b..54fcdf66ae96 100644 --- a/arch/s390/mm/pgalloc.c +++ b/arch/s390/mm/pgalloc.c | |||
@@ -17,8 +17,6 @@ | |||
17 | 17 | ||
18 | #ifdef CONFIG_PGSTE | 18 | #ifdef CONFIG_PGSTE |
19 | 19 | ||
20 | static int page_table_allocate_pgste_min = 0; | ||
21 | static int page_table_allocate_pgste_max = 1; | ||
22 | int page_table_allocate_pgste = 0; | 20 | int page_table_allocate_pgste = 0; |
23 | EXPORT_SYMBOL(page_table_allocate_pgste); | 21 | EXPORT_SYMBOL(page_table_allocate_pgste); |
24 | 22 | ||
@@ -29,8 +27,8 @@ static struct ctl_table page_table_sysctl[] = { | |||
29 | .maxlen = sizeof(int), | 27 | .maxlen = sizeof(int), |
30 | .mode = S_IRUGO | S_IWUSR, | 28 | .mode = S_IRUGO | S_IWUSR, |
31 | .proc_handler = proc_dointvec_minmax, | 29 | .proc_handler = proc_dointvec_minmax, |
32 | .extra1 = &page_table_allocate_pgste_min, | 30 | .extra1 = SYSCTL_ZERO, |
33 | .extra2 = &page_table_allocate_pgste_max, | 31 | .extra2 = SYSCTL_ONE, |
34 | }, | 32 | }, |
35 | { } | 33 | { } |
36 | }; | 34 | }; |
diff --git a/arch/sh/include/uapi/asm/setup.h b/arch/sh/include/uapi/asm/setup.h index 1170dd2fb998..4bd19f80f9b0 100644 --- a/arch/sh/include/uapi/asm/setup.h +++ b/arch/sh/include/uapi/asm/setup.h | |||
@@ -1,2 +1,2 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
2 | #include <asm-generic/setup.h> | 2 | #include <asm-generic/setup.h> |
diff --git a/arch/sh/include/uapi/asm/types.h b/arch/sh/include/uapi/asm/types.h index f83795fdc0da..68100e108ea6 100644 --- a/arch/sh/include/uapi/asm/types.h +++ b/arch/sh/include/uapi/asm/types.h | |||
@@ -1,2 +1,2 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
2 | #include <asm-generic/types.h> | 2 | #include <asm-generic/types.h> |
diff --git a/arch/sparc/include/uapi/asm/oradax.h b/arch/sparc/include/uapi/asm/oradax.h index 64c67f2ea33f..0dace69058ab 100644 --- a/arch/sparc/include/uapi/asm/oradax.h +++ b/arch/sparc/include/uapi/asm/oradax.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later WITH Linux-syscall-note */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. | 3 | * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. |
4 | */ | 4 | */ |
diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S index 2bb986f305ac..f83ca5aa8b77 100644 --- a/arch/x86/entry/entry_32.S +++ b/arch/x86/entry/entry_32.S | |||
@@ -63,7 +63,7 @@ | |||
63 | * enough to patch inline, increasing performance. | 63 | * enough to patch inline, increasing performance. |
64 | */ | 64 | */ |
65 | 65 | ||
66 | #ifdef CONFIG_PREEMPT | 66 | #ifdef CONFIG_PREEMPTION |
67 | # define preempt_stop(clobbers) DISABLE_INTERRUPTS(clobbers); TRACE_IRQS_OFF | 67 | # define preempt_stop(clobbers) DISABLE_INTERRUPTS(clobbers); TRACE_IRQS_OFF |
68 | #else | 68 | #else |
69 | # define preempt_stop(clobbers) | 69 | # define preempt_stop(clobbers) |
@@ -1084,7 +1084,7 @@ restore_all: | |||
1084 | INTERRUPT_RETURN | 1084 | INTERRUPT_RETURN |
1085 | 1085 | ||
1086 | restore_all_kernel: | 1086 | restore_all_kernel: |
1087 | #ifdef CONFIG_PREEMPT | 1087 | #ifdef CONFIG_PREEMPTION |
1088 | DISABLE_INTERRUPTS(CLBR_ANY) | 1088 | DISABLE_INTERRUPTS(CLBR_ANY) |
1089 | cmpl $0, PER_CPU_VAR(__preempt_count) | 1089 | cmpl $0, PER_CPU_VAR(__preempt_count) |
1090 | jnz .Lno_preempt | 1090 | jnz .Lno_preempt |
@@ -1364,7 +1364,7 @@ ENTRY(xen_hypervisor_callback) | |||
1364 | ENTRY(xen_do_upcall) | 1364 | ENTRY(xen_do_upcall) |
1365 | 1: mov %esp, %eax | 1365 | 1: mov %esp, %eax |
1366 | call xen_evtchn_do_upcall | 1366 | call xen_evtchn_do_upcall |
1367 | #ifndef CONFIG_PREEMPT | 1367 | #ifndef CONFIG_PREEMPTION |
1368 | call xen_maybe_preempt_hcall | 1368 | call xen_maybe_preempt_hcall |
1369 | #endif | 1369 | #endif |
1370 | jmp ret_from_intr | 1370 | jmp ret_from_intr |
@@ -1443,8 +1443,12 @@ BUILD_INTERRUPT3(hv_stimer0_callback_vector, HYPERV_STIMER0_VECTOR, | |||
1443 | 1443 | ||
1444 | ENTRY(page_fault) | 1444 | ENTRY(page_fault) |
1445 | ASM_CLAC | 1445 | ASM_CLAC |
1446 | pushl $0; /* %gs's slot on the stack */ | 1446 | pushl $do_page_fault |
1447 | jmp common_exception_read_cr2 | ||
1448 | END(page_fault) | ||
1447 | 1449 | ||
1450 | common_exception_read_cr2: | ||
1451 | /* the function address is in %gs's slot on the stack */ | ||
1448 | SAVE_ALL switch_stacks=1 skip_gs=1 | 1452 | SAVE_ALL switch_stacks=1 skip_gs=1 |
1449 | 1453 | ||
1450 | ENCODE_FRAME_POINTER | 1454 | ENCODE_FRAME_POINTER |
@@ -1452,6 +1456,7 @@ ENTRY(page_fault) | |||
1452 | 1456 | ||
1453 | /* fixup %gs */ | 1457 | /* fixup %gs */ |
1454 | GS_TO_REG %ecx | 1458 | GS_TO_REG %ecx |
1459 | movl PT_GS(%esp), %edi | ||
1455 | REG_TO_PTGS %ecx | 1460 | REG_TO_PTGS %ecx |
1456 | SET_KERNEL_GS %ecx | 1461 | SET_KERNEL_GS %ecx |
1457 | 1462 | ||
@@ -1463,9 +1468,9 @@ ENTRY(page_fault) | |||
1463 | 1468 | ||
1464 | TRACE_IRQS_OFF | 1469 | TRACE_IRQS_OFF |
1465 | movl %esp, %eax # pt_regs pointer | 1470 | movl %esp, %eax # pt_regs pointer |
1466 | call do_page_fault | 1471 | CALL_NOSPEC %edi |
1467 | jmp ret_from_exception | 1472 | jmp ret_from_exception |
1468 | END(page_fault) | 1473 | END(common_exception_read_cr2) |
1469 | 1474 | ||
1470 | common_exception: | 1475 | common_exception: |
1471 | /* the function address is in %gs's slot on the stack */ | 1476 | /* the function address is in %gs's slot on the stack */ |
@@ -1595,7 +1600,7 @@ END(general_protection) | |||
1595 | ENTRY(async_page_fault) | 1600 | ENTRY(async_page_fault) |
1596 | ASM_CLAC | 1601 | ASM_CLAC |
1597 | pushl $do_async_page_fault | 1602 | pushl $do_async_page_fault |
1598 | jmp common_exception | 1603 | jmp common_exception_read_cr2 |
1599 | END(async_page_fault) | 1604 | END(async_page_fault) |
1600 | #endif | 1605 | #endif |
1601 | 1606 | ||
diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S index 3f5a978a02a7..9701464341e4 100644 --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S | |||
@@ -662,7 +662,7 @@ GLOBAL(swapgs_restore_regs_and_return_to_usermode) | |||
662 | 662 | ||
663 | /* Returning to kernel space */ | 663 | /* Returning to kernel space */ |
664 | retint_kernel: | 664 | retint_kernel: |
665 | #ifdef CONFIG_PREEMPT | 665 | #ifdef CONFIG_PREEMPTION |
666 | /* Interrupts are off */ | 666 | /* Interrupts are off */ |
667 | /* Check if we need preemption */ | 667 | /* Check if we need preemption */ |
668 | btl $9, EFLAGS(%rsp) /* were interrupts off? */ | 668 | btl $9, EFLAGS(%rsp) /* were interrupts off? */ |
@@ -1113,7 +1113,7 @@ ENTRY(xen_do_hypervisor_callback) /* do_hypervisor_callback(struct *pt_regs) */ | |||
1113 | call xen_evtchn_do_upcall | 1113 | call xen_evtchn_do_upcall |
1114 | LEAVE_IRQ_STACK | 1114 | LEAVE_IRQ_STACK |
1115 | 1115 | ||
1116 | #ifndef CONFIG_PREEMPT | 1116 | #ifndef CONFIG_PREEMPTION |
1117 | call xen_maybe_preempt_hcall | 1117 | call xen_maybe_preempt_hcall |
1118 | #endif | 1118 | #endif |
1119 | jmp error_exit | 1119 | jmp error_exit |
diff --git a/arch/x86/entry/thunk_32.S b/arch/x86/entry/thunk_32.S index cb3464525b37..2713490611a3 100644 --- a/arch/x86/entry/thunk_32.S +++ b/arch/x86/entry/thunk_32.S | |||
@@ -34,7 +34,7 @@ | |||
34 | THUNK trace_hardirqs_off_thunk,trace_hardirqs_off_caller,1 | 34 | THUNK trace_hardirqs_off_thunk,trace_hardirqs_off_caller,1 |
35 | #endif | 35 | #endif |
36 | 36 | ||
37 | #ifdef CONFIG_PREEMPT | 37 | #ifdef CONFIG_PREEMPTION |
38 | THUNK ___preempt_schedule, preempt_schedule | 38 | THUNK ___preempt_schedule, preempt_schedule |
39 | THUNK ___preempt_schedule_notrace, preempt_schedule_notrace | 39 | THUNK ___preempt_schedule_notrace, preempt_schedule_notrace |
40 | EXPORT_SYMBOL(___preempt_schedule) | 40 | EXPORT_SYMBOL(___preempt_schedule) |
diff --git a/arch/x86/entry/thunk_64.S b/arch/x86/entry/thunk_64.S index cc20465b2867..ea5c4167086c 100644 --- a/arch/x86/entry/thunk_64.S +++ b/arch/x86/entry/thunk_64.S | |||
@@ -46,7 +46,7 @@ | |||
46 | THUNK lockdep_sys_exit_thunk,lockdep_sys_exit | 46 | THUNK lockdep_sys_exit_thunk,lockdep_sys_exit |
47 | #endif | 47 | #endif |
48 | 48 | ||
49 | #ifdef CONFIG_PREEMPT | 49 | #ifdef CONFIG_PREEMPTION |
50 | THUNK ___preempt_schedule, preempt_schedule | 50 | THUNK ___preempt_schedule, preempt_schedule |
51 | THUNK ___preempt_schedule_notrace, preempt_schedule_notrace | 51 | THUNK ___preempt_schedule_notrace, preempt_schedule_notrace |
52 | EXPORT_SYMBOL(___preempt_schedule) | 52 | EXPORT_SYMBOL(___preempt_schedule) |
@@ -55,7 +55,7 @@ | |||
55 | 55 | ||
56 | #if defined(CONFIG_TRACE_IRQFLAGS) \ | 56 | #if defined(CONFIG_TRACE_IRQFLAGS) \ |
57 | || defined(CONFIG_DEBUG_LOCK_ALLOC) \ | 57 | || defined(CONFIG_DEBUG_LOCK_ALLOC) \ |
58 | || defined(CONFIG_PREEMPT) | 58 | || defined(CONFIG_PREEMPTION) |
59 | .L_restore: | 59 | .L_restore: |
60 | popq %r11 | 60 | popq %r11 |
61 | popq %r10 | 61 | popq %r10 |
diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c index 9e911a96972b..648260b5f367 100644 --- a/arch/x86/events/intel/core.c +++ b/arch/x86/events/intel/core.c | |||
@@ -20,7 +20,6 @@ | |||
20 | #include <asm/intel-family.h> | 20 | #include <asm/intel-family.h> |
21 | #include <asm/apic.h> | 21 | #include <asm/apic.h> |
22 | #include <asm/cpu_device_id.h> | 22 | #include <asm/cpu_device_id.h> |
23 | #include <asm/hypervisor.h> | ||
24 | 23 | ||
25 | #include "../perf_event.h" | 24 | #include "../perf_event.h" |
26 | 25 | ||
@@ -263,8 +262,8 @@ static struct event_constraint intel_icl_event_constraints[] = { | |||
263 | }; | 262 | }; |
264 | 263 | ||
265 | static struct extra_reg intel_icl_extra_regs[] __read_mostly = { | 264 | static struct extra_reg intel_icl_extra_regs[] __read_mostly = { |
266 | INTEL_UEVENT_EXTRA_REG(0x01b7, MSR_OFFCORE_RSP_0, 0x3fffff9fffull, RSP_0), | 265 | INTEL_UEVENT_EXTRA_REG(0x01b7, MSR_OFFCORE_RSP_0, 0x3fffffbfffull, RSP_0), |
267 | INTEL_UEVENT_EXTRA_REG(0x01bb, MSR_OFFCORE_RSP_1, 0x3fffff9fffull, RSP_1), | 266 | INTEL_UEVENT_EXTRA_REG(0x01bb, MSR_OFFCORE_RSP_1, 0x3fffffbfffull, RSP_1), |
268 | INTEL_UEVENT_PEBS_LDLAT_EXTRA_REG(0x01cd), | 267 | INTEL_UEVENT_PEBS_LDLAT_EXTRA_REG(0x01cd), |
269 | INTEL_UEVENT_EXTRA_REG(0x01c6, MSR_PEBS_FRONTEND, 0x7fff17, FE), | 268 | INTEL_UEVENT_EXTRA_REG(0x01c6, MSR_PEBS_FRONTEND, 0x7fff17, FE), |
270 | EVENT_EXTRA_END | 269 | EVENT_EXTRA_END |
@@ -4053,7 +4052,7 @@ static bool check_msr(unsigned long msr, u64 mask) | |||
4053 | * Disable the check for real HW, so we don't | 4052 | * Disable the check for real HW, so we don't |
4054 | * mess with potentionaly enabled registers: | 4053 | * mess with potentionaly enabled registers: |
4055 | */ | 4054 | */ |
4056 | if (hypervisor_is_type(X86_HYPER_NATIVE)) | 4055 | if (!boot_cpu_has(X86_FEATURE_HYPERVISOR)) |
4057 | return true; | 4056 | return true; |
4058 | 4057 | ||
4059 | /* | 4058 | /* |
@@ -4955,6 +4954,7 @@ __init int intel_pmu_init(void) | |||
4955 | 4954 | ||
4956 | case INTEL_FAM6_SKYLAKE_X: | 4955 | case INTEL_FAM6_SKYLAKE_X: |
4957 | pmem = true; | 4956 | pmem = true; |
4957 | /* fall through */ | ||
4958 | case INTEL_FAM6_SKYLAKE_MOBILE: | 4958 | case INTEL_FAM6_SKYLAKE_MOBILE: |
4959 | case INTEL_FAM6_SKYLAKE_DESKTOP: | 4959 | case INTEL_FAM6_SKYLAKE_DESKTOP: |
4960 | case INTEL_FAM6_KABYLAKE_MOBILE: | 4960 | case INTEL_FAM6_KABYLAKE_MOBILE: |
@@ -5004,6 +5004,7 @@ __init int intel_pmu_init(void) | |||
5004 | case INTEL_FAM6_ICELAKE_X: | 5004 | case INTEL_FAM6_ICELAKE_X: |
5005 | case INTEL_FAM6_ICELAKE_XEON_D: | 5005 | case INTEL_FAM6_ICELAKE_XEON_D: |
5006 | pmem = true; | 5006 | pmem = true; |
5007 | /* fall through */ | ||
5007 | case INTEL_FAM6_ICELAKE_MOBILE: | 5008 | case INTEL_FAM6_ICELAKE_MOBILE: |
5008 | case INTEL_FAM6_ICELAKE_DESKTOP: | 5009 | case INTEL_FAM6_ICELAKE_DESKTOP: |
5009 | x86_pmu.late_ack = true; | 5010 | x86_pmu.late_ack = true; |
diff --git a/arch/x86/events/intel/ds.c b/arch/x86/events/intel/ds.c index 2c8db2c19328..f1269e804e9b 100644 --- a/arch/x86/events/intel/ds.c +++ b/arch/x86/events/intel/ds.c | |||
@@ -851,7 +851,7 @@ struct event_constraint intel_skl_pebs_event_constraints[] = { | |||
851 | 851 | ||
852 | struct event_constraint intel_icl_pebs_event_constraints[] = { | 852 | struct event_constraint intel_icl_pebs_event_constraints[] = { |
853 | INTEL_FLAGS_UEVENT_CONSTRAINT(0x1c0, 0x100000000ULL), /* INST_RETIRED.PREC_DIST */ | 853 | INTEL_FLAGS_UEVENT_CONSTRAINT(0x1c0, 0x100000000ULL), /* INST_RETIRED.PREC_DIST */ |
854 | INTEL_FLAGS_UEVENT_CONSTRAINT(0x0400, 0x400000000ULL), /* SLOTS */ | 854 | INTEL_FLAGS_UEVENT_CONSTRAINT(0x0400, 0x800000000ULL), /* SLOTS */ |
855 | 855 | ||
856 | INTEL_PLD_CONSTRAINT(0x1cd, 0xff), /* MEM_TRANS_RETIRED.LOAD_LATENCY */ | 856 | INTEL_PLD_CONSTRAINT(0x1cd, 0xff), /* MEM_TRANS_RETIRED.LOAD_LATENCY */ |
857 | INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_LD(0x1d0, 0xf), /* MEM_INST_RETIRED.LOAD */ | 857 | INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_LD(0x1d0, 0xf), /* MEM_INST_RETIRED.LOAD */ |
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index 8282b8d41209..7b0a4ee77313 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h | |||
@@ -607,15 +607,16 @@ struct kvm_vcpu_arch { | |||
607 | 607 | ||
608 | /* | 608 | /* |
609 | * QEMU userspace and the guest each have their own FPU state. | 609 | * QEMU userspace and the guest each have their own FPU state. |
610 | * In vcpu_run, we switch between the user, maintained in the | 610 | * In vcpu_run, we switch between the user and guest FPU contexts. |
611 | * task_struct struct, and guest FPU contexts. While running a VCPU, | 611 | * While running a VCPU, the VCPU thread will have the guest FPU |
612 | * the VCPU thread will have the guest FPU context. | 612 | * context. |
613 | * | 613 | * |
614 | * Note that while the PKRU state lives inside the fpu registers, | 614 | * Note that while the PKRU state lives inside the fpu registers, |
615 | * it is switched out separately at VMENTER and VMEXIT time. The | 615 | * it is switched out separately at VMENTER and VMEXIT time. The |
616 | * "guest_fpu" state here contains the guest FPU context, with the | 616 | * "guest_fpu" state here contains the guest FPU context, with the |
617 | * host PRKU bits. | 617 | * host PRKU bits. |
618 | */ | 618 | */ |
619 | struct fpu *user_fpu; | ||
619 | struct fpu *guest_fpu; | 620 | struct fpu *guest_fpu; |
620 | 621 | ||
621 | u64 xcr0; | 622 | u64 xcr0; |
diff --git a/arch/x86/include/asm/preempt.h b/arch/x86/include/asm/preempt.h index 99a7fa9ab0a3..3d4cb83a8828 100644 --- a/arch/x86/include/asm/preempt.h +++ b/arch/x86/include/asm/preempt.h | |||
@@ -102,7 +102,7 @@ static __always_inline bool should_resched(int preempt_offset) | |||
102 | return unlikely(raw_cpu_read_4(__preempt_count) == preempt_offset); | 102 | return unlikely(raw_cpu_read_4(__preempt_count) == preempt_offset); |
103 | } | 103 | } |
104 | 104 | ||
105 | #ifdef CONFIG_PREEMPT | 105 | #ifdef CONFIG_PREEMPTION |
106 | extern asmlinkage void ___preempt_schedule(void); | 106 | extern asmlinkage void ___preempt_schedule(void); |
107 | # define __preempt_schedule() \ | 107 | # define __preempt_schedule() \ |
108 | asm volatile ("call ___preempt_schedule" : ASM_CALL_CONSTRAINT) | 108 | asm volatile ("call ___preempt_schedule" : ASM_CALL_CONSTRAINT) |
diff --git a/arch/x86/include/uapi/asm/byteorder.h b/arch/x86/include/uapi/asm/byteorder.h index 484e3cfd7ef2..149143cab9ff 100644 --- a/arch/x86/include/uapi/asm/byteorder.h +++ b/arch/x86/include/uapi/asm/byteorder.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
2 | #ifndef _ASM_X86_BYTEORDER_H | 2 | #ifndef _ASM_X86_BYTEORDER_H |
3 | #define _ASM_X86_BYTEORDER_H | 3 | #define _ASM_X86_BYTEORDER_H |
4 | 4 | ||
diff --git a/arch/x86/include/uapi/asm/hwcap2.h b/arch/x86/include/uapi/asm/hwcap2.h index 6ebaae90e207..8b2effe6efb8 100644 --- a/arch/x86/include/uapi/asm/hwcap2.h +++ b/arch/x86/include/uapi/asm/hwcap2.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
2 | #ifndef _ASM_X86_HWCAP2_H | 2 | #ifndef _ASM_X86_HWCAP2_H |
3 | #define _ASM_X86_HWCAP2_H | 3 | #define _ASM_X86_HWCAP2_H |
4 | 4 | ||
diff --git a/arch/x86/include/uapi/asm/sigcontext32.h b/arch/x86/include/uapi/asm/sigcontext32.h index 6b18e88de8a6..7114801d0499 100644 --- a/arch/x86/include/uapi/asm/sigcontext32.h +++ b/arch/x86/include/uapi/asm/sigcontext32.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
2 | #ifndef _ASM_X86_SIGCONTEXT32_H | 2 | #ifndef _ASM_X86_SIGCONTEXT32_H |
3 | #define _ASM_X86_SIGCONTEXT32_H | 3 | #define _ASM_X86_SIGCONTEXT32_H |
4 | 4 | ||
diff --git a/arch/x86/include/uapi/asm/types.h b/arch/x86/include/uapi/asm/types.h index df55e1ddb0c9..9d5c11a24279 100644 --- a/arch/x86/include/uapi/asm/types.h +++ b/arch/x86/include/uapi/asm/types.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
2 | #ifndef _ASM_X86_TYPES_H | 2 | #ifndef _ASM_X86_TYPES_H |
3 | #define _ASM_X86_TYPES_H | 3 | #define _ASM_X86_TYPES_H |
4 | 4 | ||
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index 66ca906aa790..801ecd1c3fd5 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c | |||
@@ -1226,7 +1226,7 @@ static ssize_t l1tf_show_state(char *buf) | |||
1226 | 1226 | ||
1227 | static ssize_t mds_show_state(char *buf) | 1227 | static ssize_t mds_show_state(char *buf) |
1228 | { | 1228 | { |
1229 | if (!hypervisor_is_type(X86_HYPER_NATIVE)) { | 1229 | if (boot_cpu_has(X86_FEATURE_HYPERVISOR)) { |
1230 | return sprintf(buf, "%s; SMT Host state unknown\n", | 1230 | return sprintf(buf, "%s; SMT Host state unknown\n", |
1231 | mds_strings[mds_mitigation]); | 1231 | mds_strings[mds_mitigation]); |
1232 | } | 1232 | } |
diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c index 2b5886401e5f..e07424e19274 100644 --- a/arch/x86/kernel/dumpstack.c +++ b/arch/x86/kernel/dumpstack.c | |||
@@ -367,13 +367,18 @@ NOKPROBE_SYMBOL(oops_end); | |||
367 | 367 | ||
368 | int __die(const char *str, struct pt_regs *regs, long err) | 368 | int __die(const char *str, struct pt_regs *regs, long err) |
369 | { | 369 | { |
370 | const char *pr = ""; | ||
371 | |||
370 | /* Save the regs of the first oops for the executive summary later. */ | 372 | /* Save the regs of the first oops for the executive summary later. */ |
371 | if (!die_counter) | 373 | if (!die_counter) |
372 | exec_summary_regs = *regs; | 374 | exec_summary_regs = *regs; |
373 | 375 | ||
376 | if (IS_ENABLED(CONFIG_PREEMPTION)) | ||
377 | pr = IS_ENABLED(CONFIG_PREEMPT_RT) ? " PREEMPT_RT" : " PREEMPT"; | ||
378 | |||
374 | printk(KERN_DEFAULT | 379 | printk(KERN_DEFAULT |
375 | "%s: %04lx [#%d]%s%s%s%s%s\n", str, err & 0xffff, ++die_counter, | 380 | "%s: %04lx [#%d]%s%s%s%s%s\n", str, err & 0xffff, ++die_counter, |
376 | IS_ENABLED(CONFIG_PREEMPT) ? " PREEMPT" : "", | 381 | pr, |
377 | IS_ENABLED(CONFIG_SMP) ? " SMP" : "", | 382 | IS_ENABLED(CONFIG_SMP) ? " SMP" : "", |
378 | debug_pagealloc_enabled() ? " DEBUG_PAGEALLOC" : "", | 383 | debug_pagealloc_enabled() ? " DEBUG_PAGEALLOC" : "", |
379 | IS_ENABLED(CONFIG_KASAN) ? " KASAN" : "", | 384 | IS_ENABLED(CONFIG_KASAN) ? " KASAN" : "", |
diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S index a6342c899be5..f3d3e9646a99 100644 --- a/arch/x86/kernel/head_64.S +++ b/arch/x86/kernel/head_64.S | |||
@@ -193,10 +193,10 @@ ENTRY(secondary_startup_64) | |||
193 | 193 | ||
194 | /* Set up %gs. | 194 | /* Set up %gs. |
195 | * | 195 | * |
196 | * The base of %gs always points to the bottom of the irqstack | 196 | * The base of %gs always points to fixed_percpu_data. If the |
197 | * union. If the stack protector canary is enabled, it is | 197 | * stack protector canary is enabled, it is located at %gs:40. |
198 | * located at %gs:40. Note that, on SMP, the boot cpu uses | 198 | * Note that, on SMP, the boot cpu uses init data section until |
199 | * init data section till per cpu areas are set up. | 199 | * the per cpu areas are set up. |
200 | */ | 200 | */ |
201 | movl $MSR_GS_BASE,%ecx | 201 | movl $MSR_GS_BASE,%ecx |
202 | movl initial_gs(%rip),%eax | 202 | movl initial_gs(%rip),%eax |
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c index c43e96a938d0..c6f791bc481e 100644 --- a/arch/x86/kernel/hpet.c +++ b/arch/x86/kernel/hpet.c | |||
@@ -827,10 +827,6 @@ int __init hpet_enable(void) | |||
827 | if (!hpet_cfg_working()) | 827 | if (!hpet_cfg_working()) |
828 | goto out_nohpet; | 828 | goto out_nohpet; |
829 | 829 | ||
830 | /* Validate that the counter is counting */ | ||
831 | if (!hpet_counting()) | ||
832 | goto out_nohpet; | ||
833 | |||
834 | /* | 830 | /* |
835 | * Read the period and check for a sane value: | 831 | * Read the period and check for a sane value: |
836 | */ | 832 | */ |
@@ -896,6 +892,14 @@ int __init hpet_enable(void) | |||
896 | } | 892 | } |
897 | hpet_print_config(); | 893 | hpet_print_config(); |
898 | 894 | ||
895 | /* | ||
896 | * Validate that the counter is counting. This needs to be done | ||
897 | * after sanitizing the config registers to properly deal with | ||
898 | * force enabled HPETs. | ||
899 | */ | ||
900 | if (!hpet_counting()) | ||
901 | goto out_nohpet; | ||
902 | |||
899 | clocksource_register_hz(&clocksource_hpet, (u32)hpet_freq); | 903 | clocksource_register_hz(&clocksource_hpet, (u32)hpet_freq); |
900 | 904 | ||
901 | if (id & HPET_ID_LEGSUP) { | 905 | if (id & HPET_ID_LEGSUP) { |
diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c index 0e0b08008b5a..43fc13c831af 100644 --- a/arch/x86/kernel/kprobes/core.c +++ b/arch/x86/kernel/kprobes/core.c | |||
@@ -580,7 +580,7 @@ static void setup_singlestep(struct kprobe *p, struct pt_regs *regs, | |||
580 | if (setup_detour_execution(p, regs, reenter)) | 580 | if (setup_detour_execution(p, regs, reenter)) |
581 | return; | 581 | return; |
582 | 582 | ||
583 | #if !defined(CONFIG_PREEMPT) | 583 | #if !defined(CONFIG_PREEMPTION) |
584 | if (p->ainsn.boostable && !p->post_handler) { | 584 | if (p->ainsn.boostable && !p->post_handler) { |
585 | /* Boost up -- we can execute copied instructions directly */ | 585 | /* Boost up -- we can execute copied instructions directly */ |
586 | if (!reenter) | 586 | if (!reenter) |
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index b7f34fe2171e..3d07f84c4846 100644 --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c | |||
@@ -314,7 +314,7 @@ static void kvm_guest_cpu_init(void) | |||
314 | if (kvm_para_has_feature(KVM_FEATURE_ASYNC_PF) && kvmapf) { | 314 | if (kvm_para_has_feature(KVM_FEATURE_ASYNC_PF) && kvmapf) { |
315 | u64 pa = slow_virt_to_phys(this_cpu_ptr(&apf_reason)); | 315 | u64 pa = slow_virt_to_phys(this_cpu_ptr(&apf_reason)); |
316 | 316 | ||
317 | #ifdef CONFIG_PREEMPT | 317 | #ifdef CONFIG_PREEMPTION |
318 | pa |= KVM_ASYNC_PF_SEND_ALWAYS; | 318 | pa |= KVM_ASYNC_PF_SEND_ALWAYS; |
319 | #endif | 319 | #endif |
320 | pa |= KVM_ASYNC_PF_ENABLED; | 320 | pa |= KVM_ASYNC_PF_ENABLED; |
diff --git a/arch/x86/kernel/stacktrace.c b/arch/x86/kernel/stacktrace.c index 4f36d3241faf..2d6898c2cb64 100644 --- a/arch/x86/kernel/stacktrace.c +++ b/arch/x86/kernel/stacktrace.c | |||
@@ -100,7 +100,7 @@ copy_stack_frame(const void __user *fp, struct stack_frame_user *frame) | |||
100 | { | 100 | { |
101 | int ret; | 101 | int ret; |
102 | 102 | ||
103 | if (!access_ok(fp, sizeof(*frame))) | 103 | if (__range_not_ok(fp, sizeof(*frame), TASK_SIZE)) |
104 | return 0; | 104 | return 0; |
105 | 105 | ||
106 | ret = 1; | 106 | ret = 1; |
diff --git a/arch/x86/kernel/sysfb_efi.c b/arch/x86/kernel/sysfb_efi.c index 8eb67a670b10..653b7f617b61 100644 --- a/arch/x86/kernel/sysfb_efi.c +++ b/arch/x86/kernel/sysfb_efi.c | |||
@@ -230,9 +230,55 @@ static const struct dmi_system_id efifb_dmi_system_table[] __initconst = { | |||
230 | {}, | 230 | {}, |
231 | }; | 231 | }; |
232 | 232 | ||
233 | /* | ||
234 | * Some devices have a portrait LCD but advertise a landscape resolution (and | ||
235 | * pitch). We simply swap width and height for these devices so that we can | ||
236 | * correctly deal with some of them coming with multiple resolutions. | ||
237 | */ | ||
238 | static const struct dmi_system_id efifb_dmi_swap_width_height[] __initconst = { | ||
239 | { | ||
240 | /* | ||
241 | * Lenovo MIIX310-10ICR, only some batches have the troublesome | ||
242 | * 800x1280 portrait screen. Luckily the portrait version has | ||
243 | * its own BIOS version, so we match on that. | ||
244 | */ | ||
245 | .matches = { | ||
246 | DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
247 | DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "MIIX 310-10ICR"), | ||
248 | DMI_EXACT_MATCH(DMI_BIOS_VERSION, "1HCN44WW"), | ||
249 | }, | ||
250 | }, | ||
251 | { | ||
252 | /* Lenovo MIIX 320-10ICR with 800x1280 portrait screen */ | ||
253 | .matches = { | ||
254 | DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
255 | DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, | ||
256 | "Lenovo MIIX 320-10ICR"), | ||
257 | }, | ||
258 | }, | ||
259 | { | ||
260 | /* Lenovo D330 with 800x1280 or 1200x1920 portrait screen */ | ||
261 | .matches = { | ||
262 | DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
263 | DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, | ||
264 | "Lenovo ideapad D330-10IGM"), | ||
265 | }, | ||
266 | }, | ||
267 | {}, | ||
268 | }; | ||
269 | |||
233 | __init void sysfb_apply_efi_quirks(void) | 270 | __init void sysfb_apply_efi_quirks(void) |
234 | { | 271 | { |
235 | if (screen_info.orig_video_isVGA != VIDEO_TYPE_EFI || | 272 | if (screen_info.orig_video_isVGA != VIDEO_TYPE_EFI || |
236 | !(screen_info.capabilities & VIDEO_CAPABILITY_SKIP_QUIRKS)) | 273 | !(screen_info.capabilities & VIDEO_CAPABILITY_SKIP_QUIRKS)) |
237 | dmi_check_system(efifb_dmi_system_table); | 274 | dmi_check_system(efifb_dmi_system_table); |
275 | |||
276 | if (screen_info.orig_video_isVGA == VIDEO_TYPE_EFI && | ||
277 | dmi_check_system(efifb_dmi_swap_width_height)) { | ||
278 | u16 temp = screen_info.lfb_width; | ||
279 | |||
280 | screen_info.lfb_width = screen_info.lfb_height; | ||
281 | screen_info.lfb_height = temp; | ||
282 | screen_info.lfb_linelength = 4 * screen_info.lfb_width; | ||
283 | } | ||
238 | } | 284 | } |
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 8f72526e2f68..24843cf49579 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c | |||
@@ -3466,7 +3466,7 @@ static bool fast_page_fault(struct kvm_vcpu *vcpu, gva_t gva, int level, | |||
3466 | /* | 3466 | /* |
3467 | * Currently, fast page fault only works for direct mapping | 3467 | * Currently, fast page fault only works for direct mapping |
3468 | * since the gfn is not stable for indirect shadow page. See | 3468 | * since the gfn is not stable for indirect shadow page. See |
3469 | * Documentation/virtual/kvm/locking.txt to get more detail. | 3469 | * Documentation/virt/kvm/locking.txt to get more detail. |
3470 | */ | 3470 | */ |
3471 | fault_handled = fast_pf_fix_direct_spte(vcpu, sp, | 3471 | fault_handled = fast_pf_fix_direct_spte(vcpu, sp, |
3472 | iterator.sptep, spte, | 3472 | iterator.sptep, spte, |
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 19f69df96758..7eafc6907861 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
@@ -2143,12 +2143,20 @@ static struct kvm_vcpu *svm_create_vcpu(struct kvm *kvm, unsigned int id) | |||
2143 | goto out; | 2143 | goto out; |
2144 | } | 2144 | } |
2145 | 2145 | ||
2146 | svm->vcpu.arch.user_fpu = kmem_cache_zalloc(x86_fpu_cache, | ||
2147 | GFP_KERNEL_ACCOUNT); | ||
2148 | if (!svm->vcpu.arch.user_fpu) { | ||
2149 | printk(KERN_ERR "kvm: failed to allocate kvm userspace's fpu\n"); | ||
2150 | err = -ENOMEM; | ||
2151 | goto free_partial_svm; | ||
2152 | } | ||
2153 | |||
2146 | svm->vcpu.arch.guest_fpu = kmem_cache_zalloc(x86_fpu_cache, | 2154 | svm->vcpu.arch.guest_fpu = kmem_cache_zalloc(x86_fpu_cache, |
2147 | GFP_KERNEL_ACCOUNT); | 2155 | GFP_KERNEL_ACCOUNT); |
2148 | if (!svm->vcpu.arch.guest_fpu) { | 2156 | if (!svm->vcpu.arch.guest_fpu) { |
2149 | printk(KERN_ERR "kvm: failed to allocate vcpu's fpu\n"); | 2157 | printk(KERN_ERR "kvm: failed to allocate vcpu's fpu\n"); |
2150 | err = -ENOMEM; | 2158 | err = -ENOMEM; |
2151 | goto free_partial_svm; | 2159 | goto free_user_fpu; |
2152 | } | 2160 | } |
2153 | 2161 | ||
2154 | err = kvm_vcpu_init(&svm->vcpu, kvm, id); | 2162 | err = kvm_vcpu_init(&svm->vcpu, kvm, id); |
@@ -2211,6 +2219,8 @@ uninit: | |||
2211 | kvm_vcpu_uninit(&svm->vcpu); | 2219 | kvm_vcpu_uninit(&svm->vcpu); |
2212 | free_svm: | 2220 | free_svm: |
2213 | kmem_cache_free(x86_fpu_cache, svm->vcpu.arch.guest_fpu); | 2221 | kmem_cache_free(x86_fpu_cache, svm->vcpu.arch.guest_fpu); |
2222 | free_user_fpu: | ||
2223 | kmem_cache_free(x86_fpu_cache, svm->vcpu.arch.user_fpu); | ||
2214 | free_partial_svm: | 2224 | free_partial_svm: |
2215 | kmem_cache_free(kvm_vcpu_cache, svm); | 2225 | kmem_cache_free(kvm_vcpu_cache, svm); |
2216 | out: | 2226 | out: |
@@ -2241,6 +2251,7 @@ static void svm_free_vcpu(struct kvm_vcpu *vcpu) | |||
2241 | __free_page(virt_to_page(svm->nested.hsave)); | 2251 | __free_page(virt_to_page(svm->nested.hsave)); |
2242 | __free_pages(virt_to_page(svm->nested.msrpm), MSRPM_ALLOC_ORDER); | 2252 | __free_pages(virt_to_page(svm->nested.msrpm), MSRPM_ALLOC_ORDER); |
2243 | kvm_vcpu_uninit(vcpu); | 2253 | kvm_vcpu_uninit(vcpu); |
2254 | kmem_cache_free(x86_fpu_cache, svm->vcpu.arch.user_fpu); | ||
2244 | kmem_cache_free(x86_fpu_cache, svm->vcpu.arch.guest_fpu); | 2255 | kmem_cache_free(x86_fpu_cache, svm->vcpu.arch.guest_fpu); |
2245 | kmem_cache_free(kvm_vcpu_cache, svm); | 2256 | kmem_cache_free(kvm_vcpu_cache, svm); |
2246 | } | 2257 | } |
diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c index 0f1378789bd0..ced9fba32598 100644 --- a/arch/x86/kvm/vmx/nested.c +++ b/arch/x86/kvm/vmx/nested.c | |||
@@ -220,6 +220,8 @@ static void free_nested(struct kvm_vcpu *vcpu) | |||
220 | if (!vmx->nested.vmxon && !vmx->nested.smm.vmxon) | 220 | if (!vmx->nested.vmxon && !vmx->nested.smm.vmxon) |
221 | return; | 221 | return; |
222 | 222 | ||
223 | kvm_clear_request(KVM_REQ_GET_VMCS12_PAGES, vcpu); | ||
224 | |||
223 | vmx->nested.vmxon = false; | 225 | vmx->nested.vmxon = false; |
224 | vmx->nested.smm.vmxon = false; | 226 | vmx->nested.smm.vmxon = false; |
225 | free_vpid(vmx->nested.vpid02); | 227 | free_vpid(vmx->nested.vpid02); |
@@ -232,7 +234,9 @@ static void free_nested(struct kvm_vcpu *vcpu) | |||
232 | vmx->vmcs01.shadow_vmcs = NULL; | 234 | vmx->vmcs01.shadow_vmcs = NULL; |
233 | } | 235 | } |
234 | kfree(vmx->nested.cached_vmcs12); | 236 | kfree(vmx->nested.cached_vmcs12); |
237 | vmx->nested.cached_vmcs12 = NULL; | ||
235 | kfree(vmx->nested.cached_shadow_vmcs12); | 238 | kfree(vmx->nested.cached_shadow_vmcs12); |
239 | vmx->nested.cached_shadow_vmcs12 = NULL; | ||
236 | /* Unpin physical memory we referred to in the vmcs02 */ | 240 | /* Unpin physical memory we referred to in the vmcs02 */ |
237 | if (vmx->nested.apic_access_page) { | 241 | if (vmx->nested.apic_access_page) { |
238 | kvm_release_page_dirty(vmx->nested.apic_access_page); | 242 | kvm_release_page_dirty(vmx->nested.apic_access_page); |
diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index a279447eb75b..074385c86c09 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c | |||
@@ -6598,6 +6598,7 @@ static void vmx_free_vcpu(struct kvm_vcpu *vcpu) | |||
6598 | free_loaded_vmcs(vmx->loaded_vmcs); | 6598 | free_loaded_vmcs(vmx->loaded_vmcs); |
6599 | kfree(vmx->guest_msrs); | 6599 | kfree(vmx->guest_msrs); |
6600 | kvm_vcpu_uninit(vcpu); | 6600 | kvm_vcpu_uninit(vcpu); |
6601 | kmem_cache_free(x86_fpu_cache, vmx->vcpu.arch.user_fpu); | ||
6601 | kmem_cache_free(x86_fpu_cache, vmx->vcpu.arch.guest_fpu); | 6602 | kmem_cache_free(x86_fpu_cache, vmx->vcpu.arch.guest_fpu); |
6602 | kmem_cache_free(kvm_vcpu_cache, vmx); | 6603 | kmem_cache_free(kvm_vcpu_cache, vmx); |
6603 | } | 6604 | } |
@@ -6613,12 +6614,20 @@ static struct kvm_vcpu *vmx_create_vcpu(struct kvm *kvm, unsigned int id) | |||
6613 | if (!vmx) | 6614 | if (!vmx) |
6614 | return ERR_PTR(-ENOMEM); | 6615 | return ERR_PTR(-ENOMEM); |
6615 | 6616 | ||
6617 | vmx->vcpu.arch.user_fpu = kmem_cache_zalloc(x86_fpu_cache, | ||
6618 | GFP_KERNEL_ACCOUNT); | ||
6619 | if (!vmx->vcpu.arch.user_fpu) { | ||
6620 | printk(KERN_ERR "kvm: failed to allocate kvm userspace's fpu\n"); | ||
6621 | err = -ENOMEM; | ||
6622 | goto free_partial_vcpu; | ||
6623 | } | ||
6624 | |||
6616 | vmx->vcpu.arch.guest_fpu = kmem_cache_zalloc(x86_fpu_cache, | 6625 | vmx->vcpu.arch.guest_fpu = kmem_cache_zalloc(x86_fpu_cache, |
6617 | GFP_KERNEL_ACCOUNT); | 6626 | GFP_KERNEL_ACCOUNT); |
6618 | if (!vmx->vcpu.arch.guest_fpu) { | 6627 | if (!vmx->vcpu.arch.guest_fpu) { |
6619 | printk(KERN_ERR "kvm: failed to allocate vcpu's fpu\n"); | 6628 | printk(KERN_ERR "kvm: failed to allocate vcpu's fpu\n"); |
6620 | err = -ENOMEM; | 6629 | err = -ENOMEM; |
6621 | goto free_partial_vcpu; | 6630 | goto free_user_fpu; |
6622 | } | 6631 | } |
6623 | 6632 | ||
6624 | vmx->vpid = allocate_vpid(); | 6633 | vmx->vpid = allocate_vpid(); |
@@ -6721,6 +6730,8 @@ uninit_vcpu: | |||
6721 | free_vcpu: | 6730 | free_vcpu: |
6722 | free_vpid(vmx->vpid); | 6731 | free_vpid(vmx->vpid); |
6723 | kmem_cache_free(x86_fpu_cache, vmx->vcpu.arch.guest_fpu); | 6732 | kmem_cache_free(x86_fpu_cache, vmx->vcpu.arch.guest_fpu); |
6733 | free_user_fpu: | ||
6734 | kmem_cache_free(x86_fpu_cache, vmx->vcpu.arch.user_fpu); | ||
6724 | free_partial_vcpu: | 6735 | free_partial_vcpu: |
6725 | kmem_cache_free(kvm_vcpu_cache, vmx); | 6736 | kmem_cache_free(kvm_vcpu_cache, vmx); |
6726 | return ERR_PTR(err); | 6737 | return ERR_PTR(err); |
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 58305cf81182..c6d951cbd76c 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -3306,6 +3306,10 @@ void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu) | |||
3306 | 3306 | ||
3307 | kvm_x86_ops->vcpu_load(vcpu, cpu); | 3307 | kvm_x86_ops->vcpu_load(vcpu, cpu); |
3308 | 3308 | ||
3309 | fpregs_assert_state_consistent(); | ||
3310 | if (test_thread_flag(TIF_NEED_FPU_LOAD)) | ||
3311 | switch_fpu_return(); | ||
3312 | |||
3309 | /* Apply any externally detected TSC adjustments (due to suspend) */ | 3313 | /* Apply any externally detected TSC adjustments (due to suspend) */ |
3310 | if (unlikely(vcpu->arch.tsc_offset_adjustment)) { | 3314 | if (unlikely(vcpu->arch.tsc_offset_adjustment)) { |
3311 | adjust_tsc_offset_host(vcpu, vcpu->arch.tsc_offset_adjustment); | 3315 | adjust_tsc_offset_host(vcpu, vcpu->arch.tsc_offset_adjustment); |
@@ -7202,7 +7206,7 @@ static void kvm_sched_yield(struct kvm *kvm, unsigned long dest_id) | |||
7202 | 7206 | ||
7203 | rcu_read_unlock(); | 7207 | rcu_read_unlock(); |
7204 | 7208 | ||
7205 | if (target) | 7209 | if (target && READ_ONCE(target->ready)) |
7206 | kvm_vcpu_yield_to(target); | 7210 | kvm_vcpu_yield_to(target); |
7207 | } | 7211 | } |
7208 | 7212 | ||
@@ -7242,6 +7246,7 @@ int kvm_emulate_hypercall(struct kvm_vcpu *vcpu) | |||
7242 | break; | 7246 | break; |
7243 | case KVM_HC_KICK_CPU: | 7247 | case KVM_HC_KICK_CPU: |
7244 | kvm_pv_kick_cpu_op(vcpu->kvm, a0, a1); | 7248 | kvm_pv_kick_cpu_op(vcpu->kvm, a0, a1); |
7249 | kvm_sched_yield(vcpu->kvm, a1); | ||
7245 | ret = 0; | 7250 | ret = 0; |
7246 | break; | 7251 | break; |
7247 | #ifdef CONFIG_X86_64 | 7252 | #ifdef CONFIG_X86_64 |
@@ -7990,9 +7995,8 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu) | |||
7990 | trace_kvm_entry(vcpu->vcpu_id); | 7995 | trace_kvm_entry(vcpu->vcpu_id); |
7991 | guest_enter_irqoff(); | 7996 | guest_enter_irqoff(); |
7992 | 7997 | ||
7993 | fpregs_assert_state_consistent(); | 7998 | /* The preempt notifier should have taken care of the FPU already. */ |
7994 | if (test_thread_flag(TIF_NEED_FPU_LOAD)) | 7999 | WARN_ON_ONCE(test_thread_flag(TIF_NEED_FPU_LOAD)); |
7995 | switch_fpu_return(); | ||
7996 | 8000 | ||
7997 | if (unlikely(vcpu->arch.switch_db_regs)) { | 8001 | if (unlikely(vcpu->arch.switch_db_regs)) { |
7998 | set_debugreg(0, 7); | 8002 | set_debugreg(0, 7); |
@@ -8270,7 +8274,7 @@ static void kvm_load_guest_fpu(struct kvm_vcpu *vcpu) | |||
8270 | { | 8274 | { |
8271 | fpregs_lock(); | 8275 | fpregs_lock(); |
8272 | 8276 | ||
8273 | copy_fpregs_to_fpstate(¤t->thread.fpu); | 8277 | copy_fpregs_to_fpstate(vcpu->arch.user_fpu); |
8274 | /* PKRU is separately restored in kvm_x86_ops->run. */ | 8278 | /* PKRU is separately restored in kvm_x86_ops->run. */ |
8275 | __copy_kernel_to_fpregs(&vcpu->arch.guest_fpu->state, | 8279 | __copy_kernel_to_fpregs(&vcpu->arch.guest_fpu->state, |
8276 | ~XFEATURE_MASK_PKRU); | 8280 | ~XFEATURE_MASK_PKRU); |
@@ -8287,7 +8291,7 @@ static void kvm_put_guest_fpu(struct kvm_vcpu *vcpu) | |||
8287 | fpregs_lock(); | 8291 | fpregs_lock(); |
8288 | 8292 | ||
8289 | copy_fpregs_to_fpstate(vcpu->arch.guest_fpu); | 8293 | copy_fpregs_to_fpstate(vcpu->arch.guest_fpu); |
8290 | copy_kernel_to_fpregs(¤t->thread.fpu.state); | 8294 | copy_kernel_to_fpregs(&vcpu->arch.user_fpu->state); |
8291 | 8295 | ||
8292 | fpregs_mark_activate(); | 8296 | fpregs_mark_activate(); |
8293 | fpregs_unlock(); | 8297 | fpregs_unlock(); |
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index 6c46095cd0d9..9ceacd1156db 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c | |||
@@ -177,13 +177,14 @@ static inline pmd_t *vmalloc_sync_one(pgd_t *pgd, unsigned long address) | |||
177 | 177 | ||
178 | pmd = pmd_offset(pud, address); | 178 | pmd = pmd_offset(pud, address); |
179 | pmd_k = pmd_offset(pud_k, address); | 179 | pmd_k = pmd_offset(pud_k, address); |
180 | if (!pmd_present(*pmd_k)) | ||
181 | return NULL; | ||
182 | 180 | ||
183 | if (!pmd_present(*pmd)) | 181 | if (pmd_present(*pmd) != pmd_present(*pmd_k)) |
184 | set_pmd(pmd, *pmd_k); | 182 | set_pmd(pmd, *pmd_k); |
183 | |||
184 | if (!pmd_present(*pmd_k)) | ||
185 | return NULL; | ||
185 | else | 186 | else |
186 | BUG_ON(pmd_page(*pmd) != pmd_page(*pmd_k)); | 187 | BUG_ON(pmd_pfn(*pmd) != pmd_pfn(*pmd_k)); |
187 | 188 | ||
188 | return pmd_k; | 189 | return pmd_k; |
189 | } | 190 | } |
@@ -203,17 +204,13 @@ void vmalloc_sync_all(void) | |||
203 | spin_lock(&pgd_lock); | 204 | spin_lock(&pgd_lock); |
204 | list_for_each_entry(page, &pgd_list, lru) { | 205 | list_for_each_entry(page, &pgd_list, lru) { |
205 | spinlock_t *pgt_lock; | 206 | spinlock_t *pgt_lock; |
206 | pmd_t *ret; | ||
207 | 207 | ||
208 | /* the pgt_lock only for Xen */ | 208 | /* the pgt_lock only for Xen */ |
209 | pgt_lock = &pgd_page_get_mm(page)->page_table_lock; | 209 | pgt_lock = &pgd_page_get_mm(page)->page_table_lock; |
210 | 210 | ||
211 | spin_lock(pgt_lock); | 211 | spin_lock(pgt_lock); |
212 | ret = vmalloc_sync_one(page_address(page), address); | 212 | vmalloc_sync_one(page_address(page), address); |
213 | spin_unlock(pgt_lock); | 213 | spin_unlock(pgt_lock); |
214 | |||
215 | if (!ret) | ||
216 | break; | ||
217 | } | 214 | } |
218 | spin_unlock(&pgd_lock); | 215 | spin_unlock(&pgd_lock); |
219 | } | 216 | } |
diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index 72860325245a..586fcfe227ea 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c | |||
@@ -3354,38 +3354,57 @@ static void bfq_dispatch_remove(struct request_queue *q, struct request *rq) | |||
3354 | * there is no active group, then the primary expectation for | 3354 | * there is no active group, then the primary expectation for |
3355 | * this device is probably a high throughput. | 3355 | * this device is probably a high throughput. |
3356 | * | 3356 | * |
3357 | * We are now left only with explaining the additional | 3357 | * We are now left only with explaining the two sub-conditions in the |
3358 | * compound condition that is checked below for deciding | 3358 | * additional compound condition that is checked below for deciding |
3359 | * whether the scenario is asymmetric. To explain this | 3359 | * whether the scenario is asymmetric. To explain the first |
3360 | * compound condition, we need to add that the function | 3360 | * sub-condition, we need to add that the function |
3361 | * bfq_asymmetric_scenario checks the weights of only | 3361 | * bfq_asymmetric_scenario checks the weights of only |
3362 | * non-weight-raised queues, for efficiency reasons (see | 3362 | * non-weight-raised queues, for efficiency reasons (see comments on |
3363 | * comments on bfq_weights_tree_add()). Then the fact that | 3363 | * bfq_weights_tree_add()). Then the fact that bfqq is weight-raised |
3364 | * bfqq is weight-raised is checked explicitly here. More | 3364 | * is checked explicitly here. More precisely, the compound condition |
3365 | * precisely, the compound condition below takes into account | 3365 | * below takes into account also the fact that, even if bfqq is being |
3366 | * also the fact that, even if bfqq is being weight-raised, | 3366 | * weight-raised, the scenario is still symmetric if all queues with |
3367 | * the scenario is still symmetric if all queues with requests | 3367 | * requests waiting for completion happen to be |
3368 | * waiting for completion happen to be | 3368 | * weight-raised. Actually, we should be even more precise here, and |
3369 | * weight-raised. Actually, we should be even more precise | 3369 | * differentiate between interactive weight raising and soft real-time |
3370 | * here, and differentiate between interactive weight raising | 3370 | * weight raising. |
3371 | * and soft real-time weight raising. | 3371 | * |
3372 | * The second sub-condition checked in the compound condition is | ||
3373 | * whether there is a fair amount of already in-flight I/O not | ||
3374 | * belonging to bfqq. If so, I/O dispatching is to be plugged, for the | ||
3375 | * following reason. The drive may decide to serve in-flight | ||
3376 | * non-bfqq's I/O requests before bfqq's ones, thereby delaying the | ||
3377 | * arrival of new I/O requests for bfqq (recall that bfqq is sync). If | ||
3378 | * I/O-dispatching is not plugged, then, while bfqq remains empty, a | ||
3379 | * basically uncontrolled amount of I/O from other queues may be | ||
3380 | * dispatched too, possibly causing the service of bfqq's I/O to be | ||
3381 | * delayed even longer in the drive. This problem gets more and more | ||
3382 | * serious as the speed and the queue depth of the drive grow, | ||
3383 | * because, as these two quantities grow, the probability to find no | ||
3384 | * queue busy but many requests in flight grows too. By contrast, | ||
3385 | * plugging I/O dispatching minimizes the delay induced by already | ||
3386 | * in-flight I/O, and enables bfqq to recover the bandwidth it may | ||
3387 | * lose because of this delay. | ||
3372 | * | 3388 | * |
3373 | * As a side note, it is worth considering that the above | 3389 | * As a side note, it is worth considering that the above |
3374 | * device-idling countermeasures may however fail in the | 3390 | * device-idling countermeasures may however fail in the following |
3375 | * following unlucky scenario: if idling is (correctly) | 3391 | * unlucky scenario: if I/O-dispatch plugging is (correctly) disabled |
3376 | * disabled in a time period during which all symmetry | 3392 | * in a time period during which all symmetry sub-conditions hold, and |
3377 | * sub-conditions hold, and hence the device is allowed to | 3393 | * therefore the device is allowed to enqueue many requests, but at |
3378 | * enqueue many requests, but at some later point in time some | 3394 | * some later point in time some sub-condition stops to hold, then it |
3379 | * sub-condition stops to hold, then it may become impossible | 3395 | * may become impossible to make requests be served in the desired |
3380 | * to let requests be served in the desired order until all | 3396 | * order until all the requests already queued in the device have been |
3381 | * the requests already queued in the device have been served. | 3397 | * served. The last sub-condition commented above somewhat mitigates |
3398 | * this problem for weight-raised queues. | ||
3382 | */ | 3399 | */ |
3383 | static bool idling_needed_for_service_guarantees(struct bfq_data *bfqd, | 3400 | static bool idling_needed_for_service_guarantees(struct bfq_data *bfqd, |
3384 | struct bfq_queue *bfqq) | 3401 | struct bfq_queue *bfqq) |
3385 | { | 3402 | { |
3386 | return (bfqq->wr_coeff > 1 && | 3403 | return (bfqq->wr_coeff > 1 && |
3387 | bfqd->wr_busy_queues < | 3404 | (bfqd->wr_busy_queues < |
3388 | bfq_tot_busy_queues(bfqd)) || | 3405 | bfq_tot_busy_queues(bfqd) || |
3406 | bfqd->rq_in_driver >= | ||
3407 | bfqq->dispatched + 4)) || | ||
3389 | bfq_asymmetric_scenario(bfqd, bfqq); | 3408 | bfq_asymmetric_scenario(bfqd, bfqq); |
3390 | } | 3409 | } |
3391 | 3410 | ||
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index 24ed26957367..55a7dc227dfb 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c | |||
@@ -54,7 +54,7 @@ static struct blkcg_policy *blkcg_policy[BLKCG_MAX_POLS]; | |||
54 | 54 | ||
55 | static LIST_HEAD(all_blkcgs); /* protected by blkcg_pol_mutex */ | 55 | static LIST_HEAD(all_blkcgs); /* protected by blkcg_pol_mutex */ |
56 | 56 | ||
57 | static bool blkcg_debug_stats = false; | 57 | bool blkcg_debug_stats = false; |
58 | static struct workqueue_struct *blkcg_punt_bio_wq; | 58 | static struct workqueue_struct *blkcg_punt_bio_wq; |
59 | 59 | ||
60 | static bool blkcg_policy_enabled(struct request_queue *q, | 60 | static bool blkcg_policy_enabled(struct request_queue *q, |
@@ -944,10 +944,7 @@ static int blkcg_print_stat(struct seq_file *sf, void *v) | |||
944 | dbytes, dios); | 944 | dbytes, dios); |
945 | } | 945 | } |
946 | 946 | ||
947 | if (!blkcg_debug_stats) | 947 | if (blkcg_debug_stats && atomic_read(&blkg->use_delay)) { |
948 | goto next; | ||
949 | |||
950 | if (atomic_read(&blkg->use_delay)) { | ||
951 | has_stats = true; | 948 | has_stats = true; |
952 | off += scnprintf(buf+off, size-off, | 949 | off += scnprintf(buf+off, size-off, |
953 | " use_delay=%d delay_nsec=%llu", | 950 | " use_delay=%d delay_nsec=%llu", |
@@ -967,7 +964,7 @@ static int blkcg_print_stat(struct seq_file *sf, void *v) | |||
967 | has_stats = true; | 964 | has_stats = true; |
968 | off += written; | 965 | off += written; |
969 | } | 966 | } |
970 | next: | 967 | |
971 | if (has_stats) { | 968 | if (has_stats) { |
972 | if (off < size - 1) { | 969 | if (off < size - 1) { |
973 | off += scnprintf(buf+off, size-off, "\n"); | 970 | off += scnprintf(buf+off, size-off, "\n"); |
diff --git a/block/blk-iolatency.c b/block/blk-iolatency.c index d973c38ee4fd..0fff7b56df0e 100644 --- a/block/blk-iolatency.c +++ b/block/blk-iolatency.c | |||
@@ -917,6 +917,9 @@ static size_t iolatency_pd_stat(struct blkg_policy_data *pd, char *buf, | |||
917 | unsigned long long avg_lat; | 917 | unsigned long long avg_lat; |
918 | unsigned long long cur_win; | 918 | unsigned long long cur_win; |
919 | 919 | ||
920 | if (!blkcg_debug_stats) | ||
921 | return 0; | ||
922 | |||
920 | if (iolat->ssd) | 923 | if (iolat->ssd) |
921 | return iolatency_ssd_stat(iolat, buf, size); | 924 | return iolatency_ssd_stat(iolat, buf, size); |
922 | 925 | ||
diff --git a/block/blk-mq-sched.h b/block/blk-mq-sched.h index cf22ab00fefb..126021fc3a11 100644 --- a/block/blk-mq-sched.h +++ b/block/blk-mq-sched.h | |||
@@ -61,15 +61,6 @@ static inline void blk_mq_sched_completed_request(struct request *rq, u64 now) | |||
61 | e->type->ops.completed_request(rq, now); | 61 | e->type->ops.completed_request(rq, now); |
62 | } | 62 | } |
63 | 63 | ||
64 | static inline void blk_mq_sched_started_request(struct request *rq) | ||
65 | { | ||
66 | struct request_queue *q = rq->q; | ||
67 | struct elevator_queue *e = q->elevator; | ||
68 | |||
69 | if (e && e->type->ops.started_request) | ||
70 | e->type->ops.started_request(rq); | ||
71 | } | ||
72 | |||
73 | static inline void blk_mq_sched_requeue_request(struct request *rq) | 64 | static inline void blk_mq_sched_requeue_request(struct request *rq) |
74 | { | 65 | { |
75 | struct request_queue *q = rq->q; | 66 | struct request_queue *q = rq->q; |
diff --git a/block/blk-mq.c b/block/blk-mq.c index b038ec680e84..f78d3287dd82 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c | |||
@@ -669,8 +669,6 @@ void blk_mq_start_request(struct request *rq) | |||
669 | { | 669 | { |
670 | struct request_queue *q = rq->q; | 670 | struct request_queue *q = rq->q; |
671 | 671 | ||
672 | blk_mq_sched_started_request(rq); | ||
673 | |||
674 | trace_block_rq_issue(q, rq); | 672 | trace_block_rq_issue(q, rq); |
675 | 673 | ||
676 | if (test_bit(QUEUE_FLAG_STATS, &q->queue_flags)) { | 674 | if (test_bit(QUEUE_FLAG_STATS, &q->queue_flags)) { |
@@ -1960,9 +1958,13 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio) | |||
1960 | rq = blk_mq_get_request(q, bio, &data); | 1958 | rq = blk_mq_get_request(q, bio, &data); |
1961 | if (unlikely(!rq)) { | 1959 | if (unlikely(!rq)) { |
1962 | rq_qos_cleanup(q, bio); | 1960 | rq_qos_cleanup(q, bio); |
1963 | if (bio->bi_opf & REQ_NOWAIT) | 1961 | |
1962 | cookie = BLK_QC_T_NONE; | ||
1963 | if (bio->bi_opf & REQ_NOWAIT_INLINE) | ||
1964 | cookie = BLK_QC_T_EAGAIN; | ||
1965 | else if (bio->bi_opf & REQ_NOWAIT) | ||
1964 | bio_wouldblock_error(bio); | 1966 | bio_wouldblock_error(bio); |
1965 | return BLK_QC_T_NONE; | 1967 | return cookie; |
1966 | } | 1968 | } |
1967 | 1969 | ||
1968 | trace_block_getrq(q, bio, bio->bi_opf); | 1970 | trace_block_getrq(q, bio, bio->bi_opf); |
diff --git a/block/blk-rq-qos.c b/block/blk-rq-qos.c index 659ccb8b693f..3954c0dc1443 100644 --- a/block/blk-rq-qos.c +++ b/block/blk-rq-qos.c | |||
@@ -202,6 +202,7 @@ static int rq_qos_wake_function(struct wait_queue_entry *curr, | |||
202 | return -1; | 202 | return -1; |
203 | 203 | ||
204 | data->got_token = true; | 204 | data->got_token = true; |
205 | smp_wmb(); | ||
205 | list_del_init(&curr->entry); | 206 | list_del_init(&curr->entry); |
206 | wake_up_process(data->task); | 207 | wake_up_process(data->task); |
207 | return 1; | 208 | return 1; |
@@ -244,7 +245,9 @@ void rq_qos_wait(struct rq_wait *rqw, void *private_data, | |||
244 | return; | 245 | return; |
245 | 246 | ||
246 | prepare_to_wait_exclusive(&rqw->wait, &data.wq, TASK_UNINTERRUPTIBLE); | 247 | prepare_to_wait_exclusive(&rqw->wait, &data.wq, TASK_UNINTERRUPTIBLE); |
248 | has_sleeper = !wq_has_single_sleeper(&rqw->wait); | ||
247 | do { | 249 | do { |
250 | /* The memory barrier in set_task_state saves us here. */ | ||
248 | if (data.got_token) | 251 | if (data.got_token) |
249 | break; | 252 | break; |
250 | if (!has_sleeper && acquire_inflight_cb(rqw, private_data)) { | 253 | if (!has_sleeper && acquire_inflight_cb(rqw, private_data)) { |
@@ -255,12 +258,14 @@ void rq_qos_wait(struct rq_wait *rqw, void *private_data, | |||
255 | * which means we now have two. Put our local token | 258 | * which means we now have two. Put our local token |
256 | * and wake anyone else potentially waiting for one. | 259 | * and wake anyone else potentially waiting for one. |
257 | */ | 260 | */ |
261 | smp_rmb(); | ||
258 | if (data.got_token) | 262 | if (data.got_token) |
259 | cleanup_cb(rqw, private_data); | 263 | cleanup_cb(rqw, private_data); |
260 | break; | 264 | break; |
261 | } | 265 | } |
262 | io_schedule(); | 266 | io_schedule(); |
263 | has_sleeper = false; | 267 | has_sleeper = true; |
268 | set_current_state(TASK_UNINTERRUPTIBLE); | ||
264 | } while (1); | 269 | } while (1); |
265 | finish_wait(&rqw->wait, &data.wq); | 270 | finish_wait(&rqw->wait, &data.wq); |
266 | } | 271 | } |
diff --git a/block/blk-settings.c b/block/blk-settings.c index 2ae348c101a0..2c1831207a8f 100644 --- a/block/blk-settings.c +++ b/block/blk-settings.c | |||
@@ -752,7 +752,8 @@ void blk_queue_virt_boundary(struct request_queue *q, unsigned long mask) | |||
752 | * page (which might not be idential to the Linux PAGE_SIZE). Because | 752 | * page (which might not be idential to the Linux PAGE_SIZE). Because |
753 | * of that they are not limited by our notion of "segment size". | 753 | * of that they are not limited by our notion of "segment size". |
754 | */ | 754 | */ |
755 | q->limits.max_segment_size = UINT_MAX; | 755 | if (mask) |
756 | q->limits.max_segment_size = UINT_MAX; | ||
756 | } | 757 | } |
757 | EXPORT_SYMBOL(blk_queue_virt_boundary); | 758 | EXPORT_SYMBOL(blk_queue_virt_boundary); |
758 | 759 | ||
diff --git a/block/genhd.c b/block/genhd.c index 97887e59f3b2..54f1f0d381f4 100644 --- a/block/genhd.c +++ b/block/genhd.c | |||
@@ -1969,7 +1969,7 @@ static const struct attribute *disk_events_attrs[] = { | |||
1969 | * The default polling interval can be specified by the kernel | 1969 | * The default polling interval can be specified by the kernel |
1970 | * parameter block.events_dfl_poll_msecs which defaults to 0 | 1970 | * parameter block.events_dfl_poll_msecs which defaults to 0 |
1971 | * (disable). This can also be modified runtime by writing to | 1971 | * (disable). This can also be modified runtime by writing to |
1972 | * /sys/module/block/events_dfl_poll_msecs. | 1972 | * /sys/module/block/parameters/events_dfl_poll_msecs. |
1973 | */ | 1973 | */ |
1974 | static int disk_events_set_dfl_poll_msecs(const char *val, | 1974 | static int disk_events_set_dfl_poll_msecs(const char *val, |
1975 | const struct kernel_param *kp) | 1975 | const struct kernel_param *kp) |
diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c index d4551e33fa71..8569b79e8b58 100644 --- a/drivers/acpi/arm64/iort.c +++ b/drivers/acpi/arm64/iort.c | |||
@@ -611,8 +611,8 @@ static int iort_dev_find_its_id(struct device *dev, u32 req_id, | |||
611 | 611 | ||
612 | /* Move to ITS specific data */ | 612 | /* Move to ITS specific data */ |
613 | its = (struct acpi_iort_its_group *)node->node_data; | 613 | its = (struct acpi_iort_its_group *)node->node_data; |
614 | if (idx > its->its_count) { | 614 | if (idx >= its->its_count) { |
615 | dev_err(dev, "requested ITS ID index [%d] is greater than available [%d]\n", | 615 | dev_err(dev, "requested ITS ID index [%d] overruns ITS entries [%d]\n", |
616 | idx, its->its_count); | 616 | idx, its->its_count); |
617 | return -ENXIO; | 617 | return -ENXIO; |
618 | } | 618 | } |
diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c index c02fa27dd3f3..1413324982f0 100644 --- a/drivers/acpi/nfit/core.c +++ b/drivers/acpi/nfit/core.c | |||
@@ -1282,7 +1282,7 @@ static ssize_t hw_error_scrub_store(struct device *dev, | |||
1282 | if (rc) | 1282 | if (rc) |
1283 | return rc; | 1283 | return rc; |
1284 | 1284 | ||
1285 | device_lock(dev); | 1285 | nfit_device_lock(dev); |
1286 | nd_desc = dev_get_drvdata(dev); | 1286 | nd_desc = dev_get_drvdata(dev); |
1287 | if (nd_desc) { | 1287 | if (nd_desc) { |
1288 | struct acpi_nfit_desc *acpi_desc = to_acpi_desc(nd_desc); | 1288 | struct acpi_nfit_desc *acpi_desc = to_acpi_desc(nd_desc); |
@@ -1299,7 +1299,7 @@ static ssize_t hw_error_scrub_store(struct device *dev, | |||
1299 | break; | 1299 | break; |
1300 | } | 1300 | } |
1301 | } | 1301 | } |
1302 | device_unlock(dev); | 1302 | nfit_device_unlock(dev); |
1303 | if (rc) | 1303 | if (rc) |
1304 | return rc; | 1304 | return rc; |
1305 | return size; | 1305 | return size; |
@@ -1319,7 +1319,7 @@ static ssize_t scrub_show(struct device *dev, | |||
1319 | ssize_t rc = -ENXIO; | 1319 | ssize_t rc = -ENXIO; |
1320 | bool busy; | 1320 | bool busy; |
1321 | 1321 | ||
1322 | device_lock(dev); | 1322 | nfit_device_lock(dev); |
1323 | nd_desc = dev_get_drvdata(dev); | 1323 | nd_desc = dev_get_drvdata(dev); |
1324 | if (!nd_desc) { | 1324 | if (!nd_desc) { |
1325 | device_unlock(dev); | 1325 | device_unlock(dev); |
@@ -1339,7 +1339,7 @@ static ssize_t scrub_show(struct device *dev, | |||
1339 | } | 1339 | } |
1340 | 1340 | ||
1341 | mutex_unlock(&acpi_desc->init_mutex); | 1341 | mutex_unlock(&acpi_desc->init_mutex); |
1342 | device_unlock(dev); | 1342 | nfit_device_unlock(dev); |
1343 | return rc; | 1343 | return rc; |
1344 | } | 1344 | } |
1345 | 1345 | ||
@@ -1356,14 +1356,14 @@ static ssize_t scrub_store(struct device *dev, | |||
1356 | if (val != 1) | 1356 | if (val != 1) |
1357 | return -EINVAL; | 1357 | return -EINVAL; |
1358 | 1358 | ||
1359 | device_lock(dev); | 1359 | nfit_device_lock(dev); |
1360 | nd_desc = dev_get_drvdata(dev); | 1360 | nd_desc = dev_get_drvdata(dev); |
1361 | if (nd_desc) { | 1361 | if (nd_desc) { |
1362 | struct acpi_nfit_desc *acpi_desc = to_acpi_desc(nd_desc); | 1362 | struct acpi_nfit_desc *acpi_desc = to_acpi_desc(nd_desc); |
1363 | 1363 | ||
1364 | rc = acpi_nfit_ars_rescan(acpi_desc, ARS_REQ_LONG); | 1364 | rc = acpi_nfit_ars_rescan(acpi_desc, ARS_REQ_LONG); |
1365 | } | 1365 | } |
1366 | device_unlock(dev); | 1366 | nfit_device_unlock(dev); |
1367 | if (rc) | 1367 | if (rc) |
1368 | return rc; | 1368 | return rc; |
1369 | return size; | 1369 | return size; |
@@ -1749,9 +1749,9 @@ static void acpi_nvdimm_notify(acpi_handle handle, u32 event, void *data) | |||
1749 | struct acpi_device *adev = data; | 1749 | struct acpi_device *adev = data; |
1750 | struct device *dev = &adev->dev; | 1750 | struct device *dev = &adev->dev; |
1751 | 1751 | ||
1752 | device_lock(dev->parent); | 1752 | nfit_device_lock(dev->parent); |
1753 | __acpi_nvdimm_notify(dev, event); | 1753 | __acpi_nvdimm_notify(dev, event); |
1754 | device_unlock(dev->parent); | 1754 | nfit_device_unlock(dev->parent); |
1755 | } | 1755 | } |
1756 | 1756 | ||
1757 | static bool acpi_nvdimm_has_method(struct acpi_device *adev, char *method) | 1757 | static bool acpi_nvdimm_has_method(struct acpi_device *adev, char *method) |
@@ -3457,8 +3457,8 @@ static int acpi_nfit_flush_probe(struct nvdimm_bus_descriptor *nd_desc) | |||
3457 | struct device *dev = acpi_desc->dev; | 3457 | struct device *dev = acpi_desc->dev; |
3458 | 3458 | ||
3459 | /* Bounce the device lock to flush acpi_nfit_add / acpi_nfit_notify */ | 3459 | /* Bounce the device lock to flush acpi_nfit_add / acpi_nfit_notify */ |
3460 | device_lock(dev); | 3460 | nfit_device_lock(dev); |
3461 | device_unlock(dev); | 3461 | nfit_device_unlock(dev); |
3462 | 3462 | ||
3463 | /* Bounce the init_mutex to complete initial registration */ | 3463 | /* Bounce the init_mutex to complete initial registration */ |
3464 | mutex_lock(&acpi_desc->init_mutex); | 3464 | mutex_lock(&acpi_desc->init_mutex); |
@@ -3602,8 +3602,8 @@ void acpi_nfit_shutdown(void *data) | |||
3602 | * acpi_nfit_ars_rescan() submissions have had a chance to | 3602 | * acpi_nfit_ars_rescan() submissions have had a chance to |
3603 | * either submit or see ->cancel set. | 3603 | * either submit or see ->cancel set. |
3604 | */ | 3604 | */ |
3605 | device_lock(bus_dev); | 3605 | nfit_device_lock(bus_dev); |
3606 | device_unlock(bus_dev); | 3606 | nfit_device_unlock(bus_dev); |
3607 | 3607 | ||
3608 | flush_workqueue(nfit_wq); | 3608 | flush_workqueue(nfit_wq); |
3609 | } | 3609 | } |
@@ -3746,9 +3746,9 @@ EXPORT_SYMBOL_GPL(__acpi_nfit_notify); | |||
3746 | 3746 | ||
3747 | static void acpi_nfit_notify(struct acpi_device *adev, u32 event) | 3747 | static void acpi_nfit_notify(struct acpi_device *adev, u32 event) |
3748 | { | 3748 | { |
3749 | device_lock(&adev->dev); | 3749 | nfit_device_lock(&adev->dev); |
3750 | __acpi_nfit_notify(&adev->dev, adev->handle, event); | 3750 | __acpi_nfit_notify(&adev->dev, adev->handle, event); |
3751 | device_unlock(&adev->dev); | 3751 | nfit_device_unlock(&adev->dev); |
3752 | } | 3752 | } |
3753 | 3753 | ||
3754 | static const struct acpi_device_id acpi_nfit_ids[] = { | 3754 | static const struct acpi_device_id acpi_nfit_ids[] = { |
diff --git a/drivers/acpi/nfit/nfit.h b/drivers/acpi/nfit/nfit.h index 6ee2b02af73e..24241941181c 100644 --- a/drivers/acpi/nfit/nfit.h +++ b/drivers/acpi/nfit/nfit.h | |||
@@ -312,6 +312,30 @@ static inline struct acpi_nfit_desc *to_acpi_desc( | |||
312 | return container_of(nd_desc, struct acpi_nfit_desc, nd_desc); | 312 | return container_of(nd_desc, struct acpi_nfit_desc, nd_desc); |
313 | } | 313 | } |
314 | 314 | ||
315 | #ifdef CONFIG_PROVE_LOCKING | ||
316 | static inline void nfit_device_lock(struct device *dev) | ||
317 | { | ||
318 | device_lock(dev); | ||
319 | mutex_lock(&dev->lockdep_mutex); | ||
320 | } | ||
321 | |||
322 | static inline void nfit_device_unlock(struct device *dev) | ||
323 | { | ||
324 | mutex_unlock(&dev->lockdep_mutex); | ||
325 | device_unlock(dev); | ||
326 | } | ||
327 | #else | ||
328 | static inline void nfit_device_lock(struct device *dev) | ||
329 | { | ||
330 | device_lock(dev); | ||
331 | } | ||
332 | |||
333 | static inline void nfit_device_unlock(struct device *dev) | ||
334 | { | ||
335 | device_unlock(dev); | ||
336 | } | ||
337 | #endif | ||
338 | |||
315 | const guid_t *to_nfit_uuid(enum nfit_uuids id); | 339 | const guid_t *to_nfit_uuid(enum nfit_uuids id); |
316 | int acpi_nfit_init(struct acpi_nfit_desc *acpi_desc, void *nfit, acpi_size sz); | 340 | int acpi_nfit_init(struct acpi_nfit_desc *acpi_desc, void *nfit, acpi_size sz); |
317 | void acpi_nfit_shutdown(void *data); | 341 | void acpi_nfit_shutdown(void *data); |
diff --git a/drivers/android/binder.c b/drivers/android/binder.c index 38a59a630cd4..dc1c83eafc22 100644 --- a/drivers/android/binder.c +++ b/drivers/android/binder.c | |||
@@ -2988,7 +2988,7 @@ static void binder_transaction(struct binder_proc *proc, | |||
2988 | else | 2988 | else |
2989 | return_error = BR_DEAD_REPLY; | 2989 | return_error = BR_DEAD_REPLY; |
2990 | mutex_unlock(&context->context_mgr_node_lock); | 2990 | mutex_unlock(&context->context_mgr_node_lock); |
2991 | if (target_node && target_proc == proc) { | 2991 | if (target_node && target_proc->pid == proc->pid) { |
2992 | binder_user_error("%d:%d got transaction to context manager from process owning it\n", | 2992 | binder_user_error("%d:%d got transaction to context manager from process owning it\n", |
2993 | proc->pid, thread->pid); | 2993 | proc->pid, thread->pid); |
2994 | return_error = BR_FAILED_REPLY; | 2994 | return_error = BR_FAILED_REPLY; |
@@ -3239,7 +3239,8 @@ static void binder_transaction(struct binder_proc *proc, | |||
3239 | buffer_offset = off_start_offset; | 3239 | buffer_offset = off_start_offset; |
3240 | off_end_offset = off_start_offset + tr->offsets_size; | 3240 | off_end_offset = off_start_offset + tr->offsets_size; |
3241 | sg_buf_offset = ALIGN(off_end_offset, sizeof(void *)); | 3241 | sg_buf_offset = ALIGN(off_end_offset, sizeof(void *)); |
3242 | sg_buf_end_offset = sg_buf_offset + extra_buffers_size; | 3242 | sg_buf_end_offset = sg_buf_offset + extra_buffers_size - |
3243 | ALIGN(secctx_sz, sizeof(u64)); | ||
3243 | off_min = 0; | 3244 | off_min = 0; |
3244 | for (buffer_offset = off_start_offset; buffer_offset < off_end_offset; | 3245 | for (buffer_offset = off_start_offset; buffer_offset < off_end_offset; |
3245 | buffer_offset += sizeof(binder_size_t)) { | 3246 | buffer_offset += sizeof(binder_size_t)) { |
diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c index 72312ad2e142..3a36e76eca83 100644 --- a/drivers/ata/libahci_platform.c +++ b/drivers/ata/libahci_platform.c | |||
@@ -408,7 +408,6 @@ struct ahci_host_priv *ahci_platform_get_resources(struct platform_device *pdev, | |||
408 | hpriv->mmio = devm_ioremap_resource(dev, | 408 | hpriv->mmio = devm_ioremap_resource(dev, |
409 | platform_get_resource(pdev, IORESOURCE_MEM, 0)); | 409 | platform_get_resource(pdev, IORESOURCE_MEM, 0)); |
410 | if (IS_ERR(hpriv->mmio)) { | 410 | if (IS_ERR(hpriv->mmio)) { |
411 | dev_err(dev, "no mmio space\n"); | ||
412 | rc = PTR_ERR(hpriv->mmio); | 411 | rc = PTR_ERR(hpriv->mmio); |
413 | goto err_out; | 412 | goto err_out; |
414 | } | 413 | } |
diff --git a/drivers/base/core.c b/drivers/base/core.c index da84a73f2ba6..636058bbf48a 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c | |||
@@ -1663,6 +1663,9 @@ void device_initialize(struct device *dev) | |||
1663 | kobject_init(&dev->kobj, &device_ktype); | 1663 | kobject_init(&dev->kobj, &device_ktype); |
1664 | INIT_LIST_HEAD(&dev->dma_pools); | 1664 | INIT_LIST_HEAD(&dev->dma_pools); |
1665 | mutex_init(&dev->mutex); | 1665 | mutex_init(&dev->mutex); |
1666 | #ifdef CONFIG_PROVE_LOCKING | ||
1667 | mutex_init(&dev->lockdep_mutex); | ||
1668 | #endif | ||
1666 | lockdep_set_novalidate_class(&dev->mutex); | 1669 | lockdep_set_novalidate_class(&dev->mutex); |
1667 | spin_lock_init(&dev->devres_lock); | 1670 | spin_lock_init(&dev->devres_lock); |
1668 | INIT_LIST_HEAD(&dev->devres_head); | 1671 | INIT_LIST_HEAD(&dev->devres_head); |
@@ -2211,6 +2214,24 @@ void put_device(struct device *dev) | |||
2211 | } | 2214 | } |
2212 | EXPORT_SYMBOL_GPL(put_device); | 2215 | EXPORT_SYMBOL_GPL(put_device); |
2213 | 2216 | ||
2217 | bool kill_device(struct device *dev) | ||
2218 | { | ||
2219 | /* | ||
2220 | * Require the device lock and set the "dead" flag to guarantee that | ||
2221 | * the update behavior is consistent with the other bitfields near | ||
2222 | * it and that we cannot have an asynchronous probe routine trying | ||
2223 | * to run while we are tearing out the bus/class/sysfs from | ||
2224 | * underneath the device. | ||
2225 | */ | ||
2226 | lockdep_assert_held(&dev->mutex); | ||
2227 | |||
2228 | if (dev->p->dead) | ||
2229 | return false; | ||
2230 | dev->p->dead = true; | ||
2231 | return true; | ||
2232 | } | ||
2233 | EXPORT_SYMBOL_GPL(kill_device); | ||
2234 | |||
2214 | /** | 2235 | /** |
2215 | * device_del - delete device from system. | 2236 | * device_del - delete device from system. |
2216 | * @dev: device. | 2237 | * @dev: device. |
@@ -2230,15 +2251,8 @@ void device_del(struct device *dev) | |||
2230 | struct kobject *glue_dir = NULL; | 2251 | struct kobject *glue_dir = NULL; |
2231 | struct class_interface *class_intf; | 2252 | struct class_interface *class_intf; |
2232 | 2253 | ||
2233 | /* | ||
2234 | * Hold the device lock and set the "dead" flag to guarantee that | ||
2235 | * the update behavior is consistent with the other bitfields near | ||
2236 | * it and that we cannot have an asynchronous probe routine trying | ||
2237 | * to run while we are tearing out the bus/class/sysfs from | ||
2238 | * underneath the device. | ||
2239 | */ | ||
2240 | device_lock(dev); | 2254 | device_lock(dev); |
2241 | dev->p->dead = true; | 2255 | kill_device(dev); |
2242 | device_unlock(dev); | 2256 | device_unlock(dev); |
2243 | 2257 | ||
2244 | /* Notify clients of device removal. This call must come | 2258 | /* Notify clients of device removal. This call must come |
diff --git a/drivers/base/firmware_loader/firmware.h b/drivers/base/firmware_loader/firmware.h index 7048a41973ed..7ecd590e67fe 100644 --- a/drivers/base/firmware_loader/firmware.h +++ b/drivers/base/firmware_loader/firmware.h | |||
@@ -141,8 +141,8 @@ int fw_grow_paged_buf(struct fw_priv *fw_priv, int pages_needed); | |||
141 | int fw_map_paged_buf(struct fw_priv *fw_priv); | 141 | int fw_map_paged_buf(struct fw_priv *fw_priv); |
142 | #else | 142 | #else |
143 | static inline void fw_free_paged_buf(struct fw_priv *fw_priv) {} | 143 | static inline void fw_free_paged_buf(struct fw_priv *fw_priv) {} |
144 | int fw_grow_paged_buf(struct fw_priv *fw_priv, int pages_needed) { return -ENXIO; } | 144 | static inline int fw_grow_paged_buf(struct fw_priv *fw_priv, int pages_needed) { return -ENXIO; } |
145 | int fw_map_paged_buf(struct fw_priv *fw_priv) { return -ENXIO; } | 145 | static inline int fw_map_paged_buf(struct fw_priv *fw_priv) { return -ENXIO; } |
146 | #endif | 146 | #endif |
147 | 147 | ||
148 | #endif /* __FIRMWARE_LOADER_H */ | 148 | #endif /* __FIRMWARE_LOADER_H */ |
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index 90ebfcae0ce6..2b3103c30857 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c | |||
@@ -5417,7 +5417,7 @@ static int drbd_do_auth(struct drbd_connection *connection) | |||
5417 | unsigned int key_len; | 5417 | unsigned int key_len; |
5418 | char secret[SHARED_SECRET_MAX]; /* 64 byte */ | 5418 | char secret[SHARED_SECRET_MAX]; /* 64 byte */ |
5419 | unsigned int resp_size; | 5419 | unsigned int resp_size; |
5420 | SHASH_DESC_ON_STACK(desc, connection->cram_hmac_tfm); | 5420 | struct shash_desc *desc; |
5421 | struct packet_info pi; | 5421 | struct packet_info pi; |
5422 | struct net_conf *nc; | 5422 | struct net_conf *nc; |
5423 | int err, rv; | 5423 | int err, rv; |
@@ -5430,6 +5430,13 @@ static int drbd_do_auth(struct drbd_connection *connection) | |||
5430 | memcpy(secret, nc->shared_secret, key_len); | 5430 | memcpy(secret, nc->shared_secret, key_len); |
5431 | rcu_read_unlock(); | 5431 | rcu_read_unlock(); |
5432 | 5432 | ||
5433 | desc = kmalloc(sizeof(struct shash_desc) + | ||
5434 | crypto_shash_descsize(connection->cram_hmac_tfm), | ||
5435 | GFP_KERNEL); | ||
5436 | if (!desc) { | ||
5437 | rv = -1; | ||
5438 | goto fail; | ||
5439 | } | ||
5433 | desc->tfm = connection->cram_hmac_tfm; | 5440 | desc->tfm = connection->cram_hmac_tfm; |
5434 | 5441 | ||
5435 | rv = crypto_shash_setkey(connection->cram_hmac_tfm, (u8 *)secret, key_len); | 5442 | rv = crypto_shash_setkey(connection->cram_hmac_tfm, (u8 *)secret, key_len); |
@@ -5571,7 +5578,10 @@ static int drbd_do_auth(struct drbd_connection *connection) | |||
5571 | kfree(peers_ch); | 5578 | kfree(peers_ch); |
5572 | kfree(response); | 5579 | kfree(response); |
5573 | kfree(right_response); | 5580 | kfree(right_response); |
5574 | shash_desc_zero(desc); | 5581 | if (desc) { |
5582 | shash_desc_zero(desc); | ||
5583 | kfree(desc); | ||
5584 | } | ||
5575 | 5585 | ||
5576 | return rv; | 5586 | return rv; |
5577 | } | 5587 | } |
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c index 5c39f20378b8..9ac6671bb514 100644 --- a/drivers/char/hpet.c +++ b/drivers/char/hpet.c | |||
@@ -567,8 +567,7 @@ static inline unsigned long hpet_time_div(struct hpets *hpets, | |||
567 | unsigned long long m; | 567 | unsigned long long m; |
568 | 568 | ||
569 | m = hpets->hp_tick_freq + (dis >> 1); | 569 | m = hpets->hp_tick_freq + (dis >> 1); |
570 | do_div(m, dis); | 570 | return div64_ul(m, dis); |
571 | return (unsigned long)m; | ||
572 | } | 571 | } |
573 | 572 | ||
574 | static int | 573 | static int |
diff --git a/drivers/cpufreq/pasemi-cpufreq.c b/drivers/cpufreq/pasemi-cpufreq.c index 93f39a1d4c3d..c66f566a854c 100644 --- a/drivers/cpufreq/pasemi-cpufreq.c +++ b/drivers/cpufreq/pasemi-cpufreq.c | |||
@@ -131,10 +131,18 @@ static int pas_cpufreq_cpu_init(struct cpufreq_policy *policy) | |||
131 | int err = -ENODEV; | 131 | int err = -ENODEV; |
132 | 132 | ||
133 | cpu = of_get_cpu_node(policy->cpu, NULL); | 133 | cpu = of_get_cpu_node(policy->cpu, NULL); |
134 | if (!cpu) | ||
135 | goto out; | ||
134 | 136 | ||
137 | max_freqp = of_get_property(cpu, "clock-frequency", NULL); | ||
135 | of_node_put(cpu); | 138 | of_node_put(cpu); |
136 | if (!cpu) | 139 | if (!max_freqp) { |
140 | err = -EINVAL; | ||
137 | goto out; | 141 | goto out; |
142 | } | ||
143 | |||
144 | /* we need the freq in kHz */ | ||
145 | max_freq = *max_freqp / 1000; | ||
138 | 146 | ||
139 | dn = of_find_compatible_node(NULL, NULL, "1682m-sdc"); | 147 | dn = of_find_compatible_node(NULL, NULL, "1682m-sdc"); |
140 | if (!dn) | 148 | if (!dn) |
@@ -171,16 +179,6 @@ static int pas_cpufreq_cpu_init(struct cpufreq_policy *policy) | |||
171 | } | 179 | } |
172 | 180 | ||
173 | pr_debug("init cpufreq on CPU %d\n", policy->cpu); | 181 | pr_debug("init cpufreq on CPU %d\n", policy->cpu); |
174 | |||
175 | max_freqp = of_get_property(cpu, "clock-frequency", NULL); | ||
176 | if (!max_freqp) { | ||
177 | err = -EINVAL; | ||
178 | goto out_unmap_sdcpwr; | ||
179 | } | ||
180 | |||
181 | /* we need the freq in kHz */ | ||
182 | max_freq = *max_freqp / 1000; | ||
183 | |||
184 | pr_debug("max clock-frequency is at %u kHz\n", max_freq); | 182 | pr_debug("max clock-frequency is at %u kHz\n", max_freq); |
185 | pr_debug("initializing frequency table\n"); | 183 | pr_debug("initializing frequency table\n"); |
186 | 184 | ||
@@ -199,9 +197,6 @@ static int pas_cpufreq_cpu_init(struct cpufreq_policy *policy) | |||
199 | cpufreq_generic_init(policy, pas_freqs, get_gizmo_latency()); | 197 | cpufreq_generic_init(policy, pas_freqs, get_gizmo_latency()); |
200 | return 0; | 198 | return 0; |
201 | 199 | ||
202 | out_unmap_sdcpwr: | ||
203 | iounmap(sdcpwr_mapbase); | ||
204 | |||
205 | out_unmap_sdcasr: | 200 | out_unmap_sdcasr: |
206 | iounmap(sdcasr_mapbase); | 201 | iounmap(sdcasr_mapbase); |
207 | out: | 202 | out: |
diff --git a/drivers/firewire/core-device.c b/drivers/firewire/core-device.c index 3dc1cbf849db..b785e936244f 100644 --- a/drivers/firewire/core-device.c +++ b/drivers/firewire/core-device.c | |||
@@ -957,7 +957,7 @@ static void set_broadcast_channel(struct fw_device *device, int generation) | |||
957 | device->bc_implemented = BC_IMPLEMENTED; | 957 | device->bc_implemented = BC_IMPLEMENTED; |
958 | break; | 958 | break; |
959 | } | 959 | } |
960 | /* else fall through to case address error */ | 960 | /* else, fall through - to case address error */ |
961 | case RCODE_ADDRESS_ERROR: | 961 | case RCODE_ADDRESS_ERROR: |
962 | device->bc_implemented = BC_UNIMPLEMENTED; | 962 | device->bc_implemented = BC_UNIMPLEMENTED; |
963 | } | 963 | } |
diff --git a/drivers/firewire/core-iso.c b/drivers/firewire/core-iso.c index 42566b7be8f5..df8a56a979b9 100644 --- a/drivers/firewire/core-iso.c +++ b/drivers/firewire/core-iso.c | |||
@@ -284,7 +284,7 @@ static int manage_channel(struct fw_card *card, int irm_id, int generation, | |||
284 | if ((data[0] & bit) == (data[1] & bit)) | 284 | if ((data[0] & bit) == (data[1] & bit)) |
285 | continue; | 285 | continue; |
286 | 286 | ||
287 | /* 1394-1995 IRM, fall through to retry. */ | 287 | /* fall through - It's a 1394-1995 IRM, retry. */ |
288 | default: | 288 | default: |
289 | if (retry) { | 289 | if (retry) { |
290 | retry--; | 290 | retry--; |
diff --git a/drivers/firewire/core-topology.c b/drivers/firewire/core-topology.c index 46bd22dde535..94a13fca8267 100644 --- a/drivers/firewire/core-topology.c +++ b/drivers/firewire/core-topology.c | |||
@@ -54,6 +54,7 @@ static u32 *count_ports(u32 *sid, int *total_port_count, int *child_port_count) | |||
54 | switch (port_type) { | 54 | switch (port_type) { |
55 | case SELFID_PORT_CHILD: | 55 | case SELFID_PORT_CHILD: |
56 | (*child_port_count)++; | 56 | (*child_port_count)++; |
57 | /* fall through */ | ||
57 | case SELFID_PORT_PARENT: | 58 | case SELFID_PORT_PARENT: |
58 | case SELFID_PORT_NCONN: | 59 | case SELFID_PORT_NCONN: |
59 | (*total_port_count)++; | 60 | (*total_port_count)++; |
diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig index 53446e39a32c..ba8d3d0ef32c 100644 --- a/drivers/firmware/Kconfig +++ b/drivers/firmware/Kconfig | |||
@@ -157,7 +157,7 @@ config DMI_SCAN_MACHINE_NON_EFI_FALLBACK | |||
157 | 157 | ||
158 | config ISCSI_IBFT_FIND | 158 | config ISCSI_IBFT_FIND |
159 | bool "iSCSI Boot Firmware Table Attributes" | 159 | bool "iSCSI Boot Firmware Table Attributes" |
160 | depends on X86 && ACPI | 160 | depends on X86 && ISCSI_IBFT |
161 | default n | 161 | default n |
162 | help | 162 | help |
163 | This option enables the kernel to find the region of memory | 163 | This option enables the kernel to find the region of memory |
@@ -168,7 +168,8 @@ config ISCSI_IBFT_FIND | |||
168 | config ISCSI_IBFT | 168 | config ISCSI_IBFT |
169 | tristate "iSCSI Boot Firmware Table Attributes module" | 169 | tristate "iSCSI Boot Firmware Table Attributes module" |
170 | select ISCSI_BOOT_SYSFS | 170 | select ISCSI_BOOT_SYSFS |
171 | depends on ISCSI_IBFT_FIND && SCSI && SCSI_LOWLEVEL | 171 | select ISCSI_IBFT_FIND if X86 |
172 | depends on ACPI && SCSI && SCSI_LOWLEVEL | ||
172 | default n | 173 | default n |
173 | help | 174 | help |
174 | This option enables support for detection and exposing of iSCSI | 175 | This option enables support for detection and exposing of iSCSI |
diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c index ab3aa3983833..7e12cbdf957c 100644 --- a/drivers/firmware/iscsi_ibft.c +++ b/drivers/firmware/iscsi_ibft.c | |||
@@ -84,6 +84,10 @@ MODULE_DESCRIPTION("sysfs interface to BIOS iBFT information"); | |||
84 | MODULE_LICENSE("GPL"); | 84 | MODULE_LICENSE("GPL"); |
85 | MODULE_VERSION(IBFT_ISCSI_VERSION); | 85 | MODULE_VERSION(IBFT_ISCSI_VERSION); |
86 | 86 | ||
87 | #ifndef CONFIG_ISCSI_IBFT_FIND | ||
88 | struct acpi_table_ibft *ibft_addr; | ||
89 | #endif | ||
90 | |||
87 | struct ibft_hdr { | 91 | struct ibft_hdr { |
88 | u8 id; | 92 | u8 id; |
89 | u8 version; | 93 | u8 version; |
diff --git a/drivers/fpga/Kconfig b/drivers/fpga/Kconfig index 474f304ec109..cdd4f73b4869 100644 --- a/drivers/fpga/Kconfig +++ b/drivers/fpga/Kconfig | |||
@@ -40,6 +40,7 @@ config ALTERA_PR_IP_CORE_PLAT | |||
40 | config FPGA_MGR_ALTERA_PS_SPI | 40 | config FPGA_MGR_ALTERA_PS_SPI |
41 | tristate "Altera FPGA Passive Serial over SPI" | 41 | tristate "Altera FPGA Passive Serial over SPI" |
42 | depends on SPI | 42 | depends on SPI |
43 | select BITREVERSE | ||
43 | help | 44 | help |
44 | FPGA manager driver support for Altera Arria/Cyclone/Stratix | 45 | FPGA manager driver support for Altera Arria/Cyclone/Stratix |
45 | using the passive serial interface over SPI. | 46 | using the passive serial interface over SPI. |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index f2e8b4238efd..5376328d3fd0 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | |||
@@ -148,7 +148,7 @@ struct amdgpu_mgpu_info mgpu_info = { | |||
148 | .mutex = __MUTEX_INITIALIZER(mgpu_info.mutex), | 148 | .mutex = __MUTEX_INITIALIZER(mgpu_info.mutex), |
149 | }; | 149 | }; |
150 | int amdgpu_ras_enable = -1; | 150 | int amdgpu_ras_enable = -1; |
151 | uint amdgpu_ras_mask = 0xffffffff; | 151 | uint amdgpu_ras_mask = 0xfffffffb; |
152 | 152 | ||
153 | /** | 153 | /** |
154 | * DOC: vramlimit (int) | 154 | * DOC: vramlimit (int) |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c index 8b7efd0a7028..03ca8c69114f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | |||
@@ -1734,7 +1734,7 @@ static ssize_t amdgpu_hwmon_get_fan1_input(struct device *dev, | |||
1734 | return -EINVAL; | 1734 | return -EINVAL; |
1735 | 1735 | ||
1736 | if (is_support_sw_smu(adev)) { | 1736 | if (is_support_sw_smu(adev)) { |
1737 | err = smu_get_current_rpm(&adev->smu, &speed); | 1737 | err = smu_get_fan_speed_rpm(&adev->smu, &speed); |
1738 | if (err) | 1738 | if (err) |
1739 | return err; | 1739 | return err; |
1740 | } else if (adev->powerplay.pp_funcs->get_fan_speed_rpm) { | 1740 | } else if (adev->powerplay.pp_funcs->get_fan_speed_rpm) { |
@@ -1794,7 +1794,7 @@ static ssize_t amdgpu_hwmon_get_fan1_target(struct device *dev, | |||
1794 | return -EINVAL; | 1794 | return -EINVAL; |
1795 | 1795 | ||
1796 | if (is_support_sw_smu(adev)) { | 1796 | if (is_support_sw_smu(adev)) { |
1797 | err = smu_get_current_rpm(&adev->smu, &rpm); | 1797 | err = smu_get_fan_speed_rpm(&adev->smu, &rpm); |
1798 | if (err) | 1798 | if (err) |
1799 | return err; | 1799 | return err; |
1800 | } else if (adev->powerplay.pp_funcs->get_fan_speed_rpm) { | 1800 | } else if (adev->powerplay.pp_funcs->get_fan_speed_rpm) { |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c index 1a4412e47810..fac7aa2c244f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | |||
@@ -136,11 +136,6 @@ static int amdgpu_ras_reserve_vram(struct amdgpu_device *adev, | |||
136 | static int amdgpu_ras_release_vram(struct amdgpu_device *adev, | 136 | static int amdgpu_ras_release_vram(struct amdgpu_device *adev, |
137 | struct amdgpu_bo **bo_ptr); | 137 | struct amdgpu_bo **bo_ptr); |
138 | 138 | ||
139 | static void amdgpu_ras_self_test(struct amdgpu_device *adev) | ||
140 | { | ||
141 | /* TODO */ | ||
142 | } | ||
143 | |||
144 | static ssize_t amdgpu_ras_debugfs_read(struct file *f, char __user *buf, | 139 | static ssize_t amdgpu_ras_debugfs_read(struct file *f, char __user *buf, |
145 | size_t size, loff_t *pos) | 140 | size_t size, loff_t *pos) |
146 | { | 141 | { |
@@ -689,6 +684,12 @@ int amdgpu_ras_error_inject(struct amdgpu_device *adev, | |||
689 | if (!obj) | 684 | if (!obj) |
690 | return -EINVAL; | 685 | return -EINVAL; |
691 | 686 | ||
687 | if (block_info.block_id != TA_RAS_BLOCK__UMC) { | ||
688 | DRM_INFO("%s error injection is not supported yet\n", | ||
689 | ras_block_str(info->head.block)); | ||
690 | return -EINVAL; | ||
691 | } | ||
692 | |||
692 | ret = psp_ras_trigger_error(&adev->psp, &block_info); | 693 | ret = psp_ras_trigger_error(&adev->psp, &block_info); |
693 | if (ret) | 694 | if (ret) |
694 | DRM_ERROR("RAS ERROR: inject %s error failed ret %d\n", | 695 | DRM_ERROR("RAS ERROR: inject %s error failed ret %d\n", |
@@ -1557,6 +1558,12 @@ int amdgpu_ras_init(struct amdgpu_device *adev) | |||
1557 | 1558 | ||
1558 | amdgpu_ras_check_supported(adev, &con->hw_supported, | 1559 | amdgpu_ras_check_supported(adev, &con->hw_supported, |
1559 | &con->supported); | 1560 | &con->supported); |
1561 | if (!con->hw_supported) { | ||
1562 | amdgpu_ras_set_context(adev, NULL); | ||
1563 | kfree(con); | ||
1564 | return 0; | ||
1565 | } | ||
1566 | |||
1560 | con->features = 0; | 1567 | con->features = 0; |
1561 | INIT_LIST_HEAD(&con->head); | 1568 | INIT_LIST_HEAD(&con->head); |
1562 | /* Might need get this flag from vbios. */ | 1569 | /* Might need get this flag from vbios. */ |
@@ -1570,8 +1577,6 @@ int amdgpu_ras_init(struct amdgpu_device *adev) | |||
1570 | if (amdgpu_ras_fs_init(adev)) | 1577 | if (amdgpu_ras_fs_init(adev)) |
1571 | goto fs_out; | 1578 | goto fs_out; |
1572 | 1579 | ||
1573 | amdgpu_ras_self_test(adev); | ||
1574 | |||
1575 | DRM_INFO("RAS INFO: ras initialized successfully, " | 1580 | DRM_INFO("RAS INFO: ras initialized successfully, " |
1576 | "hardware ability[%x] ras_mask[%x]\n", | 1581 | "hardware ability[%x] ras_mask[%x]\n", |
1577 | con->hw_supported, con->supported); | 1582 | con->hw_supported, con->supported); |
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c index 1675d5837c3c..32773b7523d2 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | |||
@@ -1441,6 +1441,15 @@ static void gfx_v10_0_init_compute_vmid(struct amdgpu_device *adev) | |||
1441 | } | 1441 | } |
1442 | nv_grbm_select(adev, 0, 0, 0, 0); | 1442 | nv_grbm_select(adev, 0, 0, 0, 0); |
1443 | mutex_unlock(&adev->srbm_mutex); | 1443 | mutex_unlock(&adev->srbm_mutex); |
1444 | |||
1445 | /* Initialize all compute VMIDs to have no GDS, GWS, or OA | ||
1446 | acccess. These should be enabled by FW for target VMIDs. */ | ||
1447 | for (i = FIRST_COMPUTE_VMID; i < LAST_COMPUTE_VMID; i++) { | ||
1448 | WREG32_SOC15_OFFSET(GC, 0, mmGDS_VMID0_BASE, 2 * i, 0); | ||
1449 | WREG32_SOC15_OFFSET(GC, 0, mmGDS_VMID0_SIZE, 2 * i, 0); | ||
1450 | WREG32_SOC15_OFFSET(GC, 0, mmGDS_GWS_VMID0, i, 0); | ||
1451 | WREG32_SOC15_OFFSET(GC, 0, mmGDS_OA_VMID0, i, 0); | ||
1452 | } | ||
1444 | } | 1453 | } |
1445 | 1454 | ||
1446 | static void gfx_v10_0_tcp_harvest(struct amdgpu_device *adev) | 1455 | static void gfx_v10_0_tcp_harvest(struct amdgpu_device *adev) |
@@ -4611,6 +4620,7 @@ gfx_v10_0_set_gfx_eop_interrupt_state(struct amdgpu_device *adev, | |||
4611 | cp_int_cntl = REG_SET_FIELD(cp_int_cntl, CP_INT_CNTL_RING0, | 4620 | cp_int_cntl = REG_SET_FIELD(cp_int_cntl, CP_INT_CNTL_RING0, |
4612 | TIME_STAMP_INT_ENABLE, 0); | 4621 | TIME_STAMP_INT_ENABLE, 0); |
4613 | WREG32(cp_int_cntl_reg, cp_int_cntl); | 4622 | WREG32(cp_int_cntl_reg, cp_int_cntl); |
4623 | break; | ||
4614 | case AMDGPU_IRQ_STATE_ENABLE: | 4624 | case AMDGPU_IRQ_STATE_ENABLE: |
4615 | cp_int_cntl = RREG32(cp_int_cntl_reg); | 4625 | cp_int_cntl = RREG32(cp_int_cntl_reg); |
4616 | cp_int_cntl = REG_SET_FIELD(cp_int_cntl, CP_INT_CNTL_RING0, | 4626 | cp_int_cntl = REG_SET_FIELD(cp_int_cntl, CP_INT_CNTL_RING0, |
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c index 0db9f488da7e..21187275dfd3 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | |||
@@ -1879,6 +1879,15 @@ static void gfx_v7_0_init_compute_vmid(struct amdgpu_device *adev) | |||
1879 | } | 1879 | } |
1880 | cik_srbm_select(adev, 0, 0, 0, 0); | 1880 | cik_srbm_select(adev, 0, 0, 0, 0); |
1881 | mutex_unlock(&adev->srbm_mutex); | 1881 | mutex_unlock(&adev->srbm_mutex); |
1882 | |||
1883 | /* Initialize all compute VMIDs to have no GDS, GWS, or OA | ||
1884 | acccess. These should be enabled by FW for target VMIDs. */ | ||
1885 | for (i = FIRST_COMPUTE_VMID; i < LAST_COMPUTE_VMID; i++) { | ||
1886 | WREG32(amdgpu_gds_reg_offset[i].mem_base, 0); | ||
1887 | WREG32(amdgpu_gds_reg_offset[i].mem_size, 0); | ||
1888 | WREG32(amdgpu_gds_reg_offset[i].gws, 0); | ||
1889 | WREG32(amdgpu_gds_reg_offset[i].oa, 0); | ||
1890 | } | ||
1882 | } | 1891 | } |
1883 | 1892 | ||
1884 | static void gfx_v7_0_config_init(struct amdgpu_device *adev) | 1893 | static void gfx_v7_0_config_init(struct amdgpu_device *adev) |
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c index 5f401b41ef7c..751567f78567 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | |||
@@ -3706,6 +3706,15 @@ static void gfx_v8_0_init_compute_vmid(struct amdgpu_device *adev) | |||
3706 | } | 3706 | } |
3707 | vi_srbm_select(adev, 0, 0, 0, 0); | 3707 | vi_srbm_select(adev, 0, 0, 0, 0); |
3708 | mutex_unlock(&adev->srbm_mutex); | 3708 | mutex_unlock(&adev->srbm_mutex); |
3709 | |||
3710 | /* Initialize all compute VMIDs to have no GDS, GWS, or OA | ||
3711 | acccess. These should be enabled by FW for target VMIDs. */ | ||
3712 | for (i = FIRST_COMPUTE_VMID; i < LAST_COMPUTE_VMID; i++) { | ||
3713 | WREG32(amdgpu_gds_reg_offset[i].mem_base, 0); | ||
3714 | WREG32(amdgpu_gds_reg_offset[i].mem_size, 0); | ||
3715 | WREG32(amdgpu_gds_reg_offset[i].gws, 0); | ||
3716 | WREG32(amdgpu_gds_reg_offset[i].oa, 0); | ||
3717 | } | ||
3709 | } | 3718 | } |
3710 | 3719 | ||
3711 | static void gfx_v8_0_config_init(struct amdgpu_device *adev) | 3720 | static void gfx_v8_0_config_init(struct amdgpu_device *adev) |
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c index f4c4eea62526..1cf639a51178 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | |||
@@ -1918,6 +1918,15 @@ static void gfx_v9_0_init_compute_vmid(struct amdgpu_device *adev) | |||
1918 | } | 1918 | } |
1919 | soc15_grbm_select(adev, 0, 0, 0, 0); | 1919 | soc15_grbm_select(adev, 0, 0, 0, 0); |
1920 | mutex_unlock(&adev->srbm_mutex); | 1920 | mutex_unlock(&adev->srbm_mutex); |
1921 | |||
1922 | /* Initialize all compute VMIDs to have no GDS, GWS, or OA | ||
1923 | acccess. These should be enabled by FW for target VMIDs. */ | ||
1924 | for (i = FIRST_COMPUTE_VMID; i < LAST_COMPUTE_VMID; i++) { | ||
1925 | WREG32_SOC15_OFFSET(GC, 0, mmGDS_VMID0_BASE, 2 * i, 0); | ||
1926 | WREG32_SOC15_OFFSET(GC, 0, mmGDS_VMID0_SIZE, 2 * i, 0); | ||
1927 | WREG32_SOC15_OFFSET(GC, 0, mmGDS_GWS_VMID0, i, 0); | ||
1928 | WREG32_SOC15_OFFSET(GC, 0, mmGDS_OA_VMID0, i, 0); | ||
1929 | } | ||
1921 | } | 1930 | } |
1922 | 1931 | ||
1923 | static void gfx_v9_0_constants_init(struct amdgpu_device *adev) | 1932 | static void gfx_v9_0_constants_init(struct amdgpu_device *adev) |
diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c index 988c0adaca91..1cfc2620b2dd 100644 --- a/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | |||
@@ -372,11 +372,8 @@ static void vcn_v2_0_mc_resume(struct amdgpu_device *adev) | |||
372 | WREG32_SOC15(UVD, 0, mmUVD_LMI_VCPU_CACHE_64BIT_BAR_HIGH, | 372 | WREG32_SOC15(UVD, 0, mmUVD_LMI_VCPU_CACHE_64BIT_BAR_HIGH, |
373 | upper_32_bits(adev->vcn.gpu_addr)); | 373 | upper_32_bits(adev->vcn.gpu_addr)); |
374 | offset = size; | 374 | offset = size; |
375 | /* No signed header for now from firmware | ||
376 | WREG32_SOC15(UVD, 0, mmUVD_VCPU_CACHE_OFFSET0, | 375 | WREG32_SOC15(UVD, 0, mmUVD_VCPU_CACHE_OFFSET0, |
377 | AMDGPU_UVD_FIRMWARE_OFFSET >> 3); | 376 | AMDGPU_UVD_FIRMWARE_OFFSET >> 3); |
378 | */ | ||
379 | WREG32_SOC15(UVD, 0, mmUVD_VCPU_CACHE_OFFSET0, 0); | ||
380 | } | 377 | } |
381 | 378 | ||
382 | WREG32_SOC15(UVD, 0, mmUVD_VCPU_CACHE_SIZE0, size); | 379 | WREG32_SOC15(UVD, 0, mmUVD_VCPU_CACHE_SIZE0, size); |
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c index 792371442195..4e3fc284f6ac 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c | |||
@@ -668,6 +668,7 @@ static int kfd_fill_gpu_cache_info(struct kfd_dev *kdev, | |||
668 | case CHIP_RAVEN: | 668 | case CHIP_RAVEN: |
669 | pcache_info = raven_cache_info; | 669 | pcache_info = raven_cache_info; |
670 | num_of_cache_types = ARRAY_SIZE(raven_cache_info); | 670 | num_of_cache_types = ARRAY_SIZE(raven_cache_info); |
671 | break; | ||
671 | case CHIP_NAVI10: | 672 | case CHIP_NAVI10: |
672 | pcache_info = navi10_cache_info; | 673 | pcache_info = navi10_cache_info; |
673 | num_of_cache_types = ARRAY_SIZE(navi10_cache_info); | 674 | num_of_cache_types = ARRAY_SIZE(navi10_cache_info); |
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c index 4f8a6ffc5775..9cd3eb2d90bd 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c | |||
@@ -429,7 +429,6 @@ struct mqd_manager *mqd_manager_init_v10(enum KFD_MQD_TYPE type, | |||
429 | 429 | ||
430 | switch (type) { | 430 | switch (type) { |
431 | case KFD_MQD_TYPE_CP: | 431 | case KFD_MQD_TYPE_CP: |
432 | pr_debug("%s@%i\n", __func__, __LINE__); | ||
433 | case KFD_MQD_TYPE_COMPUTE: | 432 | case KFD_MQD_TYPE_COMPUTE: |
434 | pr_debug("%s@%i\n", __func__, __LINE__); | 433 | pr_debug("%s@%i\n", __func__, __LINE__); |
435 | mqd->allocate_mqd = allocate_mqd; | 434 | mqd->allocate_mqd = allocate_mqd; |
diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dce110/dce110_clk_mgr.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/dce110/dce110_clk_mgr.c index c1a92c16535c..5cc3acccda2a 100644 --- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dce110/dce110_clk_mgr.c +++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dce110/dce110_clk_mgr.c | |||
@@ -262,12 +262,12 @@ void dce110_clk_mgr_construct( | |||
262 | struct dc_context *ctx, | 262 | struct dc_context *ctx, |
263 | struct clk_mgr_internal *clk_mgr) | 263 | struct clk_mgr_internal *clk_mgr) |
264 | { | 264 | { |
265 | dce_clk_mgr_construct(ctx, clk_mgr); | ||
266 | |||
265 | memcpy(clk_mgr->max_clks_by_state, | 267 | memcpy(clk_mgr->max_clks_by_state, |
266 | dce110_max_clks_by_state, | 268 | dce110_max_clks_by_state, |
267 | sizeof(dce110_max_clks_by_state)); | 269 | sizeof(dce110_max_clks_by_state)); |
268 | 270 | ||
269 | dce_clk_mgr_construct(ctx, clk_mgr); | ||
270 | |||
271 | clk_mgr->regs = &disp_clk_regs; | 271 | clk_mgr->regs = &disp_clk_regs; |
272 | clk_mgr->clk_mgr_shift = &disp_clk_shift; | 272 | clk_mgr->clk_mgr_shift = &disp_clk_shift; |
273 | clk_mgr->clk_mgr_mask = &disp_clk_mask; | 273 | clk_mgr->clk_mgr_mask = &disp_clk_mask; |
diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c index 778392c73187..7c746ef1e32e 100644 --- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c +++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c | |||
@@ -226,12 +226,12 @@ void dce112_clk_mgr_construct( | |||
226 | struct dc_context *ctx, | 226 | struct dc_context *ctx, |
227 | struct clk_mgr_internal *clk_mgr) | 227 | struct clk_mgr_internal *clk_mgr) |
228 | { | 228 | { |
229 | dce_clk_mgr_construct(ctx, clk_mgr); | ||
230 | |||
229 | memcpy(clk_mgr->max_clks_by_state, | 231 | memcpy(clk_mgr->max_clks_by_state, |
230 | dce112_max_clks_by_state, | 232 | dce112_max_clks_by_state, |
231 | sizeof(dce112_max_clks_by_state)); | 233 | sizeof(dce112_max_clks_by_state)); |
232 | 234 | ||
233 | dce_clk_mgr_construct(ctx, clk_mgr); | ||
234 | |||
235 | clk_mgr->regs = &disp_clk_regs; | 235 | clk_mgr->regs = &disp_clk_regs; |
236 | clk_mgr->clk_mgr_shift = &disp_clk_shift; | 236 | clk_mgr->clk_mgr_shift = &disp_clk_shift; |
237 | clk_mgr->clk_mgr_mask = &disp_clk_mask; | 237 | clk_mgr->clk_mgr_mask = &disp_clk_mask; |
diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dce120/dce120_clk_mgr.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/dce120/dce120_clk_mgr.c index 906310c3e2eb..5399b8cf6b75 100644 --- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dce120/dce120_clk_mgr.c +++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dce120/dce120_clk_mgr.c | |||
@@ -127,12 +127,12 @@ static struct clk_mgr_funcs dce120_funcs = { | |||
127 | 127 | ||
128 | void dce120_clk_mgr_construct(struct dc_context *ctx, struct clk_mgr_internal *clk_mgr) | 128 | void dce120_clk_mgr_construct(struct dc_context *ctx, struct clk_mgr_internal *clk_mgr) |
129 | { | 129 | { |
130 | dce_clk_mgr_construct(ctx, clk_mgr); | ||
131 | |||
130 | memcpy(clk_mgr->max_clks_by_state, | 132 | memcpy(clk_mgr->max_clks_by_state, |
131 | dce120_max_clks_by_state, | 133 | dce120_max_clks_by_state, |
132 | sizeof(dce120_max_clks_by_state)); | 134 | sizeof(dce120_max_clks_by_state)); |
133 | 135 | ||
134 | dce_clk_mgr_construct(ctx, clk_mgr); | ||
135 | |||
136 | clk_mgr->base.dprefclk_khz = 600000; | 136 | clk_mgr->base.dprefclk_khz = 600000; |
137 | clk_mgr->base.funcs = &dce120_funcs; | 137 | clk_mgr->base.funcs = &dce120_funcs; |
138 | } | 138 | } |
diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c index 08a774fc7b67..50bfb5921de0 100644 --- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c +++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c | |||
@@ -301,6 +301,8 @@ void dcn2_update_clocks_fpga(struct clk_mgr *clk_mgr, | |||
301 | void dcn2_init_clocks(struct clk_mgr *clk_mgr) | 301 | void dcn2_init_clocks(struct clk_mgr *clk_mgr) |
302 | { | 302 | { |
303 | memset(&(clk_mgr->clks), 0, sizeof(struct dc_clocks)); | 303 | memset(&(clk_mgr->clks), 0, sizeof(struct dc_clocks)); |
304 | // Assumption is that boot state always supports pstate | ||
305 | clk_mgr->clks.p_state_change_support = true; | ||
304 | } | 306 | } |
305 | 307 | ||
306 | void dcn2_enable_pme_wa(struct clk_mgr *clk_mgr_base) | 308 | void dcn2_enable_pme_wa(struct clk_mgr *clk_mgr_base) |
@@ -331,6 +333,7 @@ void dcn20_clk_mgr_construct( | |||
331 | struct dccg *dccg) | 333 | struct dccg *dccg) |
332 | { | 334 | { |
333 | clk_mgr->base.ctx = ctx; | 335 | clk_mgr->base.ctx = ctx; |
336 | clk_mgr->pp_smu = pp_smu; | ||
334 | clk_mgr->base.funcs = &dcn2_funcs; | 337 | clk_mgr->base.funcs = &dcn2_funcs; |
335 | clk_mgr->regs = &clk_mgr_regs; | 338 | clk_mgr->regs = &clk_mgr_regs; |
336 | clk_mgr->clk_mgr_shift = &clk_mgr_shift; | 339 | clk_mgr->clk_mgr_shift = &clk_mgr_shift; |
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c index 4ef4dc63e221..fa20201eef3a 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c | |||
@@ -502,8 +502,10 @@ void dc_stream_set_static_screen_events(struct dc *dc, | |||
502 | 502 | ||
503 | static void destruct(struct dc *dc) | 503 | static void destruct(struct dc *dc) |
504 | { | 504 | { |
505 | dc_release_state(dc->current_state); | 505 | if (dc->current_state) { |
506 | dc->current_state = NULL; | 506 | dc_release_state(dc->current_state); |
507 | dc->current_state = NULL; | ||
508 | } | ||
507 | 509 | ||
508 | destroy_links(dc); | 510 | destroy_links(dc); |
509 | 511 | ||
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c index 8dbf759eba45..355b4ba12796 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c | |||
@@ -532,6 +532,7 @@ static void read_edp_current_link_settings_on_detect(struct dc_link *link) | |||
532 | uint32_t read_dpcd_retry_cnt = 10; | 532 | uint32_t read_dpcd_retry_cnt = 10; |
533 | enum dc_status status = DC_ERROR_UNEXPECTED; | 533 | enum dc_status status = DC_ERROR_UNEXPECTED; |
534 | int i; | 534 | int i; |
535 | union max_down_spread max_down_spread = { {0} }; | ||
535 | 536 | ||
536 | // Read DPCD 00101h to find out the number of lanes currently set | 537 | // Read DPCD 00101h to find out the number of lanes currently set |
537 | for (i = 0; i < read_dpcd_retry_cnt; i++) { | 538 | for (i = 0; i < read_dpcd_retry_cnt; i++) { |
@@ -553,8 +554,6 @@ static void read_edp_current_link_settings_on_detect(struct dc_link *link) | |||
553 | msleep(8); | 554 | msleep(8); |
554 | } | 555 | } |
555 | 556 | ||
556 | ASSERT(status == DC_OK); | ||
557 | |||
558 | // Read DPCD 00100h to find if standard link rates are set | 557 | // Read DPCD 00100h to find if standard link rates are set |
559 | core_link_read_dpcd(link, DP_LINK_BW_SET, | 558 | core_link_read_dpcd(link, DP_LINK_BW_SET, |
560 | &link_bw_set, sizeof(link_bw_set)); | 559 | &link_bw_set, sizeof(link_bw_set)); |
@@ -576,6 +575,12 @@ static void read_edp_current_link_settings_on_detect(struct dc_link *link) | |||
576 | link->cur_link_settings.link_rate = link_bw_set; | 575 | link->cur_link_settings.link_rate = link_bw_set; |
577 | link->cur_link_settings.use_link_rate_set = false; | 576 | link->cur_link_settings.use_link_rate_set = false; |
578 | } | 577 | } |
578 | // Read DPCD 00003h to find the max down spread. | ||
579 | core_link_read_dpcd(link, DP_MAX_DOWNSPREAD, | ||
580 | &max_down_spread.raw, sizeof(max_down_spread)); | ||
581 | link->cur_link_settings.link_spread = | ||
582 | max_down_spread.bits.MAX_DOWN_SPREAD ? | ||
583 | LINK_SPREAD_05_DOWNSPREAD_30KHZ : LINK_SPREAD_DISABLED; | ||
579 | } | 584 | } |
580 | 585 | ||
581 | static bool detect_dp( | 586 | static bool detect_dp( |
@@ -717,13 +722,6 @@ bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason) | |||
717 | return false; | 722 | return false; |
718 | } | 723 | } |
719 | 724 | ||
720 | if (link->connector_signal == SIGNAL_TYPE_EDP) { | ||
721 | /* On detect, we want to make sure current link settings are | ||
722 | * up to date, especially if link was powered on by GOP. | ||
723 | */ | ||
724 | read_edp_current_link_settings_on_detect(link); | ||
725 | } | ||
726 | |||
727 | prev_sink = link->local_sink; | 725 | prev_sink = link->local_sink; |
728 | if (prev_sink != NULL) { | 726 | if (prev_sink != NULL) { |
729 | dc_sink_retain(prev_sink); | 727 | dc_sink_retain(prev_sink); |
@@ -765,6 +763,7 @@ bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason) | |||
765 | } | 763 | } |
766 | 764 | ||
767 | case SIGNAL_TYPE_EDP: { | 765 | case SIGNAL_TYPE_EDP: { |
766 | read_edp_current_link_settings_on_detect(link); | ||
768 | detect_edp_sink_caps(link); | 767 | detect_edp_sink_caps(link); |
769 | sink_caps.transaction_type = | 768 | sink_caps.transaction_type = |
770 | DDC_TRANSACTION_TYPE_I2C_OVER_AUX; | 769 | DDC_TRANSACTION_TYPE_I2C_OVER_AUX; |
@@ -2329,7 +2328,7 @@ bool dc_link_set_backlight_level(const struct dc_link *link, | |||
2329 | if (core_dc->current_state->res_ctx.pipe_ctx[i].stream) { | 2328 | if (core_dc->current_state->res_ctx.pipe_ctx[i].stream) { |
2330 | if (core_dc->current_state->res_ctx. | 2329 | if (core_dc->current_state->res_ctx. |
2331 | pipe_ctx[i].stream->link | 2330 | pipe_ctx[i].stream->link |
2332 | == link) | 2331 | == link) { |
2333 | /* DMCU -1 for all controller id values, | 2332 | /* DMCU -1 for all controller id values, |
2334 | * therefore +1 here | 2333 | * therefore +1 here |
2335 | */ | 2334 | */ |
@@ -2337,6 +2336,13 @@ bool dc_link_set_backlight_level(const struct dc_link *link, | |||
2337 | core_dc->current_state-> | 2336 | core_dc->current_state-> |
2338 | res_ctx.pipe_ctx[i].stream_res.tg->inst + | 2337 | res_ctx.pipe_ctx[i].stream_res.tg->inst + |
2339 | 1; | 2338 | 1; |
2339 | |||
2340 | /* Disable brightness ramping when the display is blanked | ||
2341 | * as it can hang the DMCU | ||
2342 | */ | ||
2343 | if (core_dc->current_state->res_ctx.pipe_ctx[i].plane_state == NULL) | ||
2344 | frame_ramp = 0; | ||
2345 | } | ||
2340 | } | 2346 | } |
2341 | } | 2347 | } |
2342 | abm->funcs->set_backlight_level_pwm( | 2348 | abm->funcs->set_backlight_level_pwm( |
@@ -2984,8 +2990,10 @@ void dc_link_set_preferred_link_settings(struct dc *dc, | |||
2984 | 2990 | ||
2985 | /* Retrain with preferred link settings only relevant for | 2991 | /* Retrain with preferred link settings only relevant for |
2986 | * DP signal type | 2992 | * DP signal type |
2993 | * Check for non-DP signal or if passive dongle present | ||
2987 | */ | 2994 | */ |
2988 | if (!dc_is_dp_signal(link->connector_signal)) | 2995 | if (!dc_is_dp_signal(link->connector_signal) || |
2996 | link->dongle_max_pix_clk > 0) | ||
2989 | return; | 2997 | return; |
2990 | 2998 | ||
2991 | for (i = 0; i < MAX_PIPES; i++) { | 2999 | for (i = 0; i < MAX_PIPES; i++) { |
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c index 056be4c34a98..2c7aaed907b9 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | |||
@@ -2230,18 +2230,25 @@ static void get_active_converter_info( | |||
2230 | link->dpcd_caps.dongle_type = DISPLAY_DONGLE_NONE; | 2230 | link->dpcd_caps.dongle_type = DISPLAY_DONGLE_NONE; |
2231 | ddc_service_set_dongle_type(link->ddc, | 2231 | ddc_service_set_dongle_type(link->ddc, |
2232 | link->dpcd_caps.dongle_type); | 2232 | link->dpcd_caps.dongle_type); |
2233 | link->dpcd_caps.is_branch_dev = false; | ||
2233 | return; | 2234 | return; |
2234 | } | 2235 | } |
2235 | 2236 | ||
2236 | /* DPCD 0x5 bit 0 = 1, it indicate it's branch device */ | 2237 | /* DPCD 0x5 bit 0 = 1, it indicate it's branch device */ |
2237 | link->dpcd_caps.is_branch_dev = ds_port.fields.PORT_PRESENT; | 2238 | if (ds_port.fields.PORT_TYPE == DOWNSTREAM_DP) { |
2239 | link->dpcd_caps.is_branch_dev = false; | ||
2240 | } | ||
2241 | |||
2242 | else { | ||
2243 | link->dpcd_caps.is_branch_dev = ds_port.fields.PORT_PRESENT; | ||
2244 | } | ||
2238 | 2245 | ||
2239 | switch (ds_port.fields.PORT_TYPE) { | 2246 | switch (ds_port.fields.PORT_TYPE) { |
2240 | case DOWNSTREAM_VGA: | 2247 | case DOWNSTREAM_VGA: |
2241 | link->dpcd_caps.dongle_type = DISPLAY_DONGLE_DP_VGA_CONVERTER; | 2248 | link->dpcd_caps.dongle_type = DISPLAY_DONGLE_DP_VGA_CONVERTER; |
2242 | break; | 2249 | break; |
2243 | case DOWNSTREAM_DVI_HDMI: | 2250 | case DOWNSTREAM_DVI_HDMI_DP_PLUS_PLUS: |
2244 | /* At this point we don't know is it DVI or HDMI, | 2251 | /* At this point we don't know is it DVI or HDMI or DP++, |
2245 | * assume DVI.*/ | 2252 | * assume DVI.*/ |
2246 | link->dpcd_caps.dongle_type = DISPLAY_DONGLE_DP_DVI_CONVERTER; | 2253 | link->dpcd_caps.dongle_type = DISPLAY_DONGLE_DP_DVI_CONVERTER; |
2247 | break; | 2254 | break; |
@@ -2258,6 +2265,10 @@ static void get_active_converter_info( | |||
2258 | det_caps, sizeof(det_caps)); | 2265 | det_caps, sizeof(det_caps)); |
2259 | 2266 | ||
2260 | switch (port_caps->bits.DWN_STRM_PORTX_TYPE) { | 2267 | switch (port_caps->bits.DWN_STRM_PORTX_TYPE) { |
2268 | /*Handle DP case as DONGLE_NONE*/ | ||
2269 | case DOWN_STREAM_DETAILED_DP: | ||
2270 | link->dpcd_caps.dongle_type = DISPLAY_DONGLE_NONE; | ||
2271 | break; | ||
2261 | case DOWN_STREAM_DETAILED_VGA: | 2272 | case DOWN_STREAM_DETAILED_VGA: |
2262 | link->dpcd_caps.dongle_type = | 2273 | link->dpcd_caps.dongle_type = |
2263 | DISPLAY_DONGLE_DP_VGA_CONVERTER; | 2274 | DISPLAY_DONGLE_DP_VGA_CONVERTER; |
@@ -2267,6 +2278,8 @@ static void get_active_converter_info( | |||
2267 | DISPLAY_DONGLE_DP_DVI_CONVERTER; | 2278 | DISPLAY_DONGLE_DP_DVI_CONVERTER; |
2268 | break; | 2279 | break; |
2269 | case DOWN_STREAM_DETAILED_HDMI: | 2280 | case DOWN_STREAM_DETAILED_HDMI: |
2281 | case DOWN_STREAM_DETAILED_DP_PLUS_PLUS: | ||
2282 | /*Handle DP++ active converter case, process DP++ case as HDMI case according DP1.4 spec*/ | ||
2270 | link->dpcd_caps.dongle_type = | 2283 | link->dpcd_caps.dongle_type = |
2271 | DISPLAY_DONGLE_DP_HDMI_CONVERTER; | 2284 | DISPLAY_DONGLE_DP_HDMI_CONVERTER; |
2272 | 2285 | ||
@@ -2282,14 +2295,18 @@ static void get_active_converter_info( | |||
2282 | 2295 | ||
2283 | link->dpcd_caps.dongle_caps.is_dp_hdmi_s3d_converter = | 2296 | link->dpcd_caps.dongle_caps.is_dp_hdmi_s3d_converter = |
2284 | hdmi_caps.bits.FRAME_SEQ_TO_FRAME_PACK; | 2297 | hdmi_caps.bits.FRAME_SEQ_TO_FRAME_PACK; |
2285 | link->dpcd_caps.dongle_caps.is_dp_hdmi_ycbcr422_pass_through = | 2298 | /*YCBCR capability only for HDMI case*/ |
2286 | hdmi_caps.bits.YCrCr422_PASS_THROUGH; | 2299 | if (port_caps->bits.DWN_STRM_PORTX_TYPE |
2287 | link->dpcd_caps.dongle_caps.is_dp_hdmi_ycbcr420_pass_through = | 2300 | == DOWN_STREAM_DETAILED_HDMI) { |
2288 | hdmi_caps.bits.YCrCr420_PASS_THROUGH; | 2301 | link->dpcd_caps.dongle_caps.is_dp_hdmi_ycbcr422_pass_through = |
2289 | link->dpcd_caps.dongle_caps.is_dp_hdmi_ycbcr422_converter = | 2302 | hdmi_caps.bits.YCrCr422_PASS_THROUGH; |
2290 | hdmi_caps.bits.YCrCr422_CONVERSION; | 2303 | link->dpcd_caps.dongle_caps.is_dp_hdmi_ycbcr420_pass_through = |
2291 | link->dpcd_caps.dongle_caps.is_dp_hdmi_ycbcr420_converter = | 2304 | hdmi_caps.bits.YCrCr420_PASS_THROUGH; |
2292 | hdmi_caps.bits.YCrCr420_CONVERSION; | 2305 | link->dpcd_caps.dongle_caps.is_dp_hdmi_ycbcr422_converter = |
2306 | hdmi_caps.bits.YCrCr422_CONVERSION; | ||
2307 | link->dpcd_caps.dongle_caps.is_dp_hdmi_ycbcr420_converter = | ||
2308 | hdmi_caps.bits.YCrCr420_CONVERSION; | ||
2309 | } | ||
2293 | 2310 | ||
2294 | link->dpcd_caps.dongle_caps.dp_hdmi_max_bpc = | 2311 | link->dpcd_caps.dongle_caps.dp_hdmi_max_bpc = |
2295 | translate_dpcd_max_bpc( | 2312 | translate_dpcd_max_bpc( |
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c index 51a78283a86d..2ceaab4fb5de 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c | |||
@@ -258,7 +258,7 @@ bool resource_construct( | |||
258 | * PORT_CONNECTIVITY == 1 (as instructed by HW team). | 258 | * PORT_CONNECTIVITY == 1 (as instructed by HW team). |
259 | */ | 259 | */ |
260 | update_num_audio(&straps, &num_audio, &pool->audio_support); | 260 | update_num_audio(&straps, &num_audio, &pool->audio_support); |
261 | for (i = 0; i < pool->pipe_count && i < num_audio; i++) { | 261 | for (i = 0; i < caps->num_audio; i++) { |
262 | struct audio *aud = create_funcs->create_audio(ctx, i); | 262 | struct audio *aud = create_funcs->create_audio(ctx, i); |
263 | 263 | ||
264 | if (aud == NULL) { | 264 | if (aud == NULL) { |
@@ -1669,6 +1669,12 @@ static struct audio *find_first_free_audio( | |||
1669 | return pool->audios[i]; | 1669 | return pool->audios[i]; |
1670 | } | 1670 | } |
1671 | } | 1671 | } |
1672 | |||
1673 | /* use engine id to find free audio */ | ||
1674 | if ((id < pool->audio_count) && (res_ctx->is_audio_acquired[id] == false)) { | ||
1675 | return pool->audios[id]; | ||
1676 | } | ||
1677 | |||
1672 | /*not found the matching one, first come first serve*/ | 1678 | /*not found the matching one, first come first serve*/ |
1673 | for (i = 0; i < pool->audio_count; i++) { | 1679 | for (i = 0; i < pool->audio_count; i++) { |
1674 | if (res_ctx->is_audio_acquired[i] == false) { | 1680 | if (res_ctx->is_audio_acquired[i] == false) { |
@@ -1833,6 +1839,7 @@ static int get_norm_pix_clk(const struct dc_crtc_timing *timing) | |||
1833 | pix_clk /= 2; | 1839 | pix_clk /= 2; |
1834 | if (timing->pixel_encoding != PIXEL_ENCODING_YCBCR422) { | 1840 | if (timing->pixel_encoding != PIXEL_ENCODING_YCBCR422) { |
1835 | switch (timing->display_color_depth) { | 1841 | switch (timing->display_color_depth) { |
1842 | case COLOR_DEPTH_666: | ||
1836 | case COLOR_DEPTH_888: | 1843 | case COLOR_DEPTH_888: |
1837 | normalized_pix_clk = pix_clk; | 1844 | normalized_pix_clk = pix_clk; |
1838 | break; | 1845 | break; |
@@ -1979,7 +1986,7 @@ enum dc_status resource_map_pool_resources( | |||
1979 | /* TODO: Add check if ASIC support and EDID audio */ | 1986 | /* TODO: Add check if ASIC support and EDID audio */ |
1980 | if (!stream->converter_disable_audio && | 1987 | if (!stream->converter_disable_audio && |
1981 | dc_is_audio_capable_signal(pipe_ctx->stream->signal) && | 1988 | dc_is_audio_capable_signal(pipe_ctx->stream->signal) && |
1982 | stream->audio_info.mode_count) { | 1989 | stream->audio_info.mode_count && stream->audio_info.flags.all) { |
1983 | pipe_ctx->stream_res.audio = find_first_free_audio( | 1990 | pipe_ctx->stream_res.audio = find_first_free_audio( |
1984 | &context->res_ctx, pool, pipe_ctx->stream_res.stream_enc->id); | 1991 | &context->res_ctx, pool, pipe_ctx->stream_res.stream_enc->id); |
1985 | 1992 | ||
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c index af7f8be230f7..352862370390 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c | |||
@@ -612,7 +612,8 @@ bool dc_stream_set_dynamic_metadata(struct dc *dc, | |||
612 | 612 | ||
613 | pipe_ctx->stream->dmdata_address = attr->address; | 613 | pipe_ctx->stream->dmdata_address = attr->address; |
614 | 614 | ||
615 | if (pipe_ctx->stream_res.stream_enc->funcs->set_dynamic_metadata != NULL) { | 615 | if (pipe_ctx->stream_res.stream_enc && |
616 | pipe_ctx->stream_res.stream_enc->funcs->set_dynamic_metadata != NULL) { | ||
616 | if (pipe_ctx->stream->dmdata_address.quad_part != 0) { | 617 | if (pipe_ctx->stream->dmdata_address.quad_part != 0) { |
617 | /* if using dynamic meta, don't set up generic infopackets */ | 618 | /* if using dynamic meta, don't set up generic infopackets */ |
618 | pipe_ctx->stream_res.encoder_info_frame.hdrsmd.valid = false; | 619 | pipe_ctx->stream_res.encoder_info_frame.hdrsmd.valid = false; |
diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_abm.c b/drivers/gpu/drm/amd/display/dc/dce/dce_abm.c index f8903bcabe49..58bd131d5b48 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dce_abm.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_abm.c | |||
@@ -239,6 +239,10 @@ static void dmcu_set_backlight_level( | |||
239 | s2 |= (backlight_8_bit << ATOM_S2_CURRENT_BL_LEVEL_SHIFT); | 239 | s2 |= (backlight_8_bit << ATOM_S2_CURRENT_BL_LEVEL_SHIFT); |
240 | 240 | ||
241 | REG_WRITE(BIOS_SCRATCH_2, s2); | 241 | REG_WRITE(BIOS_SCRATCH_2, s2); |
242 | |||
243 | /* waitDMCUReadyForCmd */ | ||
244 | REG_WAIT(MASTER_COMM_CNTL_REG, MASTER_COMM_INTERRUPT, | ||
245 | 0, 1, 80000); | ||
242 | } | 246 | } |
243 | 247 | ||
244 | static void dce_abm_init(struct abm *abm) | 248 | static void dce_abm_init(struct abm *abm) |
diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c index 858a58856ebd..fafb4b470140 100644 --- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | |||
@@ -965,11 +965,17 @@ void hwss_edp_backlight_control( | |||
965 | void dce110_enable_audio_stream(struct pipe_ctx *pipe_ctx) | 965 | void dce110_enable_audio_stream(struct pipe_ctx *pipe_ctx) |
966 | { | 966 | { |
967 | /* notify audio driver for audio modes of monitor */ | 967 | /* notify audio driver for audio modes of monitor */ |
968 | struct dc *core_dc = pipe_ctx->stream->ctx->dc; | 968 | struct dc *core_dc; |
969 | struct pp_smu_funcs *pp_smu = NULL; | 969 | struct pp_smu_funcs *pp_smu = NULL; |
970 | struct clk_mgr *clk_mgr = core_dc->clk_mgr; | 970 | struct clk_mgr *clk_mgr; |
971 | unsigned int i, num_audio = 1; | 971 | unsigned int i, num_audio = 1; |
972 | 972 | ||
973 | if (!pipe_ctx->stream) | ||
974 | return; | ||
975 | |||
976 | core_dc = pipe_ctx->stream->ctx->dc; | ||
977 | clk_mgr = core_dc->clk_mgr; | ||
978 | |||
973 | if (pipe_ctx->stream_res.audio && pipe_ctx->stream_res.audio->enabled == true) | 979 | if (pipe_ctx->stream_res.audio && pipe_ctx->stream_res.audio->enabled == true) |
974 | return; | 980 | return; |
975 | 981 | ||
@@ -999,9 +1005,15 @@ void dce110_enable_audio_stream(struct pipe_ctx *pipe_ctx) | |||
999 | 1005 | ||
1000 | void dce110_disable_audio_stream(struct pipe_ctx *pipe_ctx, int option) | 1006 | void dce110_disable_audio_stream(struct pipe_ctx *pipe_ctx, int option) |
1001 | { | 1007 | { |
1002 | struct dc *dc = pipe_ctx->stream->ctx->dc; | 1008 | struct dc *dc; |
1003 | struct pp_smu_funcs *pp_smu = NULL; | 1009 | struct pp_smu_funcs *pp_smu = NULL; |
1004 | struct clk_mgr *clk_mgr = dc->clk_mgr; | 1010 | struct clk_mgr *clk_mgr; |
1011 | |||
1012 | if (!pipe_ctx || !pipe_ctx->stream) | ||
1013 | return; | ||
1014 | |||
1015 | dc = pipe_ctx->stream->ctx->dc; | ||
1016 | clk_mgr = dc->clk_mgr; | ||
1005 | 1017 | ||
1006 | if (pipe_ctx->stream_res.audio && pipe_ctx->stream_res.audio->enabled == false) | 1018 | if (pipe_ctx->stream_res.audio && pipe_ctx->stream_res.audio->enabled == false) |
1007 | return; | 1019 | return; |
@@ -1009,6 +1021,8 @@ void dce110_disable_audio_stream(struct pipe_ctx *pipe_ctx, int option) | |||
1009 | pipe_ctx->stream_res.stream_enc->funcs->audio_mute_control( | 1021 | pipe_ctx->stream_res.stream_enc->funcs->audio_mute_control( |
1010 | pipe_ctx->stream_res.stream_enc, true); | 1022 | pipe_ctx->stream_res.stream_enc, true); |
1011 | if (pipe_ctx->stream_res.audio) { | 1023 | if (pipe_ctx->stream_res.audio) { |
1024 | pipe_ctx->stream_res.audio->enabled = false; | ||
1025 | |||
1012 | if (dc->res_pool->pp_smu) | 1026 | if (dc->res_pool->pp_smu) |
1013 | pp_smu = dc->res_pool->pp_smu; | 1027 | pp_smu = dc->res_pool->pp_smu; |
1014 | 1028 | ||
@@ -1039,8 +1053,6 @@ void dce110_disable_audio_stream(struct pipe_ctx *pipe_ctx, int option) | |||
1039 | /* dal_audio_disable_azalia_audio_jack_presence(stream->audio, | 1053 | /* dal_audio_disable_azalia_audio_jack_presence(stream->audio, |
1040 | * stream->stream_engine_id); | 1054 | * stream->stream_engine_id); |
1041 | */ | 1055 | */ |
1042 | if (pipe_ctx->stream_res.audio) | ||
1043 | pipe_ctx->stream_res.audio->enabled = false; | ||
1044 | } | 1056 | } |
1045 | } | 1057 | } |
1046 | 1058 | ||
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c index e50a696fcb5d..2118ea21d7e9 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | |||
@@ -1195,16 +1195,7 @@ static void dcn10_init_hw(struct dc *dc) | |||
1195 | * everything down. | 1195 | * everything down. |
1196 | */ | 1196 | */ |
1197 | if (dcb->funcs->is_accelerated_mode(dcb) || dc->config.power_down_display_on_boot) { | 1197 | if (dcb->funcs->is_accelerated_mode(dcb) || dc->config.power_down_display_on_boot) { |
1198 | for (i = 0; i < dc->res_pool->pipe_count; i++) { | 1198 | dc->hwss.init_pipes(dc, dc->current_state); |
1199 | struct hubp *hubp = dc->res_pool->hubps[i]; | ||
1200 | struct dpp *dpp = dc->res_pool->dpps[i]; | ||
1201 | |||
1202 | hubp->funcs->hubp_init(hubp); | ||
1203 | dc->res_pool->opps[i]->mpc_tree_params.opp_id = dc->res_pool->opps[i]->inst; | ||
1204 | plane_atomic_power_down(dc, dpp, hubp); | ||
1205 | } | ||
1206 | |||
1207 | apply_DEGVIDCN10_253_wa(dc); | ||
1208 | } | 1199 | } |
1209 | 1200 | ||
1210 | for (i = 0; i < dc->res_pool->audio_count; i++) { | 1201 | for (i = 0; i < dc->res_pool->audio_count; i++) { |
@@ -1375,10 +1366,6 @@ static bool dcn10_set_input_transfer_func(struct pipe_ctx *pipe_ctx, | |||
1375 | return result; | 1366 | return result; |
1376 | } | 1367 | } |
1377 | 1368 | ||
1378 | |||
1379 | |||
1380 | |||
1381 | |||
1382 | static bool | 1369 | static bool |
1383 | dcn10_set_output_transfer_func(struct pipe_ctx *pipe_ctx, | 1370 | dcn10_set_output_transfer_func(struct pipe_ctx *pipe_ctx, |
1384 | const struct dc_stream_state *stream) | 1371 | const struct dc_stream_state *stream) |
@@ -2516,6 +2503,12 @@ static void dcn10_apply_ctx_for_surface( | |||
2516 | if (removed_pipe[i]) | 2503 | if (removed_pipe[i]) |
2517 | dcn10_disable_plane(dc, &dc->current_state->res_ctx.pipe_ctx[i]); | 2504 | dcn10_disable_plane(dc, &dc->current_state->res_ctx.pipe_ctx[i]); |
2518 | 2505 | ||
2506 | for (i = 0; i < dc->res_pool->pipe_count; i++) | ||
2507 | if (removed_pipe[i]) { | ||
2508 | dc->hwss.optimize_bandwidth(dc, context); | ||
2509 | break; | ||
2510 | } | ||
2511 | |||
2519 | if (dc->hwseq->wa.DEGVIDCN10_254) | 2512 | if (dc->hwseq->wa.DEGVIDCN10_254) |
2520 | hubbub1_wm_change_req_wa(dc->res_pool->hubbub); | 2513 | hubbub1_wm_change_req_wa(dc->res_pool->hubbub); |
2521 | } | 2514 | } |
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c index 1a20461c2937..a12530a3ab9c 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | |||
@@ -508,7 +508,7 @@ static const struct resource_caps rv2_res_cap = { | |||
508 | .num_audio = 3, | 508 | .num_audio = 3, |
509 | .num_stream_encoder = 3, | 509 | .num_stream_encoder = 3, |
510 | .num_pll = 3, | 510 | .num_pll = 3, |
511 | .num_ddc = 3, | 511 | .num_ddc = 4, |
512 | }; | 512 | }; |
513 | 513 | ||
514 | static const struct dc_plane_cap plane_cap = { | 514 | static const struct dc_plane_cap plane_cap = { |
diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dccg.c b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dccg.c index 51a3dfe97f0e..31aa6ee5cd5b 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dccg.c +++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dccg.c | |||
@@ -102,14 +102,19 @@ void dccg2_init(struct dccg *dccg) | |||
102 | switch (dccg_dcn->base.ctx->dc->res_pool->pipe_count) { | 102 | switch (dccg_dcn->base.ctx->dc->res_pool->pipe_count) { |
103 | case 6: | 103 | case 6: |
104 | REG_UPDATE(DPPCLK_DTO_CTRL, DPPCLK_DTO_DB_EN[5], 1); | 104 | REG_UPDATE(DPPCLK_DTO_CTRL, DPPCLK_DTO_DB_EN[5], 1); |
105 | /* Fall through */ | ||
105 | case 5: | 106 | case 5: |
106 | REG_UPDATE(DPPCLK_DTO_CTRL, DPPCLK_DTO_DB_EN[4], 1); | 107 | REG_UPDATE(DPPCLK_DTO_CTRL, DPPCLK_DTO_DB_EN[4], 1); |
108 | /* Fall through */ | ||
107 | case 4: | 109 | case 4: |
108 | REG_UPDATE(DPPCLK_DTO_CTRL, DPPCLK_DTO_DB_EN[3], 1); | 110 | REG_UPDATE(DPPCLK_DTO_CTRL, DPPCLK_DTO_DB_EN[3], 1); |
111 | /* Fall through */ | ||
109 | case 3: | 112 | case 3: |
110 | REG_UPDATE(DPPCLK_DTO_CTRL, DPPCLK_DTO_DB_EN[2], 1); | 113 | REG_UPDATE(DPPCLK_DTO_CTRL, DPPCLK_DTO_DB_EN[2], 1); |
114 | /* Fall through */ | ||
111 | case 2: | 115 | case 2: |
112 | REG_UPDATE(DPPCLK_DTO_CTRL, DPPCLK_DTO_DB_EN[1], 1); | 116 | REG_UPDATE(DPPCLK_DTO_CTRL, DPPCLK_DTO_DB_EN[1], 1); |
117 | /* Fall through */ | ||
113 | case 1: | 118 | case 1: |
114 | REG_UPDATE(DPPCLK_DTO_CTRL, DPPCLK_DTO_DB_EN[0], 1); | 119 | REG_UPDATE(DPPCLK_DTO_CTRL, DPPCLK_DTO_DB_EN[0], 1); |
115 | break; | 120 | break; |
diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubbub.c b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubbub.c index ece6e136437b..6e2dbd03f9bf 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubbub.c +++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubbub.c | |||
@@ -337,6 +337,7 @@ static enum dcn_hubbub_page_table_block_size page_table_block_size_to_hw(unsigne | |||
337 | break; | 337 | break; |
338 | default: | 338 | default: |
339 | ASSERT(false); | 339 | ASSERT(false); |
340 | block_size = page_table_block_size; | ||
340 | break; | 341 | break; |
341 | } | 342 | } |
342 | 343 | ||
@@ -366,25 +367,24 @@ int hubbub2_init_dchub_sys_ctx(struct hubbub *hubbub, | |||
366 | struct dcn_vmid_page_table_config phys_config; | 367 | struct dcn_vmid_page_table_config phys_config; |
367 | 368 | ||
368 | REG_SET(DCN_VM_FB_LOCATION_BASE, 0, | 369 | REG_SET(DCN_VM_FB_LOCATION_BASE, 0, |
369 | FB_BASE, pa_config->system_aperture.fb_base); | 370 | FB_BASE, pa_config->system_aperture.fb_base >> 24); |
370 | REG_SET(DCN_VM_FB_LOCATION_TOP, 0, | 371 | REG_SET(DCN_VM_FB_LOCATION_TOP, 0, |
371 | FB_TOP, pa_config->system_aperture.fb_top); | 372 | FB_TOP, pa_config->system_aperture.fb_top >> 24); |
372 | REG_SET(DCN_VM_FB_OFFSET, 0, | 373 | REG_SET(DCN_VM_FB_OFFSET, 0, |
373 | FB_OFFSET, pa_config->system_aperture.fb_offset); | 374 | FB_OFFSET, pa_config->system_aperture.fb_offset >> 24); |
374 | REG_SET(DCN_VM_AGP_BOT, 0, | 375 | REG_SET(DCN_VM_AGP_BOT, 0, |
375 | AGP_BOT, pa_config->system_aperture.agp_bot); | 376 | AGP_BOT, pa_config->system_aperture.agp_bot >> 24); |
376 | REG_SET(DCN_VM_AGP_TOP, 0, | 377 | REG_SET(DCN_VM_AGP_TOP, 0, |
377 | AGP_TOP, pa_config->system_aperture.agp_top); | 378 | AGP_TOP, pa_config->system_aperture.agp_top >> 24); |
378 | REG_SET(DCN_VM_AGP_BASE, 0, | 379 | REG_SET(DCN_VM_AGP_BASE, 0, |
379 | AGP_BASE, pa_config->system_aperture.agp_base); | 380 | AGP_BASE, pa_config->system_aperture.agp_base >> 24); |
380 | 381 | ||
381 | if (pa_config->gart_config.page_table_start_addr != pa_config->gart_config.page_table_end_addr) { | 382 | if (pa_config->gart_config.page_table_start_addr != pa_config->gart_config.page_table_end_addr) { |
382 | phys_config.depth = 1; | ||
383 | phys_config.block_size = 4096; | ||
384 | phys_config.page_table_start_addr = pa_config->gart_config.page_table_start_addr >> 12; | 383 | phys_config.page_table_start_addr = pa_config->gart_config.page_table_start_addr >> 12; |
385 | phys_config.page_table_end_addr = pa_config->gart_config.page_table_end_addr >> 12; | 384 | phys_config.page_table_end_addr = pa_config->gart_config.page_table_end_addr >> 12; |
386 | phys_config.page_table_base_addr = pa_config->gart_config.page_table_base_addr; | 385 | phys_config.page_table_base_addr = pa_config->gart_config.page_table_base_addr; |
387 | 386 | phys_config.depth = 0; | |
387 | phys_config.block_size = 0; | ||
388 | // Init VMID 0 based on PA config | 388 | // Init VMID 0 based on PA config |
389 | dcn20_vmid_setup(&hubbub1->vmid[0], &phys_config); | 389 | dcn20_vmid_setup(&hubbub1->vmid[0], &phys_config); |
390 | } | 390 | } |
diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c index 0b84a322b8a2..d810c8940129 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c | |||
@@ -1153,8 +1153,8 @@ void dcn20_enable_plane( | |||
1153 | 1153 | ||
1154 | apt.sys_default.quad_part = 0; | 1154 | apt.sys_default.quad_part = 0; |
1155 | 1155 | ||
1156 | apt.sys_high.quad_part = dc->vm_pa_config.system_aperture.start_addr; | 1156 | apt.sys_low.quad_part = dc->vm_pa_config.system_aperture.start_addr; |
1157 | apt.sys_low.quad_part = dc->vm_pa_config.system_aperture.end_addr; | 1157 | apt.sys_high.quad_part = dc->vm_pa_config.system_aperture.end_addr; |
1158 | 1158 | ||
1159 | // Program system aperture settings | 1159 | // Program system aperture settings |
1160 | pipe_ctx->plane_res.hubp->funcs->hubp_set_vm_system_aperture_settings(pipe_ctx->plane_res.hubp, &apt); | 1160 | pipe_ctx->plane_res.hubp->funcs->hubp_set_vm_system_aperture_settings(pipe_ctx->plane_res.hubp, &apt); |
@@ -1242,6 +1242,8 @@ void dcn20_pipe_control_lock_global( | |||
1242 | CRTC_STATE_VACTIVE); | 1242 | CRTC_STATE_VACTIVE); |
1243 | pipe->stream_res.tg->funcs->wait_for_state(pipe->stream_res.tg, | 1243 | pipe->stream_res.tg->funcs->wait_for_state(pipe->stream_res.tg, |
1244 | CRTC_STATE_VBLANK); | 1244 | CRTC_STATE_VBLANK); |
1245 | pipe->stream_res.tg->funcs->wait_for_state(pipe->stream_res.tg, | ||
1246 | CRTC_STATE_VACTIVE); | ||
1245 | pipe->stream_res.tg->funcs->lock_doublebuffer_disable( | 1247 | pipe->stream_res.tg->funcs->lock_doublebuffer_disable( |
1246 | pipe->stream_res.tg); | 1248 | pipe->stream_res.tg); |
1247 | } | 1249 | } |
@@ -1263,6 +1265,17 @@ void dcn20_pipe_control_lock( | |||
1263 | if (pipe->plane_state != NULL) | 1265 | if (pipe->plane_state != NULL) |
1264 | flip_immediate = pipe->plane_state->flip_immediate; | 1266 | flip_immediate = pipe->plane_state->flip_immediate; |
1265 | 1267 | ||
1268 | if (flip_immediate && lock) { | ||
1269 | while (pipe->plane_res.hubp->funcs->hubp_is_flip_pending(pipe->plane_res.hubp)) { | ||
1270 | udelay(1); | ||
1271 | } | ||
1272 | |||
1273 | if (pipe->bottom_pipe != NULL) | ||
1274 | while (pipe->bottom_pipe->plane_res.hubp->funcs->hubp_is_flip_pending(pipe->bottom_pipe->plane_res.hubp)) { | ||
1275 | udelay(1); | ||
1276 | } | ||
1277 | } | ||
1278 | |||
1266 | /* In flip immediate and pipe splitting case, we need to use GSL | 1279 | /* In flip immediate and pipe splitting case, we need to use GSL |
1267 | * for synchronization. Only do setup on locking and on flip type change. | 1280 | * for synchronization. Only do setup on locking and on flip type change. |
1268 | */ | 1281 | */ |
@@ -1740,8 +1753,11 @@ static void dcn20_reset_back_end_for_pipe( | |||
1740 | else if (pipe_ctx->stream_res.audio) { | 1753 | else if (pipe_ctx->stream_res.audio) { |
1741 | dc->hwss.disable_audio_stream(pipe_ctx, FREE_ACQUIRED_RESOURCE); | 1754 | dc->hwss.disable_audio_stream(pipe_ctx, FREE_ACQUIRED_RESOURCE); |
1742 | } | 1755 | } |
1743 | |||
1744 | } | 1756 | } |
1757 | #ifdef CONFIG_DRM_AMD_DC_DSC_SUPPORT | ||
1758 | else if (pipe_ctx->stream_res.dsc) | ||
1759 | dp_set_dsc_enable(pipe_ctx, false); | ||
1760 | #endif | ||
1745 | 1761 | ||
1746 | /* by upper caller loop, parent pipe: pipe0, will be reset last. | 1762 | /* by upper caller loop, parent pipe: pipe0, will be reset last. |
1747 | * back end share by all pipes and will be disable only when disable | 1763 | * back end share by all pipes and will be disable only when disable |
diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_optc.c b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_optc.c index 26a66ccf6e72..1ae973962d53 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_optc.c +++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_optc.c | |||
@@ -535,7 +535,7 @@ void dcn20_timing_generator_init(struct optc *optc1) | |||
535 | optc1->min_h_blank = 32; | 535 | optc1->min_h_blank = 32; |
536 | optc1->min_v_blank = 3; | 536 | optc1->min_v_blank = 3; |
537 | optc1->min_v_blank_interlace = 5; | 537 | optc1->min_v_blank_interlace = 5; |
538 | optc1->min_h_sync_width = 8; | 538 | optc1->min_h_sync_width = 4;// Minimum HSYNC = 8 pixels asked By HW in the first place for no actual reason. Oculus Rift S will not light up with 8 as it's hsyncWidth is 6. Changing it to 4 to fix that issue. |
539 | optc1->min_v_sync_width = 1; | 539 | optc1->min_v_sync_width = 1; |
540 | optc1->comb_opp_id = 0xf; | 540 | optc1->comb_opp_id = 0xf; |
541 | } | 541 | } |
diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c index d200bc3cec71..b949e202d6cb 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c | |||
@@ -2643,6 +2643,10 @@ static void update_bounding_box(struct dc *dc, struct _vcs_dpi_soc_bounding_box_ | |||
2643 | 2643 | ||
2644 | if (dc->bb_overrides.min_dcfclk_mhz > 0) | 2644 | if (dc->bb_overrides.min_dcfclk_mhz > 0) |
2645 | min_dcfclk = dc->bb_overrides.min_dcfclk_mhz; | 2645 | min_dcfclk = dc->bb_overrides.min_dcfclk_mhz; |
2646 | else | ||
2647 | // Accounting for SOC/DCF relationship, we can go as high as | ||
2648 | // 506Mhz in Vmin. We need to code 507 since SMU will round down to 506. | ||
2649 | min_dcfclk = 507; | ||
2646 | 2650 | ||
2647 | for (i = 0; i < num_states; i++) { | 2651 | for (i = 0; i < num_states; i++) { |
2648 | int min_fclk_required_by_uclk; | 2652 | int min_fclk_required_by_uclk; |
diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_vmid.c b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_vmid.c index 27679ef6ebe8..96c263223315 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_vmid.c +++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_vmid.c | |||
@@ -23,6 +23,8 @@ | |||
23 | * | 23 | * |
24 | */ | 24 | */ |
25 | 25 | ||
26 | #include <linux/delay.h> | ||
27 | |||
26 | #include "dcn20_vmid.h" | 28 | #include "dcn20_vmid.h" |
27 | #include "reg_helper.h" | 29 | #include "reg_helper.h" |
28 | 30 | ||
@@ -36,6 +38,38 @@ | |||
36 | #define FN(reg_name, field_name) \ | 38 | #define FN(reg_name, field_name) \ |
37 | vmid->shifts->field_name, vmid->masks->field_name | 39 | vmid->shifts->field_name, vmid->masks->field_name |
38 | 40 | ||
41 | static void dcn20_wait_for_vmid_ready(struct dcn20_vmid *vmid) | ||
42 | { | ||
43 | /* According the hardware spec, we need to poll for the lowest | ||
44 | * bit of PAGE_TABLE_BASE_ADDR_LO32 = 1 any time a GPUVM | ||
45 | * context is updated. We can't use REG_WAIT here since we | ||
46 | * don't have a seperate field to wait on. | ||
47 | * | ||
48 | * TODO: Confirm timeout / poll interval with hardware team | ||
49 | */ | ||
50 | |||
51 | int max_times = 10000; | ||
52 | int delay_us = 5; | ||
53 | int i; | ||
54 | |||
55 | for (i = 0; i < max_times; ++i) { | ||
56 | uint32_t entry_lo32; | ||
57 | |||
58 | REG_GET(PAGE_TABLE_BASE_ADDR_LO32, | ||
59 | VM_CONTEXT0_PAGE_DIRECTORY_ENTRY_LO32, | ||
60 | &entry_lo32); | ||
61 | |||
62 | if (entry_lo32 & 0x1) | ||
63 | return; | ||
64 | |||
65 | udelay(delay_us); | ||
66 | } | ||
67 | |||
68 | /* VM setup timed out */ | ||
69 | DC_LOG_WARNING("Timeout while waiting for GPUVM context update\n"); | ||
70 | ASSERT(0); | ||
71 | } | ||
72 | |||
39 | void dcn20_vmid_setup(struct dcn20_vmid *vmid, const struct dcn_vmid_page_table_config *config) | 73 | void dcn20_vmid_setup(struct dcn20_vmid *vmid, const struct dcn_vmid_page_table_config *config) |
40 | { | 74 | { |
41 | REG_SET(PAGE_TABLE_START_ADDR_HI32, 0, | 75 | REG_SET(PAGE_TABLE_START_ADDR_HI32, 0, |
@@ -54,6 +88,9 @@ void dcn20_vmid_setup(struct dcn20_vmid *vmid, const struct dcn_vmid_page_table_ | |||
54 | 88 | ||
55 | REG_SET(PAGE_TABLE_BASE_ADDR_HI32, 0, | 89 | REG_SET(PAGE_TABLE_BASE_ADDR_HI32, 0, |
56 | VM_CONTEXT0_PAGE_DIRECTORY_ENTRY_HI32, (config->page_table_base_addr >> 32) & 0xFFFFFFFF); | 90 | VM_CONTEXT0_PAGE_DIRECTORY_ENTRY_HI32, (config->page_table_base_addr >> 32) & 0xFFFFFFFF); |
91 | /* Note: per hardware spec PAGE_TABLE_BASE_ADDR_LO32 must be programmed last in sequence */ | ||
57 | REG_SET(PAGE_TABLE_BASE_ADDR_LO32, 0, | 92 | REG_SET(PAGE_TABLE_BASE_ADDR_LO32, 0, |
58 | VM_CONTEXT0_PAGE_DIRECTORY_ENTRY_LO32, config->page_table_base_addr & 0xFFFFFFFF); | 93 | VM_CONTEXT0_PAGE_DIRECTORY_ENTRY_LO32, config->page_table_base_addr & 0xFFFFFFFF); |
94 | |||
95 | dcn20_wait_for_vmid_ready(vmid); | ||
59 | } | 96 | } |
diff --git a/drivers/gpu/drm/amd/display/dc/dsc/drm_dsc_dc.c b/drivers/gpu/drm/amd/display/dc/dsc/drm_dsc_dc.c index 67089765780b..340ef4d41ebd 100644 --- a/drivers/gpu/drm/amd/display/dc/dsc/drm_dsc_dc.c +++ b/drivers/gpu/drm/amd/display/dc/dsc/drm_dsc_dc.c | |||
@@ -377,6 +377,12 @@ int drm_dsc_compute_rc_parameters(struct drm_dsc_config *vdsc_cfg) | |||
377 | vdsc_cfg->rc_bits = (hrd_delay * vdsc_cfg->bits_per_pixel) / 16; | 377 | vdsc_cfg->rc_bits = (hrd_delay * vdsc_cfg->bits_per_pixel) / 16; |
378 | vdsc_cfg->initial_dec_delay = hrd_delay - vdsc_cfg->initial_xmit_delay; | 378 | vdsc_cfg->initial_dec_delay = hrd_delay - vdsc_cfg->initial_xmit_delay; |
379 | 379 | ||
380 | /* As per DSC spec v1.2a recommendation: */ | ||
381 | if (vdsc_cfg->native_420) | ||
382 | vdsc_cfg->second_line_offset_adj = 512; | ||
383 | else | ||
384 | vdsc_cfg->second_line_offset_adj = 0; | ||
385 | |||
380 | return 0; | 386 | return 0; |
381 | } | 387 | } |
382 | EXPORT_SYMBOL(drm_dsc_compute_rc_parameters); | 388 | EXPORT_SYMBOL(drm_dsc_compute_rc_parameters); |
diff --git a/drivers/gpu/drm/amd/display/dc/inc/core_types.h b/drivers/gpu/drm/amd/display/dc/inc/core_types.h index c89393c19232..a148ffde8b12 100644 --- a/drivers/gpu/drm/amd/display/dc/inc/core_types.h +++ b/drivers/gpu/drm/amd/display/dc/inc/core_types.h | |||
@@ -212,7 +212,7 @@ struct resource_pool { | |||
212 | struct clock_source *clock_sources[MAX_CLOCK_SOURCES]; | 212 | struct clock_source *clock_sources[MAX_CLOCK_SOURCES]; |
213 | unsigned int clk_src_count; | 213 | unsigned int clk_src_count; |
214 | 214 | ||
215 | struct audio *audios[MAX_PIPES]; | 215 | struct audio *audios[MAX_AUDIOS]; |
216 | unsigned int audio_count; | 216 | unsigned int audio_count; |
217 | struct audio_support audio_support; | 217 | struct audio_support audio_support; |
218 | 218 | ||
diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/dchubbub.h b/drivers/gpu/drm/amd/display/dc/inc/hw/dchubbub.h index 959f5b654611..9502478c4a1b 100644 --- a/drivers/gpu/drm/amd/display/dc/inc/hw/dchubbub.h +++ b/drivers/gpu/drm/amd/display/dc/inc/hw/dchubbub.h | |||
@@ -61,8 +61,8 @@ enum dcn_hubbub_page_table_depth { | |||
61 | }; | 61 | }; |
62 | 62 | ||
63 | enum dcn_hubbub_page_table_block_size { | 63 | enum dcn_hubbub_page_table_block_size { |
64 | DCN_PAGE_TABLE_BLOCK_SIZE_4KB, | 64 | DCN_PAGE_TABLE_BLOCK_SIZE_4KB = 0, |
65 | DCN_PAGE_TABLE_BLOCK_SIZE_64KB | 65 | DCN_PAGE_TABLE_BLOCK_SIZE_64KB = 4, |
66 | }; | 66 | }; |
67 | 67 | ||
68 | struct dcn_hubbub_phys_addr_config { | 68 | struct dcn_hubbub_phys_addr_config { |
diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/hw_shared.h b/drivers/gpu/drm/amd/display/dc/inc/hw/hw_shared.h index 8759ec03aede..f82365e2d03c 100644 --- a/drivers/gpu/drm/amd/display/dc/inc/hw/hw_shared.h +++ b/drivers/gpu/drm/amd/display/dc/inc/hw/hw_shared.h | |||
@@ -34,6 +34,7 @@ | |||
34 | * Data types shared between different Virtual HW blocks | 34 | * Data types shared between different Virtual HW blocks |
35 | ******************************************************************************/ | 35 | ******************************************************************************/ |
36 | 36 | ||
37 | #define MAX_AUDIOS 7 | ||
37 | #define MAX_PIPES 6 | 38 | #define MAX_PIPES 6 |
38 | #if defined(CONFIG_DRM_AMD_DC_DCN2_0) | 39 | #if defined(CONFIG_DRM_AMD_DC_DCN2_0) |
39 | #define MAX_DWB_PIPES 1 | 40 | #define MAX_DWB_PIPES 1 |
diff --git a/drivers/gpu/drm/amd/display/include/dpcd_defs.h b/drivers/gpu/drm/amd/display/include/dpcd_defs.h index 1c66166d0a94..2c90d1b46c8b 100644 --- a/drivers/gpu/drm/amd/display/include/dpcd_defs.h +++ b/drivers/gpu/drm/amd/display/include/dpcd_defs.h | |||
@@ -43,7 +43,7 @@ enum dpcd_revision { | |||
43 | enum dpcd_downstream_port_type { | 43 | enum dpcd_downstream_port_type { |
44 | DOWNSTREAM_DP = 0, | 44 | DOWNSTREAM_DP = 0, |
45 | DOWNSTREAM_VGA, | 45 | DOWNSTREAM_VGA, |
46 | DOWNSTREAM_DVI_HDMI, | 46 | DOWNSTREAM_DVI_HDMI_DP_PLUS_PLUS,/* DVI, HDMI, DP++ */ |
47 | DOWNSTREAM_NONDDC /* has no EDID (TV,CV) */ | 47 | DOWNSTREAM_NONDDC /* has no EDID (TV,CV) */ |
48 | }; | 48 | }; |
49 | 49 | ||
diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c index f1565c448de5..c097113c3976 100644 --- a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +++ b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | |||
@@ -137,12 +137,37 @@ int smu_get_dpm_freq_range(struct smu_context *smu, enum smu_clk_type clk_type, | |||
137 | { | 137 | { |
138 | int ret = 0, clk_id = 0; | 138 | int ret = 0, clk_id = 0; |
139 | uint32_t param = 0; | 139 | uint32_t param = 0; |
140 | uint32_t clock_limit; | ||
140 | 141 | ||
141 | if (!min && !max) | 142 | if (!min && !max) |
142 | return -EINVAL; | 143 | return -EINVAL; |
143 | 144 | ||
144 | if (!smu_clk_dpm_is_enabled(smu, clk_type)) | 145 | if (!smu_clk_dpm_is_enabled(smu, clk_type)) { |
146 | switch (clk_type) { | ||
147 | case SMU_MCLK: | ||
148 | case SMU_UCLK: | ||
149 | clock_limit = smu->smu_table.boot_values.uclk; | ||
150 | break; | ||
151 | case SMU_GFXCLK: | ||
152 | case SMU_SCLK: | ||
153 | clock_limit = smu->smu_table.boot_values.gfxclk; | ||
154 | break; | ||
155 | case SMU_SOCCLK: | ||
156 | clock_limit = smu->smu_table.boot_values.socclk; | ||
157 | break; | ||
158 | default: | ||
159 | clock_limit = 0; | ||
160 | break; | ||
161 | } | ||
162 | |||
163 | /* clock in Mhz unit */ | ||
164 | if (min) | ||
165 | *min = clock_limit / 100; | ||
166 | if (max) | ||
167 | *max = clock_limit / 100; | ||
168 | |||
145 | return 0; | 169 | return 0; |
170 | } | ||
146 | 171 | ||
147 | mutex_lock(&smu->mutex); | 172 | mutex_lock(&smu->mutex); |
148 | clk_id = smu_clk_get_index(smu, clk_type); | 173 | clk_id = smu_clk_get_index(smu, clk_type); |
@@ -1349,13 +1374,49 @@ static int smu_enable_umd_pstate(void *handle, | |||
1349 | return 0; | 1374 | return 0; |
1350 | } | 1375 | } |
1351 | 1376 | ||
1377 | static int smu_default_set_performance_level(struct smu_context *smu, enum amd_dpm_forced_level level) | ||
1378 | { | ||
1379 | int ret = 0; | ||
1380 | uint32_t sclk_mask, mclk_mask, soc_mask; | ||
1381 | |||
1382 | switch (level) { | ||
1383 | case AMD_DPM_FORCED_LEVEL_HIGH: | ||
1384 | ret = smu_force_dpm_limit_value(smu, true); | ||
1385 | break; | ||
1386 | case AMD_DPM_FORCED_LEVEL_LOW: | ||
1387 | ret = smu_force_dpm_limit_value(smu, false); | ||
1388 | break; | ||
1389 | case AMD_DPM_FORCED_LEVEL_AUTO: | ||
1390 | case AMD_DPM_FORCED_LEVEL_PROFILE_STANDARD: | ||
1391 | ret = smu_unforce_dpm_levels(smu); | ||
1392 | break; | ||
1393 | case AMD_DPM_FORCED_LEVEL_PROFILE_MIN_SCLK: | ||
1394 | case AMD_DPM_FORCED_LEVEL_PROFILE_MIN_MCLK: | ||
1395 | case AMD_DPM_FORCED_LEVEL_PROFILE_PEAK: | ||
1396 | ret = smu_get_profiling_clk_mask(smu, level, | ||
1397 | &sclk_mask, | ||
1398 | &mclk_mask, | ||
1399 | &soc_mask); | ||
1400 | if (ret) | ||
1401 | return ret; | ||
1402 | smu_force_clk_levels(smu, SMU_SCLK, 1 << sclk_mask); | ||
1403 | smu_force_clk_levels(smu, SMU_MCLK, 1 << mclk_mask); | ||
1404 | smu_force_clk_levels(smu, SMU_SOCCLK, 1 << soc_mask); | ||
1405 | break; | ||
1406 | case AMD_DPM_FORCED_LEVEL_MANUAL: | ||
1407 | case AMD_DPM_FORCED_LEVEL_PROFILE_EXIT: | ||
1408 | default: | ||
1409 | break; | ||
1410 | } | ||
1411 | return ret; | ||
1412 | } | ||
1413 | |||
1352 | int smu_adjust_power_state_dynamic(struct smu_context *smu, | 1414 | int smu_adjust_power_state_dynamic(struct smu_context *smu, |
1353 | enum amd_dpm_forced_level level, | 1415 | enum amd_dpm_forced_level level, |
1354 | bool skip_display_settings) | 1416 | bool skip_display_settings) |
1355 | { | 1417 | { |
1356 | int ret = 0; | 1418 | int ret = 0; |
1357 | int index = 0; | 1419 | int index = 0; |
1358 | uint32_t sclk_mask, mclk_mask, soc_mask; | ||
1359 | long workload; | 1420 | long workload; |
1360 | struct smu_dpm_context *smu_dpm_ctx = &(smu->smu_dpm); | 1421 | struct smu_dpm_context *smu_dpm_ctx = &(smu->smu_dpm); |
1361 | 1422 | ||
@@ -1386,39 +1447,10 @@ int smu_adjust_power_state_dynamic(struct smu_context *smu, | |||
1386 | } | 1447 | } |
1387 | 1448 | ||
1388 | if (smu_dpm_ctx->dpm_level != level) { | 1449 | if (smu_dpm_ctx->dpm_level != level) { |
1389 | switch (level) { | 1450 | ret = smu_asic_set_performance_level(smu, level); |
1390 | case AMD_DPM_FORCED_LEVEL_HIGH: | 1451 | if (ret) { |
1391 | ret = smu_force_dpm_limit_value(smu, true); | 1452 | ret = smu_default_set_performance_level(smu, level); |
1392 | break; | ||
1393 | case AMD_DPM_FORCED_LEVEL_LOW: | ||
1394 | ret = smu_force_dpm_limit_value(smu, false); | ||
1395 | break; | ||
1396 | |||
1397 | case AMD_DPM_FORCED_LEVEL_AUTO: | ||
1398 | case AMD_DPM_FORCED_LEVEL_PROFILE_STANDARD: | ||
1399 | ret = smu_unforce_dpm_levels(smu); | ||
1400 | break; | ||
1401 | |||
1402 | case AMD_DPM_FORCED_LEVEL_PROFILE_MIN_SCLK: | ||
1403 | case AMD_DPM_FORCED_LEVEL_PROFILE_MIN_MCLK: | ||
1404 | case AMD_DPM_FORCED_LEVEL_PROFILE_PEAK: | ||
1405 | ret = smu_get_profiling_clk_mask(smu, level, | ||
1406 | &sclk_mask, | ||
1407 | &mclk_mask, | ||
1408 | &soc_mask); | ||
1409 | if (ret) | ||
1410 | return ret; | ||
1411 | smu_force_clk_levels(smu, SMU_SCLK, 1 << sclk_mask); | ||
1412 | smu_force_clk_levels(smu, SMU_MCLK, 1 << mclk_mask); | ||
1413 | smu_force_clk_levels(smu, SMU_SOCCLK, 1 << soc_mask); | ||
1414 | break; | ||
1415 | |||
1416 | case AMD_DPM_FORCED_LEVEL_MANUAL: | ||
1417 | case AMD_DPM_FORCED_LEVEL_PROFILE_EXIT: | ||
1418 | default: | ||
1419 | break; | ||
1420 | } | 1453 | } |
1421 | |||
1422 | if (!ret) | 1454 | if (!ret) |
1423 | smu_dpm_ctx->dpm_level = level; | 1455 | smu_dpm_ctx->dpm_level = level; |
1424 | } | 1456 | } |
diff --git a/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h b/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h index 1af992fb0bde..22e46a289a16 100644 --- a/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h +++ b/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h | |||
@@ -613,6 +613,7 @@ struct pptable_funcs { | |||
613 | int (*tables_init)(struct smu_context *smu, struct smu_table *tables); | 613 | int (*tables_init)(struct smu_context *smu, struct smu_table *tables); |
614 | int (*set_thermal_fan_table)(struct smu_context *smu); | 614 | int (*set_thermal_fan_table)(struct smu_context *smu); |
615 | int (*get_fan_speed_percent)(struct smu_context *smu, uint32_t *speed); | 615 | int (*get_fan_speed_percent)(struct smu_context *smu, uint32_t *speed); |
616 | int (*get_fan_speed_rpm)(struct smu_context *smu, uint32_t *speed); | ||
616 | int (*set_watermarks_table)(struct smu_context *smu, void *watermarks, | 617 | int (*set_watermarks_table)(struct smu_context *smu, void *watermarks, |
617 | struct dm_pp_wm_sets_with_clock_ranges_soc15 *clock_ranges); | 618 | struct dm_pp_wm_sets_with_clock_ranges_soc15 *clock_ranges); |
618 | int (*get_current_clk_freq_by_table)(struct smu_context *smu, | 619 | int (*get_current_clk_freq_by_table)(struct smu_context *smu, |
@@ -621,6 +622,7 @@ struct pptable_funcs { | |||
621 | int (*get_thermal_temperature_range)(struct smu_context *smu, struct smu_temperature_range *range); | 622 | int (*get_thermal_temperature_range)(struct smu_context *smu, struct smu_temperature_range *range); |
622 | int (*get_uclk_dpm_states)(struct smu_context *smu, uint32_t *clocks_in_khz, uint32_t *num_states); | 623 | int (*get_uclk_dpm_states)(struct smu_context *smu, uint32_t *clocks_in_khz, uint32_t *num_states); |
623 | int (*set_default_od_settings)(struct smu_context *smu, bool initialize); | 624 | int (*set_default_od_settings)(struct smu_context *smu, bool initialize); |
625 | int (*set_performance_level)(struct smu_context *smu, enum amd_dpm_forced_level level); | ||
624 | }; | 626 | }; |
625 | 627 | ||
626 | struct smu_funcs | 628 | struct smu_funcs |
@@ -685,7 +687,6 @@ struct smu_funcs | |||
685 | int (*set_watermarks_for_clock_ranges)(struct smu_context *smu, | 687 | int (*set_watermarks_for_clock_ranges)(struct smu_context *smu, |
686 | struct dm_pp_wm_sets_with_clock_ranges_soc15 *clock_ranges); | 688 | struct dm_pp_wm_sets_with_clock_ranges_soc15 *clock_ranges); |
687 | int (*conv_power_profile_to_pplib_workload)(int power_profile); | 689 | int (*conv_power_profile_to_pplib_workload)(int power_profile); |
688 | int (*get_current_rpm)(struct smu_context *smu, uint32_t *speed); | ||
689 | uint32_t (*get_fan_control_mode)(struct smu_context *smu); | 690 | uint32_t (*get_fan_control_mode)(struct smu_context *smu); |
690 | int (*set_fan_control_mode)(struct smu_context *smu, uint32_t mode); | 691 | int (*set_fan_control_mode)(struct smu_context *smu, uint32_t mode); |
691 | int (*set_fan_speed_percent)(struct smu_context *smu, uint32_t speed); | 692 | int (*set_fan_speed_percent)(struct smu_context *smu, uint32_t speed); |
@@ -751,8 +752,6 @@ struct smu_funcs | |||
751 | ((smu)->funcs->init_max_sustainable_clocks ? (smu)->funcs->init_max_sustainable_clocks((smu)) : 0) | 752 | ((smu)->funcs->init_max_sustainable_clocks ? (smu)->funcs->init_max_sustainable_clocks((smu)) : 0) |
752 | #define smu_set_default_od_settings(smu, initialize) \ | 753 | #define smu_set_default_od_settings(smu, initialize) \ |
753 | ((smu)->ppt_funcs->set_default_od_settings ? (smu)->ppt_funcs->set_default_od_settings((smu), (initialize)) : 0) | 754 | ((smu)->ppt_funcs->set_default_od_settings ? (smu)->ppt_funcs->set_default_od_settings((smu), (initialize)) : 0) |
754 | #define smu_get_current_rpm(smu, speed) \ | ||
755 | ((smu)->funcs->get_current_rpm ? (smu)->funcs->get_current_rpm((smu), (speed)) : 0) | ||
756 | #define smu_set_fan_speed_rpm(smu, speed) \ | 755 | #define smu_set_fan_speed_rpm(smu, speed) \ |
757 | ((smu)->funcs->set_fan_speed_rpm ? (smu)->funcs->set_fan_speed_rpm((smu), (speed)) : 0) | 756 | ((smu)->funcs->set_fan_speed_rpm ? (smu)->funcs->set_fan_speed_rpm((smu), (speed)) : 0) |
758 | #define smu_send_smc_msg(smu, msg) \ | 757 | #define smu_send_smc_msg(smu, msg) \ |
@@ -841,6 +840,8 @@ struct smu_funcs | |||
841 | ((smu)->ppt_funcs->get_fan_speed_percent ? (smu)->ppt_funcs->get_fan_speed_percent((smu), (speed)) : 0) | 840 | ((smu)->ppt_funcs->get_fan_speed_percent ? (smu)->ppt_funcs->get_fan_speed_percent((smu), (speed)) : 0) |
842 | #define smu_set_fan_speed_percent(smu, speed) \ | 841 | #define smu_set_fan_speed_percent(smu, speed) \ |
843 | ((smu)->funcs->set_fan_speed_percent ? (smu)->funcs->set_fan_speed_percent((smu), (speed)) : 0) | 842 | ((smu)->funcs->set_fan_speed_percent ? (smu)->funcs->set_fan_speed_percent((smu), (speed)) : 0) |
843 | #define smu_get_fan_speed_rpm(smu, speed) \ | ||
844 | ((smu)->ppt_funcs->get_fan_speed_rpm ? (smu)->ppt_funcs->get_fan_speed_rpm((smu), (speed)) : 0) | ||
844 | 845 | ||
845 | #define smu_msg_get_index(smu, msg) \ | 846 | #define smu_msg_get_index(smu, msg) \ |
846 | ((smu)->ppt_funcs? ((smu)->ppt_funcs->get_smu_msg_index? (smu)->ppt_funcs->get_smu_msg_index((smu), (msg)) : -EINVAL) : -EINVAL) | 847 | ((smu)->ppt_funcs? ((smu)->ppt_funcs->get_smu_msg_index? (smu)->ppt_funcs->get_smu_msg_index((smu), (msg)) : -EINVAL) : -EINVAL) |
@@ -918,6 +919,9 @@ struct smu_funcs | |||
918 | ((smu)->funcs->baco_get_state? (smu)->funcs->baco_get_state((smu), (state)) : 0) | 919 | ((smu)->funcs->baco_get_state? (smu)->funcs->baco_get_state((smu), (state)) : 0) |
919 | #define smu_baco_reset(smu) \ | 920 | #define smu_baco_reset(smu) \ |
920 | ((smu)->funcs->baco_reset? (smu)->funcs->baco_reset((smu)) : 0) | 921 | ((smu)->funcs->baco_reset? (smu)->funcs->baco_reset((smu)) : 0) |
922 | #define smu_asic_set_performance_level(smu, level) \ | ||
923 | ((smu)->ppt_funcs->set_performance_level? (smu)->ppt_funcs->set_performance_level((smu), (level)) : -EINVAL); | ||
924 | |||
921 | 925 | ||
922 | extern int smu_get_atom_data_table(struct smu_context *smu, uint32_t table, | 926 | extern int smu_get_atom_data_table(struct smu_context *smu, uint32_t table, |
923 | uint16_t *size, uint8_t *frev, uint8_t *crev, | 927 | uint16_t *size, uint8_t *frev, uint8_t *crev, |
diff --git a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c index 2dae0ae0829e..4aaad255a288 100644 --- a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c +++ b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c | |||
@@ -626,11 +626,26 @@ static int navi10_get_current_clk_freq_by_table(struct smu_context *smu, | |||
626 | return ret; | 626 | return ret; |
627 | } | 627 | } |
628 | 628 | ||
629 | static bool navi10_is_support_fine_grained_dpm(struct smu_context *smu, enum smu_clk_type clk_type) | ||
630 | { | ||
631 | PPTable_t *pptable = smu->smu_table.driver_pptable; | ||
632 | DpmDescriptor_t *dpm_desc = NULL; | ||
633 | uint32_t clk_index = 0; | ||
634 | |||
635 | clk_index = smu_clk_get_index(smu, clk_type); | ||
636 | dpm_desc = &pptable->DpmDescriptor[clk_index]; | ||
637 | |||
638 | /* 0 - Fine grained DPM, 1 - Discrete DPM */ | ||
639 | return dpm_desc->SnapToDiscrete == 0 ? true : false; | ||
640 | } | ||
641 | |||
629 | static int navi10_print_clk_levels(struct smu_context *smu, | 642 | static int navi10_print_clk_levels(struct smu_context *smu, |
630 | enum smu_clk_type clk_type, char *buf) | 643 | enum smu_clk_type clk_type, char *buf) |
631 | { | 644 | { |
632 | int i, size = 0, ret = 0; | 645 | int i, size = 0, ret = 0; |
633 | uint32_t cur_value = 0, value = 0, count = 0; | 646 | uint32_t cur_value = 0, value = 0, count = 0; |
647 | uint32_t freq_values[3] = {0}; | ||
648 | uint32_t mark_index = 0; | ||
634 | 649 | ||
635 | switch (clk_type) { | 650 | switch (clk_type) { |
636 | case SMU_GFXCLK: | 651 | case SMU_GFXCLK: |
@@ -643,22 +658,42 @@ static int navi10_print_clk_levels(struct smu_context *smu, | |||
643 | ret = smu_get_current_clk_freq(smu, clk_type, &cur_value); | 658 | ret = smu_get_current_clk_freq(smu, clk_type, &cur_value); |
644 | if (ret) | 659 | if (ret) |
645 | return size; | 660 | return size; |
661 | |||
646 | /* 10KHz -> MHz */ | 662 | /* 10KHz -> MHz */ |
647 | cur_value = cur_value / 100; | 663 | cur_value = cur_value / 100; |
648 | 664 | ||
649 | size += sprintf(buf, "current clk: %uMhz\n", cur_value); | ||
650 | |||
651 | ret = smu_get_dpm_level_count(smu, clk_type, &count); | 665 | ret = smu_get_dpm_level_count(smu, clk_type, &count); |
652 | if (ret) | 666 | if (ret) |
653 | return size; | 667 | return size; |
654 | 668 | ||
655 | for (i = 0; i < count; i++) { | 669 | if (!navi10_is_support_fine_grained_dpm(smu, clk_type)) { |
656 | ret = smu_get_dpm_freq_by_index(smu, clk_type, i, &value); | 670 | for (i = 0; i < count; i++) { |
671 | ret = smu_get_dpm_freq_by_index(smu, clk_type, i, &value); | ||
672 | if (ret) | ||
673 | return size; | ||
674 | |||
675 | size += sprintf(buf + size, "%d: %uMhz %s\n", i, value, | ||
676 | cur_value == value ? "*" : ""); | ||
677 | } | ||
678 | } else { | ||
679 | ret = smu_get_dpm_freq_by_index(smu, clk_type, 0, &freq_values[0]); | ||
680 | if (ret) | ||
681 | return size; | ||
682 | ret = smu_get_dpm_freq_by_index(smu, clk_type, count - 1, &freq_values[2]); | ||
657 | if (ret) | 683 | if (ret) |
658 | return size; | 684 | return size; |
659 | 685 | ||
660 | size += sprintf(buf + size, "%d: %uMhz %s\n", i, value, | 686 | freq_values[1] = cur_value; |
661 | cur_value == value ? "*" : ""); | 687 | mark_index = cur_value == freq_values[0] ? 0 : |
688 | cur_value == freq_values[2] ? 2 : 1; | ||
689 | if (mark_index != 1) | ||
690 | freq_values[1] = (freq_values[0] + freq_values[2]) / 2; | ||
691 | |||
692 | for (i = 0; i < 3; i++) { | ||
693 | size += sprintf(buf + size, "%d: %uMhz %s\n", i, freq_values[i], | ||
694 | i == mark_index ? "*" : ""); | ||
695 | } | ||
696 | |||
662 | } | 697 | } |
663 | break; | 698 | break; |
664 | default: | 699 | default: |
@@ -919,12 +954,13 @@ static bool navi10_is_dpm_running(struct smu_context *smu) | |||
919 | return !!(feature_enabled & SMC_DPM_FEATURE); | 954 | return !!(feature_enabled & SMC_DPM_FEATURE); |
920 | } | 955 | } |
921 | 956 | ||
922 | static int navi10_get_fan_speed(struct smu_context *smu, uint16_t *value) | 957 | static int navi10_get_fan_speed_rpm(struct smu_context *smu, |
958 | uint32_t *speed) | ||
923 | { | 959 | { |
924 | SmuMetrics_t metrics; | 960 | SmuMetrics_t metrics; |
925 | int ret = 0; | 961 | int ret = 0; |
926 | 962 | ||
927 | if (!value) | 963 | if (!speed) |
928 | return -EINVAL; | 964 | return -EINVAL; |
929 | 965 | ||
930 | memset(&metrics, 0, sizeof(metrics)); | 966 | memset(&metrics, 0, sizeof(metrics)); |
@@ -934,7 +970,7 @@ static int navi10_get_fan_speed(struct smu_context *smu, uint16_t *value) | |||
934 | if (ret) | 970 | if (ret) |
935 | return ret; | 971 | return ret; |
936 | 972 | ||
937 | *value = metrics.CurrFanSpeed; | 973 | *speed = metrics.CurrFanSpeed; |
938 | 974 | ||
939 | return ret; | 975 | return ret; |
940 | } | 976 | } |
@@ -944,10 +980,10 @@ static int navi10_get_fan_speed_percent(struct smu_context *smu, | |||
944 | { | 980 | { |
945 | int ret = 0; | 981 | int ret = 0; |
946 | uint32_t percent = 0; | 982 | uint32_t percent = 0; |
947 | uint16_t current_rpm; | 983 | uint32_t current_rpm; |
948 | PPTable_t *pptable = smu->smu_table.driver_pptable; | 984 | PPTable_t *pptable = smu->smu_table.driver_pptable; |
949 | 985 | ||
950 | ret = navi10_get_fan_speed(smu, ¤t_rpm); | 986 | ret = navi10_get_fan_speed_rpm(smu, ¤t_rpm); |
951 | if (ret) | 987 | if (ret) |
952 | return ret; | 988 | return ret; |
953 | 989 | ||
@@ -1530,6 +1566,60 @@ static int navi10_set_ppfeature_status(struct smu_context *smu, | |||
1530 | return 0; | 1566 | return 0; |
1531 | } | 1567 | } |
1532 | 1568 | ||
1569 | static int navi10_set_peak_clock_by_device(struct smu_context *smu) | ||
1570 | { | ||
1571 | struct amdgpu_device *adev = smu->adev; | ||
1572 | int ret = 0; | ||
1573 | uint32_t sclk_freq = 0, uclk_freq = 0; | ||
1574 | uint32_t uclk_level = 0; | ||
1575 | |||
1576 | switch (adev->rev_id) { | ||
1577 | case 0xf0: /* XTX */ | ||
1578 | case 0xc0: | ||
1579 | sclk_freq = NAVI10_PEAK_SCLK_XTX; | ||
1580 | break; | ||
1581 | case 0xf1: /* XT */ | ||
1582 | case 0xc1: | ||
1583 | sclk_freq = NAVI10_PEAK_SCLK_XT; | ||
1584 | break; | ||
1585 | default: /* XL */ | ||
1586 | sclk_freq = NAVI10_PEAK_SCLK_XL; | ||
1587 | break; | ||
1588 | } | ||
1589 | |||
1590 | ret = smu_get_dpm_level_count(smu, SMU_UCLK, &uclk_level); | ||
1591 | if (ret) | ||
1592 | return ret; | ||
1593 | ret = smu_get_dpm_freq_by_index(smu, SMU_UCLK, uclk_level - 1, &uclk_freq); | ||
1594 | if (ret) | ||
1595 | return ret; | ||
1596 | |||
1597 | ret = smu_set_soft_freq_range(smu, SMU_SCLK, sclk_freq, sclk_freq); | ||
1598 | if (ret) | ||
1599 | return ret; | ||
1600 | ret = smu_set_soft_freq_range(smu, SMU_UCLK, uclk_freq, uclk_freq); | ||
1601 | if (ret) | ||
1602 | return ret; | ||
1603 | |||
1604 | return ret; | ||
1605 | } | ||
1606 | |||
1607 | static int navi10_set_performance_level(struct smu_context *smu, enum amd_dpm_forced_level level) | ||
1608 | { | ||
1609 | int ret = 0; | ||
1610 | |||
1611 | switch (level) { | ||
1612 | case AMD_DPM_FORCED_LEVEL_PROFILE_PEAK: | ||
1613 | ret = navi10_set_peak_clock_by_device(smu); | ||
1614 | break; | ||
1615 | default: | ||
1616 | ret = -EINVAL; | ||
1617 | break; | ||
1618 | } | ||
1619 | |||
1620 | return ret; | ||
1621 | } | ||
1622 | |||
1533 | static const struct pptable_funcs navi10_ppt_funcs = { | 1623 | static const struct pptable_funcs navi10_ppt_funcs = { |
1534 | .tables_init = navi10_tables_init, | 1624 | .tables_init = navi10_tables_init, |
1535 | .alloc_dpm_context = navi10_allocate_dpm_context, | 1625 | .alloc_dpm_context = navi10_allocate_dpm_context, |
@@ -1557,6 +1647,7 @@ static const struct pptable_funcs navi10_ppt_funcs = { | |||
1557 | .unforce_dpm_levels = navi10_unforce_dpm_levels, | 1647 | .unforce_dpm_levels = navi10_unforce_dpm_levels, |
1558 | .is_dpm_running = navi10_is_dpm_running, | 1648 | .is_dpm_running = navi10_is_dpm_running, |
1559 | .get_fan_speed_percent = navi10_get_fan_speed_percent, | 1649 | .get_fan_speed_percent = navi10_get_fan_speed_percent, |
1650 | .get_fan_speed_rpm = navi10_get_fan_speed_rpm, | ||
1560 | .get_power_profile_mode = navi10_get_power_profile_mode, | 1651 | .get_power_profile_mode = navi10_get_power_profile_mode, |
1561 | .set_power_profile_mode = navi10_set_power_profile_mode, | 1652 | .set_power_profile_mode = navi10_set_power_profile_mode, |
1562 | .get_profiling_clk_mask = navi10_get_profiling_clk_mask, | 1653 | .get_profiling_clk_mask = navi10_get_profiling_clk_mask, |
@@ -1565,6 +1656,7 @@ static const struct pptable_funcs navi10_ppt_funcs = { | |||
1565 | .get_uclk_dpm_states = navi10_get_uclk_dpm_states, | 1656 | .get_uclk_dpm_states = navi10_get_uclk_dpm_states, |
1566 | .get_ppfeature_status = navi10_get_ppfeature_status, | 1657 | .get_ppfeature_status = navi10_get_ppfeature_status, |
1567 | .set_ppfeature_status = navi10_set_ppfeature_status, | 1658 | .set_ppfeature_status = navi10_set_ppfeature_status, |
1659 | .set_performance_level = navi10_set_performance_level, | ||
1568 | }; | 1660 | }; |
1569 | 1661 | ||
1570 | void navi10_set_ppt_funcs(struct smu_context *smu) | 1662 | void navi10_set_ppt_funcs(struct smu_context *smu) |
diff --git a/drivers/gpu/drm/amd/powerplay/navi10_ppt.h b/drivers/gpu/drm/amd/powerplay/navi10_ppt.h index 957288e22f47..620ff17c2fef 100644 --- a/drivers/gpu/drm/amd/powerplay/navi10_ppt.h +++ b/drivers/gpu/drm/amd/powerplay/navi10_ppt.h | |||
@@ -23,6 +23,10 @@ | |||
23 | #ifndef __NAVI10_PPT_H__ | 23 | #ifndef __NAVI10_PPT_H__ |
24 | #define __NAVI10_PPT_H__ | 24 | #define __NAVI10_PPT_H__ |
25 | 25 | ||
26 | #define NAVI10_PEAK_SCLK_XTX (1830) | ||
27 | #define NAVI10_PEAK_SCLK_XT (1755) | ||
28 | #define NAVI10_PEAK_SCLK_XL (1625) | ||
29 | |||
26 | extern void navi10_set_ppt_funcs(struct smu_context *smu); | 30 | extern void navi10_set_ppt_funcs(struct smu_context *smu); |
27 | 31 | ||
28 | #endif | 32 | #endif |
diff --git a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c index 95c7c4dae523..caca9091bfcc 100644 --- a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c +++ b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c | |||
@@ -1371,23 +1371,6 @@ static int smu_v11_0_gfx_off_control(struct smu_context *smu, bool enable) | |||
1371 | return ret; | 1371 | return ret; |
1372 | } | 1372 | } |
1373 | 1373 | ||
1374 | static int smu_v11_0_get_current_rpm(struct smu_context *smu, | ||
1375 | uint32_t *current_rpm) | ||
1376 | { | ||
1377 | int ret; | ||
1378 | |||
1379 | ret = smu_send_smc_msg(smu, SMU_MSG_GetCurrentRpm); | ||
1380 | |||
1381 | if (ret) { | ||
1382 | pr_err("Attempt to get current RPM from SMC Failed!\n"); | ||
1383 | return ret; | ||
1384 | } | ||
1385 | |||
1386 | smu_read_smc_arg(smu, current_rpm); | ||
1387 | |||
1388 | return 0; | ||
1389 | } | ||
1390 | |||
1391 | static uint32_t | 1374 | static uint32_t |
1392 | smu_v11_0_get_fan_control_mode(struct smu_context *smu) | 1375 | smu_v11_0_get_fan_control_mode(struct smu_context *smu) |
1393 | { | 1376 | { |
@@ -1773,7 +1756,6 @@ static const struct smu_funcs smu_v11_0_funcs = { | |||
1773 | .set_deep_sleep_dcefclk = smu_v11_0_set_deep_sleep_dcefclk, | 1756 | .set_deep_sleep_dcefclk = smu_v11_0_set_deep_sleep_dcefclk, |
1774 | .display_clock_voltage_request = smu_v11_0_display_clock_voltage_request, | 1757 | .display_clock_voltage_request = smu_v11_0_display_clock_voltage_request, |
1775 | .set_watermarks_for_clock_ranges = smu_v11_0_set_watermarks_for_clock_ranges, | 1758 | .set_watermarks_for_clock_ranges = smu_v11_0_set_watermarks_for_clock_ranges, |
1776 | .get_current_rpm = smu_v11_0_get_current_rpm, | ||
1777 | .get_fan_control_mode = smu_v11_0_get_fan_control_mode, | 1759 | .get_fan_control_mode = smu_v11_0_get_fan_control_mode, |
1778 | .set_fan_control_mode = smu_v11_0_set_fan_control_mode, | 1760 | .set_fan_control_mode = smu_v11_0_set_fan_control_mode, |
1779 | .set_fan_speed_percent = smu_v11_0_set_fan_speed_percent, | 1761 | .set_fan_speed_percent = smu_v11_0_set_fan_speed_percent, |
diff --git a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c index bb9bb09cfc7a..dc139a6feeb1 100644 --- a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c +++ b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c | |||
@@ -3015,6 +3015,23 @@ static int vega20_set_thermal_fan_table(struct smu_context *smu) | |||
3015 | return ret; | 3015 | return ret; |
3016 | } | 3016 | } |
3017 | 3017 | ||
3018 | static int vega20_get_fan_speed_rpm(struct smu_context *smu, | ||
3019 | uint32_t *speed) | ||
3020 | { | ||
3021 | int ret; | ||
3022 | |||
3023 | ret = smu_send_smc_msg(smu, SMU_MSG_GetCurrentRpm); | ||
3024 | |||
3025 | if (ret) { | ||
3026 | pr_err("Attempt to get current RPM from SMC Failed!\n"); | ||
3027 | return ret; | ||
3028 | } | ||
3029 | |||
3030 | smu_read_smc_arg(smu, speed); | ||
3031 | |||
3032 | return 0; | ||
3033 | } | ||
3034 | |||
3018 | static int vega20_get_fan_speed_percent(struct smu_context *smu, | 3035 | static int vega20_get_fan_speed_percent(struct smu_context *smu, |
3019 | uint32_t *speed) | 3036 | uint32_t *speed) |
3020 | { | 3037 | { |
@@ -3022,7 +3039,7 @@ static int vega20_get_fan_speed_percent(struct smu_context *smu, | |||
3022 | uint32_t current_rpm = 0, percent = 0; | 3039 | uint32_t current_rpm = 0, percent = 0; |
3023 | PPTable_t *pptable = smu->smu_table.driver_pptable; | 3040 | PPTable_t *pptable = smu->smu_table.driver_pptable; |
3024 | 3041 | ||
3025 | ret = smu_get_current_rpm(smu, ¤t_rpm); | 3042 | ret = vega20_get_fan_speed_rpm(smu, ¤t_rpm); |
3026 | if (ret) | 3043 | if (ret) |
3027 | return ret; | 3044 | return ret; |
3028 | 3045 | ||
@@ -3293,6 +3310,7 @@ static const struct pptable_funcs vega20_ppt_funcs = { | |||
3293 | .is_dpm_running = vega20_is_dpm_running, | 3310 | .is_dpm_running = vega20_is_dpm_running, |
3294 | .set_thermal_fan_table = vega20_set_thermal_fan_table, | 3311 | .set_thermal_fan_table = vega20_set_thermal_fan_table, |
3295 | .get_fan_speed_percent = vega20_get_fan_speed_percent, | 3312 | .get_fan_speed_percent = vega20_get_fan_speed_percent, |
3313 | .get_fan_speed_rpm = vega20_get_fan_speed_rpm, | ||
3296 | .set_watermarks_table = vega20_set_watermarks_table, | 3314 | .set_watermarks_table = vega20_set_watermarks_table, |
3297 | .get_thermal_temperature_range = vega20_get_thermal_temperature_range | 3315 | .get_thermal_temperature_range = vega20_get_thermal_temperature_range |
3298 | }; | 3316 | }; |
diff --git a/drivers/gpu/drm/drm_client_modeset.c b/drivers/gpu/drm/drm_client_modeset.c index 56d36779d213..c8922b7cac09 100644 --- a/drivers/gpu/drm/drm_client_modeset.c +++ b/drivers/gpu/drm/drm_client_modeset.c | |||
@@ -859,7 +859,7 @@ bool drm_client_rotation(struct drm_mode_set *modeset, unsigned int *rotation) | |||
859 | * simple XOR between the two handle the addition nicely. | 859 | * simple XOR between the two handle the addition nicely. |
860 | */ | 860 | */ |
861 | cmdline = &connector->cmdline_mode; | 861 | cmdline = &connector->cmdline_mode; |
862 | if (cmdline->specified) { | 862 | if (cmdline->specified && cmdline->rotation_reflection) { |
863 | unsigned int cmdline_rest, panel_rest; | 863 | unsigned int cmdline_rest, panel_rest; |
864 | unsigned int cmdline_rot, panel_rot; | 864 | unsigned int cmdline_rot, panel_rot; |
865 | unsigned int sum_rot, sum_rest; | 865 | unsigned int sum_rot, sum_rest; |
diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c index 0b72468e8131..57564318ceea 100644 --- a/drivers/gpu/drm/drm_framebuffer.c +++ b/drivers/gpu/drm/drm_framebuffer.c | |||
@@ -835,7 +835,7 @@ static int atomic_remove_fb(struct drm_framebuffer *fb) | |||
835 | struct drm_device *dev = fb->dev; | 835 | struct drm_device *dev = fb->dev; |
836 | struct drm_atomic_state *state; | 836 | struct drm_atomic_state *state; |
837 | struct drm_plane *plane; | 837 | struct drm_plane *plane; |
838 | struct drm_connector *conn; | 838 | struct drm_connector *conn __maybe_unused; |
839 | struct drm_connector_state *conn_state; | 839 | struct drm_connector_state *conn_state; |
840 | int i, ret; | 840 | int i, ret; |
841 | unsigned plane_mask; | 841 | unsigned plane_mask; |
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index 74a5739df506..80fcd5dc1558 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c | |||
@@ -1686,7 +1686,7 @@ static int drm_mode_parse_cmdline_options(char *str, size_t len, | |||
1686 | * | 1686 | * |
1687 | * Additionals options can be provided following the mode, using a comma to | 1687 | * Additionals options can be provided following the mode, using a comma to |
1688 | * separate each option. Valid options can be found in | 1688 | * separate each option. Valid options can be found in |
1689 | * Documentation/fb/modedb.txt. | 1689 | * Documentation/fb/modedb.rst. |
1690 | * | 1690 | * |
1691 | * The intermediate drm_cmdline_mode structure is required to store additional | 1691 | * The intermediate drm_cmdline_mode structure is required to store additional |
1692 | * options from the command line modline like the force-enable/disable flag. | 1692 | * options from the command line modline like the force-enable/disable flag. |
diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile index 91355c2ea8a5..8cace65f50ce 100644 --- a/drivers/gpu/drm/i915/Makefile +++ b/drivers/gpu/drm/i915/Makefile | |||
@@ -16,7 +16,6 @@ subdir-ccflags-y := -Wall -Wextra | |||
16 | subdir-ccflags-y += $(call cc-disable-warning, unused-parameter) | 16 | subdir-ccflags-y += $(call cc-disable-warning, unused-parameter) |
17 | subdir-ccflags-y += $(call cc-disable-warning, type-limits) | 17 | subdir-ccflags-y += $(call cc-disable-warning, type-limits) |
18 | subdir-ccflags-y += $(call cc-disable-warning, missing-field-initializers) | 18 | subdir-ccflags-y += $(call cc-disable-warning, missing-field-initializers) |
19 | subdir-ccflags-y += $(call cc-disable-warning, implicit-fallthrough) | ||
20 | subdir-ccflags-y += $(call cc-disable-warning, unused-but-set-variable) | 19 | subdir-ccflags-y += $(call cc-disable-warning, unused-but-set-variable) |
21 | # clang warnings | 20 | # clang warnings |
22 | subdir-ccflags-y += $(call cc-disable-warning, sign-compare) | 21 | subdir-ccflags-y += $(call cc-disable-warning, sign-compare) |
diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 8592a7d422de..30b97ded6fdd 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c | |||
@@ -12042,7 +12042,7 @@ static bool check_digital_port_conflicts(struct intel_atomic_state *state) | |||
12042 | case INTEL_OUTPUT_DDI: | 12042 | case INTEL_OUTPUT_DDI: |
12043 | if (WARN_ON(!HAS_DDI(to_i915(dev)))) | 12043 | if (WARN_ON(!HAS_DDI(to_i915(dev)))) |
12044 | break; | 12044 | break; |
12045 | /* else: fall through */ | 12045 | /* else, fall through */ |
12046 | case INTEL_OUTPUT_DP: | 12046 | case INTEL_OUTPUT_DP: |
12047 | case INTEL_OUTPUT_HDMI: | 12047 | case INTEL_OUTPUT_HDMI: |
12048 | case INTEL_OUTPUT_EDP: | 12048 | case INTEL_OUTPUT_EDP: |
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index 4336df46fe78..d0fc34826771 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c | |||
@@ -231,6 +231,7 @@ static int intel_dp_get_fia_supported_lane_count(struct intel_dp *intel_dp) | |||
231 | switch (lane_info) { | 231 | switch (lane_info) { |
232 | default: | 232 | default: |
233 | MISSING_CASE(lane_info); | 233 | MISSING_CASE(lane_info); |
234 | /* fall through */ | ||
234 | case 1: | 235 | case 1: |
235 | case 2: | 236 | case 2: |
236 | case 4: | 237 | case 4: |
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c index 391621ee3cbb..39a661927d8e 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c | |||
@@ -341,7 +341,7 @@ err: | |||
341 | */ | 341 | */ |
342 | if (!i915_terminally_wedged(i915)) | 342 | if (!i915_terminally_wedged(i915)) |
343 | return VM_FAULT_SIGBUS; | 343 | return VM_FAULT_SIGBUS; |
344 | /* else: fall through */ | 344 | /* else, fall through */ |
345 | case -EAGAIN: | 345 | case -EAGAIN: |
346 | /* | 346 | /* |
347 | * EAGAIN means the gpu is hung and we'll wait for the error | 347 | * EAGAIN means the gpu is hung and we'll wait for the error |
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_pages.c b/drivers/gpu/drm/i915/gem/i915_gem_pages.c index b36ad269f4ea..65eb430cedba 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_pages.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_pages.c | |||
@@ -268,7 +268,7 @@ static void *i915_gem_object_map(const struct drm_i915_gem_object *obj, | |||
268 | switch (type) { | 268 | switch (type) { |
269 | default: | 269 | default: |
270 | MISSING_CASE(type); | 270 | MISSING_CASE(type); |
271 | /* fallthrough to use PAGE_KERNEL anyway */ | 271 | /* fallthrough - to use PAGE_KERNEL anyway */ |
272 | case I915_MAP_WB: | 272 | case I915_MAP_WB: |
273 | pgprot = PAGE_KERNEL; | 273 | pgprot = PAGE_KERNEL; |
274 | break; | 274 | break; |
diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c index b7e9fddef270..41a511d5267f 100644 --- a/drivers/gpu/drm/i915/i915_gpu_error.c +++ b/drivers/gpu/drm/i915/i915_gpu_error.c | |||
@@ -1194,6 +1194,7 @@ static void error_record_engine_registers(struct i915_gpu_state *error, | |||
1194 | switch (engine->id) { | 1194 | switch (engine->id) { |
1195 | default: | 1195 | default: |
1196 | MISSING_CASE(engine->id); | 1196 | MISSING_CASE(engine->id); |
1197 | /* fall through */ | ||
1197 | case RCS0: | 1198 | case RCS0: |
1198 | mmio = RENDER_HWS_PGA_GEN7; | 1199 | mmio = RENDER_HWS_PGA_GEN7; |
1199 | break; | 1200 | break; |
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c index 0e2f74163a16..0aa8a12c9952 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | |||
@@ -2221,8 +2221,6 @@ int dpu_encoder_setup(struct drm_device *dev, struct drm_encoder *enc, | |||
2221 | if (ret) | 2221 | if (ret) |
2222 | goto fail; | 2222 | goto fail; |
2223 | 2223 | ||
2224 | spin_lock_init(&dpu_enc->enc_spinlock); | ||
2225 | |||
2226 | atomic_set(&dpu_enc->frame_done_timeout_ms, 0); | 2224 | atomic_set(&dpu_enc->frame_done_timeout_ms, 0); |
2227 | timer_setup(&dpu_enc->frame_done_timer, | 2225 | timer_setup(&dpu_enc->frame_done_timer, |
2228 | dpu_encoder_frame_done_timeout, 0); | 2226 | dpu_encoder_frame_done_timeout, 0); |
@@ -2276,6 +2274,7 @@ struct drm_encoder *dpu_encoder_init(struct drm_device *dev, | |||
2276 | 2274 | ||
2277 | drm_encoder_helper_add(&dpu_enc->base, &dpu_encoder_helper_funcs); | 2275 | drm_encoder_helper_add(&dpu_enc->base, &dpu_encoder_helper_funcs); |
2278 | 2276 | ||
2277 | spin_lock_init(&dpu_enc->enc_spinlock); | ||
2279 | dpu_enc->enabled = false; | 2278 | dpu_enc->enabled = false; |
2280 | 2279 | ||
2281 | return &dpu_enc->base; | 2280 | return &dpu_enc->base; |
diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index ab64ab470de7..c226156f2dea 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c | |||
@@ -619,7 +619,7 @@ static int context_init(struct drm_device *dev, struct drm_file *file) | |||
619 | 619 | ||
620 | msm_submitqueue_init(dev, ctx); | 620 | msm_submitqueue_init(dev, ctx); |
621 | 621 | ||
622 | ctx->aspace = priv->gpu->aspace; | 622 | ctx->aspace = priv->gpu ? priv->gpu->aspace : NULL; |
623 | file->driver_priv = ctx; | 623 | file->driver_priv = ctx; |
624 | 624 | ||
625 | return 0; | 625 | return 0; |
diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c index 8b78554cfde3..c2114c748c2f 100644 --- a/drivers/gpu/drm/msm/msm_gem.c +++ b/drivers/gpu/drm/msm/msm_gem.c | |||
@@ -97,7 +97,7 @@ static struct page **get_pages(struct drm_gem_object *obj) | |||
97 | * because display controller, GPU, etc. are not coherent: | 97 | * because display controller, GPU, etc. are not coherent: |
98 | */ | 98 | */ |
99 | if (msm_obj->flags & (MSM_BO_WC|MSM_BO_UNCACHED)) | 99 | if (msm_obj->flags & (MSM_BO_WC|MSM_BO_UNCACHED)) |
100 | dma_map_sg(dev->dev, msm_obj->sgt->sgl, | 100 | dma_sync_sg_for_device(dev->dev, msm_obj->sgt->sgl, |
101 | msm_obj->sgt->nents, DMA_BIDIRECTIONAL); | 101 | msm_obj->sgt->nents, DMA_BIDIRECTIONAL); |
102 | } | 102 | } |
103 | 103 | ||
@@ -127,7 +127,7 @@ static void put_pages(struct drm_gem_object *obj) | |||
127 | * GPU, etc. are not coherent: | 127 | * GPU, etc. are not coherent: |
128 | */ | 128 | */ |
129 | if (msm_obj->flags & (MSM_BO_WC|MSM_BO_UNCACHED)) | 129 | if (msm_obj->flags & (MSM_BO_WC|MSM_BO_UNCACHED)) |
130 | dma_unmap_sg(obj->dev->dev, msm_obj->sgt->sgl, | 130 | dma_sync_sg_for_cpu(obj->dev->dev, msm_obj->sgt->sgl, |
131 | msm_obj->sgt->nents, | 131 | msm_obj->sgt->nents, |
132 | DMA_BIDIRECTIONAL); | 132 | DMA_BIDIRECTIONAL); |
133 | 133 | ||
diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c index d594f7520b7b..7d78e6deac89 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c | |||
@@ -285,9 +285,13 @@ static int ttm_set_pages_caching(struct dma_pool *pool, | |||
285 | 285 | ||
286 | static void __ttm_dma_free_page(struct dma_pool *pool, struct dma_page *d_page) | 286 | static void __ttm_dma_free_page(struct dma_pool *pool, struct dma_page *d_page) |
287 | { | 287 | { |
288 | unsigned long attrs = 0; | ||
288 | dma_addr_t dma = d_page->dma; | 289 | dma_addr_t dma = d_page->dma; |
289 | d_page->vaddr &= ~VADDR_FLAG_HUGE_POOL; | 290 | d_page->vaddr &= ~VADDR_FLAG_HUGE_POOL; |
290 | dma_free_coherent(pool->dev, pool->size, (void *)d_page->vaddr, dma); | 291 | if (pool->type & IS_HUGE) |
292 | attrs = DMA_ATTR_NO_WARN; | ||
293 | |||
294 | dma_free_attrs(pool->dev, pool->size, (void *)d_page->vaddr, dma, attrs); | ||
291 | 295 | ||
292 | kfree(d_page); | 296 | kfree(d_page); |
293 | d_page = NULL; | 297 | d_page = NULL; |
diff --git a/drivers/hwmon/nct6775.c b/drivers/hwmon/nct6775.c index e7dff5febe16..d42bc0883a32 100644 --- a/drivers/hwmon/nct6775.c +++ b/drivers/hwmon/nct6775.c | |||
@@ -852,7 +852,7 @@ static const u16 NCT6106_REG_TARGET[] = { 0x111, 0x121, 0x131 }; | |||
852 | static const u16 NCT6106_REG_WEIGHT_TEMP_SEL[] = { 0x168, 0x178, 0x188 }; | 852 | static const u16 NCT6106_REG_WEIGHT_TEMP_SEL[] = { 0x168, 0x178, 0x188 }; |
853 | static const u16 NCT6106_REG_WEIGHT_TEMP_STEP[] = { 0x169, 0x179, 0x189 }; | 853 | static const u16 NCT6106_REG_WEIGHT_TEMP_STEP[] = { 0x169, 0x179, 0x189 }; |
854 | static const u16 NCT6106_REG_WEIGHT_TEMP_STEP_TOL[] = { 0x16a, 0x17a, 0x18a }; | 854 | static const u16 NCT6106_REG_WEIGHT_TEMP_STEP_TOL[] = { 0x16a, 0x17a, 0x18a }; |
855 | static const u16 NCT6106_REG_WEIGHT_DUTY_STEP[] = { 0x16b, 0x17b, 0x17c }; | 855 | static const u16 NCT6106_REG_WEIGHT_DUTY_STEP[] = { 0x16b, 0x17b, 0x18b }; |
856 | static const u16 NCT6106_REG_WEIGHT_TEMP_BASE[] = { 0x16c, 0x17c, 0x18c }; | 856 | static const u16 NCT6106_REG_WEIGHT_TEMP_BASE[] = { 0x16c, 0x17c, 0x18c }; |
857 | static const u16 NCT6106_REG_WEIGHT_DUTY_BASE[] = { 0x16d, 0x17d, 0x18d }; | 857 | static const u16 NCT6106_REG_WEIGHT_DUTY_BASE[] = { 0x16d, 0x17d, 0x18d }; |
858 | 858 | ||
@@ -3764,6 +3764,7 @@ static int nct6775_probe(struct platform_device *pdev) | |||
3764 | data->REG_FAN_TIME[0] = NCT6106_REG_FAN_STOP_TIME; | 3764 | data->REG_FAN_TIME[0] = NCT6106_REG_FAN_STOP_TIME; |
3765 | data->REG_FAN_TIME[1] = NCT6106_REG_FAN_STEP_UP_TIME; | 3765 | data->REG_FAN_TIME[1] = NCT6106_REG_FAN_STEP_UP_TIME; |
3766 | data->REG_FAN_TIME[2] = NCT6106_REG_FAN_STEP_DOWN_TIME; | 3766 | data->REG_FAN_TIME[2] = NCT6106_REG_FAN_STEP_DOWN_TIME; |
3767 | data->REG_TOLERANCE_H = NCT6106_REG_TOLERANCE_H; | ||
3767 | data->REG_PWM[0] = NCT6106_REG_PWM; | 3768 | data->REG_PWM[0] = NCT6106_REG_PWM; |
3768 | data->REG_PWM[1] = NCT6106_REG_FAN_START_OUTPUT; | 3769 | data->REG_PWM[1] = NCT6106_REG_FAN_START_OUTPUT; |
3769 | data->REG_PWM[2] = NCT6106_REG_FAN_STOP_OUTPUT; | 3770 | data->REG_PWM[2] = NCT6106_REG_FAN_STOP_OUTPUT; |
diff --git a/drivers/hwmon/occ/common.c b/drivers/hwmon/occ/common.c index a7d2b16dd702..30e18eb60da7 100644 --- a/drivers/hwmon/occ/common.c +++ b/drivers/hwmon/occ/common.c | |||
@@ -408,8 +408,10 @@ static ssize_t occ_show_power_1(struct device *dev, | |||
408 | 408 | ||
409 | static u64 occ_get_powr_avg(u64 *accum, u32 *samples) | 409 | static u64 occ_get_powr_avg(u64 *accum, u32 *samples) |
410 | { | 410 | { |
411 | return div64_u64(get_unaligned_be64(accum) * 1000000ULL, | 411 | u64 divisor = get_unaligned_be32(samples); |
412 | get_unaligned_be32(samples)); | 412 | |
413 | return (divisor == 0) ? 0 : | ||
414 | div64_u64(get_unaligned_be64(accum) * 1000000ULL, divisor); | ||
413 | } | 415 | } |
414 | 416 | ||
415 | static ssize_t occ_show_power_2(struct device *dev, | 417 | static ssize_t occ_show_power_2(struct device *dev, |
diff --git a/drivers/i2c/busses/i2c-nvidia-gpu.c b/drivers/i2c/busses/i2c-nvidia-gpu.c index cfc76b5de726..5a1235fd86bb 100644 --- a/drivers/i2c/busses/i2c-nvidia-gpu.c +++ b/drivers/i2c/busses/i2c-nvidia-gpu.c | |||
@@ -364,7 +364,7 @@ static void gpu_i2c_remove(struct pci_dev *pdev) | |||
364 | /* | 364 | /* |
365 | * We need gpu_i2c_suspend() even if it is stub, for runtime pm to work | 365 | * We need gpu_i2c_suspend() even if it is stub, for runtime pm to work |
366 | * correctly. Without it, lspci shows runtime pm status as "D0" for the card. | 366 | * correctly. Without it, lspci shows runtime pm status as "D0" for the card. |
367 | * Documentation/power/pci.txt also insists for driver to provide this. | 367 | * Documentation/power/pci.rst also insists for driver to provide this. |
368 | */ | 368 | */ |
369 | static __maybe_unused int gpu_i2c_suspend(struct device *dev) | 369 | static __maybe_unused int gpu_i2c_suspend(struct device *dev) |
370 | { | 370 | { |
diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c index eb104c719629..4413aa67000e 100644 --- a/drivers/iommu/amd_iommu_init.c +++ b/drivers/iommu/amd_iommu_init.c | |||
@@ -23,6 +23,8 @@ | |||
23 | #include <linux/mem_encrypt.h> | 23 | #include <linux/mem_encrypt.h> |
24 | #include <asm/pci-direct.h> | 24 | #include <asm/pci-direct.h> |
25 | #include <asm/iommu.h> | 25 | #include <asm/iommu.h> |
26 | #include <asm/apic.h> | ||
27 | #include <asm/msidef.h> | ||
26 | #include <asm/gart.h> | 28 | #include <asm/gart.h> |
27 | #include <asm/x86_init.h> | 29 | #include <asm/x86_init.h> |
28 | #include <asm/iommu_table.h> | 30 | #include <asm/iommu_table.h> |
@@ -1920,6 +1922,90 @@ static int iommu_setup_msi(struct amd_iommu *iommu) | |||
1920 | return 0; | 1922 | return 0; |
1921 | } | 1923 | } |
1922 | 1924 | ||
1925 | #define XT_INT_DEST_MODE(x) (((x) & 0x1ULL) << 2) | ||
1926 | #define XT_INT_DEST_LO(x) (((x) & 0xFFFFFFULL) << 8) | ||
1927 | #define XT_INT_VEC(x) (((x) & 0xFFULL) << 32) | ||
1928 | #define XT_INT_DEST_HI(x) ((((x) >> 24) & 0xFFULL) << 56) | ||
1929 | |||
1930 | /** | ||
1931 | * Setup the IntCapXT registers with interrupt routing information | ||
1932 | * based on the PCI MSI capability block registers, accessed via | ||
1933 | * MMIO MSI address low/hi and MSI data registers. | ||
1934 | */ | ||
1935 | static void iommu_update_intcapxt(struct amd_iommu *iommu) | ||
1936 | { | ||
1937 | u64 val; | ||
1938 | u32 addr_lo = readl(iommu->mmio_base + MMIO_MSI_ADDR_LO_OFFSET); | ||
1939 | u32 addr_hi = readl(iommu->mmio_base + MMIO_MSI_ADDR_HI_OFFSET); | ||
1940 | u32 data = readl(iommu->mmio_base + MMIO_MSI_DATA_OFFSET); | ||
1941 | bool dm = (addr_lo >> MSI_ADDR_DEST_MODE_SHIFT) & 0x1; | ||
1942 | u32 dest = ((addr_lo >> MSI_ADDR_DEST_ID_SHIFT) & 0xFF); | ||
1943 | |||
1944 | if (x2apic_enabled()) | ||
1945 | dest |= MSI_ADDR_EXT_DEST_ID(addr_hi); | ||
1946 | |||
1947 | val = XT_INT_VEC(data & 0xFF) | | ||
1948 | XT_INT_DEST_MODE(dm) | | ||
1949 | XT_INT_DEST_LO(dest) | | ||
1950 | XT_INT_DEST_HI(dest); | ||
1951 | |||
1952 | /** | ||
1953 | * Current IOMMU implemtation uses the same IRQ for all | ||
1954 | * 3 IOMMU interrupts. | ||
1955 | */ | ||
1956 | writeq(val, iommu->mmio_base + MMIO_INTCAPXT_EVT_OFFSET); | ||
1957 | writeq(val, iommu->mmio_base + MMIO_INTCAPXT_PPR_OFFSET); | ||
1958 | writeq(val, iommu->mmio_base + MMIO_INTCAPXT_GALOG_OFFSET); | ||
1959 | } | ||
1960 | |||
1961 | static void _irq_notifier_notify(struct irq_affinity_notify *notify, | ||
1962 | const cpumask_t *mask) | ||
1963 | { | ||
1964 | struct amd_iommu *iommu; | ||
1965 | |||
1966 | for_each_iommu(iommu) { | ||
1967 | if (iommu->dev->irq == notify->irq) { | ||
1968 | iommu_update_intcapxt(iommu); | ||
1969 | break; | ||
1970 | } | ||
1971 | } | ||
1972 | } | ||
1973 | |||
1974 | static void _irq_notifier_release(struct kref *ref) | ||
1975 | { | ||
1976 | } | ||
1977 | |||
1978 | static int iommu_init_intcapxt(struct amd_iommu *iommu) | ||
1979 | { | ||
1980 | int ret; | ||
1981 | struct irq_affinity_notify *notify = &iommu->intcapxt_notify; | ||
1982 | |||
1983 | /** | ||
1984 | * IntCapXT requires XTSup=1, which can be inferred | ||
1985 | * amd_iommu_xt_mode. | ||
1986 | */ | ||
1987 | if (amd_iommu_xt_mode != IRQ_REMAP_X2APIC_MODE) | ||
1988 | return 0; | ||
1989 | |||
1990 | /** | ||
1991 | * Also, we need to setup notifier to update the IntCapXT registers | ||
1992 | * whenever the irq affinity is changed from user-space. | ||
1993 | */ | ||
1994 | notify->irq = iommu->dev->irq; | ||
1995 | notify->notify = _irq_notifier_notify, | ||
1996 | notify->release = _irq_notifier_release, | ||
1997 | ret = irq_set_affinity_notifier(iommu->dev->irq, notify); | ||
1998 | if (ret) { | ||
1999 | pr_err("Failed to register irq affinity notifier (devid=%#x, irq %d)\n", | ||
2000 | iommu->devid, iommu->dev->irq); | ||
2001 | return ret; | ||
2002 | } | ||
2003 | |||
2004 | iommu_update_intcapxt(iommu); | ||
2005 | iommu_feature_enable(iommu, CONTROL_INTCAPXT_EN); | ||
2006 | return ret; | ||
2007 | } | ||
2008 | |||
1923 | static int iommu_init_msi(struct amd_iommu *iommu) | 2009 | static int iommu_init_msi(struct amd_iommu *iommu) |
1924 | { | 2010 | { |
1925 | int ret; | 2011 | int ret; |
@@ -1936,6 +2022,10 @@ static int iommu_init_msi(struct amd_iommu *iommu) | |||
1936 | return ret; | 2022 | return ret; |
1937 | 2023 | ||
1938 | enable_faults: | 2024 | enable_faults: |
2025 | ret = iommu_init_intcapxt(iommu); | ||
2026 | if (ret) | ||
2027 | return ret; | ||
2028 | |||
1939 | iommu_feature_enable(iommu, CONTROL_EVT_INT_EN); | 2029 | iommu_feature_enable(iommu, CONTROL_EVT_INT_EN); |
1940 | 2030 | ||
1941 | if (iommu->ppr_log != NULL) | 2031 | if (iommu->ppr_log != NULL) |
diff --git a/drivers/iommu/amd_iommu_types.h b/drivers/iommu/amd_iommu_types.h index 52c35d557fad..64edd5a9694c 100644 --- a/drivers/iommu/amd_iommu_types.h +++ b/drivers/iommu/amd_iommu_types.h | |||
@@ -60,6 +60,12 @@ | |||
60 | #define MMIO_PPR_LOG_OFFSET 0x0038 | 60 | #define MMIO_PPR_LOG_OFFSET 0x0038 |
61 | #define MMIO_GA_LOG_BASE_OFFSET 0x00e0 | 61 | #define MMIO_GA_LOG_BASE_OFFSET 0x00e0 |
62 | #define MMIO_GA_LOG_TAIL_OFFSET 0x00e8 | 62 | #define MMIO_GA_LOG_TAIL_OFFSET 0x00e8 |
63 | #define MMIO_MSI_ADDR_LO_OFFSET 0x015C | ||
64 | #define MMIO_MSI_ADDR_HI_OFFSET 0x0160 | ||
65 | #define MMIO_MSI_DATA_OFFSET 0x0164 | ||
66 | #define MMIO_INTCAPXT_EVT_OFFSET 0x0170 | ||
67 | #define MMIO_INTCAPXT_PPR_OFFSET 0x0178 | ||
68 | #define MMIO_INTCAPXT_GALOG_OFFSET 0x0180 | ||
63 | #define MMIO_CMD_HEAD_OFFSET 0x2000 | 69 | #define MMIO_CMD_HEAD_OFFSET 0x2000 |
64 | #define MMIO_CMD_TAIL_OFFSET 0x2008 | 70 | #define MMIO_CMD_TAIL_OFFSET 0x2008 |
65 | #define MMIO_EVT_HEAD_OFFSET 0x2010 | 71 | #define MMIO_EVT_HEAD_OFFSET 0x2010 |
@@ -150,6 +156,7 @@ | |||
150 | #define CONTROL_GALOG_EN 0x1CULL | 156 | #define CONTROL_GALOG_EN 0x1CULL |
151 | #define CONTROL_GAINT_EN 0x1DULL | 157 | #define CONTROL_GAINT_EN 0x1DULL |
152 | #define CONTROL_XT_EN 0x32ULL | 158 | #define CONTROL_XT_EN 0x32ULL |
159 | #define CONTROL_INTCAPXT_EN 0x33ULL | ||
153 | 160 | ||
154 | #define CTRL_INV_TO_MASK (7 << CONTROL_INV_TIMEOUT) | 161 | #define CTRL_INV_TO_MASK (7 << CONTROL_INV_TIMEOUT) |
155 | #define CTRL_INV_TO_NONE 0 | 162 | #define CTRL_INV_TO_NONE 0 |
@@ -592,6 +599,8 @@ struct amd_iommu { | |||
592 | /* DebugFS Info */ | 599 | /* DebugFS Info */ |
593 | struct dentry *debugfs; | 600 | struct dentry *debugfs; |
594 | #endif | 601 | #endif |
602 | /* IRQ notifier for IntCapXT interrupt */ | ||
603 | struct irq_affinity_notify intcapxt_notify; | ||
595 | }; | 604 | }; |
596 | 605 | ||
597 | static inline struct amd_iommu *dev_to_amd_iommu(struct device *dev) | 606 | static inline struct amd_iommu *dev_to_amd_iommu(struct device *dev) |
diff --git a/drivers/iommu/intel-iommu-debugfs.c b/drivers/iommu/intel-iommu-debugfs.c index 73a552914455..2b25d9c59336 100644 --- a/drivers/iommu/intel-iommu-debugfs.c +++ b/drivers/iommu/intel-iommu-debugfs.c | |||
@@ -162,9 +162,9 @@ static inline void print_tbl_walk(struct seq_file *m) | |||
162 | (u64)0, (u64)0, (u64)0); | 162 | (u64)0, (u64)0, (u64)0); |
163 | else | 163 | else |
164 | seq_printf(m, "%-6d\t0x%016llx:0x%016llx:0x%016llx\n", | 164 | seq_printf(m, "%-6d\t0x%016llx:0x%016llx:0x%016llx\n", |
165 | tbl_wlk->pasid, tbl_wlk->pasid_tbl_entry->val[0], | 165 | tbl_wlk->pasid, tbl_wlk->pasid_tbl_entry->val[2], |
166 | tbl_wlk->pasid_tbl_entry->val[1], | 166 | tbl_wlk->pasid_tbl_entry->val[1], |
167 | tbl_wlk->pasid_tbl_entry->val[2]); | 167 | tbl_wlk->pasid_tbl_entry->val[0]); |
168 | } | 168 | } |
169 | 169 | ||
170 | static void pasid_tbl_walk(struct seq_file *m, struct pasid_entry *tbl_entry, | 170 | static void pasid_tbl_walk(struct seq_file *m, struct pasid_entry *tbl_entry, |
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index ac4172c02244..bdaed2da8a55 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c | |||
@@ -339,8 +339,6 @@ static void domain_exit(struct dmar_domain *domain); | |||
339 | static void domain_remove_dev_info(struct dmar_domain *domain); | 339 | static void domain_remove_dev_info(struct dmar_domain *domain); |
340 | static void dmar_remove_one_dev_info(struct device *dev); | 340 | static void dmar_remove_one_dev_info(struct device *dev); |
341 | static void __dmar_remove_one_dev_info(struct device_domain_info *info); | 341 | static void __dmar_remove_one_dev_info(struct device_domain_info *info); |
342 | static void domain_context_clear(struct intel_iommu *iommu, | ||
343 | struct device *dev); | ||
344 | static int domain_detach_iommu(struct dmar_domain *domain, | 342 | static int domain_detach_iommu(struct dmar_domain *domain, |
345 | struct intel_iommu *iommu); | 343 | struct intel_iommu *iommu); |
346 | static bool device_is_rmrr_locked(struct device *dev); | 344 | static bool device_is_rmrr_locked(struct device *dev); |
@@ -1833,9 +1831,65 @@ static inline int guestwidth_to_adjustwidth(int gaw) | |||
1833 | return agaw; | 1831 | return agaw; |
1834 | } | 1832 | } |
1835 | 1833 | ||
1834 | static int domain_init(struct dmar_domain *domain, struct intel_iommu *iommu, | ||
1835 | int guest_width) | ||
1836 | { | ||
1837 | int adjust_width, agaw; | ||
1838 | unsigned long sagaw; | ||
1839 | int err; | ||
1840 | |||
1841 | init_iova_domain(&domain->iovad, VTD_PAGE_SIZE, IOVA_START_PFN); | ||
1842 | |||
1843 | err = init_iova_flush_queue(&domain->iovad, | ||
1844 | iommu_flush_iova, iova_entry_free); | ||
1845 | if (err) | ||
1846 | return err; | ||
1847 | |||
1848 | domain_reserve_special_ranges(domain); | ||
1849 | |||
1850 | /* calculate AGAW */ | ||
1851 | if (guest_width > cap_mgaw(iommu->cap)) | ||
1852 | guest_width = cap_mgaw(iommu->cap); | ||
1853 | domain->gaw = guest_width; | ||
1854 | adjust_width = guestwidth_to_adjustwidth(guest_width); | ||
1855 | agaw = width_to_agaw(adjust_width); | ||
1856 | sagaw = cap_sagaw(iommu->cap); | ||
1857 | if (!test_bit(agaw, &sagaw)) { | ||
1858 | /* hardware doesn't support it, choose a bigger one */ | ||
1859 | pr_debug("Hardware doesn't support agaw %d\n", agaw); | ||
1860 | agaw = find_next_bit(&sagaw, 5, agaw); | ||
1861 | if (agaw >= 5) | ||
1862 | return -ENODEV; | ||
1863 | } | ||
1864 | domain->agaw = agaw; | ||
1865 | |||
1866 | if (ecap_coherent(iommu->ecap)) | ||
1867 | domain->iommu_coherency = 1; | ||
1868 | else | ||
1869 | domain->iommu_coherency = 0; | ||
1870 | |||
1871 | if (ecap_sc_support(iommu->ecap)) | ||
1872 | domain->iommu_snooping = 1; | ||
1873 | else | ||
1874 | domain->iommu_snooping = 0; | ||
1875 | |||
1876 | if (intel_iommu_superpage) | ||
1877 | domain->iommu_superpage = fls(cap_super_page_val(iommu->cap)); | ||
1878 | else | ||
1879 | domain->iommu_superpage = 0; | ||
1880 | |||
1881 | domain->nid = iommu->node; | ||
1882 | |||
1883 | /* always allocate the top pgd */ | ||
1884 | domain->pgd = (struct dma_pte *)alloc_pgtable_page(domain->nid); | ||
1885 | if (!domain->pgd) | ||
1886 | return -ENOMEM; | ||
1887 | __iommu_flush_cache(iommu, domain->pgd, PAGE_SIZE); | ||
1888 | return 0; | ||
1889 | } | ||
1890 | |||
1836 | static void domain_exit(struct dmar_domain *domain) | 1891 | static void domain_exit(struct dmar_domain *domain) |
1837 | { | 1892 | { |
1838 | struct page *freelist; | ||
1839 | 1893 | ||
1840 | /* Remove associated devices and clear attached or cached domains */ | 1894 | /* Remove associated devices and clear attached or cached domains */ |
1841 | domain_remove_dev_info(domain); | 1895 | domain_remove_dev_info(domain); |
@@ -1843,9 +1897,12 @@ static void domain_exit(struct dmar_domain *domain) | |||
1843 | /* destroy iovas */ | 1897 | /* destroy iovas */ |
1844 | put_iova_domain(&domain->iovad); | 1898 | put_iova_domain(&domain->iovad); |
1845 | 1899 | ||
1846 | freelist = domain_unmap(domain, 0, DOMAIN_MAX_PFN(domain->gaw)); | 1900 | if (domain->pgd) { |
1901 | struct page *freelist; | ||
1847 | 1902 | ||
1848 | dma_free_pagelist(freelist); | 1903 | freelist = domain_unmap(domain, 0, DOMAIN_MAX_PFN(domain->gaw)); |
1904 | dma_free_pagelist(freelist); | ||
1905 | } | ||
1849 | 1906 | ||
1850 | free_domain_mem(domain); | 1907 | free_domain_mem(domain); |
1851 | } | 1908 | } |
@@ -2048,26 +2105,9 @@ out_unlock: | |||
2048 | return ret; | 2105 | return ret; |
2049 | } | 2106 | } |
2050 | 2107 | ||
2051 | struct domain_context_mapping_data { | ||
2052 | struct dmar_domain *domain; | ||
2053 | struct intel_iommu *iommu; | ||
2054 | struct pasid_table *table; | ||
2055 | }; | ||
2056 | |||
2057 | static int domain_context_mapping_cb(struct pci_dev *pdev, | ||
2058 | u16 alias, void *opaque) | ||
2059 | { | ||
2060 | struct domain_context_mapping_data *data = opaque; | ||
2061 | |||
2062 | return domain_context_mapping_one(data->domain, data->iommu, | ||
2063 | data->table, PCI_BUS_NUM(alias), | ||
2064 | alias & 0xff); | ||
2065 | } | ||
2066 | |||
2067 | static int | 2108 | static int |
2068 | domain_context_mapping(struct dmar_domain *domain, struct device *dev) | 2109 | domain_context_mapping(struct dmar_domain *domain, struct device *dev) |
2069 | { | 2110 | { |
2070 | struct domain_context_mapping_data data; | ||
2071 | struct pasid_table *table; | 2111 | struct pasid_table *table; |
2072 | struct intel_iommu *iommu; | 2112 | struct intel_iommu *iommu; |
2073 | u8 bus, devfn; | 2113 | u8 bus, devfn; |
@@ -2077,17 +2117,7 @@ domain_context_mapping(struct dmar_domain *domain, struct device *dev) | |||
2077 | return -ENODEV; | 2117 | return -ENODEV; |
2078 | 2118 | ||
2079 | table = intel_pasid_get_table(dev); | 2119 | table = intel_pasid_get_table(dev); |
2080 | 2120 | return domain_context_mapping_one(domain, iommu, table, bus, devfn); | |
2081 | if (!dev_is_pci(dev)) | ||
2082 | return domain_context_mapping_one(domain, iommu, table, | ||
2083 | bus, devfn); | ||
2084 | |||
2085 | data.domain = domain; | ||
2086 | data.iommu = iommu; | ||
2087 | data.table = table; | ||
2088 | |||
2089 | return pci_for_each_dma_alias(to_pci_dev(dev), | ||
2090 | &domain_context_mapping_cb, &data); | ||
2091 | } | 2121 | } |
2092 | 2122 | ||
2093 | static int domain_context_mapped_cb(struct pci_dev *pdev, | 2123 | static int domain_context_mapped_cb(struct pci_dev *pdev, |
@@ -2513,31 +2543,6 @@ static int get_last_alias(struct pci_dev *pdev, u16 alias, void *opaque) | |||
2513 | return 0; | 2543 | return 0; |
2514 | } | 2544 | } |
2515 | 2545 | ||
2516 | static int domain_init(struct dmar_domain *domain, int guest_width) | ||
2517 | { | ||
2518 | int adjust_width; | ||
2519 | |||
2520 | init_iova_domain(&domain->iovad, VTD_PAGE_SIZE, IOVA_START_PFN); | ||
2521 | domain_reserve_special_ranges(domain); | ||
2522 | |||
2523 | /* calculate AGAW */ | ||
2524 | domain->gaw = guest_width; | ||
2525 | adjust_width = guestwidth_to_adjustwidth(guest_width); | ||
2526 | domain->agaw = width_to_agaw(adjust_width); | ||
2527 | |||
2528 | domain->iommu_coherency = 0; | ||
2529 | domain->iommu_snooping = 0; | ||
2530 | domain->iommu_superpage = 0; | ||
2531 | domain->max_addr = 0; | ||
2532 | |||
2533 | /* always allocate the top pgd */ | ||
2534 | domain->pgd = (struct dma_pte *)alloc_pgtable_page(domain->nid); | ||
2535 | if (!domain->pgd) | ||
2536 | return -ENOMEM; | ||
2537 | domain_flush_cache(domain, domain->pgd, PAGE_SIZE); | ||
2538 | return 0; | ||
2539 | } | ||
2540 | |||
2541 | static struct dmar_domain *find_or_alloc_domain(struct device *dev, int gaw) | 2546 | static struct dmar_domain *find_or_alloc_domain(struct device *dev, int gaw) |
2542 | { | 2547 | { |
2543 | struct device_domain_info *info; | 2548 | struct device_domain_info *info; |
@@ -2575,19 +2580,11 @@ static struct dmar_domain *find_or_alloc_domain(struct device *dev, int gaw) | |||
2575 | domain = alloc_domain(0); | 2580 | domain = alloc_domain(0); |
2576 | if (!domain) | 2581 | if (!domain) |
2577 | return NULL; | 2582 | return NULL; |
2578 | 2583 | if (domain_init(domain, iommu, gaw)) { | |
2579 | if (domain_init(domain, gaw)) { | ||
2580 | domain_exit(domain); | 2584 | domain_exit(domain); |
2581 | return NULL; | 2585 | return NULL; |
2582 | } | 2586 | } |
2583 | 2587 | ||
2584 | if (init_iova_flush_queue(&domain->iovad, | ||
2585 | iommu_flush_iova, | ||
2586 | iova_entry_free)) { | ||
2587 | pr_warn("iova flush queue initialization failed\n"); | ||
2588 | intel_iommu_strict = 1; | ||
2589 | } | ||
2590 | |||
2591 | out: | 2588 | out: |
2592 | return domain; | 2589 | return domain; |
2593 | } | 2590 | } |
@@ -2692,6 +2689,8 @@ static int domain_prepare_identity_map(struct device *dev, | |||
2692 | return iommu_domain_identity_map(domain, start, end); | 2689 | return iommu_domain_identity_map(domain, start, end); |
2693 | } | 2690 | } |
2694 | 2691 | ||
2692 | static int md_domain_init(struct dmar_domain *domain, int guest_width); | ||
2693 | |||
2695 | static int __init si_domain_init(int hw) | 2694 | static int __init si_domain_init(int hw) |
2696 | { | 2695 | { |
2697 | struct dmar_rmrr_unit *rmrr; | 2696 | struct dmar_rmrr_unit *rmrr; |
@@ -2702,7 +2701,7 @@ static int __init si_domain_init(int hw) | |||
2702 | if (!si_domain) | 2701 | if (!si_domain) |
2703 | return -EFAULT; | 2702 | return -EFAULT; |
2704 | 2703 | ||
2705 | if (domain_init(si_domain, DEFAULT_DOMAIN_ADDRESS_WIDTH)) { | 2704 | if (md_domain_init(si_domain, DEFAULT_DOMAIN_ADDRESS_WIDTH)) { |
2706 | domain_exit(si_domain); | 2705 | domain_exit(si_domain); |
2707 | return -EFAULT; | 2706 | return -EFAULT; |
2708 | } | 2707 | } |
@@ -3564,7 +3563,8 @@ static void intel_unmap(struct device *dev, dma_addr_t dev_addr, size_t size) | |||
3564 | 3563 | ||
3565 | freelist = domain_unmap(domain, start_pfn, last_pfn); | 3564 | freelist = domain_unmap(domain, start_pfn, last_pfn); |
3566 | 3565 | ||
3567 | if (intel_iommu_strict || (pdev && pdev->untrusted)) { | 3566 | if (intel_iommu_strict || (pdev && pdev->untrusted) || |
3567 | !has_iova_flush_queue(&domain->iovad)) { | ||
3568 | iommu_flush_iotlb_psi(iommu, domain, start_pfn, | 3568 | iommu_flush_iotlb_psi(iommu, domain, start_pfn, |
3569 | nrpages, !freelist, 0); | 3569 | nrpages, !freelist, 0); |
3570 | /* free iova */ | 3570 | /* free iova */ |
@@ -4758,28 +4758,6 @@ out_free_dmar: | |||
4758 | return ret; | 4758 | return ret; |
4759 | } | 4759 | } |
4760 | 4760 | ||
4761 | static int domain_context_clear_one_cb(struct pci_dev *pdev, u16 alias, void *opaque) | ||
4762 | { | ||
4763 | struct intel_iommu *iommu = opaque; | ||
4764 | |||
4765 | domain_context_clear_one(iommu, PCI_BUS_NUM(alias), alias & 0xff); | ||
4766 | return 0; | ||
4767 | } | ||
4768 | |||
4769 | /* | ||
4770 | * NB - intel-iommu lacks any sort of reference counting for the users of | ||
4771 | * dependent devices. If multiple endpoints have intersecting dependent | ||
4772 | * devices, unbinding the driver from any one of them will possibly leave | ||
4773 | * the others unable to operate. | ||
4774 | */ | ||
4775 | static void domain_context_clear(struct intel_iommu *iommu, struct device *dev) | ||
4776 | { | ||
4777 | if (!iommu || !dev || !dev_is_pci(dev)) | ||
4778 | return; | ||
4779 | |||
4780 | pci_for_each_dma_alias(to_pci_dev(dev), &domain_context_clear_one_cb, iommu); | ||
4781 | } | ||
4782 | |||
4783 | static void __dmar_remove_one_dev_info(struct device_domain_info *info) | 4761 | static void __dmar_remove_one_dev_info(struct device_domain_info *info) |
4784 | { | 4762 | { |
4785 | struct dmar_domain *domain; | 4763 | struct dmar_domain *domain; |
@@ -4800,7 +4778,7 @@ static void __dmar_remove_one_dev_info(struct device_domain_info *info) | |||
4800 | PASID_RID2PASID); | 4778 | PASID_RID2PASID); |
4801 | 4779 | ||
4802 | iommu_disable_dev_iotlb(info); | 4780 | iommu_disable_dev_iotlb(info); |
4803 | domain_context_clear(iommu, info->dev); | 4781 | domain_context_clear_one(iommu, info->bus, info->devfn); |
4804 | intel_pasid_free_table(info->dev); | 4782 | intel_pasid_free_table(info->dev); |
4805 | } | 4783 | } |
4806 | 4784 | ||
@@ -4829,6 +4807,31 @@ static void dmar_remove_one_dev_info(struct device *dev) | |||
4829 | spin_unlock_irqrestore(&device_domain_lock, flags); | 4807 | spin_unlock_irqrestore(&device_domain_lock, flags); |
4830 | } | 4808 | } |
4831 | 4809 | ||
4810 | static int md_domain_init(struct dmar_domain *domain, int guest_width) | ||
4811 | { | ||
4812 | int adjust_width; | ||
4813 | |||
4814 | init_iova_domain(&domain->iovad, VTD_PAGE_SIZE, IOVA_START_PFN); | ||
4815 | domain_reserve_special_ranges(domain); | ||
4816 | |||
4817 | /* calculate AGAW */ | ||
4818 | domain->gaw = guest_width; | ||
4819 | adjust_width = guestwidth_to_adjustwidth(guest_width); | ||
4820 | domain->agaw = width_to_agaw(adjust_width); | ||
4821 | |||
4822 | domain->iommu_coherency = 0; | ||
4823 | domain->iommu_snooping = 0; | ||
4824 | domain->iommu_superpage = 0; | ||
4825 | domain->max_addr = 0; | ||
4826 | |||
4827 | /* always allocate the top pgd */ | ||
4828 | domain->pgd = (struct dma_pte *)alloc_pgtable_page(domain->nid); | ||
4829 | if (!domain->pgd) | ||
4830 | return -ENOMEM; | ||
4831 | domain_flush_cache(domain, domain->pgd, PAGE_SIZE); | ||
4832 | return 0; | ||
4833 | } | ||
4834 | |||
4832 | static struct iommu_domain *intel_iommu_domain_alloc(unsigned type) | 4835 | static struct iommu_domain *intel_iommu_domain_alloc(unsigned type) |
4833 | { | 4836 | { |
4834 | struct dmar_domain *dmar_domain; | 4837 | struct dmar_domain *dmar_domain; |
@@ -4843,7 +4846,7 @@ static struct iommu_domain *intel_iommu_domain_alloc(unsigned type) | |||
4843 | pr_err("Can't allocate dmar_domain\n"); | 4846 | pr_err("Can't allocate dmar_domain\n"); |
4844 | return NULL; | 4847 | return NULL; |
4845 | } | 4848 | } |
4846 | if (domain_init(dmar_domain, DEFAULT_DOMAIN_ADDRESS_WIDTH)) { | 4849 | if (md_domain_init(dmar_domain, DEFAULT_DOMAIN_ADDRESS_WIDTH)) { |
4847 | pr_err("Domain initialization failed\n"); | 4850 | pr_err("Domain initialization failed\n"); |
4848 | domain_exit(dmar_domain); | 4851 | domain_exit(dmar_domain); |
4849 | return NULL; | 4852 | return NULL; |
diff --git a/drivers/iommu/iova.c b/drivers/iommu/iova.c index d499b2621239..3e1a8a675572 100644 --- a/drivers/iommu/iova.c +++ b/drivers/iommu/iova.c | |||
@@ -54,9 +54,14 @@ init_iova_domain(struct iova_domain *iovad, unsigned long granule, | |||
54 | } | 54 | } |
55 | EXPORT_SYMBOL_GPL(init_iova_domain); | 55 | EXPORT_SYMBOL_GPL(init_iova_domain); |
56 | 56 | ||
57 | bool has_iova_flush_queue(struct iova_domain *iovad) | ||
58 | { | ||
59 | return !!iovad->fq; | ||
60 | } | ||
61 | |||
57 | static void free_iova_flush_queue(struct iova_domain *iovad) | 62 | static void free_iova_flush_queue(struct iova_domain *iovad) |
58 | { | 63 | { |
59 | if (!iovad->fq) | 64 | if (!has_iova_flush_queue(iovad)) |
60 | return; | 65 | return; |
61 | 66 | ||
62 | if (timer_pending(&iovad->fq_timer)) | 67 | if (timer_pending(&iovad->fq_timer)) |
@@ -74,13 +79,14 @@ static void free_iova_flush_queue(struct iova_domain *iovad) | |||
74 | int init_iova_flush_queue(struct iova_domain *iovad, | 79 | int init_iova_flush_queue(struct iova_domain *iovad, |
75 | iova_flush_cb flush_cb, iova_entry_dtor entry_dtor) | 80 | iova_flush_cb flush_cb, iova_entry_dtor entry_dtor) |
76 | { | 81 | { |
82 | struct iova_fq __percpu *queue; | ||
77 | int cpu; | 83 | int cpu; |
78 | 84 | ||
79 | atomic64_set(&iovad->fq_flush_start_cnt, 0); | 85 | atomic64_set(&iovad->fq_flush_start_cnt, 0); |
80 | atomic64_set(&iovad->fq_flush_finish_cnt, 0); | 86 | atomic64_set(&iovad->fq_flush_finish_cnt, 0); |
81 | 87 | ||
82 | iovad->fq = alloc_percpu(struct iova_fq); | 88 | queue = alloc_percpu(struct iova_fq); |
83 | if (!iovad->fq) | 89 | if (!queue) |
84 | return -ENOMEM; | 90 | return -ENOMEM; |
85 | 91 | ||
86 | iovad->flush_cb = flush_cb; | 92 | iovad->flush_cb = flush_cb; |
@@ -89,13 +95,17 @@ int init_iova_flush_queue(struct iova_domain *iovad, | |||
89 | for_each_possible_cpu(cpu) { | 95 | for_each_possible_cpu(cpu) { |
90 | struct iova_fq *fq; | 96 | struct iova_fq *fq; |
91 | 97 | ||
92 | fq = per_cpu_ptr(iovad->fq, cpu); | 98 | fq = per_cpu_ptr(queue, cpu); |
93 | fq->head = 0; | 99 | fq->head = 0; |
94 | fq->tail = 0; | 100 | fq->tail = 0; |
95 | 101 | ||
96 | spin_lock_init(&fq->lock); | 102 | spin_lock_init(&fq->lock); |
97 | } | 103 | } |
98 | 104 | ||
105 | smp_wmb(); | ||
106 | |||
107 | iovad->fq = queue; | ||
108 | |||
99 | timer_setup(&iovad->fq_timer, fq_flush_timeout, 0); | 109 | timer_setup(&iovad->fq_timer, fq_flush_timeout, 0); |
100 | atomic_set(&iovad->fq_timer_on, 0); | 110 | atomic_set(&iovad->fq_timer_on, 0); |
101 | 111 | ||
@@ -127,8 +137,9 @@ __cached_rbnode_delete_update(struct iova_domain *iovad, struct iova *free) | |||
127 | struct iova *cached_iova; | 137 | struct iova *cached_iova; |
128 | 138 | ||
129 | cached_iova = rb_entry(iovad->cached32_node, struct iova, node); | 139 | cached_iova = rb_entry(iovad->cached32_node, struct iova, node); |
130 | if (free->pfn_hi < iovad->dma_32bit_pfn && | 140 | if (free == cached_iova || |
131 | free->pfn_lo >= cached_iova->pfn_lo) { | 141 | (free->pfn_hi < iovad->dma_32bit_pfn && |
142 | free->pfn_lo >= cached_iova->pfn_lo)) { | ||
132 | iovad->cached32_node = rb_next(&free->node); | 143 | iovad->cached32_node = rb_next(&free->node); |
133 | iovad->max32_alloc_size = iovad->dma_32bit_pfn; | 144 | iovad->max32_alloc_size = iovad->dma_32bit_pfn; |
134 | } | 145 | } |
diff --git a/drivers/iommu/virtio-iommu.c b/drivers/iommu/virtio-iommu.c index 433f4d2ee956..80a740df0737 100644 --- a/drivers/iommu/virtio-iommu.c +++ b/drivers/iommu/virtio-iommu.c | |||
@@ -2,7 +2,7 @@ | |||
2 | /* | 2 | /* |
3 | * Virtio driver for the paravirtualized IOMMU | 3 | * Virtio driver for the paravirtualized IOMMU |
4 | * | 4 | * |
5 | * Copyright (C) 2018 Arm Limited | 5 | * Copyright (C) 2019 Arm Limited |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | 8 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
@@ -47,7 +47,10 @@ struct viommu_dev { | |||
47 | /* Device configuration */ | 47 | /* Device configuration */ |
48 | struct iommu_domain_geometry geometry; | 48 | struct iommu_domain_geometry geometry; |
49 | u64 pgsize_bitmap; | 49 | u64 pgsize_bitmap; |
50 | u8 domain_bits; | 50 | u32 first_domain; |
51 | u32 last_domain; | ||
52 | /* Supported MAP flags */ | ||
53 | u32 map_flags; | ||
51 | u32 probe_size; | 54 | u32 probe_size; |
52 | }; | 55 | }; |
53 | 56 | ||
@@ -62,6 +65,7 @@ struct viommu_domain { | |||
62 | struct viommu_dev *viommu; | 65 | struct viommu_dev *viommu; |
63 | struct mutex mutex; /* protects viommu pointer */ | 66 | struct mutex mutex; /* protects viommu pointer */ |
64 | unsigned int id; | 67 | unsigned int id; |
68 | u32 map_flags; | ||
65 | 69 | ||
66 | spinlock_t mappings_lock; | 70 | spinlock_t mappings_lock; |
67 | struct rb_root_cached mappings; | 71 | struct rb_root_cached mappings; |
@@ -113,6 +117,8 @@ static int viommu_get_req_errno(void *buf, size_t len) | |||
113 | return -ENOENT; | 117 | return -ENOENT; |
114 | case VIRTIO_IOMMU_S_FAULT: | 118 | case VIRTIO_IOMMU_S_FAULT: |
115 | return -EFAULT; | 119 | return -EFAULT; |
120 | case VIRTIO_IOMMU_S_NOMEM: | ||
121 | return -ENOMEM; | ||
116 | case VIRTIO_IOMMU_S_IOERR: | 122 | case VIRTIO_IOMMU_S_IOERR: |
117 | case VIRTIO_IOMMU_S_DEVERR: | 123 | case VIRTIO_IOMMU_S_DEVERR: |
118 | default: | 124 | default: |
@@ -607,15 +613,15 @@ static int viommu_domain_finalise(struct viommu_dev *viommu, | |||
607 | { | 613 | { |
608 | int ret; | 614 | int ret; |
609 | struct viommu_domain *vdomain = to_viommu_domain(domain); | 615 | struct viommu_domain *vdomain = to_viommu_domain(domain); |
610 | unsigned int max_domain = viommu->domain_bits > 31 ? ~0 : | ||
611 | (1U << viommu->domain_bits) - 1; | ||
612 | 616 | ||
613 | vdomain->viommu = viommu; | 617 | vdomain->viommu = viommu; |
618 | vdomain->map_flags = viommu->map_flags; | ||
614 | 619 | ||
615 | domain->pgsize_bitmap = viommu->pgsize_bitmap; | 620 | domain->pgsize_bitmap = viommu->pgsize_bitmap; |
616 | domain->geometry = viommu->geometry; | 621 | domain->geometry = viommu->geometry; |
617 | 622 | ||
618 | ret = ida_alloc_max(&viommu->domain_ids, max_domain, GFP_KERNEL); | 623 | ret = ida_alloc_range(&viommu->domain_ids, viommu->first_domain, |
624 | viommu->last_domain, GFP_KERNEL); | ||
619 | if (ret >= 0) | 625 | if (ret >= 0) |
620 | vdomain->id = (unsigned int)ret; | 626 | vdomain->id = (unsigned int)ret; |
621 | 627 | ||
@@ -710,7 +716,7 @@ static int viommu_map(struct iommu_domain *domain, unsigned long iova, | |||
710 | phys_addr_t paddr, size_t size, int prot) | 716 | phys_addr_t paddr, size_t size, int prot) |
711 | { | 717 | { |
712 | int ret; | 718 | int ret; |
713 | int flags; | 719 | u32 flags; |
714 | struct virtio_iommu_req_map map; | 720 | struct virtio_iommu_req_map map; |
715 | struct viommu_domain *vdomain = to_viommu_domain(domain); | 721 | struct viommu_domain *vdomain = to_viommu_domain(domain); |
716 | 722 | ||
@@ -718,6 +724,9 @@ static int viommu_map(struct iommu_domain *domain, unsigned long iova, | |||
718 | (prot & IOMMU_WRITE ? VIRTIO_IOMMU_MAP_F_WRITE : 0) | | 724 | (prot & IOMMU_WRITE ? VIRTIO_IOMMU_MAP_F_WRITE : 0) | |
719 | (prot & IOMMU_MMIO ? VIRTIO_IOMMU_MAP_F_MMIO : 0); | 725 | (prot & IOMMU_MMIO ? VIRTIO_IOMMU_MAP_F_MMIO : 0); |
720 | 726 | ||
727 | if (flags & ~vdomain->map_flags) | ||
728 | return -EINVAL; | ||
729 | |||
721 | ret = viommu_add_mapping(vdomain, iova, paddr, size, flags); | 730 | ret = viommu_add_mapping(vdomain, iova, paddr, size, flags); |
722 | if (ret) | 731 | if (ret) |
723 | return ret; | 732 | return ret; |
@@ -1027,7 +1036,8 @@ static int viommu_probe(struct virtio_device *vdev) | |||
1027 | goto err_free_vqs; | 1036 | goto err_free_vqs; |
1028 | } | 1037 | } |
1029 | 1038 | ||
1030 | viommu->domain_bits = 32; | 1039 | viommu->map_flags = VIRTIO_IOMMU_MAP_F_READ | VIRTIO_IOMMU_MAP_F_WRITE; |
1040 | viommu->last_domain = ~0U; | ||
1031 | 1041 | ||
1032 | /* Optional features */ | 1042 | /* Optional features */ |
1033 | virtio_cread_feature(vdev, VIRTIO_IOMMU_F_INPUT_RANGE, | 1043 | virtio_cread_feature(vdev, VIRTIO_IOMMU_F_INPUT_RANGE, |
@@ -1038,9 +1048,13 @@ static int viommu_probe(struct virtio_device *vdev) | |||
1038 | struct virtio_iommu_config, input_range.end, | 1048 | struct virtio_iommu_config, input_range.end, |
1039 | &input_end); | 1049 | &input_end); |
1040 | 1050 | ||
1041 | virtio_cread_feature(vdev, VIRTIO_IOMMU_F_DOMAIN_BITS, | 1051 | virtio_cread_feature(vdev, VIRTIO_IOMMU_F_DOMAIN_RANGE, |
1042 | struct virtio_iommu_config, domain_bits, | 1052 | struct virtio_iommu_config, domain_range.start, |
1043 | &viommu->domain_bits); | 1053 | &viommu->first_domain); |
1054 | |||
1055 | virtio_cread_feature(vdev, VIRTIO_IOMMU_F_DOMAIN_RANGE, | ||
1056 | struct virtio_iommu_config, domain_range.end, | ||
1057 | &viommu->last_domain); | ||
1044 | 1058 | ||
1045 | virtio_cread_feature(vdev, VIRTIO_IOMMU_F_PROBE, | 1059 | virtio_cread_feature(vdev, VIRTIO_IOMMU_F_PROBE, |
1046 | struct virtio_iommu_config, probe_size, | 1060 | struct virtio_iommu_config, probe_size, |
@@ -1052,6 +1066,9 @@ static int viommu_probe(struct virtio_device *vdev) | |||
1052 | .force_aperture = true, | 1066 | .force_aperture = true, |
1053 | }; | 1067 | }; |
1054 | 1068 | ||
1069 | if (virtio_has_feature(vdev, VIRTIO_IOMMU_F_MMIO)) | ||
1070 | viommu->map_flags |= VIRTIO_IOMMU_MAP_F_MMIO; | ||
1071 | |||
1055 | viommu_ops.pgsize_bitmap = viommu->pgsize_bitmap; | 1072 | viommu_ops.pgsize_bitmap = viommu->pgsize_bitmap; |
1056 | 1073 | ||
1057 | virtio_device_ready(vdev); | 1074 | virtio_device_ready(vdev); |
@@ -1130,9 +1147,10 @@ static void viommu_config_changed(struct virtio_device *vdev) | |||
1130 | 1147 | ||
1131 | static unsigned int features[] = { | 1148 | static unsigned int features[] = { |
1132 | VIRTIO_IOMMU_F_MAP_UNMAP, | 1149 | VIRTIO_IOMMU_F_MAP_UNMAP, |
1133 | VIRTIO_IOMMU_F_DOMAIN_BITS, | ||
1134 | VIRTIO_IOMMU_F_INPUT_RANGE, | 1150 | VIRTIO_IOMMU_F_INPUT_RANGE, |
1151 | VIRTIO_IOMMU_F_DOMAIN_RANGE, | ||
1135 | VIRTIO_IOMMU_F_PROBE, | 1152 | VIRTIO_IOMMU_F_PROBE, |
1153 | VIRTIO_IOMMU_F_MMIO, | ||
1136 | }; | 1154 | }; |
1137 | 1155 | ||
1138 | static struct virtio_device_id id_table[] = { | 1156 | static struct virtio_device_id id_table[] = { |
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index 26e374fbf57c..20ed838e9413 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c | |||
@@ -931,6 +931,9 @@ int bch_cached_dev_run(struct cached_dev *dc) | |||
931 | if (dc->io_disable) { | 931 | if (dc->io_disable) { |
932 | pr_err("I/O disabled on cached dev %s", | 932 | pr_err("I/O disabled on cached dev %s", |
933 | dc->backing_dev_name); | 933 | dc->backing_dev_name); |
934 | kfree(env[1]); | ||
935 | kfree(env[2]); | ||
936 | kfree(buf); | ||
934 | return -EIO; | 937 | return -EIO; |
935 | } | 938 | } |
936 | 939 | ||
diff --git a/drivers/misc/eeprom/Kconfig b/drivers/misc/eeprom/Kconfig index f88094719552..f2abe27010ef 100644 --- a/drivers/misc/eeprom/Kconfig +++ b/drivers/misc/eeprom/Kconfig | |||
@@ -5,6 +5,7 @@ config EEPROM_AT24 | |||
5 | tristate "I2C EEPROMs / RAMs / ROMs from most vendors" | 5 | tristate "I2C EEPROMs / RAMs / ROMs from most vendors" |
6 | depends on I2C && SYSFS | 6 | depends on I2C && SYSFS |
7 | select NVMEM | 7 | select NVMEM |
8 | select NVMEM_SYSFS | ||
8 | select REGMAP_I2C | 9 | select REGMAP_I2C |
9 | help | 10 | help |
10 | Enable this driver to get read/write support to most I2C EEPROMs | 11 | Enable this driver to get read/write support to most I2C EEPROMs |
@@ -34,6 +35,7 @@ config EEPROM_AT25 | |||
34 | tristate "SPI EEPROMs from most vendors" | 35 | tristate "SPI EEPROMs from most vendors" |
35 | depends on SPI && SYSFS | 36 | depends on SPI && SYSFS |
36 | select NVMEM | 37 | select NVMEM |
38 | select NVMEM_SYSFS | ||
37 | help | 39 | help |
38 | Enable this driver to get read/write support to most SPI EEPROMs, | 40 | Enable this driver to get read/write support to most SPI EEPROMs, |
39 | after you configure the board init code to know about each eeprom | 41 | after you configure the board init code to know about each eeprom |
@@ -80,6 +82,7 @@ config EEPROM_93XX46 | |||
80 | depends on SPI && SYSFS | 82 | depends on SPI && SYSFS |
81 | select REGMAP | 83 | select REGMAP |
82 | select NVMEM | 84 | select NVMEM |
85 | select NVMEM_SYSFS | ||
83 | help | 86 | help |
84 | Driver for the microwire EEPROM chipsets 93xx46x. The driver | 87 | Driver for the microwire EEPROM chipsets 93xx46x. The driver |
85 | supports both read and write commands and also the command to | 88 | supports both read and write commands and also the command to |
diff --git a/drivers/misc/habanalabs/goya/goya.c b/drivers/misc/habanalabs/goya/goya.c index 75294ec65257..1a2c062a57d4 100644 --- a/drivers/misc/habanalabs/goya/goya.c +++ b/drivers/misc/habanalabs/goya/goya.c | |||
@@ -695,8 +695,8 @@ static int goya_sw_init(struct hl_device *hdev) | |||
695 | goto free_dma_pool; | 695 | goto free_dma_pool; |
696 | } | 696 | } |
697 | 697 | ||
698 | dev_dbg(hdev->dev, "cpu accessible memory at bus address 0x%llx\n", | 698 | dev_dbg(hdev->dev, "cpu accessible memory at bus address %pad\n", |
699 | hdev->cpu_accessible_dma_address); | 699 | &hdev->cpu_accessible_dma_address); |
700 | 700 | ||
701 | hdev->cpu_accessible_dma_pool = gen_pool_create(ilog2(32), -1); | 701 | hdev->cpu_accessible_dma_pool = gen_pool_create(ilog2(32), -1); |
702 | if (!hdev->cpu_accessible_dma_pool) { | 702 | if (!hdev->cpu_accessible_dma_pool) { |
@@ -4449,7 +4449,6 @@ void goya_handle_eqe(struct hl_device *hdev, struct hl_eq_entry *eq_entry) | |||
4449 | case GOYA_ASYNC_EVENT_ID_AXI_ECC: | 4449 | case GOYA_ASYNC_EVENT_ID_AXI_ECC: |
4450 | case GOYA_ASYNC_EVENT_ID_L2_RAM_ECC: | 4450 | case GOYA_ASYNC_EVENT_ID_L2_RAM_ECC: |
4451 | case GOYA_ASYNC_EVENT_ID_PSOC_GPIO_05_SW_RESET: | 4451 | case GOYA_ASYNC_EVENT_ID_PSOC_GPIO_05_SW_RESET: |
4452 | case GOYA_ASYNC_EVENT_ID_PSOC_GPIO_10_VRHOT_ICRIT: | ||
4453 | goya_print_irq_info(hdev, event_type, false); | 4452 | goya_print_irq_info(hdev, event_type, false); |
4454 | hl_device_reset(hdev, true, false); | 4453 | hl_device_reset(hdev, true, false); |
4455 | break; | 4454 | break; |
@@ -4485,6 +4484,7 @@ void goya_handle_eqe(struct hl_device *hdev, struct hl_eq_entry *eq_entry) | |||
4485 | goya_unmask_irq(hdev, event_type); | 4484 | goya_unmask_irq(hdev, event_type); |
4486 | break; | 4485 | break; |
4487 | 4486 | ||
4487 | case GOYA_ASYNC_EVENT_ID_PSOC_GPIO_10_VRHOT_ICRIT: | ||
4488 | case GOYA_ASYNC_EVENT_ID_TPC0_BMON_SPMU: | 4488 | case GOYA_ASYNC_EVENT_ID_TPC0_BMON_SPMU: |
4489 | case GOYA_ASYNC_EVENT_ID_TPC1_BMON_SPMU: | 4489 | case GOYA_ASYNC_EVENT_ID_TPC1_BMON_SPMU: |
4490 | case GOYA_ASYNC_EVENT_ID_TPC2_BMON_SPMU: | 4490 | case GOYA_ASYNC_EVENT_ID_TPC2_BMON_SPMU: |
diff --git a/drivers/misc/mei/hw-me-regs.h b/drivers/misc/mei/hw-me-regs.h index d74b182e19f3..6c0173772162 100644 --- a/drivers/misc/mei/hw-me-regs.h +++ b/drivers/misc/mei/hw-me-regs.h | |||
@@ -81,6 +81,9 @@ | |||
81 | 81 | ||
82 | #define MEI_DEV_ID_ICP_LP 0x34E0 /* Ice Lake Point LP */ | 82 | #define MEI_DEV_ID_ICP_LP 0x34E0 /* Ice Lake Point LP */ |
83 | 83 | ||
84 | #define MEI_DEV_ID_MCC 0x4B70 /* Mule Creek Canyon (EHL) */ | ||
85 | #define MEI_DEV_ID_MCC_4 0x4B75 /* Mule Creek Canyon 4 (EHL) */ | ||
86 | |||
84 | /* | 87 | /* |
85 | * MEI HW Section | 88 | * MEI HW Section |
86 | */ | 89 | */ |
diff --git a/drivers/misc/mei/pci-me.c b/drivers/misc/mei/pci-me.c index 7a2b3545a7f9..57cb68f5cc64 100644 --- a/drivers/misc/mei/pci-me.c +++ b/drivers/misc/mei/pci-me.c | |||
@@ -98,6 +98,9 @@ static const struct pci_device_id mei_me_pci_tbl[] = { | |||
98 | 98 | ||
99 | {MEI_PCI_DEVICE(MEI_DEV_ID_ICP_LP, MEI_ME_PCH12_CFG)}, | 99 | {MEI_PCI_DEVICE(MEI_DEV_ID_ICP_LP, MEI_ME_PCH12_CFG)}, |
100 | 100 | ||
101 | {MEI_PCI_DEVICE(MEI_DEV_ID_MCC, MEI_ME_PCH12_CFG)}, | ||
102 | {MEI_PCI_DEVICE(MEI_DEV_ID_MCC_4, MEI_ME_PCH8_CFG)}, | ||
103 | |||
101 | /* required last entry */ | 104 | /* required last entry */ |
102 | {0, } | 105 | {0, } |
103 | }; | 106 | }; |
diff --git a/drivers/mtd/nand/onenand/onenand_base.c b/drivers/mtd/nand/onenand/onenand_base.c index a1f8fe1abb10..e082d632fb74 100644 --- a/drivers/mtd/nand/onenand/onenand_base.c +++ b/drivers/mtd/nand/onenand/onenand_base.c | |||
@@ -3259,6 +3259,7 @@ static void onenand_check_features(struct mtd_info *mtd) | |||
3259 | switch (density) { | 3259 | switch (density) { |
3260 | case ONENAND_DEVICE_DENSITY_8Gb: | 3260 | case ONENAND_DEVICE_DENSITY_8Gb: |
3261 | this->options |= ONENAND_HAS_NOP_1; | 3261 | this->options |= ONENAND_HAS_NOP_1; |
3262 | /* fall through */ | ||
3262 | case ONENAND_DEVICE_DENSITY_4Gb: | 3263 | case ONENAND_DEVICE_DENSITY_4Gb: |
3263 | if (ONENAND_IS_DDP(this)) | 3264 | if (ONENAND_IS_DDP(this)) |
3264 | this->options |= ONENAND_HAS_2PLANE; | 3265 | this->options |= ONENAND_HAS_2PLANE; |
diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c index 1d4075903971..c8e1a04ba384 100644 --- a/drivers/net/can/at91_can.c +++ b/drivers/net/can/at91_can.c | |||
@@ -898,7 +898,8 @@ static void at91_irq_err_state(struct net_device *dev, | |||
898 | CAN_ERR_CRTL_TX_WARNING : | 898 | CAN_ERR_CRTL_TX_WARNING : |
899 | CAN_ERR_CRTL_RX_WARNING; | 899 | CAN_ERR_CRTL_RX_WARNING; |
900 | } | 900 | } |
901 | case CAN_STATE_ERROR_WARNING: /* fallthrough */ | 901 | /* fall through */ |
902 | case CAN_STATE_ERROR_WARNING: | ||
902 | /* | 903 | /* |
903 | * from: ERROR_ACTIVE, ERROR_WARNING | 904 | * from: ERROR_ACTIVE, ERROR_WARNING |
904 | * to : ERROR_PASSIVE, BUS_OFF | 905 | * to : ERROR_PASSIVE, BUS_OFF |
@@ -947,7 +948,8 @@ static void at91_irq_err_state(struct net_device *dev, | |||
947 | netdev_dbg(dev, "Error Active\n"); | 948 | netdev_dbg(dev, "Error Active\n"); |
948 | cf->can_id |= CAN_ERR_PROT; | 949 | cf->can_id |= CAN_ERR_PROT; |
949 | cf->data[2] = CAN_ERR_PROT_ACTIVE; | 950 | cf->data[2] = CAN_ERR_PROT_ACTIVE; |
950 | case CAN_STATE_ERROR_WARNING: /* fallthrough */ | 951 | /* fall through */ |
952 | case CAN_STATE_ERROR_WARNING: | ||
951 | reg_idr = AT91_IRQ_ERRA | AT91_IRQ_WARN | AT91_IRQ_BOFF; | 953 | reg_idr = AT91_IRQ_ERRA | AT91_IRQ_WARN | AT91_IRQ_BOFF; |
952 | reg_ier = AT91_IRQ_ERRP; | 954 | reg_ier = AT91_IRQ_ERRP; |
953 | break; | 955 | break; |
diff --git a/drivers/net/can/peak_canfd/peak_pciefd_main.c b/drivers/net/can/peak_canfd/peak_pciefd_main.c index 7f6a3b971da9..13b10cbf236a 100644 --- a/drivers/net/can/peak_canfd/peak_pciefd_main.c +++ b/drivers/net/can/peak_canfd/peak_pciefd_main.c | |||
@@ -660,7 +660,7 @@ static int pciefd_can_probe(struct pciefd_board *pciefd) | |||
660 | pciefd_can_writereg(priv, CANFD_CLK_SEL_80MHZ, | 660 | pciefd_can_writereg(priv, CANFD_CLK_SEL_80MHZ, |
661 | PCIEFD_REG_CAN_CLK_SEL); | 661 | PCIEFD_REG_CAN_CLK_SEL); |
662 | 662 | ||
663 | /* fallthough */ | 663 | /* fall through */ |
664 | case CANFD_CLK_SEL_80MHZ: | 664 | case CANFD_CLK_SEL_80MHZ: |
665 | priv->ucan.can.clock.freq = 80 * 1000 * 1000; | 665 | priv->ucan.can.clock.freq = 80 * 1000 * 1000; |
666 | break; | 666 | break; |
diff --git a/drivers/net/can/spi/mcp251x.c b/drivers/net/can/spi/mcp251x.c index 44e99e3d7134..234cf1042df6 100644 --- a/drivers/net/can/spi/mcp251x.c +++ b/drivers/net/can/spi/mcp251x.c | |||
@@ -860,7 +860,8 @@ static irqreturn_t mcp251x_can_ist(int irq, void *dev_id) | |||
860 | if (new_state >= CAN_STATE_ERROR_WARNING && | 860 | if (new_state >= CAN_STATE_ERROR_WARNING && |
861 | new_state <= CAN_STATE_BUS_OFF) | 861 | new_state <= CAN_STATE_BUS_OFF) |
862 | priv->can.can_stats.error_warning++; | 862 | priv->can.can_stats.error_warning++; |
863 | case CAN_STATE_ERROR_WARNING: /* fallthrough */ | 863 | /* fall through */ |
864 | case CAN_STATE_ERROR_WARNING: | ||
864 | if (new_state >= CAN_STATE_ERROR_PASSIVE && | 865 | if (new_state >= CAN_STATE_ERROR_PASSIVE && |
865 | new_state <= CAN_STATE_BUS_OFF) | 866 | new_state <= CAN_STATE_BUS_OFF) |
866 | priv->can.can_stats.error_passive++; | 867 | priv->can.can_stats.error_passive++; |
diff --git a/drivers/net/can/usb/peak_usb/pcan_usb.c b/drivers/net/can/usb/peak_usb/pcan_usb.c index 15ce5ad1d632..617da295b6c1 100644 --- a/drivers/net/can/usb/peak_usb/pcan_usb.c +++ b/drivers/net/can/usb/peak_usb/pcan_usb.c | |||
@@ -415,7 +415,7 @@ static int pcan_usb_decode_error(struct pcan_usb_msg_context *mc, u8 n, | |||
415 | new_state = CAN_STATE_ERROR_WARNING; | 415 | new_state = CAN_STATE_ERROR_WARNING; |
416 | break; | 416 | break; |
417 | } | 417 | } |
418 | /* else: fall through */ | 418 | /* fall through */ |
419 | 419 | ||
420 | case CAN_STATE_ERROR_WARNING: | 420 | case CAN_STATE_ERROR_WARNING: |
421 | if (n & PCAN_USB_ERROR_BUS_HEAVY) { | 421 | if (n & PCAN_USB_ERROR_BUS_HEAVY) { |
diff --git a/drivers/nvdimm/btt_devs.c b/drivers/nvdimm/btt_devs.c index 62d00fffa4af..3508a79110c7 100644 --- a/drivers/nvdimm/btt_devs.c +++ b/drivers/nvdimm/btt_devs.c | |||
@@ -62,14 +62,14 @@ static ssize_t sector_size_store(struct device *dev, | |||
62 | struct nd_btt *nd_btt = to_nd_btt(dev); | 62 | struct nd_btt *nd_btt = to_nd_btt(dev); |
63 | ssize_t rc; | 63 | ssize_t rc; |
64 | 64 | ||
65 | device_lock(dev); | 65 | nd_device_lock(dev); |
66 | nvdimm_bus_lock(dev); | 66 | nvdimm_bus_lock(dev); |
67 | rc = nd_size_select_store(dev, buf, &nd_btt->lbasize, | 67 | rc = nd_size_select_store(dev, buf, &nd_btt->lbasize, |
68 | btt_lbasize_supported); | 68 | btt_lbasize_supported); |
69 | dev_dbg(dev, "result: %zd wrote: %s%s", rc, buf, | 69 | dev_dbg(dev, "result: %zd wrote: %s%s", rc, buf, |
70 | buf[len - 1] == '\n' ? "" : "\n"); | 70 | buf[len - 1] == '\n' ? "" : "\n"); |
71 | nvdimm_bus_unlock(dev); | 71 | nvdimm_bus_unlock(dev); |
72 | device_unlock(dev); | 72 | nd_device_unlock(dev); |
73 | 73 | ||
74 | return rc ? rc : len; | 74 | return rc ? rc : len; |
75 | } | 75 | } |
@@ -91,11 +91,11 @@ static ssize_t uuid_store(struct device *dev, | |||
91 | struct nd_btt *nd_btt = to_nd_btt(dev); | 91 | struct nd_btt *nd_btt = to_nd_btt(dev); |
92 | ssize_t rc; | 92 | ssize_t rc; |
93 | 93 | ||
94 | device_lock(dev); | 94 | nd_device_lock(dev); |
95 | rc = nd_uuid_store(dev, &nd_btt->uuid, buf, len); | 95 | rc = nd_uuid_store(dev, &nd_btt->uuid, buf, len); |
96 | dev_dbg(dev, "result: %zd wrote: %s%s", rc, buf, | 96 | dev_dbg(dev, "result: %zd wrote: %s%s", rc, buf, |
97 | buf[len - 1] == '\n' ? "" : "\n"); | 97 | buf[len - 1] == '\n' ? "" : "\n"); |
98 | device_unlock(dev); | 98 | nd_device_unlock(dev); |
99 | 99 | ||
100 | return rc ? rc : len; | 100 | return rc ? rc : len; |
101 | } | 101 | } |
@@ -120,13 +120,13 @@ static ssize_t namespace_store(struct device *dev, | |||
120 | struct nd_btt *nd_btt = to_nd_btt(dev); | 120 | struct nd_btt *nd_btt = to_nd_btt(dev); |
121 | ssize_t rc; | 121 | ssize_t rc; |
122 | 122 | ||
123 | device_lock(dev); | 123 | nd_device_lock(dev); |
124 | nvdimm_bus_lock(dev); | 124 | nvdimm_bus_lock(dev); |
125 | rc = nd_namespace_store(dev, &nd_btt->ndns, buf, len); | 125 | rc = nd_namespace_store(dev, &nd_btt->ndns, buf, len); |
126 | dev_dbg(dev, "result: %zd wrote: %s%s", rc, buf, | 126 | dev_dbg(dev, "result: %zd wrote: %s%s", rc, buf, |
127 | buf[len - 1] == '\n' ? "" : "\n"); | 127 | buf[len - 1] == '\n' ? "" : "\n"); |
128 | nvdimm_bus_unlock(dev); | 128 | nvdimm_bus_unlock(dev); |
129 | device_unlock(dev); | 129 | nd_device_unlock(dev); |
130 | 130 | ||
131 | return rc; | 131 | return rc; |
132 | } | 132 | } |
@@ -138,14 +138,14 @@ static ssize_t size_show(struct device *dev, | |||
138 | struct nd_btt *nd_btt = to_nd_btt(dev); | 138 | struct nd_btt *nd_btt = to_nd_btt(dev); |
139 | ssize_t rc; | 139 | ssize_t rc; |
140 | 140 | ||
141 | device_lock(dev); | 141 | nd_device_lock(dev); |
142 | if (dev->driver) | 142 | if (dev->driver) |
143 | rc = sprintf(buf, "%llu\n", nd_btt->size); | 143 | rc = sprintf(buf, "%llu\n", nd_btt->size); |
144 | else { | 144 | else { |
145 | /* no size to convey if the btt instance is disabled */ | 145 | /* no size to convey if the btt instance is disabled */ |
146 | rc = -ENXIO; | 146 | rc = -ENXIO; |
147 | } | 147 | } |
148 | device_unlock(dev); | 148 | nd_device_unlock(dev); |
149 | 149 | ||
150 | return rc; | 150 | return rc; |
151 | } | 151 | } |
diff --git a/drivers/nvdimm/bus.c b/drivers/nvdimm/bus.c index 2dca3034fee0..798c5c4aea9c 100644 --- a/drivers/nvdimm/bus.c +++ b/drivers/nvdimm/bus.c | |||
@@ -26,7 +26,7 @@ | |||
26 | 26 | ||
27 | int nvdimm_major; | 27 | int nvdimm_major; |
28 | static int nvdimm_bus_major; | 28 | static int nvdimm_bus_major; |
29 | static struct class *nd_class; | 29 | struct class *nd_class; |
30 | static DEFINE_IDA(nd_ida); | 30 | static DEFINE_IDA(nd_ida); |
31 | 31 | ||
32 | static int to_nd_device_type(struct device *dev) | 32 | static int to_nd_device_type(struct device *dev) |
@@ -73,7 +73,7 @@ static void nvdimm_bus_probe_end(struct nvdimm_bus *nvdimm_bus) | |||
73 | { | 73 | { |
74 | nvdimm_bus_lock(&nvdimm_bus->dev); | 74 | nvdimm_bus_lock(&nvdimm_bus->dev); |
75 | if (--nvdimm_bus->probe_active == 0) | 75 | if (--nvdimm_bus->probe_active == 0) |
76 | wake_up(&nvdimm_bus->probe_wait); | 76 | wake_up(&nvdimm_bus->wait); |
77 | nvdimm_bus_unlock(&nvdimm_bus->dev); | 77 | nvdimm_bus_unlock(&nvdimm_bus->dev); |
78 | } | 78 | } |
79 | 79 | ||
@@ -91,7 +91,10 @@ static int nvdimm_bus_probe(struct device *dev) | |||
91 | dev->driver->name, dev_name(dev)); | 91 | dev->driver->name, dev_name(dev)); |
92 | 92 | ||
93 | nvdimm_bus_probe_start(nvdimm_bus); | 93 | nvdimm_bus_probe_start(nvdimm_bus); |
94 | debug_nvdimm_lock(dev); | ||
94 | rc = nd_drv->probe(dev); | 95 | rc = nd_drv->probe(dev); |
96 | debug_nvdimm_unlock(dev); | ||
97 | |||
95 | if (rc == 0) | 98 | if (rc == 0) |
96 | nd_region_probe_success(nvdimm_bus, dev); | 99 | nd_region_probe_success(nvdimm_bus, dev); |
97 | else | 100 | else |
@@ -113,8 +116,11 @@ static int nvdimm_bus_remove(struct device *dev) | |||
113 | struct nvdimm_bus *nvdimm_bus = walk_to_nvdimm_bus(dev); | 116 | struct nvdimm_bus *nvdimm_bus = walk_to_nvdimm_bus(dev); |
114 | int rc = 0; | 117 | int rc = 0; |
115 | 118 | ||
116 | if (nd_drv->remove) | 119 | if (nd_drv->remove) { |
120 | debug_nvdimm_lock(dev); | ||
117 | rc = nd_drv->remove(dev); | 121 | rc = nd_drv->remove(dev); |
122 | debug_nvdimm_unlock(dev); | ||
123 | } | ||
118 | nd_region_disable(nvdimm_bus, dev); | 124 | nd_region_disable(nvdimm_bus, dev); |
119 | 125 | ||
120 | dev_dbg(&nvdimm_bus->dev, "%s.remove(%s) = %d\n", dev->driver->name, | 126 | dev_dbg(&nvdimm_bus->dev, "%s.remove(%s) = %d\n", dev->driver->name, |
@@ -140,7 +146,7 @@ static void nvdimm_bus_shutdown(struct device *dev) | |||
140 | 146 | ||
141 | void nd_device_notify(struct device *dev, enum nvdimm_event event) | 147 | void nd_device_notify(struct device *dev, enum nvdimm_event event) |
142 | { | 148 | { |
143 | device_lock(dev); | 149 | nd_device_lock(dev); |
144 | if (dev->driver) { | 150 | if (dev->driver) { |
145 | struct nd_device_driver *nd_drv; | 151 | struct nd_device_driver *nd_drv; |
146 | 152 | ||
@@ -148,7 +154,7 @@ void nd_device_notify(struct device *dev, enum nvdimm_event event) | |||
148 | if (nd_drv->notify) | 154 | if (nd_drv->notify) |
149 | nd_drv->notify(dev, event); | 155 | nd_drv->notify(dev, event); |
150 | } | 156 | } |
151 | device_unlock(dev); | 157 | nd_device_unlock(dev); |
152 | } | 158 | } |
153 | EXPORT_SYMBOL(nd_device_notify); | 159 | EXPORT_SYMBOL(nd_device_notify); |
154 | 160 | ||
@@ -296,7 +302,7 @@ static void nvdimm_bus_release(struct device *dev) | |||
296 | kfree(nvdimm_bus); | 302 | kfree(nvdimm_bus); |
297 | } | 303 | } |
298 | 304 | ||
299 | static bool is_nvdimm_bus(struct device *dev) | 305 | bool is_nvdimm_bus(struct device *dev) |
300 | { | 306 | { |
301 | return dev->release == nvdimm_bus_release; | 307 | return dev->release == nvdimm_bus_release; |
302 | } | 308 | } |
@@ -341,7 +347,7 @@ struct nvdimm_bus *nvdimm_bus_register(struct device *parent, | |||
341 | return NULL; | 347 | return NULL; |
342 | INIT_LIST_HEAD(&nvdimm_bus->list); | 348 | INIT_LIST_HEAD(&nvdimm_bus->list); |
343 | INIT_LIST_HEAD(&nvdimm_bus->mapping_list); | 349 | INIT_LIST_HEAD(&nvdimm_bus->mapping_list); |
344 | init_waitqueue_head(&nvdimm_bus->probe_wait); | 350 | init_waitqueue_head(&nvdimm_bus->wait); |
345 | nvdimm_bus->id = ida_simple_get(&nd_ida, 0, 0, GFP_KERNEL); | 351 | nvdimm_bus->id = ida_simple_get(&nd_ida, 0, 0, GFP_KERNEL); |
346 | if (nvdimm_bus->id < 0) { | 352 | if (nvdimm_bus->id < 0) { |
347 | kfree(nvdimm_bus); | 353 | kfree(nvdimm_bus); |
@@ -426,6 +432,9 @@ static int nd_bus_remove(struct device *dev) | |||
426 | list_del_init(&nvdimm_bus->list); | 432 | list_del_init(&nvdimm_bus->list); |
427 | mutex_unlock(&nvdimm_bus_list_mutex); | 433 | mutex_unlock(&nvdimm_bus_list_mutex); |
428 | 434 | ||
435 | wait_event(nvdimm_bus->wait, | ||
436 | atomic_read(&nvdimm_bus->ioctl_active) == 0); | ||
437 | |||
429 | nd_synchronize(); | 438 | nd_synchronize(); |
430 | device_for_each_child(&nvdimm_bus->dev, NULL, child_unregister); | 439 | device_for_each_child(&nvdimm_bus->dev, NULL, child_unregister); |
431 | 440 | ||
@@ -547,13 +556,38 @@ EXPORT_SYMBOL(nd_device_register); | |||
547 | 556 | ||
548 | void nd_device_unregister(struct device *dev, enum nd_async_mode mode) | 557 | void nd_device_unregister(struct device *dev, enum nd_async_mode mode) |
549 | { | 558 | { |
559 | bool killed; | ||
560 | |||
550 | switch (mode) { | 561 | switch (mode) { |
551 | case ND_ASYNC: | 562 | case ND_ASYNC: |
563 | /* | ||
564 | * In the async case this is being triggered with the | ||
565 | * device lock held and the unregistration work needs to | ||
566 | * be moved out of line iff this is thread has won the | ||
567 | * race to schedule the deletion. | ||
568 | */ | ||
569 | if (!kill_device(dev)) | ||
570 | return; | ||
571 | |||
552 | get_device(dev); | 572 | get_device(dev); |
553 | async_schedule_domain(nd_async_device_unregister, dev, | 573 | async_schedule_domain(nd_async_device_unregister, dev, |
554 | &nd_async_domain); | 574 | &nd_async_domain); |
555 | break; | 575 | break; |
556 | case ND_SYNC: | 576 | case ND_SYNC: |
577 | /* | ||
578 | * In the sync case the device is being unregistered due | ||
579 | * to a state change of the parent. Claim the kill state | ||
580 | * to synchronize against other unregistration requests, | ||
581 | * or otherwise let the async path handle it if the | ||
582 | * unregistration was already queued. | ||
583 | */ | ||
584 | nd_device_lock(dev); | ||
585 | killed = kill_device(dev); | ||
586 | nd_device_unlock(dev); | ||
587 | |||
588 | if (!killed) | ||
589 | return; | ||
590 | |||
557 | nd_synchronize(); | 591 | nd_synchronize(); |
558 | device_unregister(dev); | 592 | device_unregister(dev); |
559 | break; | 593 | break; |
@@ -859,10 +893,12 @@ void wait_nvdimm_bus_probe_idle(struct device *dev) | |||
859 | do { | 893 | do { |
860 | if (nvdimm_bus->probe_active == 0) | 894 | if (nvdimm_bus->probe_active == 0) |
861 | break; | 895 | break; |
862 | nvdimm_bus_unlock(&nvdimm_bus->dev); | 896 | nvdimm_bus_unlock(dev); |
863 | wait_event(nvdimm_bus->probe_wait, | 897 | nd_device_unlock(dev); |
898 | wait_event(nvdimm_bus->wait, | ||
864 | nvdimm_bus->probe_active == 0); | 899 | nvdimm_bus->probe_active == 0); |
865 | nvdimm_bus_lock(&nvdimm_bus->dev); | 900 | nd_device_lock(dev); |
901 | nvdimm_bus_lock(dev); | ||
866 | } while (true); | 902 | } while (true); |
867 | } | 903 | } |
868 | 904 | ||
@@ -945,20 +981,19 @@ static int __nd_ioctl(struct nvdimm_bus *nvdimm_bus, struct nvdimm *nvdimm, | |||
945 | int read_only, unsigned int ioctl_cmd, unsigned long arg) | 981 | int read_only, unsigned int ioctl_cmd, unsigned long arg) |
946 | { | 982 | { |
947 | struct nvdimm_bus_descriptor *nd_desc = nvdimm_bus->nd_desc; | 983 | struct nvdimm_bus_descriptor *nd_desc = nvdimm_bus->nd_desc; |
948 | static char out_env[ND_CMD_MAX_ENVELOPE]; | ||
949 | static char in_env[ND_CMD_MAX_ENVELOPE]; | ||
950 | const struct nd_cmd_desc *desc = NULL; | 984 | const struct nd_cmd_desc *desc = NULL; |
951 | unsigned int cmd = _IOC_NR(ioctl_cmd); | 985 | unsigned int cmd = _IOC_NR(ioctl_cmd); |
952 | struct device *dev = &nvdimm_bus->dev; | 986 | struct device *dev = &nvdimm_bus->dev; |
953 | void __user *p = (void __user *) arg; | 987 | void __user *p = (void __user *) arg; |
988 | char *out_env = NULL, *in_env = NULL; | ||
954 | const char *cmd_name, *dimm_name; | 989 | const char *cmd_name, *dimm_name; |
955 | u32 in_len = 0, out_len = 0; | 990 | u32 in_len = 0, out_len = 0; |
956 | unsigned int func = cmd; | 991 | unsigned int func = cmd; |
957 | unsigned long cmd_mask; | 992 | unsigned long cmd_mask; |
958 | struct nd_cmd_pkg pkg; | 993 | struct nd_cmd_pkg pkg; |
959 | int rc, i, cmd_rc; | 994 | int rc, i, cmd_rc; |
995 | void *buf = NULL; | ||
960 | u64 buf_len = 0; | 996 | u64 buf_len = 0; |
961 | void *buf; | ||
962 | 997 | ||
963 | if (nvdimm) { | 998 | if (nvdimm) { |
964 | desc = nd_cmd_dimm_desc(cmd); | 999 | desc = nd_cmd_dimm_desc(cmd); |
@@ -989,7 +1024,7 @@ static int __nd_ioctl(struct nvdimm_bus *nvdimm_bus, struct nvdimm *nvdimm, | |||
989 | case ND_CMD_ARS_START: | 1024 | case ND_CMD_ARS_START: |
990 | case ND_CMD_CLEAR_ERROR: | 1025 | case ND_CMD_CLEAR_ERROR: |
991 | case ND_CMD_CALL: | 1026 | case ND_CMD_CALL: |
992 | dev_dbg(&nvdimm_bus->dev, "'%s' command while read-only.\n", | 1027 | dev_dbg(dev, "'%s' command while read-only.\n", |
993 | nvdimm ? nvdimm_cmd_name(cmd) | 1028 | nvdimm ? nvdimm_cmd_name(cmd) |
994 | : nvdimm_bus_cmd_name(cmd)); | 1029 | : nvdimm_bus_cmd_name(cmd)); |
995 | return -EPERM; | 1030 | return -EPERM; |
@@ -998,6 +1033,9 @@ static int __nd_ioctl(struct nvdimm_bus *nvdimm_bus, struct nvdimm *nvdimm, | |||
998 | } | 1033 | } |
999 | 1034 | ||
1000 | /* process an input envelope */ | 1035 | /* process an input envelope */ |
1036 | in_env = kzalloc(ND_CMD_MAX_ENVELOPE, GFP_KERNEL); | ||
1037 | if (!in_env) | ||
1038 | return -ENOMEM; | ||
1001 | for (i = 0; i < desc->in_num; i++) { | 1039 | for (i = 0; i < desc->in_num; i++) { |
1002 | u32 in_size, copy; | 1040 | u32 in_size, copy; |
1003 | 1041 | ||
@@ -1005,14 +1043,17 @@ static int __nd_ioctl(struct nvdimm_bus *nvdimm_bus, struct nvdimm *nvdimm, | |||
1005 | if (in_size == UINT_MAX) { | 1043 | if (in_size == UINT_MAX) { |
1006 | dev_err(dev, "%s:%s unknown input size cmd: %s field: %d\n", | 1044 | dev_err(dev, "%s:%s unknown input size cmd: %s field: %d\n", |
1007 | __func__, dimm_name, cmd_name, i); | 1045 | __func__, dimm_name, cmd_name, i); |
1008 | return -ENXIO; | 1046 | rc = -ENXIO; |
1047 | goto out; | ||
1009 | } | 1048 | } |
1010 | if (in_len < sizeof(in_env)) | 1049 | if (in_len < ND_CMD_MAX_ENVELOPE) |
1011 | copy = min_t(u32, sizeof(in_env) - in_len, in_size); | 1050 | copy = min_t(u32, ND_CMD_MAX_ENVELOPE - in_len, in_size); |
1012 | else | 1051 | else |
1013 | copy = 0; | 1052 | copy = 0; |
1014 | if (copy && copy_from_user(&in_env[in_len], p + in_len, copy)) | 1053 | if (copy && copy_from_user(&in_env[in_len], p + in_len, copy)) { |
1015 | return -EFAULT; | 1054 | rc = -EFAULT; |
1055 | goto out; | ||
1056 | } | ||
1016 | in_len += in_size; | 1057 | in_len += in_size; |
1017 | } | 1058 | } |
1018 | 1059 | ||
@@ -1024,6 +1065,12 @@ static int __nd_ioctl(struct nvdimm_bus *nvdimm_bus, struct nvdimm *nvdimm, | |||
1024 | } | 1065 | } |
1025 | 1066 | ||
1026 | /* process an output envelope */ | 1067 | /* process an output envelope */ |
1068 | out_env = kzalloc(ND_CMD_MAX_ENVELOPE, GFP_KERNEL); | ||
1069 | if (!out_env) { | ||
1070 | rc = -ENOMEM; | ||
1071 | goto out; | ||
1072 | } | ||
1073 | |||
1027 | for (i = 0; i < desc->out_num; i++) { | 1074 | for (i = 0; i < desc->out_num; i++) { |
1028 | u32 out_size = nd_cmd_out_size(nvdimm, cmd, desc, i, | 1075 | u32 out_size = nd_cmd_out_size(nvdimm, cmd, desc, i, |
1029 | (u32 *) in_env, (u32 *) out_env, 0); | 1076 | (u32 *) in_env, (u32 *) out_env, 0); |
@@ -1032,15 +1079,18 @@ static int __nd_ioctl(struct nvdimm_bus *nvdimm_bus, struct nvdimm *nvdimm, | |||
1032 | if (out_size == UINT_MAX) { | 1079 | if (out_size == UINT_MAX) { |
1033 | dev_dbg(dev, "%s unknown output size cmd: %s field: %d\n", | 1080 | dev_dbg(dev, "%s unknown output size cmd: %s field: %d\n", |
1034 | dimm_name, cmd_name, i); | 1081 | dimm_name, cmd_name, i); |
1035 | return -EFAULT; | 1082 | rc = -EFAULT; |
1083 | goto out; | ||
1036 | } | 1084 | } |
1037 | if (out_len < sizeof(out_env)) | 1085 | if (out_len < ND_CMD_MAX_ENVELOPE) |
1038 | copy = min_t(u32, sizeof(out_env) - out_len, out_size); | 1086 | copy = min_t(u32, ND_CMD_MAX_ENVELOPE - out_len, out_size); |
1039 | else | 1087 | else |
1040 | copy = 0; | 1088 | copy = 0; |
1041 | if (copy && copy_from_user(&out_env[out_len], | 1089 | if (copy && copy_from_user(&out_env[out_len], |
1042 | p + in_len + out_len, copy)) | 1090 | p + in_len + out_len, copy)) { |
1043 | return -EFAULT; | 1091 | rc = -EFAULT; |
1092 | goto out; | ||
1093 | } | ||
1044 | out_len += out_size; | 1094 | out_len += out_size; |
1045 | } | 1095 | } |
1046 | 1096 | ||
@@ -1048,19 +1098,23 @@ static int __nd_ioctl(struct nvdimm_bus *nvdimm_bus, struct nvdimm *nvdimm, | |||
1048 | if (buf_len > ND_IOCTL_MAX_BUFLEN) { | 1098 | if (buf_len > ND_IOCTL_MAX_BUFLEN) { |
1049 | dev_dbg(dev, "%s cmd: %s buf_len: %llu > %d\n", dimm_name, | 1099 | dev_dbg(dev, "%s cmd: %s buf_len: %llu > %d\n", dimm_name, |
1050 | cmd_name, buf_len, ND_IOCTL_MAX_BUFLEN); | 1100 | cmd_name, buf_len, ND_IOCTL_MAX_BUFLEN); |
1051 | return -EINVAL; | 1101 | rc = -EINVAL; |
1102 | goto out; | ||
1052 | } | 1103 | } |
1053 | 1104 | ||
1054 | buf = vmalloc(buf_len); | 1105 | buf = vmalloc(buf_len); |
1055 | if (!buf) | 1106 | if (!buf) { |
1056 | return -ENOMEM; | 1107 | rc = -ENOMEM; |
1108 | goto out; | ||
1109 | } | ||
1057 | 1110 | ||
1058 | if (copy_from_user(buf, p, buf_len)) { | 1111 | if (copy_from_user(buf, p, buf_len)) { |
1059 | rc = -EFAULT; | 1112 | rc = -EFAULT; |
1060 | goto out; | 1113 | goto out; |
1061 | } | 1114 | } |
1062 | 1115 | ||
1063 | nvdimm_bus_lock(&nvdimm_bus->dev); | 1116 | nd_device_lock(dev); |
1117 | nvdimm_bus_lock(dev); | ||
1064 | rc = nd_cmd_clear_to_send(nvdimm_bus, nvdimm, func, buf); | 1118 | rc = nd_cmd_clear_to_send(nvdimm_bus, nvdimm, func, buf); |
1065 | if (rc) | 1119 | if (rc) |
1066 | goto out_unlock; | 1120 | goto out_unlock; |
@@ -1075,39 +1129,24 @@ static int __nd_ioctl(struct nvdimm_bus *nvdimm_bus, struct nvdimm *nvdimm, | |||
1075 | nvdimm_account_cleared_poison(nvdimm_bus, clear_err->address, | 1129 | nvdimm_account_cleared_poison(nvdimm_bus, clear_err->address, |
1076 | clear_err->cleared); | 1130 | clear_err->cleared); |
1077 | } | 1131 | } |
1078 | nvdimm_bus_unlock(&nvdimm_bus->dev); | ||
1079 | 1132 | ||
1080 | if (copy_to_user(p, buf, buf_len)) | 1133 | if (copy_to_user(p, buf, buf_len)) |
1081 | rc = -EFAULT; | 1134 | rc = -EFAULT; |
1082 | 1135 | ||
1083 | vfree(buf); | 1136 | out_unlock: |
1084 | return rc; | 1137 | nvdimm_bus_unlock(dev); |
1085 | 1138 | nd_device_unlock(dev); | |
1086 | out_unlock: | 1139 | out: |
1087 | nvdimm_bus_unlock(&nvdimm_bus->dev); | 1140 | kfree(in_env); |
1088 | out: | 1141 | kfree(out_env); |
1089 | vfree(buf); | 1142 | vfree(buf); |
1090 | return rc; | 1143 | return rc; |
1091 | } | 1144 | } |
1092 | 1145 | ||
1093 | static long nd_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | 1146 | enum nd_ioctl_mode { |
1094 | { | 1147 | BUS_IOCTL, |
1095 | long id = (long) file->private_data; | 1148 | DIMM_IOCTL, |
1096 | int rc = -ENXIO, ro; | 1149 | }; |
1097 | struct nvdimm_bus *nvdimm_bus; | ||
1098 | |||
1099 | ro = ((file->f_flags & O_ACCMODE) == O_RDONLY); | ||
1100 | mutex_lock(&nvdimm_bus_list_mutex); | ||
1101 | list_for_each_entry(nvdimm_bus, &nvdimm_bus_list, list) { | ||
1102 | if (nvdimm_bus->id == id) { | ||
1103 | rc = __nd_ioctl(nvdimm_bus, NULL, ro, cmd, arg); | ||
1104 | break; | ||
1105 | } | ||
1106 | } | ||
1107 | mutex_unlock(&nvdimm_bus_list_mutex); | ||
1108 | |||
1109 | return rc; | ||
1110 | } | ||
1111 | 1150 | ||
1112 | static int match_dimm(struct device *dev, void *data) | 1151 | static int match_dimm(struct device *dev, void *data) |
1113 | { | 1152 | { |
@@ -1122,31 +1161,62 @@ static int match_dimm(struct device *dev, void *data) | |||
1122 | return 0; | 1161 | return 0; |
1123 | } | 1162 | } |
1124 | 1163 | ||
1125 | static long nvdimm_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | 1164 | static long nd_ioctl(struct file *file, unsigned int cmd, unsigned long arg, |
1165 | enum nd_ioctl_mode mode) | ||
1166 | |||
1126 | { | 1167 | { |
1127 | int rc = -ENXIO, ro; | 1168 | struct nvdimm_bus *nvdimm_bus, *found = NULL; |
1128 | struct nvdimm_bus *nvdimm_bus; | 1169 | long id = (long) file->private_data; |
1170 | struct nvdimm *nvdimm = NULL; | ||
1171 | int rc, ro; | ||
1129 | 1172 | ||
1130 | ro = ((file->f_flags & O_ACCMODE) == O_RDONLY); | 1173 | ro = ((file->f_flags & O_ACCMODE) == O_RDONLY); |
1131 | mutex_lock(&nvdimm_bus_list_mutex); | 1174 | mutex_lock(&nvdimm_bus_list_mutex); |
1132 | list_for_each_entry(nvdimm_bus, &nvdimm_bus_list, list) { | 1175 | list_for_each_entry(nvdimm_bus, &nvdimm_bus_list, list) { |
1133 | struct device *dev = device_find_child(&nvdimm_bus->dev, | 1176 | if (mode == DIMM_IOCTL) { |
1134 | file->private_data, match_dimm); | 1177 | struct device *dev; |
1135 | struct nvdimm *nvdimm; | 1178 | |
1136 | 1179 | dev = device_find_child(&nvdimm_bus->dev, | |
1137 | if (!dev) | 1180 | file->private_data, match_dimm); |
1138 | continue; | 1181 | if (!dev) |
1182 | continue; | ||
1183 | nvdimm = to_nvdimm(dev); | ||
1184 | found = nvdimm_bus; | ||
1185 | } else if (nvdimm_bus->id == id) { | ||
1186 | found = nvdimm_bus; | ||
1187 | } | ||
1139 | 1188 | ||
1140 | nvdimm = to_nvdimm(dev); | 1189 | if (found) { |
1141 | rc = __nd_ioctl(nvdimm_bus, nvdimm, ro, cmd, arg); | 1190 | atomic_inc(&nvdimm_bus->ioctl_active); |
1142 | put_device(dev); | 1191 | break; |
1143 | break; | 1192 | } |
1144 | } | 1193 | } |
1145 | mutex_unlock(&nvdimm_bus_list_mutex); | 1194 | mutex_unlock(&nvdimm_bus_list_mutex); |
1146 | 1195 | ||
1196 | if (!found) | ||
1197 | return -ENXIO; | ||
1198 | |||
1199 | nvdimm_bus = found; | ||
1200 | rc = __nd_ioctl(nvdimm_bus, nvdimm, ro, cmd, arg); | ||
1201 | |||
1202 | if (nvdimm) | ||
1203 | put_device(&nvdimm->dev); | ||
1204 | if (atomic_dec_and_test(&nvdimm_bus->ioctl_active)) | ||
1205 | wake_up(&nvdimm_bus->wait); | ||
1206 | |||
1147 | return rc; | 1207 | return rc; |
1148 | } | 1208 | } |
1149 | 1209 | ||
1210 | static long bus_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | ||
1211 | { | ||
1212 | return nd_ioctl(file, cmd, arg, BUS_IOCTL); | ||
1213 | } | ||
1214 | |||
1215 | static long dimm_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | ||
1216 | { | ||
1217 | return nd_ioctl(file, cmd, arg, DIMM_IOCTL); | ||
1218 | } | ||
1219 | |||
1150 | static int nd_open(struct inode *inode, struct file *file) | 1220 | static int nd_open(struct inode *inode, struct file *file) |
1151 | { | 1221 | { |
1152 | long minor = iminor(inode); | 1222 | long minor = iminor(inode); |
@@ -1158,16 +1228,16 @@ static int nd_open(struct inode *inode, struct file *file) | |||
1158 | static const struct file_operations nvdimm_bus_fops = { | 1228 | static const struct file_operations nvdimm_bus_fops = { |
1159 | .owner = THIS_MODULE, | 1229 | .owner = THIS_MODULE, |
1160 | .open = nd_open, | 1230 | .open = nd_open, |
1161 | .unlocked_ioctl = nd_ioctl, | 1231 | .unlocked_ioctl = bus_ioctl, |
1162 | .compat_ioctl = nd_ioctl, | 1232 | .compat_ioctl = bus_ioctl, |
1163 | .llseek = noop_llseek, | 1233 | .llseek = noop_llseek, |
1164 | }; | 1234 | }; |
1165 | 1235 | ||
1166 | static const struct file_operations nvdimm_fops = { | 1236 | static const struct file_operations nvdimm_fops = { |
1167 | .owner = THIS_MODULE, | 1237 | .owner = THIS_MODULE, |
1168 | .open = nd_open, | 1238 | .open = nd_open, |
1169 | .unlocked_ioctl = nvdimm_ioctl, | 1239 | .unlocked_ioctl = dimm_ioctl, |
1170 | .compat_ioctl = nvdimm_ioctl, | 1240 | .compat_ioctl = dimm_ioctl, |
1171 | .llseek = noop_llseek, | 1241 | .llseek = noop_llseek, |
1172 | }; | 1242 | }; |
1173 | 1243 | ||
diff --git a/drivers/nvdimm/core.c b/drivers/nvdimm/core.c index 5e1f060547bf..9204f1e9fd14 100644 --- a/drivers/nvdimm/core.c +++ b/drivers/nvdimm/core.c | |||
@@ -246,7 +246,7 @@ static int nd_uuid_parse(struct device *dev, u8 *uuid_out, const char *buf, | |||
246 | * | 246 | * |
247 | * Enforce that uuids can only be changed while the device is disabled | 247 | * Enforce that uuids can only be changed while the device is disabled |
248 | * (driver detached) | 248 | * (driver detached) |
249 | * LOCKING: expects device_lock() is held on entry | 249 | * LOCKING: expects nd_device_lock() is held on entry |
250 | */ | 250 | */ |
251 | int nd_uuid_store(struct device *dev, u8 **uuid_out, const char *buf, | 251 | int nd_uuid_store(struct device *dev, u8 **uuid_out, const char *buf, |
252 | size_t len) | 252 | size_t len) |
@@ -347,15 +347,15 @@ static DEVICE_ATTR_RO(provider); | |||
347 | 347 | ||
348 | static int flush_namespaces(struct device *dev, void *data) | 348 | static int flush_namespaces(struct device *dev, void *data) |
349 | { | 349 | { |
350 | device_lock(dev); | 350 | nd_device_lock(dev); |
351 | device_unlock(dev); | 351 | nd_device_unlock(dev); |
352 | return 0; | 352 | return 0; |
353 | } | 353 | } |
354 | 354 | ||
355 | static int flush_regions_dimms(struct device *dev, void *data) | 355 | static int flush_regions_dimms(struct device *dev, void *data) |
356 | { | 356 | { |
357 | device_lock(dev); | 357 | nd_device_lock(dev); |
358 | device_unlock(dev); | 358 | nd_device_unlock(dev); |
359 | device_for_each_child(dev, NULL, flush_namespaces); | 359 | device_for_each_child(dev, NULL, flush_namespaces); |
360 | return 0; | 360 | return 0; |
361 | } | 361 | } |
diff --git a/drivers/nvdimm/dimm_devs.c b/drivers/nvdimm/dimm_devs.c index dfecd6e17043..29a065e769ea 100644 --- a/drivers/nvdimm/dimm_devs.c +++ b/drivers/nvdimm/dimm_devs.c | |||
@@ -484,12 +484,12 @@ static ssize_t security_store(struct device *dev, | |||
484 | * done while probing is idle and the DIMM is not in active use | 484 | * done while probing is idle and the DIMM is not in active use |
485 | * in any region. | 485 | * in any region. |
486 | */ | 486 | */ |
487 | device_lock(dev); | 487 | nd_device_lock(dev); |
488 | nvdimm_bus_lock(dev); | 488 | nvdimm_bus_lock(dev); |
489 | wait_nvdimm_bus_probe_idle(dev); | 489 | wait_nvdimm_bus_probe_idle(dev); |
490 | rc = __security_store(dev, buf, len); | 490 | rc = __security_store(dev, buf, len); |
491 | nvdimm_bus_unlock(dev); | 491 | nvdimm_bus_unlock(dev); |
492 | device_unlock(dev); | 492 | nd_device_unlock(dev); |
493 | 493 | ||
494 | return rc; | 494 | return rc; |
495 | } | 495 | } |
diff --git a/drivers/nvdimm/namespace_devs.c b/drivers/nvdimm/namespace_devs.c index 2d8d7e554877..a16e52251a30 100644 --- a/drivers/nvdimm/namespace_devs.c +++ b/drivers/nvdimm/namespace_devs.c | |||
@@ -410,7 +410,7 @@ static ssize_t alt_name_store(struct device *dev, | |||
410 | struct nd_region *nd_region = to_nd_region(dev->parent); | 410 | struct nd_region *nd_region = to_nd_region(dev->parent); |
411 | ssize_t rc; | 411 | ssize_t rc; |
412 | 412 | ||
413 | device_lock(dev); | 413 | nd_device_lock(dev); |
414 | nvdimm_bus_lock(dev); | 414 | nvdimm_bus_lock(dev); |
415 | wait_nvdimm_bus_probe_idle(dev); | 415 | wait_nvdimm_bus_probe_idle(dev); |
416 | rc = __alt_name_store(dev, buf, len); | 416 | rc = __alt_name_store(dev, buf, len); |
@@ -418,7 +418,7 @@ static ssize_t alt_name_store(struct device *dev, | |||
418 | rc = nd_namespace_label_update(nd_region, dev); | 418 | rc = nd_namespace_label_update(nd_region, dev); |
419 | dev_dbg(dev, "%s(%zd)\n", rc < 0 ? "fail " : "", rc); | 419 | dev_dbg(dev, "%s(%zd)\n", rc < 0 ? "fail " : "", rc); |
420 | nvdimm_bus_unlock(dev); | 420 | nvdimm_bus_unlock(dev); |
421 | device_unlock(dev); | 421 | nd_device_unlock(dev); |
422 | 422 | ||
423 | return rc < 0 ? rc : len; | 423 | return rc < 0 ? rc : len; |
424 | } | 424 | } |
@@ -1077,7 +1077,7 @@ static ssize_t size_store(struct device *dev, | |||
1077 | if (rc) | 1077 | if (rc) |
1078 | return rc; | 1078 | return rc; |
1079 | 1079 | ||
1080 | device_lock(dev); | 1080 | nd_device_lock(dev); |
1081 | nvdimm_bus_lock(dev); | 1081 | nvdimm_bus_lock(dev); |
1082 | wait_nvdimm_bus_probe_idle(dev); | 1082 | wait_nvdimm_bus_probe_idle(dev); |
1083 | rc = __size_store(dev, val); | 1083 | rc = __size_store(dev, val); |
@@ -1103,7 +1103,7 @@ static ssize_t size_store(struct device *dev, | |||
1103 | dev_dbg(dev, "%llx %s (%d)\n", val, rc < 0 ? "fail" : "success", rc); | 1103 | dev_dbg(dev, "%llx %s (%d)\n", val, rc < 0 ? "fail" : "success", rc); |
1104 | 1104 | ||
1105 | nvdimm_bus_unlock(dev); | 1105 | nvdimm_bus_unlock(dev); |
1106 | device_unlock(dev); | 1106 | nd_device_unlock(dev); |
1107 | 1107 | ||
1108 | return rc < 0 ? rc : len; | 1108 | return rc < 0 ? rc : len; |
1109 | } | 1109 | } |
@@ -1286,7 +1286,7 @@ static ssize_t uuid_store(struct device *dev, | |||
1286 | } else | 1286 | } else |
1287 | return -ENXIO; | 1287 | return -ENXIO; |
1288 | 1288 | ||
1289 | device_lock(dev); | 1289 | nd_device_lock(dev); |
1290 | nvdimm_bus_lock(dev); | 1290 | nvdimm_bus_lock(dev); |
1291 | wait_nvdimm_bus_probe_idle(dev); | 1291 | wait_nvdimm_bus_probe_idle(dev); |
1292 | if (to_ndns(dev)->claim) | 1292 | if (to_ndns(dev)->claim) |
@@ -1302,7 +1302,7 @@ static ssize_t uuid_store(struct device *dev, | |||
1302 | dev_dbg(dev, "result: %zd wrote: %s%s", rc, buf, | 1302 | dev_dbg(dev, "result: %zd wrote: %s%s", rc, buf, |
1303 | buf[len - 1] == '\n' ? "" : "\n"); | 1303 | buf[len - 1] == '\n' ? "" : "\n"); |
1304 | nvdimm_bus_unlock(dev); | 1304 | nvdimm_bus_unlock(dev); |
1305 | device_unlock(dev); | 1305 | nd_device_unlock(dev); |
1306 | 1306 | ||
1307 | return rc < 0 ? rc : len; | 1307 | return rc < 0 ? rc : len; |
1308 | } | 1308 | } |
@@ -1376,7 +1376,7 @@ static ssize_t sector_size_store(struct device *dev, | |||
1376 | } else | 1376 | } else |
1377 | return -ENXIO; | 1377 | return -ENXIO; |
1378 | 1378 | ||
1379 | device_lock(dev); | 1379 | nd_device_lock(dev); |
1380 | nvdimm_bus_lock(dev); | 1380 | nvdimm_bus_lock(dev); |
1381 | if (to_ndns(dev)->claim) | 1381 | if (to_ndns(dev)->claim) |
1382 | rc = -EBUSY; | 1382 | rc = -EBUSY; |
@@ -1387,7 +1387,7 @@ static ssize_t sector_size_store(struct device *dev, | |||
1387 | dev_dbg(dev, "result: %zd %s: %s%s", rc, rc < 0 ? "tried" : "wrote", | 1387 | dev_dbg(dev, "result: %zd %s: %s%s", rc, rc < 0 ? "tried" : "wrote", |
1388 | buf, buf[len - 1] == '\n' ? "" : "\n"); | 1388 | buf, buf[len - 1] == '\n' ? "" : "\n"); |
1389 | nvdimm_bus_unlock(dev); | 1389 | nvdimm_bus_unlock(dev); |
1390 | device_unlock(dev); | 1390 | nd_device_unlock(dev); |
1391 | 1391 | ||
1392 | return rc ? rc : len; | 1392 | return rc ? rc : len; |
1393 | } | 1393 | } |
@@ -1502,9 +1502,9 @@ static ssize_t holder_show(struct device *dev, | |||
1502 | struct nd_namespace_common *ndns = to_ndns(dev); | 1502 | struct nd_namespace_common *ndns = to_ndns(dev); |
1503 | ssize_t rc; | 1503 | ssize_t rc; |
1504 | 1504 | ||
1505 | device_lock(dev); | 1505 | nd_device_lock(dev); |
1506 | rc = sprintf(buf, "%s\n", ndns->claim ? dev_name(ndns->claim) : ""); | 1506 | rc = sprintf(buf, "%s\n", ndns->claim ? dev_name(ndns->claim) : ""); |
1507 | device_unlock(dev); | 1507 | nd_device_unlock(dev); |
1508 | 1508 | ||
1509 | return rc; | 1509 | return rc; |
1510 | } | 1510 | } |
@@ -1541,7 +1541,7 @@ static ssize_t holder_class_store(struct device *dev, | |||
1541 | struct nd_region *nd_region = to_nd_region(dev->parent); | 1541 | struct nd_region *nd_region = to_nd_region(dev->parent); |
1542 | ssize_t rc; | 1542 | ssize_t rc; |
1543 | 1543 | ||
1544 | device_lock(dev); | 1544 | nd_device_lock(dev); |
1545 | nvdimm_bus_lock(dev); | 1545 | nvdimm_bus_lock(dev); |
1546 | wait_nvdimm_bus_probe_idle(dev); | 1546 | wait_nvdimm_bus_probe_idle(dev); |
1547 | rc = __holder_class_store(dev, buf); | 1547 | rc = __holder_class_store(dev, buf); |
@@ -1549,7 +1549,7 @@ static ssize_t holder_class_store(struct device *dev, | |||
1549 | rc = nd_namespace_label_update(nd_region, dev); | 1549 | rc = nd_namespace_label_update(nd_region, dev); |
1550 | dev_dbg(dev, "%s(%zd)\n", rc < 0 ? "fail " : "", rc); | 1550 | dev_dbg(dev, "%s(%zd)\n", rc < 0 ? "fail " : "", rc); |
1551 | nvdimm_bus_unlock(dev); | 1551 | nvdimm_bus_unlock(dev); |
1552 | device_unlock(dev); | 1552 | nd_device_unlock(dev); |
1553 | 1553 | ||
1554 | return rc < 0 ? rc : len; | 1554 | return rc < 0 ? rc : len; |
1555 | } | 1555 | } |
@@ -1560,7 +1560,7 @@ static ssize_t holder_class_show(struct device *dev, | |||
1560 | struct nd_namespace_common *ndns = to_ndns(dev); | 1560 | struct nd_namespace_common *ndns = to_ndns(dev); |
1561 | ssize_t rc; | 1561 | ssize_t rc; |
1562 | 1562 | ||
1563 | device_lock(dev); | 1563 | nd_device_lock(dev); |
1564 | if (ndns->claim_class == NVDIMM_CCLASS_NONE) | 1564 | if (ndns->claim_class == NVDIMM_CCLASS_NONE) |
1565 | rc = sprintf(buf, "\n"); | 1565 | rc = sprintf(buf, "\n"); |
1566 | else if ((ndns->claim_class == NVDIMM_CCLASS_BTT) || | 1566 | else if ((ndns->claim_class == NVDIMM_CCLASS_BTT) || |
@@ -1572,7 +1572,7 @@ static ssize_t holder_class_show(struct device *dev, | |||
1572 | rc = sprintf(buf, "dax\n"); | 1572 | rc = sprintf(buf, "dax\n"); |
1573 | else | 1573 | else |
1574 | rc = sprintf(buf, "<unknown>\n"); | 1574 | rc = sprintf(buf, "<unknown>\n"); |
1575 | device_unlock(dev); | 1575 | nd_device_unlock(dev); |
1576 | 1576 | ||
1577 | return rc; | 1577 | return rc; |
1578 | } | 1578 | } |
@@ -1586,7 +1586,7 @@ static ssize_t mode_show(struct device *dev, | |||
1586 | char *mode; | 1586 | char *mode; |
1587 | ssize_t rc; | 1587 | ssize_t rc; |
1588 | 1588 | ||
1589 | device_lock(dev); | 1589 | nd_device_lock(dev); |
1590 | claim = ndns->claim; | 1590 | claim = ndns->claim; |
1591 | if (claim && is_nd_btt(claim)) | 1591 | if (claim && is_nd_btt(claim)) |
1592 | mode = "safe"; | 1592 | mode = "safe"; |
@@ -1599,7 +1599,7 @@ static ssize_t mode_show(struct device *dev, | |||
1599 | else | 1599 | else |
1600 | mode = "raw"; | 1600 | mode = "raw"; |
1601 | rc = sprintf(buf, "%s\n", mode); | 1601 | rc = sprintf(buf, "%s\n", mode); |
1602 | device_unlock(dev); | 1602 | nd_device_unlock(dev); |
1603 | 1603 | ||
1604 | return rc; | 1604 | return rc; |
1605 | } | 1605 | } |
@@ -1703,8 +1703,8 @@ struct nd_namespace_common *nvdimm_namespace_common_probe(struct device *dev) | |||
1703 | * Flush any in-progess probes / removals in the driver | 1703 | * Flush any in-progess probes / removals in the driver |
1704 | * for the raw personality of this namespace. | 1704 | * for the raw personality of this namespace. |
1705 | */ | 1705 | */ |
1706 | device_lock(&ndns->dev); | 1706 | nd_device_lock(&ndns->dev); |
1707 | device_unlock(&ndns->dev); | 1707 | nd_device_unlock(&ndns->dev); |
1708 | if (ndns->dev.driver) { | 1708 | if (ndns->dev.driver) { |
1709 | dev_dbg(&ndns->dev, "is active, can't bind %s\n", | 1709 | dev_dbg(&ndns->dev, "is active, can't bind %s\n", |
1710 | dev_name(dev)); | 1710 | dev_name(dev)); |
diff --git a/drivers/nvdimm/nd-core.h b/drivers/nvdimm/nd-core.h index 391e88de3a29..0ac52b6eb00e 100644 --- a/drivers/nvdimm/nd-core.h +++ b/drivers/nvdimm/nd-core.h | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <linux/sizes.h> | 9 | #include <linux/sizes.h> |
10 | #include <linux/mutex.h> | 10 | #include <linux/mutex.h> |
11 | #include <linux/nd.h> | 11 | #include <linux/nd.h> |
12 | #include "nd.h" | ||
12 | 13 | ||
13 | extern struct list_head nvdimm_bus_list; | 14 | extern struct list_head nvdimm_bus_list; |
14 | extern struct mutex nvdimm_bus_list_mutex; | 15 | extern struct mutex nvdimm_bus_list_mutex; |
@@ -17,10 +18,11 @@ extern struct workqueue_struct *nvdimm_wq; | |||
17 | 18 | ||
18 | struct nvdimm_bus { | 19 | struct nvdimm_bus { |
19 | struct nvdimm_bus_descriptor *nd_desc; | 20 | struct nvdimm_bus_descriptor *nd_desc; |
20 | wait_queue_head_t probe_wait; | 21 | wait_queue_head_t wait; |
21 | struct list_head list; | 22 | struct list_head list; |
22 | struct device dev; | 23 | struct device dev; |
23 | int id, probe_active; | 24 | int id, probe_active; |
25 | atomic_t ioctl_active; | ||
24 | struct list_head mapping_list; | 26 | struct list_head mapping_list; |
25 | struct mutex reconfig_mutex; | 27 | struct mutex reconfig_mutex; |
26 | struct badrange badrange; | 28 | struct badrange badrange; |
@@ -181,4 +183,71 @@ ssize_t nd_namespace_store(struct device *dev, | |||
181 | struct nd_namespace_common **_ndns, const char *buf, | 183 | struct nd_namespace_common **_ndns, const char *buf, |
182 | size_t len); | 184 | size_t len); |
183 | struct nd_pfn *to_nd_pfn_safe(struct device *dev); | 185 | struct nd_pfn *to_nd_pfn_safe(struct device *dev); |
186 | bool is_nvdimm_bus(struct device *dev); | ||
187 | |||
188 | #ifdef CONFIG_PROVE_LOCKING | ||
189 | extern struct class *nd_class; | ||
190 | |||
191 | enum { | ||
192 | LOCK_BUS, | ||
193 | LOCK_NDCTL, | ||
194 | LOCK_REGION, | ||
195 | LOCK_DIMM = LOCK_REGION, | ||
196 | LOCK_NAMESPACE, | ||
197 | LOCK_CLAIM, | ||
198 | }; | ||
199 | |||
200 | static inline void debug_nvdimm_lock(struct device *dev) | ||
201 | { | ||
202 | if (is_nd_region(dev)) | ||
203 | mutex_lock_nested(&dev->lockdep_mutex, LOCK_REGION); | ||
204 | else if (is_nvdimm(dev)) | ||
205 | mutex_lock_nested(&dev->lockdep_mutex, LOCK_DIMM); | ||
206 | else if (is_nd_btt(dev) || is_nd_pfn(dev) || is_nd_dax(dev)) | ||
207 | mutex_lock_nested(&dev->lockdep_mutex, LOCK_CLAIM); | ||
208 | else if (dev->parent && (is_nd_region(dev->parent))) | ||
209 | mutex_lock_nested(&dev->lockdep_mutex, LOCK_NAMESPACE); | ||
210 | else if (is_nvdimm_bus(dev)) | ||
211 | mutex_lock_nested(&dev->lockdep_mutex, LOCK_BUS); | ||
212 | else if (dev->class && dev->class == nd_class) | ||
213 | mutex_lock_nested(&dev->lockdep_mutex, LOCK_NDCTL); | ||
214 | else | ||
215 | dev_WARN(dev, "unknown lock level\n"); | ||
216 | } | ||
217 | |||
218 | static inline void debug_nvdimm_unlock(struct device *dev) | ||
219 | { | ||
220 | mutex_unlock(&dev->lockdep_mutex); | ||
221 | } | ||
222 | |||
223 | static inline void nd_device_lock(struct device *dev) | ||
224 | { | ||
225 | device_lock(dev); | ||
226 | debug_nvdimm_lock(dev); | ||
227 | } | ||
228 | |||
229 | static inline void nd_device_unlock(struct device *dev) | ||
230 | { | ||
231 | debug_nvdimm_unlock(dev); | ||
232 | device_unlock(dev); | ||
233 | } | ||
234 | #else | ||
235 | static inline void nd_device_lock(struct device *dev) | ||
236 | { | ||
237 | device_lock(dev); | ||
238 | } | ||
239 | |||
240 | static inline void nd_device_unlock(struct device *dev) | ||
241 | { | ||
242 | device_unlock(dev); | ||
243 | } | ||
244 | |||
245 | static inline void debug_nvdimm_lock(struct device *dev) | ||
246 | { | ||
247 | } | ||
248 | |||
249 | static inline void debug_nvdimm_unlock(struct device *dev) | ||
250 | { | ||
251 | } | ||
252 | #endif | ||
184 | #endif /* __ND_CORE_H__ */ | 253 | #endif /* __ND_CORE_H__ */ |
diff --git a/drivers/nvdimm/pfn_devs.c b/drivers/nvdimm/pfn_devs.c index df2bdbd22450..3e7b11cf1aae 100644 --- a/drivers/nvdimm/pfn_devs.c +++ b/drivers/nvdimm/pfn_devs.c | |||
@@ -67,7 +67,7 @@ static ssize_t mode_store(struct device *dev, | |||
67 | struct nd_pfn *nd_pfn = to_nd_pfn_safe(dev); | 67 | struct nd_pfn *nd_pfn = to_nd_pfn_safe(dev); |
68 | ssize_t rc = 0; | 68 | ssize_t rc = 0; |
69 | 69 | ||
70 | device_lock(dev); | 70 | nd_device_lock(dev); |
71 | nvdimm_bus_lock(dev); | 71 | nvdimm_bus_lock(dev); |
72 | if (dev->driver) | 72 | if (dev->driver) |
73 | rc = -EBUSY; | 73 | rc = -EBUSY; |
@@ -89,7 +89,7 @@ static ssize_t mode_store(struct device *dev, | |||
89 | dev_dbg(dev, "result: %zd wrote: %s%s", rc, buf, | 89 | dev_dbg(dev, "result: %zd wrote: %s%s", rc, buf, |
90 | buf[len - 1] == '\n' ? "" : "\n"); | 90 | buf[len - 1] == '\n' ? "" : "\n"); |
91 | nvdimm_bus_unlock(dev); | 91 | nvdimm_bus_unlock(dev); |
92 | device_unlock(dev); | 92 | nd_device_unlock(dev); |
93 | 93 | ||
94 | return rc ? rc : len; | 94 | return rc ? rc : len; |
95 | } | 95 | } |
@@ -132,14 +132,14 @@ static ssize_t align_store(struct device *dev, | |||
132 | struct nd_pfn *nd_pfn = to_nd_pfn_safe(dev); | 132 | struct nd_pfn *nd_pfn = to_nd_pfn_safe(dev); |
133 | ssize_t rc; | 133 | ssize_t rc; |
134 | 134 | ||
135 | device_lock(dev); | 135 | nd_device_lock(dev); |
136 | nvdimm_bus_lock(dev); | 136 | nvdimm_bus_lock(dev); |
137 | rc = nd_size_select_store(dev, buf, &nd_pfn->align, | 137 | rc = nd_size_select_store(dev, buf, &nd_pfn->align, |
138 | nd_pfn_supported_alignments()); | 138 | nd_pfn_supported_alignments()); |
139 | dev_dbg(dev, "result: %zd wrote: %s%s", rc, buf, | 139 | dev_dbg(dev, "result: %zd wrote: %s%s", rc, buf, |
140 | buf[len - 1] == '\n' ? "" : "\n"); | 140 | buf[len - 1] == '\n' ? "" : "\n"); |
141 | nvdimm_bus_unlock(dev); | 141 | nvdimm_bus_unlock(dev); |
142 | device_unlock(dev); | 142 | nd_device_unlock(dev); |
143 | 143 | ||
144 | return rc ? rc : len; | 144 | return rc ? rc : len; |
145 | } | 145 | } |
@@ -161,11 +161,11 @@ static ssize_t uuid_store(struct device *dev, | |||
161 | struct nd_pfn *nd_pfn = to_nd_pfn_safe(dev); | 161 | struct nd_pfn *nd_pfn = to_nd_pfn_safe(dev); |
162 | ssize_t rc; | 162 | ssize_t rc; |
163 | 163 | ||
164 | device_lock(dev); | 164 | nd_device_lock(dev); |
165 | rc = nd_uuid_store(dev, &nd_pfn->uuid, buf, len); | 165 | rc = nd_uuid_store(dev, &nd_pfn->uuid, buf, len); |
166 | dev_dbg(dev, "result: %zd wrote: %s%s", rc, buf, | 166 | dev_dbg(dev, "result: %zd wrote: %s%s", rc, buf, |
167 | buf[len - 1] == '\n' ? "" : "\n"); | 167 | buf[len - 1] == '\n' ? "" : "\n"); |
168 | device_unlock(dev); | 168 | nd_device_unlock(dev); |
169 | 169 | ||
170 | return rc ? rc : len; | 170 | return rc ? rc : len; |
171 | } | 171 | } |
@@ -190,13 +190,13 @@ static ssize_t namespace_store(struct device *dev, | |||
190 | struct nd_pfn *nd_pfn = to_nd_pfn_safe(dev); | 190 | struct nd_pfn *nd_pfn = to_nd_pfn_safe(dev); |
191 | ssize_t rc; | 191 | ssize_t rc; |
192 | 192 | ||
193 | device_lock(dev); | 193 | nd_device_lock(dev); |
194 | nvdimm_bus_lock(dev); | 194 | nvdimm_bus_lock(dev); |
195 | rc = nd_namespace_store(dev, &nd_pfn->ndns, buf, len); | 195 | rc = nd_namespace_store(dev, &nd_pfn->ndns, buf, len); |
196 | dev_dbg(dev, "result: %zd wrote: %s%s", rc, buf, | 196 | dev_dbg(dev, "result: %zd wrote: %s%s", rc, buf, |
197 | buf[len - 1] == '\n' ? "" : "\n"); | 197 | buf[len - 1] == '\n' ? "" : "\n"); |
198 | nvdimm_bus_unlock(dev); | 198 | nvdimm_bus_unlock(dev); |
199 | device_unlock(dev); | 199 | nd_device_unlock(dev); |
200 | 200 | ||
201 | return rc; | 201 | return rc; |
202 | } | 202 | } |
@@ -208,7 +208,7 @@ static ssize_t resource_show(struct device *dev, | |||
208 | struct nd_pfn *nd_pfn = to_nd_pfn_safe(dev); | 208 | struct nd_pfn *nd_pfn = to_nd_pfn_safe(dev); |
209 | ssize_t rc; | 209 | ssize_t rc; |
210 | 210 | ||
211 | device_lock(dev); | 211 | nd_device_lock(dev); |
212 | if (dev->driver) { | 212 | if (dev->driver) { |
213 | struct nd_pfn_sb *pfn_sb = nd_pfn->pfn_sb; | 213 | struct nd_pfn_sb *pfn_sb = nd_pfn->pfn_sb; |
214 | u64 offset = __le64_to_cpu(pfn_sb->dataoff); | 214 | u64 offset = __le64_to_cpu(pfn_sb->dataoff); |
@@ -222,7 +222,7 @@ static ssize_t resource_show(struct device *dev, | |||
222 | /* no address to convey if the pfn instance is disabled */ | 222 | /* no address to convey if the pfn instance is disabled */ |
223 | rc = -ENXIO; | 223 | rc = -ENXIO; |
224 | } | 224 | } |
225 | device_unlock(dev); | 225 | nd_device_unlock(dev); |
226 | 226 | ||
227 | return rc; | 227 | return rc; |
228 | } | 228 | } |
@@ -234,7 +234,7 @@ static ssize_t size_show(struct device *dev, | |||
234 | struct nd_pfn *nd_pfn = to_nd_pfn_safe(dev); | 234 | struct nd_pfn *nd_pfn = to_nd_pfn_safe(dev); |
235 | ssize_t rc; | 235 | ssize_t rc; |
236 | 236 | ||
237 | device_lock(dev); | 237 | nd_device_lock(dev); |
238 | if (dev->driver) { | 238 | if (dev->driver) { |
239 | struct nd_pfn_sb *pfn_sb = nd_pfn->pfn_sb; | 239 | struct nd_pfn_sb *pfn_sb = nd_pfn->pfn_sb; |
240 | u64 offset = __le64_to_cpu(pfn_sb->dataoff); | 240 | u64 offset = __le64_to_cpu(pfn_sb->dataoff); |
@@ -250,7 +250,7 @@ static ssize_t size_show(struct device *dev, | |||
250 | /* no size to convey if the pfn instance is disabled */ | 250 | /* no size to convey if the pfn instance is disabled */ |
251 | rc = -ENXIO; | 251 | rc = -ENXIO; |
252 | } | 252 | } |
253 | device_unlock(dev); | 253 | nd_device_unlock(dev); |
254 | 254 | ||
255 | return rc; | 255 | return rc; |
256 | } | 256 | } |
diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c index 2bf3acd69613..4c121dd03dd9 100644 --- a/drivers/nvdimm/pmem.c +++ b/drivers/nvdimm/pmem.c | |||
@@ -522,8 +522,8 @@ static int nd_pmem_remove(struct device *dev) | |||
522 | nvdimm_namespace_detach_btt(to_nd_btt(dev)); | 522 | nvdimm_namespace_detach_btt(to_nd_btt(dev)); |
523 | else { | 523 | else { |
524 | /* | 524 | /* |
525 | * Note, this assumes device_lock() context to not race | 525 | * Note, this assumes nd_device_lock() context to not |
526 | * nd_pmem_notify() | 526 | * race nd_pmem_notify() |
527 | */ | 527 | */ |
528 | sysfs_put(pmem->bb_state); | 528 | sysfs_put(pmem->bb_state); |
529 | pmem->bb_state = NULL; | 529 | pmem->bb_state = NULL; |
diff --git a/drivers/nvdimm/region.c b/drivers/nvdimm/region.c index ef46cc3a71ae..37bf8719a2a4 100644 --- a/drivers/nvdimm/region.c +++ b/drivers/nvdimm/region.c | |||
@@ -34,17 +34,6 @@ static int nd_region_probe(struct device *dev) | |||
34 | if (rc) | 34 | if (rc) |
35 | return rc; | 35 | return rc; |
36 | 36 | ||
37 | rc = nd_region_register_namespaces(nd_region, &err); | ||
38 | if (rc < 0) | ||
39 | return rc; | ||
40 | |||
41 | ndrd = dev_get_drvdata(dev); | ||
42 | ndrd->ns_active = rc; | ||
43 | ndrd->ns_count = rc + err; | ||
44 | |||
45 | if (rc && err && rc == err) | ||
46 | return -ENODEV; | ||
47 | |||
48 | if (is_nd_pmem(&nd_region->dev)) { | 37 | if (is_nd_pmem(&nd_region->dev)) { |
49 | struct resource ndr_res; | 38 | struct resource ndr_res; |
50 | 39 | ||
@@ -60,6 +49,17 @@ static int nd_region_probe(struct device *dev) | |||
60 | nvdimm_badblocks_populate(nd_region, &nd_region->bb, &ndr_res); | 49 | nvdimm_badblocks_populate(nd_region, &nd_region->bb, &ndr_res); |
61 | } | 50 | } |
62 | 51 | ||
52 | rc = nd_region_register_namespaces(nd_region, &err); | ||
53 | if (rc < 0) | ||
54 | return rc; | ||
55 | |||
56 | ndrd = dev_get_drvdata(dev); | ||
57 | ndrd->ns_active = rc; | ||
58 | ndrd->ns_count = rc + err; | ||
59 | |||
60 | if (rc && err && rc == err) | ||
61 | return -ENODEV; | ||
62 | |||
63 | nd_region->btt_seed = nd_btt_create(nd_region); | 63 | nd_region->btt_seed = nd_btt_create(nd_region); |
64 | nd_region->pfn_seed = nd_pfn_create(nd_region); | 64 | nd_region->pfn_seed = nd_pfn_create(nd_region); |
65 | nd_region->dax_seed = nd_dax_create(nd_region); | 65 | nd_region->dax_seed = nd_dax_create(nd_region); |
@@ -102,7 +102,7 @@ static int nd_region_remove(struct device *dev) | |||
102 | nvdimm_bus_unlock(dev); | 102 | nvdimm_bus_unlock(dev); |
103 | 103 | ||
104 | /* | 104 | /* |
105 | * Note, this assumes device_lock() context to not race | 105 | * Note, this assumes nd_device_lock() context to not race |
106 | * nd_region_notify() | 106 | * nd_region_notify() |
107 | */ | 107 | */ |
108 | sysfs_put(nd_region->bb_state); | 108 | sysfs_put(nd_region->bb_state); |
diff --git a/drivers/nvdimm/region_devs.c b/drivers/nvdimm/region_devs.c index 56f2227f192a..af30cbe7a8ea 100644 --- a/drivers/nvdimm/region_devs.c +++ b/drivers/nvdimm/region_devs.c | |||
@@ -331,7 +331,7 @@ static ssize_t set_cookie_show(struct device *dev, | |||
331 | * the v1.1 namespace label cookie definition. To read all this | 331 | * the v1.1 namespace label cookie definition. To read all this |
332 | * data we need to wait for probing to settle. | 332 | * data we need to wait for probing to settle. |
333 | */ | 333 | */ |
334 | device_lock(dev); | 334 | nd_device_lock(dev); |
335 | nvdimm_bus_lock(dev); | 335 | nvdimm_bus_lock(dev); |
336 | wait_nvdimm_bus_probe_idle(dev); | 336 | wait_nvdimm_bus_probe_idle(dev); |
337 | if (nd_region->ndr_mappings) { | 337 | if (nd_region->ndr_mappings) { |
@@ -348,7 +348,7 @@ static ssize_t set_cookie_show(struct device *dev, | |||
348 | } | 348 | } |
349 | } | 349 | } |
350 | nvdimm_bus_unlock(dev); | 350 | nvdimm_bus_unlock(dev); |
351 | device_unlock(dev); | 351 | nd_device_unlock(dev); |
352 | 352 | ||
353 | if (rc) | 353 | if (rc) |
354 | return rc; | 354 | return rc; |
@@ -424,10 +424,12 @@ static ssize_t available_size_show(struct device *dev, | |||
424 | * memory nvdimm_bus_lock() is dropped, but that's userspace's | 424 | * memory nvdimm_bus_lock() is dropped, but that's userspace's |
425 | * problem to not race itself. | 425 | * problem to not race itself. |
426 | */ | 426 | */ |
427 | nd_device_lock(dev); | ||
427 | nvdimm_bus_lock(dev); | 428 | nvdimm_bus_lock(dev); |
428 | wait_nvdimm_bus_probe_idle(dev); | 429 | wait_nvdimm_bus_probe_idle(dev); |
429 | available = nd_region_available_dpa(nd_region); | 430 | available = nd_region_available_dpa(nd_region); |
430 | nvdimm_bus_unlock(dev); | 431 | nvdimm_bus_unlock(dev); |
432 | nd_device_unlock(dev); | ||
431 | 433 | ||
432 | return sprintf(buf, "%llu\n", available); | 434 | return sprintf(buf, "%llu\n", available); |
433 | } | 435 | } |
@@ -439,10 +441,12 @@ static ssize_t max_available_extent_show(struct device *dev, | |||
439 | struct nd_region *nd_region = to_nd_region(dev); | 441 | struct nd_region *nd_region = to_nd_region(dev); |
440 | unsigned long long available = 0; | 442 | unsigned long long available = 0; |
441 | 443 | ||
444 | nd_device_lock(dev); | ||
442 | nvdimm_bus_lock(dev); | 445 | nvdimm_bus_lock(dev); |
443 | wait_nvdimm_bus_probe_idle(dev); | 446 | wait_nvdimm_bus_probe_idle(dev); |
444 | available = nd_region_allocatable_dpa(nd_region); | 447 | available = nd_region_allocatable_dpa(nd_region); |
445 | nvdimm_bus_unlock(dev); | 448 | nvdimm_bus_unlock(dev); |
449 | nd_device_unlock(dev); | ||
446 | 450 | ||
447 | return sprintf(buf, "%llu\n", available); | 451 | return sprintf(buf, "%llu\n", available); |
448 | } | 452 | } |
@@ -561,12 +565,12 @@ static ssize_t region_badblocks_show(struct device *dev, | |||
561 | struct nd_region *nd_region = to_nd_region(dev); | 565 | struct nd_region *nd_region = to_nd_region(dev); |
562 | ssize_t rc; | 566 | ssize_t rc; |
563 | 567 | ||
564 | device_lock(dev); | 568 | nd_device_lock(dev); |
565 | if (dev->driver) | 569 | if (dev->driver) |
566 | rc = badblocks_show(&nd_region->bb, buf, 0); | 570 | rc = badblocks_show(&nd_region->bb, buf, 0); |
567 | else | 571 | else |
568 | rc = -ENXIO; | 572 | rc = -ENXIO; |
569 | device_unlock(dev); | 573 | nd_device_unlock(dev); |
570 | 574 | ||
571 | return rc; | 575 | return rc; |
572 | } | 576 | } |
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index cc09b81fc7f4..8f3fbe5ca937 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c | |||
@@ -2311,17 +2311,15 @@ static void nvme_init_subnqn(struct nvme_subsystem *subsys, struct nvme_ctrl *ct | |||
2311 | memset(subsys->subnqn + off, 0, sizeof(subsys->subnqn) - off); | 2311 | memset(subsys->subnqn + off, 0, sizeof(subsys->subnqn) - off); |
2312 | } | 2312 | } |
2313 | 2313 | ||
2314 | static void __nvme_release_subsystem(struct nvme_subsystem *subsys) | 2314 | static void nvme_release_subsystem(struct device *dev) |
2315 | { | 2315 | { |
2316 | struct nvme_subsystem *subsys = | ||
2317 | container_of(dev, struct nvme_subsystem, dev); | ||
2318 | |||
2316 | ida_simple_remove(&nvme_subsystems_ida, subsys->instance); | 2319 | ida_simple_remove(&nvme_subsystems_ida, subsys->instance); |
2317 | kfree(subsys); | 2320 | kfree(subsys); |
2318 | } | 2321 | } |
2319 | 2322 | ||
2320 | static void nvme_release_subsystem(struct device *dev) | ||
2321 | { | ||
2322 | __nvme_release_subsystem(container_of(dev, struct nvme_subsystem, dev)); | ||
2323 | } | ||
2324 | |||
2325 | static void nvme_destroy_subsystem(struct kref *ref) | 2323 | static void nvme_destroy_subsystem(struct kref *ref) |
2326 | { | 2324 | { |
2327 | struct nvme_subsystem *subsys = | 2325 | struct nvme_subsystem *subsys = |
@@ -2477,7 +2475,7 @@ static int nvme_init_subsystem(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id) | |||
2477 | mutex_lock(&nvme_subsystems_lock); | 2475 | mutex_lock(&nvme_subsystems_lock); |
2478 | found = __nvme_find_get_subsystem(subsys->subnqn); | 2476 | found = __nvme_find_get_subsystem(subsys->subnqn); |
2479 | if (found) { | 2477 | if (found) { |
2480 | __nvme_release_subsystem(subsys); | 2478 | put_device(&subsys->dev); |
2481 | subsys = found; | 2479 | subsys = found; |
2482 | 2480 | ||
2483 | if (!nvme_validate_cntlid(subsys, ctrl, id)) { | 2481 | if (!nvme_validate_cntlid(subsys, ctrl, id)) { |
diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c index a9a927677970..4f0d0d12744e 100644 --- a/drivers/nvme/host/multipath.c +++ b/drivers/nvme/host/multipath.c | |||
@@ -12,11 +12,6 @@ module_param(multipath, bool, 0444); | |||
12 | MODULE_PARM_DESC(multipath, | 12 | MODULE_PARM_DESC(multipath, |
13 | "turn on native support for multiple controllers per subsystem"); | 13 | "turn on native support for multiple controllers per subsystem"); |
14 | 14 | ||
15 | inline bool nvme_ctrl_use_ana(struct nvme_ctrl *ctrl) | ||
16 | { | ||
17 | return multipath && ctrl->subsys && (ctrl->subsys->cmic & (1 << 3)); | ||
18 | } | ||
19 | |||
20 | /* | 15 | /* |
21 | * If multipathing is enabled we need to always use the subsystem instance | 16 | * If multipathing is enabled we need to always use the subsystem instance |
22 | * number for numbering our devices to avoid conflicts between subsystems that | 17 | * number for numbering our devices to avoid conflicts between subsystems that |
@@ -622,7 +617,8 @@ int nvme_mpath_init(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id) | |||
622 | { | 617 | { |
623 | int error; | 618 | int error; |
624 | 619 | ||
625 | if (!nvme_ctrl_use_ana(ctrl)) | 620 | /* check if multipath is enabled and we have the capability */ |
621 | if (!multipath || !ctrl->subsys || !(ctrl->subsys->cmic & (1 << 3))) | ||
626 | return 0; | 622 | return 0; |
627 | 623 | ||
628 | ctrl->anacap = id->anacap; | 624 | ctrl->anacap = id->anacap; |
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h index 716a876119c8..26b563f9985b 100644 --- a/drivers/nvme/host/nvme.h +++ b/drivers/nvme/host/nvme.h | |||
@@ -485,7 +485,11 @@ extern const struct attribute_group *nvme_ns_id_attr_groups[]; | |||
485 | extern const struct block_device_operations nvme_ns_head_ops; | 485 | extern const struct block_device_operations nvme_ns_head_ops; |
486 | 486 | ||
487 | #ifdef CONFIG_NVME_MULTIPATH | 487 | #ifdef CONFIG_NVME_MULTIPATH |
488 | bool nvme_ctrl_use_ana(struct nvme_ctrl *ctrl); | 488 | static inline bool nvme_ctrl_use_ana(struct nvme_ctrl *ctrl) |
489 | { | ||
490 | return ctrl->ana_log_buf != NULL; | ||
491 | } | ||
492 | |||
489 | void nvme_set_disk_name(char *disk_name, struct nvme_ns *ns, | 493 | void nvme_set_disk_name(char *disk_name, struct nvme_ns *ns, |
490 | struct nvme_ctrl *ctrl, int *flags); | 494 | struct nvme_ctrl *ctrl, int *flags); |
491 | void nvme_failover_req(struct request *req); | 495 | void nvme_failover_req(struct request *req); |
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index bb970ca82517..db160cee42ad 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c | |||
@@ -2254,9 +2254,7 @@ static int nvme_dev_add(struct nvme_dev *dev) | |||
2254 | if (!dev->ctrl.tagset) { | 2254 | if (!dev->ctrl.tagset) { |
2255 | dev->tagset.ops = &nvme_mq_ops; | 2255 | dev->tagset.ops = &nvme_mq_ops; |
2256 | dev->tagset.nr_hw_queues = dev->online_queues - 1; | 2256 | dev->tagset.nr_hw_queues = dev->online_queues - 1; |
2257 | dev->tagset.nr_maps = 1; /* default */ | 2257 | dev->tagset.nr_maps = 2; /* default + read */ |
2258 | if (dev->io_queues[HCTX_TYPE_READ]) | ||
2259 | dev->tagset.nr_maps++; | ||
2260 | if (dev->io_queues[HCTX_TYPE_POLL]) | 2258 | if (dev->io_queues[HCTX_TYPE_POLL]) |
2261 | dev->tagset.nr_maps++; | 2259 | dev->tagset.nr_maps++; |
2262 | dev->tagset.timeout = NVME_IO_TIMEOUT; | 2260 | dev->tagset.timeout = NVME_IO_TIMEOUT; |
@@ -3029,6 +3027,8 @@ static const struct pci_device_id nvme_id_table[] = { | |||
3029 | .driver_data = NVME_QUIRK_LIGHTNVM, }, | 3027 | .driver_data = NVME_QUIRK_LIGHTNVM, }, |
3030 | { PCI_DEVICE(0x1d1d, 0x2601), /* CNEX Granby */ | 3028 | { PCI_DEVICE(0x1d1d, 0x2601), /* CNEX Granby */ |
3031 | .driver_data = NVME_QUIRK_LIGHTNVM, }, | 3029 | .driver_data = NVME_QUIRK_LIGHTNVM, }, |
3030 | { PCI_DEVICE(0x10ec, 0x5762), /* ADATA SX6000LNP */ | ||
3031 | .driver_data = NVME_QUIRK_IGNORE_DEV_SUBNQN, }, | ||
3032 | { PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) }, | 3032 | { PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) }, |
3033 | { PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2001) }, | 3033 | { PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2001) }, |
3034 | { PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2003) }, | 3034 | { PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2003) }, |
diff --git a/drivers/platform/olpc/olpc-xo175-ec.c b/drivers/platform/olpc/olpc-xo175-ec.c index 48d6f0d87583..83ed1fbf73cf 100644 --- a/drivers/platform/olpc/olpc-xo175-ec.c +++ b/drivers/platform/olpc/olpc-xo175-ec.c | |||
@@ -736,6 +736,12 @@ static const struct of_device_id olpc_xo175_ec_of_match[] = { | |||
736 | }; | 736 | }; |
737 | MODULE_DEVICE_TABLE(of, olpc_xo175_ec_of_match); | 737 | MODULE_DEVICE_TABLE(of, olpc_xo175_ec_of_match); |
738 | 738 | ||
739 | static const struct spi_device_id olpc_xo175_ec_id_table[] = { | ||
740 | { "xo1.75-ec", 0 }, | ||
741 | {} | ||
742 | }; | ||
743 | MODULE_DEVICE_TABLE(spi, olpc_xo175_ec_id_table); | ||
744 | |||
739 | static struct spi_driver olpc_xo175_ec_spi_driver = { | 745 | static struct spi_driver olpc_xo175_ec_spi_driver = { |
740 | .driver = { | 746 | .driver = { |
741 | .name = "olpc-xo175-ec", | 747 | .name = "olpc-xo175-ec", |
diff --git a/drivers/platform/x86/intel_pmc_core.c b/drivers/platform/x86/intel_pmc_core.c index 235c0b89f824..c510d0d72475 100644 --- a/drivers/platform/x86/intel_pmc_core.c +++ b/drivers/platform/x86/intel_pmc_core.c | |||
@@ -812,6 +812,7 @@ static const struct x86_cpu_id intel_pmc_core_ids[] = { | |||
812 | INTEL_CPU_FAM6(KABYLAKE_DESKTOP, spt_reg_map), | 812 | INTEL_CPU_FAM6(KABYLAKE_DESKTOP, spt_reg_map), |
813 | INTEL_CPU_FAM6(CANNONLAKE_MOBILE, cnp_reg_map), | 813 | INTEL_CPU_FAM6(CANNONLAKE_MOBILE, cnp_reg_map), |
814 | INTEL_CPU_FAM6(ICELAKE_MOBILE, icl_reg_map), | 814 | INTEL_CPU_FAM6(ICELAKE_MOBILE, icl_reg_map), |
815 | INTEL_CPU_FAM6(ICELAKE_NNPI, icl_reg_map), | ||
815 | {} | 816 | {} |
816 | }; | 817 | }; |
817 | 818 | ||
diff --git a/drivers/platform/x86/pcengines-apuv2.c b/drivers/platform/x86/pcengines-apuv2.c index b0d3110ae378..e4c68efac0c2 100644 --- a/drivers/platform/x86/pcengines-apuv2.c +++ b/drivers/platform/x86/pcengines-apuv2.c | |||
@@ -93,7 +93,7 @@ static struct gpiod_lookup_table gpios_led_table = { | |||
93 | 93 | ||
94 | static struct gpio_keys_button apu2_keys_buttons[] = { | 94 | static struct gpio_keys_button apu2_keys_buttons[] = { |
95 | { | 95 | { |
96 | .code = KEY_SETUP, | 96 | .code = KEY_RESTART, |
97 | .active_low = 1, | 97 | .active_low = 1, |
98 | .desc = "front button", | 98 | .desc = "front button", |
99 | .type = EV_KEY, | 99 | .type = EV_KEY, |
@@ -255,6 +255,4 @@ MODULE_DESCRIPTION("PC Engines APUv2/APUv3 board GPIO/LED/keys driver"); | |||
255 | MODULE_LICENSE("GPL"); | 255 | MODULE_LICENSE("GPL"); |
256 | MODULE_DEVICE_TABLE(dmi, apu_gpio_dmi_table); | 256 | MODULE_DEVICE_TABLE(dmi, apu_gpio_dmi_table); |
257 | MODULE_ALIAS("platform:pcengines-apuv2"); | 257 | MODULE_ALIAS("platform:pcengines-apuv2"); |
258 | MODULE_SOFTDEP("pre: platform:" AMD_FCH_GPIO_DRIVER_NAME); | 258 | MODULE_SOFTDEP("pre: platform:" AMD_FCH_GPIO_DRIVER_NAME " platform:leds-gpio platform:gpio_keys_polled"); |
259 | MODULE_SOFTDEP("pre: platform:leds-gpio"); | ||
260 | MODULE_SOFTDEP("pre: platform:gpio_keys_polled"); | ||
diff --git a/drivers/powercap/intel_rapl_common.c b/drivers/powercap/intel_rapl_common.c index 9fd6dd342169..6df481896b5f 100644 --- a/drivers/powercap/intel_rapl_common.c +++ b/drivers/powercap/intel_rapl_common.c | |||
@@ -1454,7 +1454,7 @@ static void __exit rapl_exit(void) | |||
1454 | unregister_pm_notifier(&rapl_pm_notifier); | 1454 | unregister_pm_notifier(&rapl_pm_notifier); |
1455 | } | 1455 | } |
1456 | 1456 | ||
1457 | module_init(rapl_init); | 1457 | fs_initcall(rapl_init); |
1458 | module_exit(rapl_exit); | 1458 | module_exit(rapl_exit); |
1459 | 1459 | ||
1460 | MODULE_DESCRIPTION("Intel Runtime Average Power Limit (RAPL) common code"); | 1460 | MODULE_DESCRIPTION("Intel Runtime Average Power Limit (RAPL) common code"); |
diff --git a/drivers/powercap/powercap_sys.c b/drivers/powercap/powercap_sys.c index 540e8aafc990..f808c5fa9838 100644 --- a/drivers/powercap/powercap_sys.c +++ b/drivers/powercap/powercap_sys.c | |||
@@ -671,7 +671,7 @@ static int __init powercap_init(void) | |||
671 | return class_register(&powercap_class); | 671 | return class_register(&powercap_class); |
672 | } | 672 | } |
673 | 673 | ||
674 | device_initcall(powercap_init); | 674 | fs_initcall(powercap_init); |
675 | 675 | ||
676 | MODULE_DESCRIPTION("PowerCap sysfs Driver"); | 676 | MODULE_DESCRIPTION("PowerCap sysfs Driver"); |
677 | MODULE_AUTHOR("Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>"); | 677 | MODULE_AUTHOR("Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>"); |
diff --git a/drivers/s390/cio/qdio_main.c b/drivers/s390/cio/qdio_main.c index 730c4e68094b..4142c85e77d8 100644 --- a/drivers/s390/cio/qdio_main.c +++ b/drivers/s390/cio/qdio_main.c | |||
@@ -319,9 +319,7 @@ static int qdio_siga_output(struct qdio_q *q, unsigned int *busy_bit, | |||
319 | int retries = 0, cc; | 319 | int retries = 0, cc; |
320 | unsigned long laob = 0; | 320 | unsigned long laob = 0; |
321 | 321 | ||
322 | WARN_ON_ONCE(aob && ((queue_type(q) != QDIO_IQDIO_QFMT) || | 322 | if (aob) { |
323 | !q->u.out.use_cq)); | ||
324 | if (q->u.out.use_cq && aob != 0) { | ||
325 | fc = QDIO_SIGA_WRITEQ; | 323 | fc = QDIO_SIGA_WRITEQ; |
326 | laob = aob; | 324 | laob = aob; |
327 | } | 325 | } |
@@ -621,9 +619,6 @@ static inline unsigned long qdio_aob_for_buffer(struct qdio_output_q *q, | |||
621 | { | 619 | { |
622 | unsigned long phys_aob = 0; | 620 | unsigned long phys_aob = 0; |
623 | 621 | ||
624 | if (!q->use_cq) | ||
625 | return 0; | ||
626 | |||
627 | if (!q->aobs[bufnr]) { | 622 | if (!q->aobs[bufnr]) { |
628 | struct qaob *aob = qdio_allocate_aob(); | 623 | struct qaob *aob = qdio_allocate_aob(); |
629 | q->aobs[bufnr] = aob; | 624 | q->aobs[bufnr] = aob; |
@@ -1308,6 +1303,8 @@ static void qdio_detect_hsicq(struct qdio_irq *irq_ptr) | |||
1308 | 1303 | ||
1309 | for_each_output_queue(irq_ptr, q, i) { | 1304 | for_each_output_queue(irq_ptr, q, i) { |
1310 | if (use_cq) { | 1305 | if (use_cq) { |
1306 | if (multicast_outbound(q)) | ||
1307 | continue; | ||
1311 | if (qdio_enable_async_operation(&q->u.out) < 0) { | 1308 | if (qdio_enable_async_operation(&q->u.out) < 0) { |
1312 | use_cq = 0; | 1309 | use_cq = 0; |
1313 | continue; | 1310 | continue; |
@@ -1553,18 +1550,19 @@ static int handle_outbound(struct qdio_q *q, unsigned int callflags, | |||
1553 | /* One SIGA-W per buffer required for unicast HSI */ | 1550 | /* One SIGA-W per buffer required for unicast HSI */ |
1554 | WARN_ON_ONCE(count > 1 && !multicast_outbound(q)); | 1551 | WARN_ON_ONCE(count > 1 && !multicast_outbound(q)); |
1555 | 1552 | ||
1556 | phys_aob = qdio_aob_for_buffer(&q->u.out, bufnr); | 1553 | if (q->u.out.use_cq) |
1554 | phys_aob = qdio_aob_for_buffer(&q->u.out, bufnr); | ||
1557 | 1555 | ||
1558 | rc = qdio_kick_outbound_q(q, phys_aob); | 1556 | rc = qdio_kick_outbound_q(q, phys_aob); |
1559 | } else if (need_siga_sync(q)) { | 1557 | } else if (need_siga_sync(q)) { |
1560 | rc = qdio_siga_sync_q(q); | 1558 | rc = qdio_siga_sync_q(q); |
1559 | } else if (count < QDIO_MAX_BUFFERS_PER_Q && | ||
1560 | get_buf_state(q, prev_buf(bufnr), &state, 0) > 0 && | ||
1561 | state == SLSB_CU_OUTPUT_PRIMED) { | ||
1562 | /* The previous buffer is not processed yet, tack on. */ | ||
1563 | qperf_inc(q, fast_requeue); | ||
1561 | } else { | 1564 | } else { |
1562 | /* try to fast requeue buffers */ | 1565 | rc = qdio_kick_outbound_q(q, 0); |
1563 | get_buf_state(q, prev_buf(bufnr), &state, 0); | ||
1564 | if (state != SLSB_CU_OUTPUT_PRIMED) | ||
1565 | rc = qdio_kick_outbound_q(q, 0); | ||
1566 | else | ||
1567 | qperf_inc(q, fast_requeue); | ||
1568 | } | 1566 | } |
1569 | 1567 | ||
1570 | /* in case of SIGA errors we must process the error immediately */ | 1568 | /* in case of SIGA errors we must process the error immediately */ |
diff --git a/drivers/s390/cio/vfio_ccw_cp.c b/drivers/s390/cio/vfio_ccw_cp.c index 1d4c893ead23..3645d1720c4b 100644 --- a/drivers/s390/cio/vfio_ccw_cp.c +++ b/drivers/s390/cio/vfio_ccw_cp.c | |||
@@ -72,8 +72,10 @@ static int pfn_array_alloc(struct pfn_array *pa, u64 iova, unsigned int len) | |||
72 | sizeof(*pa->pa_iova_pfn) + | 72 | sizeof(*pa->pa_iova_pfn) + |
73 | sizeof(*pa->pa_pfn), | 73 | sizeof(*pa->pa_pfn), |
74 | GFP_KERNEL); | 74 | GFP_KERNEL); |
75 | if (unlikely(!pa->pa_iova_pfn)) | 75 | if (unlikely(!pa->pa_iova_pfn)) { |
76 | pa->pa_nr = 0; | ||
76 | return -ENOMEM; | 77 | return -ENOMEM; |
78 | } | ||
77 | pa->pa_pfn = pa->pa_iova_pfn + pa->pa_nr; | 79 | pa->pa_pfn = pa->pa_iova_pfn + pa->pa_nr; |
78 | 80 | ||
79 | pa->pa_iova_pfn[0] = pa->pa_iova >> PAGE_SHIFT; | 81 | pa->pa_iova_pfn[0] = pa->pa_iova >> PAGE_SHIFT; |
@@ -421,7 +423,7 @@ static int ccwchain_loop_tic(struct ccwchain *chain, | |||
421 | static int ccwchain_handle_ccw(u32 cda, struct channel_program *cp) | 423 | static int ccwchain_handle_ccw(u32 cda, struct channel_program *cp) |
422 | { | 424 | { |
423 | struct ccwchain *chain; | 425 | struct ccwchain *chain; |
424 | int len; | 426 | int len, ret; |
425 | 427 | ||
426 | /* Copy 2K (the most we support today) of possible CCWs */ | 428 | /* Copy 2K (the most we support today) of possible CCWs */ |
427 | len = copy_from_iova(cp->mdev, cp->guest_cp, cda, | 429 | len = copy_from_iova(cp->mdev, cp->guest_cp, cda, |
@@ -448,7 +450,12 @@ static int ccwchain_handle_ccw(u32 cda, struct channel_program *cp) | |||
448 | memcpy(chain->ch_ccw, cp->guest_cp, len * sizeof(struct ccw1)); | 450 | memcpy(chain->ch_ccw, cp->guest_cp, len * sizeof(struct ccw1)); |
449 | 451 | ||
450 | /* Loop for tics on this new chain. */ | 452 | /* Loop for tics on this new chain. */ |
451 | return ccwchain_loop_tic(chain, cp); | 453 | ret = ccwchain_loop_tic(chain, cp); |
454 | |||
455 | if (ret) | ||
456 | ccwchain_free(chain); | ||
457 | |||
458 | return ret; | ||
452 | } | 459 | } |
453 | 460 | ||
454 | /* Loop for TICs. */ | 461 | /* Loop for TICs. */ |
@@ -642,17 +649,16 @@ int cp_init(struct channel_program *cp, struct device *mdev, union orb *orb) | |||
642 | 649 | ||
643 | /* Build a ccwchain for the first CCW segment */ | 650 | /* Build a ccwchain for the first CCW segment */ |
644 | ret = ccwchain_handle_ccw(orb->cmd.cpa, cp); | 651 | ret = ccwchain_handle_ccw(orb->cmd.cpa, cp); |
645 | if (ret) | ||
646 | cp_free(cp); | ||
647 | |||
648 | /* It is safe to force: if not set but idals used | ||
649 | * ccwchain_calc_length returns an error. | ||
650 | */ | ||
651 | cp->orb.cmd.c64 = 1; | ||
652 | 652 | ||
653 | if (!ret) | 653 | if (!ret) { |
654 | cp->initialized = true; | 654 | cp->initialized = true; |
655 | 655 | ||
656 | /* It is safe to force: if it was not set but idals used | ||
657 | * ccwchain_calc_length would have returned an error. | ||
658 | */ | ||
659 | cp->orb.cmd.c64 = 1; | ||
660 | } | ||
661 | |||
656 | return ret; | 662 | return ret; |
657 | } | 663 | } |
658 | 664 | ||
diff --git a/drivers/s390/cio/vfio_ccw_drv.c b/drivers/s390/cio/vfio_ccw_drv.c index 2b90a5ecaeb9..9208c0e56c33 100644 --- a/drivers/s390/cio/vfio_ccw_drv.c +++ b/drivers/s390/cio/vfio_ccw_drv.c | |||
@@ -88,7 +88,7 @@ static void vfio_ccw_sch_io_todo(struct work_struct *work) | |||
88 | (SCSW_ACTL_DEVACT | SCSW_ACTL_SCHACT)); | 88 | (SCSW_ACTL_DEVACT | SCSW_ACTL_SCHACT)); |
89 | if (scsw_is_solicited(&irb->scsw)) { | 89 | if (scsw_is_solicited(&irb->scsw)) { |
90 | cp_update_scsw(&private->cp, &irb->scsw); | 90 | cp_update_scsw(&private->cp, &irb->scsw); |
91 | if (is_final) | 91 | if (is_final && private->state == VFIO_CCW_STATE_CP_PENDING) |
92 | cp_free(&private->cp); | 92 | cp_free(&private->cp); |
93 | } | 93 | } |
94 | mutex_lock(&private->io_mutex); | 94 | mutex_lock(&private->io_mutex); |
diff --git a/drivers/s390/virtio/virtio_ccw.c b/drivers/s390/virtio/virtio_ccw.c index 1a55e5942d36..957889a42d2e 100644 --- a/drivers/s390/virtio/virtio_ccw.c +++ b/drivers/s390/virtio/virtio_ccw.c | |||
@@ -145,6 +145,8 @@ struct airq_info { | |||
145 | struct airq_iv *aiv; | 145 | struct airq_iv *aiv; |
146 | }; | 146 | }; |
147 | static struct airq_info *airq_areas[MAX_AIRQ_AREAS]; | 147 | static struct airq_info *airq_areas[MAX_AIRQ_AREAS]; |
148 | static DEFINE_MUTEX(airq_areas_lock); | ||
149 | |||
148 | static u8 *summary_indicators; | 150 | static u8 *summary_indicators; |
149 | 151 | ||
150 | static inline u8 *get_summary_indicator(struct airq_info *info) | 152 | static inline u8 *get_summary_indicator(struct airq_info *info) |
@@ -265,9 +267,11 @@ static unsigned long get_airq_indicator(struct virtqueue *vqs[], int nvqs, | |||
265 | unsigned long bit, flags; | 267 | unsigned long bit, flags; |
266 | 268 | ||
267 | for (i = 0; i < MAX_AIRQ_AREAS && !indicator_addr; i++) { | 269 | for (i = 0; i < MAX_AIRQ_AREAS && !indicator_addr; i++) { |
270 | mutex_lock(&airq_areas_lock); | ||
268 | if (!airq_areas[i]) | 271 | if (!airq_areas[i]) |
269 | airq_areas[i] = new_airq_info(i); | 272 | airq_areas[i] = new_airq_info(i); |
270 | info = airq_areas[i]; | 273 | info = airq_areas[i]; |
274 | mutex_unlock(&airq_areas_lock); | ||
271 | if (!info) | 275 | if (!info) |
272 | return 0; | 276 | return 0; |
273 | write_lock_irqsave(&info->lock, flags); | 277 | write_lock_irqsave(&info->lock, flags); |
diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig index 75f66f8ad3ea..1b92f3c19ff3 100644 --- a/drivers/scsi/Kconfig +++ b/drivers/scsi/Kconfig | |||
@@ -1523,10 +1523,10 @@ config SCSI_VIRTIO | |||
1523 | 1523 | ||
1524 | source "drivers/scsi/csiostor/Kconfig" | 1524 | source "drivers/scsi/csiostor/Kconfig" |
1525 | 1525 | ||
1526 | endif # SCSI_LOWLEVEL | ||
1527 | |||
1528 | source "drivers/scsi/pcmcia/Kconfig" | 1526 | source "drivers/scsi/pcmcia/Kconfig" |
1529 | 1527 | ||
1528 | endif # SCSI_LOWLEVEL | ||
1529 | |||
1530 | source "drivers/scsi/device_handler/Kconfig" | 1530 | source "drivers/scsi/device_handler/Kconfig" |
1531 | 1531 | ||
1532 | endmenu | 1532 | endmenu |
diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/device_handler/scsi_dh_alua.c index f0066f8a1786..4971104b1817 100644 --- a/drivers/scsi/device_handler/scsi_dh_alua.c +++ b/drivers/scsi/device_handler/scsi_dh_alua.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #define ALUA_FAILOVER_TIMEOUT 60 | 40 | #define ALUA_FAILOVER_TIMEOUT 60 |
41 | #define ALUA_FAILOVER_RETRIES 5 | 41 | #define ALUA_FAILOVER_RETRIES 5 |
42 | #define ALUA_RTPG_DELAY_MSECS 5 | 42 | #define ALUA_RTPG_DELAY_MSECS 5 |
43 | #define ALUA_RTPG_RETRY_DELAY 2 | ||
43 | 44 | ||
44 | /* device handler flags */ | 45 | /* device handler flags */ |
45 | #define ALUA_OPTIMIZE_STPG 0x01 | 46 | #define ALUA_OPTIMIZE_STPG 0x01 |
@@ -682,7 +683,7 @@ static int alua_rtpg(struct scsi_device *sdev, struct alua_port_group *pg) | |||
682 | case SCSI_ACCESS_STATE_TRANSITIONING: | 683 | case SCSI_ACCESS_STATE_TRANSITIONING: |
683 | if (time_before(jiffies, pg->expiry)) { | 684 | if (time_before(jiffies, pg->expiry)) { |
684 | /* State transition, retry */ | 685 | /* State transition, retry */ |
685 | pg->interval = 2; | 686 | pg->interval = ALUA_RTPG_RETRY_DELAY; |
686 | err = SCSI_DH_RETRY; | 687 | err = SCSI_DH_RETRY; |
687 | } else { | 688 | } else { |
688 | struct alua_dh_data *h; | 689 | struct alua_dh_data *h; |
@@ -807,6 +808,8 @@ static void alua_rtpg_work(struct work_struct *work) | |||
807 | spin_lock_irqsave(&pg->lock, flags); | 808 | spin_lock_irqsave(&pg->lock, flags); |
808 | pg->flags &= ~ALUA_PG_RUNNING; | 809 | pg->flags &= ~ALUA_PG_RUNNING; |
809 | pg->flags |= ALUA_PG_RUN_RTPG; | 810 | pg->flags |= ALUA_PG_RUN_RTPG; |
811 | if (!pg->interval) | ||
812 | pg->interval = ALUA_RTPG_RETRY_DELAY; | ||
810 | spin_unlock_irqrestore(&pg->lock, flags); | 813 | spin_unlock_irqrestore(&pg->lock, flags); |
811 | queue_delayed_work(kaluad_wq, &pg->rtpg_work, | 814 | queue_delayed_work(kaluad_wq, &pg->rtpg_work, |
812 | pg->interval * HZ); | 815 | pg->interval * HZ); |
@@ -818,6 +821,8 @@ static void alua_rtpg_work(struct work_struct *work) | |||
818 | spin_lock_irqsave(&pg->lock, flags); | 821 | spin_lock_irqsave(&pg->lock, flags); |
819 | if (err == SCSI_DH_RETRY || pg->flags & ALUA_PG_RUN_RTPG) { | 822 | if (err == SCSI_DH_RETRY || pg->flags & ALUA_PG_RUN_RTPG) { |
820 | pg->flags &= ~ALUA_PG_RUNNING; | 823 | pg->flags &= ~ALUA_PG_RUNNING; |
824 | if (!pg->interval && !(pg->flags & ALUA_PG_RUN_RTPG)) | ||
825 | pg->interval = ALUA_RTPG_RETRY_DELAY; | ||
821 | pg->flags |= ALUA_PG_RUN_RTPG; | 826 | pg->flags |= ALUA_PG_RUN_RTPG; |
822 | spin_unlock_irqrestore(&pg->lock, flags); | 827 | spin_unlock_irqrestore(&pg->lock, flags); |
823 | queue_delayed_work(kaluad_wq, &pg->rtpg_work, | 828 | queue_delayed_work(kaluad_wq, &pg->rtpg_work, |
diff --git a/drivers/scsi/fcoe/fcoe_ctlr.c b/drivers/scsi/fcoe/fcoe_ctlr.c index 590ec8009f52..1a85fe9e4b7b 100644 --- a/drivers/scsi/fcoe/fcoe_ctlr.c +++ b/drivers/scsi/fcoe/fcoe_ctlr.c | |||
@@ -1019,7 +1019,7 @@ static void fcoe_ctlr_recv_adv(struct fcoe_ctlr *fip, struct sk_buff *skb) | |||
1019 | { | 1019 | { |
1020 | struct fcoe_fcf *fcf; | 1020 | struct fcoe_fcf *fcf; |
1021 | struct fcoe_fcf new; | 1021 | struct fcoe_fcf new; |
1022 | unsigned long sol_tov = msecs_to_jiffies(FCOE_CTRL_SOL_TOV); | 1022 | unsigned long sol_tov = msecs_to_jiffies(FCOE_CTLR_SOL_TOV); |
1023 | int first = 0; | 1023 | int first = 0; |
1024 | int mtu_valid; | 1024 | int mtu_valid; |
1025 | int found = 0; | 1025 | int found = 0; |
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 43a6b5350775..eaf6177ac9ee 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c | |||
@@ -7798,7 +7798,7 @@ static void hpsa_free_pci_init(struct ctlr_info *h) | |||
7798 | hpsa_disable_interrupt_mode(h); /* pci_init 2 */ | 7798 | hpsa_disable_interrupt_mode(h); /* pci_init 2 */ |
7799 | /* | 7799 | /* |
7800 | * call pci_disable_device before pci_release_regions per | 7800 | * call pci_disable_device before pci_release_regions per |
7801 | * Documentation/PCI/pci.rst | 7801 | * Documentation/driver-api/pci/pci.rst |
7802 | */ | 7802 | */ |
7803 | pci_disable_device(h->pdev); /* pci_init 1 */ | 7803 | pci_disable_device(h->pdev); /* pci_init 1 */ |
7804 | pci_release_regions(h->pdev); /* pci_init 2 */ | 7804 | pci_release_regions(h->pdev); /* pci_init 2 */ |
@@ -7881,7 +7881,7 @@ clean2: /* intmode+region, pci */ | |||
7881 | clean1: | 7881 | clean1: |
7882 | /* | 7882 | /* |
7883 | * call pci_disable_device before pci_release_regions per | 7883 | * call pci_disable_device before pci_release_regions per |
7884 | * Documentation/PCI/pci.rst | 7884 | * Documentation/driver-api/pci/pci.rst |
7885 | */ | 7885 | */ |
7886 | pci_disable_device(h->pdev); | 7886 | pci_disable_device(h->pdev); |
7887 | pci_release_regions(h->pdev); | 7887 | pci_release_regions(h->pdev); |
diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c index acd16e0d52cf..8cdbac076a1b 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.c +++ b/drivers/scsi/ibmvscsi/ibmvfc.c | |||
@@ -4864,8 +4864,8 @@ static int ibmvfc_remove(struct vio_dev *vdev) | |||
4864 | 4864 | ||
4865 | spin_lock_irqsave(vhost->host->host_lock, flags); | 4865 | spin_lock_irqsave(vhost->host->host_lock, flags); |
4866 | ibmvfc_purge_requests(vhost, DID_ERROR); | 4866 | ibmvfc_purge_requests(vhost, DID_ERROR); |
4867 | ibmvfc_free_event_pool(vhost); | ||
4868 | spin_unlock_irqrestore(vhost->host->host_lock, flags); | 4867 | spin_unlock_irqrestore(vhost->host->host_lock, flags); |
4868 | ibmvfc_free_event_pool(vhost); | ||
4869 | 4869 | ||
4870 | ibmvfc_free_mem(vhost); | 4870 | ibmvfc_free_mem(vhost); |
4871 | spin_lock(&ibmvfc_driver_lock); | 4871 | spin_lock(&ibmvfc_driver_lock); |
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index b2339d04a700..f9f07935556e 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c | |||
@@ -3163,6 +3163,7 @@ fw_crash_buffer_show(struct device *cdev, | |||
3163 | (struct megasas_instance *) shost->hostdata; | 3163 | (struct megasas_instance *) shost->hostdata; |
3164 | u32 size; | 3164 | u32 size; |
3165 | unsigned long dmachunk = CRASH_DMA_BUF_SIZE; | 3165 | unsigned long dmachunk = CRASH_DMA_BUF_SIZE; |
3166 | unsigned long chunk_left_bytes; | ||
3166 | unsigned long src_addr; | 3167 | unsigned long src_addr; |
3167 | unsigned long flags; | 3168 | unsigned long flags; |
3168 | u32 buff_offset; | 3169 | u32 buff_offset; |
@@ -3186,6 +3187,8 @@ fw_crash_buffer_show(struct device *cdev, | |||
3186 | } | 3187 | } |
3187 | 3188 | ||
3188 | size = (instance->fw_crash_buffer_size * dmachunk) - buff_offset; | 3189 | size = (instance->fw_crash_buffer_size * dmachunk) - buff_offset; |
3190 | chunk_left_bytes = dmachunk - (buff_offset % dmachunk); | ||
3191 | size = (size > chunk_left_bytes) ? chunk_left_bytes : size; | ||
3189 | size = (size >= PAGE_SIZE) ? (PAGE_SIZE - 1) : size; | 3192 | size = (size >= PAGE_SIZE) ? (PAGE_SIZE - 1) : size; |
3190 | 3193 | ||
3191 | src_addr = (unsigned long)instance->crash_buf[buff_offset / dmachunk] + | 3194 | src_addr = (unsigned long)instance->crash_buf[buff_offset / dmachunk] + |
@@ -8763,7 +8766,7 @@ static int __init megasas_init(void) | |||
8763 | 8766 | ||
8764 | if ((event_log_level < MFI_EVT_CLASS_DEBUG) || | 8767 | if ((event_log_level < MFI_EVT_CLASS_DEBUG) || |
8765 | (event_log_level > MFI_EVT_CLASS_DEAD)) { | 8768 | (event_log_level > MFI_EVT_CLASS_DEAD)) { |
8766 | printk(KERN_WARNING "megarid_sas: provided event log level is out of range, setting it to default 2(CLASS_CRITICAL), permissible range is: -2 to 4\n"); | 8769 | pr_warn("megaraid_sas: provided event log level is out of range, setting it to default 2(CLASS_CRITICAL), permissible range is: -2 to 4\n"); |
8767 | event_log_level = MFI_EVT_CLASS_CRITICAL; | 8770 | event_log_level = MFI_EVT_CLASS_CRITICAL; |
8768 | } | 8771 | } |
8769 | 8772 | ||
diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index a32b3f0fcd15..120e3c4de8c2 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c | |||
@@ -537,7 +537,7 @@ static int megasas_create_sg_sense_fusion(struct megasas_instance *instance) | |||
537 | return 0; | 537 | return 0; |
538 | } | 538 | } |
539 | 539 | ||
540 | int | 540 | static int |
541 | megasas_alloc_cmdlist_fusion(struct megasas_instance *instance) | 541 | megasas_alloc_cmdlist_fusion(struct megasas_instance *instance) |
542 | { | 542 | { |
543 | u32 max_mpt_cmd, i, j; | 543 | u32 max_mpt_cmd, i, j; |
@@ -576,7 +576,8 @@ megasas_alloc_cmdlist_fusion(struct megasas_instance *instance) | |||
576 | 576 | ||
577 | return 0; | 577 | return 0; |
578 | } | 578 | } |
579 | int | 579 | |
580 | static int | ||
580 | megasas_alloc_request_fusion(struct megasas_instance *instance) | 581 | megasas_alloc_request_fusion(struct megasas_instance *instance) |
581 | { | 582 | { |
582 | struct fusion_context *fusion; | 583 | struct fusion_context *fusion; |
@@ -657,7 +658,7 @@ retry_alloc: | |||
657 | return 0; | 658 | return 0; |
658 | } | 659 | } |
659 | 660 | ||
660 | int | 661 | static int |
661 | megasas_alloc_reply_fusion(struct megasas_instance *instance) | 662 | megasas_alloc_reply_fusion(struct megasas_instance *instance) |
662 | { | 663 | { |
663 | int i, count; | 664 | int i, count; |
@@ -734,7 +735,7 @@ megasas_alloc_reply_fusion(struct megasas_instance *instance) | |||
734 | return 0; | 735 | return 0; |
735 | } | 736 | } |
736 | 737 | ||
737 | int | 738 | static int |
738 | megasas_alloc_rdpq_fusion(struct megasas_instance *instance) | 739 | megasas_alloc_rdpq_fusion(struct megasas_instance *instance) |
739 | { | 740 | { |
740 | int i, j, k, msix_count; | 741 | int i, j, k, msix_count; |
@@ -916,7 +917,7 @@ megasas_free_reply_fusion(struct megasas_instance *instance) { | |||
916 | * and is used as SMID of the cmd. | 917 | * and is used as SMID of the cmd. |
917 | * SMID value range is from 1 to max_fw_cmds. | 918 | * SMID value range is from 1 to max_fw_cmds. |
918 | */ | 919 | */ |
919 | int | 920 | static int |
920 | megasas_alloc_cmds_fusion(struct megasas_instance *instance) | 921 | megasas_alloc_cmds_fusion(struct megasas_instance *instance) |
921 | { | 922 | { |
922 | int i; | 923 | int i; |
@@ -1736,7 +1737,7 @@ static inline void megasas_free_ioc_init_cmd(struct megasas_instance *instance) | |||
1736 | * | 1737 | * |
1737 | * This is the main function for initializing firmware. | 1738 | * This is the main function for initializing firmware. |
1738 | */ | 1739 | */ |
1739 | u32 | 1740 | static u32 |
1740 | megasas_init_adapter_fusion(struct megasas_instance *instance) | 1741 | megasas_init_adapter_fusion(struct megasas_instance *instance) |
1741 | { | 1742 | { |
1742 | struct fusion_context *fusion; | 1743 | struct fusion_context *fusion; |
@@ -1962,7 +1963,7 @@ megasas_fusion_stop_watchdog(struct megasas_instance *instance) | |||
1962 | * @ext_status : ext status of cmd returned by FW | 1963 | * @ext_status : ext status of cmd returned by FW |
1963 | */ | 1964 | */ |
1964 | 1965 | ||
1965 | void | 1966 | static void |
1966 | map_cmd_status(struct fusion_context *fusion, | 1967 | map_cmd_status(struct fusion_context *fusion, |
1967 | struct scsi_cmnd *scmd, u8 status, u8 ext_status, | 1968 | struct scsi_cmnd *scmd, u8 status, u8 ext_status, |
1968 | u32 data_length, u8 *sense) | 1969 | u32 data_length, u8 *sense) |
@@ -2375,7 +2376,7 @@ int megasas_make_sgl(struct megasas_instance *instance, struct scsi_cmnd *scp, | |||
2375 | * | 2376 | * |
2376 | * Used to set the PD LBA in CDB for FP IOs | 2377 | * Used to set the PD LBA in CDB for FP IOs |
2377 | */ | 2378 | */ |
2378 | void | 2379 | static void |
2379 | megasas_set_pd_lba(struct MPI2_RAID_SCSI_IO_REQUEST *io_request, u8 cdb_len, | 2380 | megasas_set_pd_lba(struct MPI2_RAID_SCSI_IO_REQUEST *io_request, u8 cdb_len, |
2380 | struct IO_REQUEST_INFO *io_info, struct scsi_cmnd *scp, | 2381 | struct IO_REQUEST_INFO *io_info, struct scsi_cmnd *scp, |
2381 | struct MR_DRV_RAID_MAP_ALL *local_map_ptr, u32 ref_tag) | 2382 | struct MR_DRV_RAID_MAP_ALL *local_map_ptr, u32 ref_tag) |
@@ -2714,7 +2715,7 @@ megasas_set_raidflag_cpu_affinity(struct fusion_context *fusion, | |||
2714 | * Prepares the io_request and chain elements (sg_frame) for IO | 2715 | * Prepares the io_request and chain elements (sg_frame) for IO |
2715 | * The IO can be for PD (Fast Path) or LD | 2716 | * The IO can be for PD (Fast Path) or LD |
2716 | */ | 2717 | */ |
2717 | void | 2718 | static void |
2718 | megasas_build_ldio_fusion(struct megasas_instance *instance, | 2719 | megasas_build_ldio_fusion(struct megasas_instance *instance, |
2719 | struct scsi_cmnd *scp, | 2720 | struct scsi_cmnd *scp, |
2720 | struct megasas_cmd_fusion *cmd) | 2721 | struct megasas_cmd_fusion *cmd) |
@@ -3211,7 +3212,7 @@ megasas_build_syspd_fusion(struct megasas_instance *instance, | |||
3211 | * Invokes helper functions to prepare request frames | 3212 | * Invokes helper functions to prepare request frames |
3212 | * and sets flags appropriate for IO/Non-IO cmd | 3213 | * and sets flags appropriate for IO/Non-IO cmd |
3213 | */ | 3214 | */ |
3214 | int | 3215 | static int |
3215 | megasas_build_io_fusion(struct megasas_instance *instance, | 3216 | megasas_build_io_fusion(struct megasas_instance *instance, |
3216 | struct scsi_cmnd *scp, | 3217 | struct scsi_cmnd *scp, |
3217 | struct megasas_cmd_fusion *cmd) | 3218 | struct megasas_cmd_fusion *cmd) |
@@ -3325,9 +3326,9 @@ megasas_get_request_descriptor(struct megasas_instance *instance, u16 index) | |||
3325 | /* megasas_prepate_secondRaid1_IO | 3326 | /* megasas_prepate_secondRaid1_IO |
3326 | * It prepares the raid 1 second IO | 3327 | * It prepares the raid 1 second IO |
3327 | */ | 3328 | */ |
3328 | void megasas_prepare_secondRaid1_IO(struct megasas_instance *instance, | 3329 | static void megasas_prepare_secondRaid1_IO(struct megasas_instance *instance, |
3329 | struct megasas_cmd_fusion *cmd, | 3330 | struct megasas_cmd_fusion *cmd, |
3330 | struct megasas_cmd_fusion *r1_cmd) | 3331 | struct megasas_cmd_fusion *r1_cmd) |
3331 | { | 3332 | { |
3332 | union MEGASAS_REQUEST_DESCRIPTOR_UNION *req_desc, *req_desc2 = NULL; | 3333 | union MEGASAS_REQUEST_DESCRIPTOR_UNION *req_desc, *req_desc2 = NULL; |
3333 | struct fusion_context *fusion; | 3334 | struct fusion_context *fusion; |
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 9381171c2fc0..11e64b50497f 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -1784,8 +1784,10 @@ void __scsi_init_queue(struct Scsi_Host *shost, struct request_queue *q) | |||
1784 | blk_queue_max_integrity_segments(q, shost->sg_prot_tablesize); | 1784 | blk_queue_max_integrity_segments(q, shost->sg_prot_tablesize); |
1785 | } | 1785 | } |
1786 | 1786 | ||
1787 | shost->max_sectors = min_t(unsigned int, shost->max_sectors, | 1787 | if (dev->dma_mask) { |
1788 | dma_max_mapping_size(dev) << SECTOR_SHIFT); | 1788 | shost->max_sectors = min_t(unsigned int, shost->max_sectors, |
1789 | dma_max_mapping_size(dev) >> SECTOR_SHIFT); | ||
1790 | } | ||
1789 | blk_queue_max_hw_sectors(q, shost->max_sectors); | 1791 | blk_queue_max_hw_sectors(q, shost->max_sectors); |
1790 | if (shost->unchecked_isa_dma) | 1792 | if (shost->unchecked_isa_dma) |
1791 | blk_queue_bounce_limit(q, BLK_BOUNCE_ISA); | 1793 | blk_queue_bounce_limit(q, BLK_BOUNCE_ISA); |
diff --git a/drivers/soc/fsl/qe/qe.c b/drivers/soc/fsl/qe/qe.c index 62c6ba17991a..c9519e62308c 100644 --- a/drivers/soc/fsl/qe/qe.c +++ b/drivers/soc/fsl/qe/qe.c | |||
@@ -419,7 +419,7 @@ static void qe_upload_microcode(const void *base, | |||
419 | /* | 419 | /* |
420 | * Upload a microcode to the I-RAM at a specific address. | 420 | * Upload a microcode to the I-RAM at a specific address. |
421 | * | 421 | * |
422 | * See Documentation/powerpc/qe_firmware.txt for information on QE microcode | 422 | * See Documentation/powerpc/qe_firmware.rst for information on QE microcode |
423 | * uploading. | 423 | * uploading. |
424 | * | 424 | * |
425 | * Currently, only version 1 is supported, so the 'version' field must be | 425 | * Currently, only version 1 is supported, so the 'version' field must be |
diff --git a/drivers/target/iscsi/cxgbit/cxgbit_cm.c b/drivers/target/iscsi/cxgbit/cxgbit_cm.c index 22dd4c457d6a..c70caf4ea490 100644 --- a/drivers/target/iscsi/cxgbit/cxgbit_cm.c +++ b/drivers/target/iscsi/cxgbit/cxgbit_cm.c | |||
@@ -875,10 +875,12 @@ static u8 cxgbit_get_iscsi_dcb_priority(struct net_device *ndev, u16 local_port) | |||
875 | return 0; | 875 | return 0; |
876 | 876 | ||
877 | if (caps & DCB_CAP_DCBX_VER_IEEE) { | 877 | if (caps & DCB_CAP_DCBX_VER_IEEE) { |
878 | iscsi_dcb_app.selector = IEEE_8021QAZ_APP_SEL_ANY; | 878 | iscsi_dcb_app.selector = IEEE_8021QAZ_APP_SEL_STREAM; |
879 | |||
880 | ret = dcb_ieee_getapp_mask(ndev, &iscsi_dcb_app); | 879 | ret = dcb_ieee_getapp_mask(ndev, &iscsi_dcb_app); |
881 | 880 | if (!ret) { | |
881 | iscsi_dcb_app.selector = IEEE_8021QAZ_APP_SEL_ANY; | ||
882 | ret = dcb_ieee_getapp_mask(ndev, &iscsi_dcb_app); | ||
883 | } | ||
882 | } else if (caps & DCB_CAP_DCBX_VER_CEE) { | 884 | } else if (caps & DCB_CAP_DCBX_VER_CEE) { |
883 | iscsi_dcb_app.selector = DCB_APP_IDTYPE_PORTNUM; | 885 | iscsi_dcb_app.selector = DCB_APP_IDTYPE_PORTNUM; |
884 | 886 | ||
diff --git a/drivers/target/iscsi/cxgbit/cxgbit_main.c b/drivers/target/iscsi/cxgbit/cxgbit_main.c index 343b129c2cfa..e877b917c15f 100644 --- a/drivers/target/iscsi/cxgbit/cxgbit_main.c +++ b/drivers/target/iscsi/cxgbit/cxgbit_main.c | |||
@@ -589,7 +589,8 @@ static void cxgbit_dcb_workfn(struct work_struct *work) | |||
589 | iscsi_app = &dcb_work->dcb_app; | 589 | iscsi_app = &dcb_work->dcb_app; |
590 | 590 | ||
591 | if (iscsi_app->dcbx & DCB_CAP_DCBX_VER_IEEE) { | 591 | if (iscsi_app->dcbx & DCB_CAP_DCBX_VER_IEEE) { |
592 | if (iscsi_app->app.selector != IEEE_8021QAZ_APP_SEL_ANY) | 592 | if ((iscsi_app->app.selector != IEEE_8021QAZ_APP_SEL_STREAM) && |
593 | (iscsi_app->app.selector != IEEE_8021QAZ_APP_SEL_ANY)) | ||
593 | goto out; | 594 | goto out; |
594 | 595 | ||
595 | priority = iscsi_app->app.priority; | 596 | priority = iscsi_app->app.priority; |
diff --git a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c index 213ab3cc6b80..d3446acf9bbd 100644 --- a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c +++ b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c | |||
@@ -487,6 +487,7 @@ static int proc_thermal_rapl_add(struct pci_dev *pdev, | |||
487 | rapl_mmio_cpu_online, rapl_mmio_cpu_down_prep); | 487 | rapl_mmio_cpu_online, rapl_mmio_cpu_down_prep); |
488 | if (ret < 0) { | 488 | if (ret < 0) { |
489 | powercap_unregister_control_type(rapl_mmio_priv.control_type); | 489 | powercap_unregister_control_type(rapl_mmio_priv.control_type); |
490 | rapl_mmio_priv.control_type = NULL; | ||
490 | return ret; | 491 | return ret; |
491 | } | 492 | } |
492 | rapl_mmio_priv.pcap_rapl_online = ret; | 493 | rapl_mmio_priv.pcap_rapl_online = ret; |
@@ -496,6 +497,9 @@ static int proc_thermal_rapl_add(struct pci_dev *pdev, | |||
496 | 497 | ||
497 | static void proc_thermal_rapl_remove(void) | 498 | static void proc_thermal_rapl_remove(void) |
498 | { | 499 | { |
500 | if (IS_ERR_OR_NULL(rapl_mmio_priv.control_type)) | ||
501 | return; | ||
502 | |||
499 | cpuhp_remove_state(rapl_mmio_priv.pcap_rapl_online); | 503 | cpuhp_remove_state(rapl_mmio_priv.pcap_rapl_online); |
500 | powercap_unregister_control_type(rapl_mmio_priv.control_type); | 504 | powercap_unregister_control_type(rapl_mmio_priv.control_type); |
501 | } | 505 | } |
diff --git a/drivers/tty/hvc/hvcs.c b/drivers/tty/hvc/hvcs.c index cb4db1b3ca3c..5fb214e67d73 100644 --- a/drivers/tty/hvc/hvcs.c +++ b/drivers/tty/hvc/hvcs.c | |||
@@ -47,7 +47,7 @@ | |||
47 | * using the 2.6 Linux kernel kref construct. | 47 | * using the 2.6 Linux kernel kref construct. |
48 | * | 48 | * |
49 | * For direction on installation and usage of this driver please reference | 49 | * For direction on installation and usage of this driver please reference |
50 | * Documentation/powerpc/hvcs.txt. | 50 | * Documentation/powerpc/hvcs.rst. |
51 | */ | 51 | */ |
52 | 52 | ||
53 | #include <linux/device.h> | 53 | #include <linux/device.h> |
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig index fd385c8c53a5..3083dbae35f7 100644 --- a/drivers/tty/serial/Kconfig +++ b/drivers/tty/serial/Kconfig | |||
@@ -1035,25 +1035,6 @@ config SERIAL_VT8500_CONSOLE | |||
1035 | depends on SERIAL_VT8500=y | 1035 | depends on SERIAL_VT8500=y |
1036 | select SERIAL_CORE_CONSOLE | 1036 | select SERIAL_CORE_CONSOLE |
1037 | 1037 | ||
1038 | config SERIAL_NETX | ||
1039 | tristate "NetX serial port support" | ||
1040 | depends on ARCH_NETX | ||
1041 | select SERIAL_CORE | ||
1042 | help | ||
1043 | If you have a machine based on a Hilscher NetX SoC you | ||
1044 | can enable its onboard serial port by enabling this option. | ||
1045 | |||
1046 | To compile this driver as a module, choose M here: the | ||
1047 | module will be called netx-serial. | ||
1048 | |||
1049 | config SERIAL_NETX_CONSOLE | ||
1050 | bool "Console on NetX serial port" | ||
1051 | depends on SERIAL_NETX=y | ||
1052 | select SERIAL_CORE_CONSOLE | ||
1053 | help | ||
1054 | If you have enabled the serial port on the Hilscher NetX SoC | ||
1055 | you can make it the console by answering Y to this option. | ||
1056 | |||
1057 | config SERIAL_OMAP | 1038 | config SERIAL_OMAP |
1058 | tristate "OMAP serial port support" | 1039 | tristate "OMAP serial port support" |
1059 | depends on ARCH_OMAP2PLUS | 1040 | depends on ARCH_OMAP2PLUS |
diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile index 7cd7cabfa6c4..15a0fccadf7e 100644 --- a/drivers/tty/serial/Makefile +++ b/drivers/tty/serial/Makefile | |||
@@ -59,7 +59,6 @@ obj-$(CONFIG_SERIAL_ATMEL) += atmel_serial.o | |||
59 | obj-$(CONFIG_SERIAL_UARTLITE) += uartlite.o | 59 | obj-$(CONFIG_SERIAL_UARTLITE) += uartlite.o |
60 | obj-$(CONFIG_SERIAL_MSM) += msm_serial.o | 60 | obj-$(CONFIG_SERIAL_MSM) += msm_serial.o |
61 | obj-$(CONFIG_SERIAL_QCOM_GENI) += qcom_geni_serial.o | 61 | obj-$(CONFIG_SERIAL_QCOM_GENI) += qcom_geni_serial.o |
62 | obj-$(CONFIG_SERIAL_NETX) += netx-serial.o | ||
63 | obj-$(CONFIG_SERIAL_KS8695) += serial_ks8695.o | 62 | obj-$(CONFIG_SERIAL_KS8695) += serial_ks8695.o |
64 | obj-$(CONFIG_SERIAL_OMAP) += omap-serial.o | 63 | obj-$(CONFIG_SERIAL_OMAP) += omap-serial.o |
65 | obj-$(CONFIG_SERIAL_ALTERA_UART) += altera_uart.o | 64 | obj-$(CONFIG_SERIAL_ALTERA_UART) += altera_uart.o |
diff --git a/drivers/tty/serial/netx-serial.c b/drivers/tty/serial/netx-serial.c deleted file mode 100644 index b3556863491f..000000000000 --- a/drivers/tty/serial/netx-serial.c +++ /dev/null | |||
@@ -1,733 +0,0 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
2 | /* | ||
3 | * Copyright (c) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix | ||
4 | */ | ||
5 | |||
6 | #if defined(CONFIG_SERIAL_NETX_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) | ||
7 | #define SUPPORT_SYSRQ | ||
8 | #endif | ||
9 | |||
10 | #include <linux/device.h> | ||
11 | #include <linux/module.h> | ||
12 | #include <linux/ioport.h> | ||
13 | #include <linux/init.h> | ||
14 | #include <linux/console.h> | ||
15 | #include <linux/sysrq.h> | ||
16 | #include <linux/platform_device.h> | ||
17 | #include <linux/tty.h> | ||
18 | #include <linux/tty_flip.h> | ||
19 | #include <linux/serial_core.h> | ||
20 | #include <linux/serial.h> | ||
21 | |||
22 | #include <asm/io.h> | ||
23 | #include <asm/irq.h> | ||
24 | #include <mach/hardware.h> | ||
25 | #include <mach/netx-regs.h> | ||
26 | |||
27 | /* We've been assigned a range on the "Low-density serial ports" major */ | ||
28 | #define SERIAL_NX_MAJOR 204 | ||
29 | #define MINOR_START 170 | ||
30 | |||
31 | enum uart_regs { | ||
32 | UART_DR = 0x00, | ||
33 | UART_SR = 0x04, | ||
34 | UART_LINE_CR = 0x08, | ||
35 | UART_BAUDDIV_MSB = 0x0c, | ||
36 | UART_BAUDDIV_LSB = 0x10, | ||
37 | UART_CR = 0x14, | ||
38 | UART_FR = 0x18, | ||
39 | UART_IIR = 0x1c, | ||
40 | UART_ILPR = 0x20, | ||
41 | UART_RTS_CR = 0x24, | ||
42 | UART_RTS_LEAD = 0x28, | ||
43 | UART_RTS_TRAIL = 0x2c, | ||
44 | UART_DRV_ENABLE = 0x30, | ||
45 | UART_BRM_CR = 0x34, | ||
46 | UART_RXFIFO_IRQLEVEL = 0x38, | ||
47 | UART_TXFIFO_IRQLEVEL = 0x3c, | ||
48 | }; | ||
49 | |||
50 | #define SR_FE (1<<0) | ||
51 | #define SR_PE (1<<1) | ||
52 | #define SR_BE (1<<2) | ||
53 | #define SR_OE (1<<3) | ||
54 | |||
55 | #define LINE_CR_BRK (1<<0) | ||
56 | #define LINE_CR_PEN (1<<1) | ||
57 | #define LINE_CR_EPS (1<<2) | ||
58 | #define LINE_CR_STP2 (1<<3) | ||
59 | #define LINE_CR_FEN (1<<4) | ||
60 | #define LINE_CR_5BIT (0<<5) | ||
61 | #define LINE_CR_6BIT (1<<5) | ||
62 | #define LINE_CR_7BIT (2<<5) | ||
63 | #define LINE_CR_8BIT (3<<5) | ||
64 | #define LINE_CR_BITS_MASK (3<<5) | ||
65 | |||
66 | #define CR_UART_EN (1<<0) | ||
67 | #define CR_SIREN (1<<1) | ||
68 | #define CR_SIRLP (1<<2) | ||
69 | #define CR_MSIE (1<<3) | ||
70 | #define CR_RIE (1<<4) | ||
71 | #define CR_TIE (1<<5) | ||
72 | #define CR_RTIE (1<<6) | ||
73 | #define CR_LBE (1<<7) | ||
74 | |||
75 | #define FR_CTS (1<<0) | ||
76 | #define FR_DSR (1<<1) | ||
77 | #define FR_DCD (1<<2) | ||
78 | #define FR_BUSY (1<<3) | ||
79 | #define FR_RXFE (1<<4) | ||
80 | #define FR_TXFF (1<<5) | ||
81 | #define FR_RXFF (1<<6) | ||
82 | #define FR_TXFE (1<<7) | ||
83 | |||
84 | #define IIR_MIS (1<<0) | ||
85 | #define IIR_RIS (1<<1) | ||
86 | #define IIR_TIS (1<<2) | ||
87 | #define IIR_RTIS (1<<3) | ||
88 | #define IIR_MASK 0xf | ||
89 | |||
90 | #define RTS_CR_AUTO (1<<0) | ||
91 | #define RTS_CR_RTS (1<<1) | ||
92 | #define RTS_CR_COUNT (1<<2) | ||
93 | #define RTS_CR_MOD2 (1<<3) | ||
94 | #define RTS_CR_RTS_POL (1<<4) | ||
95 | #define RTS_CR_CTS_CTR (1<<5) | ||
96 | #define RTS_CR_CTS_POL (1<<6) | ||
97 | #define RTS_CR_STICK (1<<7) | ||
98 | |||
99 | #define UART_PORT_SIZE 0x40 | ||
100 | #define DRIVER_NAME "netx-uart" | ||
101 | |||
102 | struct netx_port { | ||
103 | struct uart_port port; | ||
104 | }; | ||
105 | |||
106 | static void netx_stop_tx(struct uart_port *port) | ||
107 | { | ||
108 | unsigned int val; | ||
109 | val = readl(port->membase + UART_CR); | ||
110 | writel(val & ~CR_TIE, port->membase + UART_CR); | ||
111 | } | ||
112 | |||
113 | static void netx_stop_rx(struct uart_port *port) | ||
114 | { | ||
115 | unsigned int val; | ||
116 | val = readl(port->membase + UART_CR); | ||
117 | writel(val & ~CR_RIE, port->membase + UART_CR); | ||
118 | } | ||
119 | |||
120 | static void netx_enable_ms(struct uart_port *port) | ||
121 | { | ||
122 | unsigned int val; | ||
123 | val = readl(port->membase + UART_CR); | ||
124 | writel(val | CR_MSIE, port->membase + UART_CR); | ||
125 | } | ||
126 | |||
127 | static inline void netx_transmit_buffer(struct uart_port *port) | ||
128 | { | ||
129 | struct circ_buf *xmit = &port->state->xmit; | ||
130 | |||
131 | if (port->x_char) { | ||
132 | writel(port->x_char, port->membase + UART_DR); | ||
133 | port->icount.tx++; | ||
134 | port->x_char = 0; | ||
135 | return; | ||
136 | } | ||
137 | |||
138 | if (uart_tx_stopped(port) || uart_circ_empty(xmit)) { | ||
139 | netx_stop_tx(port); | ||
140 | return; | ||
141 | } | ||
142 | |||
143 | do { | ||
144 | /* send xmit->buf[xmit->tail] | ||
145 | * out the port here */ | ||
146 | writel(xmit->buf[xmit->tail], port->membase + UART_DR); | ||
147 | xmit->tail = (xmit->tail + 1) & | ||
148 | (UART_XMIT_SIZE - 1); | ||
149 | port->icount.tx++; | ||
150 | if (uart_circ_empty(xmit)) | ||
151 | break; | ||
152 | } while (!(readl(port->membase + UART_FR) & FR_TXFF)); | ||
153 | |||
154 | if (uart_circ_empty(xmit)) | ||
155 | netx_stop_tx(port); | ||
156 | } | ||
157 | |||
158 | static void netx_start_tx(struct uart_port *port) | ||
159 | { | ||
160 | writel( | ||
161 | readl(port->membase + UART_CR) | CR_TIE, port->membase + UART_CR); | ||
162 | |||
163 | if (!(readl(port->membase + UART_FR) & FR_TXFF)) | ||
164 | netx_transmit_buffer(port); | ||
165 | } | ||
166 | |||
167 | static unsigned int netx_tx_empty(struct uart_port *port) | ||
168 | { | ||
169 | return readl(port->membase + UART_FR) & FR_BUSY ? 0 : TIOCSER_TEMT; | ||
170 | } | ||
171 | |||
172 | static void netx_txint(struct uart_port *port) | ||
173 | { | ||
174 | struct circ_buf *xmit = &port->state->xmit; | ||
175 | |||
176 | if (uart_circ_empty(xmit) || uart_tx_stopped(port)) { | ||
177 | netx_stop_tx(port); | ||
178 | return; | ||
179 | } | ||
180 | |||
181 | netx_transmit_buffer(port); | ||
182 | |||
183 | if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) | ||
184 | uart_write_wakeup(port); | ||
185 | } | ||
186 | |||
187 | static void netx_rxint(struct uart_port *port, unsigned long *flags) | ||
188 | { | ||
189 | unsigned char rx, flg, status; | ||
190 | |||
191 | while (!(readl(port->membase + UART_FR) & FR_RXFE)) { | ||
192 | rx = readl(port->membase + UART_DR); | ||
193 | flg = TTY_NORMAL; | ||
194 | port->icount.rx++; | ||
195 | status = readl(port->membase + UART_SR); | ||
196 | if (status & SR_BE) { | ||
197 | writel(0, port->membase + UART_SR); | ||
198 | if (uart_handle_break(port)) | ||
199 | continue; | ||
200 | } | ||
201 | |||
202 | if (unlikely(status & (SR_FE | SR_PE | SR_OE))) { | ||
203 | |||
204 | if (status & SR_PE) | ||
205 | port->icount.parity++; | ||
206 | else if (status & SR_FE) | ||
207 | port->icount.frame++; | ||
208 | if (status & SR_OE) | ||
209 | port->icount.overrun++; | ||
210 | |||
211 | status &= port->read_status_mask; | ||
212 | |||
213 | if (status & SR_BE) | ||
214 | flg = TTY_BREAK; | ||
215 | else if (status & SR_PE) | ||
216 | flg = TTY_PARITY; | ||
217 | else if (status & SR_FE) | ||
218 | flg = TTY_FRAME; | ||
219 | } | ||
220 | |||
221 | if (uart_handle_sysrq_char(port, rx)) | ||
222 | continue; | ||
223 | |||
224 | uart_insert_char(port, status, SR_OE, rx, flg); | ||
225 | } | ||
226 | |||
227 | spin_unlock_irqrestore(&port->lock, *flags); | ||
228 | tty_flip_buffer_push(&port->state->port); | ||
229 | spin_lock_irqsave(&port->lock, *flags); | ||
230 | } | ||
231 | |||
232 | static irqreturn_t netx_int(int irq, void *dev_id) | ||
233 | { | ||
234 | struct uart_port *port = dev_id; | ||
235 | unsigned long flags; | ||
236 | unsigned char status; | ||
237 | |||
238 | spin_lock_irqsave(&port->lock,flags); | ||
239 | |||
240 | status = readl(port->membase + UART_IIR) & IIR_MASK; | ||
241 | while (status) { | ||
242 | if (status & IIR_RIS) | ||
243 | netx_rxint(port, &flags); | ||
244 | if (status & IIR_TIS) | ||
245 | netx_txint(port); | ||
246 | if (status & IIR_MIS) { | ||
247 | if (readl(port->membase + UART_FR) & FR_CTS) | ||
248 | uart_handle_cts_change(port, 1); | ||
249 | else | ||
250 | uart_handle_cts_change(port, 0); | ||
251 | } | ||
252 | writel(0, port->membase + UART_IIR); | ||
253 | status = readl(port->membase + UART_IIR) & IIR_MASK; | ||
254 | } | ||
255 | |||
256 | spin_unlock_irqrestore(&port->lock,flags); | ||
257 | return IRQ_HANDLED; | ||
258 | } | ||
259 | |||
260 | static unsigned int netx_get_mctrl(struct uart_port *port) | ||
261 | { | ||
262 | unsigned int ret = TIOCM_DSR | TIOCM_CAR; | ||
263 | |||
264 | if (readl(port->membase + UART_FR) & FR_CTS) | ||
265 | ret |= TIOCM_CTS; | ||
266 | |||
267 | return ret; | ||
268 | } | ||
269 | |||
270 | static void netx_set_mctrl(struct uart_port *port, unsigned int mctrl) | ||
271 | { | ||
272 | unsigned int val; | ||
273 | |||
274 | /* FIXME: Locking needed ? */ | ||
275 | if (mctrl & TIOCM_RTS) { | ||
276 | val = readl(port->membase + UART_RTS_CR); | ||
277 | writel(val | RTS_CR_RTS, port->membase + UART_RTS_CR); | ||
278 | } | ||
279 | } | ||
280 | |||
281 | static void netx_break_ctl(struct uart_port *port, int break_state) | ||
282 | { | ||
283 | unsigned int line_cr; | ||
284 | spin_lock_irq(&port->lock); | ||
285 | |||
286 | line_cr = readl(port->membase + UART_LINE_CR); | ||
287 | if (break_state != 0) | ||
288 | line_cr |= LINE_CR_BRK; | ||
289 | else | ||
290 | line_cr &= ~LINE_CR_BRK; | ||
291 | writel(line_cr, port->membase + UART_LINE_CR); | ||
292 | |||
293 | spin_unlock_irq(&port->lock); | ||
294 | } | ||
295 | |||
296 | static int netx_startup(struct uart_port *port) | ||
297 | { | ||
298 | int ret; | ||
299 | |||
300 | ret = request_irq(port->irq, netx_int, 0, | ||
301 | DRIVER_NAME, port); | ||
302 | if (ret) { | ||
303 | dev_err(port->dev, "unable to grab irq%d\n",port->irq); | ||
304 | goto exit; | ||
305 | } | ||
306 | |||
307 | writel(readl(port->membase + UART_LINE_CR) | LINE_CR_FEN, | ||
308 | port->membase + UART_LINE_CR); | ||
309 | |||
310 | writel(CR_MSIE | CR_RIE | CR_TIE | CR_RTIE | CR_UART_EN, | ||
311 | port->membase + UART_CR); | ||
312 | |||
313 | exit: | ||
314 | return ret; | ||
315 | } | ||
316 | |||
317 | static void netx_shutdown(struct uart_port *port) | ||
318 | { | ||
319 | writel(0, port->membase + UART_CR) ; | ||
320 | |||
321 | free_irq(port->irq, port); | ||
322 | } | ||
323 | |||
324 | static void | ||
325 | netx_set_termios(struct uart_port *port, struct ktermios *termios, | ||
326 | struct ktermios *old) | ||
327 | { | ||
328 | unsigned int baud, quot; | ||
329 | unsigned char old_cr; | ||
330 | unsigned char line_cr = LINE_CR_FEN; | ||
331 | unsigned char rts_cr = 0; | ||
332 | |||
333 | switch (termios->c_cflag & CSIZE) { | ||
334 | case CS5: | ||
335 | line_cr |= LINE_CR_5BIT; | ||
336 | break; | ||
337 | case CS6: | ||
338 | line_cr |= LINE_CR_6BIT; | ||
339 | break; | ||
340 | case CS7: | ||
341 | line_cr |= LINE_CR_7BIT; | ||
342 | break; | ||
343 | case CS8: | ||
344 | line_cr |= LINE_CR_8BIT; | ||
345 | break; | ||
346 | } | ||
347 | |||
348 | if (termios->c_cflag & CSTOPB) | ||
349 | line_cr |= LINE_CR_STP2; | ||
350 | |||
351 | if (termios->c_cflag & PARENB) { | ||
352 | line_cr |= LINE_CR_PEN; | ||
353 | if (!(termios->c_cflag & PARODD)) | ||
354 | line_cr |= LINE_CR_EPS; | ||
355 | } | ||
356 | |||
357 | if (termios->c_cflag & CRTSCTS) | ||
358 | rts_cr = RTS_CR_AUTO | RTS_CR_CTS_CTR | RTS_CR_RTS_POL; | ||
359 | |||
360 | baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16); | ||
361 | quot = baud * 4096; | ||
362 | quot /= 1000; | ||
363 | quot *= 256; | ||
364 | quot /= 100000; | ||
365 | |||
366 | spin_lock_irq(&port->lock); | ||
367 | |||
368 | uart_update_timeout(port, termios->c_cflag, baud); | ||
369 | |||
370 | old_cr = readl(port->membase + UART_CR); | ||
371 | |||
372 | /* disable interrupts */ | ||
373 | writel(old_cr & ~(CR_MSIE | CR_RIE | CR_TIE | CR_RTIE), | ||
374 | port->membase + UART_CR); | ||
375 | |||
376 | /* drain transmitter */ | ||
377 | while (readl(port->membase + UART_FR) & FR_BUSY); | ||
378 | |||
379 | /* disable UART */ | ||
380 | writel(old_cr & ~CR_UART_EN, port->membase + UART_CR); | ||
381 | |||
382 | /* modem status interrupts */ | ||
383 | old_cr &= ~CR_MSIE; | ||
384 | if (UART_ENABLE_MS(port, termios->c_cflag)) | ||
385 | old_cr |= CR_MSIE; | ||
386 | |||
387 | writel((quot>>8) & 0xff, port->membase + UART_BAUDDIV_MSB); | ||
388 | writel(quot & 0xff, port->membase + UART_BAUDDIV_LSB); | ||
389 | writel(line_cr, port->membase + UART_LINE_CR); | ||
390 | |||
391 | writel(rts_cr, port->membase + UART_RTS_CR); | ||
392 | |||
393 | /* | ||
394 | * Characters to ignore | ||
395 | */ | ||
396 | port->ignore_status_mask = 0; | ||
397 | if (termios->c_iflag & IGNPAR) | ||
398 | port->ignore_status_mask |= SR_PE; | ||
399 | if (termios->c_iflag & IGNBRK) { | ||
400 | port->ignore_status_mask |= SR_BE; | ||
401 | /* | ||
402 | * If we're ignoring parity and break indicators, | ||
403 | * ignore overruns too (for real raw support). | ||
404 | */ | ||
405 | if (termios->c_iflag & IGNPAR) | ||
406 | port->ignore_status_mask |= SR_PE; | ||
407 | } | ||
408 | |||
409 | port->read_status_mask = 0; | ||
410 | if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) | ||
411 | port->read_status_mask |= SR_BE; | ||
412 | if (termios->c_iflag & INPCK) | ||
413 | port->read_status_mask |= SR_PE | SR_FE; | ||
414 | |||
415 | writel(old_cr, port->membase + UART_CR); | ||
416 | |||
417 | spin_unlock_irq(&port->lock); | ||
418 | } | ||
419 | |||
420 | static const char *netx_type(struct uart_port *port) | ||
421 | { | ||
422 | return port->type == PORT_NETX ? "NETX" : NULL; | ||
423 | } | ||
424 | |||
425 | static void netx_release_port(struct uart_port *port) | ||
426 | { | ||
427 | release_mem_region(port->mapbase, UART_PORT_SIZE); | ||
428 | } | ||
429 | |||
430 | static int netx_request_port(struct uart_port *port) | ||
431 | { | ||
432 | return request_mem_region(port->mapbase, UART_PORT_SIZE, | ||
433 | DRIVER_NAME) != NULL ? 0 : -EBUSY; | ||
434 | } | ||
435 | |||
436 | static void netx_config_port(struct uart_port *port, int flags) | ||
437 | { | ||
438 | if (flags & UART_CONFIG_TYPE && netx_request_port(port) == 0) | ||
439 | port->type = PORT_NETX; | ||
440 | } | ||
441 | |||
442 | static int | ||
443 | netx_verify_port(struct uart_port *port, struct serial_struct *ser) | ||
444 | { | ||
445 | int ret = 0; | ||
446 | |||
447 | if (ser->type != PORT_UNKNOWN && ser->type != PORT_NETX) | ||
448 | ret = -EINVAL; | ||
449 | |||
450 | return ret; | ||
451 | } | ||
452 | |||
453 | static struct uart_ops netx_pops = { | ||
454 | .tx_empty = netx_tx_empty, | ||
455 | .set_mctrl = netx_set_mctrl, | ||
456 | .get_mctrl = netx_get_mctrl, | ||
457 | .stop_tx = netx_stop_tx, | ||
458 | .start_tx = netx_start_tx, | ||
459 | .stop_rx = netx_stop_rx, | ||
460 | .enable_ms = netx_enable_ms, | ||
461 | .break_ctl = netx_break_ctl, | ||
462 | .startup = netx_startup, | ||
463 | .shutdown = netx_shutdown, | ||
464 | .set_termios = netx_set_termios, | ||
465 | .type = netx_type, | ||
466 | .release_port = netx_release_port, | ||
467 | .request_port = netx_request_port, | ||
468 | .config_port = netx_config_port, | ||
469 | .verify_port = netx_verify_port, | ||
470 | }; | ||
471 | |||
472 | static struct netx_port netx_ports[] = { | ||
473 | { | ||
474 | .port = { | ||
475 | .type = PORT_NETX, | ||
476 | .iotype = UPIO_MEM, | ||
477 | .membase = (char __iomem *)io_p2v(NETX_PA_UART0), | ||
478 | .mapbase = NETX_PA_UART0, | ||
479 | .irq = NETX_IRQ_UART0, | ||
480 | .uartclk = 100000000, | ||
481 | .fifosize = 16, | ||
482 | .flags = UPF_BOOT_AUTOCONF, | ||
483 | .ops = &netx_pops, | ||
484 | .line = 0, | ||
485 | }, | ||
486 | }, { | ||
487 | .port = { | ||
488 | .type = PORT_NETX, | ||
489 | .iotype = UPIO_MEM, | ||
490 | .membase = (char __iomem *)io_p2v(NETX_PA_UART1), | ||
491 | .mapbase = NETX_PA_UART1, | ||
492 | .irq = NETX_IRQ_UART1, | ||
493 | .uartclk = 100000000, | ||
494 | .fifosize = 16, | ||
495 | .flags = UPF_BOOT_AUTOCONF, | ||
496 | .ops = &netx_pops, | ||
497 | .line = 1, | ||
498 | }, | ||
499 | }, { | ||
500 | .port = { | ||
501 | .type = PORT_NETX, | ||
502 | .iotype = UPIO_MEM, | ||
503 | .membase = (char __iomem *)io_p2v(NETX_PA_UART2), | ||
504 | .mapbase = NETX_PA_UART2, | ||
505 | .irq = NETX_IRQ_UART2, | ||
506 | .uartclk = 100000000, | ||
507 | .fifosize = 16, | ||
508 | .flags = UPF_BOOT_AUTOCONF, | ||
509 | .ops = &netx_pops, | ||
510 | .line = 2, | ||
511 | }, | ||
512 | } | ||
513 | }; | ||
514 | |||
515 | #ifdef CONFIG_SERIAL_NETX_CONSOLE | ||
516 | |||
517 | static void netx_console_putchar(struct uart_port *port, int ch) | ||
518 | { | ||
519 | while (readl(port->membase + UART_FR) & FR_BUSY); | ||
520 | writel(ch, port->membase + UART_DR); | ||
521 | } | ||
522 | |||
523 | static void | ||
524 | netx_console_write(struct console *co, const char *s, unsigned int count) | ||
525 | { | ||
526 | struct uart_port *port = &netx_ports[co->index].port; | ||
527 | unsigned char cr_save; | ||
528 | |||
529 | cr_save = readl(port->membase + UART_CR); | ||
530 | writel(cr_save | CR_UART_EN, port->membase + UART_CR); | ||
531 | |||
532 | uart_console_write(port, s, count, netx_console_putchar); | ||
533 | |||
534 | while (readl(port->membase + UART_FR) & FR_BUSY); | ||
535 | writel(cr_save, port->membase + UART_CR); | ||
536 | } | ||
537 | |||
538 | static void __init | ||
539 | netx_console_get_options(struct uart_port *port, int *baud, | ||
540 | int *parity, int *bits, int *flow) | ||
541 | { | ||
542 | unsigned char line_cr; | ||
543 | |||
544 | *baud = (readl(port->membase + UART_BAUDDIV_MSB) << 8) | | ||
545 | readl(port->membase + UART_BAUDDIV_LSB); | ||
546 | *baud *= 1000; | ||
547 | *baud /= 4096; | ||
548 | *baud *= 1000; | ||
549 | *baud /= 256; | ||
550 | *baud *= 100; | ||
551 | |||
552 | line_cr = readl(port->membase + UART_LINE_CR); | ||
553 | *parity = 'n'; | ||
554 | if (line_cr & LINE_CR_PEN) { | ||
555 | if (line_cr & LINE_CR_EPS) | ||
556 | *parity = 'e'; | ||
557 | else | ||
558 | *parity = 'o'; | ||
559 | } | ||
560 | |||
561 | switch (line_cr & LINE_CR_BITS_MASK) { | ||
562 | case LINE_CR_8BIT: | ||
563 | *bits = 8; | ||
564 | break; | ||
565 | case LINE_CR_7BIT: | ||
566 | *bits = 7; | ||
567 | break; | ||
568 | case LINE_CR_6BIT: | ||
569 | *bits = 6; | ||
570 | break; | ||
571 | case LINE_CR_5BIT: | ||
572 | *bits = 5; | ||
573 | break; | ||
574 | } | ||
575 | |||
576 | if (readl(port->membase + UART_RTS_CR) & RTS_CR_AUTO) | ||
577 | *flow = 'r'; | ||
578 | } | ||
579 | |||
580 | static int __init | ||
581 | netx_console_setup(struct console *co, char *options) | ||
582 | { | ||
583 | struct netx_port *sport; | ||
584 | int baud = 9600; | ||
585 | int bits = 8; | ||
586 | int parity = 'n'; | ||
587 | int flow = 'n'; | ||
588 | |||
589 | /* | ||
590 | * Check whether an invalid uart number has been specified, and | ||
591 | * if so, search for the first available port that does have | ||
592 | * console support. | ||
593 | */ | ||
594 | if (co->index == -1 || co->index >= ARRAY_SIZE(netx_ports)) | ||
595 | co->index = 0; | ||
596 | sport = &netx_ports[co->index]; | ||
597 | |||
598 | if (options) { | ||
599 | uart_parse_options(options, &baud, &parity, &bits, &flow); | ||
600 | } else { | ||
601 | /* if the UART is enabled, assume it has been correctly setup | ||
602 | * by the bootloader and get the options | ||
603 | */ | ||
604 | if (readl(sport->port.membase + UART_CR) & CR_UART_EN) { | ||
605 | netx_console_get_options(&sport->port, &baud, | ||
606 | &parity, &bits, &flow); | ||
607 | } | ||
608 | |||
609 | } | ||
610 | |||
611 | return uart_set_options(&sport->port, co, baud, parity, bits, flow); | ||
612 | } | ||
613 | |||
614 | static struct uart_driver netx_reg; | ||
615 | static struct console netx_console = { | ||
616 | .name = "ttyNX", | ||
617 | .write = netx_console_write, | ||
618 | .device = uart_console_device, | ||
619 | .setup = netx_console_setup, | ||
620 | .flags = CON_PRINTBUFFER, | ||
621 | .index = -1, | ||
622 | .data = &netx_reg, | ||
623 | }; | ||
624 | |||
625 | static int __init netx_console_init(void) | ||
626 | { | ||
627 | register_console(&netx_console); | ||
628 | return 0; | ||
629 | } | ||
630 | console_initcall(netx_console_init); | ||
631 | |||
632 | #define NETX_CONSOLE &netx_console | ||
633 | #else | ||
634 | #define NETX_CONSOLE NULL | ||
635 | #endif | ||
636 | |||
637 | static struct uart_driver netx_reg = { | ||
638 | .owner = THIS_MODULE, | ||
639 | .driver_name = DRIVER_NAME, | ||
640 | .dev_name = "ttyNX", | ||
641 | .major = SERIAL_NX_MAJOR, | ||
642 | .minor = MINOR_START, | ||
643 | .nr = ARRAY_SIZE(netx_ports), | ||
644 | .cons = NETX_CONSOLE, | ||
645 | }; | ||
646 | |||
647 | static int serial_netx_suspend(struct platform_device *pdev, pm_message_t state) | ||
648 | { | ||
649 | struct netx_port *sport = platform_get_drvdata(pdev); | ||
650 | |||
651 | if (sport) | ||
652 | uart_suspend_port(&netx_reg, &sport->port); | ||
653 | |||
654 | return 0; | ||
655 | } | ||
656 | |||
657 | static int serial_netx_resume(struct platform_device *pdev) | ||
658 | { | ||
659 | struct netx_port *sport = platform_get_drvdata(pdev); | ||
660 | |||
661 | if (sport) | ||
662 | uart_resume_port(&netx_reg, &sport->port); | ||
663 | |||
664 | return 0; | ||
665 | } | ||
666 | |||
667 | static int serial_netx_probe(struct platform_device *pdev) | ||
668 | { | ||
669 | struct uart_port *port = &netx_ports[pdev->id].port; | ||
670 | |||
671 | dev_info(&pdev->dev, "initialising\n"); | ||
672 | |||
673 | port->dev = &pdev->dev; | ||
674 | |||
675 | writel(1, port->membase + UART_RXFIFO_IRQLEVEL); | ||
676 | uart_add_one_port(&netx_reg, &netx_ports[pdev->id].port); | ||
677 | platform_set_drvdata(pdev, &netx_ports[pdev->id]); | ||
678 | |||
679 | return 0; | ||
680 | } | ||
681 | |||
682 | static int serial_netx_remove(struct platform_device *pdev) | ||
683 | { | ||
684 | struct netx_port *sport = platform_get_drvdata(pdev); | ||
685 | |||
686 | if (sport) | ||
687 | uart_remove_one_port(&netx_reg, &sport->port); | ||
688 | |||
689 | return 0; | ||
690 | } | ||
691 | |||
692 | static struct platform_driver serial_netx_driver = { | ||
693 | .probe = serial_netx_probe, | ||
694 | .remove = serial_netx_remove, | ||
695 | |||
696 | .suspend = serial_netx_suspend, | ||
697 | .resume = serial_netx_resume, | ||
698 | |||
699 | .driver = { | ||
700 | .name = DRIVER_NAME, | ||
701 | }, | ||
702 | }; | ||
703 | |||
704 | static int __init netx_serial_init(void) | ||
705 | { | ||
706 | int ret; | ||
707 | |||
708 | printk(KERN_INFO "Serial: NetX driver\n"); | ||
709 | |||
710 | ret = uart_register_driver(&netx_reg); | ||
711 | if (ret) | ||
712 | return ret; | ||
713 | |||
714 | ret = platform_driver_register(&serial_netx_driver); | ||
715 | if (ret != 0) | ||
716 | uart_unregister_driver(&netx_reg); | ||
717 | |||
718 | return 0; | ||
719 | } | ||
720 | |||
721 | static void __exit netx_serial_exit(void) | ||
722 | { | ||
723 | platform_driver_unregister(&serial_netx_driver); | ||
724 | uart_unregister_driver(&netx_reg); | ||
725 | } | ||
726 | |||
727 | module_init(netx_serial_init); | ||
728 | module_exit(netx_serial_exit); | ||
729 | |||
730 | MODULE_AUTHOR("Sascha Hauer"); | ||
731 | MODULE_DESCRIPTION("NetX serial port driver"); | ||
732 | MODULE_LICENSE("GPL"); | ||
733 | MODULE_ALIAS("platform:" DRIVER_NAME); | ||
diff --git a/drivers/tty/tty_ldsem.c b/drivers/tty/tty_ldsem.c index 717292c1c0df..60ff236a3d63 100644 --- a/drivers/tty/tty_ldsem.c +++ b/drivers/tty/tty_ldsem.c | |||
@@ -93,8 +93,7 @@ static void __ldsem_wake_readers(struct ld_semaphore *sem) | |||
93 | 93 | ||
94 | list_for_each_entry_safe(waiter, next, &sem->read_wait, list) { | 94 | list_for_each_entry_safe(waiter, next, &sem->read_wait, list) { |
95 | tsk = waiter->task; | 95 | tsk = waiter->task; |
96 | smp_mb(); | 96 | smp_store_release(&waiter->task, NULL); |
97 | waiter->task = NULL; | ||
98 | wake_up_process(tsk); | 97 | wake_up_process(tsk); |
99 | put_task_struct(tsk); | 98 | put_task_struct(tsk); |
100 | } | 99 | } |
@@ -194,7 +193,7 @@ down_read_failed(struct ld_semaphore *sem, long count, long timeout) | |||
194 | for (;;) { | 193 | for (;;) { |
195 | set_current_state(TASK_UNINTERRUPTIBLE); | 194 | set_current_state(TASK_UNINTERRUPTIBLE); |
196 | 195 | ||
197 | if (!waiter.task) | 196 | if (!smp_load_acquire(&waiter.task)) |
198 | break; | 197 | break; |
199 | if (!timeout) | 198 | if (!timeout) |
200 | break; | 199 | break; |
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index ec92f36ab5c4..34aa39d1aed9 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c | |||
@@ -3771,7 +3771,11 @@ static ssize_t show_bind(struct device *dev, struct device_attribute *attr, | |||
3771 | char *buf) | 3771 | char *buf) |
3772 | { | 3772 | { |
3773 | struct con_driver *con = dev_get_drvdata(dev); | 3773 | struct con_driver *con = dev_get_drvdata(dev); |
3774 | int bind = con_is_bound(con->con); | 3774 | int bind; |
3775 | |||
3776 | console_lock(); | ||
3777 | bind = con_is_bound(con->con); | ||
3778 | console_unlock(); | ||
3775 | 3779 | ||
3776 | return snprintf(buf, PAGE_SIZE, "%i\n", bind); | 3780 | return snprintf(buf, PAGE_SIZE, "%i\n", bind); |
3777 | } | 3781 | } |
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 88533938ce19..9320787ac2e6 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c | |||
@@ -3052,8 +3052,8 @@ int usb_hcd_setup_local_mem(struct usb_hcd *hcd, phys_addr_t phys_addr, | |||
3052 | 3052 | ||
3053 | local_mem = devm_memremap(hcd->self.sysdev, phys_addr, | 3053 | local_mem = devm_memremap(hcd->self.sysdev, phys_addr, |
3054 | size, MEMREMAP_WC); | 3054 | size, MEMREMAP_WC); |
3055 | if (!local_mem) | 3055 | if (IS_ERR(local_mem)) |
3056 | return -ENOMEM; | 3056 | return PTR_ERR(local_mem); |
3057 | 3057 | ||
3058 | /* | 3058 | /* |
3059 | * Here we pass a dma_addr_t but the arg type is a phys_addr_t. | 3059 | * Here we pass a dma_addr_t but the arg type is a phys_addr_t. |
diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c index fe9422d3bcdc..b0882c13a1d1 100644 --- a/drivers/usb/host/ehci-pci.c +++ b/drivers/usb/host/ehci-pci.c | |||
@@ -149,7 +149,7 @@ static int ehci_pci_setup(struct usb_hcd *hcd) | |||
149 | break; | 149 | break; |
150 | case PCI_VENDOR_ID_AMD: | 150 | case PCI_VENDOR_ID_AMD: |
151 | /* AMD PLL quirk */ | 151 | /* AMD PLL quirk */ |
152 | if (usb_amd_find_chipset_info()) | 152 | if (usb_amd_quirk_pll_check()) |
153 | ehci->amd_pll_fix = 1; | 153 | ehci->amd_pll_fix = 1; |
154 | /* AMD8111 EHCI doesn't work, according to AMD errata */ | 154 | /* AMD8111 EHCI doesn't work, according to AMD errata */ |
155 | if (pdev->device == 0x7463) { | 155 | if (pdev->device == 0x7463) { |
@@ -186,7 +186,7 @@ static int ehci_pci_setup(struct usb_hcd *hcd) | |||
186 | break; | 186 | break; |
187 | case PCI_VENDOR_ID_ATI: | 187 | case PCI_VENDOR_ID_ATI: |
188 | /* AMD PLL quirk */ | 188 | /* AMD PLL quirk */ |
189 | if (usb_amd_find_chipset_info()) | 189 | if (usb_amd_quirk_pll_check()) |
190 | ehci->amd_pll_fix = 1; | 190 | ehci->amd_pll_fix = 1; |
191 | 191 | ||
192 | /* | 192 | /* |
diff --git a/drivers/usb/host/hwa-hc.c b/drivers/usb/host/hwa-hc.c index 09a8ebd95588..6968b9f2b76b 100644 --- a/drivers/usb/host/hwa-hc.c +++ b/drivers/usb/host/hwa-hc.c | |||
@@ -159,7 +159,7 @@ out: | |||
159 | return result; | 159 | return result; |
160 | 160 | ||
161 | error_set_cluster_id: | 161 | error_set_cluster_id: |
162 | wusb_cluster_id_put(wusbhc->cluster_id); | 162 | wusb_cluster_id_put(addr); |
163 | error_cluster_id_get: | 163 | error_cluster_id_get: |
164 | goto out; | 164 | goto out; |
165 | 165 | ||
diff --git a/drivers/usb/host/ohci-pci.c b/drivers/usb/host/ohci-pci.c index a033f7d855e0..f4e13a3fddee 100644 --- a/drivers/usb/host/ohci-pci.c +++ b/drivers/usb/host/ohci-pci.c | |||
@@ -152,7 +152,7 @@ static int ohci_quirk_amd700(struct usb_hcd *hcd) | |||
152 | { | 152 | { |
153 | struct ohci_hcd *ohci = hcd_to_ohci(hcd); | 153 | struct ohci_hcd *ohci = hcd_to_ohci(hcd); |
154 | 154 | ||
155 | if (usb_amd_find_chipset_info()) | 155 | if (usb_amd_quirk_pll_check()) |
156 | ohci->flags |= OHCI_QUIRK_AMD_PLL; | 156 | ohci->flags |= OHCI_QUIRK_AMD_PLL; |
157 | 157 | ||
158 | /* SB800 needs pre-fetch fix */ | 158 | /* SB800 needs pre-fetch fix */ |
diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c index 3ce71cbfbb58..f6d04491df60 100644 --- a/drivers/usb/host/pci-quirks.c +++ b/drivers/usb/host/pci-quirks.c | |||
@@ -132,7 +132,7 @@ static struct amd_chipset_info { | |||
132 | struct amd_chipset_type sb_type; | 132 | struct amd_chipset_type sb_type; |
133 | int isoc_reqs; | 133 | int isoc_reqs; |
134 | int probe_count; | 134 | int probe_count; |
135 | int probe_result; | 135 | bool need_pll_quirk; |
136 | } amd_chipset; | 136 | } amd_chipset; |
137 | 137 | ||
138 | static DEFINE_SPINLOCK(amd_lock); | 138 | static DEFINE_SPINLOCK(amd_lock); |
@@ -201,11 +201,11 @@ void sb800_prefetch(struct device *dev, int on) | |||
201 | } | 201 | } |
202 | EXPORT_SYMBOL_GPL(sb800_prefetch); | 202 | EXPORT_SYMBOL_GPL(sb800_prefetch); |
203 | 203 | ||
204 | int usb_amd_find_chipset_info(void) | 204 | static void usb_amd_find_chipset_info(void) |
205 | { | 205 | { |
206 | unsigned long flags; | 206 | unsigned long flags; |
207 | struct amd_chipset_info info; | 207 | struct amd_chipset_info info; |
208 | int ret; | 208 | info.need_pll_quirk = 0; |
209 | 209 | ||
210 | spin_lock_irqsave(&amd_lock, flags); | 210 | spin_lock_irqsave(&amd_lock, flags); |
211 | 211 | ||
@@ -213,27 +213,34 @@ int usb_amd_find_chipset_info(void) | |||
213 | if (amd_chipset.probe_count > 0) { | 213 | if (amd_chipset.probe_count > 0) { |
214 | amd_chipset.probe_count++; | 214 | amd_chipset.probe_count++; |
215 | spin_unlock_irqrestore(&amd_lock, flags); | 215 | spin_unlock_irqrestore(&amd_lock, flags); |
216 | return amd_chipset.probe_result; | 216 | return; |
217 | } | 217 | } |
218 | memset(&info, 0, sizeof(info)); | 218 | memset(&info, 0, sizeof(info)); |
219 | spin_unlock_irqrestore(&amd_lock, flags); | 219 | spin_unlock_irqrestore(&amd_lock, flags); |
220 | 220 | ||
221 | if (!amd_chipset_sb_type_init(&info)) { | 221 | if (!amd_chipset_sb_type_init(&info)) { |
222 | ret = 0; | ||
223 | goto commit; | 222 | goto commit; |
224 | } | 223 | } |
225 | 224 | ||
226 | /* Below chipset generations needn't enable AMD PLL quirk */ | 225 | switch (info.sb_type.gen) { |
227 | if (info.sb_type.gen == AMD_CHIPSET_UNKNOWN || | 226 | case AMD_CHIPSET_SB700: |
228 | info.sb_type.gen == AMD_CHIPSET_SB600 || | 227 | info.need_pll_quirk = info.sb_type.rev <= 0x3B; |
229 | info.sb_type.gen == AMD_CHIPSET_YANGTZE || | 228 | break; |
230 | (info.sb_type.gen == AMD_CHIPSET_SB700 && | 229 | case AMD_CHIPSET_SB800: |
231 | info.sb_type.rev > 0x3b)) { | 230 | case AMD_CHIPSET_HUDSON2: |
231 | case AMD_CHIPSET_BOLTON: | ||
232 | info.need_pll_quirk = 1; | ||
233 | break; | ||
234 | default: | ||
235 | info.need_pll_quirk = 0; | ||
236 | break; | ||
237 | } | ||
238 | |||
239 | if (!info.need_pll_quirk) { | ||
232 | if (info.smbus_dev) { | 240 | if (info.smbus_dev) { |
233 | pci_dev_put(info.smbus_dev); | 241 | pci_dev_put(info.smbus_dev); |
234 | info.smbus_dev = NULL; | 242 | info.smbus_dev = NULL; |
235 | } | 243 | } |
236 | ret = 0; | ||
237 | goto commit; | 244 | goto commit; |
238 | } | 245 | } |
239 | 246 | ||
@@ -252,7 +259,6 @@ int usb_amd_find_chipset_info(void) | |||
252 | } | 259 | } |
253 | } | 260 | } |
254 | 261 | ||
255 | ret = info.probe_result = 1; | ||
256 | printk(KERN_DEBUG "QUIRK: Enable AMD PLL fix\n"); | 262 | printk(KERN_DEBUG "QUIRK: Enable AMD PLL fix\n"); |
257 | 263 | ||
258 | commit: | 264 | commit: |
@@ -263,7 +269,6 @@ commit: | |||
263 | 269 | ||
264 | /* Mark that we where here */ | 270 | /* Mark that we where here */ |
265 | amd_chipset.probe_count++; | 271 | amd_chipset.probe_count++; |
266 | ret = amd_chipset.probe_result; | ||
267 | 272 | ||
268 | spin_unlock_irqrestore(&amd_lock, flags); | 273 | spin_unlock_irqrestore(&amd_lock, flags); |
269 | 274 | ||
@@ -276,10 +281,7 @@ commit: | |||
276 | amd_chipset = info; | 281 | amd_chipset = info; |
277 | spin_unlock_irqrestore(&amd_lock, flags); | 282 | spin_unlock_irqrestore(&amd_lock, flags); |
278 | } | 283 | } |
279 | |||
280 | return ret; | ||
281 | } | 284 | } |
282 | EXPORT_SYMBOL_GPL(usb_amd_find_chipset_info); | ||
283 | 285 | ||
284 | int usb_hcd_amd_remote_wakeup_quirk(struct pci_dev *pdev) | 286 | int usb_hcd_amd_remote_wakeup_quirk(struct pci_dev *pdev) |
285 | { | 287 | { |
@@ -315,6 +317,13 @@ bool usb_amd_prefetch_quirk(void) | |||
315 | } | 317 | } |
316 | EXPORT_SYMBOL_GPL(usb_amd_prefetch_quirk); | 318 | EXPORT_SYMBOL_GPL(usb_amd_prefetch_quirk); |
317 | 319 | ||
320 | bool usb_amd_quirk_pll_check(void) | ||
321 | { | ||
322 | usb_amd_find_chipset_info(); | ||
323 | return amd_chipset.need_pll_quirk; | ||
324 | } | ||
325 | EXPORT_SYMBOL_GPL(usb_amd_quirk_pll_check); | ||
326 | |||
318 | /* | 327 | /* |
319 | * The hardware normally enables the A-link power management feature, which | 328 | * The hardware normally enables the A-link power management feature, which |
320 | * lets the system lower the power consumption in idle states. | 329 | * lets the system lower the power consumption in idle states. |
@@ -520,7 +529,7 @@ void usb_amd_dev_put(void) | |||
520 | amd_chipset.nb_type = 0; | 529 | amd_chipset.nb_type = 0; |
521 | memset(&amd_chipset.sb_type, 0, sizeof(amd_chipset.sb_type)); | 530 | memset(&amd_chipset.sb_type, 0, sizeof(amd_chipset.sb_type)); |
522 | amd_chipset.isoc_reqs = 0; | 531 | amd_chipset.isoc_reqs = 0; |
523 | amd_chipset.probe_result = 0; | 532 | amd_chipset.need_pll_quirk = 0; |
524 | 533 | ||
525 | spin_unlock_irqrestore(&amd_lock, flags); | 534 | spin_unlock_irqrestore(&amd_lock, flags); |
526 | 535 | ||
diff --git a/drivers/usb/host/pci-quirks.h b/drivers/usb/host/pci-quirks.h index 63c633077d9e..e729de21fad7 100644 --- a/drivers/usb/host/pci-quirks.h +++ b/drivers/usb/host/pci-quirks.h | |||
@@ -5,11 +5,11 @@ | |||
5 | #ifdef CONFIG_USB_PCI | 5 | #ifdef CONFIG_USB_PCI |
6 | void uhci_reset_hc(struct pci_dev *pdev, unsigned long base); | 6 | void uhci_reset_hc(struct pci_dev *pdev, unsigned long base); |
7 | int uhci_check_and_reset_hc(struct pci_dev *pdev, unsigned long base); | 7 | int uhci_check_and_reset_hc(struct pci_dev *pdev, unsigned long base); |
8 | int usb_amd_find_chipset_info(void); | ||
9 | int usb_hcd_amd_remote_wakeup_quirk(struct pci_dev *pdev); | 8 | int usb_hcd_amd_remote_wakeup_quirk(struct pci_dev *pdev); |
10 | bool usb_amd_hang_symptom_quirk(void); | 9 | bool usb_amd_hang_symptom_quirk(void); |
11 | bool usb_amd_prefetch_quirk(void); | 10 | bool usb_amd_prefetch_quirk(void); |
12 | void usb_amd_dev_put(void); | 11 | void usb_amd_dev_put(void); |
12 | bool usb_amd_quirk_pll_check(void); | ||
13 | void usb_amd_quirk_pll_disable(void); | 13 | void usb_amd_quirk_pll_disable(void); |
14 | void usb_amd_quirk_pll_enable(void); | 14 | void usb_amd_quirk_pll_enable(void); |
15 | void usb_asmedia_modifyflowcontrol(struct pci_dev *pdev); | 15 | void usb_asmedia_modifyflowcontrol(struct pci_dev *pdev); |
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c index c2fe218e051f..1e0236e90687 100644 --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c | |||
@@ -130,7 +130,7 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci) | |||
130 | xhci->quirks |= XHCI_AMD_0x96_HOST; | 130 | xhci->quirks |= XHCI_AMD_0x96_HOST; |
131 | 131 | ||
132 | /* AMD PLL quirk */ | 132 | /* AMD PLL quirk */ |
133 | if (pdev->vendor == PCI_VENDOR_ID_AMD && usb_amd_find_chipset_info()) | 133 | if (pdev->vendor == PCI_VENDOR_ID_AMD && usb_amd_quirk_pll_check()) |
134 | xhci->quirks |= XHCI_AMD_PLL_FIX; | 134 | xhci->quirks |= XHCI_AMD_PLL_FIX; |
135 | 135 | ||
136 | if (pdev->vendor == PCI_VENDOR_ID_AMD && | 136 | if (pdev->vendor == PCI_VENDOR_ID_AMD && |
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index 7a264962a1a9..f5c41448d067 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h | |||
@@ -2175,7 +2175,8 @@ static inline bool xhci_urb_suitable_for_idt(struct urb *urb) | |||
2175 | if (!usb_endpoint_xfer_isoc(&urb->ep->desc) && usb_urb_dir_out(urb) && | 2175 | if (!usb_endpoint_xfer_isoc(&urb->ep->desc) && usb_urb_dir_out(urb) && |
2176 | usb_endpoint_maxp(&urb->ep->desc) >= TRB_IDT_MAX_SIZE && | 2176 | usb_endpoint_maxp(&urb->ep->desc) >= TRB_IDT_MAX_SIZE && |
2177 | urb->transfer_buffer_length <= TRB_IDT_MAX_SIZE && | 2177 | urb->transfer_buffer_length <= TRB_IDT_MAX_SIZE && |
2178 | !(urb->transfer_flags & URB_NO_TRANSFER_DMA_MAP)) | 2178 | !(urb->transfer_flags & URB_NO_TRANSFER_DMA_MAP) && |
2179 | !urb->num_sgs) | ||
2179 | return true; | 2180 | return true; |
2180 | 2181 | ||
2181 | return false; | 2182 | return false; |
diff --git a/drivers/usb/misc/usb251xb.c b/drivers/usb/misc/usb251xb.c index 4d6ae3795a88..6ca9111d150a 100644 --- a/drivers/usb/misc/usb251xb.c +++ b/drivers/usb/misc/usb251xb.c | |||
@@ -375,7 +375,8 @@ out_err: | |||
375 | 375 | ||
376 | #ifdef CONFIG_OF | 376 | #ifdef CONFIG_OF |
377 | static void usb251xb_get_ports_field(struct usb251xb *hub, | 377 | static void usb251xb_get_ports_field(struct usb251xb *hub, |
378 | const char *prop_name, u8 port_cnt, u8 *fld) | 378 | const char *prop_name, u8 port_cnt, |
379 | bool ds_only, u8 *fld) | ||
379 | { | 380 | { |
380 | struct device *dev = hub->dev; | 381 | struct device *dev = hub->dev; |
381 | struct property *prop; | 382 | struct property *prop; |
@@ -383,7 +384,7 @@ static void usb251xb_get_ports_field(struct usb251xb *hub, | |||
383 | u32 port; | 384 | u32 port; |
384 | 385 | ||
385 | of_property_for_each_u32(dev->of_node, prop_name, prop, p, port) { | 386 | of_property_for_each_u32(dev->of_node, prop_name, prop, p, port) { |
386 | if ((port >= 1) && (port <= port_cnt)) | 387 | if ((port >= ds_only ? 1 : 0) && (port <= port_cnt)) |
387 | *fld |= BIT(port); | 388 | *fld |= BIT(port); |
388 | else | 389 | else |
389 | dev_warn(dev, "port %u doesn't exist\n", port); | 390 | dev_warn(dev, "port %u doesn't exist\n", port); |
@@ -501,15 +502,15 @@ static int usb251xb_get_ofdata(struct usb251xb *hub, | |||
501 | 502 | ||
502 | hub->non_rem_dev = USB251XB_DEF_NON_REMOVABLE_DEVICES; | 503 | hub->non_rem_dev = USB251XB_DEF_NON_REMOVABLE_DEVICES; |
503 | usb251xb_get_ports_field(hub, "non-removable-ports", data->port_cnt, | 504 | usb251xb_get_ports_field(hub, "non-removable-ports", data->port_cnt, |
504 | &hub->non_rem_dev); | 505 | true, &hub->non_rem_dev); |
505 | 506 | ||
506 | hub->port_disable_sp = USB251XB_DEF_PORT_DISABLE_SELF; | 507 | hub->port_disable_sp = USB251XB_DEF_PORT_DISABLE_SELF; |
507 | usb251xb_get_ports_field(hub, "sp-disabled-ports", data->port_cnt, | 508 | usb251xb_get_ports_field(hub, "sp-disabled-ports", data->port_cnt, |
508 | &hub->port_disable_sp); | 509 | true, &hub->port_disable_sp); |
509 | 510 | ||
510 | hub->port_disable_bp = USB251XB_DEF_PORT_DISABLE_BUS; | 511 | hub->port_disable_bp = USB251XB_DEF_PORT_DISABLE_BUS; |
511 | usb251xb_get_ports_field(hub, "bp-disabled-ports", data->port_cnt, | 512 | usb251xb_get_ports_field(hub, "bp-disabled-ports", data->port_cnt, |
512 | &hub->port_disable_bp); | 513 | true, &hub->port_disable_bp); |
513 | 514 | ||
514 | hub->max_power_sp = USB251XB_DEF_MAX_POWER_SELF; | 515 | hub->max_power_sp = USB251XB_DEF_MAX_POWER_SELF; |
515 | if (!of_property_read_u32(np, "sp-max-total-current-microamp", | 516 | if (!of_property_read_u32(np, "sp-max-total-current-microamp", |
@@ -573,9 +574,7 @@ static int usb251xb_get_ofdata(struct usb251xb *hub, | |||
573 | */ | 574 | */ |
574 | hub->port_swap = USB251XB_DEF_PORT_SWAP; | 575 | hub->port_swap = USB251XB_DEF_PORT_SWAP; |
575 | usb251xb_get_ports_field(hub, "swap-dx-lanes", data->port_cnt, | 576 | usb251xb_get_ports_field(hub, "swap-dx-lanes", data->port_cnt, |
576 | &hub->port_swap); | 577 | false, &hub->port_swap); |
577 | if (of_get_property(np, "swap-us-lanes", NULL)) | ||
578 | hub->port_swap |= BIT(0); | ||
579 | 578 | ||
580 | /* The following parameters are currently not exposed to devicetree, but | 579 | /* The following parameters are currently not exposed to devicetree, but |
581 | * may be as soon as needed. | 580 | * may be as soon as needed. |
diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c index 30790240aec6..05b80211290d 100644 --- a/drivers/usb/storage/scsiglue.c +++ b/drivers/usb/storage/scsiglue.c | |||
@@ -28,6 +28,8 @@ | |||
28 | * status of a command. | 28 | * status of a command. |
29 | */ | 29 | */ |
30 | 30 | ||
31 | #include <linux/blkdev.h> | ||
32 | #include <linux/dma-mapping.h> | ||
31 | #include <linux/module.h> | 33 | #include <linux/module.h> |
32 | #include <linux/mutex.h> | 34 | #include <linux/mutex.h> |
33 | 35 | ||
@@ -99,6 +101,7 @@ static int slave_alloc (struct scsi_device *sdev) | |||
99 | static int slave_configure(struct scsi_device *sdev) | 101 | static int slave_configure(struct scsi_device *sdev) |
100 | { | 102 | { |
101 | struct us_data *us = host_to_us(sdev->host); | 103 | struct us_data *us = host_to_us(sdev->host); |
104 | struct device *dev = us->pusb_dev->bus->sysdev; | ||
102 | 105 | ||
103 | /* | 106 | /* |
104 | * Many devices have trouble transferring more than 32KB at a time, | 107 | * Many devices have trouble transferring more than 32KB at a time, |
@@ -129,6 +132,14 @@ static int slave_configure(struct scsi_device *sdev) | |||
129 | } | 132 | } |
130 | 133 | ||
131 | /* | 134 | /* |
135 | * The max_hw_sectors should be up to maximum size of a mapping for | ||
136 | * the device. Otherwise, a DMA API might fail on swiotlb environment. | ||
137 | */ | ||
138 | blk_queue_max_hw_sectors(sdev->request_queue, | ||
139 | min_t(size_t, queue_max_hw_sectors(sdev->request_queue), | ||
140 | dma_max_mapping_size(dev) >> SECTOR_SHIFT)); | ||
141 | |||
142 | /* | ||
132 | * Some USB host controllers can't do DMA; they have to use PIO. | 143 | * Some USB host controllers can't do DMA; they have to use PIO. |
133 | * They indicate this by setting their dma_mask to NULL. For | 144 | * They indicate this by setting their dma_mask to NULL. For |
134 | * such controllers we need to make sure the block layer sets | 145 | * such controllers we need to make sure the block layer sets |
diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index 819296332913..42a8c2a13ab1 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h | |||
@@ -96,7 +96,7 @@ struct vhost_uaddr { | |||
96 | }; | 96 | }; |
97 | 97 | ||
98 | #if defined(CONFIG_MMU_NOTIFIER) && ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE == 0 | 98 | #if defined(CONFIG_MMU_NOTIFIER) && ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE == 0 |
99 | #define VHOST_ARCH_CAN_ACCEL_UACCESS 1 | 99 | #define VHOST_ARCH_CAN_ACCEL_UACCESS 0 |
100 | #else | 100 | #else |
101 | #define VHOST_ARCH_CAN_ACCEL_UACCESS 0 | 101 | #define VHOST_ARCH_CAN_ACCEL_UACCESS 0 |
102 | #endif | 102 | #endif |
diff --git a/fs/afs/fsclient.c b/fs/afs/fsclient.c index 1ce73e014139..114f281f3687 100644 --- a/fs/afs/fsclient.c +++ b/fs/afs/fsclient.c | |||
@@ -339,8 +339,9 @@ static int afs_deliver_fs_fetch_data(struct afs_call *call) | |||
339 | call->tmp_u = htonl(0); | 339 | call->tmp_u = htonl(0); |
340 | afs_extract_to_tmp(call); | 340 | afs_extract_to_tmp(call); |
341 | } | 341 | } |
342 | /* Fall through */ | ||
342 | 343 | ||
343 | /* Fall through - and extract the returned data length */ | 344 | /* extract the returned data length */ |
344 | case 1: | 345 | case 1: |
345 | _debug("extract data length"); | 346 | _debug("extract data length"); |
346 | ret = afs_extract_data(call, true); | 347 | ret = afs_extract_data(call, true); |
@@ -366,8 +367,9 @@ static int afs_deliver_fs_fetch_data(struct afs_call *call) | |||
366 | call->bvec[0].bv_page = req->pages[req->index]; | 367 | call->bvec[0].bv_page = req->pages[req->index]; |
367 | iov_iter_bvec(&call->iter, READ, call->bvec, 1, size); | 368 | iov_iter_bvec(&call->iter, READ, call->bvec, 1, size); |
368 | ASSERTCMP(size, <=, PAGE_SIZE); | 369 | ASSERTCMP(size, <=, PAGE_SIZE); |
370 | /* Fall through */ | ||
369 | 371 | ||
370 | /* Fall through - and extract the returned data */ | 372 | /* extract the returned data */ |
371 | case 2: | 373 | case 2: |
372 | _debug("extract data %zu/%llu", | 374 | _debug("extract data %zu/%llu", |
373 | iov_iter_count(&call->iter), req->remain); | 375 | iov_iter_count(&call->iter), req->remain); |
@@ -394,8 +396,8 @@ static int afs_deliver_fs_fetch_data(struct afs_call *call) | |||
394 | /* Discard any excess data the server gave us */ | 396 | /* Discard any excess data the server gave us */ |
395 | iov_iter_discard(&call->iter, READ, req->actual_len - req->len); | 397 | iov_iter_discard(&call->iter, READ, req->actual_len - req->len); |
396 | call->unmarshall = 3; | 398 | call->unmarshall = 3; |
397 | |||
398 | /* Fall through */ | 399 | /* Fall through */ |
400 | |||
399 | case 3: | 401 | case 3: |
400 | _debug("extract discard %zu/%llu", | 402 | _debug("extract discard %zu/%llu", |
401 | iov_iter_count(&call->iter), req->actual_len - req->len); | 403 | iov_iter_count(&call->iter), req->actual_len - req->len); |
@@ -407,8 +409,9 @@ static int afs_deliver_fs_fetch_data(struct afs_call *call) | |||
407 | no_more_data: | 409 | no_more_data: |
408 | call->unmarshall = 4; | 410 | call->unmarshall = 4; |
409 | afs_extract_to_buf(call, (21 + 3 + 6) * 4); | 411 | afs_extract_to_buf(call, (21 + 3 + 6) * 4); |
412 | /* Fall through */ | ||
410 | 413 | ||
411 | /* Fall through - and extract the metadata */ | 414 | /* extract the metadata */ |
412 | case 4: | 415 | case 4: |
413 | ret = afs_extract_data(call, false); | 416 | ret = afs_extract_data(call, false); |
414 | if (ret < 0) | 417 | if (ret < 0) |
@@ -1471,8 +1474,9 @@ static int afs_deliver_fs_get_volume_status(struct afs_call *call) | |||
1471 | case 0: | 1474 | case 0: |
1472 | call->unmarshall++; | 1475 | call->unmarshall++; |
1473 | afs_extract_to_buf(call, 12 * 4); | 1476 | afs_extract_to_buf(call, 12 * 4); |
1477 | /* Fall through */ | ||
1474 | 1478 | ||
1475 | /* Fall through - and extract the returned status record */ | 1479 | /* extract the returned status record */ |
1476 | case 1: | 1480 | case 1: |
1477 | _debug("extract status"); | 1481 | _debug("extract status"); |
1478 | ret = afs_extract_data(call, true); | 1482 | ret = afs_extract_data(call, true); |
@@ -1483,8 +1487,9 @@ static int afs_deliver_fs_get_volume_status(struct afs_call *call) | |||
1483 | xdr_decode_AFSFetchVolumeStatus(&bp, call->out_volstatus); | 1487 | xdr_decode_AFSFetchVolumeStatus(&bp, call->out_volstatus); |
1484 | call->unmarshall++; | 1488 | call->unmarshall++; |
1485 | afs_extract_to_tmp(call); | 1489 | afs_extract_to_tmp(call); |
1490 | /* Fall through */ | ||
1486 | 1491 | ||
1487 | /* Fall through - and extract the volume name length */ | 1492 | /* extract the volume name length */ |
1488 | case 2: | 1493 | case 2: |
1489 | ret = afs_extract_data(call, true); | 1494 | ret = afs_extract_data(call, true); |
1490 | if (ret < 0) | 1495 | if (ret < 0) |
@@ -1498,8 +1503,9 @@ static int afs_deliver_fs_get_volume_status(struct afs_call *call) | |||
1498 | size = (call->count + 3) & ~3; /* It's padded */ | 1503 | size = (call->count + 3) & ~3; /* It's padded */ |
1499 | afs_extract_to_buf(call, size); | 1504 | afs_extract_to_buf(call, size); |
1500 | call->unmarshall++; | 1505 | call->unmarshall++; |
1506 | /* Fall through */ | ||
1501 | 1507 | ||
1502 | /* Fall through - and extract the volume name */ | 1508 | /* extract the volume name */ |
1503 | case 3: | 1509 | case 3: |
1504 | _debug("extract volname"); | 1510 | _debug("extract volname"); |
1505 | ret = afs_extract_data(call, true); | 1511 | ret = afs_extract_data(call, true); |
@@ -1511,8 +1517,9 @@ static int afs_deliver_fs_get_volume_status(struct afs_call *call) | |||
1511 | _debug("volname '%s'", p); | 1517 | _debug("volname '%s'", p); |
1512 | afs_extract_to_tmp(call); | 1518 | afs_extract_to_tmp(call); |
1513 | call->unmarshall++; | 1519 | call->unmarshall++; |
1520 | /* Fall through */ | ||
1514 | 1521 | ||
1515 | /* Fall through - and extract the offline message length */ | 1522 | /* extract the offline message length */ |
1516 | case 4: | 1523 | case 4: |
1517 | ret = afs_extract_data(call, true); | 1524 | ret = afs_extract_data(call, true); |
1518 | if (ret < 0) | 1525 | if (ret < 0) |
@@ -1526,8 +1533,9 @@ static int afs_deliver_fs_get_volume_status(struct afs_call *call) | |||
1526 | size = (call->count + 3) & ~3; /* It's padded */ | 1533 | size = (call->count + 3) & ~3; /* It's padded */ |
1527 | afs_extract_to_buf(call, size); | 1534 | afs_extract_to_buf(call, size); |
1528 | call->unmarshall++; | 1535 | call->unmarshall++; |
1536 | /* Fall through */ | ||
1529 | 1537 | ||
1530 | /* Fall through - and extract the offline message */ | 1538 | /* extract the offline message */ |
1531 | case 5: | 1539 | case 5: |
1532 | _debug("extract offline"); | 1540 | _debug("extract offline"); |
1533 | ret = afs_extract_data(call, true); | 1541 | ret = afs_extract_data(call, true); |
@@ -1540,8 +1548,9 @@ static int afs_deliver_fs_get_volume_status(struct afs_call *call) | |||
1540 | 1548 | ||
1541 | afs_extract_to_tmp(call); | 1549 | afs_extract_to_tmp(call); |
1542 | call->unmarshall++; | 1550 | call->unmarshall++; |
1551 | /* Fall through */ | ||
1543 | 1552 | ||
1544 | /* Fall through - and extract the message of the day length */ | 1553 | /* extract the message of the day length */ |
1545 | case 6: | 1554 | case 6: |
1546 | ret = afs_extract_data(call, true); | 1555 | ret = afs_extract_data(call, true); |
1547 | if (ret < 0) | 1556 | if (ret < 0) |
@@ -1555,8 +1564,9 @@ static int afs_deliver_fs_get_volume_status(struct afs_call *call) | |||
1555 | size = (call->count + 3) & ~3; /* It's padded */ | 1564 | size = (call->count + 3) & ~3; /* It's padded */ |
1556 | afs_extract_to_buf(call, size); | 1565 | afs_extract_to_buf(call, size); |
1557 | call->unmarshall++; | 1566 | call->unmarshall++; |
1567 | /* Fall through */ | ||
1558 | 1568 | ||
1559 | /* Fall through - and extract the message of the day */ | 1569 | /* extract the message of the day */ |
1560 | case 7: | 1570 | case 7: |
1561 | _debug("extract motd"); | 1571 | _debug("extract motd"); |
1562 | ret = afs_extract_data(call, false); | 1572 | ret = afs_extract_data(call, false); |
@@ -1850,8 +1860,9 @@ static int afs_deliver_fs_get_capabilities(struct afs_call *call) | |||
1850 | case 0: | 1860 | case 0: |
1851 | afs_extract_to_tmp(call); | 1861 | afs_extract_to_tmp(call); |
1852 | call->unmarshall++; | 1862 | call->unmarshall++; |
1863 | /* Fall through */ | ||
1853 | 1864 | ||
1854 | /* Fall through - and extract the capabilities word count */ | 1865 | /* Extract the capabilities word count */ |
1855 | case 1: | 1866 | case 1: |
1856 | ret = afs_extract_data(call, true); | 1867 | ret = afs_extract_data(call, true); |
1857 | if (ret < 0) | 1868 | if (ret < 0) |
@@ -1863,8 +1874,9 @@ static int afs_deliver_fs_get_capabilities(struct afs_call *call) | |||
1863 | call->count2 = count; | 1874 | call->count2 = count; |
1864 | iov_iter_discard(&call->iter, READ, count * sizeof(__be32)); | 1875 | iov_iter_discard(&call->iter, READ, count * sizeof(__be32)); |
1865 | call->unmarshall++; | 1876 | call->unmarshall++; |
1877 | /* Fall through */ | ||
1866 | 1878 | ||
1867 | /* Fall through - and extract capabilities words */ | 1879 | /* Extract capabilities words */ |
1868 | case 2: | 1880 | case 2: |
1869 | ret = afs_extract_data(call, false); | 1881 | ret = afs_extract_data(call, false); |
1870 | if (ret < 0) | 1882 | if (ret < 0) |
@@ -2020,9 +2032,9 @@ static int afs_deliver_fs_inline_bulk_status(struct afs_call *call) | |||
2020 | case 0: | 2032 | case 0: |
2021 | afs_extract_to_tmp(call); | 2033 | afs_extract_to_tmp(call); |
2022 | call->unmarshall++; | 2034 | call->unmarshall++; |
2035 | /* Fall through */ | ||
2023 | 2036 | ||
2024 | /* Extract the file status count and array in two steps */ | 2037 | /* Extract the file status count and array in two steps */ |
2025 | /* Fall through */ | ||
2026 | case 1: | 2038 | case 1: |
2027 | _debug("extract status count"); | 2039 | _debug("extract status count"); |
2028 | ret = afs_extract_data(call, true); | 2040 | ret = afs_extract_data(call, true); |
@@ -2039,8 +2051,8 @@ static int afs_deliver_fs_inline_bulk_status(struct afs_call *call) | |||
2039 | call->unmarshall++; | 2051 | call->unmarshall++; |
2040 | more_counts: | 2052 | more_counts: |
2041 | afs_extract_to_buf(call, 21 * sizeof(__be32)); | 2053 | afs_extract_to_buf(call, 21 * sizeof(__be32)); |
2042 | |||
2043 | /* Fall through */ | 2054 | /* Fall through */ |
2055 | |||
2044 | case 2: | 2056 | case 2: |
2045 | _debug("extract status array %u", call->count); | 2057 | _debug("extract status array %u", call->count); |
2046 | ret = afs_extract_data(call, true); | 2058 | ret = afs_extract_data(call, true); |
@@ -2060,9 +2072,9 @@ static int afs_deliver_fs_inline_bulk_status(struct afs_call *call) | |||
2060 | call->count = 0; | 2072 | call->count = 0; |
2061 | call->unmarshall++; | 2073 | call->unmarshall++; |
2062 | afs_extract_to_tmp(call); | 2074 | afs_extract_to_tmp(call); |
2075 | /* Fall through */ | ||
2063 | 2076 | ||
2064 | /* Extract the callback count and array in two steps */ | 2077 | /* Extract the callback count and array in two steps */ |
2065 | /* Fall through */ | ||
2066 | case 3: | 2078 | case 3: |
2067 | _debug("extract CB count"); | 2079 | _debug("extract CB count"); |
2068 | ret = afs_extract_data(call, true); | 2080 | ret = afs_extract_data(call, true); |
@@ -2078,8 +2090,8 @@ static int afs_deliver_fs_inline_bulk_status(struct afs_call *call) | |||
2078 | call->unmarshall++; | 2090 | call->unmarshall++; |
2079 | more_cbs: | 2091 | more_cbs: |
2080 | afs_extract_to_buf(call, 3 * sizeof(__be32)); | 2092 | afs_extract_to_buf(call, 3 * sizeof(__be32)); |
2081 | |||
2082 | /* Fall through */ | 2093 | /* Fall through */ |
2094 | |||
2083 | case 4: | 2095 | case 4: |
2084 | _debug("extract CB array"); | 2096 | _debug("extract CB array"); |
2085 | ret = afs_extract_data(call, true); | 2097 | ret = afs_extract_data(call, true); |
@@ -2096,8 +2108,8 @@ static int afs_deliver_fs_inline_bulk_status(struct afs_call *call) | |||
2096 | 2108 | ||
2097 | afs_extract_to_buf(call, 6 * sizeof(__be32)); | 2109 | afs_extract_to_buf(call, 6 * sizeof(__be32)); |
2098 | call->unmarshall++; | 2110 | call->unmarshall++; |
2099 | |||
2100 | /* Fall through */ | 2111 | /* Fall through */ |
2112 | |||
2101 | case 5: | 2113 | case 5: |
2102 | ret = afs_extract_data(call, false); | 2114 | ret = afs_extract_data(call, false); |
2103 | if (ret < 0) | 2115 | if (ret < 0) |
@@ -2193,6 +2205,7 @@ static int afs_deliver_fs_fetch_acl(struct afs_call *call) | |||
2193 | case 0: | 2205 | case 0: |
2194 | afs_extract_to_tmp(call); | 2206 | afs_extract_to_tmp(call); |
2195 | call->unmarshall++; | 2207 | call->unmarshall++; |
2208 | /* Fall through */ | ||
2196 | 2209 | ||
2197 | /* extract the returned data length */ | 2210 | /* extract the returned data length */ |
2198 | case 1: | 2211 | case 1: |
@@ -2210,6 +2223,7 @@ static int afs_deliver_fs_fetch_acl(struct afs_call *call) | |||
2210 | acl->size = call->count2; | 2223 | acl->size = call->count2; |
2211 | afs_extract_begin(call, acl->data, size); | 2224 | afs_extract_begin(call, acl->data, size); |
2212 | call->unmarshall++; | 2225 | call->unmarshall++; |
2226 | /* Fall through */ | ||
2213 | 2227 | ||
2214 | /* extract the returned data */ | 2228 | /* extract the returned data */ |
2215 | case 2: | 2229 | case 2: |
@@ -2219,6 +2233,7 @@ static int afs_deliver_fs_fetch_acl(struct afs_call *call) | |||
2219 | 2233 | ||
2220 | afs_extract_to_buf(call, (21 + 6) * 4); | 2234 | afs_extract_to_buf(call, (21 + 6) * 4); |
2221 | call->unmarshall++; | 2235 | call->unmarshall++; |
2236 | /* Fall through */ | ||
2222 | 2237 | ||
2223 | /* extract the metadata */ | 2238 | /* extract the metadata */ |
2224 | case 3: | 2239 | case 3: |
diff --git a/fs/afs/yfsclient.c b/fs/afs/yfsclient.c index 18722aaeda33..2575503170fc 100644 --- a/fs/afs/yfsclient.c +++ b/fs/afs/yfsclient.c | |||
@@ -450,8 +450,9 @@ static int yfs_deliver_fs_fetch_data64(struct afs_call *call) | |||
450 | req->offset = req->pos & (PAGE_SIZE - 1); | 450 | req->offset = req->pos & (PAGE_SIZE - 1); |
451 | afs_extract_to_tmp64(call); | 451 | afs_extract_to_tmp64(call); |
452 | call->unmarshall++; | 452 | call->unmarshall++; |
453 | /* Fall through */ | ||
453 | 454 | ||
454 | /* Fall through - and extract the returned data length */ | 455 | /* extract the returned data length */ |
455 | case 1: | 456 | case 1: |
456 | _debug("extract data length"); | 457 | _debug("extract data length"); |
457 | ret = afs_extract_data(call, true); | 458 | ret = afs_extract_data(call, true); |
@@ -477,8 +478,9 @@ static int yfs_deliver_fs_fetch_data64(struct afs_call *call) | |||
477 | call->bvec[0].bv_page = req->pages[req->index]; | 478 | call->bvec[0].bv_page = req->pages[req->index]; |
478 | iov_iter_bvec(&call->iter, READ, call->bvec, 1, size); | 479 | iov_iter_bvec(&call->iter, READ, call->bvec, 1, size); |
479 | ASSERTCMP(size, <=, PAGE_SIZE); | 480 | ASSERTCMP(size, <=, PAGE_SIZE); |
481 | /* Fall through */ | ||
480 | 482 | ||
481 | /* Fall through - and extract the returned data */ | 483 | /* extract the returned data */ |
482 | case 2: | 484 | case 2: |
483 | _debug("extract data %zu/%llu", | 485 | _debug("extract data %zu/%llu", |
484 | iov_iter_count(&call->iter), req->remain); | 486 | iov_iter_count(&call->iter), req->remain); |
@@ -505,8 +507,8 @@ static int yfs_deliver_fs_fetch_data64(struct afs_call *call) | |||
505 | /* Discard any excess data the server gave us */ | 507 | /* Discard any excess data the server gave us */ |
506 | iov_iter_discard(&call->iter, READ, req->actual_len - req->len); | 508 | iov_iter_discard(&call->iter, READ, req->actual_len - req->len); |
507 | call->unmarshall = 3; | 509 | call->unmarshall = 3; |
508 | |||
509 | /* Fall through */ | 510 | /* Fall through */ |
511 | |||
510 | case 3: | 512 | case 3: |
511 | _debug("extract discard %zu/%llu", | 513 | _debug("extract discard %zu/%llu", |
512 | iov_iter_count(&call->iter), req->actual_len - req->len); | 514 | iov_iter_count(&call->iter), req->actual_len - req->len); |
@@ -521,8 +523,9 @@ static int yfs_deliver_fs_fetch_data64(struct afs_call *call) | |||
521 | sizeof(struct yfs_xdr_YFSFetchStatus) + | 523 | sizeof(struct yfs_xdr_YFSFetchStatus) + |
522 | sizeof(struct yfs_xdr_YFSCallBack) + | 524 | sizeof(struct yfs_xdr_YFSCallBack) + |
523 | sizeof(struct yfs_xdr_YFSVolSync)); | 525 | sizeof(struct yfs_xdr_YFSVolSync)); |
526 | /* Fall through */ | ||
524 | 527 | ||
525 | /* Fall through - and extract the metadata */ | 528 | /* extract the metadata */ |
526 | case 4: | 529 | case 4: |
527 | ret = afs_extract_data(call, false); | 530 | ret = afs_extract_data(call, false); |
528 | if (ret < 0) | 531 | if (ret < 0) |
@@ -539,8 +542,8 @@ static int yfs_deliver_fs_fetch_data64(struct afs_call *call) | |||
539 | req->file_size = call->out_scb->status.size; | 542 | req->file_size = call->out_scb->status.size; |
540 | 543 | ||
541 | call->unmarshall++; | 544 | call->unmarshall++; |
542 | |||
543 | /* Fall through */ | 545 | /* Fall through */ |
546 | |||
544 | case 5: | 547 | case 5: |
545 | break; | 548 | break; |
546 | } | 549 | } |
@@ -1429,8 +1432,9 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call) | |||
1429 | case 0: | 1432 | case 0: |
1430 | call->unmarshall++; | 1433 | call->unmarshall++; |
1431 | afs_extract_to_buf(call, sizeof(struct yfs_xdr_YFSFetchVolumeStatus)); | 1434 | afs_extract_to_buf(call, sizeof(struct yfs_xdr_YFSFetchVolumeStatus)); |
1435 | /* Fall through */ | ||
1432 | 1436 | ||
1433 | /* Fall through - and extract the returned status record */ | 1437 | /* extract the returned status record */ |
1434 | case 1: | 1438 | case 1: |
1435 | _debug("extract status"); | 1439 | _debug("extract status"); |
1436 | ret = afs_extract_data(call, true); | 1440 | ret = afs_extract_data(call, true); |
@@ -1441,8 +1445,9 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call) | |||
1441 | xdr_decode_YFSFetchVolumeStatus(&bp, call->out_volstatus); | 1445 | xdr_decode_YFSFetchVolumeStatus(&bp, call->out_volstatus); |
1442 | call->unmarshall++; | 1446 | call->unmarshall++; |
1443 | afs_extract_to_tmp(call); | 1447 | afs_extract_to_tmp(call); |
1448 | /* Fall through */ | ||
1444 | 1449 | ||
1445 | /* Fall through - and extract the volume name length */ | 1450 | /* extract the volume name length */ |
1446 | case 2: | 1451 | case 2: |
1447 | ret = afs_extract_data(call, true); | 1452 | ret = afs_extract_data(call, true); |
1448 | if (ret < 0) | 1453 | if (ret < 0) |
@@ -1456,8 +1461,9 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call) | |||
1456 | size = (call->count + 3) & ~3; /* It's padded */ | 1461 | size = (call->count + 3) & ~3; /* It's padded */ |
1457 | afs_extract_to_buf(call, size); | 1462 | afs_extract_to_buf(call, size); |
1458 | call->unmarshall++; | 1463 | call->unmarshall++; |
1464 | /* Fall through */ | ||
1459 | 1465 | ||
1460 | /* Fall through - and extract the volume name */ | 1466 | /* extract the volume name */ |
1461 | case 3: | 1467 | case 3: |
1462 | _debug("extract volname"); | 1468 | _debug("extract volname"); |
1463 | ret = afs_extract_data(call, true); | 1469 | ret = afs_extract_data(call, true); |
@@ -1469,8 +1475,9 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call) | |||
1469 | _debug("volname '%s'", p); | 1475 | _debug("volname '%s'", p); |
1470 | afs_extract_to_tmp(call); | 1476 | afs_extract_to_tmp(call); |
1471 | call->unmarshall++; | 1477 | call->unmarshall++; |
1478 | /* Fall through */ | ||
1472 | 1479 | ||
1473 | /* Fall through - and extract the offline message length */ | 1480 | /* extract the offline message length */ |
1474 | case 4: | 1481 | case 4: |
1475 | ret = afs_extract_data(call, true); | 1482 | ret = afs_extract_data(call, true); |
1476 | if (ret < 0) | 1483 | if (ret < 0) |
@@ -1484,8 +1491,9 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call) | |||
1484 | size = (call->count + 3) & ~3; /* It's padded */ | 1491 | size = (call->count + 3) & ~3; /* It's padded */ |
1485 | afs_extract_to_buf(call, size); | 1492 | afs_extract_to_buf(call, size); |
1486 | call->unmarshall++; | 1493 | call->unmarshall++; |
1494 | /* Fall through */ | ||
1487 | 1495 | ||
1488 | /* Fall through - and extract the offline message */ | 1496 | /* extract the offline message */ |
1489 | case 5: | 1497 | case 5: |
1490 | _debug("extract offline"); | 1498 | _debug("extract offline"); |
1491 | ret = afs_extract_data(call, true); | 1499 | ret = afs_extract_data(call, true); |
@@ -1498,8 +1506,9 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call) | |||
1498 | 1506 | ||
1499 | afs_extract_to_tmp(call); | 1507 | afs_extract_to_tmp(call); |
1500 | call->unmarshall++; | 1508 | call->unmarshall++; |
1509 | /* Fall through */ | ||
1501 | 1510 | ||
1502 | /* Fall through - and extract the message of the day length */ | 1511 | /* extract the message of the day length */ |
1503 | case 6: | 1512 | case 6: |
1504 | ret = afs_extract_data(call, true); | 1513 | ret = afs_extract_data(call, true); |
1505 | if (ret < 0) | 1514 | if (ret < 0) |
@@ -1513,8 +1522,9 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call) | |||
1513 | size = (call->count + 3) & ~3; /* It's padded */ | 1522 | size = (call->count + 3) & ~3; /* It's padded */ |
1514 | afs_extract_to_buf(call, size); | 1523 | afs_extract_to_buf(call, size); |
1515 | call->unmarshall++; | 1524 | call->unmarshall++; |
1525 | /* Fall through */ | ||
1516 | 1526 | ||
1517 | /* Fall through - and extract the message of the day */ | 1527 | /* extract the message of the day */ |
1518 | case 7: | 1528 | case 7: |
1519 | _debug("extract motd"); | 1529 | _debug("extract motd"); |
1520 | ret = afs_extract_data(call, false); | 1530 | ret = afs_extract_data(call, false); |
@@ -1526,8 +1536,8 @@ static int yfs_deliver_fs_get_volume_status(struct afs_call *call) | |||
1526 | _debug("motd '%s'", p); | 1536 | _debug("motd '%s'", p); |
1527 | 1537 | ||
1528 | call->unmarshall++; | 1538 | call->unmarshall++; |
1529 | |||
1530 | /* Fall through */ | 1539 | /* Fall through */ |
1540 | |||
1531 | case 8: | 1541 | case 8: |
1532 | break; | 1542 | break; |
1533 | } | 1543 | } |
@@ -1805,9 +1815,9 @@ static int yfs_deliver_fs_inline_bulk_status(struct afs_call *call) | |||
1805 | case 0: | 1815 | case 0: |
1806 | afs_extract_to_tmp(call); | 1816 | afs_extract_to_tmp(call); |
1807 | call->unmarshall++; | 1817 | call->unmarshall++; |
1818 | /* Fall through */ | ||
1808 | 1819 | ||
1809 | /* Extract the file status count and array in two steps */ | 1820 | /* Extract the file status count and array in two steps */ |
1810 | /* Fall through */ | ||
1811 | case 1: | 1821 | case 1: |
1812 | _debug("extract status count"); | 1822 | _debug("extract status count"); |
1813 | ret = afs_extract_data(call, true); | 1823 | ret = afs_extract_data(call, true); |
@@ -1824,8 +1834,8 @@ static int yfs_deliver_fs_inline_bulk_status(struct afs_call *call) | |||
1824 | call->unmarshall++; | 1834 | call->unmarshall++; |
1825 | more_counts: | 1835 | more_counts: |
1826 | afs_extract_to_buf(call, sizeof(struct yfs_xdr_YFSFetchStatus)); | 1836 | afs_extract_to_buf(call, sizeof(struct yfs_xdr_YFSFetchStatus)); |
1827 | |||
1828 | /* Fall through */ | 1837 | /* Fall through */ |
1838 | |||
1829 | case 2: | 1839 | case 2: |
1830 | _debug("extract status array %u", call->count); | 1840 | _debug("extract status array %u", call->count); |
1831 | ret = afs_extract_data(call, true); | 1841 | ret = afs_extract_data(call, true); |
@@ -1845,9 +1855,9 @@ static int yfs_deliver_fs_inline_bulk_status(struct afs_call *call) | |||
1845 | call->count = 0; | 1855 | call->count = 0; |
1846 | call->unmarshall++; | 1856 | call->unmarshall++; |
1847 | afs_extract_to_tmp(call); | 1857 | afs_extract_to_tmp(call); |
1858 | /* Fall through */ | ||
1848 | 1859 | ||
1849 | /* Extract the callback count and array in two steps */ | 1860 | /* Extract the callback count and array in two steps */ |
1850 | /* Fall through */ | ||
1851 | case 3: | 1861 | case 3: |
1852 | _debug("extract CB count"); | 1862 | _debug("extract CB count"); |
1853 | ret = afs_extract_data(call, true); | 1863 | ret = afs_extract_data(call, true); |
@@ -1863,8 +1873,8 @@ static int yfs_deliver_fs_inline_bulk_status(struct afs_call *call) | |||
1863 | call->unmarshall++; | 1873 | call->unmarshall++; |
1864 | more_cbs: | 1874 | more_cbs: |
1865 | afs_extract_to_buf(call, sizeof(struct yfs_xdr_YFSCallBack)); | 1875 | afs_extract_to_buf(call, sizeof(struct yfs_xdr_YFSCallBack)); |
1866 | |||
1867 | /* Fall through */ | 1876 | /* Fall through */ |
1877 | |||
1868 | case 4: | 1878 | case 4: |
1869 | _debug("extract CB array"); | 1879 | _debug("extract CB array"); |
1870 | ret = afs_extract_data(call, true); | 1880 | ret = afs_extract_data(call, true); |
@@ -1881,8 +1891,8 @@ static int yfs_deliver_fs_inline_bulk_status(struct afs_call *call) | |||
1881 | 1891 | ||
1882 | afs_extract_to_buf(call, sizeof(struct yfs_xdr_YFSVolSync)); | 1892 | afs_extract_to_buf(call, sizeof(struct yfs_xdr_YFSVolSync)); |
1883 | call->unmarshall++; | 1893 | call->unmarshall++; |
1884 | |||
1885 | /* Fall through */ | 1894 | /* Fall through */ |
1895 | |||
1886 | case 5: | 1896 | case 5: |
1887 | ret = afs_extract_data(call, false); | 1897 | ret = afs_extract_data(call, false); |
1888 | if (ret < 0) | 1898 | if (ret < 0) |
@@ -1892,8 +1902,8 @@ static int yfs_deliver_fs_inline_bulk_status(struct afs_call *call) | |||
1892 | xdr_decode_YFSVolSync(&bp, call->out_volsync); | 1902 | xdr_decode_YFSVolSync(&bp, call->out_volsync); |
1893 | 1903 | ||
1894 | call->unmarshall++; | 1904 | call->unmarshall++; |
1895 | |||
1896 | /* Fall through */ | 1905 | /* Fall through */ |
1906 | |||
1897 | case 6: | 1907 | case 6: |
1898 | break; | 1908 | break; |
1899 | } | 1909 | } |
@@ -1978,6 +1988,7 @@ static int yfs_deliver_fs_fetch_opaque_acl(struct afs_call *call) | |||
1978 | case 0: | 1988 | case 0: |
1979 | afs_extract_to_tmp(call); | 1989 | afs_extract_to_tmp(call); |
1980 | call->unmarshall++; | 1990 | call->unmarshall++; |
1991 | /* Fall through */ | ||
1981 | 1992 | ||
1982 | /* Extract the file ACL length */ | 1993 | /* Extract the file ACL length */ |
1983 | case 1: | 1994 | case 1: |
@@ -1999,6 +2010,7 @@ static int yfs_deliver_fs_fetch_opaque_acl(struct afs_call *call) | |||
1999 | iov_iter_discard(&call->iter, READ, size); | 2010 | iov_iter_discard(&call->iter, READ, size); |
2000 | } | 2011 | } |
2001 | call->unmarshall++; | 2012 | call->unmarshall++; |
2013 | /* Fall through */ | ||
2002 | 2014 | ||
2003 | /* Extract the file ACL */ | 2015 | /* Extract the file ACL */ |
2004 | case 2: | 2016 | case 2: |
@@ -2008,6 +2020,7 @@ static int yfs_deliver_fs_fetch_opaque_acl(struct afs_call *call) | |||
2008 | 2020 | ||
2009 | afs_extract_to_tmp(call); | 2021 | afs_extract_to_tmp(call); |
2010 | call->unmarshall++; | 2022 | call->unmarshall++; |
2023 | /* Fall through */ | ||
2011 | 2024 | ||
2012 | /* Extract the volume ACL length */ | 2025 | /* Extract the volume ACL length */ |
2013 | case 3: | 2026 | case 3: |
@@ -2029,6 +2042,7 @@ static int yfs_deliver_fs_fetch_opaque_acl(struct afs_call *call) | |||
2029 | iov_iter_discard(&call->iter, READ, size); | 2042 | iov_iter_discard(&call->iter, READ, size); |
2030 | } | 2043 | } |
2031 | call->unmarshall++; | 2044 | call->unmarshall++; |
2045 | /* Fall through */ | ||
2032 | 2046 | ||
2033 | /* Extract the volume ACL */ | 2047 | /* Extract the volume ACL */ |
2034 | case 4: | 2048 | case 4: |
@@ -2041,6 +2055,7 @@ static int yfs_deliver_fs_fetch_opaque_acl(struct afs_call *call) | |||
2041 | sizeof(struct yfs_xdr_YFSFetchStatus) + | 2055 | sizeof(struct yfs_xdr_YFSFetchStatus) + |
2042 | sizeof(struct yfs_xdr_YFSVolSync)); | 2056 | sizeof(struct yfs_xdr_YFSVolSync)); |
2043 | call->unmarshall++; | 2057 | call->unmarshall++; |
2058 | /* Fall through */ | ||
2044 | 2059 | ||
2045 | /* extract the metadata */ | 2060 | /* extract the metadata */ |
2046 | case 5: | 2061 | case 5: |
@@ -2057,6 +2072,7 @@ static int yfs_deliver_fs_fetch_opaque_acl(struct afs_call *call) | |||
2057 | xdr_decode_YFSVolSync(&bp, call->out_volsync); | 2072 | xdr_decode_YFSVolSync(&bp, call->out_volsync); |
2058 | 2073 | ||
2059 | call->unmarshall++; | 2074 | call->unmarshall++; |
2075 | /* Fall through */ | ||
2060 | 2076 | ||
2061 | case 6: | 2077 | case 6: |
2062 | break; | 2078 | break; |
diff --git a/fs/block_dev.c b/fs/block_dev.c index 4707dfff991b..c2a85b587922 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
@@ -345,15 +345,24 @@ __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, int nr_pages) | |||
345 | struct bio *bio; | 345 | struct bio *bio; |
346 | bool is_poll = (iocb->ki_flags & IOCB_HIPRI) != 0; | 346 | bool is_poll = (iocb->ki_flags & IOCB_HIPRI) != 0; |
347 | bool is_read = (iov_iter_rw(iter) == READ), is_sync; | 347 | bool is_read = (iov_iter_rw(iter) == READ), is_sync; |
348 | bool nowait = (iocb->ki_flags & IOCB_NOWAIT) != 0; | ||
348 | loff_t pos = iocb->ki_pos; | 349 | loff_t pos = iocb->ki_pos; |
349 | blk_qc_t qc = BLK_QC_T_NONE; | 350 | blk_qc_t qc = BLK_QC_T_NONE; |
350 | int ret = 0; | 351 | gfp_t gfp; |
352 | ssize_t ret; | ||
351 | 353 | ||
352 | if ((pos | iov_iter_alignment(iter)) & | 354 | if ((pos | iov_iter_alignment(iter)) & |
353 | (bdev_logical_block_size(bdev) - 1)) | 355 | (bdev_logical_block_size(bdev) - 1)) |
354 | return -EINVAL; | 356 | return -EINVAL; |
355 | 357 | ||
356 | bio = bio_alloc_bioset(GFP_KERNEL, nr_pages, &blkdev_dio_pool); | 358 | if (nowait) |
359 | gfp = GFP_NOWAIT; | ||
360 | else | ||
361 | gfp = GFP_KERNEL; | ||
362 | |||
363 | bio = bio_alloc_bioset(gfp, nr_pages, &blkdev_dio_pool); | ||
364 | if (!bio) | ||
365 | return -EAGAIN; | ||
357 | 366 | ||
358 | dio = container_of(bio, struct blkdev_dio, bio); | 367 | dio = container_of(bio, struct blkdev_dio, bio); |
359 | dio->is_sync = is_sync = is_sync_kiocb(iocb); | 368 | dio->is_sync = is_sync = is_sync_kiocb(iocb); |
@@ -375,7 +384,10 @@ __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, int nr_pages) | |||
375 | if (!is_poll) | 384 | if (!is_poll) |
376 | blk_start_plug(&plug); | 385 | blk_start_plug(&plug); |
377 | 386 | ||
387 | ret = 0; | ||
378 | for (;;) { | 388 | for (;;) { |
389 | int err; | ||
390 | |||
379 | bio_set_dev(bio, bdev); | 391 | bio_set_dev(bio, bdev); |
380 | bio->bi_iter.bi_sector = pos >> 9; | 392 | bio->bi_iter.bi_sector = pos >> 9; |
381 | bio->bi_write_hint = iocb->ki_hint; | 393 | bio->bi_write_hint = iocb->ki_hint; |
@@ -383,8 +395,10 @@ __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, int nr_pages) | |||
383 | bio->bi_end_io = blkdev_bio_end_io; | 395 | bio->bi_end_io = blkdev_bio_end_io; |
384 | bio->bi_ioprio = iocb->ki_ioprio; | 396 | bio->bi_ioprio = iocb->ki_ioprio; |
385 | 397 | ||
386 | ret = bio_iov_iter_get_pages(bio, iter); | 398 | err = bio_iov_iter_get_pages(bio, iter); |
387 | if (unlikely(ret)) { | 399 | if (unlikely(err)) { |
400 | if (!ret) | ||
401 | ret = err; | ||
388 | bio->bi_status = BLK_STS_IOERR; | 402 | bio->bi_status = BLK_STS_IOERR; |
389 | bio_endio(bio); | 403 | bio_endio(bio); |
390 | break; | 404 | break; |
@@ -399,6 +413,14 @@ __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, int nr_pages) | |||
399 | task_io_account_write(bio->bi_iter.bi_size); | 413 | task_io_account_write(bio->bi_iter.bi_size); |
400 | } | 414 | } |
401 | 415 | ||
416 | /* | ||
417 | * Tell underlying layer to not block for resource shortage. | ||
418 | * And if we would have blocked, return error inline instead | ||
419 | * of through the bio->bi_end_io() callback. | ||
420 | */ | ||
421 | if (nowait) | ||
422 | bio->bi_opf |= (REQ_NOWAIT | REQ_NOWAIT_INLINE); | ||
423 | |||
402 | dio->size += bio->bi_iter.bi_size; | 424 | dio->size += bio->bi_iter.bi_size; |
403 | pos += bio->bi_iter.bi_size; | 425 | pos += bio->bi_iter.bi_size; |
404 | 426 | ||
@@ -412,6 +434,11 @@ __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, int nr_pages) | |||
412 | } | 434 | } |
413 | 435 | ||
414 | qc = submit_bio(bio); | 436 | qc = submit_bio(bio); |
437 | if (qc == BLK_QC_T_EAGAIN) { | ||
438 | if (!ret) | ||
439 | ret = -EAGAIN; | ||
440 | goto error; | ||
441 | } | ||
415 | 442 | ||
416 | if (polled) | 443 | if (polled) |
417 | WRITE_ONCE(iocb->ki_cookie, qc); | 444 | WRITE_ONCE(iocb->ki_cookie, qc); |
@@ -432,8 +459,20 @@ __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, int nr_pages) | |||
432 | atomic_inc(&dio->ref); | 459 | atomic_inc(&dio->ref); |
433 | } | 460 | } |
434 | 461 | ||
435 | submit_bio(bio); | 462 | qc = submit_bio(bio); |
436 | bio = bio_alloc(GFP_KERNEL, nr_pages); | 463 | if (qc == BLK_QC_T_EAGAIN) { |
464 | if (!ret) | ||
465 | ret = -EAGAIN; | ||
466 | goto error; | ||
467 | } | ||
468 | ret += bio->bi_iter.bi_size; | ||
469 | |||
470 | bio = bio_alloc(gfp, nr_pages); | ||
471 | if (!bio) { | ||
472 | if (!ret) | ||
473 | ret = -EAGAIN; | ||
474 | goto error; | ||
475 | } | ||
437 | } | 476 | } |
438 | 477 | ||
439 | if (!is_poll) | 478 | if (!is_poll) |
@@ -453,13 +492,16 @@ __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, int nr_pages) | |||
453 | } | 492 | } |
454 | __set_current_state(TASK_RUNNING); | 493 | __set_current_state(TASK_RUNNING); |
455 | 494 | ||
495 | out: | ||
456 | if (!ret) | 496 | if (!ret) |
457 | ret = blk_status_to_errno(dio->bio.bi_status); | 497 | ret = blk_status_to_errno(dio->bio.bi_status); |
458 | if (likely(!ret)) | ||
459 | ret = dio->size; | ||
460 | 498 | ||
461 | bio_put(&dio->bio); | 499 | bio_put(&dio->bio); |
462 | return ret; | 500 | return ret; |
501 | error: | ||
502 | if (!is_poll) | ||
503 | blk_finish_plug(&plug); | ||
504 | goto out; | ||
463 | } | 505 | } |
464 | 506 | ||
465 | static ssize_t | 507 | static ssize_t |
diff --git a/fs/btrfs/locking.c b/fs/btrfs/locking.c index 98fccce4208c..393eceda57c8 100644 --- a/fs/btrfs/locking.c +++ b/fs/btrfs/locking.c | |||
@@ -346,9 +346,12 @@ void btrfs_tree_unlock(struct extent_buffer *eb) | |||
346 | if (blockers) { | 346 | if (blockers) { |
347 | btrfs_assert_no_spinning_writers(eb); | 347 | btrfs_assert_no_spinning_writers(eb); |
348 | eb->blocking_writers--; | 348 | eb->blocking_writers--; |
349 | /* Use the lighter barrier after atomic */ | 349 | /* |
350 | smp_mb__after_atomic(); | 350 | * We need to order modifying blocking_writers above with |
351 | cond_wake_up_nomb(&eb->write_lock_wq); | 351 | * actually waking up the sleepers to ensure they see the |
352 | * updated value of blocking_writers | ||
353 | */ | ||
354 | cond_wake_up(&eb->write_lock_wq); | ||
352 | } else { | 355 | } else { |
353 | btrfs_assert_spinning_writers_put(eb); | 356 | btrfs_assert_spinning_writers_put(eb); |
354 | write_unlock(&eb->lock); | 357 | write_unlock(&eb->lock); |
diff --git a/fs/btrfs/ordered-data.c b/fs/btrfs/ordered-data.c index 1744ba8b2754..ae7f64a8facb 100644 --- a/fs/btrfs/ordered-data.c +++ b/fs/btrfs/ordered-data.c | |||
@@ -985,13 +985,14 @@ void btrfs_lock_and_flush_ordered_range(struct extent_io_tree *tree, | |||
985 | struct extent_state **cached_state) | 985 | struct extent_state **cached_state) |
986 | { | 986 | { |
987 | struct btrfs_ordered_extent *ordered; | 987 | struct btrfs_ordered_extent *ordered; |
988 | struct extent_state *cachedp = NULL; | 988 | struct extent_state *cache = NULL; |
989 | struct extent_state **cachedp = &cache; | ||
989 | 990 | ||
990 | if (cached_state) | 991 | if (cached_state) |
991 | cachedp = *cached_state; | 992 | cachedp = cached_state; |
992 | 993 | ||
993 | while (1) { | 994 | while (1) { |
994 | lock_extent_bits(tree, start, end, &cachedp); | 995 | lock_extent_bits(tree, start, end, cachedp); |
995 | ordered = btrfs_lookup_ordered_range(inode, start, | 996 | ordered = btrfs_lookup_ordered_range(inode, start, |
996 | end - start + 1); | 997 | end - start + 1); |
997 | if (!ordered) { | 998 | if (!ordered) { |
@@ -1001,10 +1002,10 @@ void btrfs_lock_and_flush_ordered_range(struct extent_io_tree *tree, | |||
1001 | * aren't exposing it outside of this function | 1002 | * aren't exposing it outside of this function |
1002 | */ | 1003 | */ |
1003 | if (!cached_state) | 1004 | if (!cached_state) |
1004 | refcount_dec(&cachedp->refs); | 1005 | refcount_dec(&cache->refs); |
1005 | break; | 1006 | break; |
1006 | } | 1007 | } |
1007 | unlock_extent_cached(tree, start, end, &cachedp); | 1008 | unlock_extent_cached(tree, start, end, cachedp); |
1008 | btrfs_start_ordered_extent(&inode->vfs_inode, ordered, 1); | 1009 | btrfs_start_ordered_extent(&inode->vfs_inode, ordered, 1); |
1009 | btrfs_put_ordered_extent(ordered); | 1010 | btrfs_put_ordered_extent(ordered); |
1010 | } | 1011 | } |
diff --git a/fs/io_uring.c b/fs/io_uring.c index e2a66e12fbc6..012bc0efb9d3 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c | |||
@@ -202,7 +202,7 @@ struct async_list { | |||
202 | 202 | ||
203 | struct file *file; | 203 | struct file *file; |
204 | off_t io_end; | 204 | off_t io_end; |
205 | size_t io_pages; | 205 | size_t io_len; |
206 | }; | 206 | }; |
207 | 207 | ||
208 | struct io_ring_ctx { | 208 | struct io_ring_ctx { |
@@ -333,7 +333,8 @@ struct io_kiocb { | |||
333 | #define REQ_F_IO_DRAIN 16 /* drain existing IO first */ | 333 | #define REQ_F_IO_DRAIN 16 /* drain existing IO first */ |
334 | #define REQ_F_IO_DRAINED 32 /* drain done */ | 334 | #define REQ_F_IO_DRAINED 32 /* drain done */ |
335 | #define REQ_F_LINK 64 /* linked sqes */ | 335 | #define REQ_F_LINK 64 /* linked sqes */ |
336 | #define REQ_F_FAIL_LINK 128 /* fail rest of links */ | 336 | #define REQ_F_LINK_DONE 128 /* linked sqes done */ |
337 | #define REQ_F_FAIL_LINK 256 /* fail rest of links */ | ||
337 | u64 user_data; | 338 | u64 user_data; |
338 | u32 result; | 339 | u32 result; |
339 | u32 sequence; | 340 | u32 sequence; |
@@ -429,7 +430,7 @@ static inline bool io_sequence_defer(struct io_ring_ctx *ctx, | |||
429 | if ((req->flags & (REQ_F_IO_DRAIN|REQ_F_IO_DRAINED)) != REQ_F_IO_DRAIN) | 430 | if ((req->flags & (REQ_F_IO_DRAIN|REQ_F_IO_DRAINED)) != REQ_F_IO_DRAIN) |
430 | return false; | 431 | return false; |
431 | 432 | ||
432 | return req->sequence > ctx->cached_cq_tail + ctx->sq_ring->dropped; | 433 | return req->sequence != ctx->cached_cq_tail + ctx->sq_ring->dropped; |
433 | } | 434 | } |
434 | 435 | ||
435 | static struct io_kiocb *io_get_deferred_req(struct io_ring_ctx *ctx) | 436 | static struct io_kiocb *io_get_deferred_req(struct io_ring_ctx *ctx) |
@@ -632,6 +633,7 @@ static void io_req_link_next(struct io_kiocb *req) | |||
632 | nxt->flags |= REQ_F_LINK; | 633 | nxt->flags |= REQ_F_LINK; |
633 | } | 634 | } |
634 | 635 | ||
636 | nxt->flags |= REQ_F_LINK_DONE; | ||
635 | INIT_WORK(&nxt->work, io_sq_wq_submit_work); | 637 | INIT_WORK(&nxt->work, io_sq_wq_submit_work); |
636 | queue_work(req->ctx->sqo_wq, &nxt->work); | 638 | queue_work(req->ctx->sqo_wq, &nxt->work); |
637 | } | 639 | } |
@@ -1064,8 +1066,44 @@ static int io_import_fixed(struct io_ring_ctx *ctx, int rw, | |||
1064 | */ | 1066 | */ |
1065 | offset = buf_addr - imu->ubuf; | 1067 | offset = buf_addr - imu->ubuf; |
1066 | iov_iter_bvec(iter, rw, imu->bvec, imu->nr_bvecs, offset + len); | 1068 | iov_iter_bvec(iter, rw, imu->bvec, imu->nr_bvecs, offset + len); |
1067 | if (offset) | 1069 | |
1068 | iov_iter_advance(iter, offset); | 1070 | if (offset) { |
1071 | /* | ||
1072 | * Don't use iov_iter_advance() here, as it's really slow for | ||
1073 | * using the latter parts of a big fixed buffer - it iterates | ||
1074 | * over each segment manually. We can cheat a bit here, because | ||
1075 | * we know that: | ||
1076 | * | ||
1077 | * 1) it's a BVEC iter, we set it up | ||
1078 | * 2) all bvecs are PAGE_SIZE in size, except potentially the | ||
1079 | * first and last bvec | ||
1080 | * | ||
1081 | * So just find our index, and adjust the iterator afterwards. | ||
1082 | * If the offset is within the first bvec (or the whole first | ||
1083 | * bvec, just use iov_iter_advance(). This makes it easier | ||
1084 | * since we can just skip the first segment, which may not | ||
1085 | * be PAGE_SIZE aligned. | ||
1086 | */ | ||
1087 | const struct bio_vec *bvec = imu->bvec; | ||
1088 | |||
1089 | if (offset <= bvec->bv_len) { | ||
1090 | iov_iter_advance(iter, offset); | ||
1091 | } else { | ||
1092 | unsigned long seg_skip; | ||
1093 | |||
1094 | /* skip first vec */ | ||
1095 | offset -= bvec->bv_len; | ||
1096 | seg_skip = 1 + (offset >> PAGE_SHIFT); | ||
1097 | |||
1098 | iter->bvec = bvec + seg_skip; | ||
1099 | iter->nr_segs -= seg_skip; | ||
1100 | iter->count -= (seg_skip << PAGE_SHIFT); | ||
1101 | iter->iov_offset = offset & ~PAGE_MASK; | ||
1102 | if (iter->iov_offset) | ||
1103 | iter->count -= iter->iov_offset; | ||
1104 | } | ||
1105 | } | ||
1106 | |||
1069 | return 0; | 1107 | return 0; |
1070 | } | 1108 | } |
1071 | 1109 | ||
@@ -1120,28 +1158,26 @@ static void io_async_list_note(int rw, struct io_kiocb *req, size_t len) | |||
1120 | off_t io_end = kiocb->ki_pos + len; | 1158 | off_t io_end = kiocb->ki_pos + len; |
1121 | 1159 | ||
1122 | if (filp == async_list->file && kiocb->ki_pos == async_list->io_end) { | 1160 | if (filp == async_list->file && kiocb->ki_pos == async_list->io_end) { |
1123 | unsigned long max_pages; | 1161 | unsigned long max_bytes; |
1124 | 1162 | ||
1125 | /* Use 8x RA size as a decent limiter for both reads/writes */ | 1163 | /* Use 8x RA size as a decent limiter for both reads/writes */ |
1126 | max_pages = filp->f_ra.ra_pages; | 1164 | max_bytes = filp->f_ra.ra_pages << (PAGE_SHIFT + 3); |
1127 | if (!max_pages) | 1165 | if (!max_bytes) |
1128 | max_pages = VM_READAHEAD_PAGES; | 1166 | max_bytes = VM_READAHEAD_PAGES << (PAGE_SHIFT + 3); |
1129 | max_pages *= 8; | 1167 | |
1130 | 1168 | /* If max len are exceeded, reset the state */ | |
1131 | /* If max pages are exceeded, reset the state */ | 1169 | if (async_list->io_len + len <= max_bytes) { |
1132 | len >>= PAGE_SHIFT; | ||
1133 | if (async_list->io_pages + len <= max_pages) { | ||
1134 | req->flags |= REQ_F_SEQ_PREV; | 1170 | req->flags |= REQ_F_SEQ_PREV; |
1135 | async_list->io_pages += len; | 1171 | async_list->io_len += len; |
1136 | } else { | 1172 | } else { |
1137 | io_end = 0; | 1173 | io_end = 0; |
1138 | async_list->io_pages = 0; | 1174 | async_list->io_len = 0; |
1139 | } | 1175 | } |
1140 | } | 1176 | } |
1141 | 1177 | ||
1142 | /* New file? Reset state. */ | 1178 | /* New file? Reset state. */ |
1143 | if (async_list->file != filp) { | 1179 | if (async_list->file != filp) { |
1144 | async_list->io_pages = 0; | 1180 | async_list->io_len = 0; |
1145 | async_list->file = filp; | 1181 | async_list->file = filp; |
1146 | } | 1182 | } |
1147 | async_list->io_end = io_end; | 1183 | async_list->io_end = io_end; |
@@ -1630,6 +1666,8 @@ static int io_poll_add(struct io_kiocb *req, const struct io_uring_sqe *sqe) | |||
1630 | INIT_LIST_HEAD(&poll->wait.entry); | 1666 | INIT_LIST_HEAD(&poll->wait.entry); |
1631 | init_waitqueue_func_entry(&poll->wait, io_poll_wake); | 1667 | init_waitqueue_func_entry(&poll->wait, io_poll_wake); |
1632 | 1668 | ||
1669 | INIT_LIST_HEAD(&req->list); | ||
1670 | |||
1633 | mask = vfs_poll(poll->file, &ipt.pt) & poll->events; | 1671 | mask = vfs_poll(poll->file, &ipt.pt) & poll->events; |
1634 | 1672 | ||
1635 | spin_lock_irq(&ctx->completion_lock); | 1673 | spin_lock_irq(&ctx->completion_lock); |
@@ -1844,6 +1882,10 @@ restart: | |||
1844 | /* async context always use a copy of the sqe */ | 1882 | /* async context always use a copy of the sqe */ |
1845 | kfree(sqe); | 1883 | kfree(sqe); |
1846 | 1884 | ||
1885 | /* req from defer and link list needn't decrease async cnt */ | ||
1886 | if (req->flags & (REQ_F_IO_DRAINED | REQ_F_LINK_DONE)) | ||
1887 | goto out; | ||
1888 | |||
1847 | if (!async_list) | 1889 | if (!async_list) |
1848 | break; | 1890 | break; |
1849 | if (!list_empty(&req_list)) { | 1891 | if (!list_empty(&req_list)) { |
@@ -1891,6 +1933,7 @@ restart: | |||
1891 | } | 1933 | } |
1892 | } | 1934 | } |
1893 | 1935 | ||
1936 | out: | ||
1894 | if (cur_mm) { | 1937 | if (cur_mm) { |
1895 | set_fs(old_fs); | 1938 | set_fs(old_fs); |
1896 | unuse_mm(cur_mm); | 1939 | unuse_mm(cur_mm); |
@@ -1917,6 +1960,10 @@ static bool io_add_to_prev_work(struct async_list *list, struct io_kiocb *req) | |||
1917 | ret = true; | 1960 | ret = true; |
1918 | spin_lock(&list->lock); | 1961 | spin_lock(&list->lock); |
1919 | list_add_tail(&req->list, &list->list); | 1962 | list_add_tail(&req->list, &list->list); |
1963 | /* | ||
1964 | * Ensure we see a simultaneous modification from io_sq_wq_submit_work() | ||
1965 | */ | ||
1966 | smp_mb(); | ||
1920 | if (!atomic_read(&list->cnt)) { | 1967 | if (!atomic_read(&list->cnt)) { |
1921 | list_del_init(&req->list); | 1968 | list_del_init(&req->list); |
1922 | ret = false; | 1969 | ret = false; |
diff --git a/fs/iomap/Makefile b/fs/iomap/Makefile index 2d165388d952..93cd11938bf5 100644 --- a/fs/iomap/Makefile +++ b/fs/iomap/Makefile | |||
@@ -1,4 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0-or-newer | 1 | # SPDX-License-Identifier: GPL-2.0-or-later |
2 | # | 2 | # |
3 | # Copyright (c) 2019 Oracle. | 3 | # Copyright (c) 2019 Oracle. |
4 | # All Rights Reserved. | 4 | # All Rights Reserved. |
diff --git a/fs/namespace.c b/fs/namespace.c index 6464ea4acba9..d28d30b13043 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
@@ -1463,7 +1463,6 @@ static void umount_tree(struct mount *mnt, enum umount_tree_flags how) | |||
1463 | p->mnt.mnt_flags |= MNT_SYNC_UMOUNT; | 1463 | p->mnt.mnt_flags |= MNT_SYNC_UMOUNT; |
1464 | 1464 | ||
1465 | disconnect = disconnect_mount(p, how); | 1465 | disconnect = disconnect_mount(p, how); |
1466 | |||
1467 | if (mnt_has_parent(p)) { | 1466 | if (mnt_has_parent(p)) { |
1468 | mnt_add_count(p->mnt_parent, -1); | 1467 | mnt_add_count(p->mnt_parent, -1); |
1469 | if (!disconnect) { | 1468 | if (!disconnect) { |
@@ -1471,10 +1470,11 @@ static void umount_tree(struct mount *mnt, enum umount_tree_flags how) | |||
1471 | list_add_tail(&p->mnt_child, &p->mnt_parent->mnt_mounts); | 1470 | list_add_tail(&p->mnt_child, &p->mnt_parent->mnt_mounts); |
1472 | } else { | 1471 | } else { |
1473 | umount_mnt(p); | 1472 | umount_mnt(p); |
1474 | hlist_add_head(&p->mnt_umount, &unmounted); | ||
1475 | } | 1473 | } |
1476 | } | 1474 | } |
1477 | change_mnt_propagation(p, MS_PRIVATE); | 1475 | change_mnt_propagation(p, MS_PRIVATE); |
1476 | if (disconnect) | ||
1477 | hlist_add_head(&p->mnt_umount, &unmounted); | ||
1478 | } | 1478 | } |
1479 | } | 1479 | } |
1480 | 1480 | ||
@@ -374,6 +374,25 @@ long do_faccessat(int dfd, const char __user *filename, int mode) | |||
374 | override_cred->cap_permitted; | 374 | override_cred->cap_permitted; |
375 | } | 375 | } |
376 | 376 | ||
377 | /* | ||
378 | * The new set of credentials can *only* be used in | ||
379 | * task-synchronous circumstances, and does not need | ||
380 | * RCU freeing, unless somebody then takes a separate | ||
381 | * reference to it. | ||
382 | * | ||
383 | * NOTE! This is _only_ true because this credential | ||
384 | * is used purely for override_creds() that installs | ||
385 | * it as the subjective cred. Other threads will be | ||
386 | * accessing ->real_cred, not the subjective cred. | ||
387 | * | ||
388 | * If somebody _does_ make a copy of this (using the | ||
389 | * 'get_current_cred()' function), that will clear the | ||
390 | * non_rcu field, because now that other user may be | ||
391 | * expecting RCU freeing. But normal thread-synchronous | ||
392 | * cred accesses will keep things non-RCY. | ||
393 | */ | ||
394 | override_cred->non_rcu = 1; | ||
395 | |||
377 | old_cred = override_creds(override_cred); | 396 | old_cred = override_creds(override_cred); |
378 | retry: | 397 | retry: |
379 | res = user_path_at(dfd, filename, lookup_flags, &path); | 398 | res = user_path_at(dfd, filename, lookup_flags, &path); |
diff --git a/include/asm-generic/futex.h b/include/asm-generic/futex.h index 8666fe7f35d7..02970b11f71f 100644 --- a/include/asm-generic/futex.h +++ b/include/asm-generic/futex.h | |||
@@ -118,26 +118,7 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, | |||
118 | static inline int | 118 | static inline int |
119 | arch_futex_atomic_op_inuser(int op, u32 oparg, int *oval, u32 __user *uaddr) | 119 | arch_futex_atomic_op_inuser(int op, u32 oparg, int *oval, u32 __user *uaddr) |
120 | { | 120 | { |
121 | int oldval = 0, ret; | 121 | return -ENOSYS; |
122 | |||
123 | pagefault_disable(); | ||
124 | |||
125 | switch (op) { | ||
126 | case FUTEX_OP_SET: | ||
127 | case FUTEX_OP_ADD: | ||
128 | case FUTEX_OP_OR: | ||
129 | case FUTEX_OP_ANDN: | ||
130 | case FUTEX_OP_XOR: | ||
131 | default: | ||
132 | ret = -ENOSYS; | ||
133 | } | ||
134 | |||
135 | pagefault_enable(); | ||
136 | |||
137 | if (!ret) | ||
138 | *oval = oldval; | ||
139 | |||
140 | return ret; | ||
141 | } | 122 | } |
142 | 123 | ||
143 | static inline int | 124 | static inline int |
diff --git a/include/asm-generic/preempt.h b/include/asm-generic/preempt.h index c3046c920063..d683f5e6d791 100644 --- a/include/asm-generic/preempt.h +++ b/include/asm-generic/preempt.h | |||
@@ -78,11 +78,11 @@ static __always_inline bool should_resched(int preempt_offset) | |||
78 | tif_need_resched()); | 78 | tif_need_resched()); |
79 | } | 79 | } |
80 | 80 | ||
81 | #ifdef CONFIG_PREEMPT | 81 | #ifdef CONFIG_PREEMPTION |
82 | extern asmlinkage void preempt_schedule(void); | 82 | extern asmlinkage void preempt_schedule(void); |
83 | #define __preempt_schedule() preempt_schedule() | 83 | #define __preempt_schedule() preempt_schedule() |
84 | extern asmlinkage void preempt_schedule_notrace(void); | 84 | extern asmlinkage void preempt_schedule_notrace(void); |
85 | #define __preempt_schedule_notrace() preempt_schedule_notrace() | 85 | #define __preempt_schedule_notrace() preempt_schedule_notrace() |
86 | #endif /* CONFIG_PREEMPT */ | 86 | #endif /* CONFIG_PREEMPTION */ |
87 | 87 | ||
88 | #endif /* __ASM_PREEMPT_H */ | 88 | #endif /* __ASM_PREEMPT_H */ |
diff --git a/include/linux/blk-cgroup.h b/include/linux/blk-cgroup.h index 689a58231288..12811091fd50 100644 --- a/include/linux/blk-cgroup.h +++ b/include/linux/blk-cgroup.h | |||
@@ -181,6 +181,7 @@ struct blkcg_policy { | |||
181 | 181 | ||
182 | extern struct blkcg blkcg_root; | 182 | extern struct blkcg blkcg_root; |
183 | extern struct cgroup_subsys_state * const blkcg_root_css; | 183 | extern struct cgroup_subsys_state * const blkcg_root_css; |
184 | extern bool blkcg_debug_stats; | ||
184 | 185 | ||
185 | struct blkcg_gq *blkg_lookup_slowpath(struct blkcg *blkcg, | 186 | struct blkcg_gq *blkg_lookup_slowpath(struct blkcg *blkcg, |
186 | struct request_queue *q, bool update_hint); | 187 | struct request_queue *q, bool update_hint); |
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index feff3fe4467e..1b1fa1557e68 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h | |||
@@ -311,6 +311,7 @@ enum req_flag_bits { | |||
311 | __REQ_RAHEAD, /* read ahead, can fail anytime */ | 311 | __REQ_RAHEAD, /* read ahead, can fail anytime */ |
312 | __REQ_BACKGROUND, /* background IO */ | 312 | __REQ_BACKGROUND, /* background IO */ |
313 | __REQ_NOWAIT, /* Don't wait if request will block */ | 313 | __REQ_NOWAIT, /* Don't wait if request will block */ |
314 | __REQ_NOWAIT_INLINE, /* Return would-block error inline */ | ||
314 | /* | 315 | /* |
315 | * When a shared kthread needs to issue a bio for a cgroup, doing | 316 | * When a shared kthread needs to issue a bio for a cgroup, doing |
316 | * so synchronously can lead to priority inversions as the kthread | 317 | * so synchronously can lead to priority inversions as the kthread |
@@ -345,6 +346,7 @@ enum req_flag_bits { | |||
345 | #define REQ_RAHEAD (1ULL << __REQ_RAHEAD) | 346 | #define REQ_RAHEAD (1ULL << __REQ_RAHEAD) |
346 | #define REQ_BACKGROUND (1ULL << __REQ_BACKGROUND) | 347 | #define REQ_BACKGROUND (1ULL << __REQ_BACKGROUND) |
347 | #define REQ_NOWAIT (1ULL << __REQ_NOWAIT) | 348 | #define REQ_NOWAIT (1ULL << __REQ_NOWAIT) |
349 | #define REQ_NOWAIT_INLINE (1ULL << __REQ_NOWAIT_INLINE) | ||
348 | #define REQ_CGROUP_PUNT (1ULL << __REQ_CGROUP_PUNT) | 350 | #define REQ_CGROUP_PUNT (1ULL << __REQ_CGROUP_PUNT) |
349 | 351 | ||
350 | #define REQ_NOUNMAP (1ULL << __REQ_NOUNMAP) | 352 | #define REQ_NOUNMAP (1ULL << __REQ_NOUNMAP) |
@@ -418,12 +420,13 @@ static inline int op_stat_group(unsigned int op) | |||
418 | 420 | ||
419 | typedef unsigned int blk_qc_t; | 421 | typedef unsigned int blk_qc_t; |
420 | #define BLK_QC_T_NONE -1U | 422 | #define BLK_QC_T_NONE -1U |
423 | #define BLK_QC_T_EAGAIN -2U | ||
421 | #define BLK_QC_T_SHIFT 16 | 424 | #define BLK_QC_T_SHIFT 16 |
422 | #define BLK_QC_T_INTERNAL (1U << 31) | 425 | #define BLK_QC_T_INTERNAL (1U << 31) |
423 | 426 | ||
424 | static inline bool blk_qc_t_valid(blk_qc_t cookie) | 427 | static inline bool blk_qc_t_valid(blk_qc_t cookie) |
425 | { | 428 | { |
426 | return cookie != BLK_QC_T_NONE; | 429 | return cookie != BLK_QC_T_NONE && cookie != BLK_QC_T_EAGAIN; |
427 | } | 430 | } |
428 | 431 | ||
429 | static inline unsigned int blk_qc_t_to_queue_num(blk_qc_t cookie) | 432 | static inline unsigned int blk_qc_t_to_queue_num(blk_qc_t cookie) |
diff --git a/include/linux/cred.h b/include/linux/cred.h index 7eb43a038330..f7a30e0099be 100644 --- a/include/linux/cred.h +++ b/include/linux/cred.h | |||
@@ -145,7 +145,11 @@ struct cred { | |||
145 | struct user_struct *user; /* real user ID subscription */ | 145 | struct user_struct *user; /* real user ID subscription */ |
146 | struct user_namespace *user_ns; /* user_ns the caps and keyrings are relative to. */ | 146 | struct user_namespace *user_ns; /* user_ns the caps and keyrings are relative to. */ |
147 | struct group_info *group_info; /* supplementary groups for euid/fsgid */ | 147 | struct group_info *group_info; /* supplementary groups for euid/fsgid */ |
148 | struct rcu_head rcu; /* RCU deletion hook */ | 148 | /* RCU deletion */ |
149 | union { | ||
150 | int non_rcu; /* Can we skip RCU deletion? */ | ||
151 | struct rcu_head rcu; /* RCU deletion hook */ | ||
152 | }; | ||
149 | } __randomize_layout; | 153 | } __randomize_layout; |
150 | 154 | ||
151 | extern void __put_cred(struct cred *); | 155 | extern void __put_cred(struct cred *); |
@@ -246,6 +250,7 @@ static inline const struct cred *get_cred(const struct cred *cred) | |||
246 | if (!cred) | 250 | if (!cred) |
247 | return cred; | 251 | return cred; |
248 | validate_creds(cred); | 252 | validate_creds(cred); |
253 | nonconst_cred->non_rcu = 0; | ||
249 | return get_new_cred(nonconst_cred); | 254 | return get_new_cred(nonconst_cred); |
250 | } | 255 | } |
251 | 256 | ||
@@ -257,6 +262,7 @@ static inline const struct cred *get_cred_rcu(const struct cred *cred) | |||
257 | if (!atomic_inc_not_zero(&nonconst_cred->usage)) | 262 | if (!atomic_inc_not_zero(&nonconst_cred->usage)) |
258 | return NULL; | 263 | return NULL; |
259 | validate_creds(cred); | 264 | validate_creds(cred); |
265 | nonconst_cred->non_rcu = 0; | ||
260 | return cred; | 266 | return cred; |
261 | } | 267 | } |
262 | 268 | ||
diff --git a/include/linux/device.h b/include/linux/device.h index c330b75c6c57..6717adee33f0 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -915,6 +915,8 @@ struct dev_links_info { | |||
915 | * This identifies the device type and carries type-specific | 915 | * This identifies the device type and carries type-specific |
916 | * information. | 916 | * information. |
917 | * @mutex: Mutex to synchronize calls to its driver. | 917 | * @mutex: Mutex to synchronize calls to its driver. |
918 | * @lockdep_mutex: An optional debug lock that a subsystem can use as a | ||
919 | * peer lock to gain localized lockdep coverage of the device_lock. | ||
918 | * @bus: Type of bus device is on. | 920 | * @bus: Type of bus device is on. |
919 | * @driver: Which driver has allocated this | 921 | * @driver: Which driver has allocated this |
920 | * @platform_data: Platform data specific to the device. | 922 | * @platform_data: Platform data specific to the device. |
@@ -998,6 +1000,9 @@ struct device { | |||
998 | core doesn't touch it */ | 1000 | core doesn't touch it */ |
999 | void *driver_data; /* Driver data, set and get with | 1001 | void *driver_data; /* Driver data, set and get with |
1000 | dev_set_drvdata/dev_get_drvdata */ | 1002 | dev_set_drvdata/dev_get_drvdata */ |
1003 | #ifdef CONFIG_PROVE_LOCKING | ||
1004 | struct mutex lockdep_mutex; | ||
1005 | #endif | ||
1001 | struct mutex mutex; /* mutex to synchronize calls to | 1006 | struct mutex mutex; /* mutex to synchronize calls to |
1002 | * its driver. | 1007 | * its driver. |
1003 | */ | 1008 | */ |
@@ -1383,6 +1388,7 @@ extern int (*platform_notify_remove)(struct device *dev); | |||
1383 | */ | 1388 | */ |
1384 | extern struct device *get_device(struct device *dev); | 1389 | extern struct device *get_device(struct device *dev); |
1385 | extern void put_device(struct device *dev); | 1390 | extern void put_device(struct device *dev); |
1391 | extern bool kill_device(struct device *dev); | ||
1386 | 1392 | ||
1387 | #ifdef CONFIG_DEVTMPFS | 1393 | #ifdef CONFIG_DEVTMPFS |
1388 | extern int devtmpfs_create_node(struct device *dev); | 1394 | extern int devtmpfs_create_node(struct device *dev); |
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index e11b115dd0e4..f7d1eea32c78 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h | |||
@@ -689,8 +689,8 @@ static inline int dma_coerce_mask_and_coherent(struct device *dev, u64 mask) | |||
689 | */ | 689 | */ |
690 | static inline bool dma_addressing_limited(struct device *dev) | 690 | static inline bool dma_addressing_limited(struct device *dev) |
691 | { | 691 | { |
692 | return min_not_zero(*dev->dma_mask, dev->bus_dma_mask) < | 692 | return min_not_zero(dma_get_mask(dev), dev->bus_dma_mask) < |
693 | dma_get_required_mask(dev); | 693 | dma_get_required_mask(dev); |
694 | } | 694 | } |
695 | 695 | ||
696 | #ifdef CONFIG_ARCH_HAS_SETUP_DMA_OPS | 696 | #ifdef CONFIG_ARCH_HAS_SETUP_DMA_OPS |
diff --git a/include/linux/elevator.h b/include/linux/elevator.h index 17cd0078377c..1dd014c9c87b 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h | |||
@@ -45,7 +45,6 @@ struct elevator_mq_ops { | |||
45 | struct request *(*dispatch_request)(struct blk_mq_hw_ctx *); | 45 | struct request *(*dispatch_request)(struct blk_mq_hw_ctx *); |
46 | bool (*has_work)(struct blk_mq_hw_ctx *); | 46 | bool (*has_work)(struct blk_mq_hw_ctx *); |
47 | void (*completed_request)(struct request *, u64); | 47 | void (*completed_request)(struct request *, u64); |
48 | void (*started_request)(struct request *); | ||
49 | void (*requeue_request)(struct request *); | 48 | void (*requeue_request)(struct request *); |
50 | struct request *(*former_request)(struct request_queue *, struct request *); | 49 | struct request *(*former_request)(struct request_queue *, struct request *); |
51 | struct request *(*next_request)(struct request_queue *, struct request *); | 50 | struct request *(*next_request)(struct request_queue *, struct request *); |
diff --git a/include/linux/iova.h b/include/linux/iova.h index 781b96ac706f..a0637abffee8 100644 --- a/include/linux/iova.h +++ b/include/linux/iova.h | |||
@@ -155,6 +155,7 @@ struct iova *reserve_iova(struct iova_domain *iovad, unsigned long pfn_lo, | |||
155 | void copy_reserved_iova(struct iova_domain *from, struct iova_domain *to); | 155 | void copy_reserved_iova(struct iova_domain *from, struct iova_domain *to); |
156 | void init_iova_domain(struct iova_domain *iovad, unsigned long granule, | 156 | void init_iova_domain(struct iova_domain *iovad, unsigned long granule, |
157 | unsigned long start_pfn); | 157 | unsigned long start_pfn); |
158 | bool has_iova_flush_queue(struct iova_domain *iovad); | ||
158 | int init_iova_flush_queue(struct iova_domain *iovad, | 159 | int init_iova_flush_queue(struct iova_domain *iovad, |
159 | iova_flush_cb flush_cb, iova_entry_dtor entry_dtor); | 160 | iova_flush_cb flush_cb, iova_entry_dtor entry_dtor); |
160 | struct iova *find_iova(struct iova_domain *iovad, unsigned long pfn); | 161 | struct iova *find_iova(struct iova_domain *iovad, unsigned long pfn); |
@@ -235,6 +236,11 @@ static inline void init_iova_domain(struct iova_domain *iovad, | |||
235 | { | 236 | { |
236 | } | 237 | } |
237 | 238 | ||
239 | static inline bool has_iova_flush_queue(struct iova_domain *iovad) | ||
240 | { | ||
241 | return false; | ||
242 | } | ||
243 | |||
238 | static inline int init_iova_flush_queue(struct iova_domain *iovad, | 244 | static inline int init_iova_flush_queue(struct iova_domain *iovad, |
239 | iova_flush_cb flush_cb, | 245 | iova_flush_cb flush_cb, |
240 | iova_entry_dtor entry_dtor) | 246 | iova_entry_dtor entry_dtor) |
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index b2c1648f7e5d..5714fd35a83c 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
@@ -814,6 +814,7 @@ struct tee_client_device_id { | |||
814 | /** | 814 | /** |
815 | * struct wmi_device_id - WMI device identifier | 815 | * struct wmi_device_id - WMI device identifier |
816 | * @guid_string: 36 char string of the form fa50ff2b-f2e8-45de-83fa-65417f2f49ba | 816 | * @guid_string: 36 char string of the form fa50ff2b-f2e8-45de-83fa-65417f2f49ba |
817 | * @context: pointer to driver specific data | ||
817 | */ | 818 | */ |
818 | struct wmi_device_id { | 819 | struct wmi_device_id { |
819 | const char guid_string[UUID_STRING_LEN+1]; | 820 | const char guid_string[UUID_STRING_LEN+1]; |
diff --git a/include/linux/of.h b/include/linux/of.h index 0cf857012f11..844f89e1b039 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
@@ -1164,7 +1164,7 @@ static inline int of_property_read_string_index(const struct device_node *np, | |||
1164 | } | 1164 | } |
1165 | 1165 | ||
1166 | /** | 1166 | /** |
1167 | * of_property_read_bool - Findfrom a property | 1167 | * of_property_read_bool - Find a property |
1168 | * @np: device node from which the property value is to be read. | 1168 | * @np: device node from which the property value is to be read. |
1169 | * @propname: name of the property to be searched. | 1169 | * @propname: name of the property to be searched. |
1170 | * | 1170 | * |
diff --git a/include/linux/preempt.h b/include/linux/preempt.h index dd92b1a93919..bbb68dba37cc 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h | |||
@@ -182,7 +182,7 @@ do { \ | |||
182 | 182 | ||
183 | #define preemptible() (preempt_count() == 0 && !irqs_disabled()) | 183 | #define preemptible() (preempt_count() == 0 && !irqs_disabled()) |
184 | 184 | ||
185 | #ifdef CONFIG_PREEMPT | 185 | #ifdef CONFIG_PREEMPTION |
186 | #define preempt_enable() \ | 186 | #define preempt_enable() \ |
187 | do { \ | 187 | do { \ |
188 | barrier(); \ | 188 | barrier(); \ |
@@ -203,7 +203,7 @@ do { \ | |||
203 | __preempt_schedule(); \ | 203 | __preempt_schedule(); \ |
204 | } while (0) | 204 | } while (0) |
205 | 205 | ||
206 | #else /* !CONFIG_PREEMPT */ | 206 | #else /* !CONFIG_PREEMPTION */ |
207 | #define preempt_enable() \ | 207 | #define preempt_enable() \ |
208 | do { \ | 208 | do { \ |
209 | barrier(); \ | 209 | barrier(); \ |
@@ -217,7 +217,7 @@ do { \ | |||
217 | } while (0) | 217 | } while (0) |
218 | 218 | ||
219 | #define preempt_check_resched() do { } while (0) | 219 | #define preempt_check_resched() do { } while (0) |
220 | #endif /* CONFIG_PREEMPT */ | 220 | #endif /* CONFIG_PREEMPTION */ |
221 | 221 | ||
222 | #define preempt_disable_notrace() \ | 222 | #define preempt_disable_notrace() \ |
223 | do { \ | 223 | do { \ |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 8f7167478c1d..c4f76a310443 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -578,7 +578,7 @@ do { \ | |||
578 | * | 578 | * |
579 | * In non-preemptible RCU implementations (TREE_RCU and TINY_RCU), | 579 | * In non-preemptible RCU implementations (TREE_RCU and TINY_RCU), |
580 | * it is illegal to block while in an RCU read-side critical section. | 580 | * it is illegal to block while in an RCU read-side critical section. |
581 | * In preemptible RCU implementations (PREEMPT_RCU) in CONFIG_PREEMPT | 581 | * In preemptible RCU implementations (PREEMPT_RCU) in CONFIG_PREEMPTION |
582 | * kernel builds, RCU read-side critical sections may be preempted, | 582 | * kernel builds, RCU read-side critical sections may be preempted, |
583 | * but explicit blocking is illegal. Finally, in preemptible RCU | 583 | * but explicit blocking is illegal. Finally, in preemptible RCU |
584 | * implementations in real-time (with -rt patchset) kernel builds, RCU | 584 | * implementations in real-time (with -rt patchset) kernel builds, RCU |
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h index 735601ac27d3..18b1ed9864b0 100644 --- a/include/linux/rcutree.h +++ b/include/linux/rcutree.h | |||
@@ -53,7 +53,7 @@ void rcu_scheduler_starting(void); | |||
53 | extern int rcu_scheduler_active __read_mostly; | 53 | extern int rcu_scheduler_active __read_mostly; |
54 | void rcu_end_inkernel_boot(void); | 54 | void rcu_end_inkernel_boot(void); |
55 | bool rcu_is_watching(void); | 55 | bool rcu_is_watching(void); |
56 | #ifndef CONFIG_PREEMPT | 56 | #ifndef CONFIG_PREEMPTION |
57 | void rcu_all_qs(void); | 57 | void rcu_all_qs(void); |
58 | #endif | 58 | #endif |
59 | 59 | ||
diff --git a/include/linux/sched.h b/include/linux/sched.h index b94ad92dfbe6..f0edee94834a 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -1772,7 +1772,7 @@ static inline int test_tsk_need_resched(struct task_struct *tsk) | |||
1772 | * value indicates whether a reschedule was done in fact. | 1772 | * value indicates whether a reschedule was done in fact. |
1773 | * cond_resched_lock() will drop the spinlock before scheduling, | 1773 | * cond_resched_lock() will drop the spinlock before scheduling, |
1774 | */ | 1774 | */ |
1775 | #ifndef CONFIG_PREEMPT | 1775 | #ifndef CONFIG_PREEMPTION |
1776 | extern int _cond_resched(void); | 1776 | extern int _cond_resched(void); |
1777 | #else | 1777 | #else |
1778 | static inline int _cond_resched(void) { return 0; } | 1778 | static inline int _cond_resched(void) { return 0; } |
@@ -1801,12 +1801,12 @@ static inline void cond_resched_rcu(void) | |||
1801 | 1801 | ||
1802 | /* | 1802 | /* |
1803 | * Does a critical section need to be broken due to another | 1803 | * Does a critical section need to be broken due to another |
1804 | * task waiting?: (technically does not depend on CONFIG_PREEMPT, | 1804 | * task waiting?: (technically does not depend on CONFIG_PREEMPTION, |
1805 | * but a general need for low latency) | 1805 | * but a general need for low latency) |
1806 | */ | 1806 | */ |
1807 | static inline int spin_needbreak(spinlock_t *lock) | 1807 | static inline int spin_needbreak(spinlock_t *lock) |
1808 | { | 1808 | { |
1809 | #ifdef CONFIG_PREEMPT | 1809 | #ifdef CONFIG_PREEMPTION |
1810 | return spin_is_contended(lock); | 1810 | return spin_is_contended(lock); |
1811 | #else | 1811 | #else |
1812 | return 0; | 1812 | return 0; |
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index ed7c4d6b8235..031ce8617df8 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h | |||
@@ -214,7 +214,7 @@ static inline void do_raw_spin_unlock(raw_spinlock_t *lock) __releases(lock) | |||
214 | 214 | ||
215 | /* | 215 | /* |
216 | * Define the various spin_lock methods. Note we define these | 216 | * Define the various spin_lock methods. Note we define these |
217 | * regardless of whether CONFIG_SMP or CONFIG_PREEMPT are set. The | 217 | * regardless of whether CONFIG_SMP or CONFIG_PREEMPTION are set. The |
218 | * various methods are defined as nops in the case they are not | 218 | * various methods are defined as nops in the case they are not |
219 | * required. | 219 | * required. |
220 | */ | 220 | */ |
diff --git a/include/linux/spinlock_api_smp.h b/include/linux/spinlock_api_smp.h index 42dfab89e740..b762eaba4cdf 100644 --- a/include/linux/spinlock_api_smp.h +++ b/include/linux/spinlock_api_smp.h | |||
@@ -96,7 +96,7 @@ static inline int __raw_spin_trylock(raw_spinlock_t *lock) | |||
96 | 96 | ||
97 | /* | 97 | /* |
98 | * If lockdep is enabled then we use the non-preemption spin-ops | 98 | * If lockdep is enabled then we use the non-preemption spin-ops |
99 | * even on CONFIG_PREEMPT, because lockdep assumes that interrupts are | 99 | * even on CONFIG_PREEMPTION, because lockdep assumes that interrupts are |
100 | * not re-enabled during lock-acquire (which the preempt-spin-ops do): | 100 | * not re-enabled during lock-acquire (which the preempt-spin-ops do): |
101 | */ | 101 | */ |
102 | #if !defined(CONFIG_GENERIC_LOCKBREAK) || defined(CONFIG_DEBUG_LOCK_ALLOC) | 102 | #if !defined(CONFIG_GENERIC_LOCKBREAK) || defined(CONFIG_DEBUG_LOCK_ALLOC) |
diff --git a/include/linux/torture.h b/include/linux/torture.h index a620118385bb..6241f59e2d6f 100644 --- a/include/linux/torture.h +++ b/include/linux/torture.h | |||
@@ -86,7 +86,7 @@ void _torture_stop_kthread(char *m, struct task_struct **tp); | |||
86 | #define torture_stop_kthread(n, tp) \ | 86 | #define torture_stop_kthread(n, tp) \ |
87 | _torture_stop_kthread("Stopping " #n " task", &(tp)) | 87 | _torture_stop_kthread("Stopping " #n " task", &(tp)) |
88 | 88 | ||
89 | #ifdef CONFIG_PREEMPT | 89 | #ifdef CONFIG_PREEMPTION |
90 | #define torture_preempt_schedule() preempt_schedule() | 90 | #define torture_preempt_schedule() preempt_schedule() |
91 | #else | 91 | #else |
92 | #define torture_preempt_schedule() | 92 | #define torture_preempt_schedule() |
diff --git a/include/linux/wait.h b/include/linux/wait.h index b6f77cf60dd7..30c515520fb2 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h | |||
@@ -127,6 +127,19 @@ static inline int waitqueue_active(struct wait_queue_head *wq_head) | |||
127 | } | 127 | } |
128 | 128 | ||
129 | /** | 129 | /** |
130 | * wq_has_single_sleeper - check if there is only one sleeper | ||
131 | * @wq_head: wait queue head | ||
132 | * | ||
133 | * Returns true of wq_head has only one sleeper on the list. | ||
134 | * | ||
135 | * Please refer to the comment for waitqueue_active. | ||
136 | */ | ||
137 | static inline bool wq_has_single_sleeper(struct wait_queue_head *wq_head) | ||
138 | { | ||
139 | return list_is_singular(&wq_head->head); | ||
140 | } | ||
141 | |||
142 | /** | ||
130 | * wq_has_sleeper - check if there are any waiting processes | 143 | * wq_has_sleeper - check if there are any waiting processes |
131 | * @wq_head: wait queue head | 144 | * @wq_head: wait queue head |
132 | * | 145 | * |
diff --git a/include/scsi/libfcoe.h b/include/scsi/libfcoe.h index c50fb297e265..dc14b52577f7 100644 --- a/include/scsi/libfcoe.h +++ b/include/scsi/libfcoe.h | |||
@@ -31,7 +31,7 @@ | |||
31 | * FIP tunable parameters. | 31 | * FIP tunable parameters. |
32 | */ | 32 | */ |
33 | #define FCOE_CTLR_START_DELAY 2000 /* mS after first adv. to choose FCF */ | 33 | #define FCOE_CTLR_START_DELAY 2000 /* mS after first adv. to choose FCF */ |
34 | #define FCOE_CTRL_SOL_TOV 2000 /* min. solicitation interval (mS) */ | 34 | #define FCOE_CTLR_SOL_TOV 2000 /* min. solicitation interval (mS) */ |
35 | #define FCOE_CTLR_FCF_LIMIT 20 /* max. number of FCF entries */ | 35 | #define FCOE_CTLR_FCF_LIMIT 20 /* max. number of FCF entries */ |
36 | #define FCOE_CTLR_VN2VN_LOGIN_LIMIT 3 /* max. VN2VN rport login retries */ | 36 | #define FCOE_CTLR_VN2VN_LOGIN_LIMIT 3 /* max. VN2VN rport login retries */ |
37 | 37 | ||
diff --git a/include/soc/fsl/qe/qe.h b/include/soc/fsl/qe/qe.h index 3f9d6b6a5691..c1036d16ed03 100644 --- a/include/soc/fsl/qe/qe.h +++ b/include/soc/fsl/qe/qe.h | |||
@@ -259,7 +259,7 @@ static inline int qe_alive_during_sleep(void) | |||
259 | 259 | ||
260 | /* Structure that defines QE firmware binary files. | 260 | /* Structure that defines QE firmware binary files. |
261 | * | 261 | * |
262 | * See Documentation/powerpc/qe_firmware.txt for a description of these | 262 | * See Documentation/powerpc/qe_firmware.rst for a description of these |
263 | * fields. | 263 | * fields. |
264 | */ | 264 | */ |
265 | struct qe_firmware { | 265 | struct qe_firmware { |
diff --git a/include/sound/compress_driver.h b/include/sound/compress_driver.h index c5188ff724d1..bc88d6f964da 100644 --- a/include/sound/compress_driver.h +++ b/include/sound/compress_driver.h | |||
@@ -173,10 +173,7 @@ static inline void snd_compr_drain_notify(struct snd_compr_stream *stream) | |||
173 | if (snd_BUG_ON(!stream)) | 173 | if (snd_BUG_ON(!stream)) |
174 | return; | 174 | return; |
175 | 175 | ||
176 | if (stream->direction == SND_COMPRESS_PLAYBACK) | 176 | stream->runtime->state = SNDRV_PCM_STATE_SETUP; |
177 | stream->runtime->state = SNDRV_PCM_STATE_SETUP; | ||
178 | else | ||
179 | stream->runtime->state = SNDRV_PCM_STATE_PREPARED; | ||
180 | 177 | ||
181 | wake_up(&stream->runtime->sleep); | 178 | wake_up(&stream->runtime->sleep); |
182 | } | 179 | } |
diff --git a/include/sound/sof/control.h b/include/sound/sof/control.h index bded69e696d4..6080ea0facd7 100644 --- a/include/sound/sof/control.h +++ b/include/sound/sof/control.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */ | 1 | /* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */ |
2 | /* | 2 | /* |
3 | * This file is provided under a dual BSD/GPLv2 license. When using or | 3 | * This file is provided under a dual BSD/GPLv2 license. When using or |
4 | * redistributing this file, you may do so under either license. | 4 | * redistributing this file, you may do so under either license. |
diff --git a/include/sound/sof/dai-intel.h b/include/sound/sof/dai-intel.h index 4bb8ee138ba7..65e4c20e567c 100644 --- a/include/sound/sof/dai-intel.h +++ b/include/sound/sof/dai-intel.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */ | 1 | /* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */ |
2 | /* | 2 | /* |
3 | * This file is provided under a dual BSD/GPLv2 license. When using or | 3 | * This file is provided under a dual BSD/GPLv2 license. When using or |
4 | * redistributing this file, you may do so under either license. | 4 | * redistributing this file, you may do so under either license. |
diff --git a/include/sound/sof/dai.h b/include/sound/sof/dai.h index 3d174e20aa53..5b8de1b1983c 100644 --- a/include/sound/sof/dai.h +++ b/include/sound/sof/dai.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */ | 1 | /* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */ |
2 | /* | 2 | /* |
3 | * This file is provided under a dual BSD/GPLv2 license. When using or | 3 | * This file is provided under a dual BSD/GPLv2 license. When using or |
4 | * redistributing this file, you may do so under either license. | 4 | * redistributing this file, you may do so under either license. |
diff --git a/include/sound/sof/header.h b/include/sound/sof/header.h index 12867bbd4372..10f00c08dbb7 100644 --- a/include/sound/sof/header.h +++ b/include/sound/sof/header.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */ | 1 | /* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */ |
2 | /* | 2 | /* |
3 | * This file is provided under a dual BSD/GPLv2 license. When using or | 3 | * This file is provided under a dual BSD/GPLv2 license. When using or |
4 | * redistributing this file, you may do so under either license. | 4 | * redistributing this file, you may do so under either license. |
diff --git a/include/sound/sof/info.h b/include/sound/sof/info.h index 16528d2b4a50..a9156b4a062c 100644 --- a/include/sound/sof/info.h +++ b/include/sound/sof/info.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */ | 1 | /* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */ |
2 | /* | 2 | /* |
3 | * This file is provided under a dual BSD/GPLv2 license. When using or | 3 | * This file is provided under a dual BSD/GPLv2 license. When using or |
4 | * redistributing this file, you may do so under either license. | 4 | * redistributing this file, you may do so under either license. |
diff --git a/include/sound/sof/pm.h b/include/sound/sof/pm.h index 8ae3ad45bdf7..003879401d63 100644 --- a/include/sound/sof/pm.h +++ b/include/sound/sof/pm.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */ | 1 | /* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */ |
2 | /* | 2 | /* |
3 | * This file is provided under a dual BSD/GPLv2 license. When using or | 3 | * This file is provided under a dual BSD/GPLv2 license. When using or |
4 | * redistributing this file, you may do so under either license. | 4 | * redistributing this file, you may do so under either license. |
diff --git a/include/sound/sof/stream.h b/include/sound/sof/stream.h index 643f175cb479..0b71b381b952 100644 --- a/include/sound/sof/stream.h +++ b/include/sound/sof/stream.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */ | 1 | /* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */ |
2 | /* | 2 | /* |
3 | * This file is provided under a dual BSD/GPLv2 license. When using or | 3 | * This file is provided under a dual BSD/GPLv2 license. When using or |
4 | * redistributing this file, you may do so under either license. | 4 | * redistributing this file, you may do so under either license. |
diff --git a/include/sound/sof/topology.h b/include/sound/sof/topology.h index 41dcabf89899..c47b36240920 100644 --- a/include/sound/sof/topology.h +++ b/include/sound/sof/topology.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */ | 1 | /* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */ |
2 | /* | 2 | /* |
3 | * This file is provided under a dual BSD/GPLv2 license. When using or | 3 | * This file is provided under a dual BSD/GPLv2 license. When using or |
4 | * redistributing this file, you may do so under either license. | 4 | * redistributing this file, you may do so under either license. |
diff --git a/include/sound/sof/trace.h b/include/sound/sof/trace.h index 9257d5473d97..fda6e8f6ead4 100644 --- a/include/sound/sof/trace.h +++ b/include/sound/sof/trace.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */ | 1 | /* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */ |
2 | /* | 2 | /* |
3 | * This file is provided under a dual BSD/GPLv2 license. When using or | 3 | * This file is provided under a dual BSD/GPLv2 license. When using or |
4 | * redistributing this file, you may do so under either license. | 4 | * redistributing this file, you may do so under either license. |
diff --git a/include/sound/sof/xtensa.h b/include/sound/sof/xtensa.h index d25c764b10e8..dd53d36b34e1 100644 --- a/include/sound/sof/xtensa.h +++ b/include/sound/sof/xtensa.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */ | 1 | /* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */ |
2 | /* | 2 | /* |
3 | * This file is provided under a dual BSD/GPLv2 license. When using or | 3 | * This file is provided under a dual BSD/GPLv2 license. When using or |
4 | * redistributing this file, you may do so under either license. | 4 | * redistributing this file, you may do so under either license. |
diff --git a/include/uapi/linux/bpfilter.h b/include/uapi/linux/bpfilter.h index 2ec3cc99ea4c..cbc1f5813f50 100644 --- a/include/uapi/linux/bpfilter.h +++ b/include/uapi/linux/bpfilter.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
2 | #ifndef _UAPI_LINUX_BPFILTER_H | 2 | #ifndef _UAPI_LINUX_BPFILTER_H |
3 | #define _UAPI_LINUX_BPFILTER_H | 3 | #define _UAPI_LINUX_BPFILTER_H |
4 | 4 | ||
diff --git a/include/uapi/linux/ipmi_bmc.h b/include/uapi/linux/ipmi_bmc.h index 1670f0944227..782a03eb1086 100644 --- a/include/uapi/linux/ipmi_bmc.h +++ b/include/uapi/linux/ipmi_bmc.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2015-2018, Intel Corporation. | 3 | * Copyright (c) 2015-2018, Intel Corporation. |
4 | */ | 4 | */ |
diff --git a/include/uapi/linux/isst_if.h b/include/uapi/linux/isst_if.h index d10b832c58c5..0a52b7b093d3 100644 --- a/include/uapi/linux/isst_if.h +++ b/include/uapi/linux/isst_if.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
2 | /* | 2 | /* |
3 | * Intel Speed Select Interface: OS to hardware Interface | 3 | * Intel Speed Select Interface: OS to hardware Interface |
4 | * Copyright (c) 2019, Intel Corporation. | 4 | * Copyright (c) 2019, Intel Corporation. |
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index a7c19540ce21..5e3f12d5359e 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h | |||
@@ -116,7 +116,7 @@ struct kvm_irq_level { | |||
116 | * ACPI gsi notion of irq. | 116 | * ACPI gsi notion of irq. |
117 | * For IA-64 (APIC model) IOAPIC0: irq 0-23; IOAPIC1: irq 24-47.. | 117 | * For IA-64 (APIC model) IOAPIC0: irq 0-23; IOAPIC1: irq 24-47.. |
118 | * For X86 (standard AT mode) PIC0/1: irq 0-15. IOAPIC0: 0-23.. | 118 | * For X86 (standard AT mode) PIC0/1: irq 0-15. IOAPIC0: 0-23.. |
119 | * For ARM: See Documentation/virtual/kvm/api.txt | 119 | * For ARM: See Documentation/virt/kvm/api.txt |
120 | */ | 120 | */ |
121 | union { | 121 | union { |
122 | __u32 irq; | 122 | __u32 irq; |
@@ -1086,7 +1086,7 @@ struct kvm_xen_hvm_config { | |||
1086 | * | 1086 | * |
1087 | * KVM_IRQFD_FLAG_RESAMPLE indicates resamplefd is valid and specifies | 1087 | * KVM_IRQFD_FLAG_RESAMPLE indicates resamplefd is valid and specifies |
1088 | * the irqfd to operate in resampling mode for level triggered interrupt | 1088 | * the irqfd to operate in resampling mode for level triggered interrupt |
1089 | * emulation. See Documentation/virtual/kvm/api.txt. | 1089 | * emulation. See Documentation/virt/kvm/api.txt. |
1090 | */ | 1090 | */ |
1091 | #define KVM_IRQFD_FLAG_RESAMPLE (1 << 1) | 1091 | #define KVM_IRQFD_FLAG_RESAMPLE (1 << 1) |
1092 | 1092 | ||
diff --git a/include/uapi/linux/netfilter/nf_synproxy.h b/include/uapi/linux/netfilter/nf_synproxy.h index 6f3791c8946f..00d787f0260e 100644 --- a/include/uapi/linux/netfilter/nf_synproxy.h +++ b/include/uapi/linux/netfilter/nf_synproxy.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
2 | #ifndef _NF_SYNPROXY_H | 2 | #ifndef _NF_SYNPROXY_H |
3 | #define _NF_SYNPROXY_H | 3 | #define _NF_SYNPROXY_H |
4 | 4 | ||
diff --git a/include/uapi/linux/psp-sev.h b/include/uapi/linux/psp-sev.h index 8654b2442f6a..592a0c1b77c9 100644 --- a/include/uapi/linux/psp-sev.h +++ b/include/uapi/linux/psp-sev.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0-only */ | 1 | /* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */ |
2 | /* | 2 | /* |
3 | * Userspace interface for AMD Secure Encrypted Virtualization (SEV) | 3 | * Userspace interface for AMD Secure Encrypted Virtualization (SEV) |
4 | * platform management commands. | 4 | * platform management commands. |
diff --git a/include/uapi/linux/rxrpc.h b/include/uapi/linux/rxrpc.h index 782069dcf607..4accfa7e266d 100644 --- a/include/uapi/linux/rxrpc.h +++ b/include/uapi/linux/rxrpc.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later WITH Linux-syscall-note */ |
2 | /* Types and definitions for AF_RXRPC. | 2 | /* Types and definitions for AF_RXRPC. |
3 | * | 3 | * |
4 | * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. | 4 | * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. |
diff --git a/include/uapi/linux/serial_core.h b/include/uapi/linux/serial_core.h index 5642c05e0da0..3cc3af1c2ee1 100644 --- a/include/uapi/linux/serial_core.h +++ b/include/uapi/linux/serial_core.h | |||
@@ -150,9 +150,6 @@ | |||
150 | 150 | ||
151 | #define PORT_PNX8XXX 70 | 151 | #define PORT_PNX8XXX 70 |
152 | 152 | ||
153 | /* Hilscher netx */ | ||
154 | #define PORT_NETX 71 | ||
155 | |||
156 | /* SUN4V Hypervisor Console */ | 153 | /* SUN4V Hypervisor Console */ |
157 | #define PORT_SUNHV 72 | 154 | #define PORT_SUNHV 72 |
158 | 155 | ||
diff --git a/include/uapi/linux/usb/g_uvc.h b/include/uapi/linux/usb/g_uvc.h index 3c9ee3020cbb..652f169a019e 100644 --- a/include/uapi/linux/usb/g_uvc.h +++ b/include/uapi/linux/usb/g_uvc.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0+ */ | 1 | /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */ |
2 | /* | 2 | /* |
3 | * g_uvc.h -- USB Video Class Gadget driver API | 3 | * g_uvc.h -- USB Video Class Gadget driver API |
4 | * | 4 | * |
diff --git a/include/uapi/linux/vbox_vmmdev_types.h b/include/uapi/linux/vbox_vmmdev_types.h index 26f39816af14..c27289fd619a 100644 --- a/include/uapi/linux/vbox_vmmdev_types.h +++ b/include/uapi/linux/vbox_vmmdev_types.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: (GPL-2.0 OR CDDL-1.0) */ | 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR CDDL-1.0) */ |
2 | /* | 2 | /* |
3 | * Virtual Device for Guest <-> VMM/Host communication, type definitions | 3 | * Virtual Device for Guest <-> VMM/Host communication, type definitions |
4 | * which are also used for the vboxguest ioctl interface / by vboxsf | 4 | * which are also used for the vboxguest ioctl interface / by vboxsf |
diff --git a/include/uapi/linux/vboxguest.h b/include/uapi/linux/vboxguest.h index 612f0c7d3558..9cec58a6a5ea 100644 --- a/include/uapi/linux/vboxguest.h +++ b/include/uapi/linux/vboxguest.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: (GPL-2.0 OR CDDL-1.0) */ | 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR CDDL-1.0) */ |
2 | /* | 2 | /* |
3 | * VBoxGuest - VirtualBox Guest Additions Driver Interface. | 3 | * VBoxGuest - VirtualBox Guest Additions Driver Interface. |
4 | * | 4 | * |
diff --git a/include/uapi/linux/virtio_iommu.h b/include/uapi/linux/virtio_iommu.h index ba1b460c9944..237e36a280cb 100644 --- a/include/uapi/linux/virtio_iommu.h +++ b/include/uapi/linux/virtio_iommu.h | |||
@@ -1,8 +1,8 @@ | |||
1 | /* SPDX-License-Identifier: BSD-3-Clause */ | 1 | /* SPDX-License-Identifier: BSD-3-Clause */ |
2 | /* | 2 | /* |
3 | * Virtio-iommu definition v0.9 | 3 | * Virtio-iommu definition v0.12 |
4 | * | 4 | * |
5 | * Copyright (C) 2018 Arm Ltd. | 5 | * Copyright (C) 2019 Arm Ltd. |
6 | */ | 6 | */ |
7 | #ifndef _UAPI_LINUX_VIRTIO_IOMMU_H | 7 | #ifndef _UAPI_LINUX_VIRTIO_IOMMU_H |
8 | #define _UAPI_LINUX_VIRTIO_IOMMU_H | 8 | #define _UAPI_LINUX_VIRTIO_IOMMU_H |
@@ -11,26 +11,31 @@ | |||
11 | 11 | ||
12 | /* Feature bits */ | 12 | /* Feature bits */ |
13 | #define VIRTIO_IOMMU_F_INPUT_RANGE 0 | 13 | #define VIRTIO_IOMMU_F_INPUT_RANGE 0 |
14 | #define VIRTIO_IOMMU_F_DOMAIN_BITS 1 | 14 | #define VIRTIO_IOMMU_F_DOMAIN_RANGE 1 |
15 | #define VIRTIO_IOMMU_F_MAP_UNMAP 2 | 15 | #define VIRTIO_IOMMU_F_MAP_UNMAP 2 |
16 | #define VIRTIO_IOMMU_F_BYPASS 3 | 16 | #define VIRTIO_IOMMU_F_BYPASS 3 |
17 | #define VIRTIO_IOMMU_F_PROBE 4 | 17 | #define VIRTIO_IOMMU_F_PROBE 4 |
18 | #define VIRTIO_IOMMU_F_MMIO 5 | ||
18 | 19 | ||
19 | struct virtio_iommu_range { | 20 | struct virtio_iommu_range_64 { |
20 | __u64 start; | 21 | __le64 start; |
21 | __u64 end; | 22 | __le64 end; |
23 | }; | ||
24 | |||
25 | struct virtio_iommu_range_32 { | ||
26 | __le32 start; | ||
27 | __le32 end; | ||
22 | }; | 28 | }; |
23 | 29 | ||
24 | struct virtio_iommu_config { | 30 | struct virtio_iommu_config { |
25 | /* Supported page sizes */ | 31 | /* Supported page sizes */ |
26 | __u64 page_size_mask; | 32 | __le64 page_size_mask; |
27 | /* Supported IOVA range */ | 33 | /* Supported IOVA range */ |
28 | struct virtio_iommu_range input_range; | 34 | struct virtio_iommu_range_64 input_range; |
29 | /* Max domain ID size */ | 35 | /* Max domain ID size */ |
30 | __u8 domain_bits; | 36 | struct virtio_iommu_range_32 domain_range; |
31 | __u8 padding[3]; | ||
32 | /* Probe buffer size */ | 37 | /* Probe buffer size */ |
33 | __u32 probe_size; | 38 | __le32 probe_size; |
34 | }; | 39 | }; |
35 | 40 | ||
36 | /* Request types */ | 41 | /* Request types */ |
@@ -49,6 +54,7 @@ struct virtio_iommu_config { | |||
49 | #define VIRTIO_IOMMU_S_RANGE 0x05 | 54 | #define VIRTIO_IOMMU_S_RANGE 0x05 |
50 | #define VIRTIO_IOMMU_S_NOENT 0x06 | 55 | #define VIRTIO_IOMMU_S_NOENT 0x06 |
51 | #define VIRTIO_IOMMU_S_FAULT 0x07 | 56 | #define VIRTIO_IOMMU_S_FAULT 0x07 |
57 | #define VIRTIO_IOMMU_S_NOMEM 0x08 | ||
52 | 58 | ||
53 | struct virtio_iommu_req_head { | 59 | struct virtio_iommu_req_head { |
54 | __u8 type; | 60 | __u8 type; |
@@ -78,12 +84,10 @@ struct virtio_iommu_req_detach { | |||
78 | 84 | ||
79 | #define VIRTIO_IOMMU_MAP_F_READ (1 << 0) | 85 | #define VIRTIO_IOMMU_MAP_F_READ (1 << 0) |
80 | #define VIRTIO_IOMMU_MAP_F_WRITE (1 << 1) | 86 | #define VIRTIO_IOMMU_MAP_F_WRITE (1 << 1) |
81 | #define VIRTIO_IOMMU_MAP_F_EXEC (1 << 2) | 87 | #define VIRTIO_IOMMU_MAP_F_MMIO (1 << 2) |
82 | #define VIRTIO_IOMMU_MAP_F_MMIO (1 << 3) | ||
83 | 88 | ||
84 | #define VIRTIO_IOMMU_MAP_F_MASK (VIRTIO_IOMMU_MAP_F_READ | \ | 89 | #define VIRTIO_IOMMU_MAP_F_MASK (VIRTIO_IOMMU_MAP_F_READ | \ |
85 | VIRTIO_IOMMU_MAP_F_WRITE | \ | 90 | VIRTIO_IOMMU_MAP_F_WRITE | \ |
86 | VIRTIO_IOMMU_MAP_F_EXEC | \ | ||
87 | VIRTIO_IOMMU_MAP_F_MMIO) | 91 | VIRTIO_IOMMU_MAP_F_MMIO) |
88 | 92 | ||
89 | struct virtio_iommu_req_map { | 93 | struct virtio_iommu_req_map { |
diff --git a/include/uapi/linux/virtio_pmem.h b/include/uapi/linux/virtio_pmem.h index 9a63ed6d062f..b022787ffb94 100644 --- a/include/uapi/linux/virtio_pmem.h +++ b/include/uapi/linux/virtio_pmem.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ | 1 | /* SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause */ |
2 | /* | 2 | /* |
3 | * Definitions for virtio-pmem devices. | 3 | * Definitions for virtio-pmem devices. |
4 | * | 4 | * |
diff --git a/include/uapi/linux/vmcore.h b/include/uapi/linux/vmcore.h index 022619668e0e..3e9da91866ff 100644 --- a/include/uapi/linux/vmcore.h +++ b/include/uapi/linux/vmcore.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
2 | #ifndef _UAPI_VMCORE_H | 2 | #ifndef _UAPI_VMCORE_H |
3 | #define _UAPI_VMCORE_H | 3 | #define _UAPI_VMCORE_H |
4 | 4 | ||
diff --git a/include/uapi/linux/wmi.h b/include/uapi/linux/wmi.h index c36f2d7675a4..7085c5dca9fa 100644 --- a/include/uapi/linux/wmi.h +++ b/include/uapi/linux/wmi.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0-only */ | 1 | /* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */ |
2 | /* | 2 | /* |
3 | * User API methods for ACPI-WMI mapping driver | 3 | * User API methods for ACPI-WMI mapping driver |
4 | * | 4 | * |
diff --git a/include/uapi/misc/fastrpc.h b/include/uapi/misc/fastrpc.h index 6d701af9fc42..fb792e882cef 100644 --- a/include/uapi/misc/fastrpc.h +++ b/include/uapi/misc/fastrpc.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
2 | 2 | ||
3 | #ifndef __QCOM_FASTRPC_H__ | 3 | #ifndef __QCOM_FASTRPC_H__ |
4 | #define __QCOM_FASTRPC_H__ | 4 | #define __QCOM_FASTRPC_H__ |
diff --git a/include/uapi/rdma/rvt-abi.h b/include/uapi/rdma/rvt-abi.h index 7328293c715c..7c05a02d2be5 100644 --- a/include/uapi/rdma/rvt-abi.h +++ b/include/uapi/rdma/rvt-abi.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */ | 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * This file contains defines, structures, etc. that are used | 4 | * This file contains defines, structures, etc. that are used |
diff --git a/include/uapi/rdma/siw-abi.h b/include/uapi/rdma/siw-abi.h index 3dd8071ace7b..7de68f1dc707 100644 --- a/include/uapi/rdma/siw-abi.h +++ b/include/uapi/rdma/siw-abi.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 or BSD-3-Clause */ | 1 | /* SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) or BSD-3-Clause */ |
2 | 2 | ||
3 | /* Authors: Bernard Metzler <bmt@zurich.ibm.com> */ | 3 | /* Authors: Bernard Metzler <bmt@zurich.ibm.com> */ |
4 | /* Copyright (c) 2008-2019, IBM Corporation */ | 4 | /* Copyright (c) 2008-2019, IBM Corporation */ |
diff --git a/include/uapi/scsi/scsi_bsg_ufs.h b/include/uapi/scsi/scsi_bsg_ufs.h index 17c7abd0803a..9988db6ad244 100644 --- a/include/uapi/scsi/scsi_bsg_ufs.h +++ b/include/uapi/scsi/scsi_bsg_ufs.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
2 | /* | 2 | /* |
3 | * UFS Transport SGIO v4 BSG Message Support | 3 | * UFS Transport SGIO v4 BSG Message Support |
4 | * | 4 | * |
diff --git a/include/uapi/sound/skl-tplg-interface.h b/include/uapi/sound/skl-tplg-interface.h index f39352cef382..9eee32f5e407 100644 --- a/include/uapi/sound/skl-tplg-interface.h +++ b/include/uapi/sound/skl-tplg-interface.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
2 | /* | 2 | /* |
3 | * skl-tplg-interface.h - Intel DSP FW private data interface | 3 | * skl-tplg-interface.h - Intel DSP FW private data interface |
4 | * | 4 | * |
diff --git a/init/init_task.c b/init/init_task.c index 7ab773b9b3cd..bfe06c53b14e 100644 --- a/init/init_task.c +++ b/init/init_task.c | |||
@@ -174,7 +174,7 @@ struct task_struct init_task | |||
174 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | 174 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER |
175 | .ret_stack = NULL, | 175 | .ret_stack = NULL, |
176 | #endif | 176 | #endif |
177 | #if defined(CONFIG_TRACING) && defined(CONFIG_PREEMPT) | 177 | #if defined(CONFIG_TRACING) && defined(CONFIG_PREEMPTION) |
178 | .trace_recursion = 0, | 178 | .trace_recursion = 0, |
179 | #endif | 179 | #endif |
180 | #ifdef CONFIG_LIVEPATCH | 180 | #ifdef CONFIG_LIVEPATCH |
diff --git a/init/main.c b/init/main.c index 96f8d5af52d6..653693da8da6 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -433,7 +433,7 @@ noinline void __ref rest_init(void) | |||
433 | 433 | ||
434 | /* | 434 | /* |
435 | * Enable might_sleep() and smp_processor_id() checks. | 435 | * Enable might_sleep() and smp_processor_id() checks. |
436 | * They cannot be enabled earlier because with CONFIG_PREEMPT=y | 436 | * They cannot be enabled earlier because with CONFIG_PREEMPTION=y |
437 | * kernel_thread() would trigger might_sleep() splats. With | 437 | * kernel_thread() would trigger might_sleep() splats. With |
438 | * CONFIG_PREEMPT_VOLUNTARY=y the init task might have scheduled | 438 | * CONFIG_PREEMPT_VOLUNTARY=y the init task might have scheduled |
439 | * already, but it's stuck on the kthreadd_done completion. | 439 | * already, but it's stuck on the kthreadd_done completion. |
diff --git a/kernel/cred.c b/kernel/cred.c index f9a0ce66c9c3..c0a4c12d38b2 100644 --- a/kernel/cred.c +++ b/kernel/cred.c | |||
@@ -144,7 +144,10 @@ void __put_cred(struct cred *cred) | |||
144 | BUG_ON(cred == current->cred); | 144 | BUG_ON(cred == current->cred); |
145 | BUG_ON(cred == current->real_cred); | 145 | BUG_ON(cred == current->real_cred); |
146 | 146 | ||
147 | call_rcu(&cred->rcu, put_cred_rcu); | 147 | if (cred->non_rcu) |
148 | put_cred_rcu(&cred->rcu); | ||
149 | else | ||
150 | call_rcu(&cred->rcu, put_cred_rcu); | ||
148 | } | 151 | } |
149 | EXPORT_SYMBOL(__put_cred); | 152 | EXPORT_SYMBOL(__put_cred); |
150 | 153 | ||
@@ -261,6 +264,7 @@ struct cred *prepare_creds(void) | |||
261 | old = task->cred; | 264 | old = task->cred; |
262 | memcpy(new, old, sizeof(struct cred)); | 265 | memcpy(new, old, sizeof(struct cred)); |
263 | 266 | ||
267 | new->non_rcu = 0; | ||
264 | atomic_set(&new->usage, 1); | 268 | atomic_set(&new->usage, 1); |
265 | set_cred_subscribers(new, 0); | 269 | set_cred_subscribers(new, 0); |
266 | get_group_info(new->group_info); | 270 | get_group_info(new->group_info); |
@@ -544,7 +548,19 @@ const struct cred *override_creds(const struct cred *new) | |||
544 | 548 | ||
545 | validate_creds(old); | 549 | validate_creds(old); |
546 | validate_creds(new); | 550 | validate_creds(new); |
547 | get_cred(new); | 551 | |
552 | /* | ||
553 | * NOTE! This uses 'get_new_cred()' rather than 'get_cred()'. | ||
554 | * | ||
555 | * That means that we do not clear the 'non_rcu' flag, since | ||
556 | * we are only installing the cred into the thread-synchronous | ||
557 | * '->cred' pointer, not the '->real_cred' pointer that is | ||
558 | * visible to other threads under RCU. | ||
559 | * | ||
560 | * Also note that we did validate_creds() manually, not depending | ||
561 | * on the validation in 'get_cred()'. | ||
562 | */ | ||
563 | get_new_cred((struct cred *)new); | ||
548 | alter_cred_subscribers(new, 1); | 564 | alter_cred_subscribers(new, 1); |
549 | rcu_assign_pointer(current->cred, new); | 565 | rcu_assign_pointer(current->cred, new); |
550 | alter_cred_subscribers(old, -1); | 566 | alter_cred_subscribers(old, -1); |
@@ -681,6 +697,7 @@ struct cred *prepare_kernel_cred(struct task_struct *daemon) | |||
681 | validate_creds(old); | 697 | validate_creds(old); |
682 | 698 | ||
683 | *new = *old; | 699 | *new = *old; |
700 | new->non_rcu = 0; | ||
684 | atomic_set(&new->usage, 1); | 701 | atomic_set(&new->usage, 1); |
685 | set_cred_subscribers(new, 0); | 702 | set_cred_subscribers(new, 0); |
686 | get_uid(new->user); | 703 | get_uid(new->user); |
diff --git a/kernel/events/core.c b/kernel/events/core.c index ea5e8139fe62..c1f52a749db2 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c | |||
@@ -11271,7 +11271,7 @@ perf_event_create_kernel_counter(struct perf_event_attr *attr, int cpu, | |||
11271 | goto err_unlock; | 11271 | goto err_unlock; |
11272 | } | 11272 | } |
11273 | 11273 | ||
11274 | perf_install_in_context(ctx, event, cpu); | 11274 | perf_install_in_context(ctx, event, event->cpu); |
11275 | perf_unpin_context(ctx); | 11275 | perf_unpin_context(ctx); |
11276 | mutex_unlock(&ctx->mutex); | 11276 | mutex_unlock(&ctx->mutex); |
11277 | 11277 | ||
diff --git a/kernel/kprobes.c b/kernel/kprobes.c index 9873fc627d61..8bc5f1ffd68e 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c | |||
@@ -1906,7 +1906,7 @@ int register_kretprobe(struct kretprobe *rp) | |||
1906 | 1906 | ||
1907 | /* Pre-allocate memory for max kretprobe instances */ | 1907 | /* Pre-allocate memory for max kretprobe instances */ |
1908 | if (rp->maxactive <= 0) { | 1908 | if (rp->maxactive <= 0) { |
1909 | #ifdef CONFIG_PREEMPT | 1909 | #ifdef CONFIG_PREEMPTION |
1910 | rp->maxactive = max_t(unsigned int, 10, 2*num_possible_cpus()); | 1910 | rp->maxactive = max_t(unsigned int, 10, 2*num_possible_cpus()); |
1911 | #else | 1911 | #else |
1912 | rp->maxactive = num_possible_cpus(); | 1912 | rp->maxactive = num_possible_cpus(); |
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index 341f52117f88..4861cf8e274b 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c | |||
@@ -448,7 +448,7 @@ static void print_lockdep_off(const char *bug_msg) | |||
448 | 448 | ||
449 | unsigned long nr_stack_trace_entries; | 449 | unsigned long nr_stack_trace_entries; |
450 | 450 | ||
451 | #if defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_PROVE_LOCKING) | 451 | #ifdef CONFIG_PROVE_LOCKING |
452 | /* | 452 | /* |
453 | * Stack-trace: tightly packed array of stack backtrace | 453 | * Stack-trace: tightly packed array of stack backtrace |
454 | * addresses. Protected by the graph_lock. | 454 | * addresses. Protected by the graph_lock. |
@@ -491,7 +491,7 @@ unsigned int max_lockdep_depth; | |||
491 | DEFINE_PER_CPU(struct lockdep_stats, lockdep_stats); | 491 | DEFINE_PER_CPU(struct lockdep_stats, lockdep_stats); |
492 | #endif | 492 | #endif |
493 | 493 | ||
494 | #if defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_PROVE_LOCKING) | 494 | #ifdef CONFIG_PROVE_LOCKING |
495 | /* | 495 | /* |
496 | * Locking printouts: | 496 | * Locking printouts: |
497 | */ | 497 | */ |
@@ -2969,7 +2969,7 @@ static void check_chain_key(struct task_struct *curr) | |||
2969 | #endif | 2969 | #endif |
2970 | } | 2970 | } |
2971 | 2971 | ||
2972 | #if defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_PROVE_LOCKING) | 2972 | #ifdef CONFIG_PROVE_LOCKING |
2973 | static int mark_lock(struct task_struct *curr, struct held_lock *this, | 2973 | static int mark_lock(struct task_struct *curr, struct held_lock *this, |
2974 | enum lock_usage_bit new_bit); | 2974 | enum lock_usage_bit new_bit); |
2975 | 2975 | ||
@@ -3608,7 +3608,7 @@ static int mark_lock(struct task_struct *curr, struct held_lock *this, | |||
3608 | return ret; | 3608 | return ret; |
3609 | } | 3609 | } |
3610 | 3610 | ||
3611 | #else /* defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_PROVE_LOCKING) */ | 3611 | #else /* CONFIG_PROVE_LOCKING */ |
3612 | 3612 | ||
3613 | static inline int | 3613 | static inline int |
3614 | mark_usage(struct task_struct *curr, struct held_lock *hlock, int check) | 3614 | mark_usage(struct task_struct *curr, struct held_lock *hlock, int check) |
@@ -3627,7 +3627,7 @@ static inline int separate_irq_context(struct task_struct *curr, | |||
3627 | return 0; | 3627 | return 0; |
3628 | } | 3628 | } |
3629 | 3629 | ||
3630 | #endif /* defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_PROVE_LOCKING) */ | 3630 | #endif /* CONFIG_PROVE_LOCKING */ |
3631 | 3631 | ||
3632 | /* | 3632 | /* |
3633 | * Initialize a lock instance's lock-class mapping info: | 3633 | * Initialize a lock instance's lock-class mapping info: |
@@ -4321,8 +4321,7 @@ static void __lock_unpin_lock(struct lockdep_map *lock, struct pin_cookie cookie | |||
4321 | */ | 4321 | */ |
4322 | static void check_flags(unsigned long flags) | 4322 | static void check_flags(unsigned long flags) |
4323 | { | 4323 | { |
4324 | #if defined(CONFIG_PROVE_LOCKING) && defined(CONFIG_DEBUG_LOCKDEP) && \ | 4324 | #if defined(CONFIG_PROVE_LOCKING) && defined(CONFIG_DEBUG_LOCKDEP) |
4325 | defined(CONFIG_TRACE_IRQFLAGS) | ||
4326 | if (!debug_locks) | 4325 | if (!debug_locks) |
4327 | return; | 4326 | return; |
4328 | 4327 | ||
diff --git a/kernel/locking/lockdep_proc.c b/kernel/locking/lockdep_proc.c index 65b6a1600c8f..bda006f8a88b 100644 --- a/kernel/locking/lockdep_proc.c +++ b/kernel/locking/lockdep_proc.c | |||
@@ -200,7 +200,6 @@ static void lockdep_stats_debug_show(struct seq_file *m) | |||
200 | 200 | ||
201 | static int lockdep_stats_show(struct seq_file *m, void *v) | 201 | static int lockdep_stats_show(struct seq_file *m, void *v) |
202 | { | 202 | { |
203 | struct lock_class *class; | ||
204 | unsigned long nr_unused = 0, nr_uncategorized = 0, | 203 | unsigned long nr_unused = 0, nr_uncategorized = 0, |
205 | nr_irq_safe = 0, nr_irq_unsafe = 0, | 204 | nr_irq_safe = 0, nr_irq_unsafe = 0, |
206 | nr_softirq_safe = 0, nr_softirq_unsafe = 0, | 205 | nr_softirq_safe = 0, nr_softirq_unsafe = 0, |
@@ -211,6 +210,8 @@ static int lockdep_stats_show(struct seq_file *m, void *v) | |||
211 | sum_forward_deps = 0; | 210 | sum_forward_deps = 0; |
212 | 211 | ||
213 | #ifdef CONFIG_PROVE_LOCKING | 212 | #ifdef CONFIG_PROVE_LOCKING |
213 | struct lock_class *class; | ||
214 | |||
214 | list_for_each_entry(class, &all_lock_classes, lock_entry) { | 215 | list_for_each_entry(class, &all_lock_classes, lock_entry) { |
215 | 216 | ||
216 | if (class->usage_mask == 0) | 217 | if (class->usage_mask == 0) |
diff --git a/kernel/locking/mutex.c b/kernel/locking/mutex.c index edd1c082dbf5..5e069734363c 100644 --- a/kernel/locking/mutex.c +++ b/kernel/locking/mutex.c | |||
@@ -908,6 +908,10 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, | |||
908 | 908 | ||
909 | might_sleep(); | 909 | might_sleep(); |
910 | 910 | ||
911 | #ifdef CONFIG_DEBUG_MUTEXES | ||
912 | DEBUG_LOCKS_WARN_ON(lock->magic != lock); | ||
913 | #endif | ||
914 | |||
911 | ww = container_of(lock, struct ww_mutex, base); | 915 | ww = container_of(lock, struct ww_mutex, base); |
912 | if (use_ww_ctx && ww_ctx) { | 916 | if (use_ww_ctx && ww_ctx) { |
913 | if (unlikely(ww_ctx == READ_ONCE(ww->ctx))) | 917 | if (unlikely(ww_ctx == READ_ONCE(ww->ctx))) |
@@ -1379,8 +1383,13 @@ __ww_mutex_lock_interruptible_slowpath(struct ww_mutex *lock, | |||
1379 | */ | 1383 | */ |
1380 | int __sched mutex_trylock(struct mutex *lock) | 1384 | int __sched mutex_trylock(struct mutex *lock) |
1381 | { | 1385 | { |
1382 | bool locked = __mutex_trylock(lock); | 1386 | bool locked; |
1387 | |||
1388 | #ifdef CONFIG_DEBUG_MUTEXES | ||
1389 | DEBUG_LOCKS_WARN_ON(lock->magic != lock); | ||
1390 | #endif | ||
1383 | 1391 | ||
1392 | locked = __mutex_trylock(lock); | ||
1384 | if (locked) | 1393 | if (locked) |
1385 | mutex_acquire(&lock->dep_map, 0, 1, _RET_IP_); | 1394 | mutex_acquire(&lock->dep_map, 0, 1, _RET_IP_); |
1386 | 1395 | ||
diff --git a/kernel/locking/rwsem.c b/kernel/locking/rwsem.c index 37524a47f002..bd0f0d05724c 100644 --- a/kernel/locking/rwsem.c +++ b/kernel/locking/rwsem.c | |||
@@ -666,7 +666,11 @@ static inline bool rwsem_can_spin_on_owner(struct rw_semaphore *sem, | |||
666 | preempt_disable(); | 666 | preempt_disable(); |
667 | rcu_read_lock(); | 667 | rcu_read_lock(); |
668 | owner = rwsem_owner_flags(sem, &flags); | 668 | owner = rwsem_owner_flags(sem, &flags); |
669 | if ((flags & nonspinnable) || (owner && !owner_on_cpu(owner))) | 669 | /* |
670 | * Don't check the read-owner as the entry may be stale. | ||
671 | */ | ||
672 | if ((flags & nonspinnable) || | ||
673 | (owner && !(flags & RWSEM_READER_OWNED) && !owner_on_cpu(owner))) | ||
670 | ret = false; | 674 | ret = false; |
671 | rcu_read_unlock(); | 675 | rcu_read_unlock(); |
672 | preempt_enable(); | 676 | preempt_enable(); |
@@ -1000,6 +1004,7 @@ rwsem_down_read_slowpath(struct rw_semaphore *sem, int state) | |||
1000 | atomic_long_add(-RWSEM_READER_BIAS, &sem->count); | 1004 | atomic_long_add(-RWSEM_READER_BIAS, &sem->count); |
1001 | adjustment = 0; | 1005 | adjustment = 0; |
1002 | if (rwsem_optimistic_spin(sem, false)) { | 1006 | if (rwsem_optimistic_spin(sem, false)) { |
1007 | /* rwsem_optimistic_spin() implies ACQUIRE on success */ | ||
1003 | /* | 1008 | /* |
1004 | * Wake up other readers in the wait list if the front | 1009 | * Wake up other readers in the wait list if the front |
1005 | * waiter is a reader. | 1010 | * waiter is a reader. |
@@ -1014,6 +1019,7 @@ rwsem_down_read_slowpath(struct rw_semaphore *sem, int state) | |||
1014 | } | 1019 | } |
1015 | return sem; | 1020 | return sem; |
1016 | } else if (rwsem_reader_phase_trylock(sem, waiter.last_rowner)) { | 1021 | } else if (rwsem_reader_phase_trylock(sem, waiter.last_rowner)) { |
1022 | /* rwsem_reader_phase_trylock() implies ACQUIRE on success */ | ||
1017 | return sem; | 1023 | return sem; |
1018 | } | 1024 | } |
1019 | 1025 | ||
@@ -1032,6 +1038,8 @@ queue: | |||
1032 | */ | 1038 | */ |
1033 | if (adjustment && !(atomic_long_read(&sem->count) & | 1039 | if (adjustment && !(atomic_long_read(&sem->count) & |
1034 | (RWSEM_WRITER_MASK | RWSEM_FLAG_HANDOFF))) { | 1040 | (RWSEM_WRITER_MASK | RWSEM_FLAG_HANDOFF))) { |
1041 | /* Provide lock ACQUIRE */ | ||
1042 | smp_acquire__after_ctrl_dep(); | ||
1035 | raw_spin_unlock_irq(&sem->wait_lock); | 1043 | raw_spin_unlock_irq(&sem->wait_lock); |
1036 | rwsem_set_reader_owned(sem); | 1044 | rwsem_set_reader_owned(sem); |
1037 | lockevent_inc(rwsem_rlock_fast); | 1045 | lockevent_inc(rwsem_rlock_fast); |
@@ -1065,15 +1073,18 @@ queue: | |||
1065 | wake_up_q(&wake_q); | 1073 | wake_up_q(&wake_q); |
1066 | 1074 | ||
1067 | /* wait to be given the lock */ | 1075 | /* wait to be given the lock */ |
1068 | while (true) { | 1076 | for (;;) { |
1069 | set_current_state(state); | 1077 | set_current_state(state); |
1070 | if (!waiter.task) | 1078 | if (!smp_load_acquire(&waiter.task)) { |
1079 | /* Matches rwsem_mark_wake()'s smp_store_release(). */ | ||
1071 | break; | 1080 | break; |
1081 | } | ||
1072 | if (signal_pending_state(state, current)) { | 1082 | if (signal_pending_state(state, current)) { |
1073 | raw_spin_lock_irq(&sem->wait_lock); | 1083 | raw_spin_lock_irq(&sem->wait_lock); |
1074 | if (waiter.task) | 1084 | if (waiter.task) |
1075 | goto out_nolock; | 1085 | goto out_nolock; |
1076 | raw_spin_unlock_irq(&sem->wait_lock); | 1086 | raw_spin_unlock_irq(&sem->wait_lock); |
1087 | /* Ordered by sem->wait_lock against rwsem_mark_wake(). */ | ||
1077 | break; | 1088 | break; |
1078 | } | 1089 | } |
1079 | schedule(); | 1090 | schedule(); |
@@ -1083,6 +1094,7 @@ queue: | |||
1083 | __set_current_state(TASK_RUNNING); | 1094 | __set_current_state(TASK_RUNNING); |
1084 | lockevent_inc(rwsem_rlock); | 1095 | lockevent_inc(rwsem_rlock); |
1085 | return sem; | 1096 | return sem; |
1097 | |||
1086 | out_nolock: | 1098 | out_nolock: |
1087 | list_del(&waiter.list); | 1099 | list_del(&waiter.list); |
1088 | if (list_empty(&sem->wait_list)) { | 1100 | if (list_empty(&sem->wait_list)) { |
@@ -1123,8 +1135,10 @@ rwsem_down_write_slowpath(struct rw_semaphore *sem, int state) | |||
1123 | 1135 | ||
1124 | /* do optimistic spinning and steal lock if possible */ | 1136 | /* do optimistic spinning and steal lock if possible */ |
1125 | if (rwsem_can_spin_on_owner(sem, RWSEM_WR_NONSPINNABLE) && | 1137 | if (rwsem_can_spin_on_owner(sem, RWSEM_WR_NONSPINNABLE) && |
1126 | rwsem_optimistic_spin(sem, true)) | 1138 | rwsem_optimistic_spin(sem, true)) { |
1139 | /* rwsem_optimistic_spin() implies ACQUIRE on success */ | ||
1127 | return sem; | 1140 | return sem; |
1141 | } | ||
1128 | 1142 | ||
1129 | /* | 1143 | /* |
1130 | * Disable reader optimistic spinning for this rwsem after | 1144 | * Disable reader optimistic spinning for this rwsem after |
@@ -1184,9 +1198,11 @@ rwsem_down_write_slowpath(struct rw_semaphore *sem, int state) | |||
1184 | wait: | 1198 | wait: |
1185 | /* wait until we successfully acquire the lock */ | 1199 | /* wait until we successfully acquire the lock */ |
1186 | set_current_state(state); | 1200 | set_current_state(state); |
1187 | while (true) { | 1201 | for (;;) { |
1188 | if (rwsem_try_write_lock(sem, wstate)) | 1202 | if (rwsem_try_write_lock(sem, wstate)) { |
1203 | /* rwsem_try_write_lock() implies ACQUIRE on success */ | ||
1189 | break; | 1204 | break; |
1205 | } | ||
1190 | 1206 | ||
1191 | raw_spin_unlock_irq(&sem->wait_lock); | 1207 | raw_spin_unlock_irq(&sem->wait_lock); |
1192 | 1208 | ||
diff --git a/kernel/rcu/Kconfig b/kernel/rcu/Kconfig index 480edf328b51..7644eda17d62 100644 --- a/kernel/rcu/Kconfig +++ b/kernel/rcu/Kconfig | |||
@@ -7,7 +7,7 @@ menu "RCU Subsystem" | |||
7 | 7 | ||
8 | config TREE_RCU | 8 | config TREE_RCU |
9 | bool | 9 | bool |
10 | default y if !PREEMPT && SMP | 10 | default y if !PREEMPTION && SMP |
11 | help | 11 | help |
12 | This option selects the RCU implementation that is | 12 | This option selects the RCU implementation that is |
13 | designed for very large SMP system with hundreds or | 13 | designed for very large SMP system with hundreds or |
@@ -16,7 +16,7 @@ config TREE_RCU | |||
16 | 16 | ||
17 | config PREEMPT_RCU | 17 | config PREEMPT_RCU |
18 | bool | 18 | bool |
19 | default y if PREEMPT | 19 | default y if PREEMPTION |
20 | help | 20 | help |
21 | This option selects the RCU implementation that is | 21 | This option selects the RCU implementation that is |
22 | designed for very large SMP systems with hundreds or | 22 | designed for very large SMP systems with hundreds or |
@@ -28,7 +28,7 @@ config PREEMPT_RCU | |||
28 | 28 | ||
29 | config TINY_RCU | 29 | config TINY_RCU |
30 | bool | 30 | bool |
31 | default y if !PREEMPT && !SMP | 31 | default y if !PREEMPTION && !SMP |
32 | help | 32 | help |
33 | This option selects the RCU implementation that is | 33 | This option selects the RCU implementation that is |
34 | designed for UP systems from which real-time response | 34 | designed for UP systems from which real-time response |
@@ -70,7 +70,7 @@ config TREE_SRCU | |||
70 | This option selects the full-fledged version of SRCU. | 70 | This option selects the full-fledged version of SRCU. |
71 | 71 | ||
72 | config TASKS_RCU | 72 | config TASKS_RCU |
73 | def_bool PREEMPT | 73 | def_bool PREEMPTION |
74 | select SRCU | 74 | select SRCU |
75 | help | 75 | help |
76 | This option enables a task-based RCU implementation that uses | 76 | This option enables a task-based RCU implementation that uses |
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 5efdce756fdf..6a37afd5436c 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c | |||
@@ -1881,7 +1881,7 @@ rcu_report_unblock_qs_rnp(struct rcu_node *rnp, unsigned long flags) | |||
1881 | struct rcu_node *rnp_p; | 1881 | struct rcu_node *rnp_p; |
1882 | 1882 | ||
1883 | raw_lockdep_assert_held_rcu_node(rnp); | 1883 | raw_lockdep_assert_held_rcu_node(rnp); |
1884 | if (WARN_ON_ONCE(!IS_ENABLED(CONFIG_PREEMPT)) || | 1884 | if (WARN_ON_ONCE(!IS_ENABLED(CONFIG_PREEMPTION)) || |
1885 | WARN_ON_ONCE(rcu_preempt_blocked_readers_cgp(rnp)) || | 1885 | WARN_ON_ONCE(rcu_preempt_blocked_readers_cgp(rnp)) || |
1886 | rnp->qsmask != 0) { | 1886 | rnp->qsmask != 0) { |
1887 | raw_spin_unlock_irqrestore_rcu_node(rnp, flags); | 1887 | raw_spin_unlock_irqrestore_rcu_node(rnp, flags); |
@@ -2205,7 +2205,7 @@ static void force_qs_rnp(int (*f)(struct rcu_data *rdp)) | |||
2205 | mask = 0; | 2205 | mask = 0; |
2206 | raw_spin_lock_irqsave_rcu_node(rnp, flags); | 2206 | raw_spin_lock_irqsave_rcu_node(rnp, flags); |
2207 | if (rnp->qsmask == 0) { | 2207 | if (rnp->qsmask == 0) { |
2208 | if (!IS_ENABLED(CONFIG_PREEMPT) || | 2208 | if (!IS_ENABLED(CONFIG_PREEMPTION) || |
2209 | rcu_preempt_blocked_readers_cgp(rnp)) { | 2209 | rcu_preempt_blocked_readers_cgp(rnp)) { |
2210 | /* | 2210 | /* |
2211 | * No point in scanning bits because they | 2211 | * No point in scanning bits because they |
@@ -2622,7 +2622,7 @@ static int rcu_blocking_is_gp(void) | |||
2622 | { | 2622 | { |
2623 | int ret; | 2623 | int ret; |
2624 | 2624 | ||
2625 | if (IS_ENABLED(CONFIG_PREEMPT)) | 2625 | if (IS_ENABLED(CONFIG_PREEMPTION)) |
2626 | return rcu_scheduler_active == RCU_SCHEDULER_INACTIVE; | 2626 | return rcu_scheduler_active == RCU_SCHEDULER_INACTIVE; |
2627 | might_sleep(); /* Check for RCU read-side critical section. */ | 2627 | might_sleep(); /* Check for RCU read-side critical section. */ |
2628 | preempt_disable(); | 2628 | preempt_disable(); |
diff --git a/kernel/rcu/tree_stall.h b/kernel/rcu/tree_stall.h index 065183391f75..9b92bf18b737 100644 --- a/kernel/rcu/tree_stall.h +++ b/kernel/rcu/tree_stall.h | |||
@@ -163,7 +163,7 @@ static void rcu_iw_handler(struct irq_work *iwp) | |||
163 | // | 163 | // |
164 | // Printing RCU CPU stall warnings | 164 | // Printing RCU CPU stall warnings |
165 | 165 | ||
166 | #ifdef CONFIG_PREEMPT | 166 | #ifdef CONFIG_PREEMPTION |
167 | 167 | ||
168 | /* | 168 | /* |
169 | * Dump detailed information for all tasks blocking the current RCU | 169 | * Dump detailed information for all tasks blocking the current RCU |
@@ -215,7 +215,7 @@ static int rcu_print_task_stall(struct rcu_node *rnp) | |||
215 | return ndetected; | 215 | return ndetected; |
216 | } | 216 | } |
217 | 217 | ||
218 | #else /* #ifdef CONFIG_PREEMPT */ | 218 | #else /* #ifdef CONFIG_PREEMPTION */ |
219 | 219 | ||
220 | /* | 220 | /* |
221 | * Because preemptible RCU does not exist, we never have to check for | 221 | * Because preemptible RCU does not exist, we never have to check for |
@@ -233,7 +233,7 @@ static int rcu_print_task_stall(struct rcu_node *rnp) | |||
233 | { | 233 | { |
234 | return 0; | 234 | return 0; |
235 | } | 235 | } |
236 | #endif /* #else #ifdef CONFIG_PREEMPT */ | 236 | #endif /* #else #ifdef CONFIG_PREEMPTION */ |
237 | 237 | ||
238 | /* | 238 | /* |
239 | * Dump stacks of all tasks running on stalled CPUs. First try using | 239 | * Dump stacks of all tasks running on stalled CPUs. First try using |
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 3c7b90bcbe4e..87b84a726db4 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
@@ -3752,7 +3752,7 @@ static inline void sched_tick_start(int cpu) { } | |||
3752 | static inline void sched_tick_stop(int cpu) { } | 3752 | static inline void sched_tick_stop(int cpu) { } |
3753 | #endif | 3753 | #endif |
3754 | 3754 | ||
3755 | #if defined(CONFIG_PREEMPT) && (defined(CONFIG_DEBUG_PREEMPT) || \ | 3755 | #if defined(CONFIG_PREEMPTION) && (defined(CONFIG_DEBUG_PREEMPT) || \ |
3756 | defined(CONFIG_TRACE_PREEMPT_TOGGLE)) | 3756 | defined(CONFIG_TRACE_PREEMPT_TOGGLE)) |
3757 | /* | 3757 | /* |
3758 | * If the value passed in is equal to the current preempt count | 3758 | * If the value passed in is equal to the current preempt count |
@@ -3958,7 +3958,7 @@ restart: | |||
3958 | * task, then the wakeup sets TIF_NEED_RESCHED and schedule() gets | 3958 | * task, then the wakeup sets TIF_NEED_RESCHED and schedule() gets |
3959 | * called on the nearest possible occasion: | 3959 | * called on the nearest possible occasion: |
3960 | * | 3960 | * |
3961 | * - If the kernel is preemptible (CONFIG_PREEMPT=y): | 3961 | * - If the kernel is preemptible (CONFIG_PREEMPTION=y): |
3962 | * | 3962 | * |
3963 | * - in syscall or exception context, at the next outmost | 3963 | * - in syscall or exception context, at the next outmost |
3964 | * preempt_enable(). (this might be as soon as the wake_up()'s | 3964 | * preempt_enable(). (this might be as soon as the wake_up()'s |
@@ -3967,7 +3967,7 @@ restart: | |||
3967 | * - in IRQ context, return from interrupt-handler to | 3967 | * - in IRQ context, return from interrupt-handler to |
3968 | * preemptible context | 3968 | * preemptible context |
3969 | * | 3969 | * |
3970 | * - If the kernel is not preemptible (CONFIG_PREEMPT is not set) | 3970 | * - If the kernel is not preemptible (CONFIG_PREEMPTION is not set) |
3971 | * then at the next: | 3971 | * then at the next: |
3972 | * | 3972 | * |
3973 | * - cond_resched() call | 3973 | * - cond_resched() call |
@@ -4209,7 +4209,7 @@ static void __sched notrace preempt_schedule_common(void) | |||
4209 | } while (need_resched()); | 4209 | } while (need_resched()); |
4210 | } | 4210 | } |
4211 | 4211 | ||
4212 | #ifdef CONFIG_PREEMPT | 4212 | #ifdef CONFIG_PREEMPTION |
4213 | /* | 4213 | /* |
4214 | * this is the entry point to schedule() from in-kernel preemption | 4214 | * this is the entry point to schedule() from in-kernel preemption |
4215 | * off of preempt_enable. Kernel preemptions off return from interrupt | 4215 | * off of preempt_enable. Kernel preemptions off return from interrupt |
@@ -4281,7 +4281,7 @@ asmlinkage __visible void __sched notrace preempt_schedule_notrace(void) | |||
4281 | } | 4281 | } |
4282 | EXPORT_SYMBOL_GPL(preempt_schedule_notrace); | 4282 | EXPORT_SYMBOL_GPL(preempt_schedule_notrace); |
4283 | 4283 | ||
4284 | #endif /* CONFIG_PREEMPT */ | 4284 | #endif /* CONFIG_PREEMPTION */ |
4285 | 4285 | ||
4286 | /* | 4286 | /* |
4287 | * this is the entry point to schedule() from kernel preemption | 4287 | * this is the entry point to schedule() from kernel preemption |
@@ -5610,7 +5610,7 @@ SYSCALL_DEFINE0(sched_yield) | |||
5610 | return 0; | 5610 | return 0; |
5611 | } | 5611 | } |
5612 | 5612 | ||
5613 | #ifndef CONFIG_PREEMPT | 5613 | #ifndef CONFIG_PREEMPTION |
5614 | int __sched _cond_resched(void) | 5614 | int __sched _cond_resched(void) |
5615 | { | 5615 | { |
5616 | if (should_resched(0)) { | 5616 | if (should_resched(0)) { |
@@ -5627,7 +5627,7 @@ EXPORT_SYMBOL(_cond_resched); | |||
5627 | * __cond_resched_lock() - if a reschedule is pending, drop the given lock, | 5627 | * __cond_resched_lock() - if a reschedule is pending, drop the given lock, |
5628 | * call schedule, and on return reacquire the lock. | 5628 | * call schedule, and on return reacquire the lock. |
5629 | * | 5629 | * |
5630 | * This works OK both with and without CONFIG_PREEMPT. We do strange low-level | 5630 | * This works OK both with and without CONFIG_PREEMPTION. We do strange low-level |
5631 | * operations here to prevent schedule() from being called twice (once via | 5631 | * operations here to prevent schedule() from being called twice (once via |
5632 | * spin_unlock(), once by hand). | 5632 | * spin_unlock(), once by hand). |
5633 | */ | 5633 | */ |
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 8b665110a44a..1f0a5e1a90fa 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c | |||
@@ -7396,7 +7396,7 @@ static int detach_tasks(struct lb_env *env) | |||
7396 | detached++; | 7396 | detached++; |
7397 | env->imbalance -= load; | 7397 | env->imbalance -= load; |
7398 | 7398 | ||
7399 | #ifdef CONFIG_PREEMPT | 7399 | #ifdef CONFIG_PREEMPTION |
7400 | /* | 7400 | /* |
7401 | * NEWIDLE balancing is a source of latency, so preemptible | 7401 | * NEWIDLE balancing is a source of latency, so preemptible |
7402 | * kernels will stop after the first task is detached to minimize | 7402 | * kernels will stop after the first task is detached to minimize |
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 00ff5b57e9cd..b3cb895d14a2 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h | |||
@@ -1958,7 +1958,7 @@ unsigned long arch_scale_freq_capacity(int cpu) | |||
1958 | #endif | 1958 | #endif |
1959 | 1959 | ||
1960 | #ifdef CONFIG_SMP | 1960 | #ifdef CONFIG_SMP |
1961 | #ifdef CONFIG_PREEMPT | 1961 | #ifdef CONFIG_PREEMPTION |
1962 | 1962 | ||
1963 | static inline void double_rq_lock(struct rq *rq1, struct rq *rq2); | 1963 | static inline void double_rq_lock(struct rq *rq1, struct rq *rq2); |
1964 | 1964 | ||
@@ -2010,7 +2010,7 @@ static inline int _double_lock_balance(struct rq *this_rq, struct rq *busiest) | |||
2010 | return ret; | 2010 | return ret; |
2011 | } | 2011 | } |
2012 | 2012 | ||
2013 | #endif /* CONFIG_PREEMPT */ | 2013 | #endif /* CONFIG_PREEMPTION */ |
2014 | 2014 | ||
2015 | /* | 2015 | /* |
2016 | * double_lock_balance - lock the busiest runqueue, this_rq is locked already. | 2016 | * double_lock_balance - lock the busiest runqueue, this_rq is locked already. |
diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig index 98da8998c25c..6a64d7772870 100644 --- a/kernel/trace/Kconfig +++ b/kernel/trace/Kconfig | |||
@@ -146,7 +146,7 @@ config FUNCTION_TRACER | |||
146 | select GENERIC_TRACER | 146 | select GENERIC_TRACER |
147 | select CONTEXT_SWITCH_TRACER | 147 | select CONTEXT_SWITCH_TRACER |
148 | select GLOB | 148 | select GLOB |
149 | select TASKS_RCU if PREEMPT | 149 | select TASKS_RCU if PREEMPTION |
150 | help | 150 | help |
151 | Enable the kernel to trace every kernel function. This is done | 151 | Enable the kernel to trace every kernel function. This is done |
152 | by using a compiler feature to insert a small, 5-byte No-Operation | 152 | by using a compiler feature to insert a small, 5-byte No-Operation |
@@ -179,7 +179,7 @@ config TRACE_PREEMPT_TOGGLE | |||
179 | config PREEMPTIRQ_EVENTS | 179 | config PREEMPTIRQ_EVENTS |
180 | bool "Enable trace events for preempt and irq disable/enable" | 180 | bool "Enable trace events for preempt and irq disable/enable" |
181 | select TRACE_IRQFLAGS | 181 | select TRACE_IRQFLAGS |
182 | select TRACE_PREEMPT_TOGGLE if PREEMPT | 182 | select TRACE_PREEMPT_TOGGLE if PREEMPTION |
183 | select GENERIC_TRACER | 183 | select GENERIC_TRACER |
184 | default n | 184 | default n |
185 | help | 185 | help |
@@ -214,7 +214,7 @@ config PREEMPT_TRACER | |||
214 | bool "Preemption-off Latency Tracer" | 214 | bool "Preemption-off Latency Tracer" |
215 | default n | 215 | default n |
216 | depends on !ARCH_USES_GETTIMEOFFSET | 216 | depends on !ARCH_USES_GETTIMEOFFSET |
217 | depends on PREEMPT | 217 | depends on PREEMPTION |
218 | select GENERIC_TRACER | 218 | select GENERIC_TRACER |
219 | select TRACER_MAX_TRACE | 219 | select TRACER_MAX_TRACE |
220 | select RING_BUFFER_ALLOW_SWAP | 220 | select RING_BUFFER_ALLOW_SWAP |
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index eca34503f178..a800e867c1a3 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -2814,7 +2814,7 @@ int ftrace_shutdown(struct ftrace_ops *ops, int command) | |||
2814 | * synchornize_rcu_tasks() will wait for those tasks to | 2814 | * synchornize_rcu_tasks() will wait for those tasks to |
2815 | * execute and either schedule voluntarily or enter user space. | 2815 | * execute and either schedule voluntarily or enter user space. |
2816 | */ | 2816 | */ |
2817 | if (IS_ENABLED(CONFIG_PREEMPT)) | 2817 | if (IS_ENABLED(CONFIG_PREEMPTION)) |
2818 | synchronize_rcu_tasks(); | 2818 | synchronize_rcu_tasks(); |
2819 | 2819 | ||
2820 | free_ops: | 2820 | free_ops: |
diff --git a/kernel/trace/ring_buffer_benchmark.c b/kernel/trace/ring_buffer_benchmark.c index 0564f6db0561..09b0b49f346e 100644 --- a/kernel/trace/ring_buffer_benchmark.c +++ b/kernel/trace/ring_buffer_benchmark.c | |||
@@ -267,7 +267,7 @@ static void ring_buffer_producer(void) | |||
267 | if (consumer && !(cnt % wakeup_interval)) | 267 | if (consumer && !(cnt % wakeup_interval)) |
268 | wake_up_process(consumer); | 268 | wake_up_process(consumer); |
269 | 269 | ||
270 | #ifndef CONFIG_PREEMPT | 270 | #ifndef CONFIG_PREEMPTION |
271 | /* | 271 | /* |
272 | * If we are a non preempt kernel, the 10 second run will | 272 | * If we are a non preempt kernel, the 10 second run will |
273 | * stop everything while it runs. Instead, we will call | 273 | * stop everything while it runs. Instead, we will call |
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index c7506bc81b75..5a189fb8ec23 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c | |||
@@ -255,12 +255,12 @@ void *trace_event_buffer_reserve(struct trace_event_buffer *fbuffer, | |||
255 | local_save_flags(fbuffer->flags); | 255 | local_save_flags(fbuffer->flags); |
256 | fbuffer->pc = preempt_count(); | 256 | fbuffer->pc = preempt_count(); |
257 | /* | 257 | /* |
258 | * If CONFIG_PREEMPT is enabled, then the tracepoint itself disables | 258 | * If CONFIG_PREEMPTION is enabled, then the tracepoint itself disables |
259 | * preemption (adding one to the preempt_count). Since we are | 259 | * preemption (adding one to the preempt_count). Since we are |
260 | * interested in the preempt_count at the time the tracepoint was | 260 | * interested in the preempt_count at the time the tracepoint was |
261 | * hit, we need to subtract one to offset the increment. | 261 | * hit, we need to subtract one to offset the increment. |
262 | */ | 262 | */ |
263 | if (IS_ENABLED(CONFIG_PREEMPT)) | 263 | if (IS_ENABLED(CONFIG_PREEMPTION)) |
264 | fbuffer->pc--; | 264 | fbuffer->pc--; |
265 | fbuffer->trace_file = trace_file; | 265 | fbuffer->trace_file = trace_file; |
266 | 266 | ||
diff --git a/lib/test_firmware.c b/lib/test_firmware.c index 83ea6c4e623c..6ca97a63b3d6 100644 --- a/lib/test_firmware.c +++ b/lib/test_firmware.c | |||
@@ -886,8 +886,11 @@ static int __init test_firmware_init(void) | |||
886 | return -ENOMEM; | 886 | return -ENOMEM; |
887 | 887 | ||
888 | rc = __test_firmware_config_init(); | 888 | rc = __test_firmware_config_init(); |
889 | if (rc) | 889 | if (rc) { |
890 | kfree(test_fw_config); | ||
891 | pr_err("could not init firmware test config: %d\n", rc); | ||
890 | return rc; | 892 | return rc; |
893 | } | ||
891 | 894 | ||
892 | rc = misc_register(&test_fw_misc_device); | 895 | rc = misc_register(&test_fw_misc_device); |
893 | if (rc) { | 896 | if (rc) { |
diff --git a/mm/balloon_compaction.c b/mm/balloon_compaction.c index 83a7b614061f..798275a51887 100644 --- a/mm/balloon_compaction.c +++ b/mm/balloon_compaction.c | |||
@@ -21,7 +21,6 @@ static void balloon_page_enqueue_one(struct balloon_dev_info *b_dev_info, | |||
21 | * memory corruption is possible and we should stop execution. | 21 | * memory corruption is possible and we should stop execution. |
22 | */ | 22 | */ |
23 | BUG_ON(!trylock_page(page)); | 23 | BUG_ON(!trylock_page(page)); |
24 | list_del(&page->lru); | ||
25 | balloon_page_insert(b_dev_info, page); | 24 | balloon_page_insert(b_dev_info, page); |
26 | unlock_page(page); | 25 | unlock_page(page); |
27 | __count_vm_event(BALLOON_INFLATE); | 26 | __count_vm_event(BALLOON_INFLATE); |
@@ -33,8 +32,8 @@ static void balloon_page_enqueue_one(struct balloon_dev_info *b_dev_info, | |||
33 | * @b_dev_info: balloon device descriptor where we will insert a new page to | 32 | * @b_dev_info: balloon device descriptor where we will insert a new page to |
34 | * @pages: pages to enqueue - allocated using balloon_page_alloc. | 33 | * @pages: pages to enqueue - allocated using balloon_page_alloc. |
35 | * | 34 | * |
36 | * Driver must call it to properly enqueue a balloon pages before definitively | 35 | * Driver must call this function to properly enqueue balloon pages before |
37 | * removing it from the guest system. | 36 | * definitively removing them from the guest system. |
38 | * | 37 | * |
39 | * Return: number of pages that were enqueued. | 38 | * Return: number of pages that were enqueued. |
40 | */ | 39 | */ |
@@ -47,6 +46,7 @@ size_t balloon_page_list_enqueue(struct balloon_dev_info *b_dev_info, | |||
47 | 46 | ||
48 | spin_lock_irqsave(&b_dev_info->pages_lock, flags); | 47 | spin_lock_irqsave(&b_dev_info->pages_lock, flags); |
49 | list_for_each_entry_safe(page, tmp, pages, lru) { | 48 | list_for_each_entry_safe(page, tmp, pages, lru) { |
49 | list_del(&page->lru); | ||
50 | balloon_page_enqueue_one(b_dev_info, page); | 50 | balloon_page_enqueue_one(b_dev_info, page); |
51 | n_pages++; | 51 | n_pages++; |
52 | } | 52 | } |
@@ -63,12 +63,13 @@ EXPORT_SYMBOL_GPL(balloon_page_list_enqueue); | |||
63 | * @n_req_pages: number of requested pages. | 63 | * @n_req_pages: number of requested pages. |
64 | * | 64 | * |
65 | * Driver must call this function to properly de-allocate a previous enlisted | 65 | * Driver must call this function to properly de-allocate a previous enlisted |
66 | * balloon pages before definetively releasing it back to the guest system. | 66 | * balloon pages before definitively releasing it back to the guest system. |
67 | * This function tries to remove @n_req_pages from the ballooned pages and | 67 | * This function tries to remove @n_req_pages from the ballooned pages and |
68 | * return them to the caller in the @pages list. | 68 | * return them to the caller in the @pages list. |
69 | * | 69 | * |
70 | * Note that this function may fail to dequeue some pages temporarily empty due | 70 | * Note that this function may fail to dequeue some pages even if the balloon |
71 | * to compaction isolated pages. | 71 | * isn't empty - since the page list can be temporarily empty due to compaction |
72 | * of isolated pages. | ||
72 | * | 73 | * |
73 | * Return: number of pages that were added to the @pages list. | 74 | * Return: number of pages that were added to the @pages list. |
74 | */ | 75 | */ |
@@ -112,12 +113,13 @@ EXPORT_SYMBOL_GPL(balloon_page_list_dequeue); | |||
112 | 113 | ||
113 | /* | 114 | /* |
114 | * balloon_page_alloc - allocates a new page for insertion into the balloon | 115 | * balloon_page_alloc - allocates a new page for insertion into the balloon |
115 | * page list. | 116 | * page list. |
117 | * | ||
118 | * Driver must call this function to properly allocate a new balloon page. | ||
119 | * Driver must call balloon_page_enqueue before definitively removing the page | ||
120 | * from the guest system. | ||
116 | * | 121 | * |
117 | * Driver must call it to properly allocate a new enlisted balloon page. | 122 | * Return: struct page for the allocated page or NULL on allocation failure. |
118 | * Driver must call balloon_page_enqueue before definitively removing it from | ||
119 | * the guest system. This function returns the page address for the recently | ||
120 | * allocated page or NULL in the case we fail to allocate a new page this turn. | ||
121 | */ | 123 | */ |
122 | struct page *balloon_page_alloc(void) | 124 | struct page *balloon_page_alloc(void) |
123 | { | 125 | { |
@@ -128,15 +130,17 @@ struct page *balloon_page_alloc(void) | |||
128 | EXPORT_SYMBOL_GPL(balloon_page_alloc); | 130 | EXPORT_SYMBOL_GPL(balloon_page_alloc); |
129 | 131 | ||
130 | /* | 132 | /* |
131 | * balloon_page_enqueue - allocates a new page and inserts it into the balloon | 133 | * balloon_page_enqueue - inserts a new page into the balloon page list. |
132 | * page list. | 134 | * |
133 | * @b_dev_info: balloon device descriptor where we will insert a new page to | 135 | * @b_dev_info: balloon device descriptor where we will insert a new page |
134 | * @page: new page to enqueue - allocated using balloon_page_alloc. | 136 | * @page: new page to enqueue - allocated using balloon_page_alloc. |
135 | * | 137 | * |
136 | * Driver must call it to properly enqueue a new allocated balloon page | 138 | * Drivers must call this function to properly enqueue a new allocated balloon |
137 | * before definitively removing it from the guest system. | 139 | * page before definitively removing the page from the guest system. |
138 | * This function returns the page address for the recently enqueued page or | 140 | * |
139 | * NULL in the case we fail to allocate a new page this turn. | 141 | * Drivers must not call balloon_page_enqueue on pages that have been pushed to |
142 | * a list with balloon_page_push before removing them with balloon_page_pop. To | ||
143 | * enqueue a list of pages, use balloon_page_list_enqueue instead. | ||
140 | */ | 144 | */ |
141 | void balloon_page_enqueue(struct balloon_dev_info *b_dev_info, | 145 | void balloon_page_enqueue(struct balloon_dev_info *b_dev_info, |
142 | struct page *page) | 146 | struct page *page) |
@@ -151,14 +155,23 @@ EXPORT_SYMBOL_GPL(balloon_page_enqueue); | |||
151 | 155 | ||
152 | /* | 156 | /* |
153 | * balloon_page_dequeue - removes a page from balloon's page list and returns | 157 | * balloon_page_dequeue - removes a page from balloon's page list and returns |
154 | * the its address to allow the driver release the page. | 158 | * its address to allow the driver to release the page. |
155 | * @b_dev_info: balloon device decriptor where we will grab a page from. | 159 | * @b_dev_info: balloon device decriptor where we will grab a page from. |
156 | * | 160 | * |
157 | * Driver must call it to properly de-allocate a previous enlisted balloon page | 161 | * Driver must call this function to properly dequeue a previously enqueued page |
158 | * before definetively releasing it back to the guest system. | 162 | * before definitively releasing it back to the guest system. |
159 | * This function returns the page address for the recently dequeued page or | 163 | * |
160 | * NULL in the case we find balloon's page list temporarily empty due to | 164 | * Caller must perform its own accounting to ensure that this |
161 | * compaction isolated pages. | 165 | * function is called only if some pages are actually enqueued. |
166 | * | ||
167 | * Note that this function may fail to dequeue some pages even if there are | ||
168 | * some enqueued pages - since the page list can be temporarily empty due to | ||
169 | * the compaction of isolated pages. | ||
170 | * | ||
171 | * TODO: remove the caller accounting requirements, and allow caller to wait | ||
172 | * until all pages can be dequeued. | ||
173 | * | ||
174 | * Return: struct page for the dequeued page, or NULL if no page was dequeued. | ||
162 | */ | 175 | */ |
163 | struct page *balloon_page_dequeue(struct balloon_dev_info *b_dev_info) | 176 | struct page *balloon_page_dequeue(struct balloon_dev_info *b_dev_info) |
164 | { | 177 | { |
@@ -171,9 +184,9 @@ struct page *balloon_page_dequeue(struct balloon_dev_info *b_dev_info) | |||
171 | if (n_pages != 1) { | 184 | if (n_pages != 1) { |
172 | /* | 185 | /* |
173 | * If we are unable to dequeue a balloon page because the page | 186 | * If we are unable to dequeue a balloon page because the page |
174 | * list is empty and there is no isolated pages, then something | 187 | * list is empty and there are no isolated pages, then something |
175 | * went out of track and some balloon pages are lost. | 188 | * went out of track and some balloon pages are lost. |
176 | * BUG() here, otherwise the balloon driver may get stuck into | 189 | * BUG() here, otherwise the balloon driver may get stuck in |
177 | * an infinite loop while attempting to release all its pages. | 190 | * an infinite loop while attempting to release all its pages. |
178 | */ | 191 | */ |
179 | spin_lock_irqsave(&b_dev_info->pages_lock, flags); | 192 | spin_lock_irqsave(&b_dev_info->pages_lock, flags); |
@@ -224,8 +237,8 @@ int balloon_page_migrate(struct address_space *mapping, | |||
224 | 237 | ||
225 | /* | 238 | /* |
226 | * We can not easily support the no copy case here so ignore it as it | 239 | * We can not easily support the no copy case here so ignore it as it |
227 | * is unlikely to be use with ballon pages. See include/linux/hmm.h for | 240 | * is unlikely to be used with balloon pages. See include/linux/hmm.h |
228 | * user of the MIGRATE_SYNC_NO_COPY mode. | 241 | * for a user of the MIGRATE_SYNC_NO_COPY mode. |
229 | */ | 242 | */ |
230 | if (mode == MIGRATE_SYNC_NO_COPY) | 243 | if (mode == MIGRATE_SYNC_NO_COPY) |
231 | return -EINVAL; | 244 | return -EINVAL; |
diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 4fa8d84599b0..e0fc963acc41 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c | |||
@@ -1259,6 +1259,12 @@ static bool __purge_vmap_area_lazy(unsigned long start, unsigned long end) | |||
1259 | return false; | 1259 | return false; |
1260 | 1260 | ||
1261 | /* | 1261 | /* |
1262 | * First make sure the mappings are removed from all page-tables | ||
1263 | * before they are freed. | ||
1264 | */ | ||
1265 | vmalloc_sync_all(); | ||
1266 | |||
1267 | /* | ||
1262 | * TODO: to calculate a flush range without looping. | 1268 | * TODO: to calculate a flush range without looping. |
1263 | * The list can be up to lazy_max_pages() elements. | 1269 | * The list can be up to lazy_max_pages() elements. |
1264 | */ | 1270 | */ |
@@ -3038,6 +3044,9 @@ EXPORT_SYMBOL(remap_vmalloc_range); | |||
3038 | /* | 3044 | /* |
3039 | * Implement a stub for vmalloc_sync_all() if the architecture chose not to | 3045 | * Implement a stub for vmalloc_sync_all() if the architecture chose not to |
3040 | * have one. | 3046 | * have one. |
3047 | * | ||
3048 | * The purpose of this function is to make sure the vmalloc area | ||
3049 | * mappings are identical in all page-tables in the system. | ||
3041 | */ | 3050 | */ |
3042 | void __weak vmalloc_sync_all(void) | 3051 | void __weak vmalloc_sync_all(void) |
3043 | { | 3052 | { |
diff --git a/samples/vfio-mdev/mdpy-defs.h b/samples/vfio-mdev/mdpy-defs.h index 96b3b1b49d34..eb26421b6429 100644 --- a/samples/vfio-mdev/mdpy-defs.h +++ b/samples/vfio-mdev/mdpy-defs.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
2 | /* | 2 | /* |
3 | * Simple pci display device. | 3 | * Simple pci display device. |
4 | * | 4 | * |
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index 77c742fa4fb1..4b0432e095ae 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include | |||
@@ -190,9 +190,6 @@ echo-cmd = $(if $($(quiet)cmd_$(1)),\ | |||
190 | # printing commands | 190 | # printing commands |
191 | cmd = @set -e; $(echo-cmd) $(cmd_$(1)) | 191 | cmd = @set -e; $(echo-cmd) $(cmd_$(1)) |
192 | 192 | ||
193 | # Add $(obj)/ for paths that are not absolute | ||
194 | objectify = $(foreach o,$(1),$(if $(filter /%,$(o)),$(o),$(obj)/$(o))) | ||
195 | |||
196 | ### | 193 | ### |
197 | # if_changed - execute command if any prerequisite is newer than | 194 | # if_changed - execute command if any prerequisite is newer than |
198 | # target, or command line has changed | 195 | # target, or command line has changed |
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 5241d0751eb0..41c50f9461e5 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib | |||
@@ -45,7 +45,6 @@ subdir-ym := $(sort $(subdir-y) $(subdir-m)) | |||
45 | multi-used-y := $(sort $(foreach m,$(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))), $(m)))) | 45 | multi-used-y := $(sort $(foreach m,$(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))), $(m)))) |
46 | multi-used-m := $(sort $(foreach m,$(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m))), $(m)))) | 46 | multi-used-m := $(sort $(foreach m,$(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m))), $(m)))) |
47 | multi-used := $(multi-used-y) $(multi-used-m) | 47 | multi-used := $(multi-used-y) $(multi-used-m) |
48 | single-used-m := $(sort $(filter-out $(multi-used-m),$(obj-m))) | ||
49 | 48 | ||
50 | # $(subdir-obj-y) is the list of objects in $(obj-y) which uses dir/ to | 49 | # $(subdir-obj-y) is the list of objects in $(obj-y) which uses dir/ to |
51 | # tell kbuild to descend | 50 | # tell kbuild to descend |
@@ -91,7 +90,6 @@ lib-y := $(addprefix $(obj)/,$(lib-y)) | |||
91 | subdir-obj-y := $(addprefix $(obj)/,$(subdir-obj-y)) | 90 | subdir-obj-y := $(addprefix $(obj)/,$(subdir-obj-y)) |
92 | real-obj-y := $(addprefix $(obj)/,$(real-obj-y)) | 91 | real-obj-y := $(addprefix $(obj)/,$(real-obj-y)) |
93 | real-obj-m := $(addprefix $(obj)/,$(real-obj-m)) | 92 | real-obj-m := $(addprefix $(obj)/,$(real-obj-m)) |
94 | single-used-m := $(addprefix $(obj)/,$(single-used-m)) | ||
95 | multi-used-m := $(addprefix $(obj)/,$(multi-used-m)) | 93 | multi-used-m := $(addprefix $(obj)/,$(multi-used-m)) |
96 | subdir-ym := $(addprefix $(obj)/,$(subdir-ym)) | 94 | subdir-ym := $(addprefix $(obj)/,$(subdir-ym)) |
97 | 95 | ||
diff --git a/scripts/gen_compile_commands.py b/scripts/gen_compile_commands.py index 7915823b92a5..c458696ef3a7 100755 --- a/scripts/gen_compile_commands.py +++ b/scripts/gen_compile_commands.py | |||
@@ -21,9 +21,9 @@ _LINE_PATTERN = r'^cmd_[^ ]*\.o := (.* )([^ ]*\.c)$' | |||
21 | _VALID_LOG_LEVELS = ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'] | 21 | _VALID_LOG_LEVELS = ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'] |
22 | 22 | ||
23 | # A kernel build generally has over 2000 entries in its compile_commands.json | 23 | # A kernel build generally has over 2000 entries in its compile_commands.json |
24 | # database. If this code finds 500 or fewer, then warn the user that they might | 24 | # database. If this code finds 300 or fewer, then warn the user that they might |
25 | # not have all the .cmd files, and they might need to compile the kernel. | 25 | # not have all the .cmd files, and they might need to compile the kernel. |
26 | _LOW_COUNT_THRESHOLD = 500 | 26 | _LOW_COUNT_THRESHOLD = 300 |
27 | 27 | ||
28 | 28 | ||
29 | def parse_arguments(): | 29 | def parse_arguments(): |
diff --git a/scripts/sphinx-pre-install b/scripts/sphinx-pre-install index f230e65329a2..3b638c0e1a4f 100755 --- a/scripts/sphinx-pre-install +++ b/scripts/sphinx-pre-install | |||
@@ -83,6 +83,17 @@ sub check_missing(%) | |||
83 | foreach my $prog (sort keys %missing) { | 83 | foreach my $prog (sort keys %missing) { |
84 | my $is_optional = $missing{$prog}; | 84 | my $is_optional = $missing{$prog}; |
85 | 85 | ||
86 | # At least on some LTS distros like CentOS 7, texlive doesn't | ||
87 | # provide all packages we need. When such distros are | ||
88 | # detected, we have to disable PDF output. | ||
89 | # | ||
90 | # So, we need to ignore the packages that distros would | ||
91 | # need for LaTeX to work | ||
92 | if ($is_optional == 2 && !$pdf) { | ||
93 | $optional--; | ||
94 | next; | ||
95 | } | ||
96 | |||
86 | if ($is_optional) { | 97 | if ($is_optional) { |
87 | print "Warning: better to also install \"$prog\".\n"; | 98 | print "Warning: better to also install \"$prog\".\n"; |
88 | } else { | 99 | } else { |
@@ -333,10 +344,13 @@ sub give_debian_hints() | |||
333 | 344 | ||
334 | if ($pdf) { | 345 | if ($pdf) { |
335 | check_missing_file("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf", | 346 | check_missing_file("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf", |
336 | "fonts-dejavu", 1); | 347 | "fonts-dejavu", 2); |
348 | |||
349 | check_missing_file("/usr/share/fonts/noto-cjk/NotoSansCJK-Regular.ttc", | ||
350 | "fonts-noto-cjk", 2); | ||
337 | } | 351 | } |
338 | 352 | ||
339 | check_program("dvipng", 1) if ($pdf); | 353 | check_program("dvipng", 2) if ($pdf); |
340 | check_missing(\%map); | 354 | check_missing(\%map); |
341 | 355 | ||
342 | return if (!$need && !$optional); | 356 | return if (!$need && !$optional); |
@@ -363,6 +377,7 @@ sub give_redhat_hints() | |||
363 | my @fedora_tex_pkgs = ( | 377 | my @fedora_tex_pkgs = ( |
364 | "texlive-collection-fontsrecommended", | 378 | "texlive-collection-fontsrecommended", |
365 | "texlive-collection-latex", | 379 | "texlive-collection-latex", |
380 | "texlive-xecjk", | ||
366 | "dejavu-sans-fonts", | 381 | "dejavu-sans-fonts", |
367 | "dejavu-serif-fonts", | 382 | "dejavu-serif-fonts", |
368 | "dejavu-sans-mono-fonts", | 383 | "dejavu-sans-mono-fonts", |
@@ -371,22 +386,45 @@ sub give_redhat_hints() | |||
371 | # | 386 | # |
372 | # Checks valid for RHEL/CentOS version 7.x. | 387 | # Checks valid for RHEL/CentOS version 7.x. |
373 | # | 388 | # |
374 | if (! $system_release =~ /Fedora/) { | 389 | my $old = 0; |
390 | my $rel; | ||
391 | $rel = $1 if ($system_release =~ /release\s+(\d+)/); | ||
392 | |||
393 | if (!($system_release =~ /Fedora/)) { | ||
375 | $map{"virtualenv"} = "python-virtualenv"; | 394 | $map{"virtualenv"} = "python-virtualenv"; |
376 | } | ||
377 | 395 | ||
378 | my $release; | 396 | if ($rel && $rel < 8) { |
397 | $old = 1; | ||
398 | $pdf = 0; | ||
399 | |||
400 | printf("Note: texlive packages on RHEL/CENTOS <= 7 are incomplete. Can't support PDF output\n"); | ||
401 | printf("If you want to build PDF, please read:\n"); | ||
402 | printf("\thttps://www.systutorials.com/241660/how-to-install-tex-live-on-centos-7-linux/\n"); | ||
403 | } | ||
404 | } else { | ||
405 | if ($rel && $rel < 26) { | ||
406 | $old = 1; | ||
407 | } | ||
408 | } | ||
409 | if (!$rel) { | ||
410 | printf("Couldn't identify release number\n"); | ||
411 | $old = 1; | ||
412 | $pdf = 0; | ||
413 | } | ||
379 | 414 | ||
380 | $release = $1 if ($system_release =~ /Fedora\s+release\s+(\d+)/); | 415 | if ($pdf) { |
416 | check_missing_file("/usr/share/fonts/google-noto-cjk/NotoSansCJK-Regular.ttc", | ||
417 | "google-noto-sans-cjk-ttc-fonts", 2); | ||
418 | } | ||
381 | 419 | ||
382 | check_rpm_missing(\@fedora26_opt_pkgs, 1) if ($pdf && $release >= 26); | 420 | check_rpm_missing(\@fedora26_opt_pkgs, 2) if ($pdf && !$old); |
383 | check_rpm_missing(\@fedora_tex_pkgs, 1) if ($pdf); | 421 | check_rpm_missing(\@fedora_tex_pkgs, 2) if ($pdf); |
384 | check_missing_tex(1) if ($pdf); | 422 | check_missing_tex(2) if ($pdf); |
385 | check_missing(\%map); | 423 | check_missing(\%map); |
386 | 424 | ||
387 | return if (!$need && !$optional); | 425 | return if (!$need && !$optional); |
388 | 426 | ||
389 | if ($release >= 18) { | 427 | if (!$old) { |
390 | # dnf, for Fedora 18+ | 428 | # dnf, for Fedora 18+ |
391 | printf("You should run:\n\n\tsudo dnf install -y $install\n"); | 429 | printf("You should run:\n\n\tsudo dnf install -y $install\n"); |
392 | } else { | 430 | } else { |
@@ -425,8 +463,15 @@ sub give_opensuse_hints() | |||
425 | "texlive-zapfding", | 463 | "texlive-zapfding", |
426 | ); | 464 | ); |
427 | 465 | ||
428 | check_rpm_missing(\@suse_tex_pkgs, 1) if ($pdf); | 466 | $map{"latexmk"} = "texlive-latexmk-bin"; |
429 | check_missing_tex(1) if ($pdf); | 467 | |
468 | # FIXME: add support for installing CJK fonts | ||
469 | # | ||
470 | # I tried hard, but was unable to find a way to install | ||
471 | # "Noto Sans CJK SC" on openSUSE | ||
472 | |||
473 | check_rpm_missing(\@suse_tex_pkgs, 2) if ($pdf); | ||
474 | check_missing_tex(2) if ($pdf); | ||
430 | check_missing(\%map); | 475 | check_missing(\%map); |
431 | 476 | ||
432 | return if (!$need && !$optional); | 477 | return if (!$need && !$optional); |
@@ -450,7 +495,14 @@ sub give_mageia_hints() | |||
450 | "texlive-fontsextra", | 495 | "texlive-fontsextra", |
451 | ); | 496 | ); |
452 | 497 | ||
453 | check_rpm_missing(\@tex_pkgs, 1) if ($pdf); | 498 | $map{"latexmk"} = "texlive-collection-basic"; |
499 | |||
500 | if ($pdf) { | ||
501 | check_missing_file("/usr/share/fonts/google-noto-cjk/NotoSansCJK-Regular.ttc", | ||
502 | "google-noto-sans-cjk-ttc-fonts", 2); | ||
503 | } | ||
504 | |||
505 | check_rpm_missing(\@tex_pkgs, 2) if ($pdf); | ||
454 | check_missing(\%map); | 506 | check_missing(\%map); |
455 | 507 | ||
456 | return if (!$need && !$optional); | 508 | return if (!$need && !$optional); |
@@ -473,7 +525,13 @@ sub give_arch_linux_hints() | |||
473 | "texlive-latexextra", | 525 | "texlive-latexextra", |
474 | "ttf-dejavu", | 526 | "ttf-dejavu", |
475 | ); | 527 | ); |
476 | check_pacman_missing(\@archlinux_tex_pkgs, 1) if ($pdf); | 528 | check_pacman_missing(\@archlinux_tex_pkgs, 2) if ($pdf); |
529 | |||
530 | if ($pdf) { | ||
531 | check_missing_file("/usr/share/fonts/noto-cjk/NotoSansCJK-Regular.ttc", | ||
532 | "noto-fonts-cjk", 2); | ||
533 | } | ||
534 | |||
477 | check_missing(\%map); | 535 | check_missing(\%map); |
478 | 536 | ||
479 | return if (!$need && !$optional); | 537 | return if (!$need && !$optional); |
@@ -492,15 +550,31 @@ sub give_gentoo_hints() | |||
492 | ); | 550 | ); |
493 | 551 | ||
494 | check_missing_file("/usr/share/fonts/dejavu/DejaVuSans.ttf", | 552 | check_missing_file("/usr/share/fonts/dejavu/DejaVuSans.ttf", |
495 | "media-fonts/dejavu", 1) if ($pdf); | 553 | "media-fonts/dejavu", 2) if ($pdf); |
554 | |||
555 | if ($pdf) { | ||
556 | check_missing_file("/usr/share/fonts/noto-cjk/NotoSansCJKsc-Regular.otf", | ||
557 | "media-fonts/noto-cjk", 2); | ||
558 | } | ||
496 | 559 | ||
497 | check_missing(\%map); | 560 | check_missing(\%map); |
498 | 561 | ||
499 | return if (!$need && !$optional); | 562 | return if (!$need && !$optional); |
500 | 563 | ||
501 | printf("You should run:\n\n"); | 564 | printf("You should run:\n\n"); |
502 | printf("\tsudo su -c 'echo \"media-gfx/imagemagick svg png\" > /etc/portage/package.use/imagemagick'\n"); | 565 | |
503 | printf("\tsudo su -c 'echo \"media-gfx/graphviz cairo pdf\" > /etc/portage/package.use/graphviz'\n"); | 566 | my $imagemagick = "media-gfx/imagemagick svg png"; |
567 | my $cairo = "media-gfx/graphviz cairo pdf"; | ||
568 | my $portage_imagemagick = "/etc/portage/package.use/imagemagick"; | ||
569 | my $portage_cairo = "/etc/portage/package.use/graphviz"; | ||
570 | |||
571 | if (qx(cat $portage_imagemagick) ne "$imagemagick\n") { | ||
572 | printf("\tsudo su -c 'echo \"$imagemagick\" > $portage_imagemagick'\n") | ||
573 | } | ||
574 | if (qx(cat $portage_cairo) ne "$cairo\n") { | ||
575 | printf("\tsudo su -c 'echo \"$cairo\" > $portage_cairo'\n"); | ||
576 | } | ||
577 | |||
504 | printf("\tsudo emerge --ask $install\n"); | 578 | printf("\tsudo emerge --ask $install\n"); |
505 | 579 | ||
506 | } | 580 | } |
@@ -560,7 +634,7 @@ sub check_distros() | |||
560 | my %map = ( | 634 | my %map = ( |
561 | "sphinx-build" => "sphinx" | 635 | "sphinx-build" => "sphinx" |
562 | ); | 636 | ); |
563 | check_missing_tex(1) if ($pdf); | 637 | check_missing_tex(2) if ($pdf); |
564 | check_missing(\%map); | 638 | check_missing(\%map); |
565 | print "I don't know distro $system_release.\n"; | 639 | print "I don't know distro $system_release.\n"; |
566 | print "So, I can't provide you a hint with the install procedure.\n"; | 640 | print "So, I can't provide you a hint with the install procedure.\n"; |
@@ -589,11 +663,13 @@ sub check_needs() | |||
589 | check_program("make", 0); | 663 | check_program("make", 0); |
590 | check_program("gcc", 0); | 664 | check_program("gcc", 0); |
591 | check_python_module("sphinx_rtd_theme", 1) if (!$virtualenv); | 665 | check_python_module("sphinx_rtd_theme", 1) if (!$virtualenv); |
592 | check_program("xelatex", 1) if ($pdf); | ||
593 | check_program("dot", 1); | 666 | check_program("dot", 1); |
594 | check_program("convert", 1); | 667 | check_program("convert", 1); |
595 | check_program("rsvg-convert", 1) if ($pdf); | 668 | |
596 | check_program("latexmk", 1) if ($pdf); | 669 | # Extra PDF files - should use 2 for is_optional |
670 | check_program("xelatex", 2) if ($pdf); | ||
671 | check_program("rsvg-convert", 2) if ($pdf); | ||
672 | check_program("latexmk", 2) if ($pdf); | ||
597 | 673 | ||
598 | check_distros(); | 674 | check_distros(); |
599 | 675 | ||
diff --git a/security/Kconfig.hardening b/security/Kconfig.hardening index a1ffe2eb4d5f..af4c979b38ee 100644 --- a/security/Kconfig.hardening +++ b/security/Kconfig.hardening | |||
@@ -61,6 +61,7 @@ choice | |||
61 | config GCC_PLUGIN_STRUCTLEAK_BYREF | 61 | config GCC_PLUGIN_STRUCTLEAK_BYREF |
62 | bool "zero-init structs passed by reference (strong)" | 62 | bool "zero-init structs passed by reference (strong)" |
63 | depends on GCC_PLUGINS | 63 | depends on GCC_PLUGINS |
64 | depends on !(KASAN && KASAN_STACK=1) | ||
64 | select GCC_PLUGIN_STRUCTLEAK | 65 | select GCC_PLUGIN_STRUCTLEAK |
65 | help | 66 | help |
66 | Zero-initialize any structures on the stack that may | 67 | Zero-initialize any structures on the stack that may |
@@ -70,9 +71,15 @@ choice | |||
70 | exposures, like CVE-2017-1000410: | 71 | exposures, like CVE-2017-1000410: |
71 | https://git.kernel.org/linus/06e7e776ca4d3654 | 72 | https://git.kernel.org/linus/06e7e776ca4d3654 |
72 | 73 | ||
74 | As a side-effect, this keeps a lot of variables on the | ||
75 | stack that can otherwise be optimized out, so combining | ||
76 | this with CONFIG_KASAN_STACK can lead to a stack overflow | ||
77 | and is disallowed. | ||
78 | |||
73 | config GCC_PLUGIN_STRUCTLEAK_BYREF_ALL | 79 | config GCC_PLUGIN_STRUCTLEAK_BYREF_ALL |
74 | bool "zero-init anything passed by reference (very strong)" | 80 | bool "zero-init anything passed by reference (very strong)" |
75 | depends on GCC_PLUGINS | 81 | depends on GCC_PLUGINS |
82 | depends on !(KASAN && KASAN_STACK=1) | ||
76 | select GCC_PLUGIN_STRUCTLEAK | 83 | select GCC_PLUGIN_STRUCTLEAK |
77 | help | 84 | help |
78 | Zero-initialize any stack variables that may be passed | 85 | Zero-initialize any stack variables that may be passed |
diff --git a/security/selinux/ss/sidtab.c b/security/selinux/ss/sidtab.c index e63a90ff2728..1f0a6eaa2d6a 100644 --- a/security/selinux/ss/sidtab.c +++ b/security/selinux/ss/sidtab.c | |||
@@ -286,6 +286,11 @@ static int sidtab_reverse_lookup(struct sidtab *s, struct context *context, | |||
286 | ++count; | 286 | ++count; |
287 | } | 287 | } |
288 | 288 | ||
289 | /* bail out if we already reached max entries */ | ||
290 | rc = -EOVERFLOW; | ||
291 | if (count >= SIDTAB_MAX) | ||
292 | goto out_unlock; | ||
293 | |||
289 | /* insert context into new entry */ | 294 | /* insert context into new entry */ |
290 | rc = -ENOMEM; | 295 | rc = -ENOMEM; |
291 | dst = sidtab_do_lookup(s, count, 1); | 296 | dst = sidtab_do_lookup(s, count, 1); |
diff --git a/sound/ac97/bus.c b/sound/ac97/bus.c index 7b977b753a03..7985dd8198b6 100644 --- a/sound/ac97/bus.c +++ b/sound/ac97/bus.c | |||
@@ -122,17 +122,12 @@ static int ac97_codec_add(struct ac97_controller *ac97_ctrl, int idx, | |||
122 | vendor_id); | 122 | vendor_id); |
123 | 123 | ||
124 | ret = device_add(&codec->dev); | 124 | ret = device_add(&codec->dev); |
125 | if (ret) | 125 | if (ret) { |
126 | goto err_free_codec; | 126 | put_device(&codec->dev); |
127 | return ret; | ||
128 | } | ||
127 | 129 | ||
128 | return 0; | 130 | return 0; |
129 | err_free_codec: | ||
130 | of_node_put(codec->dev.of_node); | ||
131 | put_device(&codec->dev); | ||
132 | kfree(codec); | ||
133 | ac97_ctrl->codecs[idx] = NULL; | ||
134 | |||
135 | return ret; | ||
136 | } | 131 | } |
137 | 132 | ||
138 | unsigned int snd_ac97_bus_scan_one(struct ac97_controller *adrv, | 133 | unsigned int snd_ac97_bus_scan_one(struct ac97_controller *adrv, |
diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c index 99b882158705..41905afada63 100644 --- a/sound/core/compress_offload.c +++ b/sound/core/compress_offload.c | |||
@@ -574,10 +574,7 @@ snd_compr_set_params(struct snd_compr_stream *stream, unsigned long arg) | |||
574 | stream->metadata_set = false; | 574 | stream->metadata_set = false; |
575 | stream->next_track = false; | 575 | stream->next_track = false; |
576 | 576 | ||
577 | if (stream->direction == SND_COMPRESS_PLAYBACK) | 577 | stream->runtime->state = SNDRV_PCM_STATE_SETUP; |
578 | stream->runtime->state = SNDRV_PCM_STATE_SETUP; | ||
579 | else | ||
580 | stream->runtime->state = SNDRV_PCM_STATE_PREPARED; | ||
581 | } else { | 578 | } else { |
582 | return -EPERM; | 579 | return -EPERM; |
583 | } | 580 | } |
@@ -693,8 +690,17 @@ static int snd_compr_start(struct snd_compr_stream *stream) | |||
693 | { | 690 | { |
694 | int retval; | 691 | int retval; |
695 | 692 | ||
696 | if (stream->runtime->state != SNDRV_PCM_STATE_PREPARED) | 693 | switch (stream->runtime->state) { |
694 | case SNDRV_PCM_STATE_SETUP: | ||
695 | if (stream->direction != SND_COMPRESS_CAPTURE) | ||
696 | return -EPERM; | ||
697 | break; | ||
698 | case SNDRV_PCM_STATE_PREPARED: | ||
699 | break; | ||
700 | default: | ||
697 | return -EPERM; | 701 | return -EPERM; |
702 | } | ||
703 | |||
698 | retval = stream->ops->trigger(stream, SNDRV_PCM_TRIGGER_START); | 704 | retval = stream->ops->trigger(stream, SNDRV_PCM_TRIGGER_START); |
699 | if (!retval) | 705 | if (!retval) |
700 | stream->runtime->state = SNDRV_PCM_STATE_RUNNING; | 706 | stream->runtime->state = SNDRV_PCM_STATE_RUNNING; |
@@ -705,9 +711,15 @@ static int snd_compr_stop(struct snd_compr_stream *stream) | |||
705 | { | 711 | { |
706 | int retval; | 712 | int retval; |
707 | 713 | ||
708 | if (stream->runtime->state == SNDRV_PCM_STATE_PREPARED || | 714 | switch (stream->runtime->state) { |
709 | stream->runtime->state == SNDRV_PCM_STATE_SETUP) | 715 | case SNDRV_PCM_STATE_OPEN: |
716 | case SNDRV_PCM_STATE_SETUP: | ||
717 | case SNDRV_PCM_STATE_PREPARED: | ||
710 | return -EPERM; | 718 | return -EPERM; |
719 | default: | ||
720 | break; | ||
721 | } | ||
722 | |||
711 | retval = stream->ops->trigger(stream, SNDRV_PCM_TRIGGER_STOP); | 723 | retval = stream->ops->trigger(stream, SNDRV_PCM_TRIGGER_STOP); |
712 | if (!retval) { | 724 | if (!retval) { |
713 | snd_compr_drain_notify(stream); | 725 | snd_compr_drain_notify(stream); |
@@ -795,9 +807,17 @@ static int snd_compr_drain(struct snd_compr_stream *stream) | |||
795 | { | 807 | { |
796 | int retval; | 808 | int retval; |
797 | 809 | ||
798 | if (stream->runtime->state == SNDRV_PCM_STATE_PREPARED || | 810 | switch (stream->runtime->state) { |
799 | stream->runtime->state == SNDRV_PCM_STATE_SETUP) | 811 | case SNDRV_PCM_STATE_OPEN: |
812 | case SNDRV_PCM_STATE_SETUP: | ||
813 | case SNDRV_PCM_STATE_PREPARED: | ||
814 | case SNDRV_PCM_STATE_PAUSED: | ||
800 | return -EPERM; | 815 | return -EPERM; |
816 | case SNDRV_PCM_STATE_XRUN: | ||
817 | return -EPIPE; | ||
818 | default: | ||
819 | break; | ||
820 | } | ||
801 | 821 | ||
802 | retval = stream->ops->trigger(stream, SND_COMPR_TRIGGER_DRAIN); | 822 | retval = stream->ops->trigger(stream, SND_COMPR_TRIGGER_DRAIN); |
803 | if (retval) { | 823 | if (retval) { |
@@ -817,6 +837,10 @@ static int snd_compr_next_track(struct snd_compr_stream *stream) | |||
817 | if (stream->runtime->state != SNDRV_PCM_STATE_RUNNING) | 837 | if (stream->runtime->state != SNDRV_PCM_STATE_RUNNING) |
818 | return -EPERM; | 838 | return -EPERM; |
819 | 839 | ||
840 | /* next track doesn't have any meaning for capture streams */ | ||
841 | if (stream->direction == SND_COMPRESS_CAPTURE) | ||
842 | return -EPERM; | ||
843 | |||
820 | /* you can signal next track if this is intended to be a gapless stream | 844 | /* you can signal next track if this is intended to be a gapless stream |
821 | * and current track metadata is set | 845 | * and current track metadata is set |
822 | */ | 846 | */ |
@@ -834,9 +858,23 @@ static int snd_compr_next_track(struct snd_compr_stream *stream) | |||
834 | static int snd_compr_partial_drain(struct snd_compr_stream *stream) | 858 | static int snd_compr_partial_drain(struct snd_compr_stream *stream) |
835 | { | 859 | { |
836 | int retval; | 860 | int retval; |
837 | if (stream->runtime->state == SNDRV_PCM_STATE_PREPARED || | 861 | |
838 | stream->runtime->state == SNDRV_PCM_STATE_SETUP) | 862 | switch (stream->runtime->state) { |
863 | case SNDRV_PCM_STATE_OPEN: | ||
864 | case SNDRV_PCM_STATE_SETUP: | ||
865 | case SNDRV_PCM_STATE_PREPARED: | ||
866 | case SNDRV_PCM_STATE_PAUSED: | ||
867 | return -EPERM; | ||
868 | case SNDRV_PCM_STATE_XRUN: | ||
869 | return -EPIPE; | ||
870 | default: | ||
871 | break; | ||
872 | } | ||
873 | |||
874 | /* partial drain doesn't have any meaning for capture streams */ | ||
875 | if (stream->direction == SND_COMPRESS_CAPTURE) | ||
839 | return -EPERM; | 876 | return -EPERM; |
877 | |||
840 | /* stream can be drained only when next track has been signalled */ | 878 | /* stream can be drained only when next track has been signalled */ |
841 | if (stream->next_track == false) | 879 | if (stream->next_track == false) |
842 | return -EPERM; | 880 | return -EPERM; |
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 860543a4c840..12dd9b318db1 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c | |||
@@ -77,7 +77,7 @@ void snd_pcm_group_init(struct snd_pcm_group *group) | |||
77 | spin_lock_init(&group->lock); | 77 | spin_lock_init(&group->lock); |
78 | mutex_init(&group->mutex); | 78 | mutex_init(&group->mutex); |
79 | INIT_LIST_HEAD(&group->substreams); | 79 | INIT_LIST_HEAD(&group->substreams); |
80 | refcount_set(&group->refs, 0); | 80 | refcount_set(&group->refs, 1); |
81 | } | 81 | } |
82 | 82 | ||
83 | /* define group lock helpers */ | 83 | /* define group lock helpers */ |
@@ -1096,8 +1096,7 @@ static void snd_pcm_group_unref(struct snd_pcm_group *group, | |||
1096 | 1096 | ||
1097 | if (!group) | 1097 | if (!group) |
1098 | return; | 1098 | return; |
1099 | do_free = refcount_dec_and_test(&group->refs) && | 1099 | do_free = refcount_dec_and_test(&group->refs); |
1100 | list_empty(&group->substreams); | ||
1101 | snd_pcm_group_unlock(group, substream->pcm->nonatomic); | 1100 | snd_pcm_group_unlock(group, substream->pcm->nonatomic); |
1102 | if (do_free) | 1101 | if (do_free) |
1103 | kfree(group); | 1102 | kfree(group); |
@@ -2020,6 +2019,7 @@ static int snd_pcm_link(struct snd_pcm_substream *substream, int fd) | |||
2020 | snd_pcm_group_lock_irq(target_group, nonatomic); | 2019 | snd_pcm_group_lock_irq(target_group, nonatomic); |
2021 | snd_pcm_stream_lock(substream1); | 2020 | snd_pcm_stream_lock(substream1); |
2022 | snd_pcm_group_assign(substream1, target_group); | 2021 | snd_pcm_group_assign(substream1, target_group); |
2022 | refcount_inc(&target_group->refs); | ||
2023 | snd_pcm_stream_unlock(substream1); | 2023 | snd_pcm_stream_unlock(substream1); |
2024 | snd_pcm_group_unlock_irq(target_group, nonatomic); | 2024 | snd_pcm_group_unlock_irq(target_group, nonatomic); |
2025 | _end: | 2025 | _end: |
@@ -2056,13 +2056,14 @@ static int snd_pcm_unlink(struct snd_pcm_substream *substream) | |||
2056 | snd_pcm_group_lock_irq(group, nonatomic); | 2056 | snd_pcm_group_lock_irq(group, nonatomic); |
2057 | 2057 | ||
2058 | relink_to_local(substream); | 2058 | relink_to_local(substream); |
2059 | refcount_dec(&group->refs); | ||
2059 | 2060 | ||
2060 | /* detach the last stream, too */ | 2061 | /* detach the last stream, too */ |
2061 | if (list_is_singular(&group->substreams)) { | 2062 | if (list_is_singular(&group->substreams)) { |
2062 | relink_to_local(list_first_entry(&group->substreams, | 2063 | relink_to_local(list_first_entry(&group->substreams, |
2063 | struct snd_pcm_substream, | 2064 | struct snd_pcm_substream, |
2064 | link_list)); | 2065 | link_list)); |
2065 | do_free = !refcount_read(&group->refs); | 2066 | do_free = refcount_dec_and_test(&group->refs); |
2066 | } | 2067 | } |
2067 | 2068 | ||
2068 | snd_pcm_group_unlock_irq(group, nonatomic); | 2069 | snd_pcm_group_unlock_irq(group, nonatomic); |
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index e30e86ca6b72..51f10ed9bc43 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -2942,7 +2942,7 @@ static int hda_codec_runtime_resume(struct device *dev) | |||
2942 | static int hda_codec_force_resume(struct device *dev) | 2942 | static int hda_codec_force_resume(struct device *dev) |
2943 | { | 2943 | { |
2944 | struct hda_codec *codec = dev_to_hda_codec(dev); | 2944 | struct hda_codec *codec = dev_to_hda_codec(dev); |
2945 | bool forced_resume = !codec->relaxed_resume; | 2945 | bool forced_resume = !codec->relaxed_resume && codec->jacktbl.used; |
2946 | int ret; | 2946 | int ret; |
2947 | 2947 | ||
2948 | /* The get/put pair below enforces the runtime resume even if the | 2948 | /* The get/put pair below enforces the runtime resume even if the |
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index cb8b0945547c..1e14d7270adf 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -313,11 +313,10 @@ enum { | |||
313 | 313 | ||
314 | #define AZX_DCAPS_INTEL_SKYLAKE \ | 314 | #define AZX_DCAPS_INTEL_SKYLAKE \ |
315 | (AZX_DCAPS_INTEL_PCH_BASE | AZX_DCAPS_PM_RUNTIME |\ | 315 | (AZX_DCAPS_INTEL_PCH_BASE | AZX_DCAPS_PM_RUNTIME |\ |
316 | AZX_DCAPS_SYNC_WRITE |\ | ||
316 | AZX_DCAPS_SEPARATE_STREAM_TAG | AZX_DCAPS_I915_COMPONENT) | 317 | AZX_DCAPS_SEPARATE_STREAM_TAG | AZX_DCAPS_I915_COMPONENT) |
317 | 318 | ||
318 | #define AZX_DCAPS_INTEL_BROXTON \ | 319 | #define AZX_DCAPS_INTEL_BROXTON AZX_DCAPS_INTEL_SKYLAKE |
319 | (AZX_DCAPS_INTEL_PCH_BASE | AZX_DCAPS_PM_RUNTIME |\ | ||
320 | AZX_DCAPS_SEPARATE_STREAM_TAG | AZX_DCAPS_I915_COMPONENT) | ||
321 | 320 | ||
322 | /* quirks for ATI SB / AMD Hudson */ | 321 | /* quirks for ATI SB / AMD Hudson */ |
323 | #define AZX_DCAPS_PRESET_ATI_SB \ | 322 | #define AZX_DCAPS_PRESET_ATI_SB \ |
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index 4f8d0845ee1e..f299f137eaea 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c | |||
@@ -1083,6 +1083,7 @@ static int patch_conexant_auto(struct hda_codec *codec) | |||
1083 | */ | 1083 | */ |
1084 | 1084 | ||
1085 | static const struct hda_device_id snd_hda_id_conexant[] = { | 1085 | static const struct hda_device_id snd_hda_id_conexant[] = { |
1086 | HDA_CODEC_ENTRY(0x14f11f86, "CX8070", patch_conexant_auto), | ||
1086 | HDA_CODEC_ENTRY(0x14f12008, "CX8200", patch_conexant_auto), | 1087 | HDA_CODEC_ENTRY(0x14f12008, "CX8200", patch_conexant_auto), |
1087 | HDA_CODEC_ENTRY(0x14f15045, "CX20549 (Venice)", patch_conexant_auto), | 1088 | HDA_CODEC_ENTRY(0x14f15045, "CX20549 (Venice)", patch_conexant_auto), |
1088 | HDA_CODEC_ENTRY(0x14f15047, "CX20551 (Waikiki)", patch_conexant_auto), | 1089 | HDA_CODEC_ENTRY(0x14f15047, "CX20551 (Waikiki)", patch_conexant_auto), |
diff --git a/sound/usb/line6/podhd.c b/sound/usb/line6/podhd.c index f0662bd4e50f..27bf61c177c0 100644 --- a/sound/usb/line6/podhd.c +++ b/sound/usb/line6/podhd.c | |||
@@ -368,7 +368,7 @@ static const struct line6_properties podhd_properties_table[] = { | |||
368 | .name = "POD HD500", | 368 | .name = "POD HD500", |
369 | .capabilities = LINE6_CAP_PCM | 369 | .capabilities = LINE6_CAP_PCM |
370 | | LINE6_CAP_HWMON, | 370 | | LINE6_CAP_HWMON, |
371 | .altsetting = 1, | 371 | .altsetting = 0, |
372 | .ep_ctrl_r = 0x81, | 372 | .ep_ctrl_r = 0x81, |
373 | .ep_ctrl_w = 0x01, | 373 | .ep_ctrl_w = 0x01, |
374 | .ep_audio_r = 0x86, | 374 | .ep_audio_r = 0x86, |
diff --git a/sound/usb/line6/variax.c b/sound/usb/line6/variax.c index 0d24c72c155f..ed158f04de80 100644 --- a/sound/usb/line6/variax.c +++ b/sound/usb/line6/variax.c | |||
@@ -244,5 +244,5 @@ static struct usb_driver variax_driver = { | |||
244 | 244 | ||
245 | module_usb_driver(variax_driver); | 245 | module_usb_driver(variax_driver); |
246 | 246 | ||
247 | MODULE_DESCRIPTION("Vairax Workbench USB driver"); | 247 | MODULE_DESCRIPTION("Variax Workbench USB driver"); |
248 | MODULE_LICENSE("GPL"); | 248 | MODULE_LICENSE("GPL"); |
diff --git a/tools/include/uapi/linux/kvm.h b/tools/include/uapi/linux/kvm.h index c2152f3dd02d..e7c67be7c15f 100644 --- a/tools/include/uapi/linux/kvm.h +++ b/tools/include/uapi/linux/kvm.h | |||
@@ -116,7 +116,7 @@ struct kvm_irq_level { | |||
116 | * ACPI gsi notion of irq. | 116 | * ACPI gsi notion of irq. |
117 | * For IA-64 (APIC model) IOAPIC0: irq 0-23; IOAPIC1: irq 24-47.. | 117 | * For IA-64 (APIC model) IOAPIC0: irq 0-23; IOAPIC1: irq 24-47.. |
118 | * For X86 (standard AT mode) PIC0/1: irq 0-15. IOAPIC0: 0-23.. | 118 | * For X86 (standard AT mode) PIC0/1: irq 0-15. IOAPIC0: 0-23.. |
119 | * For ARM: See Documentation/virtual/kvm/api.txt | 119 | * For ARM: See Documentation/virt/kvm/api.txt |
120 | */ | 120 | */ |
121 | union { | 121 | union { |
122 | __u32 irq; | 122 | __u32 irq; |
@@ -1085,7 +1085,7 @@ struct kvm_xen_hvm_config { | |||
1085 | * | 1085 | * |
1086 | * KVM_IRQFD_FLAG_RESAMPLE indicates resamplefd is valid and specifies | 1086 | * KVM_IRQFD_FLAG_RESAMPLE indicates resamplefd is valid and specifies |
1087 | * the irqfd to operate in resampling mode for level triggered interrupt | 1087 | * the irqfd to operate in resampling mode for level triggered interrupt |
1088 | * emulation. See Documentation/virtual/kvm/api.txt. | 1088 | * emulation. See Documentation/virt/kvm/api.txt. |
1089 | */ | 1089 | */ |
1090 | #define KVM_IRQFD_FLAG_RESAMPLE (1 << 1) | 1090 | #define KVM_IRQFD_FLAG_RESAMPLE (1 << 1) |
1091 | 1091 | ||
diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 5f26620f13f5..176f2f084060 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c | |||
@@ -1946,6 +1946,7 @@ static int validate_branch(struct objtool_file *file, struct symbol *func, | |||
1946 | struct alternative *alt; | 1946 | struct alternative *alt; |
1947 | struct instruction *insn, *next_insn; | 1947 | struct instruction *insn, *next_insn; |
1948 | struct section *sec; | 1948 | struct section *sec; |
1949 | u8 visited; | ||
1949 | int ret; | 1950 | int ret; |
1950 | 1951 | ||
1951 | insn = first; | 1952 | insn = first; |
@@ -1972,12 +1973,12 @@ static int validate_branch(struct objtool_file *file, struct symbol *func, | |||
1972 | return 1; | 1973 | return 1; |
1973 | } | 1974 | } |
1974 | 1975 | ||
1976 | visited = 1 << state.uaccess; | ||
1975 | if (insn->visited) { | 1977 | if (insn->visited) { |
1976 | if (!insn->hint && !insn_state_match(insn, &state)) | 1978 | if (!insn->hint && !insn_state_match(insn, &state)) |
1977 | return 1; | 1979 | return 1; |
1978 | 1980 | ||
1979 | /* If we were here with AC=0, but now have AC=1, go again */ | 1981 | if (insn->visited & visited) |
1980 | if (insn->state.uaccess || !state.uaccess) | ||
1981 | return 0; | 1982 | return 0; |
1982 | } | 1983 | } |
1983 | 1984 | ||
@@ -2024,7 +2025,7 @@ static int validate_branch(struct objtool_file *file, struct symbol *func, | |||
2024 | } else | 2025 | } else |
2025 | insn->state = state; | 2026 | insn->state = state; |
2026 | 2027 | ||
2027 | insn->visited = true; | 2028 | insn->visited |= visited; |
2028 | 2029 | ||
2029 | if (!insn->ignore_alts) { | 2030 | if (!insn->ignore_alts) { |
2030 | bool skip_orig = false; | 2031 | bool skip_orig = false; |
diff --git a/tools/objtool/check.h b/tools/objtool/check.h index b881fafcf55d..6d875ca6fce0 100644 --- a/tools/objtool/check.h +++ b/tools/objtool/check.h | |||
@@ -33,8 +33,9 @@ struct instruction { | |||
33 | unsigned int len; | 33 | unsigned int len; |
34 | enum insn_type type; | 34 | enum insn_type type; |
35 | unsigned long immediate; | 35 | unsigned long immediate; |
36 | bool alt_group, visited, dead_end, ignore, hint, save, restore, ignore_alts; | 36 | bool alt_group, dead_end, ignore, hint, save, restore, ignore_alts; |
37 | bool retpoline_safe; | 37 | bool retpoline_safe; |
38 | u8 visited; | ||
38 | struct symbol *call_dest; | 39 | struct symbol *call_dest; |
39 | struct instruction *jump_dest; | 40 | struct instruction *jump_dest; |
40 | struct instruction *first_jump_src; | 41 | struct instruction *first_jump_src; |
diff --git a/tools/perf/Documentation/perf-script.txt b/tools/perf/Documentation/perf-script.txt index d4e2e18a5881..caaab28f8400 100644 --- a/tools/perf/Documentation/perf-script.txt +++ b/tools/perf/Documentation/perf-script.txt | |||
@@ -228,11 +228,11 @@ OPTIONS | |||
228 | 228 | ||
229 | With the metric option perf script can compute metrics for | 229 | With the metric option perf script can compute metrics for |
230 | sampling periods, similar to perf stat. This requires | 230 | sampling periods, similar to perf stat. This requires |
231 | specifying a group with multiple metrics with the :S option | 231 | specifying a group with multiple events defining metrics with the :S option |
232 | for perf record. perf will sample on the first event, and | 232 | for perf record. perf will sample on the first event, and |
233 | compute metrics for all the events in the group. Please note | 233 | print computed metrics for all the events in the group. Please note |
234 | that the metric computed is averaged over the whole sampling | 234 | that the metric computed is averaged over the whole sampling |
235 | period, not just for the sample point. | 235 | period (since the last sample), not just for the sample point. |
236 | 236 | ||
237 | For sample events it's possible to display misc field with -F +misc option, | 237 | For sample events it's possible to display misc field with -F +misc option, |
238 | following letters are displayed for each bit: | 238 | following letters are displayed for each bit: |
@@ -384,7 +384,7 @@ include::itrace.txt[] | |||
384 | perf script --time 0%-10%,30%-40% | 384 | perf script --time 0%-10%,30%-40% |
385 | 385 | ||
386 | --max-blocks:: | 386 | --max-blocks:: |
387 | Set the maximum number of program blocks to print with brstackasm for | 387 | Set the maximum number of program blocks to print with brstackinsn for |
388 | each sample. | 388 | each sample. |
389 | 389 | ||
390 | --reltime:: | 390 | --reltime:: |
diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c index 6418782951a4..3d0ffd41fb55 100644 --- a/tools/perf/builtin-probe.c +++ b/tools/perf/builtin-probe.c | |||
@@ -698,6 +698,16 @@ __cmd_probe(int argc, const char **argv) | |||
698 | 698 | ||
699 | ret = perf_add_probe_events(params.events, params.nevents); | 699 | ret = perf_add_probe_events(params.events, params.nevents); |
700 | if (ret < 0) { | 700 | if (ret < 0) { |
701 | |||
702 | /* | ||
703 | * When perf_add_probe_events() fails it calls | ||
704 | * cleanup_perf_probe_events(pevs, npevs), i.e. | ||
705 | * cleanup_perf_probe_events(params.events, params.nevents), which | ||
706 | * will call clear_perf_probe_event(), so set nevents to zero | ||
707 | * to avoid cleanup_params() to call clear_perf_probe_event() again | ||
708 | * on the same pevs. | ||
709 | */ | ||
710 | params.nevents = 0; | ||
701 | pr_err_with_code(" Error: Failed to add events.", ret); | 711 | pr_err_with_code(" Error: Failed to add events.", ret); |
702 | return ret; | 712 | return ret; |
703 | } | 713 | } |
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 8f24865596af..0140ddb8dd0b 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c | |||
@@ -1059,7 +1059,7 @@ static int perf_sample__fprintf_brstackinsn(struct perf_sample *sample, | |||
1059 | 1059 | ||
1060 | printed += ip__fprintf_sym(ip, thread, x.cpumode, x.cpu, &lastsym, attr, fp); | 1060 | printed += ip__fprintf_sym(ip, thread, x.cpumode, x.cpu, &lastsym, attr, fp); |
1061 | if (ip == end) { | 1061 | if (ip == end) { |
1062 | printed += ip__fprintf_jump(ip, &br->entries[i], &x, buffer + off, len - off, insn, fp, | 1062 | printed += ip__fprintf_jump(ip, &br->entries[i], &x, buffer + off, len - off, ++insn, fp, |
1063 | &total_cycles); | 1063 | &total_cycles); |
1064 | if (PRINT_FIELD(SRCCODE)) | 1064 | if (PRINT_FIELD(SRCCODE)) |
1065 | printed += print_srccode(thread, x.cpumode, ip); | 1065 | printed += print_srccode(thread, x.cpumode, ip); |
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index b55a534b4de0..352cf39d7c2f 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c | |||
@@ -607,7 +607,13 @@ try_again: | |||
607 | * group leaders. | 607 | * group leaders. |
608 | */ | 608 | */ |
609 | read_counters(&(struct timespec) { .tv_nsec = t1-t0 }); | 609 | read_counters(&(struct timespec) { .tv_nsec = t1-t0 }); |
610 | perf_evlist__close(evsel_list); | 610 | |
611 | /* | ||
612 | * We need to keep evsel_list alive, because it's processed | ||
613 | * later the evsel_list will be closed after. | ||
614 | */ | ||
615 | if (!STAT_RECORD) | ||
616 | perf_evlist__close(evsel_list); | ||
611 | 617 | ||
612 | return WEXITSTATUS(status); | 618 | return WEXITSTATUS(status); |
613 | } | 619 | } |
@@ -1997,6 +2003,7 @@ int cmd_stat(int argc, const char **argv) | |||
1997 | perf_session__write_header(perf_stat.session, evsel_list, fd, true); | 2003 | perf_session__write_header(perf_stat.session, evsel_list, fd, true); |
1998 | } | 2004 | } |
1999 | 2005 | ||
2006 | perf_evlist__close(evsel_list); | ||
2000 | perf_session__delete(perf_stat.session); | 2007 | perf_session__delete(perf_stat.session); |
2001 | } | 2008 | } |
2002 | 2009 | ||
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index ebb46da4dfe5..52459dd5ad0c 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c | |||
@@ -1291,6 +1291,7 @@ static void perf_evsel__free_id(struct perf_evsel *evsel) | |||
1291 | xyarray__delete(evsel->sample_id); | 1291 | xyarray__delete(evsel->sample_id); |
1292 | evsel->sample_id = NULL; | 1292 | evsel->sample_id = NULL; |
1293 | zfree(&evsel->id); | 1293 | zfree(&evsel->id); |
1294 | evsel->ids = 0; | ||
1294 | } | 1295 | } |
1295 | 1296 | ||
1296 | static void perf_evsel__free_config_terms(struct perf_evsel *evsel) | 1297 | static void perf_evsel__free_config_terms(struct perf_evsel *evsel) |
@@ -2077,6 +2078,7 @@ void perf_evsel__close(struct perf_evsel *evsel) | |||
2077 | 2078 | ||
2078 | perf_evsel__close_fd(evsel); | 2079 | perf_evsel__close_fd(evsel); |
2079 | perf_evsel__free_fd(evsel); | 2080 | perf_evsel__free_fd(evsel); |
2081 | perf_evsel__free_id(evsel); | ||
2080 | } | 2082 | } |
2081 | 2083 | ||
2082 | int perf_evsel__open_per_cpu(struct perf_evsel *evsel, | 2084 | int perf_evsel__open_per_cpu(struct perf_evsel *evsel, |
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index c24db7f4909c..20111f8da5cb 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c | |||
@@ -3747,7 +3747,7 @@ int perf_event__process_feature(struct perf_session *session, | |||
3747 | return 0; | 3747 | return 0; |
3748 | 3748 | ||
3749 | ff.buf = (void *)fe->data; | 3749 | ff.buf = (void *)fe->data; |
3750 | ff.size = event->header.size - sizeof(event->header); | 3750 | ff.size = event->header.size - sizeof(*fe); |
3751 | ff.ph = &session->header; | 3751 | ff.ph = &session->header; |
3752 | 3752 | ||
3753 | if (feat_ops[feat].process(&ff, NULL)) | 3753 | if (feat_ops[feat].process(&ff, NULL)) |
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c index cd1eb73cfe83..8394d48f8b32 100644 --- a/tools/perf/util/probe-event.c +++ b/tools/perf/util/probe-event.c | |||
@@ -2230,6 +2230,7 @@ void clear_perf_probe_event(struct perf_probe_event *pev) | |||
2230 | field = next; | 2230 | field = next; |
2231 | } | 2231 | } |
2232 | } | 2232 | } |
2233 | pev->nargs = 0; | ||
2233 | zfree(&pev->args); | 2234 | zfree(&pev->args); |
2234 | } | 2235 | } |
2235 | 2236 | ||
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index d0fd6c614e68..37efa1f43d8b 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c | |||
@@ -36,10 +36,16 @@ static int perf_session__process_compressed_event(struct perf_session *session, | |||
36 | void *src; | 36 | void *src; |
37 | size_t decomp_size, src_size; | 37 | size_t decomp_size, src_size; |
38 | u64 decomp_last_rem = 0; | 38 | u64 decomp_last_rem = 0; |
39 | size_t decomp_len = session->header.env.comp_mmap_len; | 39 | size_t mmap_len, decomp_len = session->header.env.comp_mmap_len; |
40 | struct decomp *decomp, *decomp_last = session->decomp_last; | 40 | struct decomp *decomp, *decomp_last = session->decomp_last; |
41 | 41 | ||
42 | decomp = mmap(NULL, sizeof(struct decomp) + decomp_len, PROT_READ|PROT_WRITE, | 42 | if (decomp_last) { |
43 | decomp_last_rem = decomp_last->size - decomp_last->head; | ||
44 | decomp_len += decomp_last_rem; | ||
45 | } | ||
46 | |||
47 | mmap_len = sizeof(struct decomp) + decomp_len; | ||
48 | decomp = mmap(NULL, mmap_len, PROT_READ|PROT_WRITE, | ||
43 | MAP_ANONYMOUS|MAP_PRIVATE, -1, 0); | 49 | MAP_ANONYMOUS|MAP_PRIVATE, -1, 0); |
44 | if (decomp == MAP_FAILED) { | 50 | if (decomp == MAP_FAILED) { |
45 | pr_err("Couldn't allocate memory for decompression\n"); | 51 | pr_err("Couldn't allocate memory for decompression\n"); |
@@ -47,10 +53,10 @@ static int perf_session__process_compressed_event(struct perf_session *session, | |||
47 | } | 53 | } |
48 | 54 | ||
49 | decomp->file_pos = file_offset; | 55 | decomp->file_pos = file_offset; |
56 | decomp->mmap_len = mmap_len; | ||
50 | decomp->head = 0; | 57 | decomp->head = 0; |
51 | 58 | ||
52 | if (decomp_last) { | 59 | if (decomp_last_rem) { |
53 | decomp_last_rem = decomp_last->size - decomp_last->head; | ||
54 | memcpy(decomp->data, &(decomp_last->data[decomp_last->head]), decomp_last_rem); | 60 | memcpy(decomp->data, &(decomp_last->data[decomp_last->head]), decomp_last_rem); |
55 | decomp->size = decomp_last_rem; | 61 | decomp->size = decomp_last_rem; |
56 | } | 62 | } |
@@ -61,7 +67,7 @@ static int perf_session__process_compressed_event(struct perf_session *session, | |||
61 | decomp_size = zstd_decompress_stream(&(session->zstd_data), src, src_size, | 67 | decomp_size = zstd_decompress_stream(&(session->zstd_data), src, src_size, |
62 | &(decomp->data[decomp_last_rem]), decomp_len - decomp_last_rem); | 68 | &(decomp->data[decomp_last_rem]), decomp_len - decomp_last_rem); |
63 | if (!decomp_size) { | 69 | if (!decomp_size) { |
64 | munmap(decomp, sizeof(struct decomp) + decomp_len); | 70 | munmap(decomp, mmap_len); |
65 | pr_err("Couldn't decompress data\n"); | 71 | pr_err("Couldn't decompress data\n"); |
66 | return -1; | 72 | return -1; |
67 | } | 73 | } |
@@ -255,15 +261,15 @@ static void perf_session__delete_threads(struct perf_session *session) | |||
255 | static void perf_session__release_decomp_events(struct perf_session *session) | 261 | static void perf_session__release_decomp_events(struct perf_session *session) |
256 | { | 262 | { |
257 | struct decomp *next, *decomp; | 263 | struct decomp *next, *decomp; |
258 | size_t decomp_len; | 264 | size_t mmap_len; |
259 | next = session->decomp; | 265 | next = session->decomp; |
260 | decomp_len = session->header.env.comp_mmap_len; | ||
261 | do { | 266 | do { |
262 | decomp = next; | 267 | decomp = next; |
263 | if (decomp == NULL) | 268 | if (decomp == NULL) |
264 | break; | 269 | break; |
265 | next = decomp->next; | 270 | next = decomp->next; |
266 | munmap(decomp, decomp_len + sizeof(struct decomp)); | 271 | mmap_len = decomp->mmap_len; |
272 | munmap(decomp, mmap_len); | ||
267 | } while (1); | 273 | } while (1); |
268 | } | 274 | } |
269 | 275 | ||
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h index dd8920b745bc..863dbad87849 100644 --- a/tools/perf/util/session.h +++ b/tools/perf/util/session.h | |||
@@ -46,6 +46,7 @@ struct perf_session { | |||
46 | struct decomp { | 46 | struct decomp { |
47 | struct decomp *next; | 47 | struct decomp *next; |
48 | u64 file_pos; | 48 | u64 file_pos; |
49 | size_t mmap_len; | ||
49 | u64 head; | 50 | u64 head; |
50 | size_t size; | 51 | size_t size; |
51 | char data[]; | 52 | char data[]; |
diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c index 656065af4971..accb1bf1cfd8 100644 --- a/tools/perf/util/stat-shadow.c +++ b/tools/perf/util/stat-shadow.c | |||
@@ -819,7 +819,8 @@ void perf_stat__print_shadow_stats(struct perf_stat_config *config, | |||
819 | "stalled cycles per insn", | 819 | "stalled cycles per insn", |
820 | ratio); | 820 | ratio); |
821 | } else if (have_frontend_stalled) { | 821 | } else if (have_frontend_stalled) { |
822 | print_metric(config, ctxp, NULL, NULL, | 822 | out->new_line(config, ctxp); |
823 | print_metric(config, ctxp, NULL, "%7.2f ", | ||
823 | "stalled cycles per insn", 0); | 824 | "stalled cycles per insn", 0); |
824 | } | 825 | } |
825 | } else if (perf_evsel__match(evsel, HARDWARE, HW_BRANCH_MISSES)) { | 826 | } else if (perf_evsel__match(evsel, HARDWARE, HW_BRANCH_MISSES)) { |
diff --git a/tools/perf/util/zstd.c b/tools/perf/util/zstd.c index 23bdb9884576..d2202392ffdb 100644 --- a/tools/perf/util/zstd.c +++ b/tools/perf/util/zstd.c | |||
@@ -99,8 +99,8 @@ size_t zstd_decompress_stream(struct zstd_data *data, void *src, size_t src_size | |||
99 | while (input.pos < input.size) { | 99 | while (input.pos < input.size) { |
100 | ret = ZSTD_decompressStream(data->dstream, &output, &input); | 100 | ret = ZSTD_decompressStream(data->dstream, &output, &input); |
101 | if (ZSTD_isError(ret)) { | 101 | if (ZSTD_isError(ret)) { |
102 | pr_err("failed to decompress (B): %ld -> %ld : %s\n", | 102 | pr_err("failed to decompress (B): %ld -> %ld, dst_size %ld : %s\n", |
103 | src_size, output.size, ZSTD_getErrorName(ret)); | 103 | src_size, output.size, dst_size, ZSTD_getErrorName(ret)); |
104 | break; | 104 | break; |
105 | } | 105 | } |
106 | output.dst = dst + output.pos; | 106 | output.dst = dst + output.pos; |
diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include index 495066bafbe3..ded7a950dc40 100644 --- a/tools/scripts/Makefile.include +++ b/tools/scripts/Makefile.include | |||
@@ -32,7 +32,6 @@ EXTRA_WARNINGS += -Wno-system-headers | |||
32 | EXTRA_WARNINGS += -Wold-style-definition | 32 | EXTRA_WARNINGS += -Wold-style-definition |
33 | EXTRA_WARNINGS += -Wpacked | 33 | EXTRA_WARNINGS += -Wpacked |
34 | EXTRA_WARNINGS += -Wredundant-decls | 34 | EXTRA_WARNINGS += -Wredundant-decls |
35 | EXTRA_WARNINGS += -Wshadow | ||
36 | EXTRA_WARNINGS += -Wstrict-prototypes | 35 | EXTRA_WARNINGS += -Wstrict-prototypes |
37 | EXTRA_WARNINGS += -Wswitch-default | 36 | EXTRA_WARNINGS += -Wswitch-default |
38 | EXTRA_WARNINGS += -Wswitch-enum | 37 | EXTRA_WARNINGS += -Wswitch-enum |
@@ -69,8 +68,16 @@ endif | |||
69 | # will do for now and keep the above -Wstrict-aliasing=3 in place | 68 | # will do for now and keep the above -Wstrict-aliasing=3 in place |
70 | # in newer systems. | 69 | # in newer systems. |
71 | # Needed for the __raw_cmpxchg in tools/arch/x86/include/asm/cmpxchg.h | 70 | # Needed for the __raw_cmpxchg in tools/arch/x86/include/asm/cmpxchg.h |
71 | # | ||
72 | # See https://lkml.org/lkml/2006/11/28/253 and https://gcc.gnu.org/gcc-4.8/changes.html, | ||
73 | # that takes into account Linus's comments (search for Wshadow) for the reasoning about | ||
74 | # -Wshadow not being interesting before gcc 4.8. | ||
75 | |||
72 | ifneq ($(filter 3.%,$(MAKE_VERSION)),) # make-3 | 76 | ifneq ($(filter 3.%,$(MAKE_VERSION)),) # make-3 |
73 | EXTRA_WARNINGS += -fno-strict-aliasing | 77 | EXTRA_WARNINGS += -fno-strict-aliasing |
78 | EXTRA_WARNINGS += -Wno-shadow | ||
79 | else | ||
80 | EXTRA_WARNINGS += -Wshadow | ||
74 | endif | 81 | endif |
75 | 82 | ||
76 | ifneq ($(findstring $(MAKEFLAGS), w),w) | 83 | ifneq ($(findstring $(MAKEFLAGS), w),w) |
diff --git a/tools/testing/ktest/config-bisect.pl b/tools/testing/ktest/config-bisect.pl index 72525426654b..6fd864935319 100755 --- a/tools/testing/ktest/config-bisect.pl +++ b/tools/testing/ktest/config-bisect.pl | |||
@@ -663,7 +663,7 @@ while ($#ARGV >= 0) { | |||
663 | } | 663 | } |
664 | 664 | ||
665 | else { | 665 | else { |
666 | die "Unknow option $opt\n"; | 666 | die "Unknown option $opt\n"; |
667 | } | 667 | } |
668 | } | 668 | } |
669 | 669 | ||
@@ -732,7 +732,7 @@ if ($start) { | |||
732 | } | 732 | } |
733 | } | 733 | } |
734 | run_command "cp $good_start $good" or die "failed to copy to $good\n"; | 734 | run_command "cp $good_start $good" or die "failed to copy to $good\n"; |
735 | run_command "cp $bad_start $bad" or die "faield to copy to $bad\n"; | 735 | run_command "cp $bad_start $bad" or die "failed to copy to $bad\n"; |
736 | } else { | 736 | } else { |
737 | if ( ! -f $good ) { | 737 | if ( ! -f $good ) { |
738 | die "Can not find file $good\n"; | 738 | die "Can not find file $good\n"; |
diff --git a/usr/include/Makefile b/usr/include/Makefile index aa316d99e035..1fb6abe29b2f 100644 --- a/usr/include/Makefile +++ b/usr/include/Makefile | |||
@@ -101,10 +101,6 @@ ifeq ($(SRCARCH),riscv) | |||
101 | header-test- += linux/bpf_perf_event.h | 101 | header-test- += linux/bpf_perf_event.h |
102 | endif | 102 | endif |
103 | 103 | ||
104 | ifeq ($(SRCARCH),s390) | ||
105 | header-test- += asm/zcrypt.h | ||
106 | endif | ||
107 | |||
108 | ifeq ($(SRCARCH),sparc) | 104 | ifeq ($(SRCARCH),sparc) |
109 | header-test- += asm/stat.h | 105 | header-test- += asm/stat.h |
110 | header-test- += asm/uctx.h | 106 | header-test- += asm/uctx.h |
diff --git a/virt/kvm/arm/arm.c b/virt/kvm/arm/arm.c index f645c0fbf7ec..acc43242a310 100644 --- a/virt/kvm/arm/arm.c +++ b/virt/kvm/arm/arm.c | |||
@@ -727,7 +727,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) | |||
727 | * Ensure we set mode to IN_GUEST_MODE after we disable | 727 | * Ensure we set mode to IN_GUEST_MODE after we disable |
728 | * interrupts and before the final VCPU requests check. | 728 | * interrupts and before the final VCPU requests check. |
729 | * See the comment in kvm_vcpu_exiting_guest_mode() and | 729 | * See the comment in kvm_vcpu_exiting_guest_mode() and |
730 | * Documentation/virtual/kvm/vcpu-requests.rst | 730 | * Documentation/virt/kvm/vcpu-requests.rst |
731 | */ | 731 | */ |
732 | smp_store_mb(vcpu->mode, IN_GUEST_MODE); | 732 | smp_store_mb(vcpu->mode, IN_GUEST_MODE); |
733 | 733 | ||
diff --git a/virt/kvm/arm/vgic/vgic-mmio-v3.c b/virt/kvm/arm/vgic/vgic-mmio-v3.c index 936962abc38d..c45e2d7e942f 100644 --- a/virt/kvm/arm/vgic/vgic-mmio-v3.c +++ b/virt/kvm/arm/vgic/vgic-mmio-v3.c | |||
@@ -250,7 +250,7 @@ static unsigned long vgic_v3_uaccess_read_pending(struct kvm_vcpu *vcpu, | |||
250 | * pending state of interrupt is latched in pending_latch variable. | 250 | * pending state of interrupt is latched in pending_latch variable. |
251 | * Userspace will save and restore pending state and line_level | 251 | * Userspace will save and restore pending state and line_level |
252 | * separately. | 252 | * separately. |
253 | * Refer to Documentation/virtual/kvm/devices/arm-vgic-v3.txt | 253 | * Refer to Documentation/virt/kvm/devices/arm-vgic-v3.txt |
254 | * for handling of ISPENDR and ICPENDR. | 254 | * for handling of ISPENDR and ICPENDR. |
255 | */ | 255 | */ |
256 | for (i = 0; i < len * 8; i++) { | 256 | for (i = 0; i < len * 8; i++) { |
diff --git a/virt/kvm/arm/vgic/vgic.h b/virt/kvm/arm/vgic/vgic.h index 57205beaa981..3b7525deec80 100644 --- a/virt/kvm/arm/vgic/vgic.h +++ b/virt/kvm/arm/vgic/vgic.h | |||
@@ -42,7 +42,7 @@ | |||
42 | VGIC_AFFINITY_LEVEL(val, 3)) | 42 | VGIC_AFFINITY_LEVEL(val, 3)) |
43 | 43 | ||
44 | /* | 44 | /* |
45 | * As per Documentation/virtual/kvm/devices/arm-vgic-v3.txt, | 45 | * As per Documentation/virt/kvm/devices/arm-vgic-v3.txt, |
46 | * below macros are defined for CPUREG encoding. | 46 | * below macros are defined for CPUREG encoding. |
47 | */ | 47 | */ |
48 | #define KVM_REG_ARM_VGIC_SYSREG_OP0_MASK 0x000000000000c000 | 48 | #define KVM_REG_ARM_VGIC_SYSREG_OP0_MASK 0x000000000000c000 |
@@ -63,7 +63,7 @@ | |||
63 | KVM_REG_ARM_VGIC_SYSREG_OP2_MASK) | 63 | KVM_REG_ARM_VGIC_SYSREG_OP2_MASK) |
64 | 64 | ||
65 | /* | 65 | /* |
66 | * As per Documentation/virtual/kvm/devices/arm-vgic-its.txt, | 66 | * As per Documentation/virt/kvm/devices/arm-vgic-its.txt, |
67 | * below macros are defined for ITS table entry encoding. | 67 | * below macros are defined for ITS table entry encoding. |
68 | */ | 68 | */ |
69 | #define KVM_ITS_CTE_VALID_SHIFT 63 | 69 | #define KVM_ITS_CTE_VALID_SHIFT 63 |