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 X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 91039C433ED for ; Tue, 13 Apr 2021 08:25:30 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1E31E6128E for ; Tue, 13 Apr 2021 08:25:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1E31E6128E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=r1jyDDaqo1NTbwSiGpavjI+/o5RHbUo4PLLJ1JbTmpo=; b=E5ZBa89F8om6+9IkC9I3fcjWu KMCNVCKPtBazf0oK7OX4M3qAOEcT//6qcXw6pgUv3QAn8Nt+z3ZSbwpOiyHl152qvOxFfaE9FGQ6H GPS5iKHA0p9F9jUlMYBwbp1h8ZwVQZnTyus+a1/bxz6PPdJHi0c3Bd/j/XvpCMagzX3qPOTLxCv1K bVZG/3MA53SCsoH/9uJDa3bvfyHlQarDEFzJ/bGknMBEKMxhtc3QU0jERmXhPBmumG3TVzLJvhoSf zcEy1U8FMfjS8QE7NrlvdVntVgwqA6+hDV9YZiwQmT+CeRFSkIygD/Z3QpasLNuLDiwExGPVuHsE0 QurM82sDg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lWEKI-008ZpC-V1; Tue, 13 Apr 2021 08:23:15 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lWEJc-008ZnF-I3 for linux-arm-kernel@desiato.infradead.org; Tue, 13 Apr 2021 08:22:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=3RpgkYwsEk24/oyS+RpxX+Eq0fId9ynv8/XeJ9Uev6Q=; b=tstQU45nItxiX8ryfW5bhyl1Lj xsutbENnkT+PmX5hyGFoyEGl7kMwxzfkotRarmU0WqXdDfdvKasFZTmBR5ZNj1l6dPad0h8i7tYeD 73GGxM6zH5wuRLBhhwYwnMZjCuE+XSLDblR97l1SvT45MNNEq21P02TlrX3Lz5gdFKqK34/1BZgcJ Ujp/K/1hpfRpFxuGLeOoupZQA/QekNfQG/5240VxB5ds3XLrNIi18ZhNVMlhHRd9Lb/1Fr6A2TYYv aXJSUPwxMSo/eZNEOVGhw2+7IoNYNcIzRXj+FJySrvxzKIxAIeRExzMdbrNcwqw/OHaAJZxZlniUy ugiez5Fg==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lWEJZ-006pgn-5A for linux-arm-kernel@lists.infradead.org; Tue, 13 Apr 2021 08:22:30 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id A6F51613AE for ; Tue, 13 Apr 2021 08:22:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618302148; bh=FCK+SMdbdUGO5PuqGh46hY625MCpqFUerFbVNWNJmsU=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=rbngbYahMGe4TQffxAdJtnqoA+4uAXIIzQstIvnXyycZn6yoYgbMTptGxkY1QwoCN qaRj1wD0ufR2Z6BbaKA79azUIvCglPP1Q9d9Lkh7TDvzW9aq7byrS6HOAtEK604XId TxIecErW1PFjgVRTpT/6hn9OUwz9c6l3XRtTUWJXAwV80As1OviKsH0xrI7tBnuYVB 3TnSL2TNKhzj/rw0+Ms+XlqmAcJSrUvQxex+CUOvd0VjfuLCV7Q6r0gA40TTX8fqce PeJ50GXDTxHT4XTSgLiu9HSuHNFAX2bKVELWG8//h8siSyxG99z0Zic5Y9fDM0gcMp 59hXM3+4vWrCw== Received: by mail-wm1-f41.google.com with SMTP id y124-20020a1c32820000b029010c93864955so10109049wmy.5 for ; Tue, 13 Apr 2021 01:22:28 -0700 (PDT) X-Gm-Message-State: AOAM530blY4MYXJxYeMUxt9Gy85zx7ehVfP2LWhGwpHypoGUv17PYL9M by8eOMgmAgLzsTQweph1QaZqWVWrmPSX21wzJ9o= X-Google-Smtp-Source: ABdhPJx46kLBDXZba+CnxN/ZUNBoeLvXIwiYMUqu2i8IPMHM68OBFUpSsmGRmKG5BR+iCqeSFMqyDnLyPD7VzAFJe3M= X-Received: by 2002:a7b:c14a:: with SMTP id z10mr2831003wmi.75.1618302147230; Tue, 13 Apr 2021 01:22:27 -0700 (PDT) MIME-Version: 1.0 References: <20210319062752.145730-1-andrew@aj.id.au> <20210319062752.145730-16-andrew@aj.id.au> In-Reply-To: From: Arnd Bergmann Date: Tue, 13 Apr 2021 10:22:11 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 16/21] ipmi: kcs_bmc: Add a "raw" character device interface To: Andrew Jeffery Cc: Dmitry Torokhov , openipmi-developer@lists.sourceforge.net, OpenBMC Maillist , Corey Minyard , Joel Stanley , Ryan Chen , DTML , Tomer Maimon , linux-aspeed , "open list:GPIO SUBSYSTEM" , Avi Fishman , Patrick Venture , Linus Walleij , Linux Kernel Mailing List , Tali Perry , Rob Herring , Lee Jones , "Chia-Wei, Wang" , Linux ARM , Benjamin Fair X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210413_012229_254977_2F1518AA X-CRM114-Status: GOOD ( 37.55 ) 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: , 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, Apr 13, 2021 at 1:45 AM Andrew Jeffery wrote: > On Mon, 12 Apr 2021, at 18:18, Arnd Bergmann wrote: > > On Mon, Apr 12, 2021 at 3:33 AM Andrew Jeffery wrote: > > > On Fri, 9 Apr 2021, at 17:25, Arnd Bergmann wrote: > > > > On Fri, Mar 19, 2021 at 7:31 AM Andrew Jeffery wrote: > > > > > > > > > > The existing IPMI chardev encodes IPMI behaviours as the name suggests. > > > > > However, KCS devices are useful beyond IPMI (or keyboards), as they > > > > > provide a means to generate IRQs and exchange arbitrary data between a > > > > > BMC and its host system. > > > > > > > > I only noticed the series after Joel asked about the DT changes on the arm > > > > side. One question though: > > > > > > > > How does this related to the drivers/input/serio/ framework that also talks > > > > to the keyboard controller for things that are not keyboards? > > > > > > I've taken a brief look and I feel they're somewhat closely related. > > > > > > It's plausible that we could wrangle the code so the Aspeed and Nuvoton > > > KCS drivers move under drivers/input/serio. If you squint, the i8042 > > > serio device driver has similarities with what the Aspeed and Nuvoton > > > device drivers are providing to the KCS IPMI stack. > > > > After looking some more into it, I finally understood that the two are > > rather complementary. While the drivers/char/ipmi/kcs_bmc.c > > is the other (bmc) end of drivers/char/ipmi/ipmi_kcs_sm.c, it seems > > that the proposed kcs_bmc_cdev_raw.c interface would be > > what corresponds to the other side of > > drivers/input/serio/i8042.c+userio.c. > > Right. I guess the question is should we be splitting kernel subsystems > along host/bmc lines? Doesn't feel intuitive, it's all Linux, but maybe > we can consolidate in the future if it makes sense? We actually have a number of subsystems with somewhat overlapping functionality. I brought up serio, because it has an abstraction for multiple things that communicate over the keyboard controller and I thought the problem you were trying to solve was also related to the keyboard controller. It is also one of multiple abstractions that allow you to connect a device to a uart (along with serdev and tty_ldisc, probably at least one more that you can nest above or below these). Consolidating the kcs_bmc.c interface into something that already exists would obviously be best, but it's not clear which of these that should be, that depends on the fundamental properties of the hardware interface. > > Then again, these are also on > > separate ports (0x60 for the keyboard controller, 0xca2 for the BMC > > KCS), so they would never actually talk to one another. > > Well, sort of I guess. On Power systems we don't use the keyboard > controller for IPMI or keyboards, so we're just kinda exploiting the > hardware for our own purposes. Can you describe in an abstract form what the hardware interface can do here and what you want from it? I wonder if it could be part of a higher-level interface such as drivers/mailbox/ instead. Arnd _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel