From patchwork Fri Oct 1 19:55:23 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Bounine, Alexandre" X-Patchwork-Id: 66510 X-Patchwork-Delegate: galak@kernel.crashing.org Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 09F00B74EC for ; Sat, 2 Oct 2010 05:58:38 +1000 (EST) Received: from mxout1.idt.com (mxout1.idt.com [157.165.5.25]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mxout1.idt.com", Issuer "idt.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 70FCEB70DF for ; Sat, 2 Oct 2010 05:58:25 +1000 (EST) Received: from mail.idt.com (localhost [127.0.0.1]) by mxout1.idt.com (8.13.1/8.13.1) with ESMTP id o91JvdZc017583; Fri, 1 Oct 2010 12:57:40 -0700 Received: from corpml1.corp.idt.com (corpml1.corp.idt.com [157.165.140.20]) by mail.idt.com (8.13.8/8.13.8) with ESMTP id o91Jvcje012092; Fri, 1 Oct 2010 12:57:38 -0700 (PDT) Received: from corpvpnfw (localhost [127.0.0.1]) by corpml1.corp.idt.com (8.11.7p1+Sun/8.11.7) with SMTP id o91Jvav23917; Fri, 1 Oct 2010 12:57:36 -0700 (PDT) Received: from atanerk.tundra.com ([10.1.0.17]) by corpvpnfw; Fri, 01 Oct 2010 19:57:31 +0000 (GMT) Received: from tomkin.tundra.com (tomkin [10.1.0.2]) by atanerk.tundra.com (8.13.6/8.13.6) with ESMTP id o91JvTOY000096; Fri, 1 Oct 2010 15:57:30 -0400 (EDT) Received: from tomkin.tundra.com (localhost.localdomain [127.0.0.1]) by tomkin.tundra.com (8.13.1/8.13.1) with ESMTP id o91JvOoc029382; Fri, 1 Oct 2010 15:57:24 -0400 Received: (from abounine@localhost) by tomkin.tundra.com (8.13.1/8.13.1/Submit) id o91JtxIX029350; Fri, 1 Oct 2010 15:55:59 -0400 From: Alexandre Bounine To: akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: [PATCH -mm] RapidIO: fix IDLE2 bits corruption Date: Fri, 1 Oct 2010 15:55:23 -0400 Message-Id: <1285962923-29294-1-git-send-email-alexandre.bounine@idt.com> X-Mailer: git-send-email 1.7.3.1 X-Scanned-By: MIMEDefang 2.43 Cc: Alexandre Bounine , Thomas Moll X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org RapidIO spec v.2.1 adds Idle Sequence 2 into LP-Serial Physical Layer. The fix ensures that corresponding bits are not corrupted during error handling. Signed-off-by: Alexandre Bounine Cc: Thomas Moll Cc: Matt Porter Cc: Li Yang Cc: Kumar Gala Cc: Micha Nelissen --- drivers/rapidio/rio.c | 9 ++------- include/linux/rio_regs.h | 3 +-- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/rapidio/rio.c b/drivers/rapidio/rio.c index 7f18a65..68cf0c9 100644 --- a/drivers/rapidio/rio.c +++ b/drivers/rapidio/rio.c @@ -871,15 +871,10 @@ int rio_inb_pwrite_handler(union rio_pw_msg *pw_msg) rdev->em_efptr + RIO_EM_LTL_ERR_DETECT, 0); } - /* Clear remaining error bits */ + /* Clear remaining error bits and Port-Write Pending bit */ rio_mport_write_config_32(mport, destid, hopcount, rdev->phys_efptr + RIO_PORT_N_ERR_STS_CSR(portnum), - err_status & RIO_PORT_N_ERR_STS_CLR_MASK); - - /* Clear Port-Write Pending bit */ - rio_mport_write_config_32(mport, destid, hopcount, - rdev->phys_efptr + RIO_PORT_N_ERR_STS_CSR(portnum), - RIO_PORT_N_ERR_STS_PW_PEND); + err_status); return 0; } diff --git a/include/linux/rio_regs.h b/include/linux/rio_regs.h index a18b2e2..d63dcba 100644 --- a/include/linux/rio_regs.h +++ b/include/linux/rio_regs.h @@ -229,7 +229,7 @@ #define RIO_MNT_REQ_CMD_IS 0x04 /* Input-status command */ #define RIO_PORT_N_MNT_RSP_CSR(x) (0x0044 + x*0x20) /* 0x0002 */ #define RIO_PORT_N_MNT_RSP_RVAL 0x80000000 /* Response Valid */ -#define RIO_PORT_N_MNT_RSP_ASTAT 0x000003e0 /* ackID Status */ +#define RIO_PORT_N_MNT_RSP_ASTAT 0x000007e0 /* ackID Status */ #define RIO_PORT_N_MNT_RSP_LSTAT 0x0000001f /* Link Status */ #define RIO_PORT_N_ACK_STS_CSR(x) (0x0048 + x*0x20) /* 0x0002 */ #define RIO_PORT_N_ACK_CLEAR 0x80000000 @@ -243,7 +243,6 @@ #define RIO_PORT_N_ERR_STS_PORT_ERR 0x00000004 #define RIO_PORT_N_ERR_STS_PORT_OK 0x00000002 #define RIO_PORT_N_ERR_STS_PORT_UNINIT 0x00000001 -#define RIO_PORT_N_ERR_STS_CLR_MASK 0x07120204 #define RIO_PORT_N_CTL_CSR(x) (0x005c + x*0x20) #define RIO_PORT_N_CTL_PWIDTH 0xc0000000 #define RIO_PORT_N_CTL_PWIDTH_1 0x00000000