mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: micky <micky_ching@realsil.com.cn>
To: wwang <wei_wang@realsil.com.cn>,
	Samuel Ortiz <sameo@linux.intel.com>,
	Francis Moreau <francis.moro@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Jingoo Han <jg1.han@samsung.com>, "'Chris Ball'" <cjb@laptop.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	"'Borislav Petkov'" <bp@alien8.de>,
	"'LKML'" <linux-kernel@vger.kernel.org>,
	Lee Jones <lee.jones@linaro.org>
Subject: Re: 3.12: kernel panic when resuming from suspend to RAM (x86_64)
Date: Tue, 10 Dec 2013 09:56:48 +0800	[thread overview]
Message-ID: <52A674E0.2080407@realsil.com.cn> (raw)
In-Reply-To: <52A670E4.5050501@realsil.com.cn>

Hi Francis:
On 12/10/2013 09:39 AM, wwang wrote:
> which is based on Thomas' patch. 

Can you help us test this patch, we disable irq while suspend here.

 From 6b2bd6d85780bfd8d4fe5289aee1b09dd655d2d4 Mon Sep 17 00:00:00 2001
From: Micky Ching <micky_ching@realsil.com.cn>
Date: Thu, 5 Dec 2013 16:44:19 +0800
Subject: [PATCH] mfd: rtsx: fix pci remove panic while resuming

On some special condition, when resume from suspend, the rtsx_pci will
being removed. And card insert/remove interrupt triggered during
removing, this will cause kernel panic, since in card detect work will
read pci register but device is no longer exist.

Signed-off-by: Micky Ching <micky_ching@realsil.com.cn>
---
  drivers/mfd/rtsx_pcr.c |   21 ++++++++++++++++-----
  1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/drivers/mfd/rtsx_pcr.c b/drivers/mfd/rtsx_pcr.c
index 11e20af..efdd9b9 100644
--- a/drivers/mfd/rtsx_pcr.c
+++ b/drivers/mfd/rtsx_pcr.c
@@ -1228,14 +1228,14 @@ static void rtsx_pci_remove(struct pci_dev *pcidev)

      pcr->remove_pci = true;

-    cancel_delayed_work(&pcr->carddet_work);
-    cancel_delayed_work(&pcr->idle_work);
+    cancel_delayed_work_sync(&pcr->carddet_work);
+    cancel_delayed_work_sync(&pcr->idle_work);

      mfd_remove_devices(&pcidev->dev);

      dma_free_coherent(&(pcr->pci->dev), RTSX_RESV_BUF_LEN,
              pcr->rtsx_resv_buf, pcr->rtsx_resv_buf_addr);
-    free_irq(pcr->irq, (void *)pcr);
+    free_irq(pcr->irq, pcr);
      if (pcr->msi_en)
          pci_disable_msi(pcr->pci);
      iounmap(pcr->remap_addr);
@@ -1268,8 +1268,13 @@ static int rtsx_pci_suspend(struct pci_dev 
*pcidev, pm_message_t state)
      handle = pci_get_drvdata(pcidev);
      pcr = handle->pcr;

-    cancel_delayed_work(&pcr->carddet_work);
-    cancel_delayed_work(&pcr->idle_work);
+    spin_lock_irq(&pcr->lock);
+    rtsx_pci_writel(pcr, RTSX_BIER, 0);
+    pcr->bier = 0;
+    spin_unlock_irq(&pcr->lock);
+    cancel_delayed_work_sync(&pcr->carddet_work);
+    cancel_delayed_work_sync(&pcr->idle_work);
+    free_irq(pcr->irq, pcr);

      mutex_lock(&pcr->pcr_mutex);

@@ -1295,6 +1300,12 @@ static int rtsx_pci_resume(struct pci_dev *pcidev)
      handle = pci_get_drvdata(pcidev);
      pcr = handle->pcr;

+    ret = rtsx_pci_acquire_irq(pcr);
+    if (ret < 0)
+        return ret;
+    synchronize_irq(pcr->irq);
+    rtsx_pci_enable_bus_int(pcr);
+
      mutex_lock(&pcr->pcr_mutex);

      pci_set_power_state(pcidev, PCI_D0);
-- 
1.7.9.5


