From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 89703C433F5 for ; Wed, 5 Oct 2022 23:54:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Reply-To:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=J0eY6GAAZRUVm6CrIi9ZlsyzdwcxU+FGa2UyrZhIRrI=; b=NHRAEEPh7YjqgO ds/J3ngrOIMxBRHUSDoW7iOcj0bJw2aIuE9D+KW6EaX38virA9aCk5rd7dsfLdq5OYT0CgBEC6NwY Dmi0v53fHo5vO5PETBpDLbfhyh+yL+afrQJ+M5EChcxa8t5pIlf/cPP9yhd4w/lAOdCVLhMnkApRo vVvInq9XN9Y7l4abr+iGP52nwjryNVorQf/AIczQZoD7kJ6g4E3GIHTzVnEcnw9iGzrZMSdSnx9AT baTbFOYtrI113pJKBUVGW59zSBNYnSqXAOegLxgoUC9EYfVxaMY1GusAIn+bo+kTZtalTxzGqt5Mn on/GYYfdzDmGOeJ5vjYw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ogECU-00GZZV-9I; Wed, 05 Oct 2022 23:53:18 +0000 Received: from mail-qt1-x835.google.com ([2607:f8b0:4864:20::835]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ogECQ-00GZXB-E0 for linux-arm-kernel@lists.infradead.org; Wed, 05 Oct 2022 23:53:16 +0000 Received: by mail-qt1-x835.google.com with SMTP id ay9so194033qtb.0 for ; Wed, 05 Oct 2022 16:53:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:reply-to :message-id:subject:cc:to:from:date:sender:from:to:cc:subject:date :message-id:reply-to; bh=fUpQg31qLSafDWUcMgUao3TMT+hDdWkhTyRDacQF7uQ=; b=aM4GmOwECMjw5l+6WPAkjD95HWW14o1oUdCNLymwXqDtwYnovROQVfse+/38It/BnU bz6JXDMVSPU9QCZgwYQgcZsFFwnMunvi41/w24Vlyvjw9SRyFkfd0b+YF4Jupx/w1XJQ 5LoVH/pyiY3gnxBzZbsU5Zi8J55p7svv7P8f2rfYQpBpQzQwNOVa92u6d6U0yi1/NhjH SPc8QzmVX8yfb/U3KAVJcgpp/Z2AmvFuQeGnkYk2/xGpfy+9EyyD8s8HkPJ2uSf6RLwY y5ddeigsWn/6VaZsQdFBT9/RFRvv0zV9Njgqxi8xEwwl1/MV/WrrskuGmBsf56xNnCkV hScQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:reply-to :message-id:subject:cc:to:from:date:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=fUpQg31qLSafDWUcMgUao3TMT+hDdWkhTyRDacQF7uQ=; b=Vb86ebIam6RldoOi9KOzvx4yD4WXWkThkU1V5Dlu6ajp79kM3QLHKnHxL2CJBXhzVs VEeTo4zofnNHd+2mpz9Q8GAdhhap7HxwsnTvZq4AWcnPl+DJWs/JBAEWvg8hHEP8bOwn HCJprnUoMKOKLkiOhbU8JJR3RsuwWJcmzRwtfDZd0y4LXI5Zko4KUzPSg3e7FwlwDZzE +WKT/QaOjEoWnYkiocYCUC/f/gWCOEtaYjkj1oJSMclaaiWQZD0rcnNRKuRKgV7sdEF8 8NpX+tSlNuaG/r7W7mBa90TWbbp5KcGxlGPhheBAP779aRzAQsLRe/IJv6eHOM35LH7S JmMA== X-Gm-Message-State: ACrzQf0aJyHZxipF3KLE3jLXdntABbFzrK5LNoPs9NLpEp3rXYXuYYTs y/zzt4Phmw9YN2qa7DptcniQNBBorU/N X-Google-Smtp-Source: AMsMyM7m3ZznC2N6vijBuwEzRYV9NyM1wkH4hn9XNVHWQUQZQGyIYol4VV1OoYMqoKHVzo1kf7YGHQ== X-Received: by 2002:a05:622a:1109:b0:35b:ae57:5a6c with SMTP id e9-20020a05622a110900b0035bae575a6cmr1572054qty.23.1665013991706; Wed, 05 Oct 2022 16:53:11 -0700 (PDT) Received: from serve.minyard.net ([47.184.185.126]) by smtp.gmail.com with ESMTPSA id y17-20020ac83e91000000b0038d9555b580sm3526480qtf.44.2022.10.05.16.53.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Oct 2022 16:53:11 -0700 (PDT) Received: from minyard.net (unknown [IPv6:2001:470:b8f6:1b:2d13:71e3:7ea0:219]) by serve.minyard.net (Postfix) with ESMTPSA id 61E83180015; Wed, 5 Oct 2022 23:53:10 +0000 (UTC) Date: Wed, 5 Oct 2022 18:53:06 -0500 From: Corey Minyard To: Quan Nguyen Cc: Randy Dunlap , Wolfram Sang , Rob Herring , Krzysztof Kozlowski , Brendan Higgins , Benjamin Herrenschmidt , Joel Stanley , Andrew Jeffery , openipmi-developer@lists.sourceforge.net, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, openbmc@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, Open Source Submission , Phong Vo , thang@os.amperecomputing.com Subject: Re: [PATCH v10 0/3] Add SSIF BMC driver Message-ID: References: <20221004093106.1653317-1-quan@os.amperecomputing.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20221004093106.1653317-1-quan@os.amperecomputing.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221005_165314_526225_6E1A3CE3 X-CRM114-Status: GOOD ( 32.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: minyard@acm.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Oct 04, 2022 at 04:31:03PM +0700, Quan Nguyen wrote: > This series add support the SSIF BMC driver which is to perform in-band > IPMI communication with their host in management (BMC) side. > > SSIF BMC driver in this series is tested with Aspeed AST2500 and AST2600 I have applied the two IPMI patches to the IPMI tree for 6.2. Thanks for sticking with this. -corey > > Discussion for v9: > https://lore.kernel.org/lkml/20220929080326.752907-1-quan@os.amperecomputing.com/ > > v10: > + Issuing RxCmdLast command for all errnos [Wolfram] > > v9: > + Fix dependence with I2C subsystem [Randy] > + Update missing Reviewed-by tag from v7 [Rob] > + Remove useless error handling path [CJ] > + Update comment for SSIF_ABORTING state [CJ] > + Fix "unknown type name --u8" [kernel test robot] > + Update commit message and add comment to explain > the effect of issuing RxCmdLast when Slave busy [Quan] > > v8: > + Dropped ssif_bmc.h file and move its content to ssif_bmc.c [Corey] > + Add struct ipmi_ssif_msg to include/uapi/linux/ipmi_ssif_bmc.h > header file [Corey] > + Use unsigned int for len field in struct ipmi_ssif_msg [Corey] > + Avoid using packed structure [Corey] > + Add comment to clarify the logic flow [Corey] > + Fix multipart read end with len=0 issue [Corey] > + Refactor code handle the too big request message [Corey] > + Fix code indentation issue [Corey] > + Clean buffer before receiving request to avoid garbage [Quan] > + Fix the license to SPDX-License-Identifier: GPL-2.0-only [Quan] > > v7: > + Remove unnecessary del_timer() in response_timeout() [Corey] > + Change compatible string from "ampere,ssif-bmc" to "ssif-bmc" [Jae] > + Dropped the use of ssif_msg_len() macro, use the len directly [Quan] > + Solve possible issue if both response timer and ssif_bmc_write() > occurred at the same time [Corey] > + Fix wrong return type of ssif_bmc_poll() [kernel robot test] > + Refactor and introduce ssif_part_buffer struct to replace the > response_buf to manage each send/receive part of ssif [Quan] > + Change SSIF_BAD_SMBUS state to SSIF_ABORTING state [Corey] > + Support abort feature to skip the current bad request/response and > wait until next new request [Corey] > + Refactor the PEC calculation to avoid the re-calculate the PEC on > each I2C_SLAVE_WRITE_RECEIVED event [Quan] > + Fix the use of error-proned idx [Corey] > + Defer the test for valid SMBus command until the read/write part > is determined [Quan] > + Change/split unsupported_smbus_cmd() to > supported_[write|read]_cmd() [Corey] > + Abort the request if somehow its size exceeded 255 bytes [Quan] > > v6: > + Drop the use of slave_enable() [Wolfram] > + Make i2c-aspeed to issue RxCmdLast command on all > I2C_SLAVE_WRITE_REQUESTED event to assert NAK when slave busy [Quan] > + Make i2c slave to return -EBUSY when it's busy [Quan] > + Drop the aborting feature as return Completion Code 0xFF may stop > host to retry and make ipmi_ssif.so fails to load [Quan] > + Add timer to recover slave from busy state when no response [Quan] > + Clean request/response buffer appropriately [Quan] > + Add some minor change on error and warning messages [Quan] > > v5: > + Correct the patches order to fix the bisect issue found by > kernel build robot > > v4: > + Fix recursive spinlock [Graeme] > + Send response with Completion code 0xFF when aborting [Quan] > + Fix warning with dt_binding_check [Rob] > + Change aspeed-ssif-bmc.yaml to ssif-bmc.yaml [Quan] > + Added bounding check on SMBus writes and the whole request [Dan] > + Moved buffer to end of struct ssif_bmc_ctx to avoid context > corruption if somehow buffer is written past the end [Dan] > + Return -EINVAL if userspace buffer too small, don't > silence truncate [Corey, Joel] > + Not necessary to check NONBLOCK in lock [Corey] > + Enforce one user at a time [Joel] > + Reject write with invalid response length from userspace [Corey] > + Add state machines for better ssif bmc state handling [Quan] > + Drop ssif_bmc_aspeed.c and make ssif_bmc.c is generic > SSIF BMC driver [Quan] > + Change compatible string "aspeed,ast2500-ssif-bmc" to > "ampere,ssif-bmc" [Quan] > + Toggle Slave enable in i2c-aspeed to turn on/off slave mode [Ryan] > + Added slave_enable() to struct i2c_algorithm to control > slave mode and to address the recursive spinlock [Graeme, Ryan] > + Abort current request with invalid SMBus write or > invalid command [Quan] > + Abort all request if there is pending response [Quan] > + Changed validate_pec() to validate_request() [Quan] > + Add unsupported_smbus_cmd() to handle unknown SMBus command [Quan] > + Print internal state string for ease investigating issue [Quan] > + Move to READY state on SLAVE_STOP event [Quan] > + Change initilize_transfer() to process_smbus_cmd() [Quan] > + Introduce functions for each slave event [Quan] > > v3: > + Switched binding doc to use DT schema format [Rob] > + Splited into generic ssif_bmc and aspeed-specific [Corey, Joel] > + Removed redundant license info [Joel] > + Switched to use traditional if-else [Joel] > + Removed unused ssif_bmc_ioctl() [Joel] > + Made handle_request()/complete_response() to return void [Joel] > + Refactored send_ssif_bmc_response() and > receive_ssif_bmc_request() [Corey] > + Remove mutex [Corey] > + Use spin_lock/unlock_irqsave/restore in callback [Corey] > + Removed the unnecessary memset [Corey] > + Switch to use dev_err() [Corey] > + Combine mask/unmask two interrupts together [Corey] > + Fixed unhandled Tx done with NAK [Quan] > + Late ack'ed Tx done w/wo Ack irq [Quan] > + Use aspeed-specific exported aspeed_set_slave_busy() when > slave busy to fix the deadlock [Graeme, Philipp, Quan] > + Clean buffer for last multipart read [Quan] > + Handle unknown incoming command [Quan] > > v2: > + Fixed compiling error with COMPILE_TEST for arc > > Quan Nguyen (3): > ipmi: ssif_bmc: Add SSIF BMC driver > bindings: ipmi: Add binding for SSIF BMC driver > i2c: aspeed: Assert NAK when slave is busy > > .../devicetree/bindings/ipmi/ssif-bmc.yaml | 38 + > drivers/char/ipmi/Kconfig | 10 + > drivers/char/ipmi/Makefile | 1 + > drivers/char/ipmi/ssif_bmc.c | 873 ++++++++++++++++++ > drivers/i2c/busses/i2c-aspeed.c | 9 +- > include/uapi/linux/ipmi_ssif_bmc.h | 18 + > 6 files changed, 948 insertions(+), 1 deletion(-) > create mode 100644 Documentation/devicetree/bindings/ipmi/ssif-bmc.yaml > create mode 100644 drivers/char/ipmi/ssif_bmc.c > create mode 100644 include/uapi/linux/ipmi_ssif_bmc.h > > -- > 2.35.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel