[PATCH] docs: packing: move it to core-api book and adjust markups

2019-06-29 Thread Mauro Carvalho Chehab
The packing.txt file was misplaced, as docs should be part of
a documentation book, and not at the root dir.

So, move it to the core-api directory and add to its index.

Also, ensure that the file will be properly parsed and the bitmap
ascii artwork will use a monotonic font.

Fixes: 554aae35007e ("lib: Add support for generic packing operations")
Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/core-api/index.rst  |  1 +
 .../{packing.txt => core-api/packing.rst} | 81 +++
 2 files changed, 50 insertions(+), 32 deletions(-)
 rename Documentation/{packing.txt => core-api/packing.rst} (61%)

diff --git a/Documentation/core-api/index.rst b/Documentation/core-api/index.rst
index d1e5b95bf86d..aebb16d7771f 100644
--- a/Documentation/core-api/index.rst
+++ b/Documentation/core-api/index.rst
@@ -25,6 +25,7 @@ Core utilities
librs
genalloc
errseq
+   packing
printk-formats
circular-buffers
generic-radix-tree
diff --git a/Documentation/packing.txt b/Documentation/core-api/packing.rst
similarity index 61%
rename from Documentation/packing.txt
rename to Documentation/core-api/packing.rst
index f830c98645f1..d8c341fe383e 100644
--- a/Documentation/packing.txt
+++ b/Documentation/core-api/packing.rst
@@ -30,6 +30,7 @@ The solution
 
 
 This API deals with 2 basic operations:
+
   - Packing a CPU-usable number into a memory buffer (with hardware
 constraints/quirks)
   - Unpacking a memory buffer (which has hardware constraints/quirks)
@@ -49,10 +50,12 @@ What the examples show is where the logical bytes and bits 
sit.
 
 1. Normally (no quirks), we would do it like this:
 
-63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 
37 36 35 34 33 32
-7   6   54
-31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10  9  8  7  6  
5  4  3  2  1  0
-3   2   10
+::
+
+  63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 
38 37 36 35 34 33 32
+  7   6   54
+  31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10  9  8  7  
6  5  4  3  2  1  0
+  3   2   10
 
 That is, the MSByte (7) of the CPU-usable u64 sits at memory offset 0, and the
 LSByte (0) of the u64 sits at memory offset 7.
@@ -63,10 +66,12 @@ comments as "logical" notation.
 
 2. If QUIRK_MSB_ON_THE_RIGHT is set, we do it like this:
 
-56 57 58 59 60 61 62 63 48 49 50 51 52 53 54 55 40 41 42 43 44 45 46 47 32 33 
34 35 36 37 38 39
-7   65   4
-24 25 26 27 28 29 30 31 16 17 18 19 20 21 22 23  8  9 10 11 12 13 14 15  0  1  
2  3  4  5  6  7
-3   21   0
+::
+
+  56 57 58 59 60 61 62 63 48 49 50 51 52 53 54 55 40 41 42 43 44 45 46 47 32 
33 34 35 36 37 38 39
+  7   65   4
+  24 25 26 27 28 29 30 31 16 17 18 19 20 21 22 23  8  9 10 11 12 13 14 15  0  
1  2  3  4  5  6  7
+  3   21   0
 
 That is, QUIRK_MSB_ON_THE_RIGHT does not affect byte positioning, but
 inverts bit offsets inside a byte.
@@ -74,10 +79,12 @@ inverts bit offsets inside a byte.
 
 3. If QUIRK_LITTLE_ENDIAN is set, we do it like this:
 
-39 38 37 36 35 34 33 32 47 46 45 44 43 42 41 40 55 54 53 52 51 50 49 48 63 62 
61 60 59 58 57 56
-4   5   6   7
-7  6  5  4  3  2  1  0  15 14 13 12 11 10  9  8 23 22 21 20 19 18 17 16 31 30 
29 28 27 26 25 24
-0   1   2   3
+::
+
+  39 38 37 36 35 34 33 32 47 46 45 44 43 42 41 40 55 54 53 52 51 50 49 48 63 
62 61 60 59 58 57 56
+  4   5   6   7
+  7  6  5  4  3  2  1  0  15 14 13 12 11 10  9  8 23 22 21 20 19 18 17 16 31 
30 29 28 27 26 25 24
+  0   1   2   3
 
 Therefore, QUIRK_LITTLE_ENDIAN means that inside the memory region, every
 byte from each 4-byte word is placed at its mirrored position compared to
@@ -86,18 +93,22 @@ the boundary of that word.
 4. If QUIRK_MSB_ON_THE_RIGHT and QUIRK_LITTLE_ENDIAN are both set, we do it
like this:
 
-32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 
58 59 60 61 62 63
-4   5   6   7
-0  1  2  3  4  5  6  7  8   9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 
26 27 28 29 30 31
-0   1   2   3
+::
+
+  32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 
57 58 59 60 61

[PATCH] docs: ipmb: place it at driver-api and convert to ReST

2019-06-29 Thread Mauro Carvalho Chehab
No new doc should be added at the main Documentation/ directory.

Instead, new docs should be added as ReST files, within the
Kernel documentation body.

Fixes: 51bd6f291583 ("Add support for IPMB driver")
Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/driver-api/index.rst|  1 +
 .../{IPMB.txt => driver-api/ipmb.rst} | 62 ++-
 2 files changed, 33 insertions(+), 30 deletions(-)
 rename Documentation/{IPMB.txt => driver-api/ipmb.rst} (71%)

diff --git a/Documentation/driver-api/index.rst 
b/Documentation/driver-api/index.rst
index e33849b948c7..e49c34bf16c0 100644
--- a/Documentation/driver-api/index.rst
+++ b/Documentation/driver-api/index.rst
@@ -75,6 +75,7 @@ available subsections can be seen below.
dell_rbu
edid
eisa
+   ipmb
isa
isapnp
generic-counter
diff --git a/Documentation/IPMB.txt b/Documentation/driver-api/ipmb.rst
similarity index 71%
rename from Documentation/IPMB.txt
rename to Documentation/driver-api/ipmb.rst
index cd20c9764705..3ec3baed84c4 100644
--- a/Documentation/IPMB.txt
+++ b/Documentation/driver-api/ipmb.rst
@@ -32,11 +32,11 @@ This driver works with the I2C driver and a userspace
 program such as OpenIPMI:
 
 1) It is an I2C slave backend driver. So, it defines a callback
-function to set the Satellite MC as an I2C slave.
-This callback function handles the received IPMI requests.
+   function to set the Satellite MC as an I2C slave.
+   This callback function handles the received IPMI requests.
 
 2) It defines the read and write functions to enable a user
-space program (such as OpenIPMI) to communicate with the kernel.
+   space program (such as OpenIPMI) to communicate with the kernel.
 
 
 Load the IPMB driver
@@ -48,34 +48,35 @@ CONFIG_IPMB_DEVICE_INTERFACE=y
 
 1) If you want the driver to be loaded at boot time:
 
-a) Add this entry to your ACPI table, under the appropriate SMBus:
+a) Add this entry to your ACPI table, under the appropriate SMBus::
 
-Device (SMB0) // Example SMBus host controller
-{
-  Name (_HID, "") // Vendor-Specific HID
-  Name (_UID, 0) // Unique ID of particular host controller
-  :
-  :
-Device (IPMB)
-{
-  Name (_HID, "IPMB0001") // IPMB device interface
-  Name (_UID, 0) // Unique device identifier
-}
-}
+ Device (SMB0) // Example SMBus host controller
+ {
+ Name (_HID, "") // Vendor-Specific HID
+ Name (_UID, 0) // Unique ID of particular host controller
+ :
+ :
+   Device (IPMB)
+   {
+ Name (_HID, "IPMB0001") // IPMB device interface
+ Name (_UID, 0) // Unique device identifier
+   }
+ }
 
-b) Example for device tree:
+b) Example for device tree::
 
-&i2c2 {
- status = "okay";
+ &i2c2 {
+status = "okay";
 
- ipmb@10 {
- compatible = "ipmb-dev";
- reg = <0x10>;
- };
-};
+ipmb@10 {
+compatible = "ipmb-dev";
+reg = <0x10>;
+};
+ };
 
-2) Manually from Linux:
-modprobe ipmb-dev-int
+2) Manually from Linux::
+
+ modprobe ipmb-dev-int
 
 
 Instantiate the device
@@ -86,15 +87,16 @@ described in 'Documentation/i2c/instantiating-devices.rst'.
 If you have multiple BMCs, each connected to your Satellite MC via
 a different I2C bus, you can instantiate a device for each of
 those BMCs.
+
 The name of the instantiated device contains the I2C bus number
-associated with it as follows:
+associated with it as follows::
 
-BMC1 -- IPMB/I2C bus 1 -|   /dev/ipmb-1
+  BMC1 -- IPMB/I2C bus 1 -|   /dev/ipmb-1
Satellite MC
-BMC1 -- IPMB/I2C bus 2 -|   /dev/ipmb-2
+  BMC1 -- IPMB/I2C bus 2 -|   /dev/ipmb-2
 
 For instance, you can instantiate the ipmb-dev-int device from
-user space at the 7 bit address 0x10 on bus 2:
+user space at the 7 bit address 0x10 on bus 2::
 
   # echo ipmb-dev 0x1010 > /sys/bus/i2c/devices/i2c-2/new_device
 
-- 
2.21.0



Re: [PATCH] docs: packing: move it to core-api book and adjust markups

2019-06-29 Thread Mike Rapoport
On Sat, Jun 29, 2019 at 07:37:02AM -0300, Mauro Carvalho Chehab wrote:
> The packing.txt file was misplaced, as docs should be part of
> a documentation book, and not at the root dir.
> 
> So, move it to the core-api directory and add to its index.
> 
> Also, ensure that the file will be properly parsed and the bitmap
> ascii artwork will use a monotonic font.
> 
> Fixes: 554aae35007e ("lib: Add support for generic packing operations")
> Signed-off-by: Mauro Carvalho Chehab 

Reviewed-by: Mike Rapoport 

> ---
>  Documentation/core-api/index.rst  |  1 +
>  .../{packing.txt => core-api/packing.rst} | 81 +++
>  2 files changed, 50 insertions(+), 32 deletions(-)
>  rename Documentation/{packing.txt => core-api/packing.rst} (61%)
> 
> diff --git a/Documentation/core-api/index.rst 
> b/Documentation/core-api/index.rst
> index d1e5b95bf86d..aebb16d7771f 100644
> --- a/Documentation/core-api/index.rst
> +++ b/Documentation/core-api/index.rst
> @@ -25,6 +25,7 @@ Core utilities
> librs
> genalloc
> errseq
> +   packing
> printk-formats
> circular-buffers
> generic-radix-tree
> diff --git a/Documentation/packing.txt b/Documentation/core-api/packing.rst
> similarity index 61%
> rename from Documentation/packing.txt
> rename to Documentation/core-api/packing.rst
> index f830c98645f1..d8c341fe383e 100644
> --- a/Documentation/packing.txt
> +++ b/Documentation/core-api/packing.rst
> @@ -30,6 +30,7 @@ The solution
>  
> 
>  This API deals with 2 basic operations:
> +
>- Packing a CPU-usable number into a memory buffer (with hardware
>  constraints/quirks)
>- Unpacking a memory buffer (which has hardware constraints/quirks)
> @@ -49,10 +50,12 @@ What the examples show is where the logical bytes and 
> bits sit.
> 
>  1. Normally (no quirks), we would do it like this:
> 
> -63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 
> 38 37 36 35 34 33 32
> -7   6   54
> -31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10  9  8  7  
> 6  5  4  3  2  1  0
> -3   2   10
> +::
> +
> +  63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 
> 38 37 36 35 34 33 32
> +  7   6   54
> +  31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10  9  8  7 
>  6  5  4  3  2  1  0
> +  3   2   10
> 
>  That is, the MSByte (7) of the CPU-usable u64 sits at memory offset 0, and 
> the
>  LSByte (0) of the u64 sits at memory offset 7.
> @@ -63,10 +66,12 @@ comments as "logical" notation.
> 
>  2. If QUIRK_MSB_ON_THE_RIGHT is set, we do it like this:
> 
> -56 57 58 59 60 61 62 63 48 49 50 51 52 53 54 55 40 41 42 43 44 45 46 47 32 
> 33 34 35 36 37 38 39
> -7   65   4
> -24 25 26 27 28 29 30 31 16 17 18 19 20 21 22 23  8  9 10 11 12 13 14 15  0  
> 1  2  3  4  5  6  7
> -3   21   0
> +::
> +
> +  56 57 58 59 60 61 62 63 48 49 50 51 52 53 54 55 40 41 42 43 44 45 46 47 32 
> 33 34 35 36 37 38 39
> +  7   65   4
> +  24 25 26 27 28 29 30 31 16 17 18 19 20 21 22 23  8  9 10 11 12 13 14 15  0 
>  1  2  3  4  5  6  7
> +  3   21   0
> 
>  That is, QUIRK_MSB_ON_THE_RIGHT does not affect byte positioning, but
>  inverts bit offsets inside a byte.
> @@ -74,10 +79,12 @@ inverts bit offsets inside a byte.
> 
>  3. If QUIRK_LITTLE_ENDIAN is set, we do it like this:
> 
> -39 38 37 36 35 34 33 32 47 46 45 44 43 42 41 40 55 54 53 52 51 50 49 48 63 
> 62 61 60 59 58 57 56
> -4   5   6   7
> -7  6  5  4  3  2  1  0  15 14 13 12 11 10  9  8 23 22 21 20 19 18 17 16 31 
> 30 29 28 27 26 25 24
> -0   1   2   3
> +::
> +
> +  39 38 37 36 35 34 33 32 47 46 45 44 43 42 41 40 55 54 53 52 51 50 49 48 63 
> 62 61 60 59 58 57 56
> +  4   5   6   7
> +  7  6  5  4  3  2  1  0  15 14 13 12 11 10  9  8 23 22 21 20 19 18 17 16 31 
> 30 29 28 27 26 25 24
> +  0   1   2   3
> 
>  Therefore, QUIRK_LITTLE_ENDIAN means that inside the memory region, every
>  byte from each 4-byte word is placed at its mirrored position compared to
> @@ -86,18 +93,22 @@ the boundary of that word.
>  4. If QUIRK_MSB_ON_THE_RIGHT and QUIRK_LITTLE_ENDIAN are both set, we do it
> like this:
> 
> -32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 
> 57 58 59 60 61 62 63
> -4 

Re: [PATCH 3/5] docs: i2c: convert to ReST and add to driver-api bookset

