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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6D54C83F19 for ; Mon, 28 Aug 2023 10:05:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230295AbjH1KEy (ORCPT ); Mon, 28 Aug 2023 06:04:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230285AbjH1KEZ (ORCPT ); Mon, 28 Aug 2023 06:04:25 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E7AFF0; Mon, 28 Aug 2023 03:04:21 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 148E3636A2; Mon, 28 Aug 2023 10:04:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66B3DC433C8; Mon, 28 Aug 2023 10:04:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1693217060; bh=3uglxRxHCVBlYj77LCP9PKXSeoC/1ACisKVvIg3m+uo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ISr307Emdzl9j6R8c39totXjYQBozd39lfsy2+FHTmMKSGulcTvR4rAmJTzp093vI 8f9oAJ48Ra4Kh6JPYesJYSi+kAxsJKDBI8bY/D1SLEeJ7hPk84uClEaiuO+ZXBziVp Ske9FgwJaMOSfbTYttw2xXHC5Am8Np2RdlibRpD9Rv9mSoShobGzkDcJRt993NlItJ ApiSEfjs5Sklk9NzSw5bdg6oiU4gy/Alj56ZHxq2dbZ48+nnK3A1riZN0SZCTG83d7 LZyhSpf5OZ5V3HzkZycO++l/e7WMk7NADvwI0Aq+Niz4+Zr0PvdtngmU0h75xr6tOz lP1UiJm5mhVvQ== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1qaZ6S-008gWD-Rd; Mon, 28 Aug 2023 11:04:12 +0100 Date: Mon, 28 Aug 2023 11:04:12 +0100 Message-ID: <865y4zfppf.wl-maz@kernel.org> From: Marc Zyngier To: Dmitry Baryshkov Cc: "Maulik Shah (mkshah)" , Andy Gross , Bjorn Andersson , Konrad Dybcio , Thomas Gleixner , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Neil Armstrong Subject: Re: [PATCH 1/2] irqchip/qcom-pdc: don't read version register if it is not available In-Reply-To: References: <20230825213552.1646321-1-dmitry.baryshkov@linaro.org> <09d89b1c-8c78-7671-a385-99c6a8910fde@quicinc.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: dmitry.baryshkov@linaro.org, quic_mkshah@quicinc.com, agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, tglx@linutronix.de, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, neil.armstrong@linaro.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 28 Aug 2023 10:46:10 +0100, Dmitry Baryshkov wrote: > > On Mon, 28 Aug 2023 at 12:36, Maulik Shah (mkshah) > wrote: > > > > Hi Dmitry, > > > > This patch may be useful if there was a case where some PDCs don't have > > version register populated/available, > > In all PDC versions, version register is always available but due to reg > > size not good enough in device tree for SM8150 it failed to read. > > > > reg size in device node must be expanded if its too small to access all > > registers and i think > > additional check in driver to check if size is good enough would not be > > of much use. > > Unfortunately, it doesn't work this way. DT files are ABI. Even if we > change the DT, the kernel should continue working with the older > version. > Thus, we have to add such bandaid code, which will keep the kernel > from crashing if old DT was used. You're missing the point: all existing PDC HW have version register. The fact that the DT is crap doesn't invalidate this simple fact. It is thus perfectly possible for the driver to *ignore* the crap and do the right thing by expanding the size of the mapping, rather than falling back to the non-versioned code. There is definitely precedents for this sort of behaviour, such as the ARM GICv2 probe code. M. -- Without deviation from the norm, progress is not possible.