Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7770802rwb; Wed, 23 Nov 2022 10:29:17 -0800 (PST) X-Google-Smtp-Source: AA0mqf7FMsBSXoTuLdn5eAdz6k7VHSzloTf7IsMV696fwXBqJoUektCv47dE8DL3JkhHpNv78/pz X-Received: by 2002:a17:903:31d5:b0:185:4e4c:3483 with SMTP id v21-20020a17090331d500b001854e4c3483mr11680224ple.163.1669228156809; Wed, 23 Nov 2022 10:29:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669228156; cv=none; d=google.com; s=arc-20160816; b=dGDd6ZsBhmM6fuDDZC9S0VmOI/A+4yGeuPMW90v/TXHSn129USgfeZdgzvYztylBtC xm/qiJLZBmLa0cfqu5wshg0Sy1H+EkKxWypRV0L4aViOvcuVvjsN8PKwdL72G61DMQZp p/Qzhjn0/Oq8gAdaay9AVRfM8YMM+ZxFqvACsX9E8QnnPDpk3PT1us0aWOTz4vhr3B8B 7K6i2moIyZAfvRODFUIWcGgc3TDs+wI1tNvF995/qq/u60PjLvp7XfZi8cFtbfA5YeVH kzwwHDxEUqxW9Sdn6/8QH3KQPsTVyTKh/tuefaP445DOtToVF9My9THFKc+PS6PYBClr I7AA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=FPfaV9JQYEEBlTl/fS8GFESyDnIDzd+AMUhHZbg9V84=; b=Qk3MreiUCzeqLLOsxfpO18mxD2acSp8mQcB8Thiz2qvUl411Dlk36GbRyFraRhWA4i KBfQuYLjRDkGi1rW/Z9jmiHH9hvXb1YoWmSUmRmDn/xFMFdbCZ6vOvjy0fnwKHGSclfI ijKrVrb1uAbArAqO+fmQhN3aWwIF8aQsm78XHpkIggB2W3RA9xhqjeOps9GzBzNMGbgX sgsJ1gZs8RwcC/4MByreZmE5UPuLYz/yECTfMcadkBGHUSXAm9cS39mZy2kAyIkb3VdH NdiHTtPkwgM3Nw/6vOqJ1hqxqtQdLkMho6RJp6HHSceEXRSYEAuJJ8RY1uAt1T5vkS29 w8cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eKoPx+sU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g12-20020a63520c000000b00476a48051edsi17666323pgb.476.2022.11.23.10.29.05; Wed, 23 Nov 2022 10:29:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eKoPx+sU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239260AbiKWSCZ (ORCPT + 88 others); Wed, 23 Nov 2022 13:02:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239124AbiKWSCE (ORCPT ); Wed, 23 Nov 2022 13:02:04 -0500 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBCB72D741; Wed, 23 Nov 2022 10:02:02 -0800 (PST) Received: by mail-lf1-x12d.google.com with SMTP id j16so29248965lfe.12; Wed, 23 Nov 2022 10:02:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=FPfaV9JQYEEBlTl/fS8GFESyDnIDzd+AMUhHZbg9V84=; b=eKoPx+sUx3lamSLIjdVGDSUuRs8FkZJfekAEedrz6LWYH+KepBzDOYuMOK7f3c1PVg luWOSccwRgUvlTuOpv/BFryCTO4d9+4CUF4CM1NUQ7JYfE64n+7Wh8Mr3zO2z7YwVAb/ Nr8ooCjfFBf1+bu9YqcQdNk5rXRt4QCZp+K6ItYpidbv8a2lrONEm/12drOxtxgS8qu9 Yrg9BcvR8VisogZ4SVqo2cXzKshwrPh7yH/k95Pq5vPwAB2nODViU6YYHcR9eTGvLJ9K +E0pk5rb8PdiuZMjYT9aASnOFUf6k33s4WlcBK6pgQHXZsx075i5A6qQA7wh80CjfaRc 2Glg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=FPfaV9JQYEEBlTl/fS8GFESyDnIDzd+AMUhHZbg9V84=; b=5Z4tApNDg5xoAtfcNhmjZGDBCj3PAa67Vg6n7Fxx9Hzx18cFDLh3R6+QtV3VW7mj+g vjFhSvYE+0FLQfH3xkVqRQUg5LRoY2/4dlJu9ltsu8uPfj1+tyAUFPvruHqrwhrgc17X HfO1ZpIG+iedx+89dUa6ecFvn0IHqH9b+whVQhYMApqMjTWd2zNd+BD1kvxIqdsUfhJK lyN14qQVqPceL3cJ1YMp1Z7NcAhtPpLB7L7d0jETSeHqJ+tugI/GG/jwfVvc/nLfnXQg QosrUOmBHdRWeFz9cyQPJM/vfnPdG3dLchnz6PBbEM8RFluN/CkAGqeBopkwNtLJ0Ozl 1l6g== X-Gm-Message-State: ANoB5pnR43p0VDDJ8DmCoAQXB3g8C/JdpBGUXPxixuVU0w4V4AsgW6sU 19CFj938roA5Hh9WGOh4xjrICfichVqxitWSKCY= X-Received: by 2002:ac2:4e14:0:b0:4af:f5a0:8786 with SMTP id e20-20020ac24e14000000b004aff5a08786mr9144435lfr.265.1669226520087; Wed, 23 Nov 2022 10:02:00 -0800 (PST) MIME-Version: 1.0 References: <20221122201232.107065-1-tmaimon77@gmail.com> <20221122201232.107065-3-tmaimon77@gmail.com> <577e273d-ff9b-4d8d-b797-d7275ab8374f@app.fastmail.com> In-Reply-To: <577e273d-ff9b-4d8d-b797-d7275ab8374f@app.fastmail.com> From: Tomer Maimon Date: Wed, 23 Nov 2022 20:01:48 +0200 Message-ID: Subject: Re: [PATCH v1 2/2] soc: nuvoton: add NPCM LPC BPC driver To: Arnd Bergmann Cc: avifishman70@gmail.com, tali.perry1@gmail.com, Joel Stanley , venture@google.com, yuenn@google.com, benjaminfair@google.com, Hitomi Hasegawa , Hector Martin , Nicolas Ferre , "Conor.Dooley" , =?UTF-8?Q?Heiko_St=C3=BCbner?= , Sven Peter , Brian Norris , Rob Herring , krzysztof.kozlowski+dt@linaro.org, openbmc@lists.ozlabs.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Content-Type: text/plain; charset="UTF-8" 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_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Arnd, Thanks for your email On Wed, 23 Nov 2022 at 12:58, Arnd Bergmann wrote: > > On Tue, Nov 22, 2022, at 21:12, Tomer Maimon wrote: > > Add Nuvoton BMC NPCM LPC BIOS post code (BPC) driver. > > > > The NPCM BPC monitoring two configurable I/O address written by the host > > on the Low Pin Count (LPC) bus. > > > > Signed-off-by: Tomer Maimon > > --- > > drivers/soc/Kconfig | 1 + > > drivers/soc/Makefile | 1 + > > drivers/soc/nuvoton/Kconfig | 24 ++ > > drivers/soc/nuvoton/Makefile | 3 + > > drivers/soc/nuvoton/npcm-lpc-bpc.c | 396 +++++++++++++++++++++++++++++ > > In general, I try to keep drivers/soc/ for drivers that are > used purely inside of the kernel and don't provide their > own user space ABI, those should normally be part of > some subsystem grouped by functionality. > > It appears that we have similar drivers for aspeed already, > so there is some precedent, but I would still like to ask > you and Joel to try to make sure the two are compatible, > or ideally share the code for the user-facing part of the > LPC driver. Nuvoton and Aspeed use the same user-facing code to manage the host snooping. https://github.com/openbmc/phosphor-host-postd > > > +config NPCM_PCI_MBOX > > + tristate "NPCM PCI Mailbox Controller" > > + depends on (ARCH_NPCM || COMPILE_TEST) && REGMAP && MFD_SYSCON > > + help > > + Expose the NPCM BMC PCI MBOX registers found on Nuvoton SOCs > > + to userspace. > > This looks unrelated to the LPC driver, so this should > probably be a separate patch. The same comment about user > space presumably applies here, but I have not seen the driver. You are right, it was added by mistake. will drop off in the next patch > > The implementation of npcm-lpc-bpc looks fine otherwise, I only > noticed one minor detail that I would change: > > > + np = pdev->dev.parent->of_node; > > + if (!of_device_is_compatible(np, "nuvoton,npcm750-lpc") && > > + !of_device_is_compatible(np, "nuvoton,npcm845-lpc")) { > > + dev_err(dev, "unsupported LPC device binding\n"); > > + return -ENODEV; > > + } > > This check doesn't seem to make sense here, since those are > the only two types you support. About the LPC, I like to double check with our architectures on it because the BPC should working on eSPI as well. Maybe I should remove the LPC part. > > Arnd Best regards, Tomer