From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B108F19464 for ; Tue, 10 Oct 2023 12:23:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VF3S2fj1" Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85D7B9D; Tue, 10 Oct 2023 05:23:28 -0700 (PDT) Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2bfed7c4e6dso63796661fa.1; Tue, 10 Oct 2023 05:23:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696940607; x=1697545407; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=oPyRhYnTnlw7DtON8/f4uUVjXj+t1U+rNcjZ4jW1MJI=; b=VF3S2fj1JlHS40N164ygMaHBRHn0jx9a1J0CkjYjKv7RZNXW3Fr4XjmCQ7q9LBDzY+ c9hSC8+s9vqb/G6eeILSkeHU8DNvOoxXi404JgvFN8uRqzXgie+SLmDoJYoo8QTvFHFA N32DZaNsLdbtOYurwt1a3QudsjOQS+6lvNLe0QQxt5c7fHeTDCnPWUVJzW4KL0TsqcGZ WlKKgAXrb2H/LYxNSRgeAKaRy2xe0L1D2ULsJzD+4fPV61hvn322shj6Ml8jQZLxpYWo 3wzxmza0GFHe+1u+EF036XHY1WCAUDtZOrqGEDxa6SSzYyNJhuiOqRyHItK0oM1qamwc 77Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696940607; x=1697545407; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=oPyRhYnTnlw7DtON8/f4uUVjXj+t1U+rNcjZ4jW1MJI=; b=TLMIKwg1JSEF33UZg4kdLLYFPMm7fWLMSB1NWBN8DSf84qUJREP1VgZ0aThhpDlfUP DFp8f1/6BfkdUUgCIGv+cxAYPRFv6dHxBotamLQ/Tj+O0sTRU9qECYkUkxIMEGSGTEa7 SMugekuIL/cwhBoc3wjq5yES/GpauJwJGuhGB5oE8y+QGnaUSBW/5iihaltV0Qw3A41T QfNFqh7bFI0fgKxbystI0j1l2c0Wd8bvfalVVVbSPgXTOBh2YFZdkkfJtIeEfK6ncDTp AC8v9ekAAJByUomh1LBryH30Dv+2pl8eX0VDJXDdQzdcWHNINsf08UwEF6pug+Y+hCfT XmzA== X-Gm-Message-State: AOJu0YyCXTvUKWGicvTXSUwSHqKl7ql9nGM/5L+Y97uts7rUlCXSlAlW TFRFBrX+745zUuC5dQhhMG4= X-Google-Smtp-Source: AGHT+IGxa/VzwMQyk/bDo1finjw3mICZD9B5q0yI+DRUIsS6DH1ij3P9b+SOtVsaRDdkt9gWV6j36w== X-Received: by 2002:a2e:6e09:0:b0:2bc:e2bc:81ff with SMTP id j9-20020a2e6e09000000b002bce2bc81ffmr17213932ljc.51.1696940606426; Tue, 10 Oct 2023 05:23:26 -0700 (PDT) Received: from PC10319.67 ([82.97.198.254]) by smtp.googlemail.com with ESMTPSA id g9-20020a2e9cc9000000b002b9e346a152sm2425638ljj.96.2023.10.10.05.23.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 05:23:25 -0700 (PDT) From: Konstantin Aladyshev To: Cc: minyard@acm.org, joel@jms.id.au, andrew@aj.id.au, avifishman70@gmail.com, tmaimon77@gmail.com, tali.perry1@gmail.com, venture@google.com, yuenn@google.com, benjaminfair@google.com, aladyshev22@gmail.com, jk@codeconstruct.com.au, matt@codeconstruct.com.au, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, openipmi-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, openbmc@lists.ozlabs.org, netdev@vger.kernel.org Subject: [PATCH v5 0/3] Add MCTP-over-KCS transport binding Date: Tue, 10 Oct 2023 15:23:18 +0300 Message-Id: <20231010122321.823-1-aladyshev22@gmail.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 v4 -> v5: - correct spelling errors in description - check that rx data is big enough for binding structures - use unsigned int type for index and len variables - refactor mctp_kcs_rx_work() function - arrange local variables in reverse xmas tree order Changes v3 -> v4: - drop 'inline' keyword Changes v2 -> v3: - use 'dev_err_probe' correctly 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@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 | 600 ++++++++++++++++++ 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, 699 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%) -- 2.25.1