All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Christoph Hellwig <hch@lst.de>, ulf.hansson@linaro.org
Cc: linux-mmc@vger.kernel.org, Jiri Slaby <jslaby@suse.cz>
Subject: Re: [PATCH] sdhci: stop poking into swiotlb internals
Date: Fri, 5 Feb 2021 20:43:10 +0200	[thread overview]
Message-ID: <195d7168-3be0-91ea-1c5b-e850d5c12582@intel.com> (raw)
In-Reply-To: <20210205162346.2847165-1-hch@lst.de>

+ Jiri Slaby <jslaby@suse.cz>

On 5/02/21 6:23 pm, Christoph Hellwig wrote:
> Use the proper API to query the max mapping size instead of guessing
> it based on swiotlb internals.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  drivers/mmc/host/sdhci.c | 9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index 646823ddd31715..2d73407ee52ec7 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -20,7 +20,6 @@
>  #include <linux/slab.h>
>  #include <linux/scatterlist.h>
>  #include <linux/sizes.h>
> -#include <linux/swiotlb.h>
>  #include <linux/regulator/consumer.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/of.h>
> @@ -4582,12 +4581,8 @@ int sdhci_setup_host(struct sdhci_host *host)
>  		mmc->max_segs = SDHCI_MAX_SEGS;
>  	} else if (host->flags & SDHCI_USE_SDMA) {
>  		mmc->max_segs = 1;
> -		if (swiotlb_max_segment()) {
> -			unsigned int max_req_size = (1 << IO_TLB_SHIFT) *
> -						IO_TLB_SEGSIZE;
> -			mmc->max_req_size = min(mmc->max_req_size,
> -						max_req_size);
> -		}
> +		mmc->max_req_size = min_t(size_t, mmc->max_req_size,
> +					  dma_max_mapping_size(mmc_dev(mmc)));
>  	} else { /* PIO */
>  		mmc->max_segs = SDHCI_MAX_SEGS;
>  	}
> 


  reply	other threads:[~2021-02-05 18:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-05 16:23 [PATCH] sdhci: stop poking into swiotlb internals Christoph Hellwig
2021-02-05 18:43 ` Adrian Hunter [this message]
2021-02-17 12:10   ` Jiri Slaby
2021-02-17 13:39     ` Christoph Hellwig
2021-02-17 13:59 ` Adrian Hunter

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=195d7168-3be0-91ea-1c5b-e850d5c12582@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=hch@lst.de \
    --cc=jslaby@suse.cz \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ulf.hansson@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.