From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH] drm/prime: remove cargo-cult locking from map_sg helper Date: Wed, 10 Jul 2013 17:21:23 +0200 Message-ID: References: <1373457273-5800-1-git-send-email-daniel.vetter@ffwll.ch> <51DD4D89.3090409@canonical.com> <20130710151824.GF11007@phenom.dumpdata.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ie0-f172.google.com (mail-ie0-f172.google.com [209.85.223.172]) by gabe.freedesktop.org (Postfix) with ESMTP id B4F6AE5CD9 for ; Wed, 10 Jul 2013 08:21:24 -0700 (PDT) Received: by mail-ie0-f172.google.com with SMTP id 16so15893188iea.17 for ; Wed, 10 Jul 2013 08:21:24 -0700 (PDT) In-Reply-To: <20130710151824.GF11007@phenom.dumpdata.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Konrad Rzeszutek Wilk Cc: DRI Development List-Id: dri-devel@lists.freedesktop.org On Wed, Jul 10, 2013 at 5:18 PM, Konrad Rzeszutek Wilk wrote: >> So after a bit of irc chatting with Maarten this seems to be more >> involved. The above check is to cache the dma mapping, but the >> implementation is bogus in tons of ways: >> - If direction changes we don't bother with unmaping and freeing the >> mapping, but simply leak it. >> - This will break if the dma mapping needs explicit syncing since the >> helpers don't call sync_to_cpu/sync_to_device anywhere. > > Right, and I believe I signed up for that. Well, the breakage runs deeper since atm ttm doesn't have any concept of syncing from/to the device dma. Neither has i915. So this little issue here is just the tip of the iceberg ... >> So I think I'll decline to poke around more in this hornet nest and >> leave it at the locking removal. > > .. and I get the hornet nest :-). Is there a IRC log of what you guys talked > about so I don't omit certain pieces of code. The above is pretty much the summary, actually more lines than what we've discussed on irc ;-) It's on #dri-devel though: http://people.freedesktop.org/~cbrill/dri-log/?channel=dri-devel&show_html=true&highlight_names=&date=2013-07-10 -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch