Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3586247imm; Mon, 4 Jun 2018 06:11:53 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK6hVYy2DHrBi63wAqk0eVbAZyZpCPQFT+iWDYMr2vNrStV/jlpmOFi8o+Wllhz1EIQSchz X-Received: by 2002:a17:902:d20c:: with SMTP id t12-v6mr21729605ply.364.1528117913702; Mon, 04 Jun 2018 06:11:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528117913; cv=none; d=google.com; s=arc-20160816; b=X/B+KH/heR9EIrS0NxMG30TbMafd5WdYSrPRC57nXhLJ4bc4fTJDdAeszT4mC9LBGk 5A9esc3PpXVNbM1PBzt5G3t1XBW1vEepEiCJWkYv9v34PCYnaizdgVbPsNgOZrkQNvy+ T+Rl/I74MIrapFk6mSOzBPhG6J8F7DAl9/nFYsZXLuSwYFIMEFdy9IIAZIFnfMY/3jiB zPp457LtuWd+tChja1x7RWP+qDQAoN/1mn8csP30i956S4oVz78Y06AdvlFcoWzNEkBP CvvokkmXRNPIY6QhqFNtOgEqpsAIAPFVQl0ycAODYzVCArF2+UFVtf6v0fbnMpx7Iy2a wkOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=zB8XLWs/zMXLzhdfQLZEH1+SKmZ0Ilb6ghBb02jYP6c=; b=OXwxefpSWT8VX8vf4e7qFliVMJI3Em7CDGVeZkkPrUP+H6ILfkB7kdblAuwanHKM2f Q8oErwXDQEnTSOl9vRwAXulZvuaBLv7WXoIO0VEvgknIeIuAEK3y/C8CM7iW97ozLTf5 ry3ntSqu6PNu5aO6iFn2MfcEEhB+fqhswC/7jj9Izne9RYF4UZRC/oGsA66fwg4l3qLa cQwRGNRGEiyE81v8Odt+tTbfP3EA6hTDqmHUHsv3MppSW4O13igPXEVS4RGIKtBpn3s+ 2sMY4W8JtCw9jmxfzNfSTeRPQKvZ42xKHYWR+BJqiKXdKPVQJDQI1tiWO7mBrKfmYmMq ysiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=LHLw9rYf; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bh1-v6si45161377plb.481.2018.06.04.06.11.38; Mon, 04 Jun 2018 06:11:53 -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=@chromium.org header.s=google header.b=LHLw9rYf; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753171AbeFDNJX (ORCPT + 99 others); Mon, 4 Jun 2018 09:09:23 -0400 Received: from mail-vk0-f66.google.com ([209.85.213.66]:41964 "EHLO mail-vk0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753154AbeFDNJU (ORCPT ); Mon, 4 Jun 2018 09:09:20 -0400 Received: by mail-vk0-f66.google.com with SMTP id 128-v6so14587042vkf.8 for ; Mon, 04 Jun 2018 06:09:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zB8XLWs/zMXLzhdfQLZEH1+SKmZ0Ilb6ghBb02jYP6c=; b=LHLw9rYfIjbL9XA+IH9NSKSl2ckC4m3qvZ4cD+iRRgRNZy+sYC91F+5hnYN3E0P1or +fYOKuuW61fJ/4mC2gcsrS85kg/hsFttcKwpHzrQs4QQ4om5umZRg4xftRoLtbGGdU0U dzfZxnwB10jXnCgmS7g+8qSXHN6oYF0790jZ4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zB8XLWs/zMXLzhdfQLZEH1+SKmZ0Ilb6ghBb02jYP6c=; b=Z7p4Fi9EM6+vrwT7GVpVrxEkNsE0alE7hcFvn4gF/sEUo9t4Bo0fU2Cls3+sFgsxgd hmPMIrgsUtp4WQL8UYIttj6J85QLeHs6GczUooXfRUKZ9N8jY4jUynbSCqrEPjHf+XiS iQXB8hdRtDq1RMwA7md9B859TU6YNx4huqDMA8yMm2Era2XEV2WbOtjPEMqKnJ9MtTXl pRdLlmx516iX8OChepzpUEdRi5mK5DKbydAcTqZXj7h5QuDl7O/+dUIRLrNsgbhVV0H3 0UYdOcWJuOJw9d3Peu6G7BhYxKfWsZ5wi80gClabMrWJhXYQKfwVWEsOEcJalD/K32Mi 4doQ== X-Gm-Message-State: ALKqPwd17xDK71MixGfwMQIN6OfPuYZc35r96qcB5SaIFQ+fcKyUS2u/ 3uQDMgT2YDG/PgHQ3MUIklI/Xk/KK/g= X-Received: by 2002:a1f:dbc3:: with SMTP id s186-v6mr13924783vkg.0.1528117758753; Mon, 04 Jun 2018 06:09:18 -0700 (PDT) Received: from mail-vk0-f54.google.com (mail-vk0-f54.google.com. [209.85.213.54]) by smtp.gmail.com with ESMTPSA id j9-v6sm5805868vkf.29.2018.06.04.06.09.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Jun 2018 06:09:17 -0700 (PDT) Received: by mail-vk0-f54.google.com with SMTP id 128-v6so14586914vkf.8 for ; Mon, 04 Jun 2018 06:09:16 -0700 (PDT) X-Received: by 2002:a1f:4843:: with SMTP id v64-v6mr5314111vka.97.1528117756521; Mon, 04 Jun 2018 06:09:16 -0700 (PDT) MIME-Version: 1.0 References: <1527884768-22392-1-git-send-email-vgarodia@codeaurora.org> <1527884768-22392-5-git-send-email-vgarodia@codeaurora.org> In-Reply-To: <1527884768-22392-5-git-send-email-vgarodia@codeaurora.org> From: Tomasz Figa Date: Mon, 4 Jun 2018 22:09:05 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 4/5] media: venus: add no TZ boot and shutdown routine To: vgarodia@codeaurora.org Cc: Hans Verkuil , Mauro Carvalho Chehab , Rob Herring , Mark Rutland , andy.gross@linaro.org, bjorn.andersson@linaro.org, Stanimir Varbanov , Linux Media Mailing List , Linux Kernel Mailing List , linux-arm-msm , linux-soc@vger.kernel.org, devicetree@vger.kernel.org, Alexandre Courbot , Will Deacon , Robin Murphy 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 Hi Vikash, On Sat, Jun 2, 2018 at 5:27 AM Vikash Garodia wrote: [snip] > +int venus_boot_noTZ(struct venus_core *core, phys_addr_t mem_phys, > + size_t mem_size) > +{ > + struct iommu_domain *iommu; > + struct device *dev; > + int ret; > + > + if (!core->fw.dev) > + return -EPROBE_DEFER; Is it really possible that the device appears after the probe is retried? > + > + dev = core->fw.dev; > + > + iommu = iommu_domain_alloc(&platform_bus_type); > + if (!iommu) { > + dev_err(dev, "Failed to allocate iommu domain\n"); > + return -ENOMEM; > + } > + > + ret = iommu_attach_device(iommu, dev); > + if (ret) { > + dev_err(dev, "could not attach device\n"); > + goto err_attach; > + } > + > + ret = iommu_map(iommu, VENUS_FW_START_ADDR, mem_phys, mem_size, > + IOMMU_READ|IOMMU_WRITE|IOMMU_PRIV); > + if (ret) { > + dev_err(dev, "could not map video firmware region\n"); > + goto err_map; > + } I'm not very familiar with translation capabilities of ARM SMMU, so that might be an elementary question, but could you explain how this works? Will this make the firmware device (transfers with firmware PASID) use different page directory from the main device (all the other PASIDs; used with DMA mapping API)? +Will and Robin, just in case. > + core->fw.iommu_domain = iommu; > + venus_reset_hw(core); > + > + return 0; > + > +err_map: > + iommu_detach_device(iommu, dev); > +err_attach: > + iommu_domain_free(iommu); > + return ret; > +} [snip] > diff --git a/drivers/media/platform/qcom/venus/firmware.h b/drivers/media/platform/qcom/venus/firmware.h > index 0916826..67fdd89 100644 > --- a/drivers/media/platform/qcom/venus/firmware.h > +++ b/drivers/media/platform/qcom/venus/firmware.h > @@ -14,10 +14,15 @@ > #ifndef __VENUS_FIRMWARE_H__ > #define __VENUS_FIRMWARE_H__ > > +#define VENUS_PAS_ID 9 Shouldn't this normally be given in DT? Best regards, Tomasz