Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2441094pxb; Sat, 30 Jan 2021 02:43:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJxHT8/XdU3eQmLHWyTcoDx9SgSh7Jeiqt/iiXSlv63QBpqeEGLIHRAhneREPkVgLC4iSQkW X-Received: by 2002:a17:906:7a42:: with SMTP id i2mr8787786ejo.27.1612003425023; Sat, 30 Jan 2021 02:43:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612003425; cv=none; d=google.com; s=arc-20160816; b=sdir1ngYNwTS6Yjl+fvzIp1UCsguDGYp8ySbl4KKWFA9rTTNpX1N+LsRr4WpMpaMSX kwFeN+WOAckidvWaofoXMNTPanBxEsumkTmFmGQAO/GppDEsGmzWUzR1y85KweSEZ1d9 9vNqohIGAyMGPZmrV0eDXHO1pRRunW2WS4oTZ7Ya1bDDqY8f9VyKkKsDXTSWihCw21uJ S/1xNc9jTVn0mkJlD9cN/HBDC9mFwyUrOhZfQWyAwSNdhhmx12wOoFiaFWl4/TXZRXY7 v8VnCWewrmF20LOWC7Yvmzdq1MV4vbRpsZg2yTJ37iP0rVZhgKw1xEPWJTmiFZmYktFQ Gylg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=Oa1dItTmNYKHh5pZMMxxZ+w/cNjCvp3zbGbPpGitjzI=; b=YzD91HvqEXV0t9Ww0n4p79P/PoCLZ08ZEjneADS2PAPFTRgFccCHqs0rx87QUiFIMw 1s18oQUi+ruqmWBNuAh7mKvXU7fy2ur4Ycbr5qHnFDwKLbi7PQ5TGSuviYlXN60L6CYX cYMYDCimhih3jpaEzZUynN9hsjahCNX26EgkV9rdYveKomAk4N7lesrT0m7qWFPRCvXu bIOxTbb7AAAfvCjT2QyUp8KcXfsV35PueDU6oJY4Ojb0F2ORxxoajx1F3ZO4nLRy1Zfo ybTpuFg2OW72ekz8ws5+bhgAgc41OYU8o+MBP8ig5OfL0kZTD8+fsZVMCXse0KvvHuzb cgMQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g27si397209edf.244.2021.01.30.02.43.21; Sat, 30 Jan 2021 02:43:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230111AbhA3Kit (ORCPT + 99 others); Sat, 30 Jan 2021 05:38:49 -0500 Received: from mail-ot1-f48.google.com ([209.85.210.48]:46787 "EHLO mail-ot1-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229726AbhA3Kit (ORCPT ); Sat, 30 Jan 2021 05:38:49 -0500 Received: by mail-ot1-f48.google.com with SMTP id d1so11188155otl.13 for ; Sat, 30 Jan 2021 02:38:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Oa1dItTmNYKHh5pZMMxxZ+w/cNjCvp3zbGbPpGitjzI=; b=gK44i0YIgajYuuAfxQzY1X8lmDseo2JOdrtyI2W4YiNSCndUZz43Wr2BmXVndWMEea reRiXr37WAh6lYcqlzpmUH5cT6j9tlpIWRtf0T92/phIZWLb7txzePiorHMAToC8ZhY3 sFEVMjshUDif0Yfu5fjW00AhiXnxoAWyYek2c3rm02ImsoOdPkQeWaUBF4OlRZNX4kY7 24/uUDH05vYTtEZNeCyM9ltsqgwg8VbswGzHaW1wQ9d4vrrVmgdt1tkkKfcRMEm09H5d aAp3poeZo3GFno9j7qNrfoJFyUrS5UXkwEbzDQYPrKLtTuYpZfIUhp2fswx8Pts2kbdq lqWA== X-Gm-Message-State: AOAM533G6tYf9MPziUnV3ZWHf+nBCrOvDUWjpE3dgzZc/fZxCLsJRCeH IIzUfNXEBanpZZ/YytrOnXehVPKgqvHuUTaw+6E= X-Received: by 2002:a05:6830:1489:: with SMTP id s9mr5600635otq.250.1612003088374; Sat, 30 Jan 2021 02:38:08 -0800 (PST) MIME-Version: 1.0 References: <0b26eda7-229d-3dc9-f2ae-19b9212fb0ea@rwth-aachen.de> In-Reply-To: <0b26eda7-229d-3dc9-f2ae-19b9212fb0ea@rwth-aachen.de> From: Geert Uytterhoeven Date: Sat, 30 Jan 2021 11:37:57 +0100 Message-ID: Subject: Re: [PATCH] openrisc: use device tree to determine present cpus To: Jan Henrik Weinstock Cc: Jonas Bonn , Stefan Kristiansson , Stafford Horne , Openrisc , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jan, On Fri, Jan 29, 2021 at 7:34 PM Jan Henrik Weinstock wrote: > This patch proposes to use the device tree to determine the present cpus > instead of assuming all CONFIG_NRCPUS are actually present in the system. > > Signed-off-by: Jan Henrik Weinstock Thanks for your patch! > --- a/arch/openrisc/kernel/smp.c > +++ b/arch/openrisc/kernel/smp.c > @@ -68,14 +69,25 @@ void __init smp_init_cpus(void) > > void __init smp_prepare_cpus(unsigned int max_cpus) > { > - int i; > + u32 cpu_id; > + struct device_node *cpu, *cpus; > > /* > * Initialise the present map, which describes the set of CPUs > * actually populated at the present time. > */ > - for (i = 0; i < max_cpus; i++) > - set_cpu_present(i, true); > + cpus = of_find_node_by_path("/cpus"); > + for_each_child_of_node(cpus, cpu) { for_each_of_cpu_node()? Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds