Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Alexandre Oliva <oliva@gnu.org>
To: 陈华才 <chenhc@lemote.com>
Cc: "wuzhangjin" <wuzhangjin@gmail.com>,
	"linux-mips" <linux-mips@linux-mips.org>,
	"stable" <stable@vger.kernel.org>
Subject: Re: MIPS: Hibernate: Flush TLB entries in swsusp_arch_resume()
Date: Sun, 01 Jun 2014 03:55:55 -0300	[thread overview]
Message-ID: <or61klqft0.fsf@free.home> (raw)
In-Reply-To: <tencent_03F1BF0862C094496B5D0360@qq.com> ("陈华才"'s message of "Sun, 1 Jun 2014 11:06:54 +0800")

Hi,

Thanks for your response,

On Jun  1, 2014, "陈华才" <chenhc@lemote.com> wrote:

> The original code flush both TLB and cache, and I think the original author (Wu Zhangjin) has tested his code. In my patch I only restore the TLB flush, but not the cache flush. Since Loongson-3A maintain cache coherency by hardware, with or without cache flush will both OK. But for Loongson-2F, I guess cache flush is also needed, but I have no Yeelong-2F to test now.

I'm afraid reintroducing the cache flush is not enough to bring the
kernel back to a working state, hibernation wise.  The last oops message
I saw, after the ones that flew by, had __arch_local_irq_restore at the
top of the backtrace, called by some function with resume in its name.

Any other suggestions?


Here's the patch I tried on top of yours, as an alternative to reverting
it, unfortunately without success:

--- arch/mips/power/hibernate.S
+++ arch/mips/power/hibernate.S
@@ -43,6 +43,9 @@
 	bne t1, t3, 1b
 	PTR_L t0, PBE_NEXT(t0)
 	bnez t0, 0b
+	/* flush caches to make sure context is in memory */
+	PTR_L t0, __flush_cache_all
+	jalr t0
 	jal local_flush_tlb_all /* Avoid TLB mismatch after kernel resume */
 	PTR_LA t0, saved_regs
 	PTR_L ra, PT_R31(t0)


-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist|Red Hat Brasil GNU Toolchain Engineer

       reply	other threads:[~2014-06-01  6:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <tencent_03F1BF0862C094496B5D0360@qq.com>
2014-06-01  6:55 ` Alexandre Oliva [this message]
2014-06-02  1:20   ` MIPS: Hibernate: Flush TLB entries in swsusp_arch_resume() Huacai Chen
2014-03-22  9:21 Huacai Chen
  -- strict thread matches above, loose matches on Subject: below --
2014-03-22  9:21 Huacai Chen
2014-03-22  9:21 Huacai Chen

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=or61klqft0.fsf@free.home \
    --to=oliva@gnu.org \
    --cc=chenhc@lemote.com \
    --cc=linux-mips@linux-mips.org \
    --cc=stable@vger.kernel.org \
    --cc=wuzhangjin@gmail.com \
    /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