Message ID | 20240524182702.1317935-11-dave.stevenson@raspberrypi.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D3A04C25B79 for <linux-arm-kernel@archiver.kernel.org>; Fri, 24 May 2024 18:29:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=dpa9yJWTxVv5drBlP/U6Vfj7NYXJOgdTDzNLSBVoWms=; b=Xh6RAIXySkU0Qd np+Q+s+bTLJr3tT/w/Xkpz1Fh2nm34PRNGzJLd67DSbCvhSiEaw4RDfJVGkXIajwRaa9pfcgbyC00 Gv3YxKqk8SDzCm4gNzKFAIKZKSElm7qB+CUGpZJgd9X7RaPX3eOjF1QWDu1tD3pVQmbXG4BS9oGsh ucrfCzMCSHs8WDxqDdKzZQgcM+lL09Vx2FoBidk+p8VvhpUaD9z6O92Smz3YRN2djb6kOj9xLVQ2w 6byGKb7oZgvwDjPD+7XXkEb6dZEHCvNEx1AyHi0ZaSWymSsk5KtXhdFDQuQ5OWCr6Kn1dq771USyw RiGnTcRB/wosBayT8mYQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sAZfH-00000009a5S-3zdX; Fri, 24 May 2024 18:29:15 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sAZeB-00000009ZGt-1cqe for linux-arm-kernel@bombadil.infradead.org; Fri, 24 May 2024 18:28:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=FsDDNY/QwJvf47dmHC7PRu5uL7JEaRYA48sLf9OqOOY=; b=S9iU/4pN0QHG8g7goJqZxTQpYg gbKO35wKY3oMzZJWHw/pecpdLQu3gEmHBS1TRkUkkiDy9xO+xrme8TXTF0gLCUWFxsU6tu7vKj5dX 6xCtjIYpz1J64pk3tUjePwr0UYTUrBeppezW0XvWUjzMJuLgPtfMDjM5ElyxAU/3ZLDwHViZLJE5e g+W05aTmvNoik6zf6zTyyjWLqXeNG4EmW9lRC7ag7zfJoadRjhYyVRP1rIlQXgPkPOCNbN5oj1bir kWlilsPjKlmicYcJTurJgL8G9SFyZKYhsjJcxnIi4gtw2QSC73tCKBl90G18Br+z1H315MUiqoThF ecdu3QVA==; Received: from mail-wm1-x361.google.com ([2a00:1450:4864:20::361]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sAZe4-00000009vJ4-177u for linux-arm-kernel@lists.infradead.org; Fri, 24 May 2024 18:28:05 +0000 Received: by mail-wm1-x361.google.com with SMTP id 5b1f17b1804b1-4200ee78e56so33901735e9.3 for <linux-arm-kernel@lists.infradead.org>; Fri, 24 May 2024 11:27:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1716575277; x=1717180077; darn=lists.infradead.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=dNUqCJRxwTTjz4NoOMorUeQWAU39+pNW9fYsd2X6o7YkZx/9xDeTX/i6zF9eJOuD7Z 3uBHeulIMkR4d2bwTncD7qcDRNN2PwY8f4PMTRIduWh8a7XoXMygTWIZN+9LGrPNR5EX 8gwapH3rxSa5vP5s7GVCXBD8vNfSaNkYQVuimfD/Tek9HxkEXLU2Pegf9gGqg78RPpBB Oieoby+tWd41PzU9e8DfGstpt9NmPxAjb97wql0AUgjUcBGhxmJKffWbaf1gu97z8rLn 08BQObggMrPy5CHTr/xputymeh7YBZZye0j6R6rLnW195tZxMauNPb/5kn1Ns8VycziR d2Sw== 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=umeEbgPVhpAZdkA/Cd1op01pYBsXzRJZEr9LpMaCfguaFTQ6OI0rCEqjq1L8cEo0B5 4zbKMUHnDUqBBS1EcyCTlnxPcfsxhcoVHiIQZ4SyzgL0itBT+9o27gS6khTMBJuNNtYc rHg1gUDgn3/sG7H+j1NOwT2KBSDLqHyYcXmcuCZaQtjNzZvftDxPkYYXOzadh7HIbOlS b+MAvukXsSkvc5SVC+Gud4mdtbGm9n/tMQxzmaVytv/rn9dUtQzLytq9lOw+QEIfxjLP FMuLkjmvwKctqdH58IvSsQvGtj0P6ew8/qqNPtNyY8c9LiyiEaJp4V5RYFDU/gJCehCJ pMhw== X-Forwarded-Encrypted: i=1; AJvYcCWTFqxyNVzUdVigkJwLEBbJhUt3p9bAosdF94f06lKv0QNowSoGILA3EX8QYsY+HWdgZtfDpSysVUZAgUmVVvv0lfFgF14Gn4KA0MgEx3uARVRmlt0= X-Gm-Message-State: AOJu0YzlH2QZrK9yJbvlMhjwIJnOWt04ulK+XDP0jJxvh2QtDE7cFw/K BDAMiKs3/cUiL93KYx9LqeuqkuIzt0UvpELdB7Mmu/U8FINtKizO2+SNDXEpEdPKH87zEyDktbp HuAeuhEzWWTiFC1zyd5h6ARyBP8Qo+3fa X-Google-Smtp-Source: AGHT+IEXHyAwczg+VXo+M67fY0mVhzt5oPk36AjtQ9lYPMdZoLz7U9U+HdeHdCJz5d472HFdCSVQwmE4fQK0 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 <dave.stevenson@raspberrypi.com> To: Rob Herring <robh@kernel.org>, Krzysztof Kozlowski <krzk+dt@kernel.org>, Conor Dooley <conor+dt@kernel.org>, Florian Fainelli <florian.fainelli@broadcom.com>, Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, Ray Jui <rjui@broadcom.com>, Scott Branden <sbranden@broadcom.com>, Vinod Koul <vkoul@kernel.org>, Maxime Ripard <mripard@kernel.org>, Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, Thomas Zimmermann <tzimmermann@suse.de>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, Ulf Hansson <ulf.hansson@linaro.org>, Mark Brown <broonie@kernel.org>, Christoph Hellwig <hch@lst.de>, Marek Szyprowski <m.szyprowski@samsung.com>, Robin Murphy <robin.murphy@arm.com>, Liam Girdwood <lgirdwood@gmail.com>, Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>, Vladimir Murzin <vladimir.murzin@arm.com>, Phil Elwell <phil@raspberrypi.com>, Stefan Wahren <wahrenst@gmx.net>, Serge Semin <Sergey.Semin@baikalelectronics.ru> 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 <dave.stevenson@raspberrypi.com> 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> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240524_192801_031797_9A25A94C X-CRM114-Status: GOOD ( 15.93 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
BCM2835 DMA mapping cleanups and fixes
|
expand
|
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)
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 <dave.stevenson@raspberrypi.com> --- drivers/dma/bcm2835-dma.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-)