Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1026646ybe; Wed, 4 Sep 2019 11:21:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqyirDpENY/WAZoh/wWxsDIS25vBpqAMgsZEaIY7eVpSORt2IU1QpZC7F/L+/QKqDgxuhxvA X-Received: by 2002:a63:494d:: with SMTP id y13mr36844600pgk.109.1567621265575; Wed, 04 Sep 2019 11:21:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567621265; cv=none; d=google.com; s=arc-20160816; b=ROZtXWGbfHi/VTmkLAGU+jE6xE4MOeZEFnFOQnbmZLP+bQPyKm6yELxIbF9giOmTDD wigJgeWUUAlbpcY4nNX3XjE0VPeU1FYMan1QXderpZjXwSzt6+ZoK5l+N61ZbBU0D1M5 E8LmEtl6fUb3+JBg6Cl7hy4q9T95joi358d79cUv1x4pxvn7nTmgnKJFe3Kynsm0oQ3X 4kkMpLwxMJmz8Fcgd7d2xEYZBYpS97RU7YwqVxXHGXOf1xLazg92nOdpxeSquJKEF12T GAt8v7hi/DRlYYxwc4CG81UHtT7gPaYPv7bgq/zmWwQtyHEvB2rtpH0qXMBi0KEi476e mMSg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=JCiHui4do6qgvJY+Zoz+nAseDHfR7z3U6flKcNA5Vsk=; b=IUGEGpHxTj0LMC8uxdwuqREvb6Pwn9UogW0ZKDyEnu709nzQ1UVYMSUvUU7Hqex1UF Xc2vUNunPS0QqJOCW+kA60SHzQAcRjjy1/G8mjA/fWUS9w85w2Rg97jsTixNpYwqCoGv qDSdYkg/tppgAge5lMplU5FQRaHaaTKz7KVdkXvF8nQSnUy0rLguX6Phj7whi7GjjCsW /2qfa18cIV++9wqcV7aJhHP/ttaYVRR6vH5T5J3NfbL4U1e6U7oqIHiIbwg3DB228rKO K5kec5VcDODrUW5wFJ1LJYdLCjUJ28QyLyIQ3Jsx9IP7znanrmxfDYklxDuT6mFi9xTw hmOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XTxWR2Yc; 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 l2si82664pjn.26.2019.09.04.11.20.49; Wed, 04 Sep 2019 11:21:05 -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=pass header.i=@kernel.org header.s=default header.b=XTxWR2Yc; 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 S2389710AbfIDSTT (ORCPT + 99 others); Wed, 4 Sep 2019 14:19:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:53402 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390019AbfIDSJ7 (ORCPT ); Wed, 4 Sep 2019 14:09:59 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 245042087E; Wed, 4 Sep 2019 18:09:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567620598; bh=mMUhugRxCVP5bdl6+7j98wwjOy/wromZmzTztlHSIZA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XTxWR2YclJVOYRGd/IIINdiJt1802a2lCNgmNoLBlhimL2J/Vj/4Ogu+kv2EV8Ktu ULgb/lo3zQzarUsJEYU7b3IwapvBOfqGRJJMYWnK5rZBd23svisatjekJmCqdSAg8a nxtPIx+lFPoFeEoDHHuPX/PPoYlwBzT+9ewOozmk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lucas Stach , Atish Patra , Christoph Hellwig , Sasha Levin Subject: [PATCH 5.2 025/143] dma-direct: dont truncate dma_required_mask to bus addressing capabilities Date: Wed, 4 Sep 2019 19:52:48 +0200 Message-Id: <20190904175315.051650883@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190904175314.206239922@linuxfoundation.org> References: <20190904175314.206239922@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit d8ad55538abe443919e20e0bb996561bca9cad84 ] 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 Tested-by: Atish Patra Signed-off-by: Christoph Hellwig Signed-off-by: Sasha Levin --- kernel/dma/direct.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c index 2c2772e9702ab..9912be7a970de 100644 --- a/kernel/dma/direct.c +++ b/kernel/dma/direct.c @@ -55,9 +55,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