Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp5099190imb; Thu, 7 Mar 2019 07:45:02 -0800 (PST) X-Google-Smtp-Source: APXvYqwDtTZZEGM40AlXyXmTSiadv5saCBzBJif9TDtMH6FKBDFKtwxrHVU8T5BNJuNKRPKUQi6t X-Received: by 2002:a17:902:681:: with SMTP id 1mr13508437plh.185.1551973502289; Thu, 07 Mar 2019 07:45:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551973502; cv=none; d=google.com; s=arc-20160816; b=gF5xUrNrZBBLh/p0dD/lSpDn3nNGJX9k7NagXcWn2RC49eht06aVluVLnAqkqEOquU 3yhS7bCtyOVPgV9zUGnmtVyNKz1bM1XXFMSOlzGhVU/Ht5S9i4QYbVS++Fk4ZAe2iUEl /x1u/nduc5l+V5bKmQfutYUrsCujjkw+vIe09C9EZ+hka8JTDdwnXXs0ffp2iBnRYPT7 MhQBdi1g7lhGnVsP3Z0la2YDwaH/NpzhOmgoUQaBOy/0sFeaGJHvAxvt2C/epyPMVTc/ 5yQvK8xfo9xPzBJK71P1EEhs9dz4eOV8hSTXwQKFu7rFH6O6A71NDZLO4qVT35Jq327N 3MZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=m2PImTHUkIGFFzrRDgUVkhFZ5xdv+LaKyQQ9Im+8Pb4=; b=aF98elceAZvLZYvbXWegcfok5NkYtZXmfTaThwYuB1YgO5PWZWuGArCNpKgmn3uqJE 5OVOBdiwvhbloQ99adhsnyggKX1pPGRzLtKC6q5O3tuCvN/TMBJmCC4TLx5zPkfUtUHc vgP4xRE+EveBgQystNx6XCcQWMV73220t/4qCtE9cfWSHM6CyCVj33bGc/grIM8RtdUN Fc+DxcyA5zAEe6Xq8RkJ6XEajnfq3mmsCmiZFjfjtsvpdO3BAZIZd5k2+OBeaUw9pw5v ukzb/Hoh7O4JkoE6pgS/EpN5yuJmYA9WWc52OtYc5dfveXkCxU8LY2yACyN6zCiIs09/ my5Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l187si4276851pge.71.2019.03.07.07.44.46; Thu, 07 Mar 2019 07:45:02 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726676AbfCGPmk (ORCPT + 99 others); Thu, 7 Mar 2019 10:42:40 -0500 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:36728 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726512AbfCGPmk (ORCPT ); Thu, 7 Mar 2019 10:42:40 -0500 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x27FVDpJ022558; Thu, 7 Mar 2019 16:42:29 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2r2ng25jcb-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 07 Mar 2019 16:42:29 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id AEA8A34; Thu, 7 Mar 2019 15:42:28 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas21.st.com [10.75.90.44]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 804B452B2; Thu, 7 Mar 2019 15:42:28 +0000 (GMT) Received: from SAFEX1HUBCAS23.st.com (10.75.90.47) by SAFEX1HUBCAS21.st.com (10.75.90.44) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 7 Mar 2019 16:42:28 +0100 Received: from localhost (10.129.4.33) by webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 7 Mar 2019 16:42:28 +0100 From: Fabien Dessenne To: Ohad Ben-Cohen , Bjorn Andersson , Maxime Coquelin , Alexandre Torgue , , , , CC: Fabien Dessenne , Benjamin Gaignard Subject: [PATCH] hwspinlock: stm32: implement the relax() ops Date: Thu, 7 Mar 2019 16:42:16 +0100 Message-ID: <1551973336-23048-1-git-send-email-fabien.dessenne@st.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.129.4.33] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-03-07_08:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Implement this optional ops, called by hwspinlock core while spinning on a lock, between two successive invocations of trylock(). Signed-off-by: Fabien Dessenne --- drivers/hwspinlock/stm32_hwspinlock.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/hwspinlock/stm32_hwspinlock.c b/drivers/hwspinlock/stm32_hwspinlock.c index 4418392..c8eacf4 100644 --- a/drivers/hwspinlock/stm32_hwspinlock.c +++ b/drivers/hwspinlock/stm32_hwspinlock.c @@ -5,6 +5,7 @@ */ #include +#include #include #include #include @@ -42,9 +43,15 @@ static void stm32_hwspinlock_unlock(struct hwspinlock *lock) writel(STM32_MUTEX_COREID, lock_addr); } +static void stm32_hwspinlock_relax(struct hwspinlock *lock) +{ + ndelay(50); +} + static const struct hwspinlock_ops stm32_hwspinlock_ops = { .trylock = stm32_hwspinlock_trylock, .unlock = stm32_hwspinlock_unlock, + .relax = stm32_hwspinlock_relax, }; static int stm32_hwspinlock_probe(struct platform_device *pdev) -- 2.7.4