From patchwork Wed Sep 15 09:00:57 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Huang, Ying" X-Patchwork-Id: 182062 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 o8F91828002894 for ; Wed, 15 Sep 2010 09:01:08 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752601Ab0IOJBE (ORCPT ); Wed, 15 Sep 2010 05:01:04 -0400 Received: from mga02.intel.com ([134.134.136.20]:39207 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752409Ab0IOJBA (ORCPT ); Wed, 15 Sep 2010 05:01:00 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 15 Sep 2010 02:00:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.56,370,1280732400"; d="scan'208";a="657485474" Received: from yhuang-dev.sh.intel.com (HELO [10.239.13.2]) ([10.239.13.2]) by orsmga001.jf.intel.com with ESMTP; 15 Sep 2010 02:00:58 -0700 Subject: [BUGFIX] ACPI, APEI, Fix ERST MOVE_DATA instruction implementation From: Huang Ying To: Len Brown Cc: Javier Martinez Canillas , Andrew Morton , "linux-acpi@vger.kernel.org" , LKML , Andi Kleen Date: Wed, 15 Sep 2010 17:00:57 +0800 Message-ID: <1284541257.2754.15.camel@yhuang-dev> Mime-Version: 1.0 X-Mailer: Evolution 2.30.2 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, 15 Sep 2010 09:01:08 +0000 (UTC) --- a/drivers/acpi/apei/erst.c +++ b/drivers/acpi/apei/erst.c @@ -266,13 +266,27 @@ 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()) + return -EBUSY; rc = __apei_exec_read_register(entry, &offset); if (rc) return rc; - memmove((void *)ctx->dst_base + offset, - (void *)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; }