Add SSIF BMC driver
Subsystems (6)
v4 cover Add SSIF BMC driver
This series add support the SSIF BMC driver which is to perform in-band IPMI communication with their host in management (BMC) side.
SSIF BMC driver in this series is tested with Aspeed AST2500.
v4:
+ Fix recursive spinlock [Graeme]
+ Send response with Completion code 0xFF when aborting [Quan]
+ Fix warning with dt_binding_check [Rob]
+ Change aspeed-ssif-bmc.yaml to ssif-bmc.yaml [Quan]
+ Added bounding check on SMBus writes and the whole request [Dan]
+ Moved buffer to end of struct ssif_bmc_ctx to avoid context
corruption if somehow buffer is written past the end [Dan]
+ Return -EINVAL if userspace buffer too small, dont
silence truncate [Corey, Joel]
+ Not necessary to check NONBLOCK in lock [Corey]
+ Enforce one user at a time [Joel]
+ Reject write with invalid response length from userspace [Corey]
+ Add state machines for better ssif bmc state handling [Quan]
+ Drop ssif_bmc_aspeed.c and make ssif_bmc.c is generic
SSIF BMC driver [Quan]
+ Change compatible string "aspeed,ast2500-ssif-bmc" to
"ampere,ssif-bmc" [Quan]
+ Toggle Slave enable in i2c-aspeed to turn on/off slave mode [Ryan]
+ Added slave_enable() to struct i2c_algorithm to control
slave mode and to address the recursive spinlock [Graeme, Ryan]
+ Abort current request with invalid SMBus write or
invalid command [Quan] + Abort all request if there is pending response [Quan] + Changed validate_pec() to validate_request() [Quan] + Add unsupported_smbus_cmd() to handle unknown SMBus command [Quan] + Print internal state string for ease investigating issue [Quan] + Move to READY state on SLAVE_STOP event [Quan] + Change initilize_transfer() to process_smbus_cmd() [Quan] + Introduce functions for each slave event [Quan]
v3:
+ Switched binding doc to use DT schema format [Rob]
+ Splited into generic ssif_bmc and aspeed-specific [Corey, Joel]
+ Removed redundant license info [Joel]
+ Switched to use traditional if-else [Joel]
+ Removed unused ssif_bmc_ioctl() [Joel]
+ Made handle_request()/complete_response() to return void [Joel]
+ Refactored send_ssif_bmc_response()/receive_ssif_bmc_request() [Corey]
+ Remove mutex [Corey]
+ Use spin_lock/unlock_irqsave/restore in callback [Corey]
+ Removed the unnecessary memset [Corey]
+ Switch to use dev_err() [Corey]
+ Combine mask/unmask two interrupts together [Corey]
+ Fixed unhandled Tx done with NAK [Quan]
+ Late ack'ed Tx done w/wo Ack irq [Quan]
+ Use aspeed-specific exported aspeed_set_slave_busy() when slave busy to fix the deadlock [Graeme, Philipp, Quan]
+ Clean buffer for last multipart read [Quan]
+ Handle unknown incoming command [Quan]
v2:
+ Fixed compiling error with COMPILE_TEST for arc
Quan Nguyen (3):
ipmi: ssif_bmc: Add SSIF BMC driver
bindings: ipmi: Add binding for SSIF BMC driver
i2c: aspeed: Add slave_enable() to toggle slave mode
.../devicetree/bindings/ipmi/ssif-bmc.yaml | 38 + drivers/char/ipmi/Kconfig | 11 + drivers/char/ipmi/Makefile | 1 + drivers/char/ipmi/ssif_bmc.c | 781 ++++++++++++++++++ drivers/char/ipmi/ssif_bmc.h | 106 +++ drivers/i2c/busses/i2c-aspeed.c | 20 + include/linux/i2c.h | 2 + 7 files changed, 959 insertions(+) create mode 100644 Documentation/devicetree/bindings/ipmi/ssif-bmc.yaml create mode 100644 drivers/char/ipmi/ssif_bmc.c create mode 100644 drivers/char/ipmi/ssif_bmc.h
Signature · 1 line
2.28.0
PATCH v4 1/3 ipmi: ssif_bmc: Add SSIF BMC driver
The SMBus system interface (SSIF) IPMI BMC driver can be used to perform in-band IPMI communication with their host in management (BMC) side.
---
v4:
+ Send response with Completion code 0xFF when aborting [Quan]
+ Added bounding check on SMBus writes and the whole request [Dan]
+ Moved buffer to end of struct ssif_bmc_ctx to avoid context
corruption if somehow buffer is written past the end [Dan]
+ Return -EINVAL if userspace buffer too small, dont
silence truncate [Corey, Joel]
+ Not necessary to check NONBLOCK in lock [Corey]
+ Enforce one user at a time [Joel]
+ Reject write with invalid response length from userspace [Corey]
+ Add state machines for better ssif bmc state handling [Quan]
+ Drop ssif_bmc_aspeed.c and make ssif_bmc.c is generic
SSIF BMC driver [Quan]
+ Change compatible string "aspeed,ast2500-ssif-bmc" to
"ampere,ssif-bmc" [Quan]
+ Abort current request with invalid SMBus write or
invalid command [Quan] + Abort all request if there is pending response [Quan] + Changed validate_pec() to validate_request() [Quan] + Add unsupported_smbus_cmd() to handle unknown SMBus command [Quan] + Print internal state string for ease investigating issue [Quan] + Move to READY state on SLAVE_STOP event [Quan] + Change initilize_transfer() to process_smbus_cmd() [Quan] + Introduce functions for each slave event [Quan]
v3:
+ Removed redundant license info [Joel]
+ Switched to use traditional if-else [Joel]
+ Removed unused ssif_bmc_ioctl() [Joel]
+ Made handle_request()/complete_response() to return void [Joel]
+ Refactored send_ssif_bmc_response()/receive_ssif_bmc_request()
[Corey]
+ Removed mutex [Corey]
+ Use spin_lock/unlock_irqsave/restore in callback [Corey]
+ Removed the unnecessary memset [Corey]
+ Switch to use dev_err() [Corey]
v2:
+ Fixed compiling error with COMPILE_TEST for arc
drivers/char/ipmi/Kconfig | 11 + drivers/char/ipmi/Makefile | 1 + drivers/char/ipmi/ssif_bmc.c | 781 +++++++++++++++++++++++++++++++++++ drivers/char/ipmi/ssif_bmc.h | 106 +++++ 4 files changed, 899 insertions(+) create mode 100644 drivers/char/ipmi/ssif_bmc.c create mode 100644 drivers/char/ipmi/ssif_bmc.h
drivers/char/ipmi/Kconfig +11 -0
@@ -160,6 +160,17 @@ config ASPEED_BT_IPMI_BMC found on Aspeed SOCs (AST2400 and AST2500). The driver implements the BMC side of the BT interface. +config SSIF_IPMI_BMC + tristate "SSIF IPMI BMC driver" + select I2C + select I2C_SLAVE + help + This enables the IPMI SMBus system interface (SSIF) at the + management (BMC) side. + + The driver implements the BMC side of the SMBus system + interface (SSIF). + config IPMB_DEVICE_INTERFACE tristate 'IPMB Interface handler' depends on I2C
drivers/char/ipmi/Makefile +1 -0
@@ -29,3 +29,4 @@ obj-$(CONFIG_ASPEED_BT_IPMI_BMC) += bt-bmc.o obj-$(CONFIG_ASPEED_KCS_IPMI_BMC) += kcs_bmc_aspeed.o obj-$(CONFIG_NPCM7XX_KCS_IPMI_BMC) += kcs_bmc_npcm7xx.o obj-$(CONFIG_IPMB_DEVICE_INTERFACE) += ipmb_dev_int.o +obj-$(CONFIG_SSIF_IPMI_BMC) += ssif_bmc.o
drivers/char/ipmi/ssif_bmc.c new file +781 -0
781 lines not on this page · raw message
drivers/char/ipmi/ssif_bmc.h new file +106 -0
106 lines not on this page · raw message
Signature · 1 line
2.28.0
kernel test robot
build botRe: [PATCH v4 1/3] ipmi: ssif_bmc: Add SSIF BMC driver
I love your patch! Yet something to improve:
Hi Quan,
I love your patch! Yet something to improve:
[auto build test ERROR on char-misc/char-misc-testing]
[also build test ERROR on wsa/i2c/for-next ipmi/for-next v5.14-rc1 next-20210713] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Quan-Nguyen/Add-SSIF-BMC-driver/20210713-135600 base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git 77d34a4683b053108ecd466cc7c4193b45805528 config: arc-allyesconfig (attached as .config) compiler: arceb-elf-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/cf593040967f887f9c4957726fcdccc8fbaa6f9e
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Quan-Nguyen/Add-SSIF-BMC-driver/20210713-135600 git checkout cf593040967f887f9c4957726fcdccc8fbaa6f9e
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Note: the linux-review/Quan-Nguyen/Add-SSIF-BMC-driver/20210713-135600 HEAD 92b8df8e5b040f3d832db695bc204463986f7fcd builds fine.
It only hurts bisectibility.
All errors (new ones prefixed by >>):
drivers/char/ipmi/ssif_bmc.c: In function 'ssif_bmc_write':
>> drivers/char/ipmi/ssif_bmc.c:111:37: error: 'const struct i2c_algorithm' has no member named 'slave_enable'
111 | if (ssif_bmc->client->adapter->algo->slave_enable)
| ^~
drivers/char/ipmi/ssif_bmc.c:112:40: error: 'const struct i2c_algorithm' has no member named 'slave_enable'
112 | ret = ssif_bmc->client->adapter->algo->slave_enable(ssif_bmc->client, true);
| ^~
drivers/char/ipmi/ssif_bmc.c: In function 'handle_request':
drivers/char/ipmi/ssif_bmc.c:188:37: error: 'const struct i2c_algorithm' has no member named 'slave_enable'
188 | if (ssif_bmc->client->adapter->algo->slave_enable)
| ^~
drivers/char/ipmi/ssif_bmc.c:189:34: error: 'const struct i2c_algorithm' has no member named 'slave_enable'
189 | ssif_bmc->client->adapter->algo->slave_enable(ssif_bmc->client, false);
| ^~vim +111 drivers/char/ipmi/ssif_bmc.c
75
76 /* Handle SSIF message that is written by user */
77 static ssize_t ssif_bmc_write(struct file *file, const char __user *buf, size_t count,
78 loff_t *ppos)
79 {
80 struct ssif_bmc_ctx *ssif_bmc = to_ssif_bmc(file);
81 struct ssif_msg msg;
82 unsigned long flags;
83 ssize_t ret;
84
85 if (count > sizeof(struct ssif_msg))
86 return -EINVAL;
87
88 ret = copy_from_user(&msg, buf, count);
89 if (ret)
90 return ret;
91
92 if (!msg.len || count < ssif_msg_len(&msg))
93 return -EINVAL;
94
95 spin_lock_irqsave(&ssif_bmc->lock, flags);
96 while (ssif_bmc->response_in_progress) {
97 spin_unlock_irqrestore(&ssif_bmc->lock, flags);
98 if (file->f_flags & O_NONBLOCK)
99 return -EAGAIN;
100 ret = wait_event_interruptible(ssif_bmc->wait_queue,
101 !ssif_bmc->response_in_progress);
102 if (ret)
103 return ret;
104 spin_lock_irqsave(&ssif_bmc->lock, flags);
105 }
106
107 memcpy(&ssif_bmc->response, &msg, count);
108 ssif_bmc->is_singlepart_read = (ssif_msg_len(&msg) <= MAX_PAYLOAD_PER_TRANSACTION + 1);
109 ssif_bmc->response_in_progress = true;
110
> 111 if (ssif_bmc->client->adapter->algo->slave_enable) 112 ret = ssif_bmc->client->adapter->algo->slave_enable(ssif_bmc->client, true);
113
114 spin_unlock_irqrestore(&ssif_bmc->lock, flags);
115
116 return (ret < 0) ? ret : count;
117 }
118
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]
PATCH v4 2/3 bindings: ipmi: Add binding for SSIF BMC driver
In reply to Quan NguyenAdd device tree binding document for the SSIF BMC driver.
---
v4:
+ Fix warning with dt_binding_check [Rob]
+ Change aspeed-ssif-bmc.yaml to ssif-bmc.yaml [Quan]
v3:
+ Switched to use DT schema format [Rob]
v2:
+ None
.../devicetree/bindings/ipmi/ssif-bmc.yaml | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Documentation/devicetree/bindings/ipmi/ssif-bmc.yaml
Documentation/devicetree/bindings/ipmi/ssif-bmc.yaml new file +38 -0
@@ -0,0 +1,38 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/ipmi/ssif-bmc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: SSIF IPMI BMC interface + +description: SSIF IPMI BMC device bindings + +maintainers: + - Quan Nguyen <[email protected]> + +properties: + compatible: + enum: + - ampere,ssif-bmc + + reg: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + ssif-bmc at 10 { + compatible = "ampere,ssif-bmc"; + reg = <0x10>; + }; + };
Signature · 1 line
2.28.0
PATCH v4 3/3 i2c: aspeed: Add slave_enable() to toggle slave mode
In reply to Quan NguyenSlave needs time to prepare the response data before Master could enquiry via read transaction. However, there is no mechanism for i2c-aspeed Slave to notify Master that it needs more time to process and this make Master side to time out when trying to get the response.
This commit introduces the slave_enable() callback in struct i2c_algorithm for Slave to temporary stop the Slave mode while working on the response and re-enable the Slave when response data ready.
---
v4:
+ First introduced follow Ryan's suggestion [Ryan]
+ Fix recursive spinlock issue in v3 (aspeed_set_slave_busy())
and apply in this patch [Graeme]
drivers/i2c/busses/i2c-aspeed.c | 20 ++++++++++++++++++++ include/linux/i2c.h | 2 ++ 2 files changed, 22 insertions(+)
drivers/i2c/busses/i2c-aspeed.c +20 -0
@@ -785,6 +785,25 @@ static int aspeed_i2c_unreg_slave(struct i2c_client *client)return 0 ; } + +static int aspeed_i2c_slave_enable (struct i2c_client *client,bool enable) +{ +struct aspeed_i2c_bus *bus =i2c_get_adapdata (client->adapter); +u32 func_ctrl_reg_val; + +if (!bus->slave) +return -EINVAL ; + +/* Toggle slave mode. */ + func_ctrl_reg_val =readl (bus->base +ASPEED_I2C_FUN_CTRL_REG ); +if (enable) + func_ctrl_reg_val |=ASPEED_I2CD_SLAVE_EN ; +else + func_ctrl_reg_val &= ~ASPEED_I2CD_SLAVE_EN ; +writel (func_ctrl_reg_val, bus->base +ASPEED_I2C_FUN_CTRL_REG ); + +return 0 ; +}#endif /* CONFIG_I2C_SLAVE */ static const struct i2c_algorithm aspeed_i2c_algo = {
@@ -793,6 +812,7 @@ static const struct i2c_algorithm aspeed_i2c_algo = {#if IS_ENABLED (CONFIG_I2C_SLAVE ) .reg_slave = aspeed_i2c_reg_slave, .unreg_slave = aspeed_i2c_unreg_slave, + .slave_enable = aspeed_i2c_slave_enable,#endif /* CONFIG_I2C_SLAVE */ };
include/linux/i2c.h +2 -0
@@ -520,6 +520,7 @@ i2c_register_board_info(int busnum, struct i2c_board_info const *info,* from the ``I2C_FUNC_*`` flags. * @reg_slave: Register given client to I2C slave mode of this adapter * @unreg_slave: Unregister given client from I2C slave mode of this adapter +* @slave_enable: Toggle enable slave mode for given client of this adapter * * The following structs are for those who like to implement new bus drivers: * i2c_algorithm is the interface to a class of hardware solutions which can
@@ -557,6 +558,7 @@ struct i2c_algorithm {#if IS_ENABLED (CONFIG_I2C_SLAVE )int (*reg_slave)(struct i2c_client *client);int (*unreg_slave)(struct i2c_client *client); +int (*slave_enable)(struct i2c_client *client,bool enable);#endif };
Signature · 1 line
2.28.0
Quoted 2 lines · Quan Nguyen
This series add support the SSIF BMC driver which is to perform in-band IPMI communication with their host in management (BMC) side.
Per the kernel build robot, looks like patch 3 introduces slave_enable() but patch 1 uses it.
-corey
Quoted 78 lines
SSIF BMC driver in this series is tested with Aspeed AST2500.
v4:
+ Fix recursive spinlock [Graeme]
+ Send response with Completion code0xFFwhen aborting [Quan]
+ Fix warning withdt_binding_check[Rob]
+ Changeaspeed-ssif-bmc.yamltossif-bmc.yaml[Quan]
+ Added bounding check on SMBus writes and the whole request [Dan]
+ Moved buffer to end of structssif_bmc_ctxto avoid context
corruption if somehow buffer is written past the end [Dan]
+ Return-EINVALif userspace buffer too small, dont
silence truncate [Corey, Joel]
+ Not necessary to check NONBLOCK in lock [Corey]
+ Enforce one user at a time [Joel]
+ Reject write with invalid response length from userspace [Corey]
+ Add state machines for better ssif bmc state handling [Quan]
+ Dropssif_bmc_aspeed.cand makessif_bmc.cis generic
SSIF BMC driver [Quan]
+ Change compatible string "aspeed,ast2500-ssif-bmc" to
"ampere,ssif-bmc" [Quan]
+ Toggle Slave enable in i2c-aspeed to turn on/off slave mode [Ryan]
+ Addedslave_enable()to structi2c_algorithmto control
slave mode and to address the recursive spinlock [Graeme, Ryan]
+ Abort current request with invalid SMBus write orinvalid command [Quan] + Abort all request if there is pending response [Quan] + Changed validate_pec() to validate_request() [Quan] + Add unsupported_smbus_cmd() to handle unknown SMBus command [Quan] + Print internal state string for ease investigating issue [Quan] + Move to READY state on SLAVE_STOP event [Quan] + Change initilize_transfer() to process_smbus_cmd() [Quan] + Introduce functions for each slave event [Quan]v3:
+ Switched binding doc to use DT schema format [Rob]
+ Splited into genericssif_bmcand aspeed-specific [Corey, Joel]
+ Removed redundant license info [Joel]
+ Switched to use traditional if-else [Joel]
+ Removed unusedssif_bmc_ioctl()[Joel]
+ Made handle_request()/complete_response() to return void [Joel]
+ Refactored send_ssif_bmc_response()/receive_ssif_bmc_request() [Corey]
+ Remove mutex [Corey]
+ Use spin_lock/unlock_irqsave/restore in callback [Corey]
+ Removed the unnecessary memset [Corey]
+ Switch to usedev_err()[Corey]
+ Combine mask/unmask two interrupts together [Corey]
+ Fixed unhandled Tx done with NAK [Quan]
+ Late ack'ed Tx done w/wo Ack irq [Quan]
+ Use aspeed-specific exportedaspeed_set_slave_busy()when slave busy to fix the deadlock [Graeme, Philipp, Quan]
+ Clean buffer for last multipart read [Quan]
+ Handle unknown incoming command [Quan]v2:
+ Fixed compiling error withCOMPILE_TESTfor arcQuan Nguyen (3):
ipmi:ssif_bmc: Add SSIF BMC driver
bindings: ipmi: Add binding for SSIF BMC driver
i2c: aspeed: Addslave_enable()to toggle slave mode.../devicetree/bindings/ipmi/ssif-bmc.yaml | 38 + drivers/char/ipmi/Kconfig | 11 + drivers/char/ipmi/Makefile | 1 + drivers/char/ipmi/ssif_bmc.c | 781 ++++++++++++++++++ drivers/char/ipmi/ssif_bmc.h | 106 +++ drivers/i2c/busses/i2c-aspeed.c | 20 + include/linux/i2c.h | 2 + 7 files changed, 959 insertions(+) create mode 100644 Documentation/devicetree/bindings/ipmi/ssif-bmc.yaml create mode 100644 drivers/char/ipmi/ssif_bmc.c create mode 100644 drivers/char/ipmi/ssif_bmc.hSignature · 1 line
2.28.0
Quoted 9 lines · Corey Minyard
Quoted 2 lines · Quan Nguyen
This series add support the SSIF BMC driver which is to perform in-band IPMI communication with their host in management (BMC) side.
Per the kernel build robot, looks like patch 3 introduces
slave_enable()but patch 1 uses it.-corey
Thanks Corey,
The order is not correct and kernel build robot found this hurts bisectibility.
The patch 3 should be the first patch.
- Quan
Quoted 78 lines
Quoted 78 lines
SSIF BMC driver in this series is tested with Aspeed AST2500.
v4:
+ Fix recursive spinlock [Graeme]
+ Send response with Completion code0xFFwhen aborting [Quan]
+ Fix warning withdt_binding_check[Rob]
+ Changeaspeed-ssif-bmc.yamltossif-bmc.yaml[Quan]
+ Added bounding check on SMBus writes and the whole request [Dan]
+ Moved buffer to end of structssif_bmc_ctxto avoid context
corruption if somehow buffer is written past the end [Dan]
+ Return-EINVALif userspace buffer too small, dont
silence truncate [Corey, Joel]
+ Not necessary to check NONBLOCK in lock [Corey]
+ Enforce one user at a time [Joel]
+ Reject write with invalid response length from userspace [Corey]
+ Add state machines for better ssif bmc state handling [Quan]
+ Dropssif_bmc_aspeed.cand makessif_bmc.cis generic
SSIF BMC driver [Quan]
+ Change compatible string "aspeed,ast2500-ssif-bmc" to
"ampere,ssif-bmc" [Quan]
+ Toggle Slave enable in i2c-aspeed to turn on/off slave mode [Ryan]
+ Addedslave_enable()to structi2c_algorithmto control
slave mode and to address the recursive spinlock [Graeme, Ryan]
+ Abort current request with invalid SMBus write orinvalid command [Quan] + Abort all request if there is pending response [Quan] + Changed validate_pec() to validate_request() [Quan] + Add unsupported_smbus_cmd() to handle unknown SMBus command [Quan] + Print internal state string for ease investigating issue [Quan] + Move to READY state on SLAVE_STOP event [Quan] + Change initilize_transfer() to process_smbus_cmd() [Quan] + Introduce functions for each slave event [Quan]v3:
+ Switched binding doc to use DT schema format [Rob]
+ Splited into genericssif_bmcand aspeed-specific [Corey, Joel]
+ Removed redundant license info [Joel]
+ Switched to use traditional if-else [Joel]
+ Removed unusedssif_bmc_ioctl()[Joel]
+ Made handle_request()/complete_response() to return void [Joel]
+ Refactored send_ssif_bmc_response()/receive_ssif_bmc_request() [Corey]
+ Remove mutex [Corey]
+ Use spin_lock/unlock_irqsave/restore in callback [Corey]
+ Removed the unnecessary memset [Corey]
+ Switch to usedev_err()[Corey]
+ Combine mask/unmask two interrupts together [Corey]
+ Fixed unhandled Tx done with NAK [Quan]
+ Late ack'ed Tx done w/wo Ack irq [Quan]
+ Use aspeed-specific exportedaspeed_set_slave_busy()when slave busy to fix the deadlock [Graeme, Philipp, Quan]
+ Clean buffer for last multipart read [Quan]
+ Handle unknown incoming command [Quan]v2:
+ Fixed compiling error withCOMPILE_TESTfor arcQuan Nguyen (3):
ipmi:ssif_bmc: Add SSIF BMC driver
bindings: ipmi: Add binding for SSIF BMC driver
i2c: aspeed: Addslave_enable()to toggle slave mode.../devicetree/bindings/ipmi/ssif-bmc.yaml | 38 + drivers/char/ipmi/Kconfig | 11 + drivers/char/ipmi/Makefile | 1 + drivers/char/ipmi/ssif_bmc.c | 781 ++++++++++++++++++ drivers/char/ipmi/ssif_bmc.h | 106 +++ drivers/i2c/busses/i2c-aspeed.c | 20 + include/linux/i2c.h | 2 + 7 files changed, 959 insertions(+)create mode 100644
Documentation/devicetree/bindings/ipmi/ssif-bmc.yamlcreate mode 100644drivers/char/ipmi/ssif_bmc.c
create mode 100644drivers/char/ipmi/ssif_bmc.hSignature · 1 line
2.28.0
Quoted 8 lines · Quan Nguyen
Quoted 7 lines · Corey Minyard
Quoted 2 lines · Quan Nguyen
This series add support the SSIF BMC driver which is to perform in-band IPMI communication with their host in management (BMC) side.
Per the kernel build robot, looks like patch 3 introduces
slave_enable()but patch 1 uses it.
Quoted 7 lines
Quoted 2 lines
-corey
Thanks Corey,
The order is not correct and kernel build robot found this hurts bisectibility.
The patch 3 should be the first patch.
Ok, can you re-submit in the right order?
Thanks,
-corey
Quoted 82 lines
- Quan
Quoted 78 lines
Quoted 78 lines
SSIF BMC driver in this series is tested with Aspeed AST2500.
v4:
+ Fix recursive spinlock [Graeme]
+ Send response with Completion code0xFFwhen aborting [Quan]
+ Fix warning withdt_binding_check[Rob]
+ Changeaspeed-ssif-bmc.yamltossif-bmc.yaml[Quan]
+ Added bounding check on SMBus writes and the whole request [Dan]
+ Moved buffer to end of structssif_bmc_ctxto avoid context
corruption if somehow buffer is written past the end [Dan]
+ Return-EINVALif userspace buffer too small, dont
silence truncate [Corey, Joel]
+ Not necessary to check NONBLOCK in lock [Corey]
+ Enforce one user at a time [Joel]
+ Reject write with invalid response length from userspace [Corey]
+ Add state machines for better ssif bmc state handling [Quan]
+ Dropssif_bmc_aspeed.cand makessif_bmc.cis generic
SSIF BMC driver [Quan]
+ Change compatible string "aspeed,ast2500-ssif-bmc" to
"ampere,ssif-bmc" [Quan]
+ Toggle Slave enable in i2c-aspeed to turn on/off slave mode [Ryan]
+ Addedslave_enable()to structi2c_algorithmto control
slave mode and to address the recursive spinlock [Graeme, Ryan]
+ Abort current request with invalid SMBus write orinvalid command [Quan] + Abort all request if there is pending response [Quan] + Changed validate_pec() to validate_request() [Quan] + Add unsupported_smbus_cmd() to handle unknown SMBus command [Quan] + Print internal state string for ease investigating issue [Quan] + Move to READY state on SLAVE_STOP event [Quan] + Change initilize_transfer() to process_smbus_cmd() [Quan] + Introduce functions for each slave event [Quan]v3:
+ Switched binding doc to use DT schema format [Rob]
+ Splited into genericssif_bmcand aspeed-specific [Corey, Joel]
+ Removed redundant license info [Joel]
+ Switched to use traditional if-else [Joel]
+ Removed unusedssif_bmc_ioctl()[Joel]
+ Made handle_request()/complete_response() to return void [Joel]
+ Refactored send_ssif_bmc_response()/receive_ssif_bmc_request() [Corey]
+ Remove mutex [Corey]
+ Use spin_lock/unlock_irqsave/restore in callback [Corey]
+ Removed the unnecessary memset [Corey]
+ Switch to usedev_err()[Corey]
+ Combine mask/unmask two interrupts together [Corey]
+ Fixed unhandled Tx done with NAK [Quan]
+ Late ack'ed Tx done w/wo Ack irq [Quan]
+ Use aspeed-specific exportedaspeed_set_slave_busy()when slave busy to fix the deadlock [Graeme, Philipp, Quan]
+ Clean buffer for last multipart read [Quan]
+ Handle unknown incoming command [Quan]v2:
+ Fixed compiling error withCOMPILE_TESTfor arcQuan Nguyen (3):
ipmi:ssif_bmc: Add SSIF BMC driver
bindings: ipmi: Add binding for SSIF BMC driver
i2c: aspeed: Addslave_enable()to toggle slave mode.../devicetree/bindings/ipmi/ssif-bmc.yaml | 38 + drivers/char/ipmi/Kconfig | 11 + drivers/char/ipmi/Makefile | 1 + drivers/char/ipmi/ssif_bmc.c | 781 ++++++++++++++++++ drivers/char/ipmi/ssif_bmc.h | 106 +++ drivers/i2c/busses/i2c-aspeed.c | 20 + include/linux/i2c.h | 2 + 7 files changed, 959 insertions(+)create mode 100644
Documentation/devicetree/bindings/ipmi/ssif-bmc.yamlcreate mode 100644drivers/char/ipmi/ssif_bmc.c
create mode 100644drivers/char/ipmi/ssif_bmc.hSignature · 1 line
2.28.0
Quoted 17 lines · Corey Minyard
Quoted 8 lines · Quan Nguyen
Quoted 7 lines · Corey Minyard
Quoted 2 lines · Quan Nguyen
This series add support the SSIF BMC driver which is to perform in-band IPMI communication with their host in management (BMC) side.
Per the kernel build robot, looks like patch 3 introduces
slave_enable()but patch 1 uses it.Quoted 7 lines
Quoted 2 lines
-corey
Thanks Corey,
The order is not correct and kernel build robot found this hurts bisectibility.
The patch 3 should be the first patch.
Quoted 6 lines
Ok, can you re-submit in the right order?
Thanks,
-corey
Yes, I will re-submit new series with right order soon.
Quoted 82 lines
Quoted 82 lines
- Quan
Quoted 78 lines
Quoted 78 lines
SSIF BMC driver in this series is tested with Aspeed AST2500.
v4:
+ Fix recursive spinlock [Graeme]
+ Send response with Completion code0xFFwhen aborting [Quan]
+ Fix warning withdt_binding_check[Rob]
+ Changeaspeed-ssif-bmc.yamltossif-bmc.yaml[Quan]
+ Added bounding check on SMBus writes and the whole request [Dan]
+ Moved buffer to end of structssif_bmc_ctxto avoid context
corruption if somehow buffer is written past the end [Dan]
+ Return-EINVALif userspace buffer too small, dont
silence truncate [Corey, Joel]
+ Not necessary to check NONBLOCK in lock [Corey]
+ Enforce one user at a time [Joel]
+ Reject write with invalid response length from userspace [Corey]
+ Add state machines for better ssif bmc state handling [Quan]
+ Dropssif_bmc_aspeed.cand makessif_bmc.cis generic
SSIF BMC driver [Quan]
+ Change compatible string "aspeed,ast2500-ssif-bmc" to
"ampere,ssif-bmc" [Quan]
+ Toggle Slave enable in i2c-aspeed to turn on/off slave mode [Ryan]
+ Addedslave_enable()to structi2c_algorithmto control
slave mode and to address the recursive spinlock [Graeme, Ryan]
+ Abort current request with invalid SMBus write or
invalid command [Quan]
+ Abort all request if there is pending response [Quan]
+ Changedvalidate_pec()tovalidate_request()[Quan]
+ Addunsupported_smbus_cmd()to handle unknown SMBus command [Quan]
+ Print internal state string for ease investigating issue [Quan]
+ Move to READY state onSLAVE_STOPevent [Quan]
+ Changeinitilize_transfer()toprocess_smbus_cmd()[Quan]
+ Introduce functions for each slave event [Quan]v3:
+ Switched binding doc to use DT schema format [Rob]
+ Splited into genericssif_bmcand aspeed-specific [Corey, Joel]
+ Removed redundant license info [Joel]
+ Switched to use traditional if-else [Joel]
+ Removed unusedssif_bmc_ioctl()[Joel]
+ Made handle_request()/complete_response() to return void [Joel]
+ Refactored send_ssif_bmc_response()/receive_ssif_bmc_request() [Corey]
+ Remove mutex [Corey]
+ Use spin_lock/unlock_irqsave/restore in callback [Corey]
+ Removed the unnecessary memset [Corey]
+ Switch to usedev_err()[Corey]
+ Combine mask/unmask two interrupts together [Corey]
+ Fixed unhandled Tx done with NAK [Quan]
+ Late ack'ed Tx done w/wo Ack irq [Quan]
+ Use aspeed-specific exportedaspeed_set_slave_busy()when slave busy to fix the deadlock [Graeme, Philipp, Quan]
+ Clean buffer for last multipart read [Quan]
+ Handle unknown incoming command [Quan]v2:
+ Fixed compiling error withCOMPILE_TESTfor arcQuan Nguyen (3):
ipmi:ssif_bmc: Add SSIF BMC driver
bindings: ipmi: Add binding for SSIF BMC driver
i2c: aspeed: Addslave_enable()to toggle slave mode.../devicetree/bindings/ipmi/ssif-bmc.yaml | 38 + drivers/char/ipmi/Kconfig | 11 + drivers/char/ipmi/Makefile | 1 + drivers/char/ipmi/ssif_bmc.c | 781 ++++++++++++++++++ drivers/char/ipmi/ssif_bmc.h | 106 +++ drivers/i2c/busses/i2c-aspeed.c | 20 + include/linux/i2c.h | 2 + 7 files changed, 959 insertions(+)create mode 100644
Documentation/devicetree/bindings/ipmi/ssif-bmc.yamlcreate mode 100644drivers/char/ipmi/ssif_bmc.c
create mode 100644drivers/char/ipmi/ssif_bmc.hSignature · 1 line
2.28.0