Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp41743imm; Thu, 27 Sep 2018 15:36:44 -0700 (PDT) X-Google-Smtp-Source: ACcGV629zkUgZRuQjYBlqIPFEeGQzpsMzRVo57WJGgCGcv/yAhkjlIqgkgMIyhk8ljM/I4+HbR1D X-Received: by 2002:a62:45d2:: with SMTP id n79-v6mr13574352pfi.137.1538087804393; Thu, 27 Sep 2018 15:36:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538087804; cv=none; d=google.com; s=arc-20160816; b=YqPvVQVYli2zVz14PuKgynq7cMMW9BrVSviJicjO1Rx5oI1j/VtsH2isaRJdfq7Tln vHIk7sVpsKsOuXjpej6QKq6IdA8FM+eNitAs8aWp4Uqncn/CzQo/NWyo6Dn5Bt4ddTem OpAreTXip5AUmiOO2ASFBoHM1OADAqtlkQuTnR5ll9d3FIMAMgslZ6b8PiYm1TaRCePP BUHyZcECqhsQDAydcooLeT5qZRNSz226NIzkPvxew1ozHWX1LHYReBQ6SL9dkGnp1NXz WoNXUoUTFAfv+2zAANNCxa0TwX9xHNuslRgtGxG5GpR+Ffhv25kePR33z3gyp908R1/a /+4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=AYZEMS42FWgWX/fZd9uNWJ95ae3u3tpBODoaU0A9Amg=; b=Oh//OhBhVU8U8dJGBRnhq5XxD3dc9fi3xYJZTFZUtklo3eD0dR+uHh1Cdf1Gs3LkYT J6feC+KhQPR/tIc/su1Gto9tZUfWBVkxqXHNybmL2cxEtwkREGLp4mDqFygeTvqVzAeS 90FDDYgEVK2YTV5l6Nc9/KlSnbNFG85LbsYvNBXmjeH+SZl5oAaBVnVfL0iQFSdYQOnw WMJEKARWXdrW7R/9qlB6a/l9IrgnLZO78ObIGiv3aD+7teVl984I8+U1C4ihMIRpBylh ansKofsDNXTKNJJkeTQc1HzfgVq7i4GEjW5gYU/lwYcHU2buDLHbYHj6YGVTi1r2AQ0v C9qA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=V9aJejna; 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 bb6-v6si3021968plb.359.2018.09.27.15.36.28; Thu, 27 Sep 2018 15:36:44 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=V9aJejna; 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 S1726191AbeI1E4p (ORCPT + 99 others); Fri, 28 Sep 2018 00:56:45 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:56606 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725924AbeI1E4p (ORCPT ); Fri, 28 Sep 2018 00:56:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=AYZEMS42FWgWX/fZd9uNWJ95ae3u3tpBODoaU0A9Amg=; b=V9aJejnaDNDprBrqfXpd1FI+0 8CYuQz71rO2ew/P/VWh1j4gq0TTLZpqIU2Sdm735ttG0HNxP7CrHKYJhxqIdrUGwnISP6EAnd/cYE ZKB6nPvEMTRBTEfyw74BMiSZi9mi/Xlf9KKQT3UBUb+YIlKhjDtwJQAobZJSZ28JDvgJ9lR56Ptg7 Gsy9P72I493S5tt3mJZRELn8uJdCxp/UdsSEsoGdyHwYiki1D8j55lGfz9gsKt+JJY18cvil2f+u9 V6KgicuXt/Xr/jl3uuSDSYb+5ii7VzhYyEHuIO+KAyzBYPXss2VRlyyQGiVXu+331moWx7MWcu2pb WtDa/kmKw==; Received: from [199.255.44.5] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1g5esr-0002jp-Sv; Thu, 27 Sep 2018 22:36:05 +0000 From: Christoph Hellwig To: iommu@lists.linux-foundation.org Cc: Marek Szyprowski , Robin Murphy , Benjamin Herrenschmidt , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: dma mask related fixups (including full bus_dma_mask support) v2 Date: Thu, 27 Sep 2018 15:35:34 -0700 Message-Id: <20180927223539.28449-1-hch@lst.de> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, the dma_get_required_mask dma API implementation has always been a little odd, in that we by default don't wire it up struct dma_map_ops, but instead hard code a default implementation. powerpc and ia64 override this default and either call a method or otherwise duplicate the default. This series always enabled the method and just falls back to the previous default implementation when it is not available, as well as fixing up a few bits in the default implementations. This already allows removing the ia64 override of the implementation, and will also allow to remove the powerpc one together with a few additional cleanups in the powerpc code, but those will be sent separately with other powerpc DMA API patches. Last but not least the method will allow us to return a more sensible value for typical iommu dma_ops eventually, but that is left to another series as well. Additionally the dma-direct code has been a bit sloppy in when it was using phys_to_dma in a few places, so this gets fixed up as well as actually respecting the bus_dma_mask everywhere instead of just rejecting dma mask that don't fit into it. Alltogether this should be all core dma-direct changes required to move powerpc over to the generic code. Changes since v2: - clean up a mask check - add various acks