Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3268519imm; Mon, 6 Aug 2018 01:29:14 -0700 (PDT) X-Google-Smtp-Source: AAOMgpddvnOIX1E/xg52fDQCoA8xkXSstfGKkmKWqOo8yecv/MsWiL8tiQhCPXrqD9H/9bo1VRW9 X-Received: by 2002:a62:6cc7:: with SMTP id h190-v6mr16206567pfc.113.1533544154767; Mon, 06 Aug 2018 01:29:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533544154; cv=none; d=google.com; s=arc-20160816; b=EmSA7Tl4BTTT9ZIqLGAe5xXdDCztHA7+Ems0mXPB0JEf3LQnx4ZtcZ5rFyPA+4Pl1u u+kCk9roQ9nEp3ZaVhX1KbTOYz/32OZgvHmYV9/LxZ4biwaMlJQZTYqcAs9WczxB1Klh UuqxDW7v3aUI5KFp5Xq3bDER9UEk+u8mBouUlto4ibpoNIET5Zqe8IkQH4Kg/J9Mw0N3 YCCOQ0EkqGfrHcI+O41i/8OuLsuFal11zGNrg0jPqvABriil4UFwQVZWtFLrQxnNbdqm Hbdv31CzbYQUlSwBKwouy+xJSOa+9p2gEVbm3JzPaf3SD2Oa+pmMMtwfX67Eq5L1hCJ6 doCA== 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:arc-authentication-results; bh=2+NFsRLkP3dWogXRAGS4fnvatPuOS9UWjbeEuZzlc60=; b=y96kgLIJ2XmyFlzZ58gBpZYoVGGnFiqRMGcH8Eno+sm05bk2ZlPuvf+KakM4gBd0Wg uBeG8hTib6OeJPU/UIq31wLNO54nlEs7XjD55uwYYyujS8u1+g5b8dJjUBCZRrsSR7gv pDOYZKi1ed/AleSV22Je8pmowYrOtTxdBdBt/P+8R5/+0RVMNbTl/n/bG0KBwhMOuey0 tsFJlt05oKjsWsQQIN/NalX2XEF6TvV+HL4UIIQKZ3AOYzF4oDffEdvgQF5rjxVeMPz1 fAWlvxXhkOAaM/dl/FHwcr/HNEQG6uNV0yGtfCl+AIrRz7t6ENqexcTZJjHhfgIL8+Xy I1NA== ARC-Authentication-Results: i=1; mx.google.com; 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 s198-v6si10142208pgc.381.2018.08.06.01.28.59; Mon, 06 Aug 2018 01:29:14 -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; 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 S1727146AbeHFKgI (ORCPT + 99 others); Mon, 6 Aug 2018 06:36:08 -0400 Received: from verein.lst.de ([213.95.11.211]:54656 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725951AbeHFKgH (ORCPT ); Mon, 6 Aug 2018 06:36:07 -0400 Received: by newverein.lst.de (Postfix, from userid 2407) id 8B3A468D52; Mon, 6 Aug 2018 10:33:22 +0200 (CEST) Date: Mon, 6 Aug 2018 10:33:22 +0200 From: Christoph Hellwig To: Guenter Roeck Cc: Alan Stern , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Christoph Hellwig Subject: Re: [PATCH] USB: OHCI: ohci-sm501: complete URBs in BH context Message-ID: <20180806083322.GA31637@lst.de> References: <55fffb30-1388-af6a-70a6-cb738dab062f@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55fffb30-1388-af6a-70a6-cb738dab062f@roeck-us.net> 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 Sun, Aug 05, 2018 at 02:38:22PM -0700, Guenter Roeck wrote: > AFAICS it used to be interrupt tolerant for all but x86 up to commit > 6894258eda ("dma-mapping: consolidate dma_{alloc,free}_{attrs,coherent}"). > A quick test shows that the warning is indeed not seen if I run my test > on v3.18.y. > > You would have to ask Christoph why it is now interrupt-intolerant for all > architectures. interrupt-tolerant actually is a very odd wording. x86 itself (at least unless using an iommu) actually is fine with calling dma_free_* with interrupts disabled, but many other architectures are not. For many architectures that are not cache coherent we'll have to manipulale the kernel page tables when freeing coherent memory, which we absolutely can't do from irq context. And as usual in the kernel we try to enforce the same rules on everyone to allow for portable code. Also except for the odd USB use cases that abuses dma_alloc_coherent for the bounce buffers in device local memory you are doing something wrong if you call dma_alloc*/dma_free* anywhere but during device initialization and removal. These are slow path interfaces for allocating memory for things like descriptors and similar. Your fast path should be using dma_map*/dma_unmap*.