lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aaffb145-69ab-af11-7470-e887b45583a9@intel.com>
Date:   Mon, 20 Jan 2020 10:58:11 +0200
From:   Adrian Hunter <adrian.hunter@...el.com>
To:     Veerabhadrarao Badiganti <vbadigan@...eaurora.org>,
        ulf.hansson@...aro.org
Cc:     asutoshd@...eaurora.org, stummala@...eaurora.org,
        sayalil@...eaurora.org, cang@...eaurora.org,
        rampraka@...eaurora.org, linux-mmc@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-arm-msm@...r.kernel.org
Subject: Re: [PATCH V2 1/2] mmc: sdhci: Let a vendor driver supply and update
 ADMA descriptor size

On 16/01/20 7:03 pm, Veerabhadrarao Badiganti wrote:
> Let a vendor driver supply the maximum descriptor size that it
> can operate on. ADMA descriptor table would be allocated using this
> supplied size.
> If any SD Host controller is of version prior to v4.10 spec
> but supports 16byte descriptor, this change allows them to supply
> correct descriptor size for ADMA table allocation.
> 
> Also let a vendor driver update the descriptor size by overriding
> sdhc_host->desc_size if it has to operates on a different descriptor
> sizes in different conditions.
> 
> Suggested-by: Adrian Hunter <adrian.hunter@...el.com>
> Signed-off-by: Veerabhadrarao Badiganti <vbadigan@...eaurora.org>

A couple of minor comments below but with those changes:

Acked-by: Adrian Hunter <adrian.hunter@...el.com>

> ---
>  drivers/mmc/host/sdhci.c | 7 +++++--
>  drivers/mmc/host/sdhci.h | 1 +
>  2 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index 3140fe2..19a5ad3 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -3822,9 +3822,12 @@ int sdhci_setup_host(struct sdhci_host *host)
>  		void *buf;
>  
>  		if (host->flags & SDHCI_USE_64_BIT_DMA) {
> +			if (!host->alloc_desc_sz)
> +				host->alloc_desc_sz =
> +					SDHCI_ADMA2_64_DESC_SZ(host);
> +			host->desc_sz = host->alloc_desc_sz;
>  			host->adma_table_sz = host->adma_table_cnt *
> -					      SDHCI_ADMA2_64_DESC_SZ(host);
> -			host->desc_sz = SDHCI_ADMA2_64_DESC_SZ(host);
> +					      host->desc_sz;
>  		} else {
>  			host->adma_table_sz = host->adma_table_cnt *
>  					      SDHCI_ADMA2_32_DESC_SZ;

Please also initialize host->alloc_desc_sz for the 32-bit case here.

> diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
> index 0ed3e0e..8e7c77d 100644
> --- a/drivers/mmc/host/sdhci.h
> +++ b/drivers/mmc/host/sdhci.h
> @@ -555,6 +555,7 @@ struct sdhci_host {
>  	dma_addr_t align_addr;	/* Mapped bounce buffer */
>  
>  	unsigned int desc_sz;	/* ADMA descriptor size */

Please  amend the comment above to:
				/* ADMA current descriptor size */

> +	unsigned int alloc_desc_sz;	/* ADMA descr. max size host supports */
>  
>  	struct workqueue_struct *complete_wq;	/* Request completion wq */
>  	struct work_struct	complete_work;	/* Request completion work */
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