From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0FC98C18E57 for ; Thu, 3 Dec 2020 19:24:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BF93D22211 for ; Thu, 3 Dec 2020 19:24:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728494AbgLCTYW (ORCPT ); Thu, 3 Dec 2020 14:24:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:51164 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728339AbgLCTYW (ORCPT ); Thu, 3 Dec 2020 14:24:22 -0500 Date: Thu, 3 Dec 2020 11:23:38 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1607023421; bh=dgKZ0GPXALlHJ8HX2WzQ7blAJ5ntasiHe5O/gfXbvTc=; h=From:To:Cc:Subject:References:In-Reply-To:From; b=S6FEgB8jX/1c70EB2oYEoo/CAvEBHADLY8FuQNB5oOG4rV63f6o634o9/9m8gejVC k4deXopmHpKWW2htjAJeQK87u3IKCh+1g3QgPlOnDffMwAWTgMAFgDdlbBbWfUqeTd sMpndykYU2BSng1r6adQs2xXUCdzK7fm8ztoVzPV3c0Yous7vui7YcFjk23DiFNbOu rh7k5Gt7MaBO6bPhD/2Wd2Osh5PZxCZZoQVpbLx6UzEWpivYcLxHBYt1z4a0AfVWSu hZqjSsyzYhR55bF1Nx7t0aJQUMTVHlm/vKcupwACm92gqX2/Us+hLTOyNFKCZYF7fw DNlU2KrGIc2dw== From: Eric Biggers To: Adrian Hunter Cc: linux-mmc@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-fscrypt@vger.kernel.org, Satya Tangirala , Ulf Hansson , Andy Gross , Bjorn Andersson , Asutosh Das , Rob Herring , Neeraj Soni , Barani Muthukumaran , Peng Zhou , Stanley Chu , Konrad Dybcio Subject: Re: [PATCH v2 3/9] mmc: cqhci: initialize upper 64 bits of 128-bit task descriptors Message-ID: References: <20201203020516.225701-1-ebiggers@kernel.org> <20201203020516.225701-4-ebiggers@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On Thu, Dec 03, 2020 at 08:45:15AM +0200, Adrian Hunter wrote: > On 3/12/20 4:05 am, Eric Biggers wrote: > > From: Eric Biggers > > > > Move the task descriptor initialization into cqhci_prep_task_desc(), and > > make it initialize all 128 bits of the task descriptor if the host > > controller is using 128-bit task descriptors. > > > > This is needed to prepare for CQHCI inline encryption support, which > > requires 128-bit task descriptors and uses the upper 64 bits. > > > > Note: since some host controllers already enable 128-bit task > > descriptors, it's unclear why the previous code worked when it wasn't > > initializing the upper 64 bits. One possibility is that the bits are > > being ignored because the features that use them aren't enabled yet. > > In any case, setting them to 0 won't hurt. > > Coherent allocations are zero-initialized. So the upper 64-bits stay zero. > People set 128-bit anyway because the hardware needs it. Okay, that explains it then -- I didn't realize that dma_alloc_coherent() always returns zeroed memory. It isn't mentioned in Documentation/core-api/dma-api.rst, and there's no kerneldoc comment, so it wasn't clear. But apparently it's intentional; see commit 518a2f1925c3 ("dma-mapping: zero memory returned from dma_alloc_*"). I'll fix this commit message in the next version. - Eric