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=-5.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 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 B5E75C433E0 for ; Thu, 28 Jan 2021 11:38:05 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 6603464DDA for ; Thu, 28 Jan 2021 11:38:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6603464DDA 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=merlin.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=jQdo9537Dkz16oI4pFTjk7a35TEideNPir7NNkJAm8k=; b=3Os0QmVw32Kncl+kUynFGiFxV VOSxoK5fk6XDurVe3AcAhtxq6Qm40wFMTYtDCbhV7GL3lXQuwn6KZYcOP1VOGOrC6c4eH0837UJhB bp3qDWlWT7dqnbIXgr9i2C38+Ry/mtNpbrDlAuYivuBF8RH0C26nkH0eO9CPVF6vWBdBmx/Untu3h iNAACRmLlpjsin8WBFvVxRTYMSc44T/SWU/2DwFQVV1R/B8jzgOICUsOd4TOWFdEAMX1A63qKl8nE UgPGE9GmwAtf+VGJfZyDU7tnthkPc2cci7gmlnKHV/2xBFRSyZtQiqmpcYwm5n6Ds2TqqHJmecXup J0CKAMn1A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l55bV-0003ue-Q0; Thu, 28 Jan 2021 11:36:49 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l55bT-0003uC-Dm for linux-arm-kernel@lists.infradead.org; Thu, 28 Jan 2021 11:36:48 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id B53D964DDA; Thu, 28 Jan 2021 11:36:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1611833806; bh=a1pl4yZDX8FPvw3cpwyHg1r7e84wJZBNZdKVzm8x6K4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TUC2K8gPUvmnzKZQzzuf+PemNlviY14vMimTRMCzM4brTI0nQP4x5OIE9V9p5ZxvU xZZscGYS89XTN/DIus3DgPKThBI9XoePeCP0qIvrD5uBj81hBq7RmjxtgTJNMw2Ryv PnUdUOLca2rxgHqu3hfq3iTkLjw6+WfJJVHRG1Ls8P7ZaQv1uOGJQp7OdtYVK3+Bak +al6UiQEUNoE6Q4mXGnVZ/SDO9Nok/gFL/q0RFKAc5N8dYiuL9kcyBSx7lurwNk1a3 JOINsJRXSKTq4OIu0d7NY0w600qY0OtFV5diGt4tc82qeGvumhmgb9dkq59naSCJGa 7AfUi6VWUindQ== Date: Thu, 28 Jan 2021 11:36:01 +0000 From: Mark Brown To: Andre Przywara Subject: Re: [PATCH v5 05/20] Input: axp20x-pek: Bail out if AXP has no interrupt line connected Message-ID: <20210128113601.GA4537@sirena.org.uk> References: <20210127172500.13356-1-andre.przywara@arm.com> <20210127172500.13356-6-andre.przywara@arm.com> <20210128104627.76b35a5c@slackpad.fritz.box> MIME-Version: 1.0 In-Reply-To: <20210128104627.76b35a5c@slackpad.fritz.box> X-Cookie: Do not pick the flowers. User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210128_063647_660144_6D2AF296 X-CRM114-Status: GOOD ( 22.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jernej Skrabec , Samuel Holland , Yangtao Li , linux-sunxi@googlegroups.com, Dmitry Torokhov , linux-kernel@vger.kernel.org, Maxime Ripard , Chen-Yu Tsai , =?iso-8859-1?Q?Cl=E9ment_P=E9ron?= , linux-input@vger.kernel.org, Shuosheng Huang , Lee Jones , linux-arm-kernel@lists.infradead.org, Icenowy Zheng Content-Type: multipart/mixed; boundary="===============2828701591376582383==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============2828701591376582383== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="cNdxnHkX5QqsyA0e" Content-Disposition: inline --cNdxnHkX5QqsyA0e Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jan 28, 2021 at 11:11:28AM +0000, Andre Przywara wrote: > Dmitry Torokhov wrote: > > On Wed, Jan 27, 2021 at 05:24:45PM +0000, Andre Przywara wrote: > > > Check for the regmap_irqc member to be not NULL before proceeding with > > > probe. This gets normally filled by the call to regmap_add_irq_chip(), > > > which we allow to skip now, when the DT node lacks an interrupt > > > property. =20 It sounds like you're trying to register an IRQ chip with a somehow bogus configuration? > > No, the driver is not the right place to patch this; regmap should be > > fixed so it does not crash instead. > I am not sure this is the right approach, those regmap functions look > more like an internal interface to me, with lots of wrapper functions > happily dereferencing pointers and reaching into structs. Moving > NULL checks into those does not sound like the right thing. CC:ing Mark > for more opinions on this. Without having seen the actual issue if you're trying to register an interrupt controller with a known broken hardware configuration that does seem like something the caller just shouldn't be doing, it's not something that's going to transiently happen at runtime and we're very much trusting that the caller got things right. > A more general solution would be to not instantiate this driver here > at all, when we don't have an interrupt line. > However at the moment the AXP MFD driver uses a const struct to hold > all MFD cells, so there is no easy way of omitting the power key > device dynamically. And even then it would hard code the requirement > for an interrupt into the MFD driver, when this could be considered an > implementation detail of the axp20x-pek driver. Another approach is to just register the optional device separately. --cNdxnHkX5QqsyA0e Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmASoaEACgkQJNaLcl1U h9AQ/gf+MpX0pegJATN0VStaUHumZY023d5JzzKt3eqw1qf+/tSf8NdJGJTV9CZa +91FikW/5M23AyOw2SxaT3waW9sm7ruTRIv0koHv3/G+XKzxrO9EUvulpDElhyHz qTXmW1e8JXWhyGji473Ki4e/1CaBRbTpSj440I6gc0ZiY4DVNE2/uJPeDPOJ4ijG gCk6s8H915DkQZnmHHzwbrXhz7uFXu3rXtq5PQ3ActDMJK1qQuPJW/KVq1mnpSLo G3U1+ydOhvHZ2jd68kfP12TKXDKEP8h+oGF+YBMVJYUWvNh1swtlFNwNsP6qrnq/ aStCaC8z4Kf+6B3v0jksH+nUjXFFUw== =ODfU -----END PGP SIGNATURE----- --cNdxnHkX5QqsyA0e-- --===============2828701591376582383== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============2828701591376582383==--