From: Arnd Bergmann <arnd@arndb.de>
To: linuxppc-dev@lists.ozlabs.org
Cc: Brian King <brking@linux.vnet.ibm.com>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Daniel Kreling <kreling@linux.vnet.ibm.com>,
linux-scsi <linux-scsi@vger.kernel.org>,
Sreekanth Reddy <sreekanth.reddy@avagotech.com>
Subject: Re: [PATCH] mpt2sas: Fall back to 64 bit coherent mask if 64 bit DMA / 32 bit coherent mask not supported
Date: Wed, 13 May 2015 10:10:50 +0200 [thread overview]
Message-ID: <2214146.EzgWBA6g23@wuerfel> (raw)
In-Reply-To: <55528BBB.3000809@linux.vnet.ibm.com>
On Tuesday 12 May 2015 18:24:43 Brian King wrote:
>
> Commit 5fb1bf8aaa832e1e9ca3198de7bbecb8eff7db9c broke 64 bit DMA for mpt2sas on Power.
> That commit changed the sequence for setting up the DMA and coherent DMA masks so
> that during initialization the driver requests a 64 bit DMA mask and a 32 bit consistent
> DMA mask, then later requests a 64 bit consistent DMA mask. The Power architecture does
> not currently support this, which results in always falling back to a 32 bit DMA window,
> which has a negative impact on performance. Tweak this algorithm slightly so that
> if requesting a 32 bit consistent mask fails after we've successfully set a 64 bit
> DMA mask, just try to get a 64 bit consistent mask. This should preserve existing
> behavior on platforms that support mixed mask setting and restore previous functionality
> to those that do not.
>
> Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
I believe the way the API is designed, it should guarantee that after dma_set_mask()
succeeds for a device, dma_set_coherent_mask() with the same mask will also succeed.
Could you just call dma_set_mask_and_coherent() here to avoid that complex logic?
Arnd
next prev parent reply other threads:[~2015-05-13 12:04 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-12 22:07 mpt2sas DMA mask Brian King
2015-05-12 22:10 ` Benjamin Herrenschmidt
2015-05-12 23:24 ` [PATCH] mpt2sas: Fall back to 64 bit coherent mask if 64 bit DMA / 32 bit coherent mask not supported Brian King
2015-05-13 8:10 ` Arnd Bergmann [this message]
2015-05-13 13:23 ` Brian King
2015-05-13 13:31 ` Arnd Bergmann
2015-05-13 13:59 ` James Bottomley
2015-05-13 14:12 ` Brian King
2015-05-13 16:44 ` Sreekanth Reddy
2015-05-13 20:56 ` Benjamin Herrenschmidt
2015-05-13 21:37 ` Brian King
2015-05-14 7:43 ` [RFC/PATCH] powerpc/iommu: Support "hybrid" iommu/direct DMA ops for coherent_mask < dma_mask Benjamin Herrenschmidt
2015-05-14 21:34 ` Brian King
2015-05-14 21:58 ` [RFC/PATCH v2] " Benjamin Herrenschmidt
2015-05-14 22:03 ` [RFC/PATCH v3] " Benjamin Herrenschmidt
2015-05-15 22:19 ` Brian King
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=2214146.EzgWBA6g23@wuerfel \
--to=arnd@arndb.de \
--cc=benh@kernel.crashing.org \
--cc=brking@linux.vnet.ibm.com \
--cc=kreling@linux.vnet.ibm.com \
--cc=linux-scsi@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=sreekanth.reddy@avagotech.com \
/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