From patchwork Wed Sep 29 11:53:55 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Huang, Ying" X-Patchwork-Id: 216922 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8TBtUgV014065 for ; Wed, 29 Sep 2010 11:55:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753860Ab0I2LyM (ORCPT ); Wed, 29 Sep 2010 07:54:12 -0400 Received: from mga02.intel.com ([134.134.136.20]:51593 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753789Ab0I2LyI (ORCPT ); Wed, 29 Sep 2010 07:54:08 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 29 Sep 2010 04:54:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.57,252,1283756400"; d="scan'208";a="559002021" Received: from yhuang-dev.sh.intel.com ([10.239.13.2]) by orsmga002.jf.intel.com with ESMTP; 29 Sep 2010 04:54:07 -0700 From: Huang Ying To: Len Brown Cc: linux-kernel@vger.kernel.org, Andi Kleen , linux-acpi@vger.kernel.org, Huang Ying Subject: [PATCH -v2 5/5] ACPI, APEI, Fix ERST MOVE_DATA instruction implementation Date: Wed, 29 Sep 2010 19:53:55 +0800 Message-Id: <1285761235-4751-6-git-send-email-ying.huang@intel.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1285761235-4751-1-git-send-email-ying.huang@intel.com> References: <1285761235-4751-1-git-send-email-ying.huang@intel.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 29 Sep 2010 11:55:30 +0000 (UTC) --- a/drivers/acpi/apei/erst.c +++ b/drivers/acpi/apei/erst.c @@ -266,13 +266,30 @@ static int erst_exec_move_data(struct ap { int rc; u64 offset; + void *src, *dst; + + /* ioremap does not work in interrupt context */ + if (in_interrupt()) { + pr_warning(ERST_PFX + "MOVE_DATA can not be used in interrupt context"); + return -EBUSY; + } rc = __apei_exec_read_register(entry, &offset); if (rc) return rc; - memmove((void *)(unsigned long)ctx->dst_base + offset, - (void *)(unsigned long)ctx->src_base + offset, - ctx->var2); + + src = ioremap(ctx->src_base + offset, ctx->var2); + if (!src) + return -ENOMEM; + dst = ioremap(ctx->dst_base + offset, ctx->var2); + if (!dst) + return -ENOMEM; + + memmove(dst, src, ctx->var2); + + iounmap(src); + iounmap(dst); return 0; }