From: Vineet Gupta <Vineet.Gupta1@synopsys.com>
To: Alexey Brodkin <Alexey.Brodkin@synopsys.com>,
"linux-snps-arc@lists.infradead.org"
<linux-snps-arc@lists.infradead.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Igor Guryanov" <Igor.Guryanov@synopsys.com>
Subject: Re: [PATCH 2/2] arc: Fix xCCM size check
Date: Thu, 22 Dec 2016 16:34:02 -0800 [thread overview]
Message-ID: <75d86ac5-ed58-99d4-3c6b-97d56b90ed36@synopsys.com> (raw)
In-Reply-To: <1482415750-5471-3-git-send-email-abrodkin@synopsys.com>
On 12/22/2016 06:09 AM, Alexey Brodkin wrote:
> CONFIG_ARC_ICCM_SZ in menuconfig is specified in kB while
> "cpu->Xccm.sz" contains value in bytes thus direct comparison fails
> leading to boot-time panic like that:
> ----------------------->8---------------------
> IDENTITY : ARCVER [0x52] ARCNUM [0x1] CHIPID [ 0x0]
> processor [1] : ARC HS38 R2.1 (ARCv2 ISA)
> Timers : Timer0 Timer1 Local-64-bit-Ctr (not used)
> ISA Extn : atomic ll64 unalign (not used)
> : mpy[opt 9] div_rem norm barrel-shift swap minmax swape
> BPU : full match, cache:2048, Predict Table:16384
> MMU [v0] : 0k PAGE, JTLB 0 (0x0), uDTLB 0, uITLB 0
> I-Cache : N/A
> D-Cache : N/A
> Peripherals : 0xf0000000, IO-Coherency (disabled)
> Vector Table : 0x80000000
> FPU : SP DP
> DEBUG : ActionPoint smaRT RTT
> Extn [CCM] : DCCM @ e0000000, 256 KB / ICCM: @ 60000000, 256 KB
> OS ABI [v4] : 64-bit data any register aligned
> Extn [SMP] : ARConnect (v2): 2 cores with IPI IDU DEBUG GFRC
> Kernel panic - not syncing: Linux built with incorrect DCCM Size
>
> ---[ end Kernel panic - not syncing: Linux built with incorrect DCCM Size
> ----------------------->8---------------------
>
> Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
> Cc: Igor Guryanov <guryanov@synopsys.com>
> Cc: stable@vger.kernel.org
> ---
> arch/arc/kernel/setup.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c
> index ee574f37f365..601dab6fe5e0 100644
> --- a/arch/arc/kernel/setup.c
> +++ b/arch/arc/kernel/setup.c
> @@ -333,12 +333,12 @@ static void arc_chk_core_config(void)
> if ((unsigned int)__arc_dccm_base != cpu->dccm.base_addr)
> panic("Linux built with incorrect DCCM Base address\n");
>
> - if (CONFIG_ARC_DCCM_SZ != cpu->dccm.sz)
> + if (CONFIG_ARC_DCCM_SZ != TO_KB(cpu->dccm.sz))
Could we just avoid this existing TO_KB non sense in multiple places by keeping
the *ccm.sz unit consistent with CONFIG_ARC_*CCM_SZ ?
so
- cpu->iccm.sz = 4096 << iccm.sz; /* 8K to 512K */
+ cpu->iccm.sz = 4 << iccm.sz; /* 8K to 512K */
Since we only want to keep ccm size to kb granularity
And while at it, rename @sz placeholder in bcr_(i|d)ccm_arc(v2,compact) to sz_k
-Vineet
> panic("Linux built with incorrect DCCM Size\n");
> #endif
>
> #ifdef CONFIG_ARC_HAS_ICCM
> - if (CONFIG_ARC_ICCM_SZ != cpu->iccm.sz)
> + if (CONFIG_ARC_ICCM_SZ != TO_KB(cpu->iccm.sz))
> panic("Linux built with incorrect ICCM Size\n");
> #endif
>
next prev parent reply other threads:[~2016-12-23 0:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-22 14:09 [PATCH 0/2] Minor fixes for CCMs Alexey Brodkin
2016-12-22 14:09 ` [PATCH 1/2] arc: rename xCCM sections so they are not merged in global .data/.text Alexey Brodkin
2016-12-23 0:25 ` Vineet Gupta
2017-01-09 15:08 ` Alexey Brodkin
2016-12-22 14:09 ` [PATCH 2/2] arc: Fix xCCM size check Alexey Brodkin
2016-12-23 0:34 ` Vineet Gupta [this message]
2017-01-09 15:12 ` Alexey Brodkin
2016-12-23 0:26 ` [PATCH 0/2] Minor fixes for CCMs Vineet Gupta
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=75d86ac5-ed58-99d4-3c6b-97d56b90ed36@synopsys.com \
--to=vineet.gupta1@synopsys.com \
--cc=Alexey.Brodkin@synopsys.com \
--cc=Igor.Guryanov@synopsys.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-snps-arc@lists.infradead.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).