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=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 35FC7C31E57 for ; Mon, 17 Jun 2019 13:15:55 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0E8A22082C for ; Mon, 17 Jun 2019 13:15:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="S3ye78RE"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mev.co.uk header.i=@mev.co.uk header.b="Nl+Gx2+K" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0E8A22082C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=mev.co.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=5dXg64t7zLLlV6Rzo4Ms+R1omGS7ykBo4Y39BNvPxf4=; b=S3ye78REQwysrotjVeUX3Wh4z QgoIE2t+zHO8+JS+8Nyv1y9cBBJ2YXvfmnHLttThSGWf8RELaEjRyPxbUTy0wVQ52URn9aVP2GglL h7X8ACdxmfrvi5tcB6C8XBzGefzFRtFEjZZJ+4S6Np1OOHYnswHHj1LmkKCo6NxnBomSu1Fk3/gRP dSyiazQfJj/UC8ZTscrGvESLN0AIFdHCPGue6CJILPsz680hI7VXPYChehlMIkQBoueQN96h9XA5v afTHEfR5JnQJxbWGV5ix/Zg0wQuH9qRW1/xwhAYJrZq/hlcr/MpLA+SmL4WoV9MKAepDbxNVSnZxf O8SF2VcKw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hcrUI-0002Ug-Ol; Mon, 17 Jun 2019 13:15:54 +0000 Received: from smtp113.ord1c.emailsrvr.com ([108.166.43.113]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hcrUG-0002Tp-4D for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2019 13:15:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mev.co.uk; s=20190130-41we5z8j; t=1560777347; bh=ZvJvYkjr7iE1RIXRXDlijzKzJL0BitvNBM9T5FqQAmw=; h=Subject:To:From:Date:From; b=Nl+Gx2+KTHlZUrgrlD4OPdHaDIh8UJfTuRA5MZVnySfiilIiWgnddpiJk4/aln5DA OAo8bcON3aHKJNRIUHN2qprmbAq2BRvH2IUzshdVkvRvYeZuB2iOeftPYIjVWn6ziI KuJnFj51kem220yEC5D7kahxijPjmtFu66j0THaY= X-Auth-ID: abbotti@mev.co.uk Received: by smtp7.relay.ord1c.emailsrvr.com (Authenticated sender: abbotti-AT-mev.co.uk) with ESMTPSA id D9002A01B2; Mon, 17 Jun 2019 09:15:44 -0400 (EDT) X-Sender-Id: abbotti@mev.co.uk Received: from [10.0.0.62] (remote.quintadena.com [81.133.34.160]) (using TLSv1.2 with cipher AES128-SHA) by 0.0.0.0:465 (trex/5.7.12); Mon, 17 Jun 2019 09:15:47 -0400 Subject: Re: [PATCH 12/16] staging/comedi: mark as broken To: Christoph Hellwig , Greg KH References: <20190614134726.3827-1-hch@lst.de> <20190614134726.3827-13-hch@lst.de> <20190614140239.GA7234@kroah.com> <20190614144857.GA9088@lst.de> <20190614153032.GD18049@kroah.com> <20190614153428.GA10008@lst.de> From: Ian Abbott Organization: MEV Ltd. Message-ID: <60c6af3d-d8e4-5745-8d2b-9791a2f4ff56@mev.co.uk> Date: Mon, 17 Jun 2019 14:15:43 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20190614153428.GA10008@lst.de> Content-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190617_061552_303819_6657F2E5 X-CRM114-Status: GOOD ( 17.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Maxime Ripard , Joonas Lahtinen , dri-devel@lists.freedesktop.org, linux-mm@kvack.org, devel@driverdev.osuosl.org, linux-s390@vger.kernel.org, linux-rdma@vger.kernel.org, David Airlie , linux-media@vger.kernel.org, Intel Linux Wireless , intel-gfx@lists.freedesktop.org, Maarten Lankhorst , Jani Nikula , Rodrigo Vivi , Sean Paul , "moderated list:ARM PORT" , netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, H Hartley Sweeten , iommu@lists.linux-foundation.org, Daniel Vetter Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 14/06/2019 16:34, Christoph Hellwig wrote: > On Fri, Jun 14, 2019 at 05:30:32PM +0200, Greg KH wrote: >> On Fri, Jun 14, 2019 at 04:48:57PM +0200, Christoph Hellwig wrote: >>> On Fri, Jun 14, 2019 at 04:02:39PM +0200, Greg KH wrote: >>>> Perhaps a hint as to how we can fix this up? This is the first time >>>> I've heard of the comedi code not handling dma properly. >>> >>> It can be fixed by: >>> >>> a) never calling virt_to_page (or vmalloc_to_page for that matter) >>> on dma allocation >>> b) never remapping dma allocation with conflicting cache modes >>> (no remapping should be doable after a) anyway). >> >> Ok, fair enough, have any pointers of drivers/core code that does this >> correctly? I can put it on my todo list, but might take a week or so... > > Just about everyone else. They just need to remove the vmap and > either do one large allocation, or live with the fact that they need > helpers to access multiple array elements instead of one net vmap, > which most of the users already seem to do anyway, with just a few > using the vmap (which might explain why we didn't see blowups yet). Avoiding the vmap in comedi should be do-able as it already has other means to get at the buffer pages. When comedi makes the buffer from DMA coherent memory, it currently allocates it as a series of page-sized chunks. That cannot be mmap'ed in one go with dma_mmap_coherent(), so I see the following solutions. 1. Change the buffer allocation to allocate a single chunk of DMA coherent memory and use dma_mmap_coherent() to mmap it. 2. Call dma_mmap_coherent() in a loop, adjusting vma->vm_start and vma->vm_end for each iteration (vma->vm_pgoff will be 0), and restoring the vma->vm_start and vma->vm_end at the end. I'm not sure if 2 is a legal option. -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( MEV Ltd. is a company registered in England & Wales. )=- -=( Registered number: 02862268. Registered address: )=- -=( 15 West Park Road, Bramhall, STOCKPORT, SK7 3JZ, UK. )=- _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel