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=-1.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 37E34C10DCE for ; Sun, 8 Mar 2020 17:26:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 02BC0208CD for ; Sun, 8 Mar 2020 17:26:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583688404; bh=YTPDcg3NPobDvml6ZB3YkfAxMLw7bA5LT4Eay9tb5wM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=WsaGRWpzsxJzc8ueS9vxSJIgZO/9kkNQgIt2mMVsa157dYEE8eBMwaRzuxp3FKl9D rTQpqgaVPg7PeMEB4b7zm2JZrziWD9We5Yisdkp0lmrhq+04m3psWscSGStRAzEzrq 7eQ97X08/pi1SkCvcp9JitMN9LMIvZc6yvfI2fmI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726338AbgCHR0m (ORCPT ); Sun, 8 Mar 2020 13:26:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:34220 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726270AbgCHR0m (ORCPT ); Sun, 8 Mar 2020 13:26:42 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 52A92208C3; Sun, 8 Mar 2020 17:26:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583688401; bh=YTPDcg3NPobDvml6ZB3YkfAxMLw7bA5LT4Eay9tb5wM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=NPz3UUwj4zwrHz6FLblAphcas+yzxu2b0l/ZLg997L0I9aQpXBVHSjokqtf0Ro8HS dS1P29FbJUHhjIhTEX2qnjiTk0qSdWvKssDL9FXHB5yAqfEhEOlow1oSPktQbX2gfO DUcrsmSZoJLZ10V48CVIwj5RkwuzOf8gd3ihJI1w= Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=big-swifty.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jAzhH-00B4lv-Ca; Sun, 08 Mar 2020 17:26:39 +0000 Date: Sun, 08 Mar 2020 17:26:35 +0000 Message-ID: <861rq27o6s.wl-maz@kernel.org> From: Marc Zyngier To: Lubomir Rintel Cc: Thomas Gleixner , Jason Cooper , linux-kernel@vger.kernel.org, Rob Herring Subject: Re: [PATCH 0/2] irqchip/mmp: A pair of robustness fixed In-Reply-To: <20200308143814.GA150394@furthur.local> References: <20200219080024.4002-1-lkundrak@v3.sk> <20200308140434.18b0f947@why> <20200308143814.GA150394@furthur.local> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 EasyPG/1.0.0 Emacs/26 (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: 62.31.163.78 X-SA-Exim-Rcpt-To: lkundrak@v3.sk, tglx@linutronix.de, jason@lakedaemon.net, linux-kernel@vger.kernel.org, robh@kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 08 Mar 2020 14:46:04 +0000, Lubomir Rintel wrote: > > On Sun, Mar 08, 2020 at 02:04:34PM +0000, Marc Zyngier wrote: > > On Wed, 19 Feb 2020 09:00:22 +0100 > > Lubomir Rintel wrote: > > > > [+RobH] > > > > Lubomir, > > > > > Hi, > > > > > > please consider applying these two patches. Thery are not strictly > > > necessary, but improve diagnostics in case the DT is faulty. > > > > Can't we instead make sure our DT infrastructure checks for these? I'm > > very reluctant to add more "DT validation" to the kernel, as it feels > > like the wrong place to do this. > > These are not really problems of the DT infrastructure. They are. The DT bindings describes the constraints (or at least should), and the DT infrastructure could, at least in theory, check them at compile time. Adding the checks to the kernel defeats the single benefit of DT, which is independence from the kernel. > It's that the driver has some constrains resulting from use of > global data ([PATCH 1]) and statically sized arrays ([PATCH 2]) > without enforcing them. > > It's probably easier to mess up DT than to mess up board files, No, both models can be just as easily broken if people write them without thinking twice. > but regardless of that, being a little defensive and checking the > bounds of arrays is probably a good programming practice anyways. Is there even any example of such broken DT in the tree? M. -- Jazz is not dead, it just smells funny.