linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>,
	Asutosh Das <asutoshd@codeaurora.org>,
	Sahitya Tummala <stummala@codeaurora.org>,
	Sayali Lokhande <sayalil@codeaurora.org>,
	cang@codeaurora.org, Ram Prakash Gupta <rampraka@codeaurora.org>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-arm-msm <linux-arm-msm@vger.kernel.org>
Subject: Re: [PATCH V3] mmc: sdhci: Let a vendor driver supply and update ADMA descriptor size
Date: Fri, 24 Jan 2020 12:25:30 +0100	[thread overview]
Message-ID: <CAPDyKFpiMU5PdUOP-VZEXT_Rsot9LfHmWp4ZTBC5oboWXiWsDA@mail.gmail.com> (raw)
In-Reply-To: <1579531122-28341-1-git-send-email-vbadigan@codeaurora.org>

On Mon, 20 Jan 2020 at 15:39, Veerabhadrarao Badiganti
<vbadigan@codeaurora.org> 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@intel.com>
> Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
> Acked-by: Adrian Hunter <adrian.hunter@intel.com>
> --
> Thanks Adrian.
>
> Hi Ulf,
> Can you pick this patch instead of earlier one? This is more clean
> change, sorry for the multiple interations.
> Otherwise let me know, I will make these changes as seperate patch.

Alright, I have replaced the previous version with this one.

Kind regards
Uffe


> ---
>  drivers/mmc/host/sdhci.c | 16 +++++++---------
>  drivers/mmc/host/sdhci.h |  3 ++-
>  2 files changed, 9 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index 3140fe2..7a7a18e 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -3821,15 +3821,13 @@ int sdhci_setup_host(struct sdhci_host *host)
>                 dma_addr_t dma;
>                 void *buf;
>
> -               if (host->flags & SDHCI_USE_64_BIT_DMA) {
> -                       host->adma_table_sz = host->adma_table_cnt *
> -                                             SDHCI_ADMA2_64_DESC_SZ(host);
> -                       host->desc_sz = SDHCI_ADMA2_64_DESC_SZ(host);
> -               } else {
> -                       host->adma_table_sz = host->adma_table_cnt *
> -                                             SDHCI_ADMA2_32_DESC_SZ;
> -                       host->desc_sz = SDHCI_ADMA2_32_DESC_SZ;
> -               }
> +               if (!(host->flags & SDHCI_USE_64_BIT_DMA))
> +                       host->alloc_desc_sz = SDHCI_ADMA2_32_DESC_SZ;
> +               else 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 * host->desc_sz;
>
>                 host->align_buffer_sz = SDHCI_MAX_SEGS * SDHCI_ADMA2_ALIGN;
>                 /*
> diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
> index 0ed3e0e..10bda3a 100644
> --- a/drivers/mmc/host/sdhci.h
> +++ b/drivers/mmc/host/sdhci.h
> @@ -554,7 +554,8 @@ struct sdhci_host {
>         dma_addr_t adma_addr;   /* Mapped ADMA descr. table */
>         dma_addr_t align_addr;  /* Mapped bounce buffer */
>
> -       unsigned int desc_sz;   /* ADMA descriptor size */
> +       unsigned int desc_sz;   /* 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 */
> --
> Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc., is a member of Code Aurora Forum, a Linux Foundation Collaborative Project

  reply	other threads:[~2020-01-24 11:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-16 17:03 [PATCH V2 0/2] Add CQHCI support for sdhci-msm Veerabhadrarao Badiganti
2020-01-16 17:03 ` [PATCH V2 1/2] mmc: sdhci: Let a vendor driver supply and update ADMA descriptor size Veerabhadrarao Badiganti
2020-01-20  8:58   ` Adrian Hunter
2020-01-20 11:17   ` Veerabhadrarao Badiganti
2020-01-20 12:29     ` Adrian Hunter
2020-01-20 12:30     ` Ulf Hansson
2020-01-20 14:38     ` [PATCH V3] " Veerabhadrarao Badiganti
2020-01-24 11:25       ` Ulf Hansson [this message]
2020-01-16 17:03 ` [PATCH V2 2/2] mmc: sdhci-msm: Add CQHCI support for sdhci-msm Veerabhadrarao Badiganti
2020-01-20  8:58   ` Adrian Hunter
2020-01-20 12:30   ` Ulf Hansson

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=CAPDyKFpiMU5PdUOP-VZEXT_Rsot9LfHmWp4ZTBC5oboWXiWsDA@mail.gmail.com \
    --to=ulf.hansson@linaro.org \
    --cc=adrian.hunter@intel.com \
    --cc=asutoshd@codeaurora.org \
    --cc=cang@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=rampraka@codeaurora.org \
    --cc=sayalil@codeaurora.org \
    --cc=stummala@codeaurora.org \
    --cc=vbadigan@codeaurora.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).