Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1910965lql; Wed, 13 Mar 2024 11:33:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUdrNRGg5QViunfkdi61Wui1/I2PyvyAHVt7sAfW8rM99JkaSZDnl/UO5QvKcZOan5tm6zykaNsQOxxEdEX0SG+jTt7P775um70w81qTw== X-Google-Smtp-Source: AGHT+IHNITvvlMsGmXhWcvZtbvURMWMBSdnH8lcc16GnNQuL7OPNtILRJ6NVRdszl4kuxm0y9hER X-Received: by 2002:a50:ab48:0:b0:566:825b:98 with SMTP id t8-20020a50ab48000000b00566825b0098mr3158084edc.6.1710354819115; Wed, 13 Mar 2024 11:33:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710354819; cv=pass; d=google.com; s=arc-20160816; b=ok4l2ERJmvL1MRODkF8LYEkNRxZ++sDhtQz2LmUXo1B38OK/SNnWu7TvskvDCBRjnn HzPcAUGC1qkJlpiljXoVNZruJBjQAOSlmxZb9IbtdmbvyQYf+8cpjZ8uAla+sdKIkBYZ RY5WvTl2CebfqFQ3YkRz9nVd81TUzx4UCS7eO2Z+LELQji0kORTuVCprzU27QX1rQ8hz UqfI5dK3QXPnSDB0suzOsHYC6ErMyiZjpEwy6eixnmv9r+Heq/CAmz43tpN4D54aTN1n 84rYbHKHyIM7/Nnit2upovQjPFUhPeGGPeOTC8iFDMxrwNQBgLrwD1wfcOzLvTxVGRnb z19A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=PplELY1KFkbbainlrPdk4FaZv2dPnxhGL2R5dvxZJcc=; fh=iimQjM7L+aMcIucqmVm/t90EcDr37fSDHmhRpGltNXQ=; b=iPnV+CXCt48GOUiWg2yGeLJ0vGqArUAw2mElYZT4MWDrH3m7cIL/UqLYLhpNKmtlvL 8cdtOt26PmSKEd8+DiXg0P+Iz349gPOash3t/rj49RhQ7IgYk567Vw+DaXyIkajJO2WD T2p7T1ePRivSc3UCR/1Z+cqZE04NkJRNnmpNg1EVCRhdnIsGOMapSp2kNIHFdVsV1fm8 89JwTVDDR3Ko0Snp7MqIMWg6rwiMgzHLbc7DDxfQ18zd/xG6JBjqe7oFpqiBlNTzzHva nWFozNxU3HTFLhdIhNsTJteVgZVgiR0ooRg/929rWwTnzP5XTBTTP+r0h3sx9qBpSR5/ olfw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=gaE78Dgv; arc=pass (i=1 dkim=pass dkdomain=armlinux.org.uk dmarc=pass fromdomain=armlinux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-102242-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-102242-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id j11-20020a05640211cb00b005682adbee5csi1208746edw.292.2024.03.13.11.33.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 11:33:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-102242-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=gaE78Dgv; arc=pass (i=1 dkim=pass dkdomain=armlinux.org.uk dmarc=pass fromdomain=armlinux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-102242-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-102242-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id C91FC1F2D77E for ; Wed, 13 Mar 2024 18:33:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C318061685; Wed, 13 Mar 2024 17:13:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="gaE78Dgv" Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 119807BB11; Wed, 13 Mar 2024 17:13:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710350034; cv=none; b=ePBNxK8DSfDwv5CLekJc2YZkN6rgeJvWjWdwc5ZHv2lKdNdKzVoIcAu0+huD/ve5+yeL2Tc6Al/45vy6d8AGgf3akggf8jqtwqIhRVta6pm+SzEvZuSXetTckJeWUkvInt5plgn6iUWxJoyfA+NhqJ9pNttlvxt6fbCnzWyykv0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710350034; c=relaxed/simple; bh=GUQXLTXTZ/RC3EIvgtVKiqNodwEKbwS4Cu2U8qXFU/w=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=u8IuPHKfZ3k6qosQYp8noz9b3W2LQ4YEY7tpdWC0xxH3eU5bn3U42cespeDtX4TF40svG+NqI9w5DqdtXtXLJ95oz+VIgnzpzBeZhrUmXiRWm3Fa8cqbbNobbfAPZ1MVvIL7RjXqHaJ6hBaggNcIA5QA3O9f9pBgD7jNBUp/QAI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=gaE78Dgv; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=PplELY1KFkbbainlrPdk4FaZv2dPnxhGL2R5dvxZJcc=; b=gaE78DgvKAJxF5LfQGZm9rbZnq Z6g9f1MSGKltQmW+YWLoqsnkeGJUXUGPP1sjsV3PidbKBCS5V9wNQjTXOrlwwmwm5bbV/BxWMAr2x sTjZF0F6PR9AYHWc9+auHzQVw4pZRi7IIZ5xMlKxmn9VcoawshgDsEDKz0zSmdCCE+ZXVUKwRHXLY bdvmNEyOB6vNM01wor0GwCEy0QZ8WoBSHJ97KjFOXz7i368MBndTTPTtjn75tFwxUgqqU3n7bkAHc 6CzEW+lQ1fE9lpgzIG4VkIQ8bJ/vG3Egqoref58CZpLPcRcoFZWM9kQqNYrJ/5MPmamzjixkUvUvW RHj+UJcA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:45220) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1rkSAf-0007y7-0R; Wed, 13 Mar 2024 17:13:41 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1rkSAX-0004eW-SY; Wed, 13 Mar 2024 17:13:33 +0000 Date: Wed, 13 Mar 2024 17:13:33 +0000 From: "Russell King (Oracle)" To: Marek Szyprowski Cc: Sudeep Holla , Catalin Marinas , "Christoph Lameter (Ampere)" , Mark Rutland , "linux-pm@vger.kernel.org" , "Rafael J. Wysocki" , Viresh Kumar , Will Deacon , Jonathan.Cameron@huawei.com, Matteo.Carlini@arm.com, Valentin.Schneider@arm.com, akpm@linux-foundation.org, anshuman.khandual@arm.com, Eric Mackay , dave.kleikamp@oracle.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, robin.murphy@arm.com, vanshikonda@os.amperecomputing.com, yang@os.amperecomputing.com, Nishanth Menon , Stephen Boyd Subject: Re: [PATCH v3] ARM64: Dynamically allocate cpumasks and increase supported CPUs to 512 Message-ID: References: <37099a57-b655-3b3a-56d0-5f7fbd49d7db@gentwo.org> <9352f410-9dad-ac89-181a-b3cfc86176b8@linux.com> <432c1980-b00f-4b07-9e24-0bec52ccb5d6@samsung.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <432c1980-b00f-4b07-9e24-0bec52ccb5d6@samsung.com> Sender: Russell King (Oracle) On Wed, Mar 13, 2024 at 05:22:33PM +0100, Marek Szyprowski wrote: > On 13.03.2024 15:35, Sudeep Holla wrote: > > On Tue, Mar 12, 2024 at 05:55:49PM +0000, Catalin Marinas wrote: > >> On Tue, Mar 12, 2024 at 10:06:06AM -0700, Christoph Lameter (Ampere) wrote: > >>> On Mon, 11 Mar 2024, Christoph Lameter (Ampere) wrote: > >>> > >>>> This could be an issue in the ARM64 arch code itself where there maybe > >>>> an assumption elsewhere that a cpumask can always store up to NR_CPU > >>>> cpus and not only nr_cpu_ids as OFFSTACK does. > >>>> > >>>> How can I exercise the opp driver in order to recreate the problem? > >>>> > >>>> I assume the opp driver is ARM specific? x86 defaults to OFFSTACK so if > >>>> there is an issue with OFFSTACK in opp then it should fail with kernel > >>>> default configuration on that platform. > >>> I checked the ARM64 arch sources use of NR_CPUS and its all fine. > >>> > >>> Also verified in my testing logs that CONFIG_PM_OPP was set in all tests. > >>> > >>> No warnings in the kernel log during those tests. > >>> > >>> How to reproduce this? > >> I guess you need a platform with a dts that has an "operating-points-v2" > >> property. I don't have any around. > >> > >> Sudeep was trying to trigger this code path earlier, not sure where he > >> got to. > > I did try to trigger this on FVP by adding OPPs + some hacks to add dummy > > clock provider to successfully probe this driver. I couldn't hit the issue > > reported ????. It could be that with the hardware clock/regulator drivers, it > > take a different path in OPP core. > > I can fully reproduce this issue on Khadas VIM3 and Odroid-N2 boards. > Both Meson A311D SoC based. So, if I'm reading the OPP code and the DTS* files for Khadas VIM3 correctly, these use operating-points-v2, which is parsed by the opp layer. If the opp layer is unable to parse any operating points, it should print "no supported OPPs" and remove the table (thereby preventing the code in question being reached.) So, I wonder whether what you're seeing is a latent bug which is being tickled by the presence of the CPU masks being off-stack changing the kernel timing. I would suggest the printk debug approach may help here to see when the OPPs are begun to be parsed, when they're created etc and their timing relationship to being used. Given the suspicion, it's possible that the mere addition of printk() may "fix" the problem, which again would be another semi-useful data point. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!