-- 
Best Regards
Micky.


  reply	other threads:[~2013-12-10  1:55 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-17  9:42 Francis Moreau
2013-11-17 13:25 ` Borislav Petkov
2013-11-17 15:50   ` Francis Moreau
2013-11-17 16:01     ` Borislav Petkov
2013-11-17 18:02       ` Francis Moreau
2013-11-17 19:53         ` Borislav Petkov
2013-11-17 20:49           ` Francis Moreau
2013-11-17 22:06             ` Borislav Petkov
2013-11-17 22:34               ` Rafael J. Wysocki
2013-11-17 22:46                 ` Borislav Petkov
2013-11-18 12:21                   ` Francis Moreau
2013-11-18 12:20                 ` Francis Moreau
2013-11-18  0:33               ` Kevin Easton
2013-11-18  1:04                 ` Borislav Petkov
2013-11-18  2:43                   ` Kevin Easton
2013-11-18 12:19               ` Francis Moreau
2013-11-18 13:32                 ` Borislav Petkov
2013-11-19 10:01                   ` Francis Moreau
2013-11-19 10:15                     ` Borislav Petkov
2013-11-20  9:45                       ` Francis Moreau
2013-11-20 11:15                         ` Borislav Petkov
2013-11-21  8:22                           ` Francis Moreau
2013-11-21 10:12                             ` Borislav Petkov
2013-11-21 11:17                               ` Jingoo Han
2013-11-21 13:07                                 ` Francis Moreau
2013-11-22  7:43                                 ` Francis Moreau
2013-11-22  9:57                                   ` Francis Moreau
2013-11-22 12:54                                     ` Rafael J. Wysocki
2013-11-22 21:36                                       ` Francis Moreau
2013-11-22 22:08                                         ` Rafael J. Wysocki
2013-11-22 22:27                                           ` Thomas Gleixner
2013-11-24  9:39                                             ` Francis Moreau
2013-11-24 13:31                                               ` Borislav Petkov
2013-11-24 21:06                                               ` Rafael J. Wysocki
2013-11-25  7:42                                                 ` Francis Moreau
2013-11-25 10:47                                                   ` Rafael J. Wysocki
2013-11-29  8:28                                                     ` Francis Moreau
2013-11-29  9:02                                                       ` Thomas Gleixner
2013-11-30 15:07                                                         ` Francis Moreau
2013-11-30 20:17                                                           ` Rafael J. Wysocki
2013-12-01 10:11                                                             ` Francis Moreau
2013-12-01 19:26                                                             ` Francis Moreau
2013-12-02 10:49                                                           ` Thomas Gleixner
2013-12-02 11:20                                                             ` Thomas Gleixner
2013-12-03  8:14                                                               ` Francis Moreau
2013-12-09 19:33                                                                 ` Francis Moreau
2013-12-09 22:27                                                                   ` Samuel Ortiz
2013-12-09 22:17                                                                 ` Samuel Ortiz
2013-12-10  1:39                                                                   ` wwang
2013-12-10  1:56                                                                     ` micky [this message]
2013-12-10  8:29                                                                       ` Samuel Ortiz
2014-01-10  7:26                                                                         ` Francis Moreau
2014-01-10  9:16                                                                           ` micky
2014-01-10  9:52                                                                           ` Samuel Ortiz
2014-01-10 10:07                                                                             ` Francis Moreau
2013-12-10 10:50                                                                       ` Francis Moreau
2013-12-17  8:03                                                                       ` Francis Moreau
2013-12-18  4:05                                                                         ` micky
2013-12-18  8:12                                                                           ` Francis Moreau
2013-12-20  1:30                                                                             ` micky
2013-12-20  2:28                                                                               ` Jingoo Han
2013-12-10 10:49                                                                   ` Francis Moreau
2013-11-24  9:42                                           ` Francis Moreau

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=52A674E0.2080407@realsil.com.cn \
    --to=micky_ching@realsil.com.cn \
    --cc=bp@alien8.de \
    --cc=cjb@laptop.org \
    --cc=francis.moro@gmail.com \
    --cc=jg1.han@samsung.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=sameo@linux.intel.com \
    --cc=tglx@linutronix.de \
    --cc=wei_wang@realsil.com.cn \
    /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

Powered by JetHome