Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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()

+117 -75
-28
Documentation/devicetree/bindings/ipmi/aspeed,ast2400-ibt-bmc.txt
··· 1 - * Aspeed BT (Block Transfer) IPMI interface 2 - 3 - The Aspeed SOCs (AST2400 and AST2500) are commonly used as BMCs 4 - (BaseBoard Management Controllers) and the BT interface can be used to 5 - perform in-band IPMI communication with their host. 6 - 7 - Required properties: 8 - 9 - - compatible : should be one of 10 - "aspeed,ast2400-ibt-bmc" 11 - "aspeed,ast2500-ibt-bmc" 12 - "aspeed,ast2600-ibt-bmc" 13 - - reg: physical address and size of the registers 14 - - clocks: clock for the device 15 - 16 - Optional properties: 17 - 18 - - interrupts: interrupt generated by the BT interface. without an 19 - interrupt, the driver will operate in poll mode. 20 - 21 - Example: 22 - 23 - ibt@1e789140 { 24 - compatible = "aspeed,ast2400-ibt-bmc"; 25 - reg = <0x1e789140 0x18>; 26 - interrupts = <8>; 27 - clocks = <&syscon ASPEED_CLK_GATE_LCLK>; 28 - };
+44
Documentation/devicetree/bindings/ipmi/aspeed,ast2400-ibt-bmc.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-ibt-bmc.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Aspeed Block Transfer (BT) IPMI interface 8 + 9 + maintainers: 10 + - Joel Stanley <joel@jms.id.au> 11 + 12 + properties: 13 + compatible: 14 + enum: 15 + - aspeed,ast2400-ibt-bmc 16 + - aspeed,ast2500-ibt-bmc 17 + - aspeed,ast2600-ibt-bmc 18 + 19 + reg: 20 + maxItems: 1 21 + 22 + clocks: 23 + maxItems: 1 24 + 25 + interrupts: 26 + maxItems: 1 27 + 28 + required: 29 + - compatible 30 + - reg 31 + - clocks 32 + 33 + additionalProperties: false 34 + 35 + examples: 36 + - | 37 + #include <dt-bindings/clock/aspeed-clock.h> 38 + 39 + bt@1e789140 { 40 + compatible = "aspeed,ast2400-ibt-bmc"; 41 + reg = <0x1e789140 0x18>; 42 + interrupts = <8>; 43 + clocks = <&syscon ASPEED_CLK_GATE_LCLK>; 44 + };
-40
Documentation/devicetree/bindings/ipmi/npcm7xx-kcs-bmc.txt
··· 1 - * Nuvoton NPCM KCS (Keyboard Controller Style) IPMI interface 2 - 3 - The Nuvoton SOCs (NPCM) are commonly used as BMCs 4 - (Baseboard Management Controllers) and the KCS interface can be 5 - used to perform in-band IPMI communication with their host. 6 - 7 - Required properties: 8 - - compatible : should be one of 9 - "nuvoton,npcm750-kcs-bmc" 10 - "nuvoton,npcm845-kcs-bmc", "nuvoton,npcm750-kcs-bmc" 11 - - interrupts : interrupt generated by the controller 12 - - kcs_chan : The KCS channel number in the controller 13 - 14 - Example: 15 - 16 - lpc_kcs: lpc_kcs@f0007000 { 17 - compatible = "nuvoton,npcm750-lpc-kcs", "simple-mfd", "syscon"; 18 - reg = <0xf0007000 0x40>; 19 - reg-io-width = <1>; 20 - 21 - #address-cells = <1>; 22 - #size-cells = <1>; 23 - ranges = <0x0 0xf0007000 0x40>; 24 - 25 - kcs1: kcs1@0 { 26 - compatible = "nuvoton,npcm750-kcs-bmc"; 27 - reg = <0x0 0x40>; 28 - interrupts = <0 9 4>; 29 - kcs_chan = <1>; 30 - status = "disabled"; 31 - }; 32 - 33 - kcs2: kcs2@0 { 34 - compatible = "nuvoton,npcm750-kcs-bmc"; 35 - reg = <0x0 0x40>; 36 - interrupts = <0 9 4>; 37 - kcs_chan = <2>; 38 - status = "disabled"; 39 - }; 40 - };
+55
Documentation/devicetree/bindings/ipmi/nuvoton,npcm750-kcs-bmc.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/ipmi/nuvoton,npcm750-kcs-bmc.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Nuvoton NPCM KCS BMC 8 + 9 + maintainers: 10 + - Avi Fishman <avifishman70@gmail.com> 11 + - Tomer Maimon <tmaimon77@gmail.com> 12 + - Tali Perry <tali.perry1@gmail.com> 13 + 14 + description: 15 + The Nuvoton SOCs (NPCM) are commonly used as BMCs (Baseboard Management 16 + Controllers) and the KCS interface can be used to perform in-band IPMI 17 + communication with their host. 18 + 19 + properties: 20 + compatible: 21 + oneOf: 22 + - const: nuvoton,npcm750-kcs-bmc 23 + - items: 24 + - enum: 25 + - nuvoton,npcm845-kcs-bmc 26 + - const: nuvoton,npcm750-kcs-bmc 27 + 28 + reg: 29 + maxItems: 1 30 + 31 + interrupts: 32 + maxItems: 1 33 + 34 + kcs_chan: 35 + description: The KCS channel number in the controller 36 + $ref: /schemas/types.yaml#/definitions/uint32 37 + minimum: 1 38 + maximum: 3 39 + 40 + required: 41 + - compatible 42 + - reg 43 + - interrupts 44 + - kcs_chan 45 + 46 + additionalProperties: false 47 + 48 + examples: 49 + - | 50 + kcs@0 { 51 + compatible = "nuvoton,npcm750-kcs-bmc"; 52 + reg = <0x0 0x40>; 53 + interrupts = <9 4>; 54 + kcs_chan = <1>; 55 + };
+1
MAINTAINERS
··· 14767 14767 M: Binbin Zhou <zhoubinbin@loongson.cn> 14768 14768 M: Chong Qiao <qiaochong@loongson.cn> 14769 14769 S: Maintained 14770 + F: drivers/char/ipmi/ipmi_si_ls2k.c 14770 14771 F: drivers/mfd/ls2k-bmc-core.c 14771 14772 14772 14773 LOONGSON EDAC DRIVER
+17 -7
drivers/char/ipmi/ipmi_msghandler.c
··· 599 599 static int __ipmi_bmc_register(struct ipmi_smi *intf, 600 600 struct ipmi_device_id *id, 601 601 bool guid_set, guid_t *guid, int intf_num); 602 - static int __scan_channels(struct ipmi_smi *intf, struct ipmi_device_id *id); 602 + static int __scan_channels(struct ipmi_smi *intf, 603 + struct ipmi_device_id *id, bool rescan); 603 604 604 605 static void free_ipmi_user(struct kref *ref) 605 606 { ··· 2669 2668 if (__ipmi_bmc_register(intf, &id, guid_set, &guid, intf_num)) 2670 2669 need_waiter(intf); /* Retry later on an error. */ 2671 2670 else 2672 - __scan_channels(intf, &id); 2671 + __scan_channels(intf, &id, false); 2673 2672 2674 2673 2675 2674 if (!intf_set) { ··· 2689 2688 goto out_noprocessing; 2690 2689 } else if (memcmp(&bmc->fetch_id, &bmc->id, sizeof(bmc->id))) 2691 2690 /* Version info changes, scan the channels again. */ 2692 - __scan_channels(intf, &bmc->fetch_id); 2691 + __scan_channels(intf, &bmc->fetch_id, true); 2693 2692 2694 2693 bmc->dyn_id_expiry = jiffies + IPMI_DYN_DEV_ID_EXPIRY; 2695 2694 ··· 3418 3417 intf->channels_ready = true; 3419 3418 wake_up(&intf->waitq); 3420 3419 } else { 3421 - intf->channel_list = intf->wchannels + set; 3422 - intf->channels_ready = true; 3423 3420 rv = send_channel_info_cmd(intf, intf->curr_channel); 3424 3421 } 3425 3422 ··· 3439 3440 /* 3440 3441 * Must be holding intf->bmc_reg_mutex to call this. 3441 3442 */ 3442 - static int __scan_channels(struct ipmi_smi *intf, struct ipmi_device_id *id) 3443 + static int __scan_channels(struct ipmi_smi *intf, 3444 + struct ipmi_device_id *id, 3445 + bool rescan) 3443 3446 { 3444 3447 int rv; 3448 + 3449 + if (rescan) { 3450 + /* Clear channels_ready to force channels rescan. */ 3451 + intf->channels_ready = false; 3452 + } 3453 + 3454 + /* Skip channel scan if channels are already marked ready */ 3455 + if (intf->channels_ready) 3456 + return 0; 3445 3457 3446 3458 if (ipmi_version_major(id) > 1 3447 3459 || (ipmi_version_major(id) == 1 ··· 3668 3658 } 3669 3659 3670 3660 mutex_lock(&intf->bmc_reg_mutex); 3671 - rv = __scan_channels(intf, &id); 3661 + rv = __scan_channels(intf, &id, false); 3672 3662 mutex_unlock(&intf->bmc_reg_mutex); 3673 3663 if (rv) 3674 3664 goto out_err_bmc_reg;