linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: thor.thayer@linux.intel.com
To: bp@alien8.de, mchehab@kernel.org, tony.luck@intel.com,
	james.morse@arm.com, rrichter@marvell.com
Cc: Meng.Li@windriver.com, linux-edac@vger.kernel.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: [PATCHv2 1/3] EDAC/altera: Use fast register IO for S10 IRQs
Date: Thu, 21 Nov 2019 12:30:46 -0600	[thread overview]
Message-ID: <1574361048-17572-2-git-send-email-thor.thayer@linux.intel.com> (raw)
In-Reply-To: <1574361048-17572-1-git-send-email-thor.thayer@linux.intel.com>

From: Meng Li <Meng.Li@windriver.com>

When an irq occurs in altera edac driver, regmap_xxx() is invoked
in atomic context. Regmap must indicate register IO is fast so
that a spinlock is used instead of a mutex to avoid sleeping
in atomic context.

Fixes mutex-lock error
   lock_acquire+0xfc/0x288
   __mutex_lock+0x8c/0x808
   mutex_lock_nested+0x3c/0x50
   regmap_lock_mutex+0x24/0x30
   regmap_write+0x40/0x78
   a10_eccmgr_irq_unmask+0x34/0x40
   unmask_irq.part.0+0x30/0x50
   irq_enable+0x74/0x80
   __irq_startup+0x80/0xa8
   irq_startup+0x70/0x150
   __setup_irq+0x650/0x6d0
   request_threaded_irq+0xe4/0x180
   devm_request_threaded_irq+0x7c/0xf0
   altr_sdram_probe+0x2c4/0x600
<snip>

Upstream fix pending [1] (common code uses fast mode)
[1] https://lkml.org/lkml/2019/11/7/1014

Fixes: 3dab6bd52687 ("EDAC, altera: Add support for Stratix10 SDRAM EDAC")
Cc: stable@vger.kernel.org
Reported-by: Meng Li <Meng.Li@windriver.com>
Signed-off-by: Meng Li <Meng.Li@windriver.com>
Reviewed-by: Thor Thayer <thor.thayer@linux.intel.com>
---
v2 Change Author to Meng Li & Reviewed-by: Thor Thayer
---
 drivers/edac/altera_edac.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c
index fbda4b876afd..0be3d1b17f03 100644
--- a/drivers/edac/altera_edac.c
+++ b/drivers/edac/altera_edac.c
@@ -560,6 +560,7 @@ static const struct regmap_config s10_sdram_regmap_cfg = {
 	.reg_write = s10_protected_reg_write,
 	.use_single_read = true,
 	.use_single_write = true,
+	.fast_io = true,
 };
 
 /************** </Stratix10 EDAC Memory Controller Functions> ***********/
-- 
2.7.4


  reply	other threads:[~2019-11-21 18:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-21 18:30 [PATCHv2 0/3] Altera EDAC Fix & Cleanup Patches thor.thayer
2019-11-21 18:30 ` thor.thayer [this message]
2019-11-22  9:03   ` [PATCHv2 1/3] EDAC/altera: Use fast register IO for S10 IRQs Borislav Petkov
2019-11-21 18:30 ` [PATCHv2 2/3] EDAC/altera: Cleanup the ECC Manager thor.thayer
2019-11-21 18:30 ` [PATCHv2 3/3] EDAC/altera: Use the Altera System Manager driver thor.thayer
2019-11-22  9:24 ` [PATCHv2 0/3] Altera EDAC Fix & Cleanup Patches Borislav Petkov

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=1574361048-17572-2-git-send-email-thor.thayer@linux.intel.com \
    --to=thor.thayer@linux.intel.com \
    --cc=Meng.Li@windriver.com \
    --cc=bp@alien8.de \
    --cc=james.morse@arm.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=rrichter@marvell.com \
    --cc=stable@vger.kernel.org \
    --cc=tony.luck@intel.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;
as well as URLs for NNTP newsgroup(s).