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=-4.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,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 13FB8C2D0ED for ; Thu, 26 Mar 2020 05:07:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D79BA2083E for ; Thu, 26 Mar 2020 05:07:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585199241; bh=L93EhN0UlFtJqX/gYR0aa3wk+7m7DwlPwFZinjcu45g=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=jvlj5kwu4+3d92Hk49App8XqMeIS9Kn+YDh/ybiWpfra6DfWdTDk5xfAd5EoebuBV hQq9T2zYsd8P+lRZMU+uAQ4/AihIDIObeJ01YtS6ILJrgD0qSdEgeMiO+e0UIjFE2O Xiy2X/WPPMCVX+xTOXn4sVDAvY40ZsxuBSn5KT4E= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726138AbgCZFHU (ORCPT ); Thu, 26 Mar 2020 01:07:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:51218 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725775AbgCZFHU (ORCPT ); Thu, 26 Mar 2020 01:07:20 -0400 Received: from sol.localdomain (c-107-3-166-239.hsd1.ca.comcast.net [107.3.166.239]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 326E62070A; Thu, 26 Mar 2020 05:07:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585199239; bh=L93EhN0UlFtJqX/gYR0aa3wk+7m7DwlPwFZinjcu45g=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=P/05KEELLY9eRnCZ52KBkPmIRjwf+w3dHjNT7/NUOuZFrdqZf0gHvuUN/cHWOysBs gG3gj6U+cMZEqWlgzpNJBKMArfqL0F2qBFDorlUP2jUGpN1iU8Rx1kySNW1RJLAXC5 AOubGRlzbwKQfv+KB+KhM9+L5/+vsIcyFOOXoxOM= Date: Wed, 25 Mar 2020 22:07:17 -0700 From: Eric Biggers To: Satya Tangirala Cc: linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, linux-fscrypt@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, Barani Muthukumaran , Kuohong Wang , Kim Boojin Subject: Re: [PATCH v9 06/11] scsi: ufs: UFS crypto API Message-ID: <20200326050717.GB858@sol.localdomain> References: <20200326030702.223233-1-satyat@google.com> <20200326030702.223233-7-satyat@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200326030702.223233-7-satyat@google.com> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed, Mar 25, 2020 at 08:06:57PM -0700, Satya Tangirala wrote: > Introduce functions to manipulate UFS inline encryption hardware > in line with the JEDEC UFSHCI v2.1 specification and to work with the > block keyslot manager. > > The UFS crypto API will assume by default that a vendor driver doesn't > support UFS crypto, even if the hardware advertises the capability, because > a lot of hardware requires some special handling that's not specified in > the aforementioned JEDEC spec. Each vendor driver must explicity set > hba->caps |= UFSHCD_CAP_CRYPTO before ufshcd_hba_init_crypto is called to > opt-in to UFS crypto support. > Thanks, this looks much better now! A couple minor nits I noticed while reading this latest version: > +void ufshcd_crypto_setup_rq_keyslot_manager(struct ufs_hba *hba, > + struct request_queue *q) > +{ > + if ((hba->caps & UFSHCD_CAP_CRYPTO)) > + blk_ksm_register(&hba->ksm, q); > +} There's an extra pair of parentheses in the 'if'. > diff --git a/drivers/scsi/ufs/ufshcd-crypto.h b/drivers/scsi/ufs/ufshcd-crypto.h > new file mode 100644 > index 0000000000000..1e98f1fc99965 > --- /dev/null > +++ b/drivers/scsi/ufs/ufshcd-crypto.h > @@ -0,0 +1,44 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +/* > + * Copyright 2019 Google LLC > + */ > + > +#ifndef _UFSHCD_CRYPTO_H > +#define _UFSHCD_CRYPTO_H > + > +#ifdef CONFIG_SCSI_UFS_CRYPTO > +#include "ufshcd.h" > +#include "ufshci.h" > + > +bool ufshcd_crypto_enable(struct ufs_hba *hba); > + > +void ufshcd_crypto_disable(struct ufs_hba *hba); ufshcd_crypto_disable() has been removed, so its declaration should be removed too. - Eric