From patchwork Mon Jun 25 20:06:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 139888 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp4386827lji; Mon, 25 Jun 2018 13:06:23 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJmJA9Ma4kcukLBlmBdTCfpBsu9WRP/xraL0L6AyuEnEwyWX3ljo0dWHF3xhErlABKg9WsT X-Received: by 2002:a17:902:3343:: with SMTP id a61-v6mr13560938plc.241.1529957182876; Mon, 25 Jun 2018 13:06:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529957182; cv=none; d=google.com; s=arc-20160816; b=o1Zxy725wrDJxbLXsKJB+d27JQC5kRBH8qhb5otfS9dnPWrPO5uZcf5SKNdEWq2HAL Z0uLe2yxruUsCmhdrfKYeMSrVkL0gCZ+CZeRshyo2I6nWKsX2Cgxp7+vtDRkqlDd6Fo0 LghDJHJQq+GhdsUGtG+IZHxoFCgWvkqNLtzTEyJDr7A8/xmHG2PQXCl48j3RYmhZO7Uz cm0ncpKbzO8W+jUyCsZeRSTYPAB7n5bhj3vHPvV7Q9IZmIeddpGf4bM1AHugvsYYzmit VGwkh9P+EvQrLFNWj/FISRgdUInDTuFFlzAPPNnyuUABMADto4ZxRsLAHvjiVKhZgOWq j67A== 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=QndvnwoOLFEz/PPR9HVV246ksdoIpO5uDePDYkrsMv4=; b=iFv+XRX7HVBbQHdK0VpFEtGUolatjzVkaNYFZxaRUWtLZjMnwH5m+D8ng7m+Uleu1y 8BpjfSHytJ0fmb21/axYtShrDOjpN07z/r2BFGJMtzBBCQXSl1T6j4aL5hhCnHGzIh9S i1Gi8GU8OTdErtG2ka3ry+2+7CcMhYX4JHyjWoocOeFh+Fm6MjhmyoYuIuVrxI5s0H0z CIEREsyMh+Ug4NLpz3aDcEG+0E6tTbb2u9jIUQPicSN2qGQsUoYD4r3M3EjVjVKTrz5M OgepXQvvuUvRrfv+6VlH2S1VkAgKjBnGhOZBEyiQP2dk/pFdpGlqpRyCyrXrdrZBwTd5 kiKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UozIUjzV; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a6-v6si12637789pgd.579.2018.06.25.13.06.22; Mon, 25 Jun 2018 13:06:22 -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=@linaro.org header.s=google header.b=UozIUjzV; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755653AbeFYUGT (ORCPT + 31 others); Mon, 25 Jun 2018 16:06:19 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:39179 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750792AbeFYUGR (ORCPT ); Mon, 25 Jun 2018 16:06:17 -0400 Received: by mail-pg0-f65.google.com with SMTP id n2-v6so3106857pgq.6 for ; Mon, 25 Jun 2018 13:06:17 -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=QndvnwoOLFEz/PPR9HVV246ksdoIpO5uDePDYkrsMv4=; b=UozIUjzVL87pGRI/2NKxPyhv2zjP7MrahYQ/Yzeq3z28OHslAa0OtadzpIaxWkATkh LumiHQ0MoYymk4Y11JZnHDGsWkKyh7NMEZrlFlEcG4GKTxZkovKpyZ5jdU5TQWffswSJ rAsSweY6LlnLQ27cW6K029xBcLD8J4e2vE25s= 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=QndvnwoOLFEz/PPR9HVV246ksdoIpO5uDePDYkrsMv4=; b=he/nsBeFcQu2+yG3n5gf647eyKaSbAhqIvTAuQ48oQUEbV7i1S8qGU7PymVlDG3WyM niQ9iwQQ5jvHB8dLPRIWEoAdnh12GG73RI/rXAzF359jmk7YycQ0n/GXhPPUH7eyMUx5 TT+kSf3zj68fbhTKqLBh3ZnumyyCz83+2zLg+ogOAvtPR2f3VdW210jzvh697DfOjiTw 9wi2BJNZ9Nu1Gj76BXhb/Stn8YlStd5EMf/JHN/PhkIEBHQEAwUOadSEzyNwdIcUKOUH TAGNyfDKgy0taTSzXif7fpI+ajWf8zmjcst9gTGuvqN08qPWAoKtfkmGa8ES6Mp0Lat8 h5Eg== X-Gm-Message-State: APt69E3PbXRkOLoLfViaZsw1U+TugSHeP9T5xZRS5mL6yBtqORMv59R8 ulKLFuC0YUKZ8z1NRR9vUoh4IA== X-Received: by 2002:a63:9611:: with SMTP id c17-v6mr11793277pge.361.1529957176762; Mon, 25 Jun 2018 13:06:16 -0700 (PDT) Received: from localhost.localdomain (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id g78-v6sm28810383pfe.39.2018.06.25.13.06.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 13:06:16 -0700 (PDT) From: Bjorn Andersson To: Andy Gross , David Brown Cc: linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Alex Elder Subject: [PATCH] soc: qcom: smem: Correct check for global partition Date: Mon, 25 Jun 2018 13:06:13 -0700 Message-Id: <20180625200613.20245-1-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.17.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The moved check for the global partition ended up in the wrong place and I failed to spot this in my review. This moves it to the correct place. Fixes: 11d2e7edac6a ("soc: qcom: smem: check sooner in qcom_smem_set_global_partition()") Signed-off-by: Bjorn Andersson --- drivers/soc/qcom/smem.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 2.17.0 diff --git a/drivers/soc/qcom/smem.c b/drivers/soc/qcom/smem.c index 70b2ee80d6bd..bf4bd71ab53f 100644 --- a/drivers/soc/qcom/smem.c +++ b/drivers/soc/qcom/smem.c @@ -364,11 +364,6 @@ static int qcom_smem_alloc_private(struct qcom_smem *smem, end = phdr_to_last_uncached_entry(phdr); cached = phdr_to_last_cached_entry(phdr); - if (smem->global_partition) { - dev_err(smem->dev, "Already found the global partition\n"); - return -EINVAL; - } - while (hdr < end) { if (hdr->canary != SMEM_PRIVATE_CANARY) goto bad_canary; @@ -736,6 +731,11 @@ static int qcom_smem_set_global_partition(struct qcom_smem *smem) bool found = false; int i; + if (smem->global_partition) { + dev_err(smem->dev, "Already found the global partition\n"); + return -EINVAL; + } + ptable = qcom_smem_get_ptable(smem); if (IS_ERR(ptable)) return PTR_ERR(ptable);