From patchwork Wed Sep 28 21:16:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benoit Parrot X-Patchwork-Id: 9354911 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 78AB86077B for ; Wed, 28 Sep 2016 21:17:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6827E2977E for ; Wed, 28 Sep 2016 21:17:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5C7642953F; Wed, 28 Sep 2016 21:17:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BE9AB2953F for ; Wed, 28 Sep 2016 21:17:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754410AbcI1VRI (ORCPT ); Wed, 28 Sep 2016 17:17:08 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:55536 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754311AbcI1VQ4 (ORCPT ); Wed, 28 Sep 2016 17:16:56 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id u8SLGtXn014202; Wed, 28 Sep 2016 16:16:55 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id u8SLGsg7019088; Wed, 28 Sep 2016 16:16:54 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.294.0; Wed, 28 Sep 2016 16:16:54 -0500 Received: from uda0869644a.am.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id u8SLGo4K029487; Wed, 28 Sep 2016 16:16:54 -0500 From: Benoit Parrot To: Hans Verkuil CC: , , Benoit Parrot Subject: [Patch 04/35] media: ti-vpe: vpdma: Fix bus error when vpdma is writing a descriptor Date: Wed, 28 Sep 2016 16:16:12 -0500 Message-ID: <20160928211643.26298-5-bparrot@ti.com> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160928211643.26298-1-bparrot@ti.com> References: <20160928211643.26298-1-bparrot@ti.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On DRA7 since l3_noc event are being reported it was found that when the write descriptor was being written it was consistently causing bus error events. The write address was improperly programmed. Signed-off-by: Benoit Parrot --- drivers/media/platform/ti-vpe/vpdma_priv.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/ti-vpe/vpdma_priv.h b/drivers/media/platform/ti-vpe/vpdma_priv.h index 65f0c067bed1..aeade5edc8ac 100644 --- a/drivers/media/platform/ti-vpe/vpdma_priv.h +++ b/drivers/media/platform/ti-vpe/vpdma_priv.h @@ -212,6 +212,7 @@ struct vpdma_dtd { #define DTD_V_START_MASK 0xffff #define DTD_V_START_SHFT 0 +#define DTD_DESC_START_MASK 0xffffffe0 #define DTD_DESC_START_SHIFT 5 #define DTD_WRITE_DESC_MASK 0x01 #define DTD_WRITE_DESC_SHIFT 2 @@ -294,7 +295,7 @@ static inline u32 dtd_frame_width_height(int width, int height) static inline u32 dtd_desc_write_addr(unsigned int addr, bool write_desc, bool drop_data, bool use_desc) { - return (addr << DTD_DESC_START_SHIFT) | + return (addr & DTD_DESC_START_MASK) | (write_desc << DTD_WRITE_DESC_SHIFT) | (drop_data << DTD_DROP_DATA_SHIFT) | use_desc; @@ -399,7 +400,7 @@ static inline int dtd_get_frame_height(struct vpdma_dtd *dtd) static inline int dtd_get_desc_write_addr(struct vpdma_dtd *dtd) { - return dtd->desc_write_addr >> DTD_DESC_START_SHIFT; + return dtd->desc_write_addr & DTD_DESC_START_MASK; } static inline bool dtd_get_write_desc(struct vpdma_dtd *dtd)