From patchwork Wed May 2 01:10:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 134801 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp123779lji; Tue, 1 May 2018 18:10:30 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoSVXn8oTYHL/2wTDbgy6OsKfb2ujFPy8zL+1lyd4hAPK1zTCGsj2U5kE3/W4QJW0yfDD6E X-Received: by 2002:a17:902:9a8b:: with SMTP id w11-v6mr18145652plp.75.1525223430741; Tue, 01 May 2018 18:10:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525223430; cv=none; d=google.com; s=arc-20160816; b=D35Mc6pKlXBAmWtVALdr/DjuatHMgRQpLENMWpgZQQK16UDpCgMvAZVu5lzLIbSVJ5 b9+gt0jBIiCmNPZ0GNS7R+WUOsEtPQ0xrfoRjpp27tOEASwBZFdrMqwYqTEHz3cHzkqq xTGvYmxExCrqrbMS2Q9j4BKF4RY8x4DWjhMt7WXL8OUskYnMvxWb8grxZ5LIKbxrdIsY NI3yk/FzmMtchGYsrTzUceBSRHx2B8Oy3WMJ2iIn3XhpahyN//88i55hbnpFSVCiRz6V 870javKP1Cr9tq9HTrxC1u5W06E03KFcQqtQpjSKlVFcKdvKPfHVgdqA4K+1L1frC1va L8jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=NXWRoKIdpnrj785oSBqPbRcXFbdnBDzENPKHROv9QQQ=; b=LgyxWWdyNwTo+i/tN66FEHprFeC2jkS4HlbTm3+0rkWQ4hOlrptbmIq0lbthhHDOA/ KNzXI0+FoQbbSv7LCZ/oiXNswKovsQpsJlf37zqiOa3QUCGbL1tV/OETMvPEqonKHuQi zt/iz7NSqVl7Gomw9K4U42Zpo7IgRtTGRTst8IPYBRZcZuC2x4M5ackMDCPOTEzrqKyk o+hyGjY/5I1Xe04rFt9ALSkgkVM3ruuh5cgGrIp5cmpstZgsUccIHFMqDB/doZbGJcUk TP1xolZ2Rw+Rf2iXORDezjAUXm2ESvbFVWB3Qmjyft2fIe1UZZaF0SY9l2mA8bkr7+xs b9Jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=kur5zoj+; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x17si10356359pfm.330.2018.05.01.18.10.29; Tue, 01 May 2018 18:10:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=kur5zoj+; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750859AbeEBBK2 (ORCPT + 12 others); Tue, 1 May 2018 21:10:28 -0400 Received: from mail-it0-f68.google.com ([209.85.214.68]:34781 "EHLO mail-it0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750785AbeEBBK1 (ORCPT ); Tue, 1 May 2018 21:10:27 -0400 Received: by mail-it0-f68.google.com with SMTP id c5-v6so12732885itj.1 for ; Tue, 01 May 2018 18:10:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=QZvmvWRcRt7tzMIQwqdc65ZYEm3SZCHFT+PkrjqTZlE=; b=kur5zoj+e38cgFfsAZr2jxUrZWn4qybtcHlZJYvAVi7U3yZqbu4LWaTcM/jMgue2su 4Mcjom6pcEqU+aL/8gNXFiv08aUgLYQQI9o0xJL1VBXcdEZfcw5t12RkS4/mp2KdvL8I Gwoh1U1EQOdugOu59HsG4Vtvl5qdj9TYdjWV8= 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; bh=QZvmvWRcRt7tzMIQwqdc65ZYEm3SZCHFT+PkrjqTZlE=; b=CAFXbaJnA93S9HpfL14Bt3HY2UpXiJ+f9uKZf9rNf/A8mv6Pn9g8gW18fapT9QqXK6 wPqOkfVQ8aoCuR6W99nafdRjcm6Xj4yI6gPCedZiMEky4adkguN4JOVCIEqLmj6DIiE4 GMYc/mY/wVA0rKPVhGfUlBSy+uLsb0JvQY3JfKVIs91CvEaS5SdeyABuhlSuCX/9PCaU fF+nkIWPhC8PC3xSz9nvJhadLcoJ5QztUaKhF8Xh4cHsoUhjIGJ2UYnAWA8QC4ioc3nH 229Eqm2U7jjSwJSPQqIT7gE8ujNyJEMOqqnjQLxt9FsXnUo2MWST+k8pDw3T2P0FW8S9 jpyQ== X-Gm-Message-State: ALQs6tC/DzOPPgvM78GxYBQI9FM/FV4aNYInJ4rx5nZ/RHK0nD9u++un vgnf2i3d1gHR7weeddk11AkE5w== X-Received: by 2002:a24:b517:: with SMTP id v23-v6mr3769876ite.63.1525223426895; Tue, 01 May 2018 18:10:26 -0700 (PDT) Received: from presto.localdomain (c-71-195-29-92.hsd1.mn.comcast.net. [71.195.29.92]) by smtp.gmail.com with ESMTPSA id g200-v6sm2082479itb.26.2018.05.01.18.10.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 May 2018 18:10:26 -0700 (PDT) From: Alex Elder To: andy.gross@linaro.org Cc: clew@codeaurora.org, aneela@codeaurora.org, david.brown@linaro.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 00/12] soc: qcom: smem: some refactoring Date: Tue, 1 May 2018 20:10:07 -0500 Message-Id: <20180502011019.22812-1-elder@linaro.org> X-Mailer: git-send-email 2.14.1 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org This series contains a few general cleanups in the Qualcomm SMEM code, reorganizing some things so memory partitions are treated more consistently, and to avoid some duplication. A few patches change existing behavior, as highlighted below. Each of these changes has been tested and verified to function with available hardware. -Alex Alex Elder (12): soc: qcom: smem: rename variable in qcom_smem_get_global() soc: qcom: smem: initialize region struct only when successful These two are simple cleanups. soc: qcom: smem: always ignore partitions with 0 offset or size This patch makes partitions with a zero offset always be ignored. Previously this condition was flagged as an error in one place and ignored in another. soc: qcom: smem: small refactor in qcom_smem_enumerate_partitions() This just simplifies a little logic in one spot. soc: qcom: smem: verify both host ids in partition header This patch makes it so *both* IDs, not just one or the other, must use the special value SMEM_GLOBAL_HOST to signify the special global partition. soc: qcom: smem: require order of host ids to match A memory partition is described by an entry in a partition table, which identifies two hosts permitted to access the partition. A partition also embeds a header, which also identifies the hosts. Previously the host ids could be in any order; now the two host ids are required to be listed in the same order in the partition table and header. soc: qcom: smem: introduce qcom_smem_partition_header() soc: qcom: smem: verify partition header size soc: qcom: smem: verify partition offset_free_uncached soc: qcom: smem: small change in global entry loop soc: qcom: smem: verify partition host ids match These patches together introduce a single function to locate a partition header in memory, and to validate its contents. The common function is used in two place and removes some duplication. The patches build up the function in steps to facilitate review. soc: qcom: smem: a few last cleanups This patch gathers a small set of trivial cleanups. drivers/soc/qcom/smem.c | 173 +++++++++++++++++++++++------------------------- 1 file changed, 82 insertions(+), 91 deletions(-) -- 2.14.1 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html