From patchwork Mon Oct 14 07:07:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 176132 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp4141492ill; Mon, 14 Oct 2019 00:08:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqwZjSoVBmBBioIqY1nTLMXO2xyYrEl8fHbVMm3A2zhDNnxdsmAkTImTYayMGQoEU3Lazbwr X-Received: by 2002:a17:906:1911:: with SMTP id a17mr26801653eje.14.1571036906964; Mon, 14 Oct 2019 00:08:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571036906; cv=none; d=google.com; s=arc-20160816; b=sB4SGYixJVsiQLWfMO4wBNR7zSi2oudLG157e8VQSOduDdJgcK8ln5RvblIVVq8TeR 9Hc9I0k1W084WLAmNQcSBpjShdbNBuEdZc0l1DC73xvDWP97J9dslsiIgKJhqnX8ughU RZ6F21iB/XBUAz3J0OJ/26J7E9Vbxo3XW43iFLIWIXmQBZ4W3rbGEbh2PDtNmXiLCwYq ym4nPPTkcWdrEvpDicJyk4dC5Z5S//NEIp4g7iIwTsiq7aV5QVYhumCDpNaGTUcTq02T 1SuA1zzAuHPHWQJZk7KqH/pOapSDJOUfJqSLHHyZRqkZFX9aWEXbq6shqLSox+juYmQn 4+JA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=1ydsP1Cp9s0wk741A+j1HGA3H7t+pJBn7+BclAM8H+M=; b=C14NAGijaCcQBJecBcyksOmUBtwnb5aBTj72TfpiquRxZV6GeZvBMYD/1Y9zO+Nzl2 wKjN1PxpWS1LlRMuyMZ8iTUOqwTObBfsHkeoT20zRhImBCsbez6hOR2MIvm/EPx3RHw8 tGNzRl269t7scwG/Ito9EndriVFCiLAKFHIacMKffh/FkoXxL+lVjkqo7MBfj3ecdC15 KQ8mbcJb6WONPWVB1yuDV/Gpp7C7OpVQ4TfEAQK5nF5Ro5WKydvJwjMg33agnk2NzC3S wmHtwBEbIGpXMy2/bTM6Ju3kjUdApFhFeNR5mEdV5d7g+PpGpOiVoGsEg4s3gdNDuo8o n8jA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kahd71I+; 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 t18si10584853ejr.205.2019.10.14.00.08.26; Mon, 14 Oct 2019 00:08:26 -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=kahd71I+; 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 S1730271AbfJNHIU (ORCPT + 10 others); Mon, 14 Oct 2019 03:08:20 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:34634 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730263AbfJNHIU (ORCPT ); Mon, 14 Oct 2019 03:08:20 -0400 Received: by mail-pf1-f195.google.com with SMTP id b128so9872190pfa.1 for ; Mon, 14 Oct 2019 00:08:18 -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:in-reply-to:references :in-reply-to:references; bh=1ydsP1Cp9s0wk741A+j1HGA3H7t+pJBn7+BclAM8H+M=; b=kahd71I+jydL8AwtKPA5jqJIFN6xTV+kelQ8RxPi/IoS5FJswOPifHzuka0ajgk84D Tu/kAVwgphcFPtLaj+ifYHJt6yGsuDBOZ9YiNQIiRoVQYgrzloEfXdpt7jEJvjvQigkC 7J224xdekYFogIev6qsKXWkQLj8f+B/jIWJRAeOiE5dmZSmnQyTZ29/sT5qNyrrmNm/X MiX7W3pwbwf4mckEbkQBSzTufBV4PzkHHmtN6LMVL223bCC1b5NkoQ2+YKnGWwdggELX QQZcbbRER3Lpt9PjdGQPnB6IVsyfV6hpzC/LfZ6670MitRmRNIJPiMNunqSEpw0pdfli WneA== 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:in-reply-to:references; bh=1ydsP1Cp9s0wk741A+j1HGA3H7t+pJBn7+BclAM8H+M=; b=XI9y7tZQtFHmgOcfULDLySAfnBS8ceBsm5CKDuatrS6Leq1x1mIaQpFd8thZTwlpE6 3m/qjyF2KxCSep8zkJ/AQAFUT8DrABO+qoBG7vof70IBhJ8gQXFFBIsb4Jw5j6kjX980 ot1cnmq2IbSSpovws1U+fFyoiNbkf1/OmMq3FVZkPzmgjSDnEA7Yu/kFl+7RD51x9HEM WJyR3UsIBAu3jHuybdZFFBCLELayceRo6vQJGeIjW0Qz0kYwEuYRkGOQ1rMcvTuur3cy AFBcaED3tWhnblM5SZa6qsqT7kce4QhB7ycCFkAEr7P92KLwsmW203k8PCZOyzUG37IX qbUA== X-Gm-Message-State: APjAAAVGfDq2gh7ntRs7+5yiStXFmv4nGgbaIdeUm1io0kpAYs3YbtXH 3z9lyBm9hBilfPwpLaFK1SrSYw== X-Received: by 2002:a63:5022:: with SMTP id e34mr15455176pgb.400.1571036898239; Mon, 14 Oct 2019 00:08:18 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id p190sm20619948pfb.160.2019.10.14.00.08.14 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 14 Oct 2019 00:08:17 -0700 (PDT) From: Baolin Wang To: ohad@wizery.com, bjorn.andersson@linaro.org Cc: linus.walleij@linaro.org, orsonzhai@gmail.com, zhang.lyra@gmail.com, baolin.wang@linaro.org, linux-arm-kernel@lists.infradead.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/4] hwspinlock: Remove BUG_ON() from the hwspinlock core Date: Mon, 14 Oct 2019 15:07:43 +0800 Message-Id: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The original code use BUG_ON() to validate the parameters when locking or unlocking one hardware lock, but we should not crash the whole kernel though the hwlock parameters are incorrect, instead we can return the error number for users and give some warning. Signed-off-by: Baolin Wang --- drivers/hwspinlock/hwspinlock_core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 1.7.9.5 diff --git a/drivers/hwspinlock/hwspinlock_core.c b/drivers/hwspinlock/hwspinlock_core.c index 8862445..a22e252c 100644 --- a/drivers/hwspinlock/hwspinlock_core.c +++ b/drivers/hwspinlock/hwspinlock_core.c @@ -92,8 +92,8 @@ int __hwspin_trylock(struct hwspinlock *hwlock, int mode, unsigned long *flags) { int ret; - BUG_ON(!hwlock); - BUG_ON(!flags && mode == HWLOCK_IRQSTATE); + if (WARN_ON(!hwlock || (!flags && mode == HWLOCK_IRQSTATE))) + return -EINVAL; /* * This spin_lock{_irq, _irqsave} serves three purposes: @@ -264,8 +264,8 @@ int __hwspin_lock_timeout(struct hwspinlock *hwlock, unsigned int to, */ void __hwspin_unlock(struct hwspinlock *hwlock, int mode, unsigned long *flags) { - BUG_ON(!hwlock); - BUG_ON(!flags && mode == HWLOCK_IRQSTATE); + if (WARN_ON(!hwlock || (!flags && mode == HWLOCK_IRQSTATE))) + return; /* * We must make sure that memory operations (both reads and writes), From patchwork Mon Oct 14 07:07:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 176133 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp4141509ill; Mon, 14 Oct 2019 00:08:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqzC12YlCFTt59IdKoyfkwuUhVeneH+ds5PxpbcnOptKx2CeczlwsLELUrkQdTwrERyvNpIA X-Received: by 2002:a17:906:130c:: with SMTP id w12mr26585006ejb.142.1571036908013; Mon, 14 Oct 2019 00:08:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571036908; cv=none; d=google.com; s=arc-20160816; b=bxylKo78I9tkS1vK1TzaA/FV68aDoHR2e2K4t7IH2JpHFKIz+JSpAtwa+v58SX1yP+ gvf5KU5A6sWMqzU/OsEWyWLFlHNpbtrjfrYlMlXidbgRsEIQZ2PgHW6pRvBX1jqwEz1X 2Fj9Guv6qqykcYgGBAlVtTOsGuVrcNEke82ZODwCJ7Gyh17k9RzvqVnjpzlrXrv73otz 2i2Z/jP/6AuB5CP8VZejhpiSmr0y4CSgdRhdTdU6YxdCdgeGAhHjdD14+D6s47U8SJ53 wpc1EdvRj1yLeAt0ZLP/P0yfHm1mRrW3OeGtsDdBL4255eD4BVUOD00CoaaI4GoU7QBy gYBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=c0QsMwW5/HlkG+EyBzY3CChBE/BthJe1X9zmk8IUDUw=; b=ooC2kju3A0PkGQm4xSmDqju7b4jK7GPGDQ5LdNuwqzBMt4DaMCkbV7oA2b5RCx6vIx pdck4HOKA5BNCG8CGecSg5IpOCCUZcQT7O8wM/0bIXtfaXGfhVzoHAFVr93K2BTiUfKf 483p2GRgzo3yTBkJLEfs8JMF4xBPysW0zj78gikhMajEiIiVGBur7Wbsni54m3A45VwP TZBU6MmLpNRp9KQP94H2II4DTWqmoUKlYVNLw/zayo5rsjgegihBKEJrGL4qymcL9J4f HOcqGtgsMevj2WnzpdNV18XZhdniMLRm4J+1y9+CpC2islrYRf9kkAnb0EbIUjFyZAaf XZgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ro6DrO1F; 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 t18si10584853ejr.205.2019.10.14.00.08.27; Mon, 14 Oct 2019 00:08:28 -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=ro6DrO1F; 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 S1730286AbfJNHIZ (ORCPT + 10 others); Mon, 14 Oct 2019 03:08:25 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:35336 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730275AbfJNHIY (ORCPT ); Mon, 14 Oct 2019 03:08:24 -0400 Received: by mail-pf1-f195.google.com with SMTP id 205so9869507pfw.2 for ; Mon, 14 Oct 2019 00:08:22 -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:in-reply-to:references :in-reply-to:references; bh=c0QsMwW5/HlkG+EyBzY3CChBE/BthJe1X9zmk8IUDUw=; b=ro6DrO1FSFrjgnEbuCTFqXVAOUVvaYpkPhUpMZ3QcSfsKg7mJYalOmP12P9nqpUs1I ZzuRB2eVsqibk7k7fhjPHQwKoppJIb1DZz+fNE1uUnjV4+53EarSuH/nZTTMHXOHonEq IF/3wnllpGOFgEpK3auT7PifBwXLm3WxU3JdX13f0ZzF0I+8e/iaVMUK6Q/DBL2cZu3n 1g9EkexgpyNk8xDpuzMejRk99CzovZpYavY0EmELdxHBrs9m1SDjcHjfeEWkID4Ip4+Z QBtdkzX4/mq7v5Q7tCDLp3N0nXHtiKzUqfQavPSMs5E/ja8WQ3MUEKkamc6pEW/+e3Lw 05Kw== 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:in-reply-to:references; bh=c0QsMwW5/HlkG+EyBzY3CChBE/BthJe1X9zmk8IUDUw=; b=Ycy7B9nLWxsYBzMe76AufPPIWit44U67aSRjyQvJLTUVgLkKIhuygogMS9j0HRUcUi TehSmCo2UlMTMFC9E1STuEBHp4OgWjSIifYZ/MPejSxsy5xeJGx3blKyePVZv5erN37b T4SskcbwUKX+BdT99J98SS4CUoMvzy+WQ+k07SNsM+p0SJGz4LDhIEkaxYCUm/qYxqkP tlfXwncRVN1gnhuplmjeyKECVpsxqlusDClIcnXy2FWvIrIVNGtP52acJgxmBgCpW9Jp 9sDy2VQcOhgHXwcVsOmofanFpnSzFeaIK+f/JvZAux6IcHRsWGmYZfgRWVb8SasehoDd zZ7w== X-Gm-Message-State: APjAAAWq/B1oqWtHYuc3JWsfPtSi2Uju3o32KCWS9sKp8uS+oNH4DkU+ a/OL5qexvatdwNdc0FKowlSuyg== X-Received: by 2002:a65:44cb:: with SMTP id g11mr32096865pgs.145.1571036901879; Mon, 14 Oct 2019 00:08:21 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id p190sm20619948pfb.160.2019.10.14.00.08.18 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 14 Oct 2019 00:08:21 -0700 (PDT) From: Baolin Wang To: ohad@wizery.com, bjorn.andersson@linaro.org Cc: linus.walleij@linaro.org, orsonzhai@gmail.com, zhang.lyra@gmail.com, baolin.wang@linaro.org, linux-arm-kernel@lists.infradead.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/4] hwspinlock: Let the PM runtime can be optional Date: Mon, 14 Oct 2019 15:07:44 +0800 Message-Id: <6c03ca84b19f0e3a4bd60b4d5ea70fd801ed7555.1571036463.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now some hwspinlock controllers did not have the requirement to implement the PM runtime, but drivers must enable the PM runtime to comply with the hwspinlock core. Thus we can change the PM runtime support to be optional by validating the -EACCES error number which means the PM runtime is not enabled, and removing the return value validating of pm_runtime_put(). So that we can remove some redundant PM runtime code in drivers. Signed-off-by: Baolin Wang --- drivers/hwspinlock/hwspinlock_core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 1.7.9.5 diff --git a/drivers/hwspinlock/hwspinlock_core.c b/drivers/hwspinlock/hwspinlock_core.c index a22e252c..fd5f5c5 100644 --- a/drivers/hwspinlock/hwspinlock_core.c +++ b/drivers/hwspinlock/hwspinlock_core.c @@ -657,13 +657,15 @@ static int __hwspin_lock_request(struct hwspinlock *hwlock) /* notify PM core that power is now needed */ ret = pm_runtime_get_sync(dev); - if (ret < 0) { + if (ret < 0 && ret != -EACCES) { dev_err(dev, "%s: can't power on device\n", __func__); pm_runtime_put_noidle(dev); module_put(dev->driver->owner); return ret; } + ret = 0; + /* mark hwspinlock as used, should not fail */ tmp = radix_tree_tag_clear(&hwspinlock_tree, hwlock_to_id(hwlock), HWSPINLOCK_UNUSED); @@ -820,9 +822,7 @@ int hwspin_lock_free(struct hwspinlock *hwlock) } /* notify the underlying device that power is not needed */ - ret = pm_runtime_put(dev); - if (ret < 0) - goto out; + pm_runtime_put(dev); /* mark this hwspinlock as available */ tmp = radix_tree_tag_set(&hwspinlock_tree, hwlock_to_id(hwlock), From patchwork Mon Oct 14 07:07:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 176134 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp4141523ill; Mon, 14 Oct 2019 00:08:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqwIsBGmsINtEm7ABfqGjhTfAWW9JNRRcTJe00unX68FHG2J//GkaXLg/NCCeUTcMvevT88c X-Received: by 2002:a17:906:9246:: with SMTP id c6mr26683602ejx.64.1571036909254; Mon, 14 Oct 2019 00:08:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571036909; cv=none; d=google.com; s=arc-20160816; b=jHWizDPkLGVRynmxEMjhSf6U4USSuWfEFCH3OBHPRQ5U9P7ZQDACoxrENVG8qlRx2S U/Yr+5hVwGPQD1qNNR56Evr45+9wY4HCnXXXV53gMLbqW8LYjtFOWU0w7+vcfmA0Yn3N wKeUy44TvHo3oiambRqSoMaskGZ/5UfYBtCRw9XQP4knp9wDk6jG+EPCYuox2ILB5KEe 4qSq0e/Ve0im6NrwlZvmnR1LpjmYVdtn0n+ZD/FIhBSq0xkbuBdw//ZVevLWGCo98iTe MIaV18pWCWYZep5JT6Ih/OyYhw30uncObxoooOvD//MOir9lC7d+7uqDdX8W0BM4VLtR f0tQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=Zl79/7idxE+IMncheCqMoc3DO2J1o16hyoOsq1ykglg=; b=WkyvgGr8oOk+mawlZiONasXOkdimpX4ruuLCqjcR25FfDpsRuVF0xFZC9AiZobM80P FqmE+IV4IqGrlatyXfHsYyYDtN22WYHp9wB5glnv58fMCssTcw2B3//1ZUnmEKl5VNfe qavWEBJsiVGpRWRt+AurxAXbz7TA7HeIPiOVyIeCuontOjdAD0q3aCICmca/xL5ERW9W CrWNJEpMQeoZoVXr0uXls333b6my+95W9h1BtnwNUxq/2qiCjSJSVdwf2tek69RvvdBv z+WUgbniPYWFEin2EPcbw87uddr/2yBTq1pBd1tO6Jnd5JysngPcou3LL6MLoOfjJuxb cmWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TSBiloH8; 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 t18si10584853ejr.205.2019.10.14.00.08.29; Mon, 14 Oct 2019 00:08:29 -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=TSBiloH8; 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 S1730304AbfJNHI2 (ORCPT + 10 others); Mon, 14 Oct 2019 03:08:28 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:40598 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730288AbfJNHI1 (ORCPT ); Mon, 14 Oct 2019 03:08:27 -0400 Received: by mail-pf1-f196.google.com with SMTP id x127so9847617pfb.7 for ; Mon, 14 Oct 2019 00:08:26 -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:in-reply-to:references :in-reply-to:references; bh=Zl79/7idxE+IMncheCqMoc3DO2J1o16hyoOsq1ykglg=; b=TSBiloH8cU92qacgCVS0kzBRFN6TltVQzaXKFTSrUcjR0r3OBMXTFZc2mw+JMJB6H7 zGn5wH2CJHsF14GFZ4h5rKwQEHdSNuVTIAfQ2I00iydhBl49QFLeaCX6+s6YF4oQO3pa thZMwkoutegGM0Y8gZ7SNCGo1QarTJz1I3suVEQQ2NmE4b/NVw+1qZJWeFxiywPbQZHs 8I/YEBLZurx6neVEIxyakEmG5TlAP44NCHkslXPAVbJZu2dsVWiSkIU9/ed8E5bc1ufp /fgHpQ4Gpx6gjvnIU4AN5IvOC6pEriNm55V8tXEF+jKIZB9gowIGRmy+1F/ZSi4yiv6q ddfw== 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:in-reply-to:references; bh=Zl79/7idxE+IMncheCqMoc3DO2J1o16hyoOsq1ykglg=; b=Hikp0g1lKK0dPpzPmbe+QvcrjEywdGY6p2bDJpXur8aOaW0MPunTcAYN+d9OQVQVod jUDATIidaePeFa5p/UU88CyPCip0ZKfozgOJ3aq9OtkgiTOL2kMpaQH5jfT/xfwCpREb VL+7LCCFKLe+C+BOfU+OmnhIblBS98hyExa6D2/I+Q/byG7/6xrcNnTOLEToHtcDQRA7 m9O4Kz3jBRI3aj9LoS1MrMDXrxoqU3rT9KN8BfqDozjUQyejttnQbWGZiF8b69G2zDDO K7TrijFXuXfvqoFumN6B7w0AIqkTJQkiv87rUwYnZPuC7KsR67bSlHG8B6zZmjZM1mKg l+YA== X-Gm-Message-State: APjAAAVXbdAUJ7rDgWhfNTc2uELyoy/mhI+cJknKsYdaR8RlfHO/onsy FTGWzCdPuvk73fSodDA17+pXQQ== X-Received: by 2002:a63:f44e:: with SMTP id p14mr30314447pgk.2.1571036906264; Mon, 14 Oct 2019 00:08:26 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id p190sm20619948pfb.160.2019.10.14.00.08.22 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 14 Oct 2019 00:08:25 -0700 (PDT) From: Baolin Wang To: ohad@wizery.com, bjorn.andersson@linaro.org Cc: linus.walleij@linaro.org, orsonzhai@gmail.com, zhang.lyra@gmail.com, baolin.wang@linaro.org, linux-arm-kernel@lists.infradead.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/4] hwspinlock: sprd: Remove redundant PM runtime implementation Date: Mon, 14 Oct 2019 15:07:45 +0800 Message-Id: <8fb54e417ee5833e09103fd1c286c4cf2f41ce69.1571036463.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since the hwspinlock core has changed the PM runtime to be optional, thus remove the redundant PM runtime implementation in the Spreadtrum hwlock driver. Signed-off-by: Baolin Wang --- drivers/hwspinlock/sprd_hwspinlock.c | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) -- 1.7.9.5 diff --git a/drivers/hwspinlock/sprd_hwspinlock.c b/drivers/hwspinlock/sprd_hwspinlock.c index 44d69db..36dc803 100644 --- a/drivers/hwspinlock/sprd_hwspinlock.c +++ b/drivers/hwspinlock/sprd_hwspinlock.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #include "hwspinlock_internal.h" @@ -133,23 +132,10 @@ static int sprd_hwspinlock_probe(struct platform_device *pdev) } platform_set_drvdata(pdev, sprd_hwlock); - pm_runtime_enable(&pdev->dev); - ret = devm_hwspin_lock_register(&pdev->dev, &sprd_hwlock->bank, - &sprd_hwspinlock_ops, 0, - SPRD_HWLOCKS_NUM); - if (ret) { - pm_runtime_disable(&pdev->dev); - return ret; - } - - return 0; -} - -static int sprd_hwspinlock_remove(struct platform_device *pdev) -{ - pm_runtime_disable(&pdev->dev); - return 0; + return devm_hwspin_lock_register(&pdev->dev, &sprd_hwlock->bank, + &sprd_hwspinlock_ops, 0, + SPRD_HWLOCKS_NUM); } static const struct of_device_id sprd_hwspinlock_of_match[] = { @@ -160,7 +146,6 @@ static int sprd_hwspinlock_remove(struct platform_device *pdev) static struct platform_driver sprd_hwspinlock_driver = { .probe = sprd_hwspinlock_probe, - .remove = sprd_hwspinlock_remove, .driver = { .name = "sprd_hwspinlock", .of_match_table = of_match_ptr(sprd_hwspinlock_of_match), From patchwork Mon Oct 14 07:07:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 176135 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp4141618ill; Mon, 14 Oct 2019 00:08:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqyxYqas76Qtyd0xeMPAMMtw7c8T8sncX6JSn77D1WAF0atlBQV166VWYbFQtNEt2ttUjtdM X-Received: by 2002:a17:906:6b88:: with SMTP id l8mr26922461ejr.26.1571036915969; Mon, 14 Oct 2019 00:08:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571036915; cv=none; d=google.com; s=arc-20160816; b=m3zBSfEH+46t48+fPzlpPkgQ23ug4MrOavDnwmFvowVe8TsmQOmr971hc79BU+ksGP fob3mWumBOcVYIv59WQmhSRuv5qXE/LI4O4prZepZZJefz0tyuzKQJ9Ud9j7M9oocwuj 59jbgTkeul1Re9FI1p44wTJXuf1evsprFrIcFYG7hXmd7u7wTMBSGBJ/1jxA7fmYUT5d L43R5po0MdcVCRN5DFY/ljHCF54zb5kEKlv98pyiQ5ChAKv6FMB6K8WaIIono/Kn4l01 l5xc5uXmdHrPbzwuOYMuYCy/HVTk5DK+V3Lreu8UE+THjfjRqNmx3IIKzaApFIhfbaoz G+FA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=QVF1cJTCILzDHlkGsXg4UxA1J9tfvByKemIbWK8sDEY=; b=kb2D0bix5sGv8mbeXEu2SOeR7rLPJxU+0uESU3a8iCgZZywxB4yZYwq2wo62W4yjU0 XEqLMzZxAPm/s2a4zyIGTphSEaA6FyuoH3lM+RWmz5bJlVMmA82O9h2b0ulDuf5Mnkwc VCr9ZjjKlKdI5oeQPZao2IkhlRAKQrdD5rQdmnQNhysDSNvdi29FwpOyizjPu2oRYl+1 tbrUlTBHPQDurHMBXVLIIU15HB2oBiHM/x3CbmwKpJHUmVmLQQtfqnf8641Yl/Ex9nc0 WFQFbOn0eU4HYRvG4DikkoIplvfk5OPgFAU9hfLCcS8P0j48KMt4tGcD0URT8YWOqFBe VlZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oqpNrl0m; 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 g13si10048165edu.4.2019.10.14.00.08.35; Mon, 14 Oct 2019 00:08:35 -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=oqpNrl0m; 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 S1730327AbfJNHIc (ORCPT + 10 others); Mon, 14 Oct 2019 03:08:32 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:37166 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730317AbfJNHIa (ORCPT ); Mon, 14 Oct 2019 03:08:30 -0400 Received: by mail-pf1-f195.google.com with SMTP id y5so9864682pfo.4 for ; Mon, 14 Oct 2019 00:08:30 -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:in-reply-to:references :in-reply-to:references; bh=QVF1cJTCILzDHlkGsXg4UxA1J9tfvByKemIbWK8sDEY=; b=oqpNrl0mbjGUAPBsMnHKssFCENhw6p9XyyTe1THcu7aRYEX6fDTxHdYq3L+6KzbVZM /l0l00OgT0xQasYWB0AHs1LyF2Oc62e8+Ubv0kgPiVn6Ty76LDL/DB35TG574+9bwgjX fOPQpweoxiY0NM05qhIdLrQwKqhjsXqy2cfKNuSB31PP/ocBFno3b6eyv4XvIRidk5Cr i/qgTlGz88oN1obZAV28TQLJnineJ5nmAyu6ZHITA8d6lnvc4zfhsnefK3ST+AVlzcKz eOR+a03El82sa0Ts7kEdaOU0oTP74f4DOoQAhgMsk0IEcW+RppsOZPIwE+PLrJOwCyv8 Qchw== 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:in-reply-to:references; bh=QVF1cJTCILzDHlkGsXg4UxA1J9tfvByKemIbWK8sDEY=; b=T1IDqE9W8/4XVZNWavECnDSK2x9jxsYt3KvDl4xsWmtA67UMceyz3pmLfKzaCuumDP +b3q1lFlu19GkwN0ha733l4Z1JccxS49hOiXRszx6SpcM6gxBqtZip6QwUiUMBohOcOC JI2I1BOgjh7gegI38oWbAAbcGGkfEa1VnkTxciWMd5RmBvtmS/KejE1U2dqYZFQqxXnh l80r6Xrg9YrUTDvpseuvVpg9X78eX0FWryfsY41J/XeyXZe+0FtBtaC6oi4V+c7MELSz Q0uo/8+xOHQBM+NnrEMinzZUOamFs482mbfzpy0LZHaE+jfIXBsR2j6I3xZevmfMs8wQ TusA== X-Gm-Message-State: APjAAAUmYVYbAz+854kAwkTXPkjB8/NzH4nxsDNCEmLgRE3pbdXXXYLJ aPRlBhv0+qZ0XFmKihEFhzJn0A== X-Received: by 2002:a17:90a:ab0e:: with SMTP id m14mr33282231pjq.78.1571036909732; Mon, 14 Oct 2019 00:08:29 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id p190sm20619948pfb.160.2019.10.14.00.08.26 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 14 Oct 2019 00:08:29 -0700 (PDT) From: Baolin Wang To: ohad@wizery.com, bjorn.andersson@linaro.org Cc: linus.walleij@linaro.org, orsonzhai@gmail.com, zhang.lyra@gmail.com, baolin.wang@linaro.org, linux-arm-kernel@lists.infradead.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/4] hwspinlock: u8500_hsem: Remove redundant PM runtime implementation Date: Mon, 14 Oct 2019 15:07:46 +0800 Message-Id: <45600b3601cbfe3685f4c9e088be9a30ae3eb8f2.1571036463.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since the hwspinlock core has changed the PM runtime to be optional, thus remove the redundant PM runtime implementation in the u8500 HWSEM driver. Signed-off-by: Baolin Wang --- drivers/hwspinlock/u8500_hsem.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) -- 1.7.9.5 Reviewed-by: Linus Walleij diff --git a/drivers/hwspinlock/u8500_hsem.c b/drivers/hwspinlock/u8500_hsem.c index b31141a..67845c0 100644 --- a/drivers/hwspinlock/u8500_hsem.c +++ b/drivers/hwspinlock/u8500_hsem.c @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include @@ -89,7 +88,7 @@ static int u8500_hsem_probe(struct platform_device *pdev) struct hwspinlock_device *bank; struct hwspinlock *hwlock; void __iomem *io_base; - int i, ret, num_locks = U8500_MAX_SEMAPHORE; + int i, num_locks = U8500_MAX_SEMAPHORE; ulong val; if (!pdata) @@ -116,17 +115,9 @@ static int u8500_hsem_probe(struct platform_device *pdev) for (i = 0, hwlock = &bank->lock[0]; i < num_locks; i++, hwlock++) hwlock->priv = io_base + HSEM_REGISTER_OFFSET + sizeof(u32) * i; - /* no pm needed for HSem but required to comply with hwspilock core */ - pm_runtime_enable(&pdev->dev); - - ret = devm_hwspin_lock_register(&pdev->dev, bank, &u8500_hwspinlock_ops, - pdata->base_id, num_locks); - if (ret) { - pm_runtime_disable(&pdev->dev); - return ret; - } - - return 0; + return devm_hwspin_lock_register(&pdev->dev, bank, + &u8500_hwspinlock_ops, + pdata->base_id, num_locks); } static int u8500_hsem_remove(struct platform_device *pdev) @@ -137,8 +128,6 @@ static int u8500_hsem_remove(struct platform_device *pdev) /* clear all interrupts */ writel(0xFFFF, io_base + HSEM_ICRALL); - pm_runtime_disable(&pdev->dev); - return 0; }