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: 11187891 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7FC6F13BD for ; Mon, 14 Oct 2019 07:08:41 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 53BA3207FF for ; Mon, 14 Oct 2019 07:08:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="BPW9ACjA"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="kahd71I+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 53BA3207FF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Tu2cBjsDjfDqNy+pgVJ97jwZXCuIseuNAq6YeLjuelw=; b=BPW9ACjAcn6I92PrzsFH1lBUzR LWZSbg9iu/xEdGO2hYUhLKlfY+vdyuqL+AGWBLc60i5XnW9AJgBS/6qJ90QHfJPNC26tDat7Q7Ygl giyQXxP5wcGTAqQcHlmkNyDApPdZ7UOftVVhtS119695jbQeJIPqTZ35xRBEcDbCwBUhdSwKG+tNy Xhe5jY8iJ8UF4JXA/4OmY7uKOooyWudkc2KNW2F3lkD8uH6/sqYQkxCrYmyxC8KE4QO9LTlvR4iZ6 yG0oAsEcjRPvwQO/InHo/2m5iySlvGjk/9nPcWxQWTtcJIlYWx8qZR1OAOo7hp3nWXtImWgww8GwI WQM4nEKg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iJuT9-0003lx-Rl; Mon, 14 Oct 2019 07:08:39 +0000 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iJuSo-0003Tl-Ns for linux-arm-kernel@lists.infradead.org; Mon, 14 Oct 2019 07:08:20 +0000 Received: by mail-pf1-x443.google.com with SMTP id v4so9855212pff.6 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=O0IhNu/D9lEYmewKaLOL2tWfCBbg2ZVncibxzPxCpTuW1SRcgn6FKi69IPBhFPqCcK 5mzCLkzfHlIe/Ar8BcIY2A2hTIBnsDo/Rq0KmCppopFwRcZQ8gV86MyGxZcXulSgpqWi 4XmiET+aJ+Rdbas67JZNCj2eyOZ5OQdwTt+EusibNIq8xnqJcdNLUW9O+KI7kqzH1vMF 5/tLVRRWXjK40GE2E25ni8ry3ptgwArVdcpdIsXdllAAZRsHKnpqsutYMlmsI35MTeI2 t2Rj1XNF1+xfFJbjZe8t7ZuxcwJIkr4a13r93VD0PYEBJWzJbUfjxsKg+8kyGff4aH+N jerQ== X-Gm-Message-State: APjAAAVlqD4mVYRov6IHU1V/cnRrTbbd9GY/ZE6XrgzW5fIFYaHQstKG clyv9/bOL7LN4MuL2Q9ToNfW7A== X-Google-Smtp-Source: APXvYqxv2BmrjcqFoDObMm2gQRhJZtQRLtBrcLu0vLIyKYJqaaJ45K79YI50OvI+hNc8D356sSDNtw== 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 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: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191014_000818_776125_5E8198E5 X-CRM114-Status: GOOD ( 11.47 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:443 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: baolin.wang@linaro.org, zhang.lyra@gmail.com, linus.walleij@linaro.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, orsonzhai@gmail.com, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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(-) 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: 11187893 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6FE551390 for ; Mon, 14 Oct 2019 07:08:55 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4C073207FF for ; Mon, 14 Oct 2019 07:08:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ftygWRKA"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ro6DrO1F" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4C073207FF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=yFhKeqtHwqCF93s3GYOsnnrKuDiuG4DZ6SPRwwx12Bc=; b=ftygWRKAS8TqVZ8oa3+uM4NZRF xVjmnzJ6s+k5E1r7Yk6BuWzg7j1PkrKEQI+BY1WS/HT2IJK1m7PkTvJsdtUOjUMePU1oodAplY1zp R0brkZTAmoR1FSsfREDvfpwBFCu2zZlxnTjhP7sXgidiv2ohQ4zNVlANLz4vqNZlTpXQvaPnFvF0T zqwgOwYtRyDljr9JeAGUiZmfE/Zilkh1vmSo5OL6few1X0tStAJmgWovtV92XiOxpAtXKKoEK9BfC /SDASY8Yb+JGoAuCrI0/7cN7tktsQxGIkgNC6iCOmaXT6aePyjvHs7Dyzerzc1NmOBGA2heDpT1kE xMsPRI/g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iJuTO-0003zr-Q3; Mon, 14 Oct 2019 07:08:54 +0000 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iJuSs-0003XM-KP for linux-arm-kernel@lists.infradead.org; Mon, 14 Oct 2019 07:08:24 +0000 Received: by mail-pf1-x441.google.com with SMTP id a2so9838735pfo.10 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=uUKZ9o4pjYJv3CkJNzlC3OQg669mFKXg9EuqSBjc+g+FPt19k/8kEmJC+v0xQJcSfa vKBlQyNptE4RRRNth/dzpub5crjsOG+NW9gi0INOf2gynocWW6avrQzmdLr+fkA+p0CT EpEOiu8o8BND550b6XsHzWzweam00Epq6mHA+kd0tCLntlIGdZCz6Gu9G7rKpvAsIzM5 ncFHUznn1CeiByib382SLDoOnYlL4QeabCucAQRDNAk2EpTMRftQ/AXJ9ELsdZOr+8o8 wdR0cIWOxndZWc4pYqNUz51rd3oKiYBFyO4grCYGbTNhLNWbdoFXPusDygwhpnfvMEAp fguw== X-Gm-Message-State: APjAAAVAYd6rG5XKwiHx1U9u9ZSfArJdN7UsGqSqOmnN3jUjfQlNTpx8 Z3rI+e9Mkhsi8hHG8wiiDNgD7MRL78CKog== X-Google-Smtp-Source: APXvYqxpj08mz2lldyLGGjWvshFVJheqS7LJzHgtZNqHz5/AArf3lNTOgLpoag2/XVvFk3uStAaTBg== 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 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: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191014_000822_705140_17962C70 X-CRM114-Status: GOOD ( 14.72 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:441 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: baolin.wang@linaro.org, zhang.lyra@gmail.com, linus.walleij@linaro.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, orsonzhai@gmail.com, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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(-) 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: 11187895 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AB67E1390 for ; Mon, 14 Oct 2019 07:09:18 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 80E6D207FF for ; Mon, 14 Oct 2019 07:09:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="o2+MxquZ"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="TSBiloH8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 80E6D207FF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=kyO5jSJdDbqOSh2rbloFB4L5JWrLswdiFcSE/+Pg6ew=; b=o2+MxquZQTx1ztdSNPx8XYcZM5 IKROKfOyk77P7R7y5U9JggS/2QiZlEz9YjrOZt2S1qvYviW03ei7B8Q24jXGDi34ZEcVDdBei7m15 zBp3Wq//HJbZWRxFuw+REc1ssmvx7mWGtxB0MgT0fnfOkyh/+LyBq+D6kCcjG8unFO8OdinU+h4RZ YX/QHRNHQUsxn4vrhx1QKBR6y54ajge05X/PSXDg9C9Q64pxWwk0nRCHCvZrjuohqAZcjA8PnWwru JKFZasc51ePejkyrkBhYGlar8dqD1svfuJ87w3eS0uuOTZCrQY0unIfEjMec6Z39VpKH/t5uLgDng kHSt0Asw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iJuTg-0004FD-18; Mon, 14 Oct 2019 07:09:12 +0000 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iJuSw-0003bE-V9 for linux-arm-kernel@lists.infradead.org; Mon, 14 Oct 2019 07:08:28 +0000 Received: by mail-pg1-x541.google.com with SMTP id e13so1333160pga.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=fC2tI6EsaPijEefxTrPy7lxeP02k0+oQvzrVzPE0ibCeOmPHLC2gY52DdI3SfSuxNy NREFnVIq0OhJaG4PtsWQU/0MdCKdq5uONRPiUALckmCMNHbpL7EKtxF30pd9F8c/sX8C ya5rvkCRjOvyro0d4JtQG92Twff0KAqDuVKt7GDHbauGbru/nK2vsG4fEk1f1gIYwVnW FR41xzHQsic4OmRA3JaH13ZW7BwkoBSFcOPNZBN6DGDaYZVlyUkvNU2EWIGgUwzz30er 5kwn21Apg8hCkq4mdXbNP95CazG/MsGJBqqV2UdA5CQZzrv93Ze7ZsDWw6RLrqb7b3Jy ZNKg== X-Gm-Message-State: APjAAAXYXV81K/1pLdnR7RHPdKD9kMcOoBGEcNGQhFzM+z6ylc4X9PYh yCzjgHRuUkMmOZXz0f30ssTw/g== X-Google-Smtp-Source: APXvYqxQb3C1sVvpu4CJn6/D9HYJ39s99IDUmrfJQOVPa+KmtT73tGHSz8Md3OBtes3vGRQXwrEABw== 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 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: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191014_000827_022943_28CF1431 X-CRM114-Status: GOOD ( 13.02 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:541 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: baolin.wang@linaro.org, zhang.lyra@gmail.com, linus.walleij@linaro.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, orsonzhai@gmail.com, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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(-) 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: 11187897 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9BF3113BD for ; Mon, 14 Oct 2019 07:09:27 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 794D8207FF for ; Mon, 14 Oct 2019 07:09:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="SuiQMXJt"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="oqpNrl0m" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 794D8207FF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=qEWQGLYlJBhop51iOC4b39FbJhq44ZjLv825Yed7UZ0=; b=SuiQMXJt8X2eBxrLJJu9qWxxU5 unNJDBExY0hvzhCnpx3QI5pJ1zEC5wbsvO5fAiAhcy5eObQ4frks641XWLCMGSgAGconutBcNchzV eULVp0tjl7XUuhMH7jfoo5zz4urHrXMUfJm/rbouk1cYNQskZJiNzabb5j0Ux6pPzWDle+D/G/MvC MPbmwMsT5wEpZAhP8fTDX04WB8rRlz+Gam70nETE+gy2Q8NXKK0LfwzIjHi8kEavCyd+JATwvFRij qGXjX+XMU+NOIIz+wEpv/gI7C/Y2qd8BqO7WZ/+f1Hj5CAw944FL+QDjJhlbc8D3Gdr1YS0khhjQJ Fqpc5qfw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iJuTu-0004Ss-Mv; Mon, 14 Oct 2019 07:09:26 +0000 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iJuT0-0003eC-St for linux-arm-kernel@lists.infradead.org; Mon, 14 Oct 2019 07:08:32 +0000 Received: by mail-pf1-x441.google.com with SMTP id 205so9869720pfw.2 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=EjQtzlNVpxAKHDwOh0s3ptGeKFK26z3/quKuqBtwQvzFxQXcWkZA4LzU7SuVWHnfk0 4lBtVnPAmfGxLzob61gHpG9wzmt2r2ieoMGFFoRIDHqp7wP+JXX5PzWaZpfy1YH5uzrp keeUBESsbaTo4lW0y9o6IaLraC+eTx2a7JdlwO5ZrR7/Rzy6vBQc1NGPaW5oa9qV9BEN R+0AGilNXkoJK/d+bc18vqDuF5EnOqQJjATQIn2+kL7rsvvze+DDnVPVSPMMwoU8x269 uMa0Xa5UzyH9n5nDaFoowgQ9Vqv3wWvy3zHYTtNEyWeimeFPRpSpaC1G4zSRokjRHf0c UXMw== X-Gm-Message-State: APjAAAVm+LloowesTDCGdTDM9FcVLI+kNOejEl5bN1Fx1KwBERTvCqU9 McYPJG/hEQXVmFUFw4M7gX83AQ== X-Google-Smtp-Source: APXvYqxcuOTybNC+LB4pwT8Vl/JKVRoXEjg7hdTh0uwB1jVIOIm1Ty8Cmrl2mLTyWsYXiMu/HdTXkQ== 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 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: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191014_000831_068515_DF683209 X-CRM114-Status: GOOD ( 13.40 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:441 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: baolin.wang@linaro.org, zhang.lyra@gmail.com, linus.walleij@linaro.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, orsonzhai@gmail.com, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 Reviewed-by: Linus Walleij --- drivers/hwspinlock/u8500_hsem.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) 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; }