Hi Satya On Thu, Jun 18, 2020 at 8:18 AM Satya Tangirala <satyat@xxxxxxxxxx> wrote: > > Wire up ufshcd.c with the UFS Crypto API, the block layer inline > encryption additions and the keyslot manager. PORT_SYMBOL_GPL(ufshcd_dealloc_host); > @@ -8872,6 +8899,13 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq) > /* Reset the attached device */ > ufshcd_vops_device_reset(hba); > > + /* Init crypto */ > + err = ufshcd_hba_init_crypto(hba); How about checking the capabilities of host controller in ufshcd_hba_capabilities() itself and then proceed? > + if (err) { > + dev_err(hba->dev, "crypto setup failed\n"); > + goto free_tmf_queue; > + } > + > /* Host controller enable */ > err = ufshcd_hba_enable(hba); > if (err) { > diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h > index 271fc19f8002..1cb0fde5772c 100644 > --- a/drivers/scsi/ufs/ufshcd.h > +++ b/drivers/scsi/ufs/ufshcd.h > @@ -184,6 +184,8 @@ struct ufs_pm_lvl_states { > * @intr_cmd: Interrupt command (doesn't participate in interrupt aggregation) > * @issue_time_stamp: time stamp for debug purposes > * @compl_time_stamp: time stamp for statistics > + * @crypto_key_slot: the key slot to use for inline crypto (-1 if none) > + * @data_unit_num: the data unit number for the first block for inline crypto > * @req_abort_skip: skip request abort task flag > */ > struct ufshcd_lrb { > @@ -208,6 +210,10 @@ struct ufshcd_lrb { > bool intr_cmd; > ktime_t issue_time_stamp; > ktime_t compl_time_stamp; > +#ifdef CONFIG_SCSI_UFS_CRYPTO > + int crypto_key_slot; > + u64 data_unit_num; > +#endif > > bool req_abort_skip; > }; > -- > 2.27.0.290.gba653c62da-goog > -- Regards, Alim