From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932619AbbCDSlq (ORCPT ); Wed, 4 Mar 2015 13:41:46 -0500 Received: from mail-bn1bon0148.outbound.protection.outlook.com ([157.56.111.148]:43664 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1758330AbbCDSln (ORCPT ); Wed, 4 Mar 2015 13:41:43 -0500 Date: Wed, 4 Mar 2015 12:36:23 -0600 From: Kim Phillips To: yjin CC: , , , , , , , , Subject: Re: [PATCH 2/3] crypto: caam_rng: fix rng_unmap_ctx's DMA_UNMAP size problem Message-ID: <20150304123623.324ab9594f04dd95c587b628@freescale.com> In-Reply-To: <54F69922.6080404@windriver.com> References: <1425365453-19358-1-git-send-email-yanjiang.jin@windriver.com> <1425365453-19358-3-git-send-email-yanjiang.jin@windriver.com> <20150303133120.6706da49d0f7188a8213fe36@freescale.com> <54F69922.6080404@windriver.com> Organization: Freescale Semiconductor, Inc. X-Mailer: Sylpheed 3.2.0 (GTK+ 2.24.13; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=kim.phillips@freescale.com; gmail.com; dkim=none (message not signed) header.d=none; X-Forefront-Antispam-Report: CIP:192.88.158.2;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(339900001)(199003)(51704005)(189002)(24454002)(106466001)(105606002)(76176999)(50226001)(104016003)(2950100001)(92566002)(36756003)(62966003)(77096005)(77156002)(110136001)(47776003)(46102003)(50986999)(87936001)(86362001)(19580405001)(19580395003)(5820100001)(100306002)(6806004)(93886004)(33646002)(50466002)(85426001)(23676002);DIR:OUT;SFP:1102;SCL:1;SRVR:DM2PR03MB400;H:az84smr01.freescale.net;FPR:;SPF:Fail;MLV:sfv;A:1;MX:1;LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR03MB400; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006);SRVR:DM2PR03MB400;BCL:0;PCL:0;RULEID:;SRVR:DM2PR03MB400; X-Forefront-PRVS: 0505147DDB X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Mar 2015 18:41:39.5137 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d;Ip=[192.88.158.2] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR03MB400 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 4 Mar 2015 13:33:22 +0800 yjin wrote: > On 2015年03月04日 03:31, Kim Phillips wrote: > > On Tue, 3 Mar 2015 14:50:52 +0800 > > wrote: > > > >> - dma_unmap_single(jrdev, ctx->sh_desc_dma, DESC_RNG_LEN, > >> - DMA_TO_DEVICE); > >> + dma_unmap_single(jrdev, ctx->sh_desc_dma, > >> + desc_bytes(ctx->sh_desc), DMA_TO_DEVICE); > > alignment: the 'd' in desc_bytes should fall directly under the 'j' > > in jrdev. > > > > Also, DESC_RNG_LEN should be corrected to (4 * CAAM_CMD_SZ). > > Hi Kim, > > I can't find the obvious limitation for the RNG descriptor length in > Freescale documents, could you point out it? ? rng_create_sh_desc() creates a fixed descriptor of exactly 4 command-lengths. Kim