2019-06-29 Thread Wolfram Sang
On Fri, Jun 28, 2019 at 06:23:14PM -0300, Mauro Carvalho Chehab wrote:
> Convert each file at I2C subsystem, renaming them to .rst and
> adding to the driver-api book.
> 
> Signed-off-by: Mauro Carvalho Chehab 

I glimpsed over it and it looks basically OK. I won't have time to
actually review all of this. But I trust you and we can fix things
later. So:

Acked-by: Wolfram Sang 

I assume this goes in via your or doc-tree?

>  Next/merge.log|   6 +-

This file doesn't exist upstream, though.



signature.asc
Description: PGP signature


Re: [PATCH 00/10] Intel(R) Speed Select Technology

2019-06-29 Thread Andy Shevchenko
On Thu, Jun 27, 2019 at 1:39 AM Srinivas Pandruvada
 wrote:
>
> Intel® Speed Select Technology (Intel® SST) — A powerful new collection of
> features giving more granular control over CPU performance for optimized total
> cost of ownership and performance. With Intel® SST, one server can be 
> configured
> for power and performance for variety of diverse workload requirements. In the
> Linux submission code. we are using ISST to specify Intel® SST to avoid 
> confusion
> with existing use of SST for "Smart Sound Technology".
>
> Refer to these links for overview of the technology released with some Intel® 
> Xeon®
> Scalable processor (5218N, 6230N, and 6252N):
> https://www.intel.com/content/www/us/en/architecture-and-technology/speed-select-technology-article.html
> https://builders.intel.com/docs/networkbuilders/intel-speed-select-technology-base-frequency-enhancing-performance.pdf
>
> The next generation of Intel® Xeon® processors are adding more features to the
> Intel® Speed Select Technology and allow dynamic configuration of these 
> features
> from OS-software level instead from BIOS. This submission is adding new 
> features
> and dynamic configuration capabilities .
>
>
> Intel SST Features:
>
> Intel® SST—Performance Profile (PP or perf-profile):
> This feature allows one server to be configured for different workload 
> requirements
> instead of deploying different servers based on the workload requirement 
> reducing total
> cost of ownership. With a single server deployed, the same server can be 
> reconfigured
> dynamically to one of the supported profiles to suit the specific workload 
> requirements.
> This feature introduces a mechanism that allows multiple optimized 
> performance profiles
> per system via static and/or dynamic adjustment of TDP level and other 
> performance
> parameters.
>
> Intel® SST—Core power (CP or core-power):
> An Interface that allows user to define per core priority. This defines a 
> mechanism
> to distribute power among cores when there is a power constrained scenario. 
> This defines
> a class of service configuration. Each CPU core can be tied to a class of 
> service and hence
> an associated priority.
>
> Intel® SST—Base Frequency (BF or base-freq):
> The Intel® SST-BF feature lets user control and direct base frequency. If 
> some critical
> workload threads demand constant high guaranteed performance, then this 
> feature can be
> used to execute the thread at higher base frequency on specific set of CPUs.
>
> Intel® SST—Turbo frequency (TF or turbo-freq):
> Enables the ability to set different all core turbo ratio limits to cores 
> based on the priority.
> Using this features some cores can be configured to get higher turbo 
> frequency by designating
> them as high priority at the cost of lower or no turbo frequency on the low 
> priority cores.
>
> Implementation
>
> The Intel® SST features are implemented in the firmware executing in the the 
> power
> management unit (we are calling PUNIT here for short). The mechanism to 
> control these
> features are specific to firmware implementation for Intel® Xeon® CPUs and 
> are not architectural
> features. The interface mechanism and semantics of the messages can change in 
> future Xeon
> CPUs. Hence there is minimal kernel implementation by offering direct 
> communication
> to PUNIT via set of IOCTLs. The actual messages which can be sent to PUNIT 
> are specified
> in the following document link:
>
> https://github.com/intel/CommsPowerManagement/blob/master/intel_sst_os_interface/mailbox.md
>
> The idea here is that user space software like cloud orchestration software 
> based on their workload
> requirement configure the system. There is a full featured "Intel Speed 
> Select" utility
> submitted to kernel power tools, which can be used to validate and exercise 
> the features.
>
> Types of PUNIT interfaces
> There are two types of interfaces. One using Mail box communications, which 
> is facilitated
> by a PCI device or in some Xeon® CPUs using MSRs; and other using an MMIO 
> interface, which is
> used primarily for core prioritization. For hiding details a single character 
> device is created
> to handle IOCTLs. The following block diagram shows the implementation 
> overview.
>
>
> UserUser Space tool(intel-speed-select)/Cloud Orchestration 
> software
>IOCTLs
> ---character 
> device--
> kernel  Common driver handling IOCTLs
> Mail Box drivers(PCI & MSR) PCI MMIO driver
> --
> HardwarePUNIT
>
>
>

Pushed to my review and testing queue, thanks!

> Srinivas Pandruvada (10):
>   platform/x86: ISST: Update ioctl-number.txt for Intel Speed Select
> interface
>   platform/x86: ISST: Add common API to register and ha

Re: [PATCH 10/10] tools/power/x86: A tool to validate Intel Speed Select commands

2019-06-29 Thread Andy Shevchenko
On Thu, Jun 27, 2019 at 1:39 AM Srinivas Pandruvada
 wrote:
>
> The Intel(R) Speed select technologies contains four features.
>
> Performance profile:An non architectural mechanism that allows multiple
> optimized performance profiles per system via static and/or dynamic
> adjustment of core count, workload, Tjmax, and TDP, etc. aka ISS
> in the documentation.
>
> Base Frequency: Enables users to increase guaranteed base frequency on
> certain cores (high priority cores) in exchange for lower base frequency
> on remaining cores (low priority cores). aka PBF in the documenation.
>
> Turbo frequency: Enables the ability to set different turbo ratio limits
> to cores based on priority. aka FACT in the documentation.
>
> Core power: An Interface that allows user to define per core/tile
> priority.
>
> There is a multi level help for commands and options. This can be used
> to check required arguments for each feature and commands for the
> feature.
>
> To start navigating the features start with
>
> $sudo intel-speed-select --help
>
> For help on a specific feature for example
> $sudo intel-speed-select perf-profile --help
>
> To get help for a command for a feature for example
> $sudo intel-speed-select perf-profile get-lock-status --help
>

I need an Ack from tools/power maintainer(s) for this.
Also see below.

> Signed-off-by: Srinivas Pandruvada 
> ---
>  tools/power/x86/intel_speed_select/Makefile   |   31 +
>  tools/power/x86/intel_speed_select/isst.h |  231 +++
>  .../x86/intel_speed_select/isst_config.c  | 1607 +
>  .../power/x86/intel_speed_select/isst_core.c  |  721 
>  .../x86/intel_speed_select/isst_display.c |  479 +
>  5 files changed, 3069 insertions(+)
>  create mode 100644 tools/power/x86/intel_speed_select/Makefile
>  create mode 100644 tools/power/x86/intel_speed_select/isst.h
>  create mode 100644 tools/power/x86/intel_speed_select/isst_config.c
>  create mode 100644 tools/power/x86/intel_speed_select/isst_core.c
>  create mode 100644 tools/power/x86/intel_speed_select/isst_display.c
>
> diff --git a/tools/power/x86/intel_speed_select/Makefile 
> b/tools/power/x86/intel_speed_select/Makefile
> new file mode 100644
> index ..8363450115e2
> --- /dev/null
> +++ b/tools/power/x86/intel_speed_select/Makefile

My experience with some tools are not good in order of their build process.
Can this one use tools build infrastructure from the day 1?

