From patchwork Wed Aug 29 06:24:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 145382 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp311592ljw; Tue, 28 Aug 2018 23:24:27 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY6uYVsoTuMOu9GqmFXxqrN9OeukILyBusBKh2VgE1Tp4QwCZksHbhMlI4sFWx8is26EP8/ X-Received: by 2002:a63:4c07:: with SMTP id z7-v6mr4549172pga.312.1535523867060; Tue, 28 Aug 2018 23:24:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535523867; cv=none; d=google.com; s=arc-20160816; b=yhkoDWqluuoV9tlclktOv2PKOHVDK52cw8Cvbn5uVZUgM/sEUHBXnH41lJMKXnIr9u mLxLxRe55sloBRxZeIveyOyYo4/gMe3hl0ndbvs80w8LJP4mYUhD3Bp6EUAoV1V0ZzzN gy6lqSTGwWoCURYpl2QbkgTFp+/Givcjv99VTssO8UrypRuP2jEhww3d+5eJy53u+n/U Mv/NOnDxeuMwn0Y0+9LhmX9YlaYH1/G6OHH0gjh6x5Wxlu9OrtJF821m0nku/+Z1Rqnu bVj5wZcueh4jeAtJ7TVx00npmSGiwStTWlhMrjIUAbS+d0qaVua6hOY5w6k9pwQWQM1h bu0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=WFuHpff7ifAeEmLpaCxMYYdOGJStFS2wfjqSeVyFvg0=; b=V/dK4m0kLKWKvZQ3je5x7FEEWb8If+5TIe9uej2YStYrHXS/WTNcuvdqF9PsGvI/qy KUw60DikY+t83D3+mI/8fesr3csGZNk4lmDe6ByNx9PhKBrGOMPWjVECeNBdptseMRHc Pwq056G8ooyGTUusKj9Xdq6lRbQ+CxwBuSyH+7Z6MM1vLTO0z02RCB+6xag6hmtusk37 /R7xu3B1zmQ5tRxLU9BV2uwA5KrZBL1gx886XMXpIMQYIDua2xPQ9Rz8Zu0rehmHyZba mYxrLvJbQC+wzPXNGnb0V9i6Y6z3VNdqQIbMxOsCVvgypYvQHBUmeN4um/K5lW7FZ9Va yO0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="Xw9/7nEn"; 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 t127-v6si2994464pfc.118.2018.08.28.23.24.26; Tue, 28 Aug 2018 23:24:27 -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="Xw9/7nEn"; 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 S1727493AbeH2KTi (ORCPT + 32 others); Wed, 29 Aug 2018 06:19:38 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:56138 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727324AbeH2KTf (ORCPT ); Wed, 29 Aug 2018 06:19:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=WFuHpff7ifAeEmLpaCxMYYdOGJStFS2wfjqSeVyFvg0=; b=Xw9/7nEn+VOyNETEc2HeN7HfM dlsTUrwxCCMv8fLOvqhITvMQcAdYLNqudORM3jY43fImEGEZfekry+d8GJaAvfhyPHwEGDBaAZ2Mp gRIGtJOVcvcCvRosi4YAzFWXzGjX7xrPZR5i4qpouW2BbVeaGgZ06iO0l2j0Jz71J3yvH27uPEMHi oZGu38cY8WGrLTnlTSE7OE7OzqNdcgV3O6l758Um0rN+tW1InDJ6+GF9KDBq7pYDtDK3YH0G4awnX XFjYh5OlNuilF+KgvN/zFbPzeEjKW5s9TLGBfHpZj2NVwBn3Bfyd+jxU/Rxze1lmjjw7UAU6L9wt1 rNmpg9Sww==; Received: from 213-225-12-4.nat.highway.a1.net ([213.225.12.4] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1futtn-0002jM-1I; Wed, 29 Aug 2018 06:24:15 +0000 From: Christoph Hellwig To: iommu@lists.linux-foundation.org Cc: Robin Murphy , Meelis Roos , Guenter Roeck , Linus Walleij , sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] of/platform: initialise AMBA default DMA masks Date: Wed, 29 Aug 2018 08:24:01 +0200 Message-Id: <20180829062401.8701-4-hch@lst.de> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180829062401.8701-1-hch@lst.de> References: <20180829062401.8701-1-hch@lst.de> 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 From: Linus Walleij commit a5516219b102 ("of/platform: Initialise default DMA masks") sets up the coherent_dma_mask of platform devices created from the device tree, but fails to do the same for AMBA (PrimeCell) devices. This leads to a regression in kernel v4.19-rc1 triggering the WARN_ON_ONCE(dev && !dev->coherent_dma_mask) in dma_alloc_attrs(). This regresses the PL111 DRM driver in drivers/gpu/drm/pl111 that uses the AMBA PrimeCell to instantiate the frame buffer device, as it cannot allocate a chunk of coherent memory anymore due to the missing mask. Fixes: a5516219b102 ("of/platform: Initialise default DMA masks") Signed-off-by: Linus Walleij [hch: added a comment, and droped a conditional that can't be true] Signed-off-by: Christoph Hellwig --- drivers/of/platform.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.18.0 diff --git a/drivers/of/platform.c b/drivers/of/platform.c index 7ba90c290a42..6c59673933e9 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -241,6 +241,10 @@ static struct amba_device *of_amba_device_create(struct device_node *node, if (!dev) goto err_clear_flag; + /* AMBA devices only support a single DMA mask */ + dev->dev.coherent_dma_mask = DMA_BIT_MASK(32); + dev->dev.dma_mask = &dev->dev.coherent_dma_mask; + /* setup generic device info */ dev->dev.of_node = of_node_get(node); dev->dev.fwnode = &node->fwnode;