From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,TVD_SUBJ_WIPE_DEBT,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2BEB1C3815B for ; Thu, 9 Apr 2020 09:49:18 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 50DD6221ED for ; Thu, 9 Apr 2020 09:41:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="WXfJC2xv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 50DD6221ED Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E54438E000E; Thu, 9 Apr 2020 05:41:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DDE2D8E0006; Thu, 9 Apr 2020 05:41:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CCCD08E000E; Thu, 9 Apr 2020 05:41:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0078.hostedemail.com [216.40.44.78]) by kanga.kvack.org (Postfix) with ESMTP id C360E8E0006 for ; Thu, 9 Apr 2020 05:41:33 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id A15AFF048 for ; Thu, 9 Apr 2020 09:41:33 +0000 (UTC) X-FDA: 76687824066.17.root56_2a9fcd476a52c X-HE-Tag: root56_2a9fcd476a52c X-Filterd-Recvd-Size: 6816 Received: from mail-ot1-f66.google.com (mail-ot1-f66.google.com [209.85.210.66]) by imf45.hostedemail.com (Postfix) with ESMTP for ; Thu, 9 Apr 2020 09:41:32 +0000 (UTC) Received: by mail-ot1-f66.google.com with SMTP id q2so7077060otk.7 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=BGBHKuPAgNbiEXo/0VGmyfhv+XpQ8ATh6/WvgdyVqX5NdwsS1fbzkQ0vs0wdCywu0T kahYlBTeZqnv1nNXO3r6R/GzPeuwK8OM3krO86AUMU2ffVSyol6pFUA6C9txhwEyAsl9 CaZEvNLns33PuydLK1mfg3ZyDGFX77J5PAZalkMFF765quOt6bXhrNYQ2wosl0K0hKSN WxehH4+ecJpitJ+t2ECqGZg/pBlrP+FG1J38CQBY4co78rvEde8cUbeWaEhurLXStb4D wL9jhot+BAZUzSKDn4i5tRoiMkisNR7HsylYqiC8cJHSgRl26hPzknDCwxhqsLt6Gr/8 2MxA== X-Gm-Message-State: AGi0PuY7m9tjL/LjXolCbOXbsHc2ZhTg+6CaeAcD9pOhvJrmBEHchY/E HiZwN1OQxngZjSyKaa1+AQC+9wRfkCogUr6NI+KGuw== X-Google-Smtp-Source: APiQypLHBVJAv55CZxyRjUHHZPFErxI7m2EAB+edMw28HekqHKAMU8pcbynFySqYUgFQY0OpR/l48dylQu4jTtXwGxw= 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" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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