> @@ -0,0 +1,31 @@
> +# SPDX-License-Identifier: GPL-2.0
> +CC = $(CROSS_COMPILE)gcc
> +BUILD_OUTPUT   := $(CURDIR)
> +PREFIX ?= /usr
> +DESTDIR?=
> +
> +override CFLAGS += -D__EXPORTED_HEADERS__ -Wall -D_GNU_SOURCE
> +override CFLAGS += -I$(CURDIR)/../../../../include/uapi/
> +override CFLAGS += -I$(CURDIR)/../../../../include/
> +
> +%: %.c
> +   @mkdir -p $(BUILD_OUTPUT)
> +   $(CC) $(CFLAGS) $< -o $(BUILD_OUTPUT)/$@ $(LDFLAGS)
> +
> +DEPS = isst.h
> +OBJ = isst_config.o isst_core.o isst_display.o
> +
> +%.o: %.c $(DEPS)
> +   $(CC) -c -o $(BUILD_OUTPUT)/$@ $< $(CFLAGS)
> +
> +intel-speed-select: $(OBJ)
> +   $(CC) -o $(BUILD_OUTPUT)/$@ $^ $(CFLAGS)
> +
> +.PHONY : clean
> +clean :
> +   @rm -f $(BUILD_OUTPUT)/intel-speed-select
> +   @rm -f $(BUILD_OUTPUT)/*.o
> +
> +install : intel-speed-select
> +   install -d $(DESTDIR)$(PREFIX)/sbin
> +   install $(BUILD_OUTPUT)/intel-speed-select 
> $(DESTDIR)$(PREFIX)/sbin/intel-speed-select
> diff --git a/tools/power/x86/intel_speed_select/isst.h 
> b/tools/power/x86/intel_speed_select/isst.h
> new file mode 100644
> index ..221881761609
> --- /dev/null
> +++ b/tools/power/x86/intel_speed_select/isst.h
> @@ -0,0 +1,231 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +/*
> + * Intel Speed Select -- Enumerate and control features
> + * Copyright (c) 2019 Intel Corporation.
> + */
> +
> +#ifndef _ISST_H_
> +#define _ISST_H_
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +#include 
> +
> +#define BIT(x) (1 << (x))
> +#define GENMASK(h, l) (((~0UL) << (l)) & (~0UL >> (sizeof(long) * 8 - 1 - 
> (h
> +#define GENMASK_ULL(h, l)
>   \
> +   (((~0ULL) << (l)) & (~0ULL >> (sizeof(long long) * 8 - 1 - (h
> +
> +#define CONFIG_TDP 0x7f
> +#define CONFIG_TDP_GET_LEVELS_INFO 0x00
> +#define CONFIG_TDP_GET_TDP_CONTROL 0x01
> +#define CONFIG_TDP_SET_TDP_CONTROL 0x02
> +#define CONFIG_TDP_GET_TDP_INFO0x03
> +#define CONFIG_TDP_GET_PWR_INFO0x04
> +#define CONFIG_TDP_GET_TJMAX_INFO  0x05
> +#define CONFIG_TDP_GET_CORE_MASK   0x06
> +#define CONFIG_TDP_GET_TURBO_LIMIT_RATIOS  0x07
> +#define CONFIG_TDP_SET_LEV

[PATCH v4] Documentation:sh:convert register-banks.txt and new-machine.txt to rst format.

2019-06-29 Thread Vandana BN
This patch converts new-machine.txt and register-banks.txt
to ReST format, No content change.
Added interfaces.rst to contain kernel-doc markups from index.rst
Added interfaces.rst,new-machine.rst and register-banks.rst to sh/index.rst
Added SPDX tag in index.rst

Signed-off-by: Vandana BN 
---
 Documentation/sh/index.rst|  65 +--
 Documentation/sh/interface.rst|  59 ++
 .../sh/{new-machine.txt => new-machine.rst}   | 171 +-
 ...{register-banks.txt => register-banks.rst} |   8 +-
 4 files changed, 163 insertions(+), 140 deletions(-)
 create mode 100644 Documentation/sh/interface.rst
 rename Documentation/sh/{new-machine.txt => new-machine.rst} (79%)
 rename Documentation/sh/{register-banks.txt => register-banks.rst} (90%)

diff --git a/Documentation/sh/index.rst b/Documentation/sh/index.rst
index bc8db7ba894a..fec3c405b6b9 100644
--- a/Documentation/sh/index.rst
+++ b/Documentation/sh/index.rst
@@ -1,59 +1,14 @@
-===
-SuperH Interfaces Guide
-===
+.. SPDX-License-Identifier: GPL-2.0

-:Author: Paul Mundt
-
-Memory Management
-=
-
-SH-4
-
-
-Store Queue API
-~~~
-
-.. kernel-doc:: arch/sh/kernel/cpu/sh4/sq.c
-   :export:
-
-SH-5
-
-
-TLB Interfaces
-~~
-
-.. kernel-doc:: arch/sh/mm/tlb-sh5.c
-   :internal:
-
-.. kernel-doc:: arch/sh/include/asm/tlb_64.h
-   :internal:
+
+SuperH Documentation
+

-Machine Specific Interfaces
-===
-
-mach-dreamcast
---
-
-.. kernel-doc:: arch/sh/boards/mach-dreamcast/rtc.c
-   :internal:
-
-mach-x3proto
-
-
-.. kernel-doc:: arch/sh/boards/mach-x3proto/ilsel.c
-   :export:
-
-Busses
-==
-
-SuperHyway
---
-
-.. kernel-doc:: drivers/sh/superhyway/superhyway.c
-   :export:
+:Author: Paul Mundt

-Maple
--
+.. toctree::
+   :maxdepth: 2

-.. kernel-doc:: drivers/sh/maple/maple.c
-   :export:
+   interface
+   new-machine
+   register-banks
diff --git a/Documentation/sh/interface.rst b/Documentation/sh/interface.rst
new file mode 100644
index ..bc8db7ba894a
--- /dev/null
+++ b/Documentation/sh/interface.rst
@@ -0,0 +1,59 @@
+===
+SuperH Interfaces Guide
+===
+
+:Author: Paul Mundt
+
+Memory Management
+=
+
+SH-4
+
+
+Store Queue API
+~~~
+
+.. kernel-doc:: arch/sh/kernel/cpu/sh4/sq.c
+   :export:
+
+SH-5
+
+
+TLB Interfaces
+~~
+
+.. kernel-doc:: arch/sh/mm/tlb-sh5.c
+   :internal:
+
+.. kernel-doc:: arch/sh/include/asm/tlb_64.h
+   :internal:
+
+Machine Specific Interfaces
+===
+
+mach-dreamcast
+--
+
+.. kernel-doc:: arch/sh/boards/mach-dreamcast/rtc.c
+   :internal:
+
+mach-x3proto
+
+
+.. kernel-doc:: arch/sh/boards/mach-x3proto/ilsel.c
+   :export:
+
+Busses
+==
+
+SuperHyway
+--
+
+.. kernel-doc:: drivers/sh/superhyway/superhyway.c
+   :export:
+
+Maple
+-
+
+.. kernel-doc:: drivers/sh/maple/maple.c
+   :export:
diff --git a/Documentation/sh/new-machine.txt b/Documentation/sh/new-machine.rst
similarity index 79%
rename from Documentation/sh/new-machine.txt
rename to Documentation/sh/new-machine.rst
index e0961a66130b..b16c33342642 100644
--- a/Documentation/sh/new-machine.txt
+++ b/Documentation/sh/new-machine.rst
@@ -1,8 +1,8 @@
+
+Adding a new board to LinuxSH
+

-Adding a new board to LinuxSH
-   
-
-   Paul Mundt 
+Paul Mundt 

 This document attempts to outline what steps are necessary to add support
 for new boards to the LinuxSH port under the new 2.5 and 2.6 kernels. This
@@ -19,65 +19,67 @@ include/asm-sh/. For the new kernel, things are broken out 
by board type,
 companion chip type, and CPU type. Looking at a tree view of this directory
 hierarchy looks like the following:

-Board-specific code:
-
-.
-|-- arch
-|   `-- sh
-|   `-- boards
-|   |-- adx
-|   |   `-- board-specific files
-|   |-- bigsur
-|   |   `-- board-specific files
-|   |
-|   ... more boards here ...
-|
-`-- include
-`-- asm-sh
-|-- adx
-|   `-- board-specific headers
-|-- bigsur
-|   `-- board-specific headers
-|
-   .. more boards here ...
-
-Next, for companion chips:
-.
-`-- arch
-`-- sh
-`-- cchips
-`-- hd6446x
-`-- hd64461
-`-- cchip-specific files
+Board-specific code::
+
+ .
+ |-- arch
+ |   `-- sh
+ |   `-- boards
+ |   |-- adx
+ |   |   `-- board-specific files
+ |   |-- bigsur
+ |   |   `-- board-specific files
+ |   |
+ |   ... more boards here ...
+ |
+ `-- include
+ `-- asm-sh
+ |-- adx
+ |   `-- board-specific hea

Re: [PATCH v4] Documentation:sh:convert register-banks.txt and new-machine.txt to rst format.

2019-06-29 Thread Mauro Carvalho Chehab
Em Sat, 29 Jun 2019 20:02:45 +0530
Vandana BN  escreveu:

> This patch converts new-machine.txt and register-banks.txt
> to ReST format, No content change.
> Added interfaces.rst to contain kernel-doc markups from index.rst
> Added interfaces.rst,new-machine.rst and register-banks.rst to sh/index.rst
> Added SPDX tag in index.rst
> 
> Signed-off-by: Vandana BN 

Looks good to me. Just a final thing to do.

Be sure to run:

./scripts/documentation-file-ref-check

in order to check that you're not breaking any references to the file.
If it breaks, please adjust the reference to reflect the file
rename.

After fixing the broken reference, feel free do add:

Reviewed-by: Mauro Carvalho Chehab 

> ---
>  Documentation/sh/index.rst|  65 +--
>  Documentation/sh/interface.rst|  59 ++
>  .../sh/{new-machine.txt => new-machine.rst}   | 171 +-
>  ...{register-banks.txt => register-banks.rst} |   8 +-
>  4 files changed, 163 insertions(+), 140 deletions(-)
>  create mode 100644 Documentation/sh/interface.rst
>  rename Documentation/sh/{new-machine.txt => new-machine.rst} (79%)
>  rename Documentation/sh/{register-banks.txt => register-banks.rst} (90%)
> 
> diff --git a/Documentation/sh/index.rst b/Documentation/sh/index.rst
> index bc8db7ba894a..fec3c405b6b9 100644
> --- a/Documentation/sh/index.rst
> +++ b/Documentation/sh/index.rst
> @@ -1,59 +1,14 @@
> -===
> -SuperH Interfaces Guide
> -===
> +.. SPDX-License-Identifier: GPL-2.0
> 
> -:Author: Paul Mundt
> -
> -Memory Management
> -=
> -
> -SH-4
> -
> -
> -Store Queue API
> -~~~
> -
> -.. kernel-doc:: arch/sh/kernel/cpu/sh4/sq.c
> -   :export:
> -
> -SH-5
> -
> -
> -TLB Interfaces
> -~~
> -
> -.. kernel-doc:: arch/sh/mm/tlb-sh5.c
> -   :internal:
> -
> -.. kernel-doc:: arch/sh/include/asm/tlb_64.h
> -   :internal:
> +
> +SuperH Documentation
> +
> 
> -Machine Specific Interfaces
> -===
> -
> -mach-dreamcast
> ---
> -
> -.. kernel-doc:: arch/sh/boards/mach-dreamcast/rtc.c
> -   :internal:
> -
> -mach-x3proto
> -
> -
> -.. kernel-doc:: arch/sh/boards/mach-x3proto/ilsel.c
> -   :export:
> -
> -Busses
> -==
> -
> -SuperHyway
> ---
> -
> -.. kernel-doc:: drivers/sh/superhyway/superhyway.c
> -   :export:
> +:Author: Paul Mundt
> 
> -Maple
> --
> +.. toctree::
> +   :maxdepth: 2
> 
> -.. kernel-doc:: drivers/sh/maple/maple.c
> -   :export:
> +   interface
> +   new-machine
> +   register-banks
> diff --git a/Documentation/sh/interface.rst b/Documentation/sh/interface.rst
> new file mode 100644
> index ..bc8db7ba894a
> --- /dev/null
> +++ b/Documentation/sh/interface.rst
> @@ -0,0 +1,59 @@
> +===
> +SuperH Interfaces Guide
> +===
> +
> +:Author: Paul Mundt
> +
> +Memory Management
> +=
> +
> +SH-4
> +
> +
> +Store Queue API
> +~~~
> +
> +.. kernel-doc:: arch/sh/kernel/cpu/sh4/sq.c
> +   :export:
> +
> +SH-5
> +
> +
> +TLB Interfaces
> +~~
> +
> +.. kernel-doc:: arch/sh/mm/tlb-sh5.c
> +   :internal:
> +
> +.. kernel-doc:: arch/sh/include/asm/tlb_64.h
> +   :internal:
> +
> +Machine Specific Interfaces
> +===
> +
> +mach-dreamcast
> +--
> +
> +.. kernel-doc:: arch/sh/boards/mach-dreamcast/rtc.c
> +   :internal:
> +
> +mach-x3proto
> +
> +
> +.. kernel-doc:: arch/sh/boards/mach-x3proto/ilsel.c
> +   :export:
> +
> +Busses
> +==
> +
> +SuperHyway
> +--
> +
> +.. kernel-doc:: drivers/sh/superhyway/superhyway.c
> +   :export:
> +
> +Maple
> +-
> +
> +.. kernel-doc:: drivers/sh/maple/maple.c
> +   :export:
> diff --git a/Documentation/sh/new-machine.txt 
> b/Documentation/sh/new-machine.rst
> similarity index 79%
> rename from Documentation/sh/new-machine.txt
> rename to Documentation/sh/new-machine.rst
> index e0961a66130b..b16c33342642 100644
> --- a/Documentation/sh/new-machine.txt
> +++ b/Documentation/sh/new-machine.rst
> @@ -1,8 +1,8 @@
> +
> +Adding a new board to LinuxSH
> +
> 
> -Adding a new board to LinuxSH
> -   
> -
> -   Paul Mundt 
> +Paul Mundt 
> 
>  This document attempts to outline what steps are necessary to add support
>  for new boards to the LinuxSH port under the new 2.5 and 2.6 kernels. This
> @@ -19,65 +19,67 @@ include/asm-sh/. For the new kernel, things are broken 
> out by board type,
>  companion chip type, and CPU type. Looking at a tree view of this directory
>  hierarchy looks like the following:
> 
> -Board-specific code:
> -
> -.
> -|-- arch
> -|   `-- sh
> -|   `-- boards
> -|   |-- adx
> -|   |   `-- board-specific files
> -|   |-- bigsur
> -|   |   `-- board

Re: [PATCH 10/10] tools/power/x86: A tool to validate Intel Speed Select commands

2019-06-29 Thread Srinivas Pandruvada
On Sat, 2019-06-29 at 17:31 +0300, Andy Shevchenko wrote:
> On Thu, Jun 27, 2019 at 1:39 AM Srinivas Pandruvada
>  wrote:
> > 
> > The Intel(R) Speed select technologies contains four features.
> > 
> > Performance profile:An non architectural mechanism that allows
> > multiple
> > optimized performance profiles per system via static and/or dynamic
> > adjustment of core count, workload, Tjmax, and TDP, etc. aka ISS
> > in the documentation.
> > 
> > Base Frequency: Enables users to increase guaranteed base frequency
> > on
> > certain cores (high priority cores) in exchange for lower base
> > frequency
> > on remaining cores (low priority cores). aka PBF in the
> > documenation.
> > 
> > Turbo frequency: Enables the ability to set different turbo ratio
> > limits
> > to cores based on priority. aka FACT in the documentation.
> > 
> > Core power: An Interface that allows user to define per core/tile
> > priority.
> > 
> > There is a multi level help for commands and options. This can be
> > used
> > to check required arguments for each feature and commands for the
> > feature.
> > 
> > To start navigating the features start with
> > 
> > $sudo intel-speed-select --help
> > 
> > For help on a specific feature for example
> > $sudo intel-speed-select perf-profile --help
> > 
> > To get help for a command for a feature for example
> > $sudo intel-speed-select perf-profile get-lock-status --help
> > 
> 
> I need an Ack from tools/power maintainer(s) for this.
> Also see below.
MAINTAINER file doesn't call for any special name in this folder.
$./scripts/get_maintainer.pl 0010-tools-power-x86-A-tool-to-validate-
Intel-Speed-Selec.patch 
Srinivas Pandruvada 
(commit_signer:1/1=100%,authored:1/1=100%,added_lines:31/31=100%,added_
lines:231/231=100%,added_lines:1607/1607=100%,added_lines:721/721=100%,
added_lines:479/479=100%)
linux-ker...@vger.kernel.org (open list)

Len and Rafael can you ACK this tool patch?

> 
> > Signed-off-by: Srinivas Pandruvada <
> > srinivas.pandruv...@linux.intel.com>
> > ---
> >  tools/power/x86/intel_speed_select/Makefile   |   31 +
> >  tools/power/x86/intel_speed_select/isst.h |  231 +++
> >  .../x86/intel_speed_select/isst_config.c  | 1607
> > +
> >  .../power/x86/intel_speed_select/isst_core.c  |  721 
> >  .../x86/intel_speed_select/isst_display.c |  479 +
> >  5 files changed, 3069 insertions(+)
> >  create mode 100644 tools/power/x86/intel_speed_select/Makefile
> >  create mode 100644 tools/power/x86/intel_speed_select/isst.h
> >  create mode 100644
> > tools/power/x86/intel_speed_select/isst_config.c
> >  create mode 100644 tools/power/x86/intel_speed_select/isst_core.c
> >  create mode 100644
> > tools/power/x86/intel_speed_select/isst_display.c
> > 
> > diff --git a/tools/power/x86/intel_speed_select/Makefile
> > b/tools/power/x86/intel_speed_select/Makefile
> > new file mode 100644
> > index ..8363450115e2
> > --- /dev/null
> > +++ b/tools/power/x86/intel_speed_select/Makefile
> 
> My experience with some tools are not good in order of their build
> process.
> Can this one use tools build infrastructure from the day 1?
Can you give some pointers?

Thanks,
Srinivas

> 
> > @@ -0,0 +1,31 @@
> > +# SPDX-License-Identifier: GPL-2.0
> > +CC = $(CROSS_COMPILE)gcc
> > +BUILD_OUTPUT   := $(CURDIR)
> > +PREFIX ?= /usr
> > +DESTDIR?=
> > +
> > +override CFLAGS += -D__EXPORTED_HEADERS__ -Wall -D_GNU_SOURCE
> > +override CFLAGS += -I$(CURDIR)/../../../../include/uapi/
> > +override CFLAGS += -I$(CURDIR)/../../../../include/
> > +
> > +%: %.c
> > +   @mkdir -p $(BUILD_OUTPUT)
> > +   $(CC) $(CFLAGS) $< -o $(BUILD_OUTPUT)/$@ $(LDFLAGS)
> > +
> > +DEPS = isst.h
> > +OBJ = isst_config.o isst_core.o isst_display.o
> > +
> > +%.o: %.c $(DEPS)
> > +   $(CC) -c -o $(BUILD_OUTPUT)/$@ $< $(CFLAGS)
> > +
> > +intel-speed-select: $(OBJ)
> > +   $(CC) -o $(BUILD_OUTPUT)/$@ $^ $(CFLAGS)
> > +
> > +.PHONY : clean
> > +clean :
> > +   @rm -f $(BUILD_OUTPUT)/intel-speed-select
> > +   @rm -f $(BUILD_OUTPUT)/*.o
> > +
> > +install : intel-speed-select
> > +   install -d $(DESTDIR)$(PREFIX)/sbin
> > +   install $(BUILD_OUTPUT)/intel-speed-select
> > $(DESTDIR)$(PREFIX)/sbin/intel-speed-select
> > diff --git a/tools/power/x86/intel_speed_select/isst.h
> > b/tools/power/x86/intel_speed_select/isst.h
> > new file mode 100644
> > index ..221881761609
> > --- /dev/null
> > +++ b/tools/power/x86/intel_speed_select/isst.h
> > @@ -0,0 +1,231 @@
> > +/* SPDX-License-Identifier: GPL-2.0 */
> > +/*
> > + * Intel Speed Select -- Enumerate and control features
> > + * Copyright (c) 2019 Intel Corporation.
> > + */
> > +
> > +#ifndef _ISST_H_
> > +#define _ISST_H_
> > +
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include

Re: [PATCH v1] Doc : fs : convert xfs.txt to ReST

2019-06-29 Thread Sheriff Esseson
On Sat, Jun 29, 2019 at 02:25:08AM +0100, Sheriff Esseson wrote:
> On Fri, Jun 28, 2019 at 10:43:24PM +0100, Sheriff Esseson wrote:
> > Convert xfs.txt to ReST, markup and rename accordingly. Update
> > Documentation/index.rst.
> > 
> > While at it, make "value" in "option=value" form xfs options definable 
> > by
> > the user, by embedding in angle "<>" brackets, rather than something
> > predifined elsewhere. This is inline with the conventions in manuals.
> > 
> > Also, make defaults of boolean options prefixed with "(*)". This is
> > so that options can be compressed to "[no]option" and on a single line, 
> > which renders
> > consistently and nicely in htmldocs.
> > lastly, enforce a "one option, one definition" policy to keep things
> > consistent and simple.
> > 
> > Signed-off-by: Sheriff Esseson 
> > ---
> > -- 
> > 2.22.0
> > 
> 
> Rid Documentation/filesystems/index.rst of ".rst" in toc-tree references.
> 
> CC xfs-list.
> 
> Correct email indentation.
> 
> Signed-off-by: Sheriff Esseson 
> ---
> -- 
> 2.22.0
> 

Signed-off-by: Sheriff Esseson 
---

In v2:
Update MAINTAINERS.
fix indentation/long lines issues.
cc Darick and xfs mailing list.

 Documentation/filesystems/index.rst |   5 +-
 Documentation/filesystems/xfs.rst   | 467 +++
 Documentation/filesystems/xfs.txt   | 470 
 MAINTAINERS |   2 +-
 4 files changed, 471 insertions(+), 473 deletions(-)
 create mode 100644 Documentation/filesystems/xfs.rst
 delete mode 100644 Documentation/filesystems/xfs.txt

diff --git a/Documentation/filesystems/index.rst 
b/Documentation/filesystems/index.rst
index 1131c34d7..a4cf5fca4 100644
--- a/Documentation/filesystems/index.rst
+++ b/Documentation/filesystems/index.rst
@@ -16,7 +16,7 @@ algorithms work.
 .. toctree::
:maxdepth: 2
 
-   path-lookup.rst
+   path-lookup
api-summary
splice
 
@@ -40,4 +40,5 @@ Documentation for individual filesystem types can be found 
here.
 .. toctree::
:maxdepth: 2
 
-   binderfs.rst
+   binderfs
+   xfs
diff --git a/Documentation/filesystems/xfs.rst 
b/Documentation/filesystems/xfs.rst
new file mode 100644
index 0..f52046b96
--- /dev/null
+++ b/Documentation/filesystems/xfs.rst
@@ -0,0 +1,467 @@
+==
+The SGI XFS Filesystem
+==
+
+XFS is a high performance journaling filesystem which originated
+on the SGI IRIX platform.  It is completely multi-threaded, can
+support large files and large filesystems, extended attributes,
+variable block sizes, is extent based, and makes extensive use of
+Btrees (directories, extents, free space) to aid both performance
+and scalability.
+
+Refer to the documentation at https://xfs.wiki.kernel.org/
+for further details.  This implementation is on-disk compatible
+with the IRIX version of XFS.
+
+
+Mount Options
+=
+
+When mounting an XFS filesystem, the following options are accepted.  For
+boolean mount options, the names with the "(*)" prefix is the default 
behaviour.
+For example, take a behaviour enabled by default to be a one (1) or, a zero (0)
+otherwise, ``(*)[no]default`` would be 0 while ``[no](*)default`` , a 1.
+
+   allocsize=
+Sets the buffered I/O end-of-file preallocation size when doing delayed
+allocation writeout (default size is 64KiB).  Valid values for this
+option are page size (typically 4KiB) through to 1GiB, inclusive, in
+power-of-2 increments.
+
+The default behaviour is for dynamic end-of-file preallocation size,
+which uses a set of heuristics to optimise the preallocation size based
+on the current allocation patterns within the file and the access
+patterns to the file. Specifying a fixed allocsize value turns off the
+dynamic behaviour.
+
+   [no]attr2
+The options enable/disable an "opportunistic" improvement to be made in
+the way inline extended attributes are stored on-disk.  When the new
+form is used for the first time when ``attr2`` is selected (either when
+setting or removing extended attributes) the on-disk superblock feature
+bit field will be updated to reflect this format being in use.
+
+The default behaviour is determined by the on-disk feature bit
+indicating that ``attr2`` behaviour is active. If either mount option 
is
+set, then that becomes the new default used by the filesystem. However
+on CRC enabled filesystems, the ``attr2`` format is always used , and 
so
+will reject the ``noattr2`` mount option if it is set.
+
+   (*)[no]discard
+Enable/disable the issuing of commands to let the block device reclaim
+space freed by the filesystem.  This is useful for SSD devices, thinly
+provisioned LUNs and virtual machine images, but may have a performance
+impact.
+
+Note: It is currently recommended that you

Re: [PATCH v7 1/2] fTPM: firmware TPM running in TEE

2019-06-29 Thread Sasha Levin

On Thu, Jun 27, 2019 at 02:31:35AM +0300, Jarkko Sakkinen wrote:

On Tue, 2019-06-25 at 16:13 -0400, Sasha Levin wrote:

+static const uuid_t ftpm_ta_uuid =
+   UUID_INIT(0xBC50D971, 0xD4C9, 0x42C4,
+ 0x82, 0xCB, 0x34, 0x3F, 0xB7, 0xF3, 0x78, 0x96);
+
+/**
+ * ftpm_tee_tpm_op_recv - retrieve fTPM response.
+ *


Should not have an empty line here.


+ * @chip: the tpm_chip description as specified in driver/char/tpm/tpm.h.
+ * @buf: the buffer to store data.
+ * @count: the number of bytes to read.


Jarkko, w.r.t your comment above, there is an empty line between the
function name and variables in drivers/char/tpm, and in particular
tpm_crb.c which you authored and I used as reference. Do you want us to
diverge here?

--
Thanks,
Sasha


Re: [PATCH v1] Doc : fs : convert xfs.txt to ReST

2019-06-29 Thread Sheriff Esseson
On Sat, Jun 29, 2019 at 03:54:33PM +0100, Sheriff Esseson wrote:
> On Sat, Jun 29, 2019 at 02:25:08AM +0100, Sheriff Esseson wrote:
> > On Fri, Jun 28, 2019 at 10:43:24PM +0100, Sheriff Esseson wrote:
> > >   Convert xfs.txt to ReST, markup and rename accordingly. Update
> > >   Documentation/index.rst.
> > >   
> > >   While at it, make "value" in "option=value" form xfs options definable 
> > > by
> > >   the user, by embedding in angle "<>" brackets, rather than something
> > >   predifined elsewhere. This is inline with the conventions in manuals.
> > >   
> > >   Also, make defaults of boolean options prefixed with "(*)". This is
> > >   so that options can be compressed to "[no]option" and on a single line, 
> > > which renders
> > >   consistently and nicely in htmldocs.
> > >   lastly, enforce a "one option, one definition" policy to keep things
> > >   consistent and simple.
> > > 
> > > Signed-off-by: Sheriff Esseson 
> > > ---
> > > -- 
> > > 2.22.0
> > > 
> > 
> > Rid Documentation/filesystems/index.rst of ".rst" in toc-tree references.
> > 
> > CC xfs-list.
> > 
> > Correct email indentation.
> > 
> > Signed-off-by: Sheriff Esseson 
> > ---
> > -- 
> > 2.22.0
> > 
> 
> Signed-off-by: Sheriff Esseson 
> ---
> 
> In v2:
> Update MAINTAINERS.
> fix indentation/long lines issues.
> cc Darick and xfs mailing list.
> 
> -- 
> 2.22.0
> 

Signed-off-by: Sheriff Esseson 
---

In v2.1:
cc mentees list.

 Documentation/filesystems/index.rst |   5 +-
 Documentation/filesystems/xfs.rst   | 467 +++
 Documentation/filesystems/xfs.txt   | 470 
 MAINTAINERS |   2 +-
 4 files changed, 471 insertions(+), 473 deletions(-)
 create mode 100644 Documentation/filesystems/xfs.rst
 delete mode 100644 Documentation/filesystems/xfs.txt

diff --git a/Documentation/filesystems/index.rst 
b/Documentation/filesystems/index.rst
index 1131c34d7..a4cf5fca4 100644
--- a/Documentation/filesystems/index.rst
+++ b/Documentation/filesystems/index.rst
@@ -16,7 +16,7 @@ algorithms work.
 .. toctree::
:maxdepth: 2
 
-   path-lookup.rst
+   path-lookup
api-summary
splice
 
@@ -40,4 +40,5 @@ Documentation for individual filesystem types can be found 
here.
 .. toctree::
:maxdepth: 2
 
-   binderfs.rst
+   binderfs
+   xfs
diff --git a/Documentation/filesystems/xfs.rst 
b/Documentation/filesystems/xfs.rst
new file mode 100644
index 0..f52046b96
--- /dev/null
+++ b/Documentation/filesystems/xfs.rst
@@ -0,0 +1,467 @@
+==
+The SGI XFS Filesystem
+==
+
+XFS is a high performance journaling filesystem which originated
+on the SGI IRIX platform.  It is completely multi-threaded, can
+support large files and large filesystems, extended attributes,
+variable block sizes, is extent based, and makes extensive use of
+Btrees (directories, extents, free space) to aid both performance
+and scalability.
+
+Refer to the documentation at https://xfs.wiki.kernel.org/
+for further details.  This implementation is on-disk compatible
+with the IRIX version of XFS.
+
+
+Mount Options
+=
+
+When mounting an XFS filesystem, the following options are accepted.  For
+boolean mount options, the names with the "(*)" prefix is the default 
behaviour.
+For example, take a behaviour enabled by default to be a one (1) or, a zero (0)
+otherwise, ``(*)[no]default`` would be 0 while ``[no](*)default`` , a 1.
+
+   allocsize=
+Sets the buffered I/O end-of-file preallocation size when doing delayed
+allocation writeout (default size is 64KiB).  Valid values for this
+option are page size (typically 4KiB) through to 1GiB, inclusive, in
+power-of-2 increments.
+
+The default behaviour is for dynamic end-of-file preallocation size,
+which uses a set of heuristics to optimise the preallocation size based
+on the current allocation patterns within the file and the access
+patterns to the file. Specifying a fixed allocsize value turns off the
+dynamic behaviour.
+
+   [no]attr2
+The options enable/disable an "opportunistic" improvement to be made in
+the way inline extended attributes are stored on-disk.  When the new
+form is used for the first time when ``attr2`` is selected (either when
+setting or removing extended attributes) the on-disk superblock feature
+bit field will be updated to reflect this format being in use.
+
+The default behaviour is determined by the on-disk feature bit
+indicating that ``attr2`` behaviour is active. If either mount option 
is
+set, then that becomes the new default used by the filesystem. However
+on CRC enabled filesystems, the ``attr2`` format is always used , and 
so
+will reject the ``noattr2`` mount option if it is set.
+
+   (*)[no]discard
+Enable/disable the issuing of commands to let the block device reclaim
+space freed 

Re: [PATCH v1] Doc : fs : convert xfs.txt to ReST

2019-06-29 Thread Jonathan Corbet
On Sat, 29 Jun 2019 16:01:55 +0100
Sheriff Esseson  wrote:

> Signed-off-by: Sheriff Esseson 
> ---
> 
> In v2.1:
> cc mentees list.

Please do us a favor?  

1) Post each patch standalone, without quoted text, ready to be applied.

2) Wait a little while between postings so that you can address more than
one comment at a time.

OK, two favors - off-by-one errors are my specialty...:)

Thanks,

jon


Re: [PATCH v4] Documentation:sh:convert register-banks.txt and new-machine.txt to rst format.

2019-06-29 Thread Vandana BN


On 29/06/19 8:20 PM, Mauro Carvalho Chehab wrote:
> Em Sat, 29 Jun 2019 20:02:45 +0530
> Vandana BN  escreveu:
>
>> This patch converts new-machine.txt and register-banks.txt
>> to ReST format, No content change.
>> Added interfaces.rst to contain kernel-doc markups from index.rst
>> Added interfaces.rst,new-machine.rst and register-banks.rst to sh/index.rst
>> Added SPDX tag in index.rst
>>
>> Signed-off-by: Vandana BN 
> Looks good to me. Just a final thing to do.
>
> Be sure to run:
>
>   ./scripts/documentation-file-ref-check
>
> in order to check that you're not breaking any references to the file.
> If it breaks, please adjust the reference to reflect the file
> rename.
>
> After fixing the broken reference, feel free do add:
>
> Reviewed-by: Mauro Carvalho Chehab 

Thanks Mauro,

i don't not see any broken references.

>> ---
>>  Documentation/sh/index.rst|  65 +--
>>  Documentation/sh/interface.rst|  59 ++
>>  .../sh/{new-machine.txt => new-machine.rst}   | 171 +-
>>  ...{register-banks.txt => register-banks.rst} |   8 +-
>>  4 files changed, 163 insertions(+), 140 deletions(-)
>>  create mode 100644 Documentation/sh/interface.rst
>>  rename Documentation/sh/{new-machine.txt => new-machine.rst} (79%)
>>  rename Documentation/sh/{register-banks.txt => register-banks.rst} (90%)
>>
>> diff --git a/Documentation/sh/index.rst b/Documentation/sh/index.rst
>> index bc8db7ba894a..fec3c405b6b9 100644
>> --- a/Documentation/sh/index.rst
>> +++ b/Documentation/sh/index.rst
>> @@ -1,59 +1,14 @@
>> -===
>> -SuperH Interfaces Guide
>> -===
>> +.. SPDX-License-Identifier: GPL-2.0
>>
>> -:Author: Paul Mundt
>> -
>> -Memory Management
>> -=
>> -
>> -SH-4
>> -
>> -
>> -Store Queue API
>> -~~~
>> -
>> -.. kernel-doc:: arch/sh/kernel/cpu/sh4/sq.c
>> -   :export:
>> -
>> -SH-5
>> -
>> -
>> -TLB Interfaces
>> -~~
>> -
>> -.. kernel-doc:: arch/sh/mm/tlb-sh5.c
>> -   :internal:
>> -
>> -.. kernel-doc:: arch/sh/include/asm/tlb_64.h
>> -   :internal:
>> +
>> +SuperH Documentation
>> +
>>
>> -Machine Specific Interfaces
>> -===
>> -
>> -mach-dreamcast
>> ---
>> -
>> -.. kernel-doc:: arch/sh/boards/mach-dreamcast/rtc.c
>> -   :internal:
>> -
>> -mach-x3proto
>> -
>> -
>> -.. kernel-doc:: arch/sh/boards/mach-x3proto/ilsel.c
>> -   :export:
>> -
>> -Busses
>> -==
>> -
>> -SuperHyway
>> ---
>> -
>> -.. kernel-doc:: drivers/sh/superhyway/superhyway.c
>> -   :export:
>> +:Author: Paul Mundt
>>
>> -Maple
>> --
>> +.. toctree::
>> +   :maxdepth: 2
>>
>> -.. kernel-doc:: drivers/sh/maple/maple.c
>> -   :export:
>> +   interface
>> +   new-machine
>> +   register-banks
>> diff --git a/Documentation/sh/interface.rst b/Documentation/sh/interface.rst
>> new file mode 100644
>> index ..bc8db7ba894a
>> --- /dev/null
>> +++ b/Documentation/sh/interface.rst
>> @@ -0,0 +1,59 @@
>> +===
>> +SuperH Interfaces Guide
>> +===
>> +
>> +:Author: Paul Mundt
>> +
>> +Memory Management
>> +=
>> +
>> +SH-4
>> +
>> +
>> +Store Queue API
>> +~~~
>> +
>> +.. kernel-doc:: arch/sh/kernel/cpu/sh4/sq.c
>> +   :export:
>> +
>> +SH-5
>> +
>> +
>> +TLB Interfaces
>> +~~
>> +
>> +.. kernel-doc:: arch/sh/mm/tlb-sh5.c
>> +   :internal:
>> +
>> +.. kernel-doc:: arch/sh/include/asm/tlb_64.h
>> +   :internal:
>> +
>> +Machine Specific Interfaces
>> +===
>> +
>> +mach-dreamcast
>> +--
>> +
>> +.. kernel-doc:: arch/sh/boards/mach-dreamcast/rtc.c
>> +   :internal:
>> +
>> +mach-x3proto
>> +
>> +
>> +.. kernel-doc:: arch/sh/boards/mach-x3proto/ilsel.c
>> +   :export:
>> +
>> +Busses
>> +==
>> +
>> +SuperHyway
>> +--
>> +
>> +.. kernel-doc:: drivers/sh/superhyway/superhyway.c
>> +   :export:
>> +
>> +Maple
>> +-
>> +
>> +.. kernel-doc:: drivers/sh/maple/maple.c
>> +   :export:
>> diff --git a/Documentation/sh/new-machine.txt 
>> b/Documentation/sh/new-machine.rst
>> similarity index 79%
>> rename from Documentation/sh/new-machine.txt
>> rename to Documentation/sh/new-machine.rst
>> index e0961a66130b..b16c33342642 100644
>> --- a/Documentation/sh/new-machine.txt
>> +++ b/Documentation/sh/new-machine.rst
>> @@ -1,8 +1,8 @@
>> +
>> +Adding a new board to LinuxSH
>> +
>>
>> -Adding a new board to LinuxSH
>> -   
>> -
>> -   Paul Mundt 
>> +Paul Mundt 
>>
>>  This document attempts to outline what steps are necessary to add support
>>  for new boards to the LinuxSH port under the new 2.5 and 2.6 kernels. This
>> @@ -19,65 +19,67 @@ include/asm-sh/. For the new kernel, things are broken 
>> out by board type,
>>  companion chip typ

Re: [PATCH 10/10] tools/power/x86: A tool to validate Intel Speed Select commands

2019-06-29 Thread Andy Shevchenko
On Sat, Jun 29, 2019 at 5:53 PM Srinivas Pandruvada
 wrote:
> On Sat, 2019-06-29 at 17:31 +0300, Andy Shevchenko wrote:
> > On Thu, Jun 27, 2019 at 1:39 AM Srinivas Pandruvada
> >  wrote:

> > > +++ b/tools/power/x86/intel_speed_select/Makefile
> >
> > My experience with some tools are not good in order of their build
> > process.
> > Can this one use tools build infrastructure from the day 1?
> Can you give some pointers?

Sure.

At least simple ones are under tools/gpio, tools/iio, etc.

You may compare them to see what's different and what's common and
base Makefile here on that.

I dunno if there is any tool under tools/power to use that, it might
give an example of `descend` feature in Makefile.

> > > @@ -0,0 +1,31 @@
> > > +# SPDX-License-Identifier: GPL-2.0
> > > +CC = $(CROSS_COMPILE)gcc
> > > +BUILD_OUTPUT   := $(CURDIR)
> > > +PREFIX ?= /usr
> > > +DESTDIR?=
> > > +
> > > +override CFLAGS += -D__EXPORTED_HEADERS__ -Wall -D_GNU_SOURCE
> > > +override CFLAGS += -I$(CURDIR)/../../../../include/uapi/
> > > +override CFLAGS += -I$(CURDIR)/../../../../include/
> > > +
> > > +%: %.c
> > > +   @mkdir -p $(BUILD_OUTPUT)
> > > +   $(CC) $(CFLAGS) $< -o $(BUILD_OUTPUT)/$@ $(LDFLAGS)
> > > +
> > > +DEPS = isst.h
> > > +OBJ = isst_config.o isst_core.o isst_display.o
> > > +
> > > +%.o: %.c $(DEPS)
> > > +   $(CC) -c -o $(BUILD_OUTPUT)/$@ $< $(CFLAGS)
> > > +
> > > +intel-speed-select: $(OBJ)
> > > +   $(CC) -o $(BUILD_OUTPUT)/$@ $^ $(CFLAGS)
> > > +
> > > +.PHONY : clean
> > > +clean :
> > > +   @rm -f $(BUILD_OUTPUT)/intel-speed-select
> > > +   @rm -f $(BUILD_OUTPUT)/*.o
> > > +
> > > +install : intel-speed-select
> > > +   install -d $(DESTDIR)$(PREFIX)/sbin
> > > +   install $(BUILD_OUTPUT)/intel-speed-select
> > > $(DESTDIR)$(PREFIX)/sbin/intel-speed-select

-- 
With Best Regards,
Andy Shevchenko


Re: [PATCH v4] Documentation:sh:convert register-banks.txt and new-machine.txt to rst format.

2019-06-29 Thread Mauro Carvalho Chehab
Em Sat, 29 Jun 2019 21:26:29 +0530
Vandana BN  escreveu:

> On 29/06/19 8:20 PM, Mauro Carvalho Chehab wrote:
> > Em Sat, 29 Jun 2019 20:02:45 +0530
> > Vandana BN  escreveu:
> >  
> >> This patch converts new-machine.txt and register-banks.txt
> >> to ReST format, No content change.
> >> Added interfaces.rst to contain kernel-doc markups from index.rst
> >> Added interfaces.rst,new-machine.rst and register-banks.rst to sh/index.rst
> >> Added SPDX tag in index.rst
> >>
> >> Signed-off-by: Vandana BN   
> > Looks good to me. Just a final thing to do.
> >
> > Be sure to run:
> >
> > ./scripts/documentation-file-ref-check
> >
> > in order to check that you're not breaking any references to the file.
> > If it breaks, please adjust the reference to reflect the file
> > rename.
> >
> > After fixing the broken reference, feel free do add:
> >
> > Reviewed-by: Mauro Carvalho Chehab   
> 
> Thanks Mauro,
> 
> i don't not see any broken references.

Then maybe the script is broken. A simple grep here (linux-next) shows
one such reference:

git grep Documentation/sh/
MAINTAINERS:F:  Documentation/sh/
arch/sh/Kconfig.cpu:  See  for 
further


> 
> >> ---
> >>  Documentation/sh/index.rst|  65 +--
> >>  Documentation/sh/interface.rst|  59 ++
> >>  .../sh/{new-machine.txt => new-machine.rst}   | 171 +-
> >>  ...{register-banks.txt => register-banks.rst} |   8 +-
> >>  4 files changed, 163 insertions(+), 140 deletions(-)
> >>  create mode 100644 Documentation/sh/interface.rst
> >>  rename Documentation/sh/{new-machine.txt => new-machine.rst} (79%)
> >>  rename Documentation/sh/{register-banks.txt => register-banks.rst} (90%)
> >>
> >> diff --git a/Documentation/sh/index.rst b/Documentation/sh/index.rst
> >> index bc8db7ba894a..fec3c405b6b9 100644
> >> --- a/Documentation/sh/index.rst
> >> +++ b/Documentation/sh/index.rst
> >> @@ -1,59 +1,14 @@
> >> -===
> >> -SuperH Interfaces Guide
> >> -===
> >> +.. SPDX-License-Identifier: GPL-2.0
> >>
> >> -:Author: Paul Mundt
> >> -
> >> -Memory Management
> >> -=
> >> -
> >> -SH-4
> >> -
> >> -
> >> -Store Queue API
> >> -~~~
> >> -
> >> -.. kernel-doc:: arch/sh/kernel/cpu/sh4/sq.c
> >> -   :export:
> >> -
> >> -SH-5
> >> -
> >> -
> >> -TLB Interfaces
> >> -~~
> >> -
> >> -.. kernel-doc:: arch/sh/mm/tlb-sh5.c
> >> -   :internal:
> >> -
> >> -.. kernel-doc:: arch/sh/include/asm/tlb_64.h
> >> -   :internal:
> >> +
> >> +SuperH Documentation
> >> +
> >>
> >> -Machine Specific Interfaces
> >> -===
> >> -
> >> -mach-dreamcast
> >> ---
> >> -
> >> -.. kernel-doc:: arch/sh/boards/mach-dreamcast/rtc.c
> >> -   :internal:
> >> -
> >> -mach-x3proto
> >> -
> >> -
> >> -.. kernel-doc:: arch/sh/boards/mach-x3proto/ilsel.c
> >> -   :export:
> >> -
> >> -Busses
> >> -==
> >> -
> >> -SuperHyway
> >> ---
> >> -
> >> -.. kernel-doc:: drivers/sh/superhyway/superhyway.c
> >> -   :export:
> >> +:Author: Paul Mundt
> >>
> >> -Maple
> >> --
> >> +.. toctree::
> >> +   :maxdepth: 2
> >>
> >> -.. kernel-doc:: drivers/sh/maple/maple.c
> >> -   :export:
> >> +   interface
> >> +   new-machine
> >> +   register-banks
> >> diff --git a/Documentation/sh/interface.rst 
> >> b/Documentation/sh/interface.rst
> >> new file mode 100644
> >> index ..bc8db7ba894a
> >> --- /dev/null
> >> +++ b/Documentation/sh/interface.rst
> >> @@ -0,0 +1,59 @@
> >> +===
> >> +SuperH Interfaces Guide
> >> +===
> >> +
> >> +:Author: Paul Mundt
> >> +
> >> +Memory Management
> >> +=
> >> +
> >> +SH-4
> >> +
> >> +
> >> +Store Queue API
> >> +~~~
> >> +
> >> +.. kernel-doc:: arch/sh/kernel/cpu/sh4/sq.c
> >> +   :export:
> >> +
> >> +SH-5
> >> +
> >> +
> >> +TLB Interfaces
> >> +~~
> >> +
> >> +.. kernel-doc:: arch/sh/mm/tlb-sh5.c
> >> +   :internal:
> >> +
> >> +.. kernel-doc:: arch/sh/include/asm/tlb_64.h
> >> +   :internal:
> >> +
> >> +Machine Specific Interfaces
> >> +===
> >> +
> >> +mach-dreamcast
> >> +--
> >> +
> >> +.. kernel-doc:: arch/sh/boards/mach-dreamcast/rtc.c
> >> +   :internal:
> >> +
> >> +mach-x3proto
> >> +
> >> +
> >> +.. kernel-doc:: arch/sh/boards/mach-x3proto/ilsel.c
> >> +   :export:
> >> +
> >> +Busses
> >> +==
> >> +
> >> +SuperHyway
> >> +--
> >> +
> >> +.. kernel-doc:: drivers/sh/superhyway/superhyway.c
> >> +   :export:
> >> +
> >> +Maple
> >> +-
> >> +
> >> +.. kernel-doc:: drivers/sh/maple/maple.c
> >> +   :export:
> >> diff --git a/Documentation/sh/new-machine.txt 
> >> b/Documentation/sh/new-machine.rst
> >> similarity index 79%
> >> rename from Documentation/sh/new-machine.txt
> >> rename to Documentation/sh/new-machine.rst
> >> index e0961a66130b..b16c33342642 100644
> >> --- a/Docume

Re: [linux-kernel-mentees] [PATCH v1] Doc : fs : convert xfs.txt to ReST

2019-06-29 Thread Sheriff Esseson
Signed-off-by: Sheriff Esseson 
---

In v2:
Update MAINTAINERS. Fix indentation/long line issues. cc Darick and xfs mailist.

 Documentation/filesystems/index.rst |   5 +-
 Documentation/filesystems/xfs.rst   | 467 +++
 Documentation/filesystems/xfs.txt   | 470 
 MAINTAINERS |   2 +-
 4 files changed, 471 insertions(+), 473 deletions(-)
 create mode 100644 Documentation/filesystems/xfs.rst
 delete mode 100644 Documentation/filesystems/xfs.txt

diff --git a/Documentation/filesystems/index.rst 
b/Documentation/filesystems/index.rst
index 1131c34d7..a4cf5fca4 100644
--- a/Documentation/filesystems/index.rst
+++ b/Documentation/filesystems/index.rst
@@ -16,7 +16,7 @@ algorithms work.
 .. toctree::
:maxdepth: 2
 
-   path-lookup.rst
+   path-lookup
api-summary
splice
 
@@ -40,4 +40,5 @@ Documentation for individual filesystem types can be found 
here.
 .. toctree::
:maxdepth: 2
 
-   binderfs.rst
+   binderfs
+   xfs
diff --git a/Documentation/filesystems/xfs.rst 
b/Documentation/filesystems/xfs.rst
new file mode 100644
index 0..f52046b96
--- /dev/null
+++ b/Documentation/filesystems/xfs.rst
@@ -0,0 +1,467 @@
+==
+The SGI XFS Filesystem
+==
+
+XFS is a high performance journaling filesystem which originated
+on the SGI IRIX platform.  It is completely multi-threaded, can
+support large files and large filesystems, extended attributes,
+variable block sizes, is extent based, and makes extensive use of
+Btrees (directories, extents, free space) to aid both performance
+and scalability.
+
+Refer to the documentation at https://xfs.wiki.kernel.org/
+for further details.  This implementation is on-disk compatible
+with the IRIX version of XFS.
+
+
+Mount Options
+=
+
+When mounting an XFS filesystem, the following options are accepted.  For
+boolean mount options, the names with the "(*)" prefix is the default 
behaviour.
+For example, take a behaviour enabled by default to be a one (1) or, a zero (0)
+otherwise, ``(*)[no]default`` would be 0 while ``[no](*)default`` , a 1.
+
+   allocsize=
+Sets the buffered I/O end-of-file preallocation size when doing delayed
+allocation writeout (default size is 64KiB).  Valid values for this
+option are page size (typically 4KiB) through to 1GiB, inclusive, in
+power-of-2 increments.
+
+The default behaviour is for dynamic end-of-file preallocation size,
+which uses a set of heuristics to optimise the preallocation size based
+on the current allocation patterns within the file and the access
+patterns to the file. Specifying a fixed allocsize value turns off the
+dynamic behaviour.
+
+   [no]attr2
+The options enable/disable an "opportunistic" improvement to be made in
+the way inline extended attributes are stored on-disk.  When the new
+form is used for the first time when ``attr2`` is selected (either when
+setting or removing extended attributes) the on-disk superblock feature
+bit field will be updated to reflect this format being in use.
+
+The default behaviour is determined by the on-disk feature bit
+indicating that ``attr2`` behaviour is active. If either mount option 
is
+set, then that becomes the new default used by the filesystem. However
+on CRC enabled filesystems, the ``attr2`` format is always used , and 
so
+will reject the ``noattr2`` mount option if it is set.
+
+   (*)[no]discard
+Enable/disable the issuing of commands to let the block device reclaim
+space freed by the filesystem.  This is useful for SSD devices, thinly
+provisioned LUNs and virtual machine images, but may have a performance
+impact.
+
+Note: It is currently recommended that you use the ``fstrim``
+application to discard unused blocks rather than the ``discard`` mount
+option because the performance impact of this option is quite severe.
+
+   grpid/bsdgroups
+   nogrpid/(*)sysvgroups
+These options define what group ID a newly created file gets.  When
+``grpid`` is set, it takes the group ID of the directory in which it is
+created; otherwise it takes the ``fsgid`` of the current process, 
unless
+the directory has the ``setgid`` bit set, in which case it takes the
+``gid`` from the parent directory, and also gets the ``setgid`` bit set
+if it is a directory itself.
+
+   filestreams
+Make the data allocator use the filestreams allocation mode across the
+entire filesystem rather than just on directories configured to use it.
+
+   (*)[no]ikeep
+When ``ikeep`` is specified, XFS does not delete empty inode clusters
+and keeps them around on disk.  When ``noikeep`` is specified, empty
+inode clusters are returned to the free space pool.
+
+   inode32

Re: [PATCH 10/10] tools/power/x86: A tool to validate Intel Speed Select commands

2019-06-29 Thread Andy Shevchenko
On Sat, Jun 29, 2019 at 5:53 PM Srinivas Pandruvada
 wrote:
> On Sat, 2019-06-29 at 17:31 +0300, Andy Shevchenko wrote:
> > On Thu, Jun 27, 2019 at 1:39 AM Srinivas Pandruvada
> >  wrote:

> > I need an Ack from tools/power maintainer(s) for this.
> > Also see below.
> MAINTAINER file doesn't call for any special name in this folder.

And this tells me perhaps this driver needs a MAINTAINER record?

> $./scripts/get_maintainer.pl 0010-tools-power-x86-A-tool-to-validate-
> Intel-Speed-Selec.patch
> Srinivas Pandruvada 
> (commit_signer:1/1=100%,authored:1/1=100%,added_lines:31/31=100%,added_
> lines:231/231=100%,added_lines:1607/1607=100%,added_lines:721/721=100%,
> added_lines:479/479=100%)
> linux-ker...@vger.kernel.org (open list)
>
> Len and Rafael can you ACK this tool patch?

-- 
With Best Regards,
Andy Shevchenko


Re: [PATCH v4] Documentation:sh:convert register-banks.txt and new-machine.txt to rst format.

2019-06-29 Thread Vandana BN


On 29/06/19 9:32 PM, Mauro Carvalho Chehab wrote:
> Em Sat, 29 Jun 2019 21:26:29 +0530
> Vandana BN  escreveu:
>
>> On 29/06/19 8:20 PM, Mauro Carvalho Chehab wrote:
>>> Em Sat, 29 Jun 2019 20:02:45 +0530
>>> Vandana BN  escreveu:
>>>  
 This patch converts new-machine.txt and register-banks.txt
 to ReST format, No content change.
 Added interfaces.rst to contain kernel-doc markups from index.rst
 Added interfaces.rst,new-machine.rst and register-banks.rst to sh/index.rst
 Added SPDX tag in index.rst

 Signed-off-by: Vandana BN   
>>> Looks good to me. Just a final thing to do.
>>>
>>> Be sure to run:
>>>
>>> ./scripts/documentation-file-ref-check
>>>
>>> in order to check that you're not breaking any references to the file.
>>> If it breaks, please adjust the reference to reflect the file
>>> rename.
>>>
>>> After fixing the broken reference, feel free do add:
>>>
>>> Reviewed-by: Mauro Carvalho Chehab   
>> Thanks Mauro,
>>
>> i don't not see any broken references.
> Then maybe the script is broken. A simple grep here (linux-next) shows
> one such reference:
>
> git grep Documentation/sh/
> MAINTAINERS:F:  Documentation/sh/
> arch/sh/Kconfig.cpu:  See  for 
> further
>
Oh ok, yes i see it now..

Will fix and send a patch.

 ---
  Documentation/sh/index.rst|  65 +--
  Documentation/sh/interface.rst|  59 ++
  .../sh/{new-machine.txt => new-machine.rst}   | 171 +-
  ...{register-banks.txt => register-banks.rst} |   8 +-
  4 files changed, 163 insertions(+), 140 deletions(-)
  create mode 100644 Documentation/sh/interface.rst
  rename Documentation/sh/{new-machine.txt => new-machine.rst} (79%)
  rename Documentation/sh/{register-banks.txt => register-banks.rst} (90%)

 diff --git a/Documentation/sh/index.rst b/Documentation/sh/index.rst
 index bc8db7ba894a..fec3c405b6b9 100644
 --- a/Documentation/sh/index.rst
 +++ b/Documentation/sh/index.rst
 @@ -1,59 +1,14 @@
 -===
 -SuperH Interfaces Guide
 -===
 +.. SPDX-License-Identifier: GPL-2.0

 -:Author: Paul Mundt
 -
 -Memory Management
 -=
 -
 -SH-4
 -
 -
 -Store Queue API
 -~~~
 -
 -.. kernel-doc:: arch/sh/kernel/cpu/sh4/sq.c
 -   :export:
 -
 -SH-5
 -
 -
 -TLB Interfaces
 -~~
 -
 -.. kernel-doc:: arch/sh/mm/tlb-sh5.c
 -   :internal:
 -
 -.. kernel-doc:: arch/sh/include/asm/tlb_64.h
 -   :internal:
 +
 +SuperH Documentation
 +

 -Machine Specific Interfaces
 -===
 -
 -mach-dreamcast
 ---
 -
 -.. kernel-doc:: arch/sh/boards/mach-dreamcast/rtc.c
 -   :internal:
 -
 -mach-x3proto
 -
 -
 -.. kernel-doc:: arch/sh/boards/mach-x3proto/ilsel.c
 -   :export:
 -
 -Busses
 -==
 -
 -SuperHyway
 ---
 -
 -.. kernel-doc:: drivers/sh/superhyway/superhyway.c
 -   :export:
 +:Author: Paul Mundt

 -Maple
 --
 +.. toctree::
 +   :maxdepth: 2

 -.. kernel-doc:: drivers/sh/maple/maple.c
 -   :export:
 +   interface
 +   new-machine
 +   register-banks
 diff --git a/Documentation/sh/interface.rst 
 b/Documentation/sh/interface.rst
 new file mode 100644
 index ..bc8db7ba894a
 --- /dev/null
 +++ b/Documentation/sh/interface.rst
 @@ -0,0 +1,59 @@
 +===
 +SuperH Interfaces Guide
 +===
 +
 +:Author: Paul Mundt
 +
 +Memory Management
 +=
 +
 +SH-4
 +
 +
 +Store Queue API
 +~~~
 +
 +.. kernel-doc:: arch/sh/kernel/cpu/sh4/sq.c
 +   :export:
 +
 +SH-5
 +
 +
 +TLB Interfaces
 +~~
 +
 +.. kernel-doc:: arch/sh/mm/tlb-sh5.c
 +   :internal:
 +
 +.. kernel-doc:: arch/sh/include/asm/tlb_64.h
 +   :internal:
 +
 +Machine Specific Interfaces
 +===
 +
 +mach-dreamcast
 +--
 +
 +.. kernel-doc:: arch/sh/boards/mach-dreamcast/rtc.c
 +   :internal:
 +
 +mach-x3proto
 +
 +
 +.. kernel-doc:: arch/sh/boards/mach-x3proto/ilsel.c
 +   :export:
 +
 +Busses
 +==
 +
 +SuperHyway
 +--
 +
 +.. kernel-doc:: drivers/sh/superhyway/superhyway.c
 +   :export:
 +
 +Maple
 +-
 +
 +.. kernel-doc:: drivers/sh/maple/maple.c
 +   :export:
 diff --git a/Documentation/sh/new-machine.txt 
 b/Documentation/sh/new-machine.rst
 similarity index 79%
 rename from Documentation/sh/new-m

[PATCH v5] Documentation:sh:convert register-banks.txt and new-machine.txt to rst format.

2019-06-29 Thread Vandana BN
This patch converts new-machine.txt and register-banks.txt
to ReST format, No content change.
Added interfaces.rst to contain kernel-doc markups from index.rst
Added interfaces.rst,new-machine.rst and register-banks.rst to sh/index.rst
Added SPDX tag in index.rst
Fixed broken reference in arch/sh/Kconfig.cpu

Signed-off-by: Vandana BN 
---
 Documentation/sh/index.rst|  65 +--
 Documentation/sh/interface.rst|  59 ++
 .../sh/{new-machine.txt => new-machine.rst}   | 171 +-
 ...{register-banks.txt => register-banks.rst} |   8 +-
 arch/sh/Kconfig.cpu   |   2 +-
 5 files changed, 164 insertions(+), 141 deletions(-)
 create mode 100644 Documentation/sh/interface.rst
 rename Documentation/sh/{new-machine.txt => new-machine.rst} (79%)
 rename Documentation/sh/{register-banks.txt => register-banks.rst} (90%)

diff --git a/Documentation/sh/index.rst b/Documentation/sh/index.rst
index bc8db7ba894a..fec3c405b6b9 100644
--- a/Documentation/sh/index.rst
+++ b/Documentation/sh/index.rst
@@ -1,59 +1,14 @@
-===
-SuperH Interfaces Guide
-===
+.. SPDX-License-Identifier: GPL-2.0

-:Author: Paul Mundt
-
-Memory Management
-=
-
-SH-4
-
-
-Store Queue API
-~~~
-
-.. kernel-doc:: arch/sh/kernel/cpu/sh4/sq.c
-   :export:
-
-SH-5
-
-
-TLB Interfaces
-~~
-
-.. kernel-doc:: arch/sh/mm/tlb-sh5.c
-   :internal:
-
-.. kernel-doc:: arch/sh/include/asm/tlb_64.h
-   :internal:
+
+SuperH Documentation
+

-Machine Specific Interfaces
-===
-
-mach-dreamcast
---
-
-.. kernel-doc:: arch/sh/boards/mach-dreamcast/rtc.c
-   :internal:
-
-mach-x3proto
-
-
-.. kernel-doc:: arch/sh/boards/mach-x3proto/ilsel.c
-   :export:
-
-Busses
-==
-
-SuperHyway
---
-
-.. kernel-doc:: drivers/sh/superhyway/superhyway.c
-   :export:
+:Author: Paul Mundt

-Maple
--
+.. toctree::
+   :maxdepth: 2

-.. kernel-doc:: drivers/sh/maple/maple.c
-   :export:
+   interface
+   new-machine
+   register-banks
diff --git a/Documentation/sh/interface.rst b/Documentation/sh/interface.rst
new file mode 100644
index ..bc8db7ba894a
--- /dev/null
+++ b/Documentation/sh/interface.rst
@@ -0,0 +1,59 @@
+===
+SuperH Interfaces Guide
+===
+
+:Author: Paul Mundt
+
+Memory Management
+=
+
+SH-4
+
+
+Store Queue API
+~~~
+
+.. kernel-doc:: arch/sh/kernel/cpu/sh4/sq.c
+   :export:
+
+SH-5
+
+
+TLB Interfaces
+~~
+
+.. kernel-doc:: arch/sh/mm/tlb-sh5.c
+   :internal:
+
+.. kernel-doc:: arch/sh/include/asm/tlb_64.h
+   :internal:
+
+Machine Specific Interfaces
+===
+
+mach-dreamcast
+--
+
+.. kernel-doc:: arch/sh/boards/mach-dreamcast/rtc.c
+   :internal:
+
+mach-x3proto
+
+
+.. kernel-doc:: arch/sh/boards/mach-x3proto/ilsel.c
+   :export:
+
+Busses
+==
+
+SuperHyway
+--
+
+.. kernel-doc:: drivers/sh/superhyway/superhyway.c
+   :export:
+
+Maple
+-
+
+.. kernel-doc:: drivers/sh/maple/maple.c
+   :export:
diff --git a/Documentation/sh/new-machine.txt b/Documentation/sh/new-machine.rst
similarity index 79%
rename from Documentation/sh/new-machine.txt
rename to Documentation/sh/new-machine.rst
index e0961a66130b..b16c33342642 100644
--- a/Documentation/sh/new-machine.txt
+++ b/Documentation/sh/new-machine.rst
@@ -1,8 +1,8 @@
+
+Adding a new board to LinuxSH
+

-Adding a new board to LinuxSH
-   
-
-   Paul Mundt 
+Paul Mundt 

 This document attempts to outline what steps are necessary to add support
 for new boards to the LinuxSH port under the new 2.5 and 2.6 kernels. This
@@ -19,65 +19,67 @@ include/asm-sh/. For the new kernel, things are broken out 
by board type,
 companion chip type, and CPU type. Looking at a tree view of this directory
 hierarchy looks like the following:

-Board-specific code:
-
-.
-|-- arch
-|   `-- sh
-|   `-- boards
-|   |-- adx
-|   |   `-- board-specific files
-|   |-- bigsur
-|   |   `-- board-specific files
-|   |
-|   ... more boards here ...
-|
-`-- include
-`-- asm-sh
-|-- adx
-|   `-- board-specific headers
-|-- bigsur
-|   `-- board-specific headers
-|
-   .. more boards here ...
-
-Next, for companion chips:
-.
-`-- arch
-`-- sh
-`-- cchips
-`-- hd6446x
-`-- hd64461
-`-- cchip-specific files
+Board-specific code::
+
+ .
+ |-- arch
+ |   `-- sh
+ |   `-- boards
+ |   |-- adx
+ |   |   `-- board-specific files
+ |   |-- bigsur
+ |   |   `-- board-specific files
+ |   |
+ |   ... more boa

Re: [PATCH v5] Documentation:sh:convert register-banks.txt and new-machine.txt to rst format.

2019-06-29 Thread Mauro Carvalho Chehab
Em Sat, 29 Jun 2019 21:55:01 +0530
Vandana BN  escreveu:

> This patch converts new-machine.txt and register-banks.txt
> to ReST format, No content change.
> Added interfaces.rst to contain kernel-doc markups from index.rst
> Added interfaces.rst,new-machine.rst and register-banks.rst to sh/index.rst
> Added SPDX tag in index.rst
> Fixed broken reference in arch/sh/Kconfig.cpu
> 
> Signed-off-by: Vandana BN 

Reviewed-by: Mauro Carvalho Chehab 

> ---
>  Documentation/sh/index.rst|  65 +--
>  Documentation/sh/interface.rst|  59 ++
>  .../sh/{new-machine.txt => new-machine.rst}   | 171 +-
>  ...{register-banks.txt => register-banks.rst} |   8 +-
>  arch/sh/Kconfig.cpu   |   2 +-
>  5 files changed, 164 insertions(+), 141 deletions(-)
>  create mode 100644 Documentation/sh/interface.rst
>  rename Documentation/sh/{new-machine.txt => new-machine.rst} (79%)
>  rename Documentation/sh/{register-banks.txt => register-banks.rst} (90%)
> 
> diff --git a/Documentation/sh/index.rst b/Documentation/sh/index.rst
> index bc8db7ba894a..fec3c405b6b9 100644
> --- a/Documentation/sh/index.rst
> +++ b/Documentation/sh/index.rst
> @@ -1,59 +1,14 @@
> -===
> -SuperH Interfaces Guide
> -===
> +.. SPDX-License-Identifier: GPL-2.0
> 
> -:Author: Paul Mundt
> -
> -Memory Management
> -=
> -
> -SH-4
> -
> -
> -Store Queue API
> -~~~
> -
> -.. kernel-doc:: arch/sh/kernel/cpu/sh4/sq.c
> -   :export:
> -
> -SH-5
> -
> -
> -TLB Interfaces
> -~~
> -
> -.. kernel-doc:: arch/sh/mm/tlb-sh5.c
> -   :internal:
> -
> -.. kernel-doc:: arch/sh/include/asm/tlb_64.h
> -   :internal:
> +
> +SuperH Documentation
> +
> 
> -Machine Specific Interfaces
> -===
> -
> -mach-dreamcast
> ---
> -
> -.. kernel-doc:: arch/sh/boards/mach-dreamcast/rtc.c
> -   :internal:
> -
> -mach-x3proto
> -
> -
> -.. kernel-doc:: arch/sh/boards/mach-x3proto/ilsel.c
> -   :export:
> -
> -Busses
> -==
> -
> -SuperHyway
> ---
> -
> -.. kernel-doc:: drivers/sh/superhyway/superhyway.c
> -   :export:
> +:Author: Paul Mundt
> 
> -Maple
> --
> +.. toctree::
> +   :maxdepth: 2
> 
> -.. kernel-doc:: drivers/sh/maple/maple.c
> -   :export:
> +   interface
> +   new-machine
> +   register-banks
> diff --git a/Documentation/sh/interface.rst b/Documentation/sh/interface.rst
> new file mode 100644
> index ..bc8db7ba894a
> --- /dev/null
> +++ b/Documentation/sh/interface.rst
> @@ -0,0 +1,59 @@
> +===
> +SuperH Interfaces Guide
> +===
> +
> +:Author: Paul Mundt
> +
> +Memory Management
> +=
> +
> +SH-4
> +
> +
> +Store Queue API
> +~~~
> +
> +.. kernel-doc:: arch/sh/kernel/cpu/sh4/sq.c
> +   :export:
> +
> +SH-5
> +
> +
> +TLB Interfaces
> +~~
> +
> +.. kernel-doc:: arch/sh/mm/tlb-sh5.c
> +   :internal:
> +
> +.. kernel-doc:: arch/sh/include/asm/tlb_64.h
> +   :internal:
> +
> +Machine Specific Interfaces
> +===
> +
> +mach-dreamcast
> +--
> +
> +.. kernel-doc:: arch/sh/boards/mach-dreamcast/rtc.c
> +   :internal:
> +
> +mach-x3proto
> +
> +
> +.. kernel-doc:: arch/sh/boards/mach-x3proto/ilsel.c
> +   :export:
> +
> +Busses
> +==
> +
> +SuperHyway
> +--
> +
> +.. kernel-doc:: drivers/sh/superhyway/superhyway.c
> +   :export:
> +
> +Maple
> +-
> +
> +.. kernel-doc:: drivers/sh/maple/maple.c
> +   :export:
> diff --git a/Documentation/sh/new-machine.txt 
> b/Documentation/sh/new-machine.rst
> similarity index 79%
> rename from Documentation/sh/new-machine.txt
> rename to Documentation/sh/new-machine.rst
> index e0961a66130b..b16c33342642 100644
> --- a/Documentation/sh/new-machine.txt
> +++ b/Documentation/sh/new-machine.rst
> @@ -1,8 +1,8 @@
> +
> +Adding a new board to LinuxSH
> +
> 
> -Adding a new board to LinuxSH
> -   
> -
> -   Paul Mundt 
> +Paul Mundt 
> 
>  This document attempts to outline what steps are necessary to add support
>  for new boards to the LinuxSH port under the new 2.5 and 2.6 kernels. This
> @@ -19,65 +19,67 @@ include/asm-sh/. For the new kernel, things are broken 
> out by board type,
>  companion chip type, and CPU type. Looking at a tree view of this directory
>  hierarchy looks like the following:
> 
> -Board-specific code:
> -
> -.
> -|-- arch
> -|   `-- sh
> -|   `-- boards
> -|   |-- adx
> -|   |   `-- board-specific files
> -|   |-- bigsur
> -|   |   `-- board-specific files
> -|   |
> -|   ... more boards here ...
> -|
> -`-- include
> -`-- asm-sh
> -|-- adx
> -|   `-- board-specific headers
> -|-- bigsur
> -   

Re: [linux-kernel-mentees] [PATCH v1] Doc : fs : convert xfs.txt to ReST

2019-06-29 Thread Sheriff Esseson
Signed-off-by: Sheriff Esseson 
---

In v3:
Update MAINTAINERS. Fix Indentation/long line issues. Insert Sphinx tag.

 Documentation/filesystems/index.rst |   5 +-
 Documentation/filesystems/xfs.rst   | 468 +++
 Documentation/filesystems/xfs.txt   | 470 
 MAINTAINERS |   2 +-
 4 files changed, 472 insertions(+), 473 deletions(-)
 create mode 100644 Documentation/filesystems/xfs.rst
 delete mode 100644 Documentation/filesystems/xfs.txt

diff --git a/Documentation/filesystems/index.rst 
b/Documentation/filesystems/index.rst
index 1131c34d7..a4cf5fca4 100644
--- a/Documentation/filesystems/index.rst
+++ b/Documentation/filesystems/index.rst
@@ -16,7 +16,7 @@ algorithms work.
 .. toctree::
:maxdepth: 2
 
-   path-lookup.rst
+   path-lookup
api-summary
splice
 
@@ -40,4 +40,5 @@ Documentation for individual filesystem types can be found 
here.
 .. toctree::
:maxdepth: 2
 
-   binderfs.rst
+   binderfs
+   xfs
diff --git a/Documentation/filesystems/xfs.rst 
b/Documentation/filesystems/xfs.rst
new file mode 100644
index 0..d36ef042c
--- /dev/null
+++ b/Documentation/filesystems/xfs.rst
@@ -0,0 +1,468 @@
+.. SPDX-License-Identifier: GPL-2.0
+==
+The SGI XFS Filesystem
+==
+
+XFS is a high performance journaling filesystem which originated
+on the SGI IRIX platform.  It is completely multi-threaded, can
+support large files and large filesystems, extended attributes,
+variable block sizes, is extent based, and makes extensive use of
+Btrees (directories, extents, free space) to aid both performance
+and scalability.
+
+Refer to the documentation at https://xfs.wiki.kernel.org/
+for further details.  This implementation is on-disk compatible
+with the IRIX version of XFS.
+
+
+Mount Options
+=
+
+When mounting an XFS filesystem, the following options are accepted.  For
+boolean mount options, the names with the "(*)" prefix is the default 
behaviour.
+For example, take a behaviour enabled by default to be a one (1) or, a zero (0)
+otherwise, ``(*)[no]default`` would be 0 while ``[no](*)default`` , a 1.
+
+   allocsize=
+Sets the buffered I/O end-of-file preallocation size when doing delayed
+allocation writeout (default size is 64KiB).  Valid values for this
+option are page size (typically 4KiB) through to 1GiB, inclusive, in
+power-of-2 increments.
+
+The default behaviour is for dynamic end-of-file preallocation size,
+which uses a set of heuristics to optimise the preallocation size based
+on the current allocation patterns within the file and the access
+patterns to the file. Specifying a fixed allocsize value turns off the
+dynamic behaviour.
+
+   [no]attr2
+The options enable/disable an "opportunistic" improvement to be made in
+the way inline extended attributes are stored on-disk.  When the new
+form is used for the first time when ``attr2`` is selected (either when
+setting or removing extended attributes) the on-disk superblock feature
+bit field will be updated to reflect this format being in use.
+
+The default behaviour is determined by the on-disk feature bit
+indicating that ``attr2`` behaviour is active. If either mount option 
is
+set, then that becomes the new default used by the filesystem. However
+on CRC enabled filesystems, the ``attr2`` format is always used , and 
so
+will reject the ``noattr2`` mount option if it is set.
+
+   (*)[no]discard
+Enable/disable the issuing of commands to let the block device reclaim
+space freed by the filesystem.  This is useful for SSD devices, thinly
+provisioned LUNs and virtual machine images, but may have a performance
+impact.
+
+Note: It is currently recommended that you use the ``fstrim``
+application to discard unused blocks rather than the ``discard`` mount
+option because the performance impact of this option is quite severe.
+
+   grpid/bsdgroups
+   nogrpid/(*)sysvgroups
+These options define what group ID a newly created file gets.  When
+``grpid`` is set, it takes the group ID of the directory in which it is
+created; otherwise it takes the ``fsgid`` of the current process, 
unless
+the directory has the ``setgid`` bit set, in which case it takes the
+``gid`` from the parent directory, and also gets the ``setgid`` bit set
+if it is a directory itself.
+
+   filestreams
+Make the data allocator use the filestreams allocation mode across the
+entire filesystem rather than just on directories configured to use it.
+
+   (*)[no]ikeep
+When ``ikeep`` is specified, XFS does not delete empty inode clusters
+and keeps them around on disk.  When ``noikeep`` is specified, empty
+inode clusters are returned to the f

[PATCH] Documentation: misc-devices: mei: Convert mei txt files to reST

2019-06-29 Thread Shreeya Patel
Convert the MEI misc device's documentation files from .txt to
reStructuredText format. Make a minor change of correcting the
wrong macro name MEI_CONNECT_CLIENT_IOCTL to IOCTL_MEI_CONNECT_CLIENT.
Add an index file in mei as there are two sections for it in the
documentation.

Signed-off-by: Shreeya Patel 
---
I am not sure if I have placed the Documentation in the right place
so I would like to get some suggestions from the MAINTAINERS on this
part.

 Documentation/misc-devices/index.rst  |   1 +
 Documentation/misc-devices/mei/index.rst  |  15 +
 .../misc-devices/mei/mei-client-bus.rst   | 151 +
 .../misc-devices/mei/mei-client-bus.txt   | 141 -
 Documentation/misc-devices/mei/mei.rst| 289 ++
 Documentation/misc-devices/mei/mei.txt| 266 
 6 files changed, 456 insertions(+), 407 deletions(-)
 create mode 100644 Documentation/misc-devices/mei/index.rst
 create mode 100644 Documentation/misc-devices/mei/mei-client-bus.rst
 delete mode 100644 Documentation/misc-devices/mei/mei-client-bus.txt
 create mode 100644 Documentation/misc-devices/mei/mei.rst
 delete mode 100644 Documentation/misc-devices/mei/mei.txt

diff --git a/Documentation/misc-devices/index.rst 
b/Documentation/misc-devices/index.rst
index dfd1f45a3127..e788a12b2b19 100644
--- a/Documentation/misc-devices/index.rst
+++ b/Documentation/misc-devices/index.rst
@@ -15,3 +15,4 @@ fit into other categories.
:maxdepth: 2
 
ibmvmc
+   mei/index
diff --git a/Documentation/misc-devices/mei/index.rst 
b/Documentation/misc-devices/mei/index.rst
new file mode 100644
index ..3018098ad075
--- /dev/null
+++ b/Documentation/misc-devices/mei/index.rst
@@ -0,0 +1,15 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+=
+Intel(R) Management Engine Interface Kernel Driver (Intel(R) MEI)
+=
+
+.. class:: toc-title
+
+   Table of contents
+
+.. toctree::
+   :maxdepth: 2
+
+   mei
+   mei-client-bus
diff --git a/Documentation/misc-devices/mei/mei-client-bus.rst 
b/Documentation/misc-devices/mei/mei-client-bus.rst
new file mode 100644
index ..82d455afae78
--- /dev/null
+++ b/Documentation/misc-devices/mei/mei-client-bus.rst
@@ -0,0 +1,151 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+==
+Intel(R) Management Engine (ME) Client bus API
+==
+
+
+Rationale
+=
+
+MEI misc character device is useful for dedicated applications to send and 
receive
+data to the many FW appliance found in Intel's ME from the user space.
+However for some of the ME functionalities it make sense to leverage existing 
software
+stack and expose them through existing kernel subsystems.
+
+In order to plug seamlessly into the kernel device driver model we add kernel 
virtual
+bus abstraction on top of the MEI driver. This allows implementing linux 
kernel drivers
+for the various MEI features as a stand alone entities found in their 
respective subsystem.
+Existing device drivers can even potentially be re-used by adding an MEI CL 
bus layer to
+the existing code.
+
+
+MEI CL bus API
+==
+
+A driver implementation for an MEI Client is very similar to existing bus
+based device drivers. The driver registers itself as an MEI CL bus driver 
through
+the :c:type:`mei_cl_driver` structure:
+
+::
+
+struct mei_cl_driver {
+   struct device_driver driver;
+   const char *name;
+
+   const struct mei_cl_device_id *id_table;
+
+   int (*probe)(struct mei_cl_device *dev, const struct mei_cl_id 
*id);
+   int (*remove)(struct mei_cl_device *dev);
+};
+
+struct mei_cl_id {
+   char name[MEI_NAME_SIZE];
+   kernel_ulong_t driver_info;
+};
+
+
+The :c:type:`mei_cl_id` structure allows the driver to bind itself against a 
device name.
+
+To actually register a driver on the ME Client bus one must call the 
:c:func:`mei_cl_add_driver()`
+API. This is typically called at module init time.
+
+Once registered on the ME Client bus, a driver will typically try to do some 
I/O on
+this bus and this should be done through the :c:func:`mei_cl_send()` and 
:c:func:`mei_cl_recv()`
+routines. The latter is synchronous (blocks and sleeps until data shows up).
+In order for drivers to be notified of pending events waiting for them (e.g.
+an Rx event) they can register an event handler through the
+:c:func:`mei_cl_register_event_cb()` routine. Currently only the 
:c:macro:`MEI_EVENT_RX` event
+will trigger an event handler call and the driver implementation is supposed
+to call :c:func:`mei_recv()` from the event handler in order to fetch the 
pending
+received buffers.
+
+
+Example
+===
+
+As a theoretical example let's pretend the ME comes with a "contact" NFC IP.
+Th

Re: [PATCH 10/10] tools/power/x86: A tool to validate Intel Speed Select commands

2019-06-29 Thread Srinivas Pandruvada
On Sat, 2019-06-29 at 19:03 +0300, Andy Shevchenko wrote:
> On Sat, Jun 29, 2019 at 5:53 PM Srinivas Pandruvada
>  wrote:
> > On Sat, 2019-06-29 at 17:31 +0300, Andy Shevchenko wrote:
> > > On Thu, Jun 27, 2019 at 1:39 AM Srinivas Pandruvada
> > >  wrote:
> > > I need an Ack from tools/power maintainer(s) for this.
> > > Also see below.
> > 
> > MAINTAINER file doesn't call for any special name in this folder.
> 
> And this tells me perhaps this driver needs a MAINTAINER record?
I will submit a MAINTAINER file update. I was waiting for reviews.

Thanks,
Srinivas

> 
> > $./scripts/get_maintainer.pl 0010-tools-power-x86-A-tool-to-
> > validate-
> > Intel-Speed-Selec.patch
> > Srinivas Pandruvada 
> > (commit_signer:1/1=100%,authored:1/1=100%,added_lines:31/31=100%,ad
> > ded_
> > lines:231/231=100%,added_lines:1607/1607=100%,added_lines:721/721=1
> > 00%,
> > added_lines:479/479=100%)
> > linux-ker...@vger.kernel.org (open list)
> > 
> > Len and Rafael can you ACK this tool patch?
> 
> 



Re: [RFC PATCH 2/3] Introduce arch_prctl(ARCH_X86_CET_MARK_LEGACY_CODE)

2019-06-29 Thread Andy Lutomirski
> On Jun 28, 2019, at 12:41 PM, Yu-cheng Yu  wrote:
>
> The CET legacy code bitmap covers the whole user-mode address space and is
> located at the top of the user-mode address space.  It is allocated only
> when the first time arch_prctl(ARCH_X86_MARK_LEGACY_CODE) is called from
> an application.
>
> Introduce:
>
> arch_prctl(ARCH_X86_MARK_LEGACY_CODE, unsigned long *buf)
>Mark an address range as IBT legacy code.

How about defining a struct for this?

The change log should discuss where the bitmap goes and how it’s allocated.

> +static int alloc_bitmap(void)
> +{
> +unsigned long addr;
> +u64 msr_ia32_u_cet;
> +
> +addr = do_mmap_locked(NULL, IBT_BITMAP_ADDR, IBT_BITMAP_SIZE,
> +  PROT_READ | PROT_WRITE,
> +  MAP_ANONYMOUS | MAP_PRIVATE | MAP_FIXED_NOREPLACE,
> +  VM_IBT | VM_NORESERVE, NULL);
> +
> +if (IS_ERR((void *)addr))
> +return addr;
> +
> +current->thread.cet.ibt_bitmap_addr = addr;

addr is a constant. Why are you storing it?  If it ends up not being
constant, you should wire up mremap like the vDSO does.


> +static int set_user_bits(unsigned long __user *buf, unsigned long buf_size,
> + unsigned long start_bit, unsigned long end_bit, unsigned long 
> set)
> +{
> +unsigned long start_ul, end_ul, total_ul;
> +int i, j, r;
> +
> +if (round_up(end_bit, BITS_PER_BYTE) / BITS_PER_BYTE > buf_size)
> +end_bit = buf_size * BITS_PER_BYTE - 1;
> +
> +start_ul = start_bit / BITS_PER_LONG;
> +end_ul = end_bit / BITS_PER_LONG;
> +total_ul = (end_ul - start_ul + 1);
> +
> +i = start_bit % BITS_PER_LONG;
> +j = end_bit % BITS_PER_LONG;
> +
> +r = 0;
> +put_user_try {

put_user_try is obsolete.  Just use get_user(), etc.

Also, I must be missing something fundamental, because this series
claims that user code can't write directly to the bitmap.  This means
that this entire function shouldn't work at all.


Re: [RFC PATCH 3/3] Prevent user from writing to IBT bitmap.

2019-06-29 Thread Andy Lutomirski
On Fri, Jun 28, 2019 at 12:50 PM Yu-cheng Yu  wrote:
>
> The IBT bitmap is visiable from user-mode, but not writable.
>
> Signed-off-by: Yu-cheng Yu 
>
> ---
>  arch/x86/mm/fault.c | 7 +++
>  1 file changed, 7 insertions(+)
>
> diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
> index 59f4f66e4f2e..231196abb62e 100644
> --- a/arch/x86/mm/fault.c
> +++ b/arch/x86/mm/fault.c
> @@ -1454,6 +1454,13 @@ void do_user_addr_fault(struct pt_regs *regs,
>  * we can handle it..
>  */
>  good_area:
> +#define USER_MODE_WRITE (FAULT_FLAG_WRITE | FAULT_FLAG_USER)
> +   if (((flags & USER_MODE_WRITE)  == USER_MODE_WRITE) &&
> +   (vma->vm_flags & VM_IBT)) {
> +   bad_area_access_error(regs, hw_error_code, address, vma);
> +   return;
> +   }
> +

Just make the VMA have VM_WRITE and VM_MAYWRITE clear.  No new code
like this should be required.


Re: [PATCH] binfmt_elf: Extract .note.gnu.property from an ELF file

2019-06-29 Thread Andy Lutomirski
On Thu, Jun 27, 2019 at 2:39 AM Florian Weimer  wrote:
>
> * Andy Lutomirski:
>
> > Also, I don't think there's any actual requirement that the upstream
> > kernel recognize existing CET-enabled RHEL 8 binaries as being
> > CET-enabled.  I tend to think that RHEL 8 jumped the gun here.
>
> The ABI was supposed to be finalized and everyone involved thought it
> had been reviewed by the GNU gABI community and other interested
> parties.  It had been included in binutils for several releases.
>
> From my point of view, the kernel is just a consumer of the ABI.  The
> kernel would not change an instruction encoding if it doesn't like it
> for some reason, either.

I read the only relevant gABI thing I could find easily, and it seems
to document the "gnu property" thing.  I have no problem with that.

>
> > While the upstream kernel should make some reasonble effort to make
> > sure that RHEL 8 binaries will continue to run, I don't see why we
> > need to go out of our way to keep the full set of mitigations
> > available for binaries that were developed against a non-upstream
> > kernel.
>
> They were developed against the ABI specification.
>
> I do not have a strong opinion what the kernel should do going forward.
> I just want to make clear what happened.

I admit that I'm not really clear on exactly what RHEL 8 shipped.
Some of this stuff is very much an ELF ABI that belongs to the
toolchain, but some if it is kernel API.  For example, the IBT legacy
bitmap API is very much in flux, and I don't think anything credible
has been submitted for upstream inclusion.  Does RHEL 8's glibc
attempt to cope with the case where some libraries are CET-compatible
and some are not?  If so, how does this work?  What, if any, services
does the RHEL 8 kernel provide in this direction?


Re: [PATCH 0/2] hwspinlock: add the 'in_atomic' API

2019-06-29 Thread Bjorn Andersson
On Thu 07 Mar 07:58 PST 2019, Fabien Dessenne wrote:

> In its current implementation, the hwspinlock framework relies on jiffies
> to handle the timeout of the hwspin_lock_timeout_xxx() API.
> In an atomic context (or more precisely when irq are disabled) jiffies does 
> not
> increase, which prevents the timeout to reach its target value (infinite 
> loop).
> 
> Note that there is already an hwspinlock user that runs in atomic context
> (drivers/irqchip/irq-stm32-exti.c) and that has to handle by itself the
> timeout.
> 
> The first patch of the series completes the Documentation (the 'raw' API
> is not documented), and the second patch provides with the 'in_atomic' API.
> 

Applied

Thanks,
Bjorn

> Fabien Dessenne (2):
>   hwspinlock: document the hwspinlock 'raw' API
>   hwspinlock: add the 'in_atomic' API
> 
>  Documentation/hwspinlock.txt | 81 
> 
>  drivers/hwspinlock/hwspinlock_core.c | 43 +--
>  include/linux/hwspinlock.h   | 61 +--
>  3 files changed, 169 insertions(+), 16 deletions(-)
> 
> -- 
> 2.7.4
> 


RE: [PATCH] Documentation: misc-devices: mei: Convert mei txt files to reST

2019-06-29 Thread Winkler, Tomas



> -Original Message-
> From: Shreeya Patel [mailto:shreeya.patel23...@gmail.com]
> Sent: Sunday, June 30, 2019 00:32
> To: sk...@linuxfoundation.org; cor...@lwn.net; Winkler, Tomas
> ; linux-doc@vger.kernel.org; linux-
> ker...@vger.kernel.org; linux-kernel-ment...@lists.linuxfoundation.org
> Subject: [PATCH] Documentation: misc-devices: mei: Convert mei txt files to
> reST
> 
> Convert the MEI misc device's documentation files from .txt to
> reStructuredText format. Make a minor change of correcting the wrong macro
> name MEI_CONNECT_CLIENT_IOCTL to IOCTL_MEI_CONNECT_CLIENT.
> Add an index file in mei as there are two sections for it in the 
> documentation.
> 
> Signed-off-by: Shreeya Patel 
> ---
Sorry you are late, we've already done that, it should be merged via Greg's 
char-misc tree.
Thanks
Tomas



> I am not sure if I have placed the Documentation in the right place so I would
> like to get some suggestions from the MAINTAINERS on this part.
> 
>  Documentation/misc-devices/index.rst  |   1 +
>  Documentation/misc-devices/mei/index.rst  |  15 +
>  .../misc-devices/mei/mei-client-bus.rst   | 151 +
>  .../misc-devices/mei/mei-client-bus.txt   | 141 -
>  Documentation/misc-devices/mei/mei.rst| 289 ++
>  Documentation/misc-devices/mei/mei.txt| 266 
>  6 files changed, 456 insertions(+), 407 deletions(-)  create mode 100644
> Documentation/misc-devices/mei/index.rst
>  create mode 100644 Documentation/misc-devices/mei/mei-client-bus.rst
>  delete mode 100644 Documentation/misc-devices/mei/mei-client-bus.txt
>  create mode 100644 Documentation/misc-devices/mei/mei.rst
>  delete mode 100644 Documentation/misc-devices/mei/mei.txt
> 
> diff --git a/Documentation/misc-devices/index.rst b/Documentation/misc-
> devices/index.rst
> index dfd1f45a3127..e788a12b2b19 100644
> --- a/Documentation/misc-devices/index.rst
> +++ b/Documentation/misc-devices/index.rst
> @@ -15,3 +15,4 @@ fit into other categories.
> :maxdepth: 2
> 
> ibmvmc
> +   mei/index
> diff --git a/Documentation/misc-devices/mei/index.rst b/Documentation/misc-
> devices/mei/index.rst
> new file mode 100644
> index ..3018098ad075
> --- /dev/null
> +++ b/Documentation/misc-devices/mei/index.rst
> @@ -0,0 +1,15 @@
> +.. SPDX-License-Identifier: GPL-2.0
> +
> +===
> ==
> +Intel(R) Management Engine Interface Kernel Driver (Intel(R) MEI)
> +===
> ==
> +
> +.. class:: toc-title
> +
> +   Table of contents
> +
> +.. toctree::
> +   :maxdepth: 2
> +
> +   mei
> +   mei-client-bus
> diff --git a/Documentation/misc-devices/mei/mei-client-bus.rst
> b/Documentation/misc-devices/mei/mei-client-bus.rst
> new file mode 100644
> index ..82d455afae78
> --- /dev/null
> +++ b/Documentation/misc-devices/mei/mei-client-bus.rst
> @@ -0,0 +1,151 @@
> +.. SPDX-License-Identifier: GPL-2.0
> +
> +==
> +Intel(R) Management Engine (ME) Client bus API
> +==
> +
> +
> +Rationale
> +=
> +
> +MEI misc character device is useful for dedicated applications to send
> +and receive data to the many FW appliance found in Intel's ME from the user
> space.
> +However for some of the ME functionalities it make sense to leverage
> +existing software stack and expose them through existing kernel subsystems.
> +
> +In order to plug seamlessly into the kernel device driver model we add
> +kernel virtual bus abstraction on top of the MEI driver. This allows
> +implementing linux kernel drivers for the various MEI features as a stand
> alone entities found in their respective subsystem.
> +Existing device drivers can even potentially be re-used by adding an
> +MEI CL bus layer to the existing code.
> +
> +
> +MEI CL bus API
> +==
> +
> +A driver implementation for an MEI Client is very similar to existing
> +bus based device drivers. The driver registers itself as an MEI CL bus
> +driver through the :c:type:`mei_cl_driver` structure:
> +
> +::
> +
> +struct mei_cl_driver {
> + struct device_driver driver;
> + const char *name;
> +
> + const struct mei_cl_device_id *id_table;
> +
> + int (*probe)(struct mei_cl_device *dev, const struct mei_cl_id
> *id);
> + int (*remove)(struct mei_cl_device *dev);
> +};
> +
> +struct mei_cl_id {
> + char name[MEI_NAME_SIZE];
> + kernel_ulong_t driver_info;
> +};
> +
> +
> +The :c:type:`mei_cl_id` structure allows the driver to bind itself against a
> device name.
> +
> +To actually register a driver on the ME Client bus one must call the
> +:c:func:`mei_cl_add_driver()` API. This is typically called at module init 
> time.
> +
> +Once registered on the ME Client bus, a driver will typicall