Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp6987641imm; Tue, 28 Aug 2018 04:43:43 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYDLveevY1D/g4oNc7YSWLM4vRlgLEmT20YrvtrVoJAUMk4rdsdpUQQq7iMs6DcI96NDjuT X-Received: by 2002:a17:902:d808:: with SMTP id a8-v6mr1211563plz.68.1535456623428; Tue, 28 Aug 2018 04:43:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535456623; cv=none; d=google.com; s=arc-20160816; b=ZAAqhuljh2PqqanmX9VHbbTOSxUMICWySUHTFehVahULNpiAgzzxZDvAOaO90n/Evb NhSd4mXEIV1dWLsAz+73r7339Ugm+MK9LOwQ3pAGM/ErEdE5icpCpU1j346gLRn6jplG 2KWDfgPXwDQqlBe213uu9ihiqZP/VpDt8GolNWkBoCqNqdoOVqIazYQUqocl4J6XphRu h0xCRz5JKkZtXdN/7MUFJ5eFGVI4nhA5W10DVd7EheHEMZb1KsXm5EanDBC5zp1Ba6Jz ueG7glIVX9tAH+Sau+eVYdnJjDnY37pRIYCnzShWwnBCYUszYBNy3dXuPwu5TNGp3Ba9 2Hwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=Ry4icOhj9HfTMxd8yngWOfJ+SwYJqnbINPTgBo3ffOs=; b=OI3kqLAOdIfZVX/Y0TZVq1VWk3aR+0COdYUibfKie68sY/Uvs4+XZ+gNRa4I8Tj8dG AppyQ7PWQe/Nb+tDBsLcEEk2fbOGuq8ZyRVcbtwsWVJWQ5f04hi0E688ZcnFGTKgU5jC tAiJ0Zs/qDeXWUBKl4iErWbjZuexOmvAemX1kJcmJoejW9Fd2OB6h2i6Pg/lEPMvR8J5 WqcNF2YlhYqfGrhWKw0RWH0R6BnvfPNoGD3Itk4K4meQUvVhnPdsuku9c1VTNcpB7/FH EeIBg82hSXbGUsirjBjHjKGGSlxKwKL388DXDGmwOKqLx4d7Vn6fmWxxAIqpZfk7Dm5f zNjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W4R8WQx3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w11-v6si766186plz.333.2018.08.28.04.43.27; Tue, 28 Aug 2018 04:43:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W4R8WQx3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727800AbeH1Pcv (ORCPT + 99 others); Tue, 28 Aug 2018 11:32:51 -0400 Received: from mail-it0-f68.google.com ([209.85.214.68]:53379 "EHLO mail-it0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727124AbeH1Pcv (ORCPT ); Tue, 28 Aug 2018 11:32:51 -0400 Received: by mail-it0-f68.google.com with SMTP id p79-v6so2207205itp.3 for ; Tue, 28 Aug 2018 04:41:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Ry4icOhj9HfTMxd8yngWOfJ+SwYJqnbINPTgBo3ffOs=; b=W4R8WQx3qxkLToEy2NksXBRRZoWOjAOtrBqkKGz7MqH6vnFf3ao/x5V0q9JLhref2W KvavZdMycnmEVUMx/9f1FZuBhEhrFcyjmnFX4SFQ4exoypEszc3DNFdxVQ8rT17L6cHN Oyw+eshES9ztI/7Ml7Po0z/IgUMh5aB9RJP6k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Ry4icOhj9HfTMxd8yngWOfJ+SwYJqnbINPTgBo3ffOs=; b=NnwDMbXaBotR0B9SJeDvQr6IhDqm7fWoIc3RZ67kzUVi0zViDZdoO/IjpwkEtfIfq3 VokrROiUCUUIxWDo5qQ2EZ8DpEE5UTR0HzRv6tCRTt9G2nqLlkpno0OBeW0zbzWW2Wtt c8VXKiTR0L8SwcUYHDGuyZ2dVrLyOS2cQCUJe+RTK9AYEZT/mYPj/L4nAjZZISA/3Cpr VwIa+EfQVqbzIJLy9Tg84/bgXYFWfdrC/qBaFJeDvTest5XIh5AoQGozCtZbzUnfm5xg RH+8TIlRQlmOmXzY/5x2YfyByx56iytO4AFMskfOb39NfT1efkQ6IvFLPN9hJr0Hcfa+ 9D2w== X-Gm-Message-State: APzg51C3Bxjqarmxr3XemdvHTJDUjZIqt7sB2m7WVZDMGhAF0eU6f9i/ L+25XEgqD30qHwJqxXiV0m5Di5C07cAn/NRQGLaIjg== X-Received: by 2002:a02:70d7:: with SMTP id f206-v6mr887581jac.142.1535456495680; Tue, 28 Aug 2018 04:41:35 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:2b03:0:0:0:0:0 with HTTP; Tue, 28 Aug 2018 04:41:35 -0700 (PDT) In-Reply-To: <20180828174534.00fb5e24@xhacker.debian> References: <20180828174534.00fb5e24@xhacker.debian> From: Ulf Hansson Date: Tue, 28 Aug 2018 13:41:35 +0200 Message-ID: Subject: Re: [PATCH v6 0/3] solve SDHCI DWC MSHC 128MB DMA boundary limitation To: Jisheng Zhang Cc: Adrian Hunter , "linux-mmc@vger.kernel.org" , Linux Kernel Mailing List , Linux ARM Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28 August 2018 at 11:45, Jisheng Zhang wrote: > When using DMA, if the DMA addr spans 128MB boundary, we have to split > the DMA transfer into two so that each one doesn't exceed the boundary. > > patch1 adds adma_table_cnt to struct sdhci_host so that driver can > control the ADMA table count. > patch2 introduces adma_write_desc() hook to struct sdhci_ops so that > driver can override it. > patch3 finally solves the 128MB boundary limitation. > > since v5: > - use dma_get_required_mask() to calculate the extra adma_table_cnt > > since v4: > - add Adrian's ack to patch 1 and patch 2 > - address Adrian's comment -- if the boundary is fine, we have to > return after writing dma desc once; adma_table_cnt updating could > make use of the fact that it's already initialized by the common > sdhci code, we just need to tune. > > since v3: > - s/adma_table_num/adma_table_cnt > - add comment to adma_table_cnt > - make the exported function name without the _ > - let sdhci_adma_write_desc() accept &desc param and set the new desc > value > > since v2: > - make use of "likely" to check (!len || BOUNDARY_OK(addr, len)) > - explicitly include for SZ_128M > > since v1: > - fix BOUNDARY_OK macro if addr+len is aligned to 128MB > - use DIV_ROUND_UP to cal extra desc num > - fix !len for dwcmshc_adma_write_desc() > > > > Jisheng Zhang (3): > mmc: sdhci: add adma_table_cnt member to struct sdhci_host > mmc: sdhci: introduce adma_write_desc() hook to struct sdhci_ops > mmc: sdhci-of-dwcmshc: solve 128MB DMA boundary limitation > > drivers/mmc/host/sdhci-of-dwcmshc.c | 39 +++++++++++++++++++++ > drivers/mmc/host/sdhci.c | 54 +++++++++++++++++------------ > drivers/mmc/host/sdhci.h | 7 ++++ > 3 files changed, 78 insertions(+), 22 deletions(-) > > -- > 2.18.0 > Applied for next, thanks! Kind regards Uffe