From patchwork Fri Mar 2 14:55:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 10254881 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 14EA960211 for ; Fri, 2 Mar 2018 14:58:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 05027289B5 for ; Fri, 2 Mar 2018 14:58:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ED3D4289D3; Fri, 2 Mar 2018 14:58:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 89157289B5 for ; Fri, 2 Mar 2018 14:58:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1428926AbeCBO6d (ORCPT ); Fri, 2 Mar 2018 09:58:33 -0500 Received: from mail-wr0-f195.google.com ([209.85.128.195]:34604 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1428938AbeCBO6b (ORCPT ); Fri, 2 Mar 2018 09:58:31 -0500 Received: by mail-wr0-f195.google.com with SMTP id b11so2200317wrf.1 for ; Fri, 02 Mar 2018 06:58:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=TYg/RYrUqDpMdA/1qaWvs8FJggDK9XLci+6XgJtdT40=; b=OJdX46mZp+AVvEUr4rNHeypAEoGKKjOdAYLAMneo/qdhulUR5OuqM/3tmsclovprOZ +dg4a0AecD4FnP/ndQz1EKjURl4EZsY7JSYeT8QhvuLIPm3PLzQymHvLvZ4Y6I8ExE/V WgEg6D+u7sbzL2Bi7vSE1EzStbxSCYMR3edw0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=TYg/RYrUqDpMdA/1qaWvs8FJggDK9XLci+6XgJtdT40=; b=J88Z3OOITnjkyZNlXJpI8VQmPuw4ctn/g2CZaki3ufFhODyQ/R9FPulSsSHY4eMTAo ay5fy7qokg1kHlaSUfyQ3/XZNm4i2lPWsMMMtqGB6OeiUykb1esAjBsLFFpXlc1xTETU 5IPQC7UPxQvplHK5MALyiO41d4Nkj5e+kYoU8hx51yY7IBVCBOItG+xE9y0zZzTiCIt5 1SRub0ARxK4UBoh1gNjzIanGdihxCgOaqVgekJAnlD6FHFV93BzP7XGkKl7YDo2UDgke n/2HQubUq+x2sd+VMXn/pZtqcPV8iWKQ6AhFSbQxuyfjY6njtSpqTM/nexjubarGpnJa fl7w== X-Gm-Message-State: APf1xPDa3/yCELB3PWpmavklkfjEAFcpJcD3HtRRoTWj92pO5C7WDk7j DpMeR/kKB03cn0ACtYpT5pQErw== X-Google-Smtp-Source: AG47ELvLjxs5I8L2PvIt1zn1tqY7q/BIkhMHms6FVLLSDFzAgpg36JSdKFn5mxWVSFelS6zQ7Up8SA== X-Received: by 10.223.170.78 with SMTP id q14mr5041859wrd.271.1520002710427; Fri, 02 Mar 2018 06:58:30 -0800 (PST) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id b68sm1483168wmi.30.2018.03.02.06.58.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 02 Mar 2018 06:58:29 -0800 (PST) From: srinivas.kandagatla@linaro.org To: will.deacon@arm.com, robin.murphy@arm.com, bjorn.andersson@linaro.org Cc: joro@8bytes.org, ohad@wizery.com, linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-remoteproc@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH 3/3] iommu: armsmmu: set iommu ops for rpmsg bus Date: Fri, 2 Mar 2018 14:55:31 +0000 Message-Id: <20180302145531.20463-4-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180302145531.20463-1-srinivas.kandagatla@linaro.org> References: <20180302145531.20463-1-srinivas.kandagatla@linaro.org> Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Srinivas Kandagatla On Qualcomm SoCs, ADSP exposes many functions like audio and others. These services need iommu access to allocate any memory for the DSP. As these drivers are childeren of rpmsg bus, able to allocate memory from iommus is basic requirement. So set arm smmu iommu ops for this bus type. Signed-off-by: Srinivas Kandagatla --- drivers/iommu/arm-smmu.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index e6920d32ac9e..9b63489af15c 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c @@ -53,6 +53,7 @@ #include #include +#include #include "io-pgtable.h" #include "arm-smmu-regs.h" @@ -2168,6 +2169,10 @@ static void arm_smmu_bus_init(void) bus_set_iommu(&pci_bus_type, &arm_smmu_ops); } #endif +#ifdef CONFIG_RPMSG + if (!iommu_present(&rpmsg_bus)) + bus_set_iommu(&rpmsg_bus, &arm_smmu_ops); +#endif } static int arm_smmu_device_probe(struct platform_device *pdev)