Re: [Openipmi-developer] [PATCH v3 1/3] ipmi: add an Aspeed BT IPMI BMC driver

2016-09-28 Thread Cédric Le Goater
On 09/28/2016 03:53 PM, Corey Minyard wrote:
> On 09/26/2016 01:50 AM, Cédric Le Goater wrote:
>>
   Changes since v1:

   - replace 'bt_host' by 'bt_bmc' to reflect that the driver is
 the BMC side of the IPMI BT interface
   - renamed the device to 'ipmi-bt-host'
   - introduced a temporary buffer to copy_{to,from}_user
   - used platform_get_irq()
   - moved the driver under drivers/char/ipmi/ but kept it as a misc
 device
   - changed the compatible cell to "aspeed,ast2400-bt-bmc"

   .../bindings/char/ipmi/aspeed,ast2400-bt-bmc.txt   |  23 +
>>> While similar, this is not the kernel directory structure. Just make
>>> this bindings/ipmi/
>>>
>>> With that,
>>>
>>> Acked-by: Rob Herring 
>> OK. So I suppose we should be moving all IPMI documentation under
>> the same directory.
>>
>>
>> Corey,
>>
>> If the move is okay for you, I can send the patch below.
>>
>> Thanks,
>>
>> C.
> 
> Sorry this took so long, I'm at a conference.  That change is fine, it does
> seem to match the structure better.

It's ok. 

Checkpatch really does not like that patch and I don't know what we can
do about it. You've been warned :) 

Thanks, 

C. 


./scripts/checkpatch.pl --strict  
0001-dt-bindings-ipmi-move-all-documentation-under-bindin.patch
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#12: 
 .../devicetree/bindings/{char => }/ipmi/aspeed,ast2400-bt-bmc.txt | 0

ERROR: Does not appear to be a unified-diff format patch

total: 1 errors, 1 warnings, 0 checks, 0 lines checked



--
___
Openipmi-developer mailing list
Openipmi-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openipmi-developer


Re: [Openipmi-developer] [PATCH v3 1/3] ipmi: add an Aspeed BT IPMI BMC driver

2016-09-28 Thread Corey Minyard
On 09/26/2016 01:50 AM, Cédric Le Goater wrote:
>
>>>   Changes since v1:
>>>
>>>   - replace 'bt_host' by 'bt_bmc' to reflect that the driver is
>>> the BMC side of the IPMI BT interface
>>>   - renamed the device to 'ipmi-bt-host'
>>>   - introduced a temporary buffer to copy_{to,from}_user
>>>   - used platform_get_irq()
>>>   - moved the driver under drivers/char/ipmi/ but kept it as a misc
>>> device
>>>   - changed the compatible cell to "aspeed,ast2400-bt-bmc"
>>>
>>>   .../bindings/char/ipmi/aspeed,ast2400-bt-bmc.txt   |  23 +
>> While similar, this is not the kernel directory structure. Just make
>> this bindings/ipmi/
>>
>> With that,
>>
>> Acked-by: Rob Herring 
> OK. So I suppose we should be moving all IPMI documentation under
> the same directory.
>
>
> Corey,
>
> If the move is okay for you, I can send the patch below.
>
> Thanks,
>
> C.

Sorry this took so long, I'm at a conference.  That change is fine, it does
seem to match the structure better.

-corey
>
>  From ca25f89b25209c260480cda5e5532d6bbe83ed43 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= 
> Date: Mon, 26 Sep 2016 08:45:15 +0200
> Subject: [PATCH] dt-bindings: ipmi: move all documentation under
>   bindings/ipmi/
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
>
> Signed-off-by: Cédric Le Goater 
> ---
>   .../devicetree/bindings/{char => }/ipmi/aspeed,ast2400-bt-bmc.txt | > 0
>   Documentation/devicetree/bindings/{ipmi.txt => ipmi/ipmi-smic.txt}| > 0
>   2 files changed, 0 insertions(+), 0 deletions(-)
>   rename Documentation/devicetree/bindings/{char => 
> }/ipmi/aspeed,ast2400-bt-bmc.txt (100%)
>   rename Documentation/devicetree/bindings/{ipmi.txt => ipmi/ipmi-smic.txt} 
> (100%)
>
> diff --git 
> a/Documentation/devicetree/bindings/char/ipmi/aspeed,ast2400-bt-bmc.txt 
> b/Documentation/devicetree/bindings/ipmi/aspeed,ast2400-bt-bmc.txt
> similarity index 100%
> rename from 
> Documentation/devicetree/bindings/char/ipmi/aspeed,ast2400-bt-bmc.txt
> rename to Documentation/devicetree/bindings/ipmi/aspeed,ast2400-bt-bmc.txt
> diff --git a/Documentation/devicetree/bindings/ipmi.txt 
> b/Documentation/devicetree/bindings/ipmi/ipmi-smic.txt
> similarity index 100%
> rename from Documentation/devicetree/bindings/ipmi.txt
> rename to Documentation/devicetree/bindings/ipmi/ipmi-smic.txt



--
___
Openipmi-developer mailing list
Openipmi-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openipmi-developer


[Openipmi-developer] [PATCH v3 1/3] ipmi: add an Aspeed BT IPMI BMC driver

2016-09-20 Thread Cédric Le Goater
From: Alistair Popple 

