Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp740949lqb; Fri, 24 May 2024 11:38:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUbugQkmuZHn4/33qdx4i6O/peXqVijbm6gnC3bcMuUHCVir6jv4Ee103dLHcnrwz6FYK/EJymqqsfhDri6/hilO00YwIYF2JGRJWJvqg== X-Google-Smtp-Source: AGHT+IHibLwTqy1xWRtT20JBzT8wdT1akR+81ezstghjm0oUost+m70r38kpNzKT5mcU42BxJUcP X-Received: by 2002:a17:902:f38c:b0:1f2:fe1b:13b5 with SMTP id d9443c01a7336-1f4494f1db4mr24832585ad.47.1716575921331; Fri, 24 May 2024 11:38:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716575921; cv=pass; d=google.com; s=arc-20160816; b=UpAxT9X6ib4di/yMrKUxdOAchKBDA55SYO9RFoaU3KZOvhcpMWGt7oB5jA/FK6TFHu PPsUOfdOI6JoGb+stqIJ/1S2u3dC5dnbpIdGEfNvpkhFKPR3DjrTqqGlrMkDXbLjej0F 0U4ywet9IpPtfhFAZZrhqY85Atx+EinUM60Fkz7qn7b5hU4lLuT9MuRqW+RQqhBEFcj3 qyoJ288iVJPXtdMP4IQlLtmqOWO09QDCcPmkM/Nx72P8DvRTXAobAt7kpvfN9mXY0VXP xH4EGh68xfOjYEHB3oXXtPDFoTQGABH4z7GGltWcUHtJMKwzNaZZ8nBv6wMGLGe7tJ8p g2nA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=FsDDNY/QwJvf47dmHC7PRu5uL7JEaRYA48sLf9OqOOY=; fh=IpIxrsvdIheffzaP4ul9roEkeM3kiE5E1c8QcWiaEBU=; b=zz+VlYvoMquit7vkej3e1syGEj+lkrPPc5IMNZszS88RZkqbObGEYNof7UyUNmxVxs slSIUX4tbt/lf/IbNKHynNlnjqApxqpqEjG8Hd8e/TrAavSq/FaN5U0jzDt5UhxvO560 QjX2MNBcA8li5BsgPl+AKNTd2cX27RBYOXt7cC/ge2dcRptUso7yAi0B0LYmgpCD1+GF Lbsac2PaHPk0TczoeBavJFZiKSDLC7msc7TrJLt6+fo0t9OwK26amhyGQdggcquNIr0x ZVt00hQBItzNjFlzJVVApnkgG+/GGN+zkkqEUYEHqID0T6yruh4k/JWxQpKsoSWfsERM dvKA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@raspberrypi.com header.s=google header.b=M65Q5Uek; arc=pass (i=1 spf=pass spfdomain=raspberrypi.com dkim=pass dkdomain=raspberrypi.com dmarc=pass fromdomain=raspberrypi.com); spf=pass (google.com: domain of linux-kernel+bounces-189006-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-189006-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=raspberrypi.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d9443c01a7336-1f44c78c099si17857305ad.111.2024.05.24.11.38.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 May 2024 11:38:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-189006-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@raspberrypi.com header.s=google header.b=M65Q5Uek; arc=pass (i=1 spf=pass spfdomain=raspberrypi.com dkim=pass dkdomain=raspberrypi.com dmarc=pass fromdomain=raspberrypi.com); spf=pass (google.com: domain of linux-kernel+bounces-189006-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-189006-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=raspberrypi.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 0B701B23064 for ; Fri, 24 May 2024 18:31:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 43ED412E1F8; Fri, 24 May 2024 18:28:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="M65Q5Uek" Received: from mail-wm1-f99.google.com (mail-wm1-f99.google.com [209.85.128.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D064A3FB2C for ; Fri, 24 May 2024 18:27:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.99 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716575284; cv=none; b=OgQu/8NpPeFvxl1nTnZjviYu+OYjfthngc80bxw60sXpp6ZMked5CXaEfvpIuIKrOC59ZzVQSGifrOOjY16AGI2eGmSD1tHax0lFy3CB8BG5r5WmYev6EwXTbjH/U8PE7HMuP6k7kExsS8rfgDXTDJ42u2Mxtzp8/UaKFMW2dUM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716575284; c=relaxed/simple; bh=5nrl5uVGiAQbueZrACpZq8a6cFbZpWvV3c8a8/I60FE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=J35lQ+Bgi83U5l/ls2WDu07y9doltDIeMafg01eNu32mHS9mTBcOMucK4cSpcyqJQzaPybzTZGkY5wX/unTI4ERb5pfzAvmUpYlfR2sFjl6Hp7t9Ifb1HZv4v9mhK3lSISC/HfyRE4Y/fmIjaOksX09xO1p0ZKYnMgP8+2LMxuw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=raspberrypi.com; spf=pass smtp.mailfrom=raspberrypi.com; dkim=pass (2048-bit key) header.d=raspberrypi.com header.i=@raspberrypi.com header.b=M65Q5Uek; arc=none smtp.client-ip=209.85.128.99 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=raspberrypi.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=raspberrypi.com Received: by mail-wm1-f99.google.com with SMTP id 5b1f17b1804b1-4202cea9941so67129585e9.1 for ; Fri, 24 May 2024 11:27:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1716575277; x=1717180077; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FsDDNY/QwJvf47dmHC7PRu5uL7JEaRYA48sLf9OqOOY=; b=M65Q5UekziG+lHvXQ/hI4nw4upU5bbNJVfgaHqEmGJLfmLg/wnt5OLrm1bsxi3HXHe hMi+LCte6mD6ONooYUmb9MJGl6n3IO0se3b14h68fuMTOAqkPm2JK3TWzOvNuHEVa8Md vNqC01pAGWD0D4ZY7ILTvYgxGTLmHYTdqM0IhIQwdzsEb5KbMbI0I/NQ7QIQaRlqERmf LNPrD7IrxfR6TeGLsMCnZfRaym/deOUkUAGgaKZvovawuN3PG3YHcKVtAWzw/TNDMOv/ 4VSeuFQ2ODyw0fdTrGMkIbOvFA2AsMEfAVghVKJwElD2ONrMLZVAmj+yW2wwG43+xpzg jhDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716575277; x=1717180077; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FsDDNY/QwJvf47dmHC7PRu5uL7JEaRYA48sLf9OqOOY=; b=XFBACUuwCmjvvxE9bUuY2kfCo9ge5p9RgCGqJ69hsxfBvOH/NDegj8fsxDsVz5rCnW 0MGdRIdBsJCGvK5l12uiJ/14g6Tdx1aqij1c5wPx2MSHw8TBejYQreghhJNbeSwrSE0o smCMrNcvGE6EAuw3Jo+wdvwnqbJtH/n2Mq6QkLrnKJWiWWr2O6Wx1YrRNbXO7DWVXkHC hYA4Zo0d3wI94+NaKl8d/UlDEXFOVB3l2xz/MwlYUtUMkllvauCbrn2gUnjUhRahev+O zjMf3ijqPq0EFixx0lDe1uA6qKRxGUh9NqcoHZHpqr27c960BBYDpjB77DjaFO9Omj84 2bhw== X-Forwarded-Encrypted: i=1; AJvYcCUo9ma0XpjiOX9TbpA6f/LwXuTbZwb81vYaXubD6E9TbF3MHt1Uh/D0eusatUgiZ0It2WxziX276DRbJXNXhZpYAhxfAD+r1qP/NTlw X-Gm-Message-State: AOJu0YyZ3/UcCzZHFOQD6NDW2bsjhb81hBR0JJDT0E9a+gO2A4pb+Du9 VbIQ/AZgceetXRVL0ciLtnQA0jASx4hSRUDfhBVyIOppULZS5ics0vdSqEJg2b8mbIrGaOsEpI/ 5lCqXIy8V55J3gVB5jcq3jgGmkARk0ggz X-Received: by 2002:a05:600c:3106:b0:420:29dd:84d5 with SMTP id 5b1f17b1804b1-421089ebf63mr23274805e9.5.1716575277312; Fri, 24 May 2024 11:27:57 -0700 (PDT) Received: from raspberrypi.com ([188.39.149.98]) by smtp-relay.gmail.com with ESMTPS id 5b1f17b1804b1-4210a964067sm979275e9.31.2024.05.24.11.27.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 May 2024 11:27:57 -0700 (PDT) X-Relaying-Domain: raspberrypi.com From: Dave Stevenson To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , Broadcom internal kernel review list , Ray Jui , Scott Branden , Vinod Koul , Maxime Ripard , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Ulf Hansson , Mark Brown , Christoph Hellwig , Marek Szyprowski , Robin Murphy , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Vladimir Murzin , Phil Elwell , Stefan Wahren , Serge Semin Cc: devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-mmc@vger.kernel.org, linux-spi@vger.kernel.org, iommu@lists.linux.dev, linux-sound@vger.kernel.org, Dave Stevenson Subject: [PATCH 10/18] dmaengine: bcm2835: Add backwards compatible handling until clients updated Date: Fri, 24 May 2024 19:26:54 +0100 Message-Id: <20240524182702.1317935-11-dave.stevenson@raspberrypi.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240524182702.1317935-1-dave.stevenson@raspberrypi.com> References: <20240524182702.1317935-1-dave.stevenson@raspberrypi.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit bcm2835-dma has been (incorrectly) expecting dma addresses to be passed in, not CPU physical addresses. In order to fix this up, add temporary handling of clients still passing in dma addresses until they are fixed up. This will be reverted once all clients have been fixed. Signed-off-by: Dave Stevenson --- drivers/dma/bcm2835-dma.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/dma/bcm2835-dma.c b/drivers/dma/bcm2835-dma.c index ef1d95bae84e..9531c0b82071 100644 --- a/drivers/dma/bcm2835-dma.c +++ b/drivers/dma/bcm2835-dma.c @@ -283,9 +283,23 @@ static int bcm2835_dma_map_slave_addr(struct dma_chan *chan, struct bcm2835_chan *c = to_bcm2835_dma_chan(chan); struct bcm2835_dma_chan_map *map = &c->map; - map->addr = dev_addr; + if ((dev_addr & 0xfe000000ULL) == 0x7e000000ULL) { + /* + * Address is already in the 0x7e... peripherals range. + * Assume this is an old client that hasn't been updated to + * correctly pass a cpu phys_addr to the DMA subsystem. + */ + map->addr = dev_addr; - return 0; + return 0; + } + + /* + * This path will be updated to handle new clients, but currently should + * never be used. + */ + + return -EINVAL; } static void bcm2835_dma_free_cb_chain(struct bcm2835_desc *desc) -- 2.34.1