Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp405650ybg; Tue, 9 Jun 2020 03:48:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWiyNeyE6Vmj5eLhosUSFoZLKuu0+WRmwk8QzkRX2BnKmLI7ShQFH2ppAi+WDV37rmuGDK X-Received: by 2002:a05:6402:158b:: with SMTP id c11mr26245888edv.29.1591699716435; Tue, 09 Jun 2020 03:48:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591699716; cv=none; d=google.com; s=arc-20160816; b=WPkEIasxGr8C1L7trMs3zFwBhey00bUIzwGVR7bY0haS3vs+8/xrmSalqgHv0SbSen UPpuVF4Hnbip16sEvgGqcgVBKfmBUHzF1HwBy3Raec8fzM3+MrewDiw8WXZT1ACeLdjx 0PQ6+moxFpMJjfSulLdX8NPibY/K/rrfJndt/MZt8Nd8hzpbEis/OZtvIfW4zMFgLVIl k/WjFFz6N4UruKW74ljISBN/B5P43lOpBBTl1RzocwHPKsCUPxBfSED3XBMgeBA4Nhag X3xmax2ilPs4lr57hdbfZ4/PS23aEgvRfvEQzIsKBCzvCuJrv/gIaPXw1LkiYRJ/OvbW zFgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=KdFWqSSea2HFbH2nnPcFiy0GjWMyDBYPi203cF8/Mq8=; b=TsmHKb8CsKdPWOs7v/nax3tz6Osj0R7/8ti6Kc6a5gW5DGC0LNAu6itpmof9i3ApkN kT/aikJAjMX2GmPvIZuGpqiPvfyaoX9gc3tTpT37ikYsZY9meVHYbssl5WQxTdUdUzcI lnXPhnERfyLIIYluFG+OhNVug3TOXVq9sPYAvv6DE3L+h8PQ6Zep/8zbq0aESy0eK1C+ ieJWxrhCsiaflBGHYpjnkCTcAiqwJQUujsBlMvbVtCncIZcpvD2pStAmZKR63NVi0TLA x1S3M1r9zcPUllhkZo36TASAtN++asf2ao4xPfnMDR0AV+FukVyyK8uXqFVndqlLSO/I gEvw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c4si9809104ejm.465.2020.06.09.03.48.13; Tue, 09 Jun 2020 03:48:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728391AbgFIJRb (ORCPT + 99 others); Tue, 9 Jun 2020 05:17:31 -0400 Received: from verein.lst.de ([213.95.11.211]:41449 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728247AbgFIJRb (ORCPT ); Tue, 9 Jun 2020 05:17:31 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 09DBF68AFE; Tue, 9 Jun 2020 11:17:28 +0200 (CEST) Date: Tue, 9 Jun 2020 11:17:27 +0200 From: Christoph Hellwig To: Takashi Iwai Cc: Christoph Hellwig , David Rientjes , "Alex Xu (Hello71)" , alsa-devel@alsa-project.org, bp@alien8.de, hch@infradead.org, hpa@zytor.com, linux-kernel@vger.kernel.org, mingo@redhat.com, Pavel Machek , perex@perex.cz, tglx@linutronix.de, tiwai@suse.com, x86@kernel.org Subject: Re: next-0519 on thinkpad x60: sound related? window manager crash Message-ID: <20200609091727.GA23814@lst.de> References: <20200520111136.GA3802@amd> <1591545088.74ii116nf2.none@localhost> <20200608061950.GA17476@lst.de> <1591624340.z01ejtod28.none@localhost> <20200609054306.GA9606@lst.de> <20200609084305.GA21671@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 09, 2020 at 11:09:14AM +0200, Takashi Iwai wrote: > On Tue, 09 Jun 2020 10:43:05 +0200, > Christoph Hellwig wrote: > > > > On Tue, Jun 09, 2020 at 10:05:26AM +0200, Takashi Iwai wrote: > > > > >From the disassembly it seems like a vmalloc allocation is NULL, which > > > > seems really weird as this patch shouldn't make a difference for them, > > > > and I also only see a single places that allocates the field, and that > > > > checks for an allocation failure. But the sound code is a little > > > > hard to unwind sometimes. > > > > > > It's not clear which sound device being affected, but if it's > > > HD-audio on x86, runtime->dma_area points to a vmapped buffer from > > > SG-pages allocated by dma_alloc_coherent(). > > > > > > OTOH, if it's a USB-audio, runtime->dma_area is a buffer by > > > vmalloc(). > > > > Err, you can't just vmap a buffer returned from dma_alloc_coherent, > > dma_alloc_coherent returns values are opaque and can't be used > > for virt_to_page. Whatever that code did has already been broken > > per the DMA API contract and on many architectures and just happend > > to work on x86 by accident. > > Hmm, that's bad. > > How would be a proper way to get the virtually mapped SG-buffer pages > with coherent memory? (Also allowing user-space mmap, too) dma_mmap_coherent / dma_mmap_attrs for userspace. We don't really have a good way for kernel space mappings.