This patch adds a simple device driver to expose the iBT interface on
Aspeed SOCs (AST2400 and AST2500) as a character device. Such SOCs are
commonly used as BMCs (BaseBoard Management Controllers) and this
driver implements the BMC side of the BT interface.

The BT (Block Transfer) interface is used to perform in-band IPMI
communication between a host and its BMC. Entire messages are buffered
before sending a notification to the other end, host or BMC, that
there is data to be read. Usually, the host emits requests and the BMC
responses but the specification provides a mean for the BMC to send
SMS Attention (BMC-to-Host attention or System Management Software
attention) messages.

For this purpose, the driver introduces a specific ioctl on the
device: 'BT_BMC_IOCTL_SMS_ATN' that can be used by the system running
on the BMC to signal the host of such an event.

The device name defaults to '/dev/ipmi-bt-host'

Signed-off-by: Alistair Popple 
Signed-off-by: Jeremy Kerr 
Signed-off-by: Joel Stanley 
[clg: - checkpatch fixes
  - added a devicetree binding documentation
  - replace 'bt_host' by 'bt_bmc' to reflect that the driver is
the BMC side of the IPMI BT interface
  - renamed the device to 'ipmi-bt-host'
  - introduced a temporary buffer to copy_{to,from}_user
  - used platform_get_irq()
  - moved the driver under drivers/char/ipmi/ but kept it as a misc
device
  - changed the compatible cell to "aspeed,ast2400-bt-bmc"
]
Signed-off-by: Cédric Le Goater 
Acked-by: Arnd Bergmann 
[clg: - checkpatch --strict fixes
  - removed the use of devm_iounmap, devm_kfree in cleanup paths
  - introduced an atomic-t to limit opens to 1
  - introduced a mutex to protect write/read operations]
Signed-off-by: Cédric Le Goater 

---

 Changes since v2:

 - fixed checkpatch --strict issues
 - cleanup'ed includes
 - limit to one opener
 - protect write/read operations with a mutex.
 - removed the use of devm_iounmap, devm_kfree in cleanup paths

 Changes since v1:

 - replace 'bt_host' by 'bt_bmc' to reflect that the driver is
   the BMC side of the IPMI BT interface
 - renamed the device to 'ipmi-bt-host'
 - introduced a temporary buffer to copy_{to,from}_user
 - used platform_get_irq()
 - moved the driver under drivers/char/ipmi/ but kept it as a misc
   device
 - changed the compatible cell to "aspeed,ast2400-bt-bmc"

 .../bindings/char/ipmi/aspeed,ast2400-bt-bmc.txt   |  23 +
 drivers/Makefile   |   2 +-
 drivers/char/ipmi/Kconfig  |   7 +
 drivers/char/ipmi/Makefile |   1 +
 drivers/char/ipmi/bt-bmc.c | 510 +
 include/uapi/linux/Kbuild  |   1 +
 include/uapi/linux/bt-bmc.h|  18 +
 7 files changed, 561 insertions(+), 1 deletion(-)
 create mode 100644 
Documentation/devicetree/bindings/char/ipmi/aspeed,ast2400-bt-bmc.txt
 create mode 100644 drivers/char/ipmi/bt-bmc.c
 create mode 100644 include/uapi/linux/bt-bmc.h

diff --git 
a/Documentation/devicetree/bindings/char/ipmi/aspeed,ast2400-bt-bmc.txt 
b/Documentation/devicetree/bindings/char/ipmi/aspeed,ast2400-bt-bmc.txt
new file mode 100644
index ..fbbacd958240
--- /dev/null
+++ b/Documentation/devicetree/bindings/char/ipmi/aspeed,ast2400-bt-bmc.txt
@@ -0,0 +1,23 @@
+* Aspeed BT (Block Transfer) IPMI interface
+
+The Aspeed SOCs (AST2400 and AST2500) are commonly used as BMCs
+(BaseBoard Management Controllers) and the BT interface can be used to
+perform in-band IPMI communication with their host.
+
+Required properties:
+
+- compatible : should be "aspeed,ast2400-bt-bmc"
+- reg: physical address and size of the registers
+
+Optional properties:
+
+- interrupts: interrupt generated by the BT interface. without an
+  interrupt, the driver will operate in poll mode.
+
+Example:
+
+   ibt@1e789140 {
+   compatible = "aspeed,ast2400-bt-bmc";
+   reg = <0x1e789140 0x18>;
+   interrupts = <8>;
+   };
diff --git a/drivers/Makefile b/drivers/Makefile
index 53abb4a5f736..5a9e7b6b7928 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -21,7 +21,7 @@ obj-y += video/
 obj-y  += idle/
 
 # IPMI must come before ACPI in order to provide IPMI opregion support
-obj-$(CONFIG_IPMI_HANDLER) += char/ipmi/
+obj-y  += char/ipmi/
 
 obj-$(CONFIG_ACPI) += acpi/
 obj-$(CONFIG_SFI)  += sfi/
diff --git a/drivers/char/ipmi/Kconfig b/drivers/char/ipmi/Kconfig
index 5a9350b1069a..2c234e3e7513 100644
--- a/drivers/char/ipmi/Kconfig
+++ b/drivers/char/ipmi/Kconfig
@@ -76,3 +76,10 @@ config IPMI_POWEROFF
 the IPMI management controller is capable of this.
 
 endif #