Commit 8de1037a authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'for-linus-6.1-1' of https://github.com/cminyard/linux-ipmi

Pull IPMI updates from Corey Minyard:
 "Fix a bunch of little problems in IPMI

  This is mostly just doc, config, and little tweaks. Nothing big, which
  is why there was nothing for 6.0. There is one crash fix, but it's not
  something that I think anyone is using yet"

* tag 'for-linus-6.1-1' of https://github.com/cminyard/linux-ipmi:
  ipmi: Remove unused struct watcher_entry
  ipmi: kcs: aspeed: Update port address comments
  ipmi: Add __init/__exit annotations to module init/exit funcs
  ipmi:ipmb: Don't call ipmi_unregister_smi() on a register failure
  ipmi:ipmb: Fix a vague comment and a typo
  dt-binding: ipmi: add fallback to npcm845 compatible
  ipmi: Fix comment typo
  char: ipmi: modify NPCM KCS configuration
  dt-bindings: ipmi: Add npcm845 compatible
parents c6cc4f72 05763c99
* Nuvoton NPCM7xx KCS (Keyboard Controller Style) IPMI interface * Nuvoton NPCM KCS (Keyboard Controller Style) IPMI interface
The Nuvoton SOCs (NPCM7xx) are commonly used as BMCs The Nuvoton SOCs (NPCM) are commonly used as BMCs
(Baseboard Management Controllers) and the KCS interface can be (Baseboard Management Controllers) and the KCS interface can be
used to perform in-band IPMI communication with their host. used to perform in-band IPMI communication with their host.
Required properties: Required properties:
- compatible : should be one of - compatible : should be one of
"nuvoton,npcm750-kcs-bmc" "nuvoton,npcm750-kcs-bmc"
"nuvoton,npcm845-kcs-bmc", "nuvoton,npcm750-kcs-bmc"
- interrupts : interrupt generated by the controller - interrupts : interrupt generated by the controller
- kcs_chan : The KCS channel number in the controller - kcs_chan : The KCS channel number in the controller
......
...@@ -119,13 +119,13 @@ config ASPEED_KCS_IPMI_BMC ...@@ -119,13 +119,13 @@ config ASPEED_KCS_IPMI_BMC
provides the access of KCS IO space for BMC side. provides the access of KCS IO space for BMC side.
config NPCM7XX_KCS_IPMI_BMC config NPCM7XX_KCS_IPMI_BMC
depends on ARCH_NPCM7XX || COMPILE_TEST depends on ARCH_NPCM || COMPILE_TEST
select IPMI_KCS_BMC select IPMI_KCS_BMC
select REGMAP_MMIO select REGMAP_MMIO
tristate "NPCM7xx KCS IPMI BMC driver" tristate "NPCM KCS IPMI BMC driver"
help help
Provides a driver for the KCS (Keyboard Controller Style) IPMI Provides a driver for the KCS (Keyboard Controller Style) IPMI
interface found on Nuvoton NPCM7xx SOCs. interface found on Nuvoton NPCM SOCs.
The driver implements the BMC side of the KCS contorller, it The driver implements the BMC side of the KCS contorller, it
provides the access of KCS IO space for BMC side. provides the access of KCS IO space for BMC side.
......
...@@ -218,8 +218,8 @@ static void ipmi_ipmb_send_response(struct ipmi_ipmb_dev *iidev, ...@@ -218,8 +218,8 @@ static void ipmi_ipmb_send_response(struct ipmi_ipmb_dev *iidev,
{ {
if ((msg->data[0] >> 2) & 1) { if ((msg->data[0] >> 2) & 1) {
/* /*
* It's a response being sent, we needto return a * It's a response being sent, we need to return a
* response response. Fake a send msg command * response to the response. Fake a send msg command
* response with channel 0. This will always be ipmb * response with channel 0. This will always be ipmb
* direct. * direct.
*/ */
...@@ -424,10 +424,8 @@ static void ipmi_ipmb_request_events(void *send_info) ...@@ -424,10 +424,8 @@ static void ipmi_ipmb_request_events(void *send_info)
/* We don't fetch events here. */ /* We don't fetch events here. */
} }
static void ipmi_ipmb_remove(struct i2c_client *client) static void ipmi_ipmb_cleanup(struct ipmi_ipmb_dev *iidev)
{ {
struct ipmi_ipmb_dev *iidev = i2c_get_clientdata(client);
if (iidev->slave) { if (iidev->slave) {
i2c_slave_unregister(iidev->slave); i2c_slave_unregister(iidev->slave);
if (iidev->slave != iidev->client) if (iidev->slave != iidev->client)
...@@ -436,7 +434,13 @@ static void ipmi_ipmb_remove(struct i2c_client *client) ...@@ -436,7 +434,13 @@ static void ipmi_ipmb_remove(struct i2c_client *client)
iidev->slave = NULL; iidev->slave = NULL;
iidev->client = NULL; iidev->client = NULL;
ipmi_ipmb_stop_thread(iidev); ipmi_ipmb_stop_thread(iidev);
}
static void ipmi_ipmb_remove(struct i2c_client *client)
{
struct ipmi_ipmb_dev *iidev = i2c_get_clientdata(client);
ipmi_ipmb_cleanup(iidev);
ipmi_unregister_smi(iidev->intf); ipmi_unregister_smi(iidev->intf);
} }
...@@ -542,7 +546,7 @@ static int ipmi_ipmb_probe(struct i2c_client *client) ...@@ -542,7 +546,7 @@ static int ipmi_ipmb_probe(struct i2c_client *client)
out_err: out_err:
if (slave && slave != client) if (slave && slave != client)
i2c_unregister_device(slave); i2c_unregister_device(slave);
ipmi_ipmb_remove(client); ipmi_ipmb_cleanup(iidev);
return rv; return rv;
} }
......
...@@ -736,12 +736,6 @@ static void intf_free(struct kref *ref) ...@@ -736,12 +736,6 @@ static void intf_free(struct kref *ref)
kfree(intf); kfree(intf);
} }
struct watcher_entry {
int intf_num;
struct ipmi_smi *intf;
struct list_head link;
};
int ipmi_smi_watcher_register(struct ipmi_smi_watcher *watcher) int ipmi_smi_watcher_register(struct ipmi_smi_watcher *watcher)
{ {
struct ipmi_smi *intf; struct ipmi_smi *intf;
...@@ -4357,7 +4351,7 @@ static int handle_oem_get_msg_cmd(struct ipmi_smi *intf, ...@@ -4357,7 +4351,7 @@ static int handle_oem_get_msg_cmd(struct ipmi_smi *intf,
/* /*
* The message starts at byte 4 which follows the * The message starts at byte 4 which follows the
* the Channel Byte in the "GET MESSAGE" command * Channel Byte in the "GET MESSAGE" command
*/ */
recv_msg->msg.data_len = msg->rsp_size - 4; recv_msg->msg.data_len = msg->rsp_size - 4;
memcpy(recv_msg->msg_data, &msg->rsp[4], memcpy(recv_msg->msg_data, &msg->rsp[4],
......
...@@ -2098,7 +2098,7 @@ static struct platform_driver ipmi_driver = { ...@@ -2098,7 +2098,7 @@ static struct platform_driver ipmi_driver = {
.id_table = ssif_plat_ids .id_table = ssif_plat_ids
}; };
static int init_ipmi_ssif(void) static int __init init_ipmi_ssif(void)
{ {
int i; int i;
int rv; int rv;
...@@ -2140,7 +2140,7 @@ static int init_ipmi_ssif(void) ...@@ -2140,7 +2140,7 @@ static int init_ipmi_ssif(void)
} }
module_init(init_ipmi_ssif); module_init(init_ipmi_ssif);
static void cleanup_ipmi_ssif(void) static void __exit cleanup_ipmi_ssif(void)
{ {
if (!initialized) if (!initialized)
return; return;
......
...@@ -207,17 +207,24 @@ static void aspeed_kcs_updateb(struct kcs_bmc_device *kcs_bmc, u32 reg, u8 mask, ...@@ -207,17 +207,24 @@ static void aspeed_kcs_updateb(struct kcs_bmc_device *kcs_bmc, u32 reg, u8 mask,
} }
/* /*
* AST_usrGuide_KCS.pdf * We note D for Data, and C for Cmd/Status, default rules are
* 2. Background: *
* we note D for Data, and C for Cmd/Status, default rules are * 1. Only the D address is given:
* A. KCS1 / KCS2 ( D / C:X / X+4 ) * A. KCS1/KCS2 (D/C: X/X+4)
* D / C : CA0h / CA4h * D/C: CA0h/CA4h
* D / C : CA8h / CACh * D/C: CA8h/CACh
* B. KCS3 ( D / C:XX2h / XX3h ) * B. KCS3 (D/C: XX2/XX3h)
* D / C : CA2h / CA3h * D/C: CA2h/CA3h
* D / C : CB2h / CB3h * C. KCS4 (D/C: X/X+1)
* C. KCS4 * D/C: CA4h/CA5h
* D / C : CA4h / CA5h *
* 2. Both the D/C addresses are given:
* A. KCS1/KCS2/KCS4 (D/C: X/Y)
* D/C: CA0h/CA1h
* D/C: CA8h/CA9h
* D/C: CA4h/CA5h
* B. KCS3 (D/C: XX2/XX3h)
* D/C: CA2h/CA3h
*/ */
static int aspeed_kcs_set_address(struct kcs_bmc_device *kcs_bmc, u32 addrs[2], int nr_addrs) static int aspeed_kcs_set_address(struct kcs_bmc_device *kcs_bmc, u32 addrs[2], int nr_addrs)
{ {
......
...@@ -548,7 +548,7 @@ static struct kcs_bmc_driver kcs_bmc_ipmi_driver = { ...@@ -548,7 +548,7 @@ static struct kcs_bmc_driver kcs_bmc_ipmi_driver = {
.ops = &kcs_bmc_ipmi_driver_ops, .ops = &kcs_bmc_ipmi_driver_ops,
}; };
static int kcs_bmc_ipmi_init(void) static int __init kcs_bmc_ipmi_init(void)
{ {
kcs_bmc_register_driver(&kcs_bmc_ipmi_driver); kcs_bmc_register_driver(&kcs_bmc_ipmi_driver);
...@@ -556,7 +556,7 @@ static int kcs_bmc_ipmi_init(void) ...@@ -556,7 +556,7 @@ static int kcs_bmc_ipmi_init(void)
} }
module_init(kcs_bmc_ipmi_init); module_init(kcs_bmc_ipmi_init);
static void kcs_bmc_ipmi_exit(void) static void __exit kcs_bmc_ipmi_exit(void)
{ {
kcs_bmc_unregister_driver(&kcs_bmc_ipmi_driver); kcs_bmc_unregister_driver(&kcs_bmc_ipmi_driver);
} }
......
...@@ -140,7 +140,7 @@ static struct kcs_bmc_driver kcs_bmc_serio_driver = { ...@@ -140,7 +140,7 @@ static struct kcs_bmc_driver kcs_bmc_serio_driver = {
.ops = &kcs_bmc_serio_driver_ops, .ops = &kcs_bmc_serio_driver_ops,
}; };
static int kcs_bmc_serio_init(void) static int __init kcs_bmc_serio_init(void)
{ {
kcs_bmc_register_driver(&kcs_bmc_serio_driver); kcs_bmc_register_driver(&kcs_bmc_serio_driver);
...@@ -148,7 +148,7 @@ static int kcs_bmc_serio_init(void) ...@@ -148,7 +148,7 @@ static int kcs_bmc_serio_init(void)
} }
module_init(kcs_bmc_serio_init); module_init(kcs_bmc_serio_init);
static void kcs_bmc_serio_exit(void) static void __exit kcs_bmc_serio_exit(void)
{ {
kcs_bmc_unregister_driver(&kcs_bmc_serio_driver); kcs_bmc_unregister_driver(&kcs_bmc_serio_driver);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment