linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rich Felker <dalias@libc.org>
To: linux-sh@vger.kernel.org
Subject: sh cpu_data init broken for smp?
Date: Wed, 23 Mar 2016 02:52:04 +0000	[thread overview]
Message-ID: <20160323025204.GA18208@brightrain.aerifal.cx> (raw)

The arch/sh/kernel/cpu/*/probe.c cpu_probe functions are run per-cpu
from cpu_init from head_32.S, but they fill boot_cpu_data with cpu &
cache properties rather than current_cpu_data. Most of the consumers
of this data (especially cache properties), however, use
current_cpu_data, which seems to be default-initialized to zero for
all but the boot cpu. I can't confirm this bug on legacy SH hardware
since I don't have any that does SMP, but it's present on my
in-progress J2 SMP work.

Possibly a global s/boot_cpu_data/current_cpu_data/ should be applied
to arch/sh/kernel/cpu/*/probe.c and a few other places, but I wonder
why this data is even kept per-cpu. Can we actually support having
cache structure and cpu properties vary per-cpu in an SMP setup? I
don't think so, and if not, I'd rather switch to having a single copy
of the cpu_data and eliminate cpu_probe except at boot time on the
boot cpu.

A related issue is that I want to replace the 'probe' results that are
actually just hard-coded with data from device tree, which is only
available in flat form this early in the boot.

Rich

                 reply	other threads:[~2016-03-23  2:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160323025204.GA18208@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=linux-sh@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).