From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754146AbbCECwx (ORCPT ); Wed, 4 Mar 2015 21:52:53 -0500 Received: from mail1.windriver.com ([147.11.146.13]:35436 "EHLO mail1.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753924AbbCECwv (ORCPT ); Wed, 4 Mar 2015 21:52:51 -0500 Message-ID: <54F7C4F5.1040204@windriver.com> Date: Thu, 5 Mar 2015 10:52:37 +0800 From: yjin User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Kim Phillips CC: , , , , , , , , Subject: Re: [PATCH 2/3] crypto: caam_rng: fix rng_unmap_ctx's DMA_UNMAP size problem 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> <20150304123623.324ab9594f04dd95c587b628@freescale.com> In-Reply-To: <20150304123623.324ab9594f04dd95c587b628@freescale.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2015年03月05日 02:36, Kim Phillips wrote: > 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. Hi Kim, Do you mean that the code itself limits the descriptor length? Not a hardware limitation. If so, I prefer to dma_unmap with desc_bytes(ctx->sh_desc) as my previous patch, and correct DESC_RNG_LEN to (4 * CAAM_CMD_SZ). Thanks! Yanjiang > > Kim