Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1346360 > unrolled thread
| Started by | Alexandre Courbot <acourbot@nvidia.com> |
|---|---|
| First post | 2016-03-01 05:50 +0100 |
| Last post | 2016-03-04 07:20 +0100 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH v2 1/2] mmc: sdhci: Set DMA mask Alexandre Courbot <acourbot@nvidia.com> - 2016-03-01 05:50 +0100
Re: [PATCH v2 1/2] mmc: sdhci: Set DMA mask Arnd Bergmann <arnd@arndb.de> - 2016-03-01 22:40 +0100
Re: [PATCH v2 1/2] mmc: sdhci: Set DMA mask Alexandre Courbot <gnurou@gmail.com> - 2016-03-04 07:20 +0100
| From | Alexandre Courbot <acourbot@nvidia.com> |
|---|---|
| Date | 2016-03-01 05:50 +0100 |
| Subject | [PATCH v2 1/2] mmc: sdhci: Set DMA mask |
| Message-ID | <r7KpX-4hl-3@gated-at.bofh.it> |
Set the DMA mask if specified by the host's dma_mask member, and
not only if the DMA flags are set.
Use dma_set_mask_and_coherent() to set it instead of messing directly
with the device's dma_mask.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
drivers/mmc/host/sdhci.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index fd9139947fa3..0693f52d238a 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2997,10 +2997,12 @@ int sdhci_add_host(struct sdhci_host *host)
* mask, but PIO does not need the hw shim so we set a new
* mask here in that case.
*/
- if (!(host->flags & (SDHCI_USE_SDMA | SDHCI_USE_ADMA))) {
+ if (!(host->flags & (SDHCI_USE_SDMA | SDHCI_USE_ADMA)))
host->dma_mask = DMA_BIT_MASK(64);
- mmc_dev(mmc)->dma_mask = &host->dma_mask;
- }
+
+ if (host->dma_mask &&
+ dma_set_mask_and_coherent(mmc_dev(mmc), host->dma_mask))
+ pr_warn("%s: cannot set DMA mask\n", mmc_hostname(mmc));
if (host->version >= SDHCI_SPEC_300)
host->max_clk = (caps[0] & SDHCI_CLOCK_V3_BASE_MASK)
--
2.7.2
[toc] | [next] | [standalone]
| From | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| Date | 2016-03-01 22:40 +0100 |
| Message-ID | <r80bq-6s3-49@gated-at.bofh.it> |
| In reply to | #1346360 |
On Tuesday 01 March 2016 13:32:43 Alexandre Courbot wrote:
> */
> - if (!(host->flags & (SDHCI_USE_SDMA | SDHCI_USE_ADMA))) {
> + if (!(host->flags & (SDHCI_USE_SDMA | SDHCI_USE_ADMA)))
> host->dma_mask = DMA_BIT_MASK(64);
> - mmc_dev(mmc)->dma_mask = &host->dma_mask;
> - }
> +
> + if (host->dma_mask &&
> + dma_set_mask_and_coherent(mmc_dev(mmc), host->dma_mask))
> + pr_warn("%s: cannot set DMA mask\n", mmc_hostname(mmc));
>
Looks good,
Acked-by: Arnd Bergmann <arnd@arndb.de>
[toc] | [prev] | [next] | [standalone]
| From | Alexandre Courbot <gnurou@gmail.com> |
|---|---|
| Date | 2016-03-04 07:20 +0100 |
| Message-ID | <r8RfH-2o1-1@gated-at.bofh.it> |
| In reply to | #1347044 |
On Wed, Mar 2, 2016 at 6:30 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Tuesday 01 March 2016 13:32:43 Alexandre Courbot wrote:
>> */
>> - if (!(host->flags & (SDHCI_USE_SDMA | SDHCI_USE_ADMA))) {
>> + if (!(host->flags & (SDHCI_USE_SDMA | SDHCI_USE_ADMA)))
>> host->dma_mask = DMA_BIT_MASK(64);
>> - mmc_dev(mmc)->dma_mask = &host->dma_mask;
>> - }
>> +
>> + if (host->dma_mask &&
>> + dma_set_mask_and_coherent(mmc_dev(mmc), host->dma_mask))
>> + pr_warn("%s: cannot set DMA mask\n", mmc_hostname(mmc));
>>
>
> Looks good,
>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
Withdrawing this patch after discussing with Arnd. The test detects
devices that are not capable of DMA, so it makes no sense to call a
DMA function right after that.
A better solution to the problem this patch tried to solve is on the way.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web