Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1467583ybb; Thu, 9 Apr 2020 02:44:22 -0700 (PDT) X-Google-Smtp-Source: APiQypIP47hgahkay+i1NjpxROiZi5pxByCb1F0tLoq7fbXk1IHZlb+VWeJLqA6foMcUOjcYsaoT X-Received: by 2002:a05:6830:1382:: with SMTP id d2mr8533391otq.214.1586425462440; Thu, 09 Apr 2020 02:44:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586425462; cv=none; d=google.com; s=arc-20160816; b=PcPWSk4gqLYY2Yw6zbT9assQbpQNotn5D4nNUcoMu+mH0WwcwR01raxuNUclGA06kZ J4eO6V/G68njQhgkYfiUkW4jrChWHKboXQ+J3C/Atdn7wtEW6dJrb5HfOnoVwYjqy5k6 by+MuzzOts7doEb9jPc6Z2e5qqQj+PKVDWEKg4R51gPXr05mnKu19MrAXPWnHsanHxjf TP4vxRFd+Z7EU6nzohQm1FWYQnpOEAOU8lm7UPl5u13wKuLKn859K+gdKVfNUKpRXaug 1OPaW73PReRDiJxJBsj7ldUCu0VBGWSaLQhY+rO8Q2mcpKOOxjbdVDgS+5hiyN7EFI6V CuVQ== 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=AAmPcakirZ+49aStGKItq0c+j+VEsXqfcBH/BMyGspk=; b=Rjavz8Iwu/IzbKC/jayJiiW9dVSULctBMVE2Z/U9ZqWY2lGS5gnpYlUwkWjmQ+sKkE CjFxtAQfNVkVUM84cRbUu+cHPWwszlGgmWDSdIDTyuLOAyVvktSTdpWHQ1Csj8Cm7Qxh m8nK8bExR3K+G2A9S3KmNBfukzimB1Z0ZGFrRPFS7l8VqpjJ9l1AeImOB0HXsUdwnUp8 D2aGhr4CDQOqD/nfxAzjFRRiqD0TlXR7cHJG89TCEC91nArKfCacikY645Uq1dSKFiAT m9ijRsGlsyJ82GGtSR7Ml8TYX/QtExS0s/Kk49BaA5qg86uVkO09p4YSmOVK14h7ec7t 4tqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=WXfJC2xv; 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 m2si3787261otk.41.2020.04.09.02.44.08; Thu, 09 Apr 2020 02:44:22 -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=WXfJC2xv; 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 S1726729AbgDIJld (ORCPT + 99 others); Thu, 9 Apr 2020 05:41:33 -0400 Received: from mail-ot1-f65.google.com ([209.85.210.65]:42013 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726623AbgDIJld (ORCPT ); Thu, 9 Apr 2020 05:41:33 -0400 Received: by mail-ot1-f65.google.com with SMTP id t92so923669otb.9 for ; Thu, 09 Apr 2020 02:41:32 -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=AAmPcakirZ+49aStGKItq0c+j+VEsXqfcBH/BMyGspk=; b=WXfJC2xvujS1NMEJmo8auNqU+zz3KoHNnFI/ZwIoQGqsenIlj1/rLp7i8g0wrHhNMA tB4UaPYqL8fo1FBLJD1QspR85zqLl/OHQQ2XW2wZhxbVmnvXaj4OEg2HGRtpK4xkfIA5 QryyOXVdb1eBXsQfmBlDoe7W6QRuDag4YOw+c= 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=AAmPcakirZ+49aStGKItq0c+j+VEsXqfcBH/BMyGspk=; b=kowpc6XCYZvbzW+5awK96cfMJLZVrhdirwB6Vm2ybc1RZMf7vuAv/lWqMopIYrI2dt nf1unBjaPAKv/AsIP3n+ZnwqFkwxLYNYaV/Ytz8TiukK8PdSVKpYMTX4GklSHDXmFWzt awKBjY6ri2clmUkQsNtQsxonzbMMujkod+B9PIuGD0j1RckNbuKWM5U6j81w9JeQ4fFV D/DPz6psK5FvH99UuNDrqkICZ7UjzMdbAirci3vKKC5qOotusK0xionuqBPuSj1hmEse oUebLRNpxhZl4050v0W8uq+uByxkL2CQ6j46JYBDAKjfHvHlHLkbItPc8jxtT3VofV1G hXgQ== X-Gm-Message-State: AGi0Pub6B3aK4yZOTJ2PE9whf0TQBQbhQyI/8o/EOtQEVEY9eUG5Bp5e hD9CRDAYHq6zBUsICE8DA88DHYNiSaUiyoZKd9u7kA== X-Received: by 2002:a4a:4190:: with SMTP id x138mr9186341ooa.35.1586425291875; Thu, 09 Apr 2020 02:41:31 -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 11:41:20 +0200 Message-ID: Subject: Re: [PATCH 19/28] gpu/drm: remove the powerpc hack in drm_legacy_sg_alloc To: Benjamin Herrenschmidt Cc: Christoph Hellwig , Andrew Morton , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , X86 ML , David Airlie , Laura Abbott , Sumit Semwal , Sakari Ailus , Minchan Kim , Nitin Gupta , Robin Murphy , Christophe Leroy , Peter Zijlstra , linuxppc-dev , linux-hyperv@vger.kernel.org, dri-devel , "moderated list:DMA BUFFER SHARING FRAMEWORK" , "open list:GENERIC INCLUDE/A..." , Linux MM , "list@263.net:IOMMU DRIVERS , Joerg Roedel ," , Linux ARM , linux-s390@vger.kernel.org, bpf , Linux Kernel Mailing List 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 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. -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