All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: "Lendacky, Thomas" <Thomas.Lendacky@amd.com>
Cc: Alexander Duyck <alexander.duyck@gmail.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Christoph Hellwig <hch@lst.de>,
	"alexander.h.duyck@linux.intel.com"
	<alexander.h.duyck@linux.intel.com>,
	"open list:INTEL IOMMU (VT-d)" <iommu@lists.linux-foundation.org>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	"open list:LINUX FOR POWERPC (32-BIT AND 64-BIT)"
	<linuxppc-dev@lists.ozlabs.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Guenter Roeck <linux@roeck-us.net>,
	Greg KH <gregkh@linuxfoundation.org>
Subject: Re: [PATCH] dma-direct: Fix return value of dma_direct_supported
Date: Thu, 13 Dec 2018 20:58:31 +0100	[thread overview]
Message-ID: <20181213195831.GA15478@lst.de> (raw)
In-Reply-To: <ebe0d4aa-5f37-cc40-4a80-cfe499d5b8e4@amd.com>

On Thu, Dec 13, 2018 at 07:45:57PM +0000, Lendacky, Thomas wrote:
> So I think this needs to be __phys_to_dma() here. I only recently got a
> system that had a device where the driver only supported 32-bit DMA and
> found that when SME is active this returns 0 and causes the driver to fail
> to initialize. This is because the SME encryption bit (bit 47) is part of
> the check when using phys_to_dma(). During actual DMA when SME is active,
> bounce buffers will be used for anything that can't meet the 48-bit
> requirement. But for this test, using __phys_to_dma() should give the
> desired results, right?
> 
> If you agree with this, I'll submit a patch to make the change. I missed
> this in 4.19, so I'll need to submit something to stable, too. The only
> issue there is the 4.20 fix won't apply cleanly to 4.19.

Yes, please send a patch.  Please make sure it includes a code comment
that explains why the __-prefixed version is used.

WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@lst.de>
To: "Lendacky, Thomas" <Thomas.Lendacky@amd.com>
Cc: "open list:LINUX FOR POWERPC \(32-BIT AND 64-BIT\)"
	<linuxppc-dev@lists.ozlabs.org>,
	Alexander Duyck <alexander.duyck@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>,
	"open list:INTEL IOMMU \(VT-d\)"
	<iommu@lists.linux-foundation.org>,
	Greg KH <gregkh@linuxfoundation.org>,
	"alexander.h.duyck@linux.intel.com"
	<alexander.h.duyck@linux.intel.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Christoph Hellwig <hch@lst.de>,
	Guenter Roeck <linux@roeck-us.net>
Subject: Re: [PATCH] dma-direct: Fix return value of dma_direct_supported
Date: Thu, 13 Dec 2018 20:58:31 +0100	[thread overview]
Message-ID: <20181213195831.GA15478@lst.de> (raw)
In-Reply-To: <ebe0d4aa-5f37-cc40-4a80-cfe499d5b8e4@amd.com>

On Thu, Dec 13, 2018 at 07:45:57PM +0000, Lendacky, Thomas wrote:
> So I think this needs to be __phys_to_dma() here. I only recently got a
> system that had a device where the driver only supported 32-bit DMA and
> found that when SME is active this returns 0 and causes the driver to fail
> to initialize. This is because the SME encryption bit (bit 47) is part of
> the check when using phys_to_dma(). During actual DMA when SME is active,
> bounce buffers will be used for anything that can't meet the 48-bit
> requirement. But for this test, using __phys_to_dma() should give the
> desired results, right?
> 
> If you agree with this, I'll submit a patch to make the change. I missed
> this in 4.19, so I'll need to submit something to stable, too. The only
> issue there is the 4.20 fix won't apply cleanly to 4.19.

Yes, please send a patch.  Please make sure it includes a code comment
that explains why the __-prefixed version is used.

  reply	other threads:[~2018-12-13 19:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-03 23:48 [PATCH] dma-direct: Fix return value of dma_direct_supported Alexander Duyck
2018-10-03 23:48 ` Alexander Duyck
     [not found] ` <20181003234746.3586.42014.stgit-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2018-10-04 11:25   ` Robin Murphy
2018-10-04 11:25     ` Robin Murphy
2018-10-04 11:25     ` Robin Murphy
2018-10-04 15:13     ` Alexander Duyck
2018-10-04 15:13       ` Alexander Duyck
2018-10-05  7:17       ` Christoph Hellwig
2018-10-05  7:17         ` Christoph Hellwig
2018-12-13 19:45       ` Lendacky, Thomas
2018-12-13 19:45         ` Lendacky, Thomas
2018-12-13 19:58         ` Christoph Hellwig [this message]
2018-12-13 19:58           ` Christoph Hellwig

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=20181213195831.GA15478@lst.de \
    --to=hch@lst.de \
    --cc=Thomas.Lendacky@amd.com \
    --cc=alexander.duyck@gmail.com \
    --cc=alexander.h.duyck@linux.intel.com \
    --cc=benh@kernel.crashing.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=robin.murphy@arm.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 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.