From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Boyd Subject: Re: [PATCH 4/6] qcom-scm: add ocmem support Date: Thu, 1 Oct 2015 14:52:36 -0700 Message-ID: <20151001215236.GL19319@codeaurora.org> References: <1443556138-21085-1-git-send-email-robdclark@gmail.com> <1443556138-21085-5-git-send-email-robdclark@gmail.com> <20150929213800.GC18556@codeaurora.org> <20150929223312.GA30885@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from smtp.codeaurora.org ([198.145.29.96]:50686 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750794AbbJAVwi (ORCPT ); Thu, 1 Oct 2015 17:52:38 -0400 Content-Disposition: inline In-Reply-To: Sender: linux-arm-msm-owner@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org To: Rob Clark Cc: "dri-devel@lists.freedesktop.org" , linux-arm-msm , Bjorn Andersson On 10/01, Rob Clark wrote: > On Tue, Sep 29, 2015 at 6:33 PM, Stephen Boyd wrote: > > On 09/29, Rob Clark wrote: > >> On Tue, Sep 29, 2015 at 5:38 PM, Stephen Boyd wrote: > > > > Yeah I think that's the only use to indicate which context bank > > it is. Maybe we can have a single id configure API and a special > > iommu context bank API that both funnel into the same private two > > number API. Otherwise we have a bunch of callers passing 0 for > > the second argument because they don't care. > > so fwiw, I went thru all the downstream scm_call() callers.. there > are a lot of callers to SCM_SVC_MP service (through a couple different > #defines), but most of them are different cmd-id's. The ones using > SECURE_CFG (0x2) are: > > * dwc3_msm_restore_sec_config() > * ocmem_restore_sec_program() > * msm_iommu_sec_program_iommu() > > so we have two points passing in zero for ctx-bank, one that does not. > I don't think it is worth having two API's to save hard-coding zero in > two places ;-) > What sources are you looking at? It seems like whatever you have is over a year old. About a year ago, we consolidated all calls to this specific SCM call into a single API called scm_restore_sec_cfg (see commit 9933a272db9a5612bcc2ee0ef9149f70c8166eb3 "qcom: scm: Provide an API that restores security configuration" on msm-3.10). Looking at our latest msm-3.10 branch I see drivers/crypto/msm/ice.c: ret = scm_restore_sec_cfg(cbuf.device_id, cbuf.spare, &scm_ret); cbuf.spare is 0 here. drivers/iommu/msm_iommu_sec.c: ret = scm_restore_sec_cfg(drvdata->sec_id, ctx_drvdata->num, &scm_ret); This is the only real user of spare drivers/pci/host/pci-msm.c: ret = scm_restore_sec_cfg(dev->scm_dev_id, 0, &scm_ret); drivers/scsi/ufs/ufs-qcom.c: ret = scm_restore_sec_cfg(cbuf.device_id, cbuf.spare, &scm_ret); cbuf.spare is 0 here. drivers/soc/qcom/ocmem_core.c: rc = scm_restore_sec_cfg(sec_id, 0, &scm_ret); drivers/video/msm/mdss/mdss_mdp.c: ret = scm_restore_sec_cfg(SEC_DEVICE_MDSS, 0, &scm_ret); So that's 6 callers and 1 uses the second argument. -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project