linux-hyperv.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Alex Deucher <alexdeucher@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	linux-hyperv@vger.kernel.org, David Airlie <airlied@linux.ie>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	Linux MM <linux-mm@kvack.org>,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	"open list:GENERIC INCLUDE/A..." <linux-arch@vger.kernel.org>,
	linux-s390@vger.kernel.org, Wei Liu <wei.liu@kernel.org>,
	Stephen Hemminger <sthemmin@microsoft.com>,
	X86 ML <x86@kernel.org>, Christoph Hellwig <hch@lst.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Laura Abbott <labbott@redhat.com>,
	Nitin Gupta <ngupta@vflare.org>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	"moderated list:DMA BUFFER SHARING FRAMEWORK" 
	<linaro-mm-sig@lists.linaro.org>, bpf <bpf@vger.kernel.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	Christophe Leroy <christophe.leroy@c-s.fr>,
	Robin Murphy <robin.murphy@arm.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Minchan Kim <minchan@kernel.org>,
	"list@263.net:IOMMU DRIVERS <iommu@lists.linux-foundation.org>,
	Joerg Roedel <joro@8bytes.org>,"
	<iommu@lists.linux-foundation.org>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [PATCH 19/28] gpu/drm: remove the powerpc hack in drm_legacy_sg_alloc
Date: Thu, 9 Apr 2020 16:57:12 +0200	[thread overview]
Message-ID: <CAKMK7uESDf446FsdA2KC9sybSKxf5OdXvHZ-d4G3PAt-vvP8zg@mail.gmail.com> (raw)
In-Reply-To: <CADnq5_MjTSm6j=_8huVQ854H6jXY5Rg36wc31QDfOpfjfscWxA@mail.gmail.com>

On Thu, Apr 9, 2020 at 4:19 PM Alex Deucher <alexdeucher@gmail.com> wrote:
>
> On Thu, Apr 9, 2020 at 5:41 AM Daniel Vetter <daniel@ffwll.ch> wrote:
> >
> > On Thu, Apr 9, 2020 at 10:54 AM Benjamin Herrenschmidt
> > <benh@kernel.crashing.org> wrote:
> > >
> > > On Wed, 2020-04-08 at 14:25 +0200, Daniel Vetter wrote:
> > > > On Wed, Apr 08, 2020 at 01:59:17PM +0200, Christoph Hellwig wrote:
> > > > > If this code was broken for non-coherent caches a crude powerpc hack
> > > > > isn't going to help anyone else.  Remove the hack as it is the last
> > > > > user of __vmalloc passing a page protection flag other than PAGE_KERNEL.
> > > >
> > > > Well Ben added this to make stuff work on ppc, ofc the home grown dma
> > > > layer in drm from back then isn't going to work in other places. I guess
> > > > should have at least an ack from him, in case anyone still cares about
> > > > this on ppc. Adding Ben to cc.
> > >
> > > This was due to some drivers (radeon ?) trying to use vmalloc pages for
> > > coherent DMA, which means on those 4xx powerpc's need to be non-cached.
> > >
> > > There were machines using that (440 based iirc), though I honestly
> > > can't tell if anybody still uses any of it.
> >
> > agp subsystem still seems to happily do that (vmalloc memory for
> > device access), never having been ported to dma apis (or well
> > converted to iommu drivers, which they kinda are really). So I think
> > this all still works exactly as back then, even with the kms radeon
> > drivers. Question really is whether we have users left, and I have no
> > clue about that either.
> >
> > Now if these boxes didn't ever have agp then I think we can get away
> > with deleting this, since we've already deleted the legacy radeon
> > driver. And that one used vmalloc for everything. The new kms one does
> > use the dma-api if the gpu isn't connected through agp.
>
> All radeons have a built in remapping table to handle non-AGP systems.
> On the earlier radeons it wasn't quite as performant as AGP, but it
> was always more reliable because AGP is AGP.  Maybe it's time to let
> AGP go?

I'd be very much in favour of that, if we can just use the integrated
gart and drop agp fast writes wobbliness on the floor. I think the
only other modern driver using agp would be nouveau at that point.
-Daniel

