On Thu, Jun 13, 2019 at 07:20:15PM +0900, Yoshihiro Shimoda wrote:
> +static unsigned int mmc_get_max_segments(struct mmc_host *host)
> +{
> +     return host->can_merge ? BLK_MAX_SEGMENTS : host->max_segs;
> +}

Note that BLK_MAX_SEGMENTS is really a little misnamed, it just
is a BLK_DEFAULT_SEGMENTS.  I think you are better of picking your
own value here (even if 128 ends up ok) than reusing this somewhat
confusing constant.

> +     /*
> +      * Since blk_mq_alloc_tag_set() calls .init_request() of mmc_mq_ops,
> +      * the host->can_merge should be set before to get max_segs from
> +      * mmc_get_max_segments().
> +      */
> +     if (host->max_segs < BLK_MAX_SEGMENTS &&
> +         device_iommu_mapped(mmc_dev(host)))
> +             host->can_merge = 1;
> +     else
> +             host->can_merge = 0;
> +

can_merge seems a little too generic a name to me.  Maybe can_iommu_merge?

Reply via email to