Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2447992imm; Mon, 28 May 2018 08:15:34 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJJf4ImhVfaWmQiPofKDzc2vbEGgnmW0XlI+lRxtK+wR0gDPpGSbOutsg43IAjE6HkRl42j X-Received: by 2002:a63:a44a:: with SMTP id c10-v6mr5249190pgp.198.1527520534873; Mon, 28 May 2018 08:15:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527520534; cv=none; d=google.com; s=arc-20160816; b=pfFF6kWLMQQytDhmrTxBEaOAwKtMX95HMkl48r3xDzXpgB1/yHWxVevqDXRLwHyd/+ dRZRo1Vo7Uw5rsaMDzJh/prPs/w/LX1Lwmo9yovN60JGCJpirTewqW4VeChdvwNzAVu7 Ti8gzzxZbR7AEXRTsABWzwyw1mFdbJN/JZZHN6YFcfw88IkpeyP9b2Jgt2lthxQ3RpUB QZXq6weZiOY7iKXLIzf3D5Su/3LQMvBwi4n2lcOyjGKYk8b7HoYE+qi2H10DrQ7nYkF4 MVrzLxoygWogMehBDLhrowoUY9EViNROSXH4kt7U46yr8Q6mXgAPuI7dZdNzGdXt7t6N wKYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=39KiDb14Pn3zXYie9tr83qe5rqH8rLg+puPO8hco/pY=; b=BikdAV2j6lbMUuPz3rsL7nUt0M1T69MptbMGSc1q6AAkc86dM91aKHMPKHfU2PpcyR 4g4jT9dbkTL9Sf53FcnH3laPQBxDD4yxpoDvoxopgay5/rqh5dIwBMxlTbgzR6VOuej6 p9vKUMSE6e8Ruc1rfpXWUIYbRmoFEPGyF1rOWMZBYm0qn8P+U1uQPzJMdgRkZXkq9qkr qsRg85JZLdE4qPDPUbUwzOOtPSnL/kHQwtizpnTx7BEAjZZNizzbfFO17qoDWjiBzG7h CJtixteNsv0mis72cMK6m7s+7miE9bTvAa8X6/ibqItB12GvhUxQI8ecOx3knfFVnKiL 8Atw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=folxod0O; 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 m11-v6si230168pgr.104.2018.05.28.08.15.19; Mon, 28 May 2018 08:15:34 -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=folxod0O; 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 S1034069AbeE1POM (ORCPT + 99 others); Mon, 28 May 2018 11:14:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:42570 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1033336AbeE1KXL (ORCPT ); Mon, 28 May 2018 06:23:11 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (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 8285420843; Mon, 28 May 2018 10:23:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527502991; bh=DCsSdnDX/bw/pQ6MYW5nDFT7O4yFXloE2M6SBXlFrAY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=folxod0Og5bEKVx9WH9kTv0ayqSeBJOfUfejmuG+hUjJBprLl8l68DqlcDTCodgKO DQPqZv7QkQkwKrnVJ7JfyBkdSkCgcO+P6jpseabG4Nn07s/JaR7YWVyZrlDUf8FlUt 89WpaJy3bxCRiHVwlhdMdBN1WqBrP+n0fMLcm7d4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Schmitz , Christoph Hellwig , Geert Uytterhoeven , Sasha Levin Subject: [PATCH 4.4 203/268] zorro: Set up z->dev.dma_mask for the DMA API Date: Mon, 28 May 2018 12:02:57 +0200 Message-Id: <20180528100225.257662844@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100202.045206534@linuxfoundation.org> References: <20180528100202.045206534@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Michael Schmitz [ Upstream commit 55496d3fe2acd1a365c43cbd613a20ecd4d74395 ] The generic DMA API uses dev->dma_mask to check the DMA addressable memory bitmask, and warns if no mask is set or even allocated. Set z->dev.dma_coherent_mask on Zorro bus scan, and make z->dev.dma_mask to point to z->dev.dma_coherent_mask so device drivers that need DMA have everything set up to avoid warnings from dma_alloc_coherent(). Drivers can still use dma_set_mask_and_coherent() to explicitly set their DMA bit mask. Signed-off-by: Michael Schmitz [geert: Handle Zorro II with 24-bit address space] Acked-by: Christoph Hellwig Signed-off-by: Geert Uytterhoeven Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/zorro/zorro.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) --- a/drivers/zorro/zorro.c +++ b/drivers/zorro/zorro.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -185,6 +186,17 @@ static int __init amiga_zorro_probe(stru z->dev.parent = &bus->dev; z->dev.bus = &zorro_bus_type; z->dev.id = i; + switch (z->rom.er_Type & ERT_TYPEMASK) { + case ERT_ZORROIII: + z->dev.coherent_dma_mask = DMA_BIT_MASK(32); + break; + + case ERT_ZORROII: + default: + z->dev.coherent_dma_mask = DMA_BIT_MASK(24); + break; + } + z->dev.dma_mask = &z->dev.coherent_dma_mask; } /* ... then register them */