Add Altera hardware mutex driver
Subsystems (2)
PATCH 1/1 Add Altera hardware mutex driver
From: Niravkumar L Rabara <[email protected]>
Altera hardware mutex soft IP provides hardware assistance for synchronization and mutual exclusion between processors in asymmetric/symmetric multiprocessing (AMP/SMP) system or multi processes/threads in uniprocessor system.
--- .../bindings/misc/altera-hwmutex.yaml | 47 +++ drivers/misc/Kconfig | 6 + drivers/misc/Makefile | 1 + drivers/misc/altera_hwmutex.c | 321 ++++++++++++++++++ include/linux/altera_hwmutex.h | 42 +++ 5 files changed, 417 insertions(+) create mode 100644 Documentation/devicetree/bindings/misc/altera-hwmutex.yaml create mode 100644 drivers/misc/altera_hwmutex.c create mode 100644 include/linux/altera_hwmutex.h
Documentation/devicetree/bindings/misc/altera-hwmutex.yaml new file +47 -0
@@ -0,0 +1,47 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/misc/altera-hwmutex.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Altera hardware mutex + +maintainers: + - Niravkumar L Rabara <[email protected]> + +description: + Altera hardware mutex can provide hardware assistance for synchronization + and mutual exclusion between processors in asymmetric/symmetric multiprocessing + (AMP/SMP) system or multi processes/threads in uniprocessor system. + +properties: + compatible: + enum: + - altr,hwmutex-1.0 + - client-1.0 + + reg: + items: + - description: physical address of hw mutex and length of memory mapped + region + +additionalProperties: false + +required: + - compatible + - reg + +examples: + - | + mutex0: mutex0@100 { + compatible = "altr,hwmutex-1.0"; + reg = <0x100 0x8>; + }; + + + #Example of mutex's client node that includes mutex phandle + #mclient0: mclient0@200 { + # compatible = "client-1.0"; + # reg = <0x200 0x10>; + # mutex = <&mutex0>; + # };
drivers/misc/Kconfig +6 -0
@@ -435,6 +435,12 @@ config DW_XDATA_PCIE If unsure, say N. +config ALTERA_HWMUTEX + tristate "Altera Hardware Mutex" + help + This option enables device driver support for Altera Hardware Mutex. + Say Y here if you want to use the Altera hardware mutex support. + config PCI_ENDPOINT_TEST depends on PCI select CRC32
drivers/misc/Makefile +1 -0
@@ -40,6 +40,7 @@ obj-$(CONFIG_PCH_PHUB) += pch_phub.o obj-y += ti-st/ obj-y += lis3lv02d/ obj-$(CONFIG_ALTERA_STAPL) +=altera-stapl/ +obj-$(CONFIG_ALTERA_HWMUTEX) += altera_hwmutex.o obj-$(CONFIG_INTEL_MEI) += mei/ obj-$(CONFIG_VMWARE_VMCI) += vmw_vmci/ obj-$(CONFIG_LATTICE_ECP3_CONFIG) += lattice-ecp3-config.o
drivers/misc/altera_hwmutex.c new file +321 -0
321 lines not on this page · raw message
include/linux/altera_hwmutex.h new file +42 -0
42 lines not on this page · raw message
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerQuoted 8 lines · On Fri, Apr 01, 2022 at 05:49:11AM +0800, [email protected] wrote:
From: Niravkumar L Rabara <[email protected]>
Altera hardware mutex soft IP provides hardware assistance for synchronization and mutual exclusion between processors in asymmetric/symmetric multiprocessing (AMP/SMP) system or multi processes/threads in uniprocessor system.
Signed-off-by Niravkumar L Rabara <[email protected]>
Sorry, but you have not followed the Intel-required rules for submitting changes to the kernel. Please contact the Intel Linux kernel team for details about this to help prevent some of the problems that this submission contains.
thanks!
greg k-h
Greg Kroah-Hartman
maintainerQuoted 6 lines · On Fri, Apr 01, 2022 at 05:49:11AM +0800, [email protected] wrote:
--- .../bindings/misc/altera-hwmutex.yaml | 47 +++ drivers/misc/Kconfig | 6 + drivers/misc/Makefile | 1 + drivers/misc/altera_hwmutex.c | 321 ++++++++++++++++++ include/linux/altera_hwmutex.h | 42 +++
There is no need for a .h file for a single .c file. Please fix that up for your next submission.
I don't think I need to read anymore :)
thanks,
greg k-h
Rob Herring
maintainerQuoted 10 lines · On Fri, Apr 01, 2022 at 05:49:11AM +0800, [email protected] wrote:
From: Niravkumar L Rabara <[email protected]>
Altera hardware mutex soft IP provides hardware assistance for synchronization and mutual exclusion between processors in asymmetric/symmetric multiprocessing (AMP/SMP) system or multi processes/threads in uniprocessor system.
Signed-off-by Niravkumar L Rabara <[email protected]>--- .../bindings/misc/altera-hwmutex.yaml | 47 +++
Bindings should be separate patch. We have a subsystem/class for this type of h/w. The binding (and driver) belongs there.
Quoted 20 lines
drivers/misc/Kconfig | 6 + drivers/misc/Makefile | 1 + drivers/misc/altera_hwmutex.c | 321 ++++++++++++++++++ include/linux/altera_hwmutex.h | 42 +++ 5 files changed, 417 insertions(+) create mode 100644 Documentation/devicetree/bindings/misc/altera-hwmutex.yaml create mode 100644 drivers/misc/altera_hwmutex.c create mode 100644 include/linux/altera_hwmutex.hDocumentation/devicetree/bindings/misc/altera-hwmutex.yaml new file +5
-0@@ -0,0 +1,47 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/misc/altera-hwmutex.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml#
Documentation/devicetree/bindings/misc/altera-hwmutex.yaml line 15
Quoted 10 lines
Documentation/devicetree/bindings/misc/altera-hwmutex.yaml new file +10
-0+ +title: Altera hardware mutex + +maintainers: + - Niravkumar L Rabara <[email protected]> + +description: + Altera hardware mutex can provide hardware assistance for synchronization + and mutual exclusion between processors in asymmetric/symmetric multiprocessing + (AMP/SMP) system or multi processes/threads in uniprocessor system.
Link to IP documentation?
Documentation/devicetree/bindings/misc/altera-hwmutex.yaml line 20
Quoted 5 lines
Documentation/devicetree/bindings/misc/altera-hwmutex.yaml new file +5
-0+ +properties: + compatible: + enum: + - altr,hwmutex-1.0
1.0? I feel like you made up this version.
Documentation/devicetree/bindings/misc/altera-hwmutex.yaml line 21
Quoted 1 line
Documentation/devicetree/bindings/misc/altera-hwmutex.yaml new file +1
-0+ - client-1.0
No.
Quoted 15 lines
Documentation/devicetree/bindings/misc/altera-hwmutex.yaml new file +15
-0+ + reg: + items: + - description: physical address of hw mutex and length of memory mapped + region + +additionalProperties: false + +required: + - compatible + - reg + +examples: + - | + mutex0: mutex0@100 {
Documentation/devicetree/bindings/misc/altera-hwmutex.yaml line 46
Quoted 10 lines
Documentation/devicetree/bindings/misc/altera-hwmutex.yaml new file +10
-0+ compatible = "altr,hwmutex-1.0"; + reg = <0x100 0x8>; + }; + + + #Example of mutex's client node that includes mutex phandle + #mclient0: mclient0@200 { + # compatible = "client-1.0"; + # reg = <0x200 0x10>; + # mutex = <&mutex0>;
We have a standard binding for this.
Quoted 41 lines
Documentation/devicetree/bindings/misc/altera-hwmutex.yaml new file +1
-0+ # };drivers/misc/Kconfig +6
-0@@ -435,6 +435,12 @@ config DW_XDATA_PCIE If unsure, say N. +config ALTERA_HWMUTEX + tristate "Altera Hardware Mutex" + help + This option enables device driver support for Altera Hardware Mutex. + Say Y here if you want to use the Altera hardware mutex support. + config PCI_ENDPOINT_TEST depends on PCI select CRC32drivers/misc/Makefile +1
-0@@ -40,6 +40,7 @@ obj-$(CONFIG_PCH_PHUB) += pch_phub.o obj-y += ti-st/ obj-y += lis3lv02d/ obj-$(CONFIG_ALTERA_STAPL) +=altera-stapl/ +obj-$(CONFIG_ALTERA_HWMUTEX) += altera_hwmutex.o obj-$(CONFIG_INTEL_MEI) += mei/ obj-$(CONFIG_VMWARE_VMCI) += vmw_vmci/ obj-$(CONFIG_LATTICE_ECP3_CONFIG) += lattice-ecp3-config.odrivers/misc/altera_hwmutex.c new file +5
-0@@ -0,0 +1,321 @@ +// SPDX-License-Identifier: GPL-2.0 +/* +* Copyright Intel Corporation (C) 2022. All rights reserved +* +* This program is free software; you can redistribute it and/or modify it
drivers/misc/altera_hwmutex.c line 15
Quoted 10 lines
drivers/misc/altera_hwmutex.c new file +10
-0+* under the terms and conditions of the GNU General Public License, +* version 2, as published by the Free Software Foundation. +* +* This program is distributed in the hope it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +* more details. +* +* You should have received a copy of the GNU General Public License along with +* this program. If not, see <http://www.gnu.org/licenses/>.
Drop the license text. You only need SPDX-License-Identifier
Arnd Bergmann
maintainerQuoted 8 lines · On Thu, Mar 31, 2022 at 11:49 PM <[email protected]> wrote:
From: Niravkumar L Rabara <[email protected]>
Altera hardware mutex soft IP provides hardware assistance for synchronization and mutual exclusion between processors in asymmetric/symmetric multiprocessing (AMP/SMP) system or multi processes/threads in uniprocessor system.
Quoted 7 lines
Signed-off-by Niravkumar L Rabara <[email protected]>--- .../bindings/misc/altera-hwmutex.yaml | 47 +++ drivers/misc/Kconfig | 6 + drivers/misc/Makefile | 1 + drivers/misc/altera_hwmutex.c | 321 ++++++++++++++++++ include/linux/altera_hwmutex.h | 42 +++
Why does this use a custom interface rather than the generic drivers/hwspinlock/ subsystem?
Arnd