Linux-f2fs-devel Archive on lore.kernel.org
 help / color / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: Satya Tangirala <satyat@google.com>
Cc: linux-scsi@vger.kernel.org, Kim Boojin <boojin.kim@samsung.com>,
	Kuohong Wang <kuohong.wang@mediatek.com>,
	Barani Muthukumaran <bmuthuku@qti.qualcomm.com>,
	linux-f2fs-devel@lists.sourceforge.net,
	linux-block@vger.kernel.org, linux-fscrypt@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org
Subject: Re: [f2fs-dev] [PATCH v9 06/11] scsi: ufs: UFS crypto API
Date: Wed, 25 Mar 2020 22:07:17 -0700
Message-ID: <20200326050717.GB858@sol.localdomain> (raw)
In-Reply-To: <20200326030702.223233-7-satyat@google.com>

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


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

  reply index

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-26  3:06 [f2fs-dev] [PATCH v9 00/11] Inline Encryption Support Satya Tangirala via Linux-f2fs-devel
2020-03-26  3:06 ` [f2fs-dev] [PATCH v9 01/11] block: Keyslot Manager for Inline Encryption Satya Tangirala via Linux-f2fs-devel
2020-03-26  6:22   ` Eric Biggers
2020-03-27 17:00     ` Christoph Hellwig
2020-03-26  3:06 ` [f2fs-dev] [PATCH v9 02/11] block: Inline encryption support for blk-mq Satya Tangirala via Linux-f2fs-devel
2020-03-26 20:05   ` Eric Biggers
2020-03-27 17:05     ` Christoph Hellwig
2020-03-26  3:06 ` [f2fs-dev] [PATCH v9 03/11] block: Make blk-integrity preclude hardware inline encryption Satya Tangirala via Linux-f2fs-devel
2020-03-26  3:06 ` [f2fs-dev] [PATCH v9 04/11] block: blk-crypto-fallback for Inline Encryption Satya Tangirala via Linux-f2fs-devel
2020-03-26 20:28   ` Eric Biggers
2020-03-26  3:06 ` [f2fs-dev] [PATCH v9 05/11] scsi: ufs: UFS driver v2.1 spec crypto additions Satya Tangirala via Linux-f2fs-devel
2020-03-26  3:06 ` [f2fs-dev] [PATCH v9 06/11] scsi: ufs: UFS crypto API Satya Tangirala via Linux-f2fs-devel
2020-03-26  5:07   ` Eric Biggers [this message]
2020-03-26  3:06 ` [f2fs-dev] [PATCH v9 07/11] scsi: ufs: Add inline encryption support to UFS Satya Tangirala via Linux-f2fs-devel
2020-03-26  5:09   ` Eric Biggers
2020-03-26  3:06 ` [f2fs-dev] [PATCH v9 08/11] fs: introduce SB_INLINECRYPT Satya Tangirala via Linux-f2fs-devel
2020-03-26  5:56   ` Eric Biggers
2020-03-26  3:07 ` [f2fs-dev] [PATCH v9 09/11] fscrypt: add inline encryption support Satya Tangirala via Linux-f2fs-devel
2020-03-26  5:45   ` Eric Biggers
2020-03-26  3:07 ` [f2fs-dev] [PATCH v9 10/11] f2fs: " Satya Tangirala via Linux-f2fs-devel
2020-03-26  3:07 ` [f2fs-dev] [PATCH v9 11/11] ext4: " Satya Tangirala via Linux-f2fs-devel
2020-03-26  3:32 ` [f2fs-dev] [PATCH v9 00/11] Inline Encryption Support Eric Biggers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200326050717.GB858@sol.localdomain \
    --to=ebiggers@kernel.org \
    --cc=bmuthuku@qti.qualcomm.com \
    --cc=boojin.kim@samsung.com \
    --cc=kuohong.wang@mediatek.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fscrypt@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=satyat@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-f2fs-devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-f2fs-devel/0 linux-f2fs-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-f2fs-devel linux-f2fs-devel/ https://lore.kernel.org/linux-f2fs-devel \
		linux-f2fs-devel@lists.sourceforge.net
	public-inbox-index linux-f2fs-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/net.sourceforge.lists.linux-f2fs-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git