From: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
To: <minyard@acm.org>, <linux-mips@linux-mips.org>,
<ralf@linux-mips.org>, <linux-kernel@vger.kernel.org>
Cc: Corey Minyard <cminyard@mvista.com>
Subject: Re: [PATCH] mips: Fix using smp_processor_id() when preemptible
Date: Thu, 10 Aug 2017 09:57:40 +0200 [thread overview]
Message-ID: <d5605c8a-6c98-af7c-1878-3a8d85b25f71@imgtec.com> (raw)
In-Reply-To: <1502313950-725-1-git-send-email-minyard@acm.org>
Hi Corey,
This has already been fixed here:
https://git.linux-mips.org/cgit/ralf/upstream-sfr.git/commit/?id=21da5332327b6d183bd93336ecf29c70bc609b7b
https://git.linux-mips.org/cgit/ralf/upstream-sfr.git/commit/?id=735302665c353d6756e7fa2a2cf41b039299f732
Marcin
On 09.08.2017 23:25, minyard@acm.org wrote:
> From: Corey Minyard <cminyard@mvista.com>
>
> I was getting the following:
>
> BUG: using smp_processor_id() in preemptible [00000000] code: swapper/0/1
> caller is pcibios_set_cache_line_size+0x10/0x58
>
> pcibios_set_cache_line_size() used current_cpu_data outside of
> an unpreemptible context.
>
> Signed-off-by: Corey Minyard <cminyard@mvista.com>
> ---
> arch/mips/pci/pci.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c
> index bd67ac7..afd2f8a 100644
> --- a/arch/mips/pci/pci.c
> +++ b/arch/mips/pci/pci.c
> @@ -28,9 +28,11 @@ EXPORT_SYMBOL(PCIBIOS_MIN_MEM);
>
> static int __init pcibios_set_cache_line_size(void)
> {
> - struct cpuinfo_mips *c = ¤t_cpu_data;
> + struct cpuinfo_mips *c;
> unsigned int lsize;
>
> + preempt_disable();
> + c = ¤t_cpu_data;
> /*
> * Set PCI cacheline size to that of the highest level in the
> * cache hierarchy.
> @@ -38,6 +40,7 @@ static int __init pcibios_set_cache_line_size(void)
> lsize = c->dcache.linesz;
> lsize = c->scache.linesz ? : lsize;
> lsize = c->tcache.linesz ? : lsize;
> + preempt_enable();
>
> BUG_ON(!lsize);
>
>
prev parent reply other threads:[~2017-08-10 7:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-09 21:25 minyard
2017-08-10 7:57 ` Marcin Nowakowski [this message]
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=d5605c8a-6c98-af7c-1878-3a8d85b25f71@imgtec.com \
--to=marcin.nowakowski@imgtec.com \
--cc=cminyard@mvista.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=minyard@acm.org \
--cc=ralf@linux-mips.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
all inboxes | Powered by JetHome®