[{"id":3672890,"web_url":"http://patchwork.ozlabs.org/comment/3672890/","msgid":"<ac7NFT818QvR9EWK@pengutronix.de>","list_archive_url":null,"date":"2026-04-02T20:09:57","subject":"Re: [PATCH v10 0/6] mfd: Add support for NXP MC33978/MC34978 MSDI","submitter":{"id":71360,"url":"http://patchwork.ozlabs.org/api/people/71360/","name":"Oleksij Rempel","email":"o.rempel@pengutronix.de"},"content":"https://sashiko.dev/#/patchset/20260402174349.3220518-1-o.rempel%40pengutronix.de\n\nTL;DR: Sashiko's analysis of the phantom transient fault interrupt is\ncorrect, but the behavior is an acceptable compromise given the hardware\nlimitations. I would be glad if this driver could be accepted without\nadditional modifications, as it has already passed human review and\naddressed 99% of bot comments.\n\n---\n\nThe MC33978/MC34978 hardware's interrupt architecture is problematic:\n1. INT_B is clear-on-read for *any* SPI transaction.\n2. For persistent faults, INT_B immediately re-asserts if the fault remains.\n3. Fault flags are latched and only cleared when the hwmon child reads\n   the FAULT register.\n\nIf the core driver passed the raw hardware state, the system would hang\nin an interrupt storm (INT_B low -> SPI read clears it -> hardware\nre-asserts -> repeat).\n\nTo prevent this storm, the core implements a software edge-detection\ncache. When the hwmon child finally clears the fault latch, the core's\ncache gets out of sync. Re-syncing it requires the synthetic wake bit\nmentioned in the report, which causes the spurious interrupt edge.\n\nThe result is just one extra hwmon wakeup/SPI read when a fault clears.\nWorking around this would require more complexity. Trading one spurious\ninterrupt to prevent a hardware interrupt storm is an acceptable cost\nfor this silicon.\n\nOn Thu, Apr 02, 2026 at 07:43:43PM +0200, Oleksij Rempel wrote:\n> changes v7:\n> - drop gpiolib irq fix and make pinctrl more robust against NULL point\n>   dereference.\n> \n> This series adds support for the NXP MC33978/MC34978 Multiple Switch Detection\n> Interface (MSDI) via the MFD framework.\n> \n> Architecture overview:\n> * mfd: Core driver handling 2-frame pipelined SPI, regulator sequencing, and\n>   linear irq_domain. Harvests status bits from SPI MISO MSB.\n> * pinctrl: Exposes 22 physical switch inputs as standard GPIOs. Proxies IRQs to\n>   the MFD domain.\n> * hwmon: Exposes thermal limits, VBATP/VDDQ voltage boundaries, and dynamic\n>   fault alarms.\n> * mux: Controls the 24-to-1 AMUX routing analog signals (switch voltages,\n>   temperature, VBATP) to an external ADC.\n> \n> Initial pinctrl implementation by David Jander, reworked into this MFD\n> architecture.\n> \n> Best regards,\n> Oleksij\n> \n> David Jander (1):\n>   pinctrl: add NXP MC33978/MC34978 pinctrl driver\n> \n> Oleksij Rempel (5):\n>   dt-bindings: pinctrl: add NXP MC33978/MC34978 MSDI\n>   mfd: add NXP MC33978/MC34978 core driver\n>   pinctrl: core: Make pin group callbacks optional for pin-only drivers\n>   hwmon: add NXP MC33978/MC34978 driver\n>   mux: add NXP MC33978/MC34978 AMUX driver\n> \n>  .../bindings/pinctrl/nxp,mc33978.yaml         |  158 +++\n>  drivers/hwmon/Kconfig                         |   10 +\n>  drivers/hwmon/Makefile                        |    1 +\n>  drivers/hwmon/mc33978-hwmon.c                 |  549 +++++++++\n>  drivers/mfd/Kconfig                           |   15 +\n>  drivers/mfd/Makefile                          |    2 +\n>  drivers/mfd/mc33978.c                         | 1088 +++++++++++++++++\n>  drivers/mux/Kconfig                           |   14 +\n>  drivers/mux/Makefile                          |    2 +\n>  drivers/mux/mc33978-mux.c                     |  141 +++\n>  drivers/pinctrl/Kconfig                       |   16 +\n>  drivers/pinctrl/Makefile                      |    1 +\n>  drivers/pinctrl/core.c                        |   41 +-\n>  drivers/pinctrl/pinconf.c                     |    9 +-\n>  drivers/pinctrl/pinctrl-mc33978.c             | 1008 +++++++++++++++\n>  include/linux/mfd/mc33978.h                   |   95 ++\n>  16 files changed, 3143 insertions(+), 7 deletions(-)\n>  create mode 100644 Documentation/devicetree/bindings/pinctrl/nxp,mc33978.yaml\n>  create mode 100644 drivers/hwmon/mc33978-hwmon.c\n>  create mode 100644 drivers/mfd/mc33978.c\n>  create mode 100644 drivers/mux/mc33978-mux.c\n>  create mode 100644 drivers/pinctrl/pinctrl-mc33978.c\n>  create mode 100644 include/linux/mfd/mc33978.h\n> \n> --\n> 2.47.3\n> \n>","headers":{"Return-Path":"\n <linux-gpio+bounces-34616-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-gpio@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org;\n envelope-from=linux-gpio+bounces-34616-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=185.203.201.7","smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=pengutronix.de","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=pengutronix.de"],"Received":["from tor.lore.kernel.org (tor.lore.kernel.org\n [IPv6:2600:3c04:e001:36c::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fmtJw6CQPz1yCt\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 03 Apr 2026 07:10:56 +1100 (AEDT)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id 012DF3041796\n\tfor <incoming@patchwork.ozlabs.org>; Thu,  2 Apr 2026 20:10:27 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 6410A38B7B0;\n\tThu,  2 Apr 2026 20:10:26 +0000 (UTC)","from metis.whiteo.stw.pengutronix.de\n (metis.whiteo.stw.pengutronix.de [185.203.201.7])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id B8F4E207A20\n\tfor <linux-gpio@vger.kernel.org>; Thu,  2 Apr 2026 20:10:24 +0000 (UTC)","from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2])\n\tby metis.whiteo.stw.pengutronix.de with esmtps\n (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)\n\t(Exim 4.92)\n\t(envelope-from <ore@pengutronix.de>)\n\tid 1w8OMY-0006PG-Fh; Thu, 02 Apr 2026 22:09:58 +0200","from pty.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::c5])\n\tby drehscheibe.grey.stw.pengutronix.de with esmtps  (TLS1.3) tls\n TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384\n\t(Exim 4.96)\n\t(envelope-from <ore@pengutronix.de>)\n\tid 1w8OMX-003Qb3-2a;\n\tThu, 02 Apr 2026 22:09:57 +0200","from ore by pty.whiteo.stw.pengutronix.de with local (Exim 4.98.2)\n\t(envelope-from <ore@pengutronix.de>)\n\tid 1w8OMX-00000003GJH-2slL;\n\tThu, 02 Apr 2026 22:09:57 +0200"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775160626; cv=none;\n b=VYqzw+ZIvWCQquN822ahVaVkplHu5sYMf6mERw23RW8k/1NT2SVHrIFf4AG8pX6Bs+2MpXPfX0rxZeSSkFrk82bj8FaqzxFiHTrANLlVLPwZzKUxtRxo0TXChEaxh46selp2XntvdLmVhXo+mR7WLWDTIfZkLMd9CYIB9lj3SK4=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775160626; c=relaxed/simple;\n\tbh=yHELw4qGLIe3pkJSjVa3khr2kUsuHzRA9KBiP2pxPiE=;\n\th=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:\n\t Content-Type:Content-Disposition:In-Reply-To;\n b=l0xBTCcd2KGmlaCQX5sBIAEDcVzqsa9tlHO8gKE0+XOvLtNQt+KgIyiWYVRKpqYZFtI8G2h9mZ1XG0YB7gOmlO6ycgA78q3D52iGdz3KEXITE4jd+dRPntQ9zC9YQR7hXZHhyi5IQGEY5CtGxqfQeAkKLPz2aw3iXIp1QPGgwZE=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=pengutronix.de;\n spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7","Date":"Thu, 2 Apr 2026 22:09:57 +0200","From":"Oleksij Rempel <o.rempel@pengutronix.de>","To":"Guenter Roeck <linux@roeck-us.net>, Rob Herring <robh@kernel.org>,\n\tKrzysztof Kozlowski <krzk+dt@kernel.org>,\n\tConor Dooley <conor+dt@kernel.org>, Lee Jones <lee@kernel.org>,\n\tPeter Rosin <peda@axentia.se>, Linus Walleij <linusw@kernel.org>","Cc":"kernel@pengutronix.de, linux-kernel@vger.kernel.org,\n\tdevicetree@vger.kernel.org, linux-hwmon@vger.kernel.org,\n\tlinux-gpio@vger.kernel.org, David Jander <david@protonic.nl>","Subject":"Re: [PATCH v10 0/6] mfd: Add support for NXP MC33978/MC34978 MSDI","Message-ID":"<ac7NFT818QvR9EWK@pengutronix.de>","References":"<20260402174349.3220518-1-o.rempel@pengutronix.de>","Precedence":"bulk","X-Mailing-List":"linux-gpio@vger.kernel.org","List-Id":"<linux-gpio.vger.kernel.org>","List-Subscribe":"<mailto:linux-gpio+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-gpio+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20260402174349.3220518-1-o.rempel@pengutronix.de>","X-Sent-From":"Pengutronix Hildesheim","X-URL":"http://www.pengutronix.de/","X-Accept-Language":"de,en","X-Accept-Content-Type":"text/plain","X-SA-Exim-Connect-IP":"2a0a:edc0:0:c01:1d::a2","X-SA-Exim-Mail-From":"ore@pengutronix.de","X-SA-Exim-Scanned":"No (on metis.whiteo.stw.pengutronix.de);\n SAEximRunCond expanded to false","X-PTX-Original-Recipient":"linux-gpio@vger.kernel.org"}}]