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 68E1AC38142 for ; Tue, 24 Jan 2023 14:01:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234498AbjAXOBl (ORCPT ); Tue, 24 Jan 2023 09:01:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234488AbjAXOBf (ORCPT ); Tue, 24 Jan 2023 09:01:35 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6C4DE470B5 for ; Tue, 24 Jan 2023 06:01:14 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 142C04B3; Tue, 24 Jan 2023 05:51:31 -0800 (PST) Received: from bogus (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A732A3F71E; Tue, 24 Jan 2023 05:50:47 -0800 (PST) Date: Tue, 24 Jan 2023 13:50:45 +0000 From: Sudeep Holla To: Conor Dooley Cc: Pierre Gondois , linux-kernel@vger.kernel.org, Dan Carpenter , Sudeep Holla , kernel test robot , Catalin Marinas , Will Deacon , Greg Kroah-Hartman , "Rafael J. Wysocki" , Palmer Dabbelt , Gavin Shan , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH -next] cacheinfo: Correctly handle new acpi_get_cache_info() prototype Message-ID: <20230124135045.ntl2nhf2oehdc7mu@bogus> References: <20230124123450.321852-1-pierre.gondois@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 24, 2023 at 01:31:06PM +0000, Conor Dooley wrote: > Hey! > > On Tue, Jan 24, 2023 at 01:34:46PM +0100, Pierre Gondois wrote: > > commit bd500361a937 ("ACPI: PPTT: Update acpi_find_last_cache_level() > > to acpi_get_cache_info()") > > updates the function acpi_get_cache_info(). > > > > If CONFIG_ACPI_PPTT is not defined, acpi_get_cache_info() doesn't > > update its *levels and *split_levels parameters and returns 0. > > This can lead to a faulty behaviour. > > > > Make acpi_get_cache_info() return an error code if CONFIG_ACPI_PPTT > > is not defined. Initialize levels and split_levels before passing > > their address to acpi_get_cache_info(). > > > > Also, in init_cache_level(): > > Hmm... > > > - commit e75d18cecbb3 ("arm64: cacheinfo: Fix incorrect > > assignment of signed error value to unsigned fw_level") > > checks the fw_level value in init_cache_level() in case > > the value is negative. Remove this check as the error code > > is not returned through fw_level anymore. > > - if no PPTT is present or CONFIG_ACPI_PPTT is not defined, > > it is still possible to use the cache information from clidr_el1. > > Instead of aborting if acpi_get_cache_info() returns an error > > code, just continue. > > To be honest, these feel like entirely separate things that should be > in different patches. You've got: > - Dan's smatch fixes > - a redundant check being removed > - a behaviour change for if acpi_get_cache_info() returns an error > I am not too fussy about it, but for sure it would be cleaner for sure. > > Reported-by: Dan Carpenter > > Reported-by: kernel test robot > > How about Link: to the LKP/Dan's report? > Link: https://lore.kernel.org/all/Y86iruJPuwNN7rZw@kili/ > > I did a quick check but didn't don't see the LKP report... > Yes, LKP dropped all the cc when reported, even I saw after merging the changes. I think this is the one: https://lore.kernel.org/all/202301052307.JYt1GWaJ-lkp@intel.com/ > Also a Fixes: tag too, no? > +1, if you split make sure you tag fixes to the right one(mainly one that changes return from acpi_get_cache_info()) > Thanks, > Conor. -- Regards, Sudeep