Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1836941ybb; Thu, 9 Apr 2020 09:54:39 -0700 (PDT) X-Google-Smtp-Source: APiQypLW9ieoLWwzSASjKJxWuttKjNVPLB6nq5pnk54GEmvfF69T6gSVHUEYns2C/++R1YCqQYvF X-Received: by 2002:ac8:7549:: with SMTP id b9mr282928qtr.390.1586451279564; Thu, 09 Apr 2020 09:54:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586451279; cv=none; d=google.com; s=arc-20160816; b=YCAYFaVSa2fPDGy90Hz+BvbpG3jaZ5Fr/4iE11nTElREXBTzNPXGGgQrNWBkg0AO/t CVE69ppvAX4OSndA0b1QVFp7ni8tJaIuMXn0vYXej+4ffdHUMOgaQl0Nx6SJlzFO5+LW 3+3xvebGj14Rm0KVkCGnfZKNTb1pwH5xr3E1xbq8dlyKdLGfphEdkTTJP3LSqjg2Tm+d n6Ap1LBY0AG1uNi7mFF+KSL00f31+NsJduoCe1MA4gRoPKR7vZ3cJSxNbsDq8ijNh7p7 8Ictk9ISZapA1PUixM5P31cYQ9CpFInn74uMd1NqsthY6DIC1C5YhK+X8pnu4fM9NGnu 1D/Q== 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 :in-reply-to:references:mime-version:dkim-signature; bh=MvCVAZWSVpElREbfXb1mt2g3VRvFUkKvrzFHvdRqvkg=; b=gzchT7fOzMCYSK8MNkeJKtc7bjOOnxu3waWLTczv6c3jOmzo03I0LA6uY0dqKugyDn CH0oVt8kcABIyyXI1rcpPYpVFjZprkG8r0DSzEOD1RrlDFrEscpG4bIcw80eTttLyeNI Ekg4pBG4LCIQ+uiwbGPcA30IPqaDDpxDI/4DKLJ2Kbdv87TVHSB1d/jgiGQHeRY5pioM c4heitmrTX4Jsl71N4sSAY+7EfL0/sPpfLPqEUOP1Kd27CzU1sEeHrSFfV2n10Fp82UZ PyZQb1qgqo1OBhflDH4o7SEyn6fjoKr+hWQCuCEQgbjPmsAyIWxtZ4ro/M6elIOUsK+g Fnhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=ebEd4FdY; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n128si6166147qkd.113.2020.04.09.09.54.24; Thu, 09 Apr 2020 09:54:39 -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=@ffwll.ch header.s=google header.b=ebEd4FdY; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727894AbgDIO51 (ORCPT + 99 others); Thu, 9 Apr 2020 10:57:27 -0400 Received: from mail-ot1-f66.google.com ([209.85.210.66]:32815 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727815AbgDIO5Z (ORCPT ); Thu, 9 Apr 2020 10:57:25 -0400 Received: by mail-ot1-f66.google.com with SMTP id 103so4359184otv.0 for ; Thu, 09 Apr 2020 07:57:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MvCVAZWSVpElREbfXb1mt2g3VRvFUkKvrzFHvdRqvkg=; b=ebEd4FdYNO+7wzGFzjBvQDg8mK2wrpjmDjuCBjAH9tAbCCg4zgABTbGAxKzQ49JMxn kqTYGut6ohJDRAdHangRN4hffUJ4MvJUmXVqHcdUYuhWsOAAhFmddn4uDDLAgZuSwUyx in2+ZqI2XFwOOnx/68F1aBghe4TTCvi2K8Jb4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MvCVAZWSVpElREbfXb1mt2g3VRvFUkKvrzFHvdRqvkg=; b=JPQflcYEHYliNmNUwqnDEO6GtWksqgslEQBMlwR3Svf96b8Inw0s/Wv3JkRaPvFnww ws4CAAgb8GY+N8wfFbOn74uxjYOr8cuA7juP8Hvv7cDYR6RnP+qRGRMRPtWRYaiNVS7s 9kJt7X/4xhQTfQVOh/n6xxsHr2cUI4ZK4yUDpBvtvMLfs4cyvCiG+C75CghEA9e1602Y mjX0GbqwkJcrwB0VmEKe831Zroe6om9wVtlrlrjAbirN3k2ge92YXnWpZ4KIkzoTJjgg PQotgPUVPXjcv6dxGMgDGRJ6l8v1T+JaYTzIRNtRngfVLaYt8IjeIhvJi894WKEyYcWF xlTw== X-Gm-Message-State: AGi0PuZe8ir3rq1d4sDodItYRapDzFvEB2AC6elC/Exvpz7TY36yp4uv 7P2MdXc817FAmi029Rx3BjtwC9L5Hd+2CMk79GtrDA== X-Received: by 2002:a9d:6e8f:: with SMTP id a15mr251186otr.188.1586444244321; Thu, 09 Apr 2020 07:57:24 -0700 (PDT) MIME-Version: 1.0 References: <20200408115926.1467567-1-hch@lst.de> <20200408115926.1467567-20-hch@lst.de> <20200408122504.GO3456981@phenom.ffwll.local> In-Reply-To: From: Daniel Vetter Date: Thu, 9 Apr 2020 16:57:12 +0200 Message-ID: Subject: Re: [PATCH 19/28] gpu/drm: remove the powerpc hack in drm_legacy_sg_alloc To: Alex Deucher Cc: Benjamin Herrenschmidt , linux-hyperv@vger.kernel.org, David Airlie , dri-devel , Linux MM , "K. Y. Srinivasan" , "open list:GENERIC INCLUDE/A..." , linux-s390@vger.kernel.org, Wei Liu , Stephen Hemminger , X86 ML , Christoph Hellwig , Peter Zijlstra , Laura Abbott , Nitin Gupta , Haiyang Zhang , "moderated list:DMA BUFFER SHARING FRAMEWORK" , bpf , Linux ARM , Christophe Leroy , Robin Murphy , Linux Kernel Mailing List , Minchan Kim , "list@263.net:IOMMU DRIVERS , Joerg Roedel ," , Sakari Ailus , Andrew Morton , linuxppc-dev 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 Thu, Apr 9, 2020 at 4:19 PM Alex Deucher wrote: > > On Thu, Apr 9, 2020 at 5:41 AM Daniel Vetter wrote: > > > > On Thu, Apr 9, 2020 at 10:54 AM Benjamin Herrenschmidt > > 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 > > > > > --- > > > > > 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