>
> Alex
>
> > -Daniel
> >
> > > Cheers,
> > > Ben.
> > >
> > > > -Daniel
> > > >
> > > > >
> > > > > Signed-off-by: Christoph Hellwig <hch@lst.de>
> > > > > ---
> > > > >  drivers/gpu/drm/drm_scatter.c | 11 +----------
> > > > >  1 file changed, 1 insertion(+), 10 deletions(-)
> > > > >
> > > > > diff --git a/drivers/gpu/drm/drm_scatter.c b/drivers/gpu/drm/drm_scatter.c
> > > > > index ca520028b2cb..f4e6184d1877 100644
> > > > > --- a/drivers/gpu/drm/drm_scatter.c
> > > > > +++ b/drivers/gpu/drm/drm_scatter.c
> > > > > @@ -43,15 +43,6 @@
> > > > >
> > > > >  #define DEBUG_SCATTER 0
> > > > >
> > > > > -static inline void *drm_vmalloc_dma(unsigned long size)
> > > > > -{
> > > > > -#if defined(__powerpc__) && defined(CONFIG_NOT_COHERENT_CACHE)
> > > > > -   return __vmalloc(size, GFP_KERNEL, pgprot_noncached_wc(PAGE_KERNEL));
> > > > > -#else
> > > > > -   return vmalloc_32(size);
> > > > > -#endif
> > > > > -}
> > > > > -
> > > > >  static void drm_sg_cleanup(struct drm_sg_mem * entry)
> > > > >  {
> > > > >     struct page *page;
> > > > > @@ -126,7 +117,7 @@ int drm_legacy_sg_alloc(struct drm_device *dev, void *data,
> > > > >             return -ENOMEM;
> > > > >     }
> > > > >
> > > > > -   entry->virtual = drm_vmalloc_dma(pages << PAGE_SHIFT);
> > > > > +   entry->virtual = vmalloc_32(pages << PAGE_SHIFT);
> > > > >     if (!entry->virtual) {
> > > > >             kfree(entry->busaddr);
> > > > >             kfree(entry->pagelist);
> > > > > --
> > > > > 2.25.1
> > > > >
> > > >
> > > >
> > >
> >
> >
> > --
> > Daniel Vetter
> > Software Engineer, Intel Corporation
> > +41 (0) 79 365 57 48 - http://blog.ffwll.ch
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/dri-devel



-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

  reply	other threads:[~2020-04-09 14:57 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-08 11:58 decruft the vmalloc API Christoph Hellwig
2020-04-08 11:58 ` [PATCH 01/28] x86/hyperv: use vmalloc_exec for the hypercall page Christoph Hellwig
2020-04-09 15:52   ` Wei Liu
2020-04-10 20:40   ` Michael Kelley
2020-04-08 11:59 ` [PATCH 02/28] staging: android: ion: use vmap instead of vm_map_ram Christoph Hellwig
2020-04-08 13:27   ` Greg KH
2020-04-08 11:59 ` [PATCH 03/28] staging: media: ipu3: use vmap insted of reimplementing it Christoph Hellwig
2020-04-08 11:59 ` [PATCH 04/28] dma-mapping: " Christoph Hellwig
2020-04-08 11:59 ` [PATCH 05/28] powerpc: add an ioremap_phb helper Christoph Hellwig
2020-04-08 11:59 ` [PATCH 06/28] powerpc: remove __ioremap_at and __iounmap_at Christoph Hellwig
2020-04-08 11:59 ` [PATCH 07/28] mm: remove __get_vm_area Christoph Hellwig
2020-04-08 11:59 ` [PATCH 08/28] mm: unexport unmap_kernel_range_noflush Christoph Hellwig
2020-04-08 11:59 ` [PATCH 09/28] mm: rename CONFIG_PGTABLE_MAPPING to CONFIG_ZSMALLOC_PGTABLE_MAPPING Christoph Hellwig
2020-04-08 15:00   ` Randy Dunlap
2020-04-09 15:59   ` Minchan Kim
2020-04-08 11:59 ` [PATCH 10/28] mm: only allow page table mappings for built-in zsmalloc Christoph Hellwig
2020-04-08 15:01   ` Randy Dunlap
2020-04-08 15:12     ` Peter Zijlstra
2020-04-08 15:15       ` Matthew Wilcox
2020-04-08 15:36         ` Christoph Hellwig
2020-04-08 15:37           ` Randy Dunlap
2020-04-08 15:36         ` Randy Dunlap
2020-04-09 16:08   ` Minchan Kim
2020-04-09 16:50     ` Peter Zijlstra
2020-04-09 17:08       ` Minchan Kim
2020-04-10  2:38         ` Sergey Senozhatsky
2020-04-10 23:11           ` Minchan Kim
2020-04-11  7:20             ` Christoph Hellwig
2020-04-16 20:37               ` Minchan Kim
2020-04-08 11:59 ` [PATCH 11/28] mm: pass addr as unsigned long to vb_free Christoph Hellwig
2020-04-08 11:59 ` [PATCH 12/28] mm: remove vmap_page_range_noflush and vunmap_page_range Christoph Hellwig
2020-04-08 11:59 ` [PATCH 13/28] mm: rename vmap_page_range to map_kernel_range Christoph Hellwig
2020-04-08 11:59 ` [PATCH 14/28] mm: don't return the number of pages from map_kernel_range{,_noflush} Christoph Hellwig
2020-04-08 11:59 ` [PATCH 15/28] mm: remove map_vm_range Christoph Hellwig
2020-04-08 11:59 ` [PATCH 16/28] mm: remove unmap_vmap_area Christoph Hellwig
2020-04-08 11:59 ` [PATCH 17/28] mm: remove the prot argument from vm_map_ram Christoph Hellwig
2020-04-08 12:21   ` Peter Zijlstra
2020-04-08 12:23     ` Christoph Hellwig
2020-04-09  0:39   ` Gao Xiang
2020-04-08 11:59 ` [PATCH 18/28] mm: enforce that vmap can't map pages executable Christoph Hellwig
2020-04-08 12:38   ` Mark Rutland
2020-04-08 15:32     ` Christoph Hellwig
2020-04-08 11:59 ` [PATCH 19/28] gpu/drm: remove the powerpc hack in drm_legacy_sg_alloc Christoph Hellwig
2020-04-08 12:25   ` Daniel Vetter
2020-04-09  8:54     ` Benjamin Herrenschmidt
2020-04-09  9:41       ` Daniel Vetter
2020-04-09 14:19         ` Alex Deucher
2020-04-09 14:57           ` Daniel Vetter [this message]
2020-04-09 22:56         ` Benjamin Herrenschmidt
2020-04-10  8:11           ` Daniel Vetter
2020-04-09 11:46       ` Gerhard Pircher
2020-04-08 11:59 ` [PATCH 20/28] mm: remove the pgprot argument to __vmalloc Christoph Hellwig
2020-04-10 20:39   ` Michael Kelley
2020-04-08 11:59 ` [PATCH 21/28] mm: remove the prot argument to __vmalloc_node Christoph Hellwig
2020-04-08 11:59 ` [PATCH 22/28] mm: remove both instances of __vmalloc_node_flags Christoph Hellwig
2020-04-08 11:59 ` [PATCH 23/28] mm: remove __vmalloc_node_flags_caller Christoph Hellwig
2020-04-08 11:59 ` [PATCH 24/28] mm: switch the test_vmalloc module to use __vmalloc_node Christoph Hellwig
2020-04-08 11:59 ` [PATCH 25/28] mm: remove vmalloc_user_node_flags Christoph Hellwig
2020-04-09 22:25   ` Andrii Nakryiko
2020-04-13 20:03     ` Johannes Weiner
2020-04-08 11:59 ` [PATCH 26/28] arm64: use __vmalloc_node in arch_alloc_vmap_stack Christoph Hellwig
2020-04-08 12:18   ` Mark Rutland
2020-04-08 11:59 ` [PATCH 27/28] s390: use __vmalloc_node in alloc_vm_stack Christoph Hellwig
2020-04-08 13:33   ` Christian Borntraeger
2020-04-08 11:59 ` [PATCH 28/28] s390: use __vmalloc_node in stack_alloc Christoph Hellwig
2020-04-08 13:44   ` Christian Borntraeger
2020-04-08 12:25 ` decruft the vmalloc API Peter Zijlstra
     [not found] ` <20200408124833.13032-1-hdanton@sina.com>
2020-04-08 15:40   ` [PATCH 02/28] staging: android: ion: use vmap instead of vm_map_ram Christoph Hellwig
2020-04-08 16:03 ` decruft the vmalloc API Russell King - ARM Linux admin
2020-04-08 16:07   ` 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=CAKMK7uESDf446FsdA2KC9sybSKxf5OdXvHZ-d4G3PAt-vvP8zg@mail.gmail.com \
    --to=daniel@ffwll.ch \
    --cc=airlied@linux.ie \
    --cc=akpm@linux-foundation.org \
    --cc=alexdeucher@gmail.com \
    --cc=benh@kernel.crashing.org \
    --cc=bpf@vger.kernel.org \
    --cc=christophe.leroy@c-s.fr \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=haiyangz@microsoft.com \
    --cc=hch@lst.de \
    --cc=iommu@lists.linux-foundation.org \
    --cc=kys@microsoft.com \
    --cc=labbott@redhat.com \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=minchan@kernel.org \
    --cc=ngupta@vflare.org \
    --cc=peterz@infradead.org \
    --cc=robin.murphy@arm.com \
    --cc=sakari.ailus@linux.intel.com \
    --cc=sthemmin@microsoft.com \
    --cc=wei.liu@kernel.org \
    --cc=x86@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).