Minor IPMI fixes
Some device tree cleanups and a maintainer add. Fix a race when handling channel updates that could result in errors being reported to the user in some cases. -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE/Q1c5nzg9ZpmiCaGYfOMkJGb/4EFAmky0/AACgkQYfOMkJGb /4Fa0w//URxkJDMHjQCc2A2wdqM5L55Efx/Z3yxCfCxDXVY7qf+6xRuSQPnhPhAk DIZAZOIMdPrArrvDsWgDKogGDiyd874KlZOpZuFQUGS6KzDHR/wJVer8umUytk2m LxrhmTAc9pCbrM23V7SzCE5m4pxDFL6MnwZtOCxlNBT15CeNyxnIELrAx2wYQsEs 6HAmZ3bwviM03Da5s1xSqXrQzvR5y9vaEfRNRjnP+TtGQjd9wp/vgQCS+ICEURRX h/t5AI1xbipn4MDGXXxtNZYY+KX4zdwAQhPtPlKo3Nvzsm4ICkb6MN+TBeRDWj0I rOcARjJ+OJsoKw4BhtFzs+bHZ/dHIVgIol9w6rpxpog/5Uj1S8bxbOoBSg0DaJPt Ik5ZjQaLtz1DrRGJN1a5Nf8IWj0c6RVndEKQ7A1hOSKeRfE8DeDtKxagNnCgxrZd IkXfI+v5FSqajwb7ozl+KoNbCcyO6n0GlNENVbdBO4E4sqGKGj49pvpE6cAA0ozn tqOqBVkr2gthPv6ofsbzh0KZQRhOXHTuwBlVXbmRZx4Ta6VdsWxRtqs97faWUCa7 6pF/MxBJ4c8ZugrzFvyxdLUjiZkS/HctZwzJSqkYlwq5Cdf0tl2Uy7oU6ky/crtO YYCXEzwT4TDkJjiGbI90JUieNeArsQIEco8gn4ynPLuBjjCvq4g= =RpBy -----END PGP SIGNATURE----- Merge tag 'for-linus-6.19-1' of https://github.com/cminyard/linux-ipmi Pull IPMI updates from Corey Minyard: "Minor IPMI fixes: - Some device tree cleanups and a maintainer add - Fix a race when handling channel updates that could result in errors being reported to the user in some cases" * tag 'for-linus-6.19-1' of https://github.com/cminyard/linux-ipmi: MAINTAINERS: Add entry on Loongson-2K IPMI driver dt-bindings: ipmi: Convert aspeed,ast2400-ibt-bmc to DT schema dt-bindings: ipmi: Convert nuvoton,npcm750-kcs-bmc to DT schema ipmi: Skip channel scan if channels are already marked ready ipmi: Fix __scan_channels() failing to rescan channels ipmi: Fix the race between __scan_channels() and deliver_response()pull/1354/merge
commit
b1ae17cd0f
|
|
@ -1,28 +0,0 @@
|
|||
* 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 one of
|
||||
"aspeed,ast2400-ibt-bmc"
|
||||
"aspeed,ast2500-ibt-bmc"
|
||||
"aspeed,ast2600-ibt-bmc"
|
||||
- reg: physical address and size of the registers
|
||||
- clocks: clock for the device
|
||||
|
||||
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-ibt-bmc";
|
||||
reg = <0x1e789140 0x18>;
|
||||
interrupts = <8>;
|
||||
clocks = <&syscon ASPEED_CLK_GATE_LCLK>;
|
||||
};
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-ibt-bmc.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Aspeed Block Transfer (BT) IPMI interface
|
||||
|
||||
maintainers:
|
||||
- Joel Stanley <joel@jms.id.au>
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
enum:
|
||||
- aspeed,ast2400-ibt-bmc
|
||||
- aspeed,ast2500-ibt-bmc
|
||||
- aspeed,ast2600-ibt-bmc
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
||||
clocks:
|
||||
maxItems: 1
|
||||
|
||||
interrupts:
|
||||
maxItems: 1
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
- clocks
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
#include <dt-bindings/clock/aspeed-clock.h>
|
||||
|
||||
bt@1e789140 {
|
||||
compatible = "aspeed,ast2400-ibt-bmc";
|
||||
reg = <0x1e789140 0x18>;
|
||||
interrupts = <8>;
|
||||
clocks = <&syscon ASPEED_CLK_GATE_LCLK>;
|
||||
};
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
* Nuvoton NPCM KCS (Keyboard Controller Style) IPMI interface
|
||||
|
||||
The Nuvoton SOCs (NPCM) are commonly used as BMCs
|
||||
(Baseboard Management Controllers) and the KCS interface can be
|
||||
used to perform in-band IPMI communication with their host.
|
||||
|
||||
Required properties:
|
||||
- compatible : should be one of
|
||||
"nuvoton,npcm750-kcs-bmc"
|
||||
"nuvoton,npcm845-kcs-bmc", "nuvoton,npcm750-kcs-bmc"
|
||||
- interrupts : interrupt generated by the controller
|
||||
- kcs_chan : The KCS channel number in the controller
|
||||
|
||||
Example:
|
||||
|
||||
lpc_kcs: lpc_kcs@f0007000 {
|
||||
compatible = "nuvoton,npcm750-lpc-kcs", "simple-mfd", "syscon";
|
||||
reg = <0xf0007000 0x40>;
|
||||
reg-io-width = <1>;
|
||||
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
ranges = <0x0 0xf0007000 0x40>;
|
||||
|
||||
kcs1: kcs1@0 {
|
||||
compatible = "nuvoton,npcm750-kcs-bmc";
|
||||
reg = <0x0 0x40>;
|
||||
interrupts = <0 9 4>;
|
||||
kcs_chan = <1>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
kcs2: kcs2@0 {
|
||||
compatible = "nuvoton,npcm750-kcs-bmc";
|
||||
reg = <0x0 0x40>;
|
||||
interrupts = <0 9 4>;
|
||||
kcs_chan = <2>;
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/ipmi/nuvoton,npcm750-kcs-bmc.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Nuvoton NPCM KCS BMC
|
||||
|
||||
maintainers:
|
||||
- Avi Fishman <avifishman70@gmail.com>
|
||||
- Tomer Maimon <tmaimon77@gmail.com>
|
||||
- Tali Perry <tali.perry1@gmail.com>
|
||||
|
||||
description:
|
||||
The Nuvoton SOCs (NPCM) are commonly used as BMCs (Baseboard Management
|
||||
Controllers) and the KCS interface can be used to perform in-band IPMI
|
||||
communication with their host.
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
oneOf:
|
||||
- const: nuvoton,npcm750-kcs-bmc
|
||||
- items:
|
||||
- enum:
|
||||
- nuvoton,npcm845-kcs-bmc
|
||||
- const: nuvoton,npcm750-kcs-bmc
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
||||
interrupts:
|
||||
maxItems: 1
|
||||
|
||||
kcs_chan:
|
||||
description: The KCS channel number in the controller
|
||||
$ref: /schemas/types.yaml#/definitions/uint32
|
||||
minimum: 1
|
||||
maximum: 3
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
- interrupts
|
||||
- kcs_chan
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
kcs@0 {
|
||||
compatible = "nuvoton,npcm750-kcs-bmc";
|
||||
reg = <0x0 0x40>;
|
||||
interrupts = <9 4>;
|
||||
kcs_chan = <1>;
|
||||
};
|
||||
|
|
@ -14767,6 +14767,7 @@ LOONGSON-2K Board Management Controller (BMC) DRIVER
|
|||
M: Binbin Zhou <zhoubinbin@loongson.cn>
|
||||
M: Chong Qiao <qiaochong@loongson.cn>
|
||||
S: Maintained
|
||||
F: drivers/char/ipmi/ipmi_si_ls2k.c
|
||||
F: drivers/mfd/ls2k-bmc-core.c
|
||||
|
||||
LOONGSON EDAC DRIVER
|
||||
|
|
|
|||
|
|
@ -599,7 +599,8 @@ static void __ipmi_bmc_unregister(struct ipmi_smi *intf);
|
|||
static int __ipmi_bmc_register(struct ipmi_smi *intf,
|
||||
struct ipmi_device_id *id,
|
||||
bool guid_set, guid_t *guid, int intf_num);
|
||||
static int __scan_channels(struct ipmi_smi *intf, struct ipmi_device_id *id);
|
||||
static int __scan_channels(struct ipmi_smi *intf,
|
||||
struct ipmi_device_id *id, bool rescan);
|
||||
|
||||
static void free_ipmi_user(struct kref *ref)
|
||||
{
|
||||
|
|
@ -2668,7 +2669,7 @@ retry_bmc_lock:
|
|||
if (__ipmi_bmc_register(intf, &id, guid_set, &guid, intf_num))
|
||||
need_waiter(intf); /* Retry later on an error. */
|
||||
else
|
||||
__scan_channels(intf, &id);
|
||||
__scan_channels(intf, &id, false);
|
||||
|
||||
|
||||
if (!intf_set) {
|
||||
|
|
@ -2688,7 +2689,7 @@ retry_bmc_lock:
|
|||
goto out_noprocessing;
|
||||
} else if (memcmp(&bmc->fetch_id, &bmc->id, sizeof(bmc->id)))
|
||||
/* Version info changes, scan the channels again. */
|
||||
__scan_channels(intf, &bmc->fetch_id);
|
||||
__scan_channels(intf, &bmc->fetch_id, true);
|
||||
|
||||
bmc->dyn_id_expiry = jiffies + IPMI_DYN_DEV_ID_EXPIRY;
|
||||
|
||||
|
|
@ -3417,8 +3418,6 @@ channel_handler(struct ipmi_smi *intf, struct ipmi_recv_msg *msg)
|
|||
intf->channels_ready = true;
|
||||
wake_up(&intf->waitq);
|
||||
} else {
|
||||
intf->channel_list = intf->wchannels + set;
|
||||
intf->channels_ready = true;
|
||||
rv = send_channel_info_cmd(intf, intf->curr_channel);
|
||||
}
|
||||
|
||||
|
|
@ -3440,10 +3439,21 @@ channel_handler(struct ipmi_smi *intf, struct ipmi_recv_msg *msg)
|
|||
/*
|
||||
* Must be holding intf->bmc_reg_mutex to call this.
|
||||
*/
|
||||
static int __scan_channels(struct ipmi_smi *intf, struct ipmi_device_id *id)
|
||||
static int __scan_channels(struct ipmi_smi *intf,
|
||||
struct ipmi_device_id *id,
|
||||
bool rescan)
|
||||
{
|
||||
int rv;
|
||||
|
||||
if (rescan) {
|
||||
/* Clear channels_ready to force channels rescan. */
|
||||
intf->channels_ready = false;
|
||||
}
|
||||
|
||||
/* Skip channel scan if channels are already marked ready */
|
||||
if (intf->channels_ready)
|
||||
return 0;
|
||||
|
||||
if (ipmi_version_major(id) > 1
|
||||
|| (ipmi_version_major(id) == 1
|
||||
&& ipmi_version_minor(id) >= 5)) {
|
||||
|
|
@ -3658,7 +3668,7 @@ int ipmi_add_smi(struct module *owner,
|
|||
}
|
||||
|
||||
mutex_lock(&intf->bmc_reg_mutex);
|
||||
rv = __scan_channels(intf, &id);
|
||||
rv = __scan_channels(intf, &id, false);
|
||||
mutex_unlock(&intf->bmc_reg_mutex);
|
||||
if (rv)
|
||||
goto out_err_bmc_reg;
|
||||
|
|
|
|||
Loading…
Reference in New Issue