Skip to content

Commit 8de1037

Browse files
committed
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
2 parents c6cc4f7 + 05763c9 commit 8de1037

File tree

8 files changed

+41
-35
lines changed

8 files changed

+41
-35
lines changed

Documentation/devicetree/bindings/ipmi/npcm7xx-kcs-bmc.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
* Nuvoton NPCM7xx KCS (Keyboard Controller Style) IPMI interface
1+
* Nuvoton NPCM KCS (Keyboard Controller Style) IPMI interface
22

3-
The Nuvoton SOCs (NPCM7xx) are commonly used as BMCs
3+
The Nuvoton SOCs (NPCM) are commonly used as BMCs
44
(Baseboard Management Controllers) and the KCS interface can be
55
used to perform in-band IPMI communication with their host.
66

77
Required properties:
88
- compatible : should be one of
99
"nuvoton,npcm750-kcs-bmc"
10+
"nuvoton,npcm845-kcs-bmc", "nuvoton,npcm750-kcs-bmc"
1011
- interrupts : interrupt generated by the controller
1112
- kcs_chan : The KCS channel number in the controller
1213

drivers/char/ipmi/Kconfig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,13 @@ config ASPEED_KCS_IPMI_BMC
119119
provides the access of KCS IO space for BMC side.
120120

121121
config NPCM7XX_KCS_IPMI_BMC
122-
depends on ARCH_NPCM7XX || COMPILE_TEST
122+
depends on ARCH_NPCM || COMPILE_TEST
123123
select IPMI_KCS_BMC
124124
select REGMAP_MMIO
125-
tristate "NPCM7xx KCS IPMI BMC driver"
125+
tristate "NPCM KCS IPMI BMC driver"
126126
help
127127
Provides a driver for the KCS (Keyboard Controller Style) IPMI
128-
interface found on Nuvoton NPCM7xx SOCs.
128+
interface found on Nuvoton NPCM SOCs.
129129

130130
The driver implements the BMC side of the KCS contorller, it
131131
provides the access of KCS IO space for BMC side.

drivers/char/ipmi/ipmi_ipmb.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,8 @@ static void ipmi_ipmb_send_response(struct ipmi_ipmb_dev *iidev,
218218
{
219219
if ((msg->data[0] >> 2) & 1) {
220220
/*
221-
* It's a response being sent, we needto return a
222-
* response response. Fake a send msg command
221+
* It's a response being sent, we need to return a
222+
* response to the response. Fake a send msg command
223223
* response with channel 0. This will always be ipmb
224224
* direct.
225225
*/
@@ -424,10 +424,8 @@ static void ipmi_ipmb_request_events(void *send_info)
424424
/* We don't fetch events here. */
425425
}
426426

427-
static void ipmi_ipmb_remove(struct i2c_client *client)
427+
static void ipmi_ipmb_cleanup(struct ipmi_ipmb_dev *iidev)
428428
{
429-
struct ipmi_ipmb_dev *iidev = i2c_get_clientdata(client);
430-
431429
if (iidev->slave) {
432430
i2c_slave_unregister(iidev->slave);
433431
if (iidev->slave != iidev->client)
@@ -436,7 +434,13 @@ static void ipmi_ipmb_remove(struct i2c_client *client)
436434
iidev->slave = NULL;
437435
iidev->client = NULL;
438436
ipmi_ipmb_stop_thread(iidev);
437+
}
438+
439+
static void ipmi_ipmb_remove(struct i2c_client *client)
440+
{
441+
struct ipmi_ipmb_dev *iidev = i2c_get_clientdata(client);
439442

443+
ipmi_ipmb_cleanup(iidev);
440444
ipmi_unregister_smi(iidev->intf);
441445
}
442446

@@ -542,7 +546,7 @@ static int ipmi_ipmb_probe(struct i2c_client *client)
542546
out_err:
543547
if (slave && slave != client)
544548
i2c_unregister_device(slave);
545-
ipmi_ipmb_remove(client);
549+
ipmi_ipmb_cleanup(iidev);
546550
return rv;
547551
}
548552

drivers/char/ipmi/ipmi_msghandler.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -736,12 +736,6 @@ static void intf_free(struct kref *ref)
736736
kfree(intf);
737737
}
738738

739-
struct watcher_entry {
740-
int intf_num;
741-
struct ipmi_smi *intf;
742-
struct list_head link;
743-
};
744-
745739
int ipmi_smi_watcher_register(struct ipmi_smi_watcher *watcher)
746740
{
747741
struct ipmi_smi *intf;
@@ -4357,7 +4351,7 @@ static int handle_oem_get_msg_cmd(struct ipmi_smi *intf,
43574351

43584352
/*
43594353
* The message starts at byte 4 which follows the
4360-
* the Channel Byte in the "GET MESSAGE" command
4354+
* Channel Byte in the "GET MESSAGE" command
43614355
*/
43624356
recv_msg->msg.data_len = msg->rsp_size - 4;
43634357
memcpy(recv_msg->msg_data, &msg->rsp[4],

drivers/char/ipmi/ipmi_ssif.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2098,7 +2098,7 @@ static struct platform_driver ipmi_driver = {
20982098
.id_table = ssif_plat_ids
20992099
};
21002100

2101-
static int init_ipmi_ssif(void)
2101+
static int __init init_ipmi_ssif(void)
21022102
{
21032103
int i;
21042104
int rv;
@@ -2140,7 +2140,7 @@ static int init_ipmi_ssif(void)
21402140
}
21412141
module_init(init_ipmi_ssif);
21422142

2143-
static void cleanup_ipmi_ssif(void)
2143+
static void __exit cleanup_ipmi_ssif(void)
21442144
{
21452145
if (!initialized)
21462146
return;

drivers/char/ipmi/kcs_bmc_aspeed.c

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -207,17 +207,24 @@ static void aspeed_kcs_updateb(struct kcs_bmc_device *kcs_bmc, u32 reg, u8 mask,
207207
}
208208

209209
/*
210-
* AST_usrGuide_KCS.pdf
211-
* 2. Background:
212-
* we note D for Data, and C for Cmd/Status, default rules are
213-
* A. KCS1 / KCS2 ( D / C:X / X+4 )
214-
* D / C : CA0h / CA4h
215-
* D / C : CA8h / CACh
216-
* B. KCS3 ( D / C:XX2h / XX3h )
217-
* D / C : CA2h / CA3h
218-
* D / C : CB2h / CB3h
219-
* C. KCS4
220-
* D / C : CA4h / CA5h
210+
* We note D for Data, and C for Cmd/Status, default rules are
211+
*
212+
* 1. Only the D address is given:
213+
* A. KCS1/KCS2 (D/C: X/X+4)
214+
* D/C: CA0h/CA4h
215+
* D/C: CA8h/CACh
216+
* B. KCS3 (D/C: XX2/XX3h)
217+
* D/C: CA2h/CA3h
218+
* C. KCS4 (D/C: X/X+1)
219+
* D/C: CA4h/CA5h
220+
*
221+
* 2. Both the D/C addresses are given:
222+
* A. KCS1/KCS2/KCS4 (D/C: X/Y)
223+
* D/C: CA0h/CA1h
224+
* D/C: CA8h/CA9h
225+
* D/C: CA4h/CA5h
226+
* B. KCS3 (D/C: XX2/XX3h)
227+
* D/C: CA2h/CA3h
221228
*/
222229
static int aspeed_kcs_set_address(struct kcs_bmc_device *kcs_bmc, u32 addrs[2], int nr_addrs)
223230
{

drivers/char/ipmi/kcs_bmc_cdev_ipmi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,15 +548,15 @@ static struct kcs_bmc_driver kcs_bmc_ipmi_driver = {
548548
.ops = &kcs_bmc_ipmi_driver_ops,
549549
};
550550

551-
static int kcs_bmc_ipmi_init(void)
551+
static int __init kcs_bmc_ipmi_init(void)
552552
{
553553
kcs_bmc_register_driver(&kcs_bmc_ipmi_driver);
554554

555555
return 0;
556556
}
557557
module_init(kcs_bmc_ipmi_init);
558558

559-
static void kcs_bmc_ipmi_exit(void)
559+
static void __exit kcs_bmc_ipmi_exit(void)
560560
{
561561
kcs_bmc_unregister_driver(&kcs_bmc_ipmi_driver);
562562
}

drivers/char/ipmi/kcs_bmc_serio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,15 @@ static struct kcs_bmc_driver kcs_bmc_serio_driver = {
140140
.ops = &kcs_bmc_serio_driver_ops,
141141
};
142142

143-
static int kcs_bmc_serio_init(void)
143+
static int __init kcs_bmc_serio_init(void)
144144
{
145145
kcs_bmc_register_driver(&kcs_bmc_serio_driver);
146146

147147
return 0;
148148
}
149149
module_init(kcs_bmc_serio_init);
150150

151-
static void kcs_bmc_serio_exit(void)
151+
static void __exit kcs_bmc_serio_exit(void)
152152
{
153153
kcs_bmc_unregister_driver(&kcs_bmc_serio_driver);
154154
}

0 commit comments

Comments
 (0)