Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp998325iob; Fri, 13 May 2022 19:06:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytUL/CqW+Sr2fbTpI+eJwOZSoXcievlEHARckc0mpXXb4l1tjAOG221ilK9YjvSgrLf0UK X-Received: by 2002:a05:6000:1562:b0:20c:64fc:34f with SMTP id 2-20020a056000156200b0020c64fc034fmr6124832wrz.132.1652493985053; Fri, 13 May 2022 19:06:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652493985; cv=none; d=google.com; s=arc-20160816; b=l+QNp5ZkgpskAALQYIawg5A9RM/r0deUl65wgF1BOImjUW7WiHZsDtiEUqt5VcgId9 ezvbcFeSKazHTSJn6bMsB/FqyGNwdT4u2aZEMzy0Zlhvn+I1d9+W34a7fj6e06vFnoEY b8GPTE39oDhFMn6ziC3+PCyJNGKr7CzkDiFbUChC9WcFJH2UZnjwPuzbwMveUtEXReH5 p1r3fzAZ3EXnG4JbW5yjIveGE5670PL66kE6I4tWvNTkKgWdMz6jHK3yRDkqMlAeUvz8 AsvlA7kjsc48rEQuqw/eGJuX2iwrq6/sDQIV1ouUp99NMgOWkvwAQ6ox58SGWUbAhlTZ aI3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=upk7oiV3ipoyV+9OhHOoOS6ppQQslCnw1gywawi73Rg=; b=0sF9FTqQp5YJi60Bp6xHY6qbR8JriWBaVnGSNfO0ptkZ3M67fKuLWM+6z+vejT+Jfh b8TudyA/UUHnMNc1ndFgGyAqMiAcCdDY7kpXTjTsCxRJDbNM/1/+EgOwyRe5dDBvQhhH Ef9TmWY1cPszQVNdtLFSrtZ5zBkcr6SuxSqqRhqZUeIVUwsIQ9QJxPJ0V2W6Y71RzrcE W6JSfQExIeSHZXEU9+E/JeLFID9c9SNF+JSIXSbz5yvVkZY9LMPxh9bvWIHmebdyNWdR Win27A19XuQKhcZ0t/GvnYLxVCmKQJA9YkIQJtOdNkjpKftgMJo1kuxbBaO+RGMlPeHx JT4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=cn5+Wofi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id v185-20020a1cacc2000000b003947e9b3302si6423768wme.145.2022.05.13.19.06.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 19:06:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=cn5+Wofi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 10FD12F4161; Fri, 13 May 2022 17:26:48 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355482AbiELOka (ORCPT + 99 others); Thu, 12 May 2022 10:40:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245183AbiELOk1 (ORCPT ); Thu, 12 May 2022 10:40:27 -0400 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04554253A9F; Thu, 12 May 2022 07:40:26 -0700 (PDT) Received: by mail-lj1-x235.google.com with SMTP id s27so6806518ljd.2; Thu, 12 May 2022 07:40:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=upk7oiV3ipoyV+9OhHOoOS6ppQQslCnw1gywawi73Rg=; b=cn5+WofiBeYl3bkckxw3lYx+LE9Jtav/Xh3MaQ+D2aG9z8L2oXvBybH4W3MDIJPtH/ vRNdjMTDIoc1wgNdcYa5QiqA5B8Bse+yTFmT2iiJBCBUjHhC/FEozLnVAueGBpuKXAJD nmK+CycBUDxLHIJ078FRlEyVDuKZvBqMX7zWyMAHcqHhP7pxNQlvy2KxbUirLxn5Kmfx yctxjglw7h+OxUzlN7ra7WQJg1RP+3IUr4KeMG3yzXPZVafoKX1DUdrbP7vEGsYomGEy BLZn5StPm9yJh30Ixrysmf36KpBDNvj79K08gdwBoNbrYV/xpc4Sq2G3yG2b052245uV gauA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=upk7oiV3ipoyV+9OhHOoOS6ppQQslCnw1gywawi73Rg=; b=2zQ1j9q9idOCf2GidjdzabD6Lwc7g4rRoMwDrtQhPOKwoNpqXOCjm1xDBoq6xwf+Ei Bci5OmmvIvLkGb2OICufrVk8N2uWnROTRqYe+V7VfTcUTStSRlGw/ruV36iJEiguumFp Ph4c1FFiebCQNzd98zMyvVAapp85Kx/8+C7ADp47p01tv2vMdZDS2Ehezq00XDlvHFRV o9qkAWoIukxozq7GGtG7zoG2H3xNrVvoegfRMj7SofW9wJiY+beq/SMM7zA03H+GScVG Vf33M3nQvHd7q+Rg4q/RgQbXP7n+k9BdGDiAGdXErafrF82WEOhekdGF4aarSXp/iCrB W2Pg== X-Gm-Message-State: AOAM5318D4bpGd+kuvMMCTkdWcIuEijuF7+plozqnwqrLCd10jHLiLZe 9KHvheo+LxkgxTFJuheASt4= X-Received: by 2002:a2e:8744:0:b0:250:9bfe:b777 with SMTP id q4-20020a2e8744000000b002509bfeb777mr178699ljj.523.1652366424277; Thu, 12 May 2022 07:40:24 -0700 (PDT) Received: from mobilestation ([95.79.189.214]) by smtp.gmail.com with ESMTPSA id n5-20020a056512310500b0047255d211ccsm809816lfb.251.2022.05.12.07.40.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 May 2022 07:40:23 -0700 (PDT) Date: Thu, 12 May 2022 17:40:21 +0300 From: Serge Semin To: Sergei Shtylyov Cc: Serge Semin , Damien Le Moal , Hans de Goede , Jens Axboe , Alexey Malahov , Pavel Parkhomenko , Rob Herring , linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH v3 09/23] ata: libahci_platform: Sanity check the DT child nodes number Message-ID: <20220512144021.stkajc7dimgfkldv@mobilestation> References: <20220511231810.4928-1-Sergey.Semin@baikalelectronics.ru> <20220511231810.4928-10-Sergey.Semin@baikalelectronics.ru> <42dfc76f-a9d9-8e63-874d-b7459cef326c@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <42dfc76f-a9d9-8e63-874d-b7459cef326c@gmail.com> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 On Thu, May 12, 2022 at 11:24:22AM +0300, Sergei Shtylyov wrote: > On 5/12/22 2:17 AM, Serge Semin wrote: > > > Having greater than (AHCI_MAX_PORTS = 32) ports detected isn't that > > Having greater than AHCI_MAX_PORTS (32) ports detected? Ok. > > > critical from the further AHCI-platform initialization point of view since > > exceeding the ports upper limit will cause allocating more resources than > > will be used afterwards. But detecting too many child DT-nodes doesn't > > seem right since it's very unlikely to have it on an ordinary platform. In > > accordance with the AHCI specification there can't be more than 32 ports > > implemented at least due to having the CAP.NP field of 4 bits wide and the > > It's 5 bits wide, actually... Right =) The denoted comments will be taken into account in v4. Thanks. -Sergey > > > PI register of dword size. Thus if such situation is found the DTB must > > have been corrupted and the data read from it shouldn't be reliable. Let's > > consider that as an erroneous situation and halt further resources > > allocation. > > > > Note it's logically more correct to have the nports set only after the > > initialization value is checked for being sane. So while at it let's make > > sure nports is assigned with a correct value. > > > > Signed-off-by: Serge Semin > > [...] > > MBR, Sergey