From patchwork Sat Sep 23 14:31:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 143955 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp279817vqu; Sat, 23 Sep 2023 10:00:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGWQPWN4UrARObgy6rSC4woptepu3xRAqoNpzSw+MRpep4t49oaH9PiKb8XYr3TX0sa/PD9 X-Received: by 2002:a17:90a:aa85:b0:274:8eda:4cbb with SMTP id l5-20020a17090aaa8500b002748eda4cbbmr1782805pjq.45.1695488455912; Sat, 23 Sep 2023 10:00:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695488455; cv=none; d=google.com; s=arc-20160816; b=eLJpyEtdUH9AqrHIrZVUfnmbzt4fGFOGYeHFM2h4kZXwGB6W/KrAhAeAMuurpvg0Tu cpuTRxwGThdSN2txI3XkbO84kp1BRO0dH0KUvZyI2lgc1zkwsyWQ8RLAzIyYWqHXUmv+ GsM/e35xGto75nMEtAD3kUgZ3HKyaG13UKa8Snyki2E/HWuSesOm0vqzLJl2iFjVmCAM 2TpbWCtGz7vFiUABb5qO7BlhiANGlEYlBbH3CIIZaI4paGgiQVID8xA0Ziq40z2FSR3I IK+K6PMUvirQbsaBrIt1LFo8JmlOGkxg2n8PKADfbo83iAUrVhwQvhN/ti6n2GDBtshq VuHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=SBL5sIpyqjQUGEFs8sBcyi3Rf1Xipk3OgAaxSlPnFCc=; fh=x1hGPnZeYvyedQGDVaFY4F5NZX5OfdEJxyYqoMYIkPY=; b=OaglmAAvJK/ZGxRQ/JlEZTbo5Rq+koJTwqubth+uy5zcbuTc04EaAWp8JFfICIS9/u sCLkPrKf7RZZdvzt2Z5M1Rm5NO36fT2WDztHnYF7p6m5L6MQTPkJHJIAEye+Y/9aCMRB ntJzq7MuwGj2EwRueI//kM72hrQdGely6rkUcU1JWQoq/MAsUNek5s0AmPR4/3Ik82pb 1roRH8eFOxj6fLyh1e0QrCjG8l6oklorOoEgV2fb6eWPfdasTgvpF7xewWJcAVinXb4O gCAs5A+jPk0a3QIGC5rRPuJ35XdcrYQ253xFByJ8t0QYErNxkFENbswSVEoNtMm3FJk/ 5Y+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=OSNX5JHn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id om4-20020a17090b3a8400b0027652885184si9208983pjb.91.2023.09.23.10.00.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Sep 2023 10:00:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=OSNX5JHn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 218A783BB7DE; Sat, 23 Sep 2023 07:32:54 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231801AbjIWOcY (ORCPT + 29 others); Sat, 23 Sep 2023 10:32:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231770AbjIWOcU (ORCPT ); Sat, 23 Sep 2023 10:32:20 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 037C5192; Sat, 23 Sep 2023 07:32:11 -0700 (PDT) Received: from umang.lan (unknown [IPv6:2001:818:e7d2:8300:2412:6733:7e63:fb46]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id B85E811A9; Sat, 23 Sep 2023 16:30:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1695479428; bh=M9/U+rgwmYjuJLbT8lvGfo8PXTj+i0WtoCKKe+50Opo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OSNX5JHnKPiUqqd/foqsemkodLQq1WWlJG8HpCZO/G2ScGsj1ai0mJTXp1HFVkbMX sfB3la8BTkGPjBfxNurZmz4CsjmPkNY7JmKISjtt7ibRhtduWzumPRgxBTcwL4wV5B 4ZTZrpxptCLY8yOVRbNI8hS34fJtGFFFWq7Ns9/0= From: Umang Jain To: linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-rpi-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Stefan Wahren , Greg Kroah-Hartman , Florian Fainelli , Adrien Thierry , Dan Carpenter , Dave Stevenson , Kieran Bingham , Laurent Pinchart , Umang Jain Subject: [PATCH v12 2/6] staging: vc04_services: bcm2835-audio: Explicitly set DMA mask Date: Sat, 23 Sep 2023 20:01:56 +0530 Message-Id: <20230923143200.268063-3-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230923143200.268063-1-umang.jain@ideasonboard.com> References: <20230923143200.268063-1-umang.jain@ideasonboard.com> MIME-Version: 1.0 X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Sat, 23 Sep 2023 07:32:54 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777848503319143536 X-GMAIL-MSGID: 1777848503319143536 In the following patches, vchiq_arm will be migrated to create and use its own bus and all the vchiq drivers (bcm2835-camera, bcm2835-audio) will be registered to it. Since the platform driver/device model internally sets the DMA mask for its registered devices, we would have to do it ourself when we remove the platform driver/device registration for vchiq devices. This patch explicitly sets the DMA mask to bcm2835-audio so as not to introduce a regression when we move away from platform device/driver model. Signed-off-by: Umang Jain --- drivers/staging/vc04_services/bcm2835-audio/bcm2835.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c index 00bc898b0189..f3ad2543d1c0 100644 --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c @@ -3,6 +3,7 @@ #include +#include #include #include #include @@ -273,6 +274,12 @@ static int snd_bcm2835_alsa_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; int err; + err = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32)); + if (err) { + dev_err(dev, "dma_set_mask_and_coherent failed: %d\n", err); + return err; + } + if (num_channels <= 0 || num_channels > MAX_SUBSTREAMS) { num_channels = MAX_SUBSTREAMS; dev_warn(dev, "Illegal num_channels value, will use %u\n",