Add MCTP-over-KCS transport binding
Subsystems (6)
v2 cover Add MCTP-over-KCS transport binding
This change adds a MCTP KCS transport binding, as defined by the DMTF specificiation DSP0254 - "MCTP KCS Transport Binding".
A MCTP protocol network device is created for each KCS channel found in the system.
The interrupt code for the KCS state machine is based on the current IPMI KCS driver.
Since the KCS subsystem code is now used both in IPMI and MCTP drivers the separate patchsets move KCS subsystem includes to a common folder.
Tested:
PLDM communication between the HOST and BMC was tested with both components implemented via open-source software:
- The HOST (UEFI firmware) part was based one the edk2 [1] and edk2-platforms [2] code,
- The BMC part was based on the openbmc [3] distribution.
The testing process and all the necessary utilities are described in the [4] repository.
[1]: https://github.com/tianocore/edk2
[2]: https://github.com/tianocore/edk2-platforms
[3]: https://github.com/openbmc/openbmc
[4]: https://github.com/Kostr/PLDM
Changes v1 -> v2:
- correct warning found by kernel test robot
- use 'i2c_smbus_pec' library function for PEC calculation
- several code style corrections based on Jonathan Cameron comments
Original patchset can be found here:
https://lwn.net/ml/linux-kernel/20230928123009.2913-1-aladyshev22 at gmail.com/
Konstantin Aladyshev (3):
ipmi: Move KCS headers to common include folder
ipmi: Create header with KCS interface defines
mctp: Add MCTP-over-KCS transport binding
drivers/char/ipmi/kcs_bmc.c | 8 +-
drivers/char/ipmi/kcs_bmc_aspeed.c | 3 +-
drivers/char/ipmi/kcs_bmc_cdev_ipmi.c | 73 +--
drivers/char/ipmi/kcs_bmc_npcm7xx.c | 2 +-
drivers/char/ipmi/kcs_bmc_serio.c | 2 +-
drivers/net/mctp/Kconfig | 8 +
drivers/net/mctp/Makefile | 1 +
drivers/net/mctp/mctp-kcs.c | 594 ++++++++++++++++++
include/linux/ipmi_kcs.h | 80 +++
.../char/ipmi => include/linux}/kcs_bmc.h | 0
.../ipmi => include/linux}/kcs_bmc_client.h | 3 +-
.../ipmi => include/linux}/kcs_bmc_device.h | 3 +-
12 files changed, 693 insertions(+), 84 deletions(-)
create mode 100644 drivers/net/mctp/mctp-kcs.c
create mode 100644 include/linux/ipmi_kcs.h
rename {drivers/char/ipmi => include/linux}/kcs_bmc.h (100%)
rename {drivers/char/ipmi => include/linux}/kcs_bmc_client.h (97%)
rename {drivers/char/ipmi => include/linux}/kcs_bmc_device.h (96%)Signature · 1 line
2.25.1
PATCH v2 1/3 ipmi: Move KCS headers to common include folder
The current KCS header files can be utilized by both IPMI drivers (drivers/char/ipmi) and MCTP driver (drivers/net/mctp). To be able to use them in both cases move the headers to 'include/linux' folder.
---
drivers/char/ipmi/kcs_bmc.c | 8 +++-----
drivers/char/ipmi/kcs_bmc_aspeed.c | 3 +--
drivers/char/ipmi/kcs_bmc_cdev_ipmi.c | 2 +-
drivers/char/ipmi/kcs_bmc_npcm7xx.c | 2 +-
drivers/char/ipmi/kcs_bmc_serio.c | 2 +-
{drivers/char/ipmi => include/linux}/kcs_bmc.h | 0
{drivers/char/ipmi => include/linux}/kcs_bmc_client.h | 3 +--
{drivers/char/ipmi => include/linux}/kcs_bmc_device.h | 3 +--
8 files changed, 9 insertions(+), 14 deletions(-)
rename {drivers/char/ipmi => include/linux}/kcs_bmc.h (100%)
rename {drivers/char/ipmi => include/linux}/kcs_bmc_client.h (97%)
rename {drivers/char/ipmi => include/linux}/kcs_bmc_device.h (96%)drivers/char/ipmi/kcs_bmc.c +3 -5
@@ -5,15 +5,13 @@*/ #include <linux/device.h> +#include <linux/kcs_bmc.h> +#include <linux/kcs_bmc_client.h> +#include <linux/kcs_bmc_device.h> #include <linux/list.h> #include <linux/module.h> #include <linux/mutex.h> -#include "kcs_bmc.h" - -/* Implement both the device and client interfaces here */ -#include "kcs_bmc_device.h" -#include "kcs_bmc_client.h" /* Record registered devices and drivers */ static DEFINE_MUTEX (kcs_bmc_lock);
drivers/char/ipmi/kcs_bmc_aspeed.c +1 -2
@@ -10,6 +10,7 @@#include <linux/interrupt.h> #include <linux/io.h> #include <linux/irq.h> +#include <linux/kcs_bmc_device.h> #include <linux/mfd/syscon.h> #include <linux/module.h> #include <linux/of.h>
@@ -21,8 +22,6 @@#include <linux/slab.h> #include <linux/timer.h> -#include "kcs_bmc_device.h" -#define DEVICE_NAME "ast-kcs-bmc"
drivers/char/ipmi/kcs_bmc_cdev_ipmi.c +1 -1
@@ -8,6 +8,7 @@#include <linux/errno.h> #include <linux/io.h> #include <linux/ipmi_bmc.h> +#include <linux/kcs_bmc_client.h> #include <linux/list.h> #include <linux/miscdevice.h> #include <linux/module.h>
@@ -17,7 +18,6 @@#include <linux/sched.h> #include <linux/slab.h> -#include "kcs_bmc_client.h" /* Different phases of the KCS BMC module. * KCS_PHASE_IDLE:
drivers/char/ipmi/kcs_bmc_npcm7xx.c +1 -1
@@ -10,6 +10,7 @@#include <linux/errno.h> #include <linux/interrupt.h> #include <linux/io.h> +#include <linux/kcs_bmc_device.h> #include <linux/mfd/syscon.h> #include <linux/module.h> #include <linux/of.h>
@@ -17,7 +18,6 @@#include <linux/regmap.h> #include <linux/slab.h> -#include "kcs_bmc_device.h" #define DEVICE_NAME "npcm-kcs-bmc"#define KCS_CHANNEL_MAX 3
drivers/char/ipmi/kcs_bmc_serio.c +1 -1
@@ -5,12 +5,12 @@#include <linux/device.h> #include <linux/errno.h> #include <linux/list.h> +#include <linux/kcs_bmc_client.h> #include <linux/module.h> #include <linux/sched/signal.h> #include <linux/serio.h> #include <linux/slab.h> -#include "kcs_bmc_client.h" struct kcs_bmc_serio {struct list_head entry;
include/linux/kcs_bmc.h renamed from drivers/char/ipmi/kcs_bmc.h +0 -0
include/linux/kcs_bmc_client.h renamed from drivers/char/ipmi/kcs_bmc_client.h +1 -2
@@ -5,8 +5,7 @@#define __KCS_BMC_CONSUMER_H__#include <linux/irqreturn.h> - -#include "kcs_bmc.h" +#include <linux/kcs_bmc.h> struct kcs_bmc_driver_ops {int (*add_device)(struct kcs_bmc_device *kcs_bmc);
include/linux/kcs_bmc_device.h renamed from drivers/char/ipmi/kcs_bmc_device.h +1 -2
@@ -5,8 +5,7 @@#define __KCS_BMC_DEVICE_H__#include <linux/irqreturn.h> - -#include "kcs_bmc.h" +#include <linux/kcs_bmc.h> struct kcs_bmc_device_ops {void (*irq_mask_update)(struct kcs_bmc_device *kcs_bmc,u8 mask,u8 enable);
Signature · 1 line
2.25.1
PATCH v2 2/3 ipmi: Create header with KCS interface defines
In reply to Konstantin AladyshevSome definitions from the current kcs_bmc_cdev_ipmi driver can be also utilized by the MTCP KCS binding driver. Move such definitions to the common header file.
--- drivers/char/ipmi/kcs_bmc_cdev_ipmi.c | 71 +----------------------- include/linux/ipmi_kcs.h | 80 +++++++++++++++++++++++++++ 2 files changed, 81 insertions(+), 70 deletions(-) create mode 100644 include/linux/ipmi_kcs.h
drivers/char/ipmi/kcs_bmc_cdev_ipmi.c +1 -70
@@ -8,6 +8,7 @@#include <linux/errno.h> #include <linux/io.h> #include <linux/ipmi_bmc.h> +#include <linux/ipmi_kcs.h> #include <linux/kcs_bmc_client.h> #include <linux/list.h> #include <linux/miscdevice.h>
@@ -19,53 +20,6 @@#include <linux/slab.h> -/* Different phases of the KCS BMC module. -* KCS_PHASE_IDLE: -* BMC should not be expecting nor sending any data. -* KCS_PHASE_WRITE_START: -* BMC is receiving a WRITE_START command from system software. -* KCS_PHASE_WRITE_DATA: -* BMC is receiving a data byte from system software. -* KCS_PHASE_WRITE_END_CMD: -* BMC is waiting a last data byte from system software. -* KCS_PHASE_WRITE_DONE: -* BMC has received the whole request from system software. -* KCS_PHASE_WAIT_READ: -* BMC is waiting the response from the upper IPMI service. -* KCS_PHASE_READ: -* BMC is transferring the response to system software. -* KCS_PHASE_ABORT_ERROR1: -* BMC is waiting error status request from system software. -* KCS_PHASE_ABORT_ERROR2: -* BMC is waiting for idle status afer error from system software. -* KCS_PHASE_ERROR: -* BMC has detected a protocol violation at the interface level. -*/ -enum kcs_ipmi_phases { -KCS_PHASE_IDLE , - -KCS_PHASE_WRITE_START , -KCS_PHASE_WRITE_DATA , -KCS_PHASE_WRITE_END_CMD , -KCS_PHASE_WRITE_DONE , - -KCS_PHASE_WAIT_READ , -KCS_PHASE_READ , - -KCS_PHASE_ABORT_ERROR1 , -KCS_PHASE_ABORT_ERROR2 , -KCS_PHASE_ERROR -}; - -/* IPMI 2.0 - Table 9-4, KCS Interface Status Codes */ -enum kcs_ipmi_errors { -KCS_NO_ERROR =0x00 , -KCS_ABORTED_BY_COMMAND =0x01 , -KCS_ILLEGAL_CONTROL_CODE =0x02 , -KCS_LENGTH_ERROR =0x06 , -KCS_UNSPECIFIED_ERROR =0xFF -}; -struct kcs_bmc_ipmi {struct list_head entry;
@@ -95,29 +49,6 @@ struct kcs_bmc_ipmi {#define KCS_MSG_BUFSIZ 1000 -#define KCS_ZERO_DATA 0 - -/* IPMI 2.0 - Table 9-1, KCS Interface Status Register Bits */ -#define KCS_STATUS_STATE (state) (state << 6) -#define KCS_STATUS_STATE_MASK GENMASK(7, 6) -#define KCS_STATUS_CMD_DAT BIT(3) -#define KCS_STATUS_SMS_ATN BIT(2) -#define KCS_STATUS_IBF BIT(1) -#define KCS_STATUS_OBF BIT(0) - -/* IPMI 2.0 - Table 9-2, KCS Interface State Bits */ -enum kcs_states { -IDLE_STATE =0 , -READ_STATE =1 , -WRITE_STATE =2 , -ERROR_STATE =3 , -}; - -/* IPMI 2.0 - Table 9-3, KCS Interface Control Codes */ -#define KCS_CMD_GET_STATUS_ABORT 0x60 -#define KCS_CMD_WRITE_START 0x61 -#define KCS_CMD_WRITE_END 0x62 -#define KCS_CMD_READ_BYTE 0x68static inline void set_state (struct kcs_bmc_ipmi *priv,u8 state) {
include/linux/ipmi_kcs.h new file +80 -0
80 lines not on this page · raw message
Signature · 1 line
2.25.1
PATCH v2 3/3 mctp: Add MCTP-over-KCS transport binding
In reply to Konstantin AladyshevThis change adds a MCTP KCS transport binding, as defined by the DMTF specificiation DSP0254 - "MCTP KCS Transport Binding".
A MCTP protocol network device is created for each KCS channel found in the system.
The interrupt code for the KCS state machine is based on the current IPMI KCS driver.
--- drivers/net/mctp/Kconfig | 8 + drivers/net/mctp/Makefile | 1 + drivers/net/mctp/mctp-kcs.c | 594 ++++++++++++++++++++++++++++++++++++ 3 files changed, 603 insertions(+) create mode 100644 drivers/net/mctp/mctp-kcs.c
drivers/net/mctp/Kconfig +8 -0
@@ -33,6 +33,14 @@ config MCTP_TRANSPORT_I2C from DMTF specification DSP0237. A MCTP protocol network device is created for each I2C bus that has been assigned a mctp-i2c device. +config MCTP_TRANSPORT_KCS + tristate "MCTP KCS transport" + depends on IPMI_KCS_BMC + help + Provides a driver to access MCTP devices over KCS transport, from + DMTF specification DSP0254. A MCTP protocol network device is + created for each KCS channel found in the system. + endmenu endif
drivers/net/mctp/Makefile +1 -0
@@ -1,2 +1,3 @@ obj-$(CONFIG_MCTP_SERIAL) += mctp-serial.o obj-$(CONFIG_MCTP_TRANSPORT_I2C) += mctp-i2c.o +obj-$(CONFIG_MCTP_TRANSPORT_KCS) += mctp-kcs.o
drivers/net/mctp/mctp-kcs.c new file +594 -0
594 lines not on this page · raw message
Signature · 1 line
2.25.1
Jakub Kicinski
maintainerRe: [PATCH v2 3/3] mctp: Add MCTP-over-KCS transport binding
Quoted 6 lines · On Mon, 2 Oct 2023 17:34:41 +0300 Konstantin Aladyshev wrote:
This change adds a MCTP KCS transport binding, as defined by the DMTF specificiation DSP0254 - "MCTP KCS Transport Binding".
A MCTP protocol network device is created for each KCS channel found in the system.
The interrupt code for the KCS state machine is based on the current IPMI KCS driver.
Still doesn't build, please make sure W=1 C=1 build is clean with both GCC and Clang (you can point them at a specific path to avoid building the entire kernel with the warnings enabled).
Signature · 1 line
pw-bot: cr
kernel test robot
build botRe: [PATCH v2 3/3] mctp: Add MCTP-over-KCS transport binding
In reply to Konstantin Aladyshevkernel test robot noticed the following build warnings:
Hi Konstantin,
kernel test robot noticed the following build warnings:
[auto build test WARNING on cminyard-ipmi/for-next]
[also build test WARNING on linus/master v6.6-rc4 next-20230929] [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#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Konstantin-Aladyshev/ipmi-Move-KCS-headers-to-common-include-folder/20231002-223632 base: https://github.com/cminyard/linux-ipmi for-next patch link: https://lore.kernel.org/r/20231002143441.545-4-aladyshev22%40gmail.com patch subject: [PATCH v2 3/3] mctp: Add MCTP-over-KCS transport binding config: sh-allyesconfig (https://download.01.org/0day-ci/archive/20231003/202310030640.tYeSJjeI-lkp at intel.com/config) compiler: sh4-linux-gcc (GCC) 13.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231003/202310030640.tYeSJjeI-lkp at intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/202310030640.tYeSJjeI-lkp at intel.com/
All warnings (new ones prefixed by >>):
drivers/net/mctp/mctp-kcs.c: In function 'kcs_bmc_mctp_add_device':
>> drivers/net/mctp/mctp-kcs.c:494:31: warning: passing argument 2 of 'dev_err_probe' makes integer from pointer without a cast [-Wint-conversion]
494 | "alloc_netdev failed for KCS channel %d\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| char *
In file included from include/linux/device.h:15,
from include/linux/acpi.h:14,
from include/linux/i2c.h:13,
from drivers/net/mctp/mctp-kcs.c:16:
include/linux/dev_printk.h:277:64: note: expected 'int' but argument is of type 'char *'
277 | __printf(3, 4) int dev_err_probe(const struct device *dev, int err, const char *fmt, ...);
| ~~~~^~~
>> drivers/net/mctp/mctp-kcs.c:495:38: warning: passing argument 3 of 'dev_err_probe' makes pointer from integer without a cast [-Wint-conversion]
495 | kcs_bmc->channel);
| ~~~~~~~^~~~~~~~~
| |
| u32 {aka unsigned int}
include/linux/dev_printk.h:277:81: note: expected 'const char *' but argument is of type 'u32' {aka 'unsigned int'}
277 | __printf(3, 4) int dev_err_probe(const struct device *dev, int err, const char *fmt, ...);
| ~~~~~~~~~~~~^~~
drivers/net/mctp/mctp-kcs.c:507:25: warning: passing argument 2 of 'dev_err_probe' makes integer from pointer without a cast [-Wint-conversion]
507 | "failed to allocate data_in buffer for KCS channel %d\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| char *
include/linux/dev_printk.h:277:64: note: expected 'int' but argument is of type 'char *'
277 | __printf(3, 4) int dev_err_probe(const struct device *dev, int err, const char *fmt, ...);
| ~~~~^~~
drivers/net/mctp/mctp-kcs.c:508:32: warning: passing argument 3 of 'dev_err_probe' makes pointer from integer without a cast [-Wint-conversion]
508 | kcs_bmc->channel);
| ~~~~~~~^~~~~~~~~
| |
| u32 {aka unsigned int}
include/linux/dev_printk.h:277:81: note: expected 'const char *' but argument is of type 'u32' {aka 'unsigned int'}
277 | __printf(3, 4) int dev_err_probe(const struct device *dev, int err, const char *fmt, ...);
| ~~~~~~~~~~~~^~~
drivers/net/mctp/mctp-kcs.c:516:25: warning: passing argument 2 of 'dev_err_probe' makes integer from pointer without a cast [-Wint-conversion]
516 | "failed to allocate data_out buffer for KCS channel %d\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| char *
include/linux/dev_printk.h:277:64: note: expected 'int' but argument is of type 'char *'
277 | __printf(3, 4) int dev_err_probe(const struct device *dev, int err, const char *fmt, ...);
| ~~~~^~~
drivers/net/mctp/mctp-kcs.c:517:32: warning: passing argument 3 of 'dev_err_probe' makes pointer from integer without a cast [-Wint-conversion]
517 | kcs_bmc->channel);
| ~~~~~~~^~~~~~~~~
| |
| u32 {aka unsigned int}
include/linux/dev_printk.h:277:81: note: expected 'const char *' but argument is of type 'u32' {aka 'unsigned int'}
277 | __printf(3, 4) int dev_err_probe(const struct device *dev, int err, const char *fmt, ...);
| ~~~~~~~~~~~~^~~vim +/dev_err_probe +494 drivers/net/mctp/mctp-kcs.c
481
482 static int kcs_bmc_mctp_add_device(struct kcs_bmc_device *kcs_bmc)
483 {
484 struct mctp_kcs *mkcs;
485 struct net_device *ndev;
486 char name[32];
487 int rc;
488
489 snprintf(name, sizeof(name), "mctpkcs%d", kcs_bmc->channel);
490
491 ndev = alloc_netdev(sizeof(*mkcs), name, NET_NAME_ENUM, mctp_kcs_setup);
492 if (!ndev) {
493 dev_err_probe(kcs_bmc->dev,
> 494 "alloc_netdev failed for KCS channel %d\n", > 495 kcs_bmc->channel);
496 return -ENOMEM;
497 }
498
499 mkcs = netdev_priv(ndev);
500 mkcs->netdev = ndev;
501 mkcs->client.dev = kcs_bmc;
502 mkcs->client.ops = &kcs_bmc_mctp_client_ops;
503 mkcs->data_in = devm_kmalloc(kcs_bmc->dev, KCS_MSG_BUFSIZ, GFP_KERNEL);
504 if (!mkcs->data_in) {
505 dev_err_probe(
506 kcs_bmc->dev,
507 "failed to allocate data_in buffer for KCS channel %d\n",
508 kcs_bmc->channel);
509 rc = -ENOMEM;
510 goto free_netdev;
511 }
512 mkcs->data_out = devm_kmalloc(kcs_bmc->dev, KCS_MSG_BUFSIZ, GFP_KERNEL);
513 if (!mkcs->data_out) {
514 dev_err_probe(
515 kcs_bmc->dev,
516 "failed to allocate data_out buffer for KCS channel %d\n",
517 kcs_bmc->channel);
518 rc = -ENOMEM;
519 goto free_netdev;
520 }
521
522 INIT_WORK(&mkcs->rx_work, mctp_kcs_rx_work);
523
524 rc = register_netdev(ndev);
525 if (rc)
526 goto free_netdev;
527
528 spin_lock_irq(&kcs_bmc_mctp_instances_lock);
529 list_add(&mkcs->entry, &kcs_bmc_mctp_instances);
530 spin_unlock_irq(&kcs_bmc_mctp_instances_lock);
531
532 dev_info(kcs_bmc->dev, "Add MCTP client for the KCS channel %d",
533 kcs_bmc->channel);
534 return 0;
535
536 free_netdev:
537 free_netdev(ndev);
538
539 return rc;
540 }
541
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
Re: [PATCH v2 3/3] mctp: Add MCTP-over-KCS transport binding
Oops, sorry about that.
I've introduced this new warning when I've refactored my code to use 'dev_err_probe'.
I've sent the v3 series to correct the issue, I hope now everything is clear. I haven't figured out how to run clang in my yocto environment where I develop code, but the
``` make W=1 C=1 drivers/net/mctp/mctp-kcs.o ```
runs without any issues now.
Best regards,
Konstantin Aladyshev
Quoted 148 lines · On Tue, Oct 3, 2023 at 2:05?AM kernel test robot <[email protected]> wrote:
Hi Konstantin,
kernel test robot noticed the following build warnings:
[auto build test WARNING on cminyard-ipmi/for-next]
[also build test WARNING on linus/master v6.6-rc4 next-20230929] [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#_base_tree_information]url: https://github.com/intel-lab-lkp/linux/commits/Konstantin-Aladyshev/ipmi-Move-KCS-headers-to-common-include-folder/20231002-223632 base: https://github.com/cminyard/linux-ipmi for-next patch link: https://lore.kernel.org/r/20231002143441.545-4-aladyshev22%40gmail.com patch subject: [PATCH v2 3/3] mctp: Add MCTP-over-KCS transport binding config: sh-allyesconfig (https://download.01.org/0day-ci/archive/20231003/202310030640.tYeSJjeI-lkp at intel.com/config) compiler: sh4-linux-gcc (GCC) 13.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231003/202310030640.tYeSJjeI-lkp at intel.com/reproduce)If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/202310030640.tYeSJjeI-lkp at intel.com/All warnings (new ones prefixed by >>):
drivers/net/mctp/mctp-kcs.c: In function 'kcs_bmc_mctp_add_device':Quoted 1 line
Quoted 1 line
drivers/net/mctp/mctp-kcs.c:494:31: warning: passing argument 2 of 'dev_err_probe' makes integer from pointer without a cast [-Wint-conversion]494 | "alloc_netdev failed for KCS channel %d\n", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | char * In file included from include/linux/device.h:15, from include/linux/acpi.h:14, from include/linux/i2c.h:13, from drivers/net/mctp/mctp-kcs.c:16: include/linux/dev_printk.h:277:64: note: expected 'int' but argument is of type 'char *' 277 | __printf(3, 4) int dev_err_probe(const struct device *dev, int err, const char *fmt, ...); | ~~~~^~~Quoted 1 line
Quoted 1 line
drivers/net/mctp/mctp-kcs.c:495:38: warning: passing argument 3 of 'dev_err_probe' makes pointer from integer without a cast [-Wint-conversion]495 | kcs_bmc->channel); | ~~~~~~~^~~~~~~~~ | | | u32 {aka unsigned int} include/linux/dev_printk.h:277:81: note: expected 'const char *' but argument is of type 'u32' {aka 'unsigned int'} 277 | __printf(3, 4) int dev_err_probe(const struct device *dev, int err, const char *fmt, ...); | ~~~~~~~~~~~~^~~ drivers/net/mctp/mctp-kcs.c:507:25: warning: passing argument 2 of 'dev_err_probe' makes integer from pointer without a cast [-Wint-conversion] 507 | "failed to allocate data_in buffer for KCS channel %d\n", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | char * include/linux/dev_printk.h:277:64: note: expected 'int' but argument is of type 'char *' 277 | __printf(3, 4) int dev_err_probe(const struct device *dev, int err, const char *fmt, ...); | ~~~~^~~ drivers/net/mctp/mctp-kcs.c:508:32: warning: passing argument 3 of 'dev_err_probe' makes pointer from integer without a cast [-Wint-conversion] 508 | kcs_bmc->channel); | ~~~~~~~^~~~~~~~~ | | | u32 {aka unsigned int} include/linux/dev_printk.h:277:81: note: expected 'const char *' but argument is of type 'u32' {aka 'unsigned int'} 277 | __printf(3, 4) int dev_err_probe(const struct device *dev, int err, const char *fmt, ...); | ~~~~~~~~~~~~^~~ drivers/net/mctp/mctp-kcs.c:516:25: warning: passing argument 2 of 'dev_err_probe' makes integer from pointer without a cast [-Wint-conversion] 516 | "failed to allocate data_out buffer for KCS channel %d\n", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | char * include/linux/dev_printk.h:277:64: note: expected 'int' but argument is of type 'char *' 277 | __printf(3, 4) int dev_err_probe(const struct device *dev, int err, const char *fmt, ...); | ~~~~^~~ drivers/net/mctp/mctp-kcs.c:517:32: warning: passing argument 3 of 'dev_err_probe' makes pointer from integer without a cast [-Wint-conversion] 517 | kcs_bmc->channel); | ~~~~~~~^~~~~~~~~ | | | u32 {aka unsigned int} include/linux/dev_printk.h:277:81: note: expected 'const char *' but argument is of type 'u32' {aka 'unsigned int'} 277 | __printf(3, 4) int dev_err_probe(const struct device *dev, int err, const char *fmt, ...); | ~~~~~~~~~~~~^~~vim +/dev_err_probe +494
drivers/net/mctp/mctp-kcs.c481 482 static int kcs_bmc_mctp_add_device(struct kcs_bmc_device *kcs_bmc) 483 { 484 struct mctp_kcs *mkcs; 485 struct net_device *ndev; 486 char name[32]; 487 int rc; 488 489 snprintf(name, sizeof(name), "mctpkcs%d", kcs_bmc->channel); 490 491 ndev = alloc_netdev(sizeof(*mkcs), name, NET_NAME_ENUM, mctp_kcs_setup); 492 if (!ndev) { 493 dev_err_probe(kcs_bmc->dev,Quoted 2 lines
494 "
alloc_netdevfailed for KCS channel %d\n",
495kcs_bmc->channel);496 return -ENOMEM; 497 } 498 499 mkcs = netdev_priv(ndev); 500 mkcs->netdev = ndev; 501 mkcs->client.dev = kcs_bmc; 502 mkcs->client.ops = &kcs_bmc_mctp_client_ops; 503 mkcs->data_in = devm_kmalloc(kcs_bmc->dev, KCS_MSG_BUFSIZ, GFP_KERNEL); 504 if (!mkcs->data_in) { 505 dev_err_probe( 506 kcs_bmc->dev, 507 "failed to allocate data_in buffer for KCS channel %d\n", 508 kcs_bmc->channel); 509 rc = -ENOMEM; 510 goto free_netdev; 511 } 512 mkcs->data_out = devm_kmalloc(kcs_bmc->dev, KCS_MSG_BUFSIZ, GFP_KERNEL); 513 if (!mkcs->data_out) { 514 dev_err_probe( 515 kcs_bmc->dev, 516 "failed to allocate data_out buffer for KCS channel %d\n", 517 kcs_bmc->channel); 518 rc = -ENOMEM; 519 goto free_netdev; 520 } 521 522 INIT_WORK(&mkcs->rx_work, mctp_kcs_rx_work); 523 524 rc = register_netdev(ndev); 525 if (rc) 526 goto free_netdev; 527 528 spin_lock_irq(&kcs_bmc_mctp_instances_lock); 529 list_add(&mkcs->entry, &kcs_bmc_mctp_instances); 530 spin_unlock_irq(&kcs_bmc_mctp_instances_lock); 531 532 dev_info(kcs_bmc->dev, "Add MCTP client for the KCS channel %d", 533 kcs_bmc->channel); 534 return 0; 535 536 free_netdev: 537 free_netdev(ndev); 538 539 return rc; 540 } 541--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki