Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp2914512ybh; Mon, 5 Aug 2019 08:53:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqxhBfX+R4aT2CQSHktbJKh6wG3pI5XTUs21z8lUOhrzBNdrdZBIS81/5bWfGUHP4GK3Y6u3 X-Received: by 2002:a17:902:6a88:: with SMTP id n8mr145102697plk.70.1565020418124; Mon, 05 Aug 2019 08:53:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565020418; cv=none; d=google.com; s=arc-20160816; b=jh7iEKXll5mozMP0KkhA9KZxfef0zEcgieoszzipPEDJs7P9r6nJ5YWwogvymXcHco 3bFg3jlhXt5p9jH/+p8TQghHHdti8s8cpPesuoGQgcHiZZNtzA64P5Bd3Kxi03DbI5dt wgMW3xZ7CgxTkQ2VSu58mmTG2KaE9eyzOeOXD7icS++QloPWqAV5BnMIeB5XJlpjTO4p PXROam02NMWAqR/JLvG6+Nbbr05xmazWsuRyye+Hj+Ps9FZ60U/uGPg/l6A+O3wQn4Gz 3k/pf1K5S4SpqjxuQRQ8qrAXtQgUCNLvNKxlKf3PPI90JAm4dkU5qUebCZASCPtXMVnH HrFQ== 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; bh=Ba6ZxU1E5xnixpkySUs7Wd3cBF0cxwjITLUvHjk/2w8=; b=as8Pud1gCUyXV4S+mnjzEq/L/ZCxu29VLMLtMuRTthuISgZT6vbUfb0qeccQsrIZn/ yx+cVNt/hmsTFoqJSzdr2+C75GNY8jlxv76cCSPEtLPFSFtLGIQ8VNoQ21TEnS0Kx8GG i8Zc0fFla49TABNhpAcQo2UntYMiswMc9HiypZW3NHgYzLNcujUlBXVEnvFCyuQC3sNo gCzUwzoIBQQN42ddDvgUMh0xRAuqA/pQ3cYliKz9o88hKY64Ub+z+lDRPGmd4063CHj3 7RhcMGJIsVDS3CDHzK+L0dC/0inxnpVb4O2KMOQrslgA7FRNhC5Mts6ST6t6tLuzsiBv GBYw== 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 r4si5267616pgg.368.2019.08.05.08.53.22; Mon, 05 Aug 2019 08:53:38 -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 S1729012AbfHEPwA (ORCPT + 99 others); Mon, 5 Aug 2019 11:52:00 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:58351 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726559AbfHEPwA (ORCPT ); Mon, 5 Aug 2019 11:52:00 -0400 Received: from dude02.hi.pengutronix.de ([2001:67c:670:100:1d::28] helo=dude02.pengutronix.de.) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1hufH9-0000B4-1O; Mon, 05 Aug 2019 17:51:55 +0200 From: Lucas Stach To: Christoph Hellwig , Marek Szyprowski , Robin Murphy Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de, patchwork-lst@pengutronix.de Subject: [PATCH] dma-direct: don't truncate dma_required_mask to bus addressing capabilities Date: Mon, 5 Aug 2019 17:51:53 +0200 Message-Id: <20190805155153.11021-1-l.stach@pengutronix.de> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::28 X-SA-Exim-Mail-From: l.stach@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The dma required_mask needs to reflect the actual addressing capabilities needed to handle the whole system RAM. When truncated down to the bus addressing capabilities dma_addressing_limited() will incorrectly signal no limitations for devices which are restricted by the bus_dma_mask. Fixes: b4ebe6063204 (dma-direct: implement complete bus_dma_mask handling) Signed-off-by: Lucas Stach --- kernel/dma/direct.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c index 59bdceea3737..7ba3480fc546 100644 --- a/kernel/dma/direct.c +++ b/kernel/dma/direct.c @@ -47,9 +47,6 @@ u64 dma_direct_get_required_mask(struct device *dev) { u64 max_dma = phys_to_dma_direct(dev, (max_pfn - 1) << PAGE_SHIFT); - if (dev->bus_dma_mask && dev->bus_dma_mask < max_dma) - max_dma = dev->bus_dma_mask; - return (1ULL << (fls64(max_dma) - 1)) * 2 - 1; } -- 2.20.1