From patchwork Thu Mar 7 15:58:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabien DESSENNE X-Patchwork-Id: 10843293 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A478014DE for ; Thu, 7 Mar 2019 15:58:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 924762F488 for ; Thu, 7 Mar 2019 15:58:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 902582F4B8; Thu, 7 Mar 2019 15:58:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C88A2F4B2 for ; Thu, 7 Mar 2019 15:58:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726279AbfCGP6m (ORCPT ); Thu, 7 Mar 2019 10:58:42 -0500 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:56214 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726249AbfCGP6m (ORCPT ); Thu, 7 Mar 2019 10:58:42 -0500 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x27FkQwR025817; Thu, 7 Mar 2019 16:58:37 +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 2r315usxv2-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 07 Mar 2019 16:58:37 +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 BBB1331; Thu, 7 Mar 2019 15:58:36 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas24.st.com [10.75.90.94]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id A0860531C; Thu, 7 Mar 2019 15:58:36 +0000 (GMT) Received: from SAFEX1HUBCAS23.st.com (10.75.90.47) by Safex1hubcas24.st.com (10.75.90.94) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 7 Mar 2019 16:58:36 +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:58:36 +0100 From: Fabien Dessenne To: Ohad Ben-Cohen , Bjorn Andersson , Jonathan Corbet , , , CC: Fabien Dessenne , Benjamin Gaignard , Alexandre Torgue Subject: [PATCH 0/2] hwspinlock: add the 'in_atomic' API Date: Thu, 7 Mar 2019 16:58:21 +0100 Message-ID: <1551974303-24542-1-git-send-email-fabien.dessenne@st.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 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-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In its current implementation, the hwspinlock framework relies on jiffies to handle the timeout of the hwspin_lock_timeout_xxx() API. In an atomic context (or more precisely when irq are disabled) jiffies does not increase, which prevents the timeout to reach its target value (infinite loop). Note that there is already an hwspinlock user that runs in atomic context (drivers/irqchip/irq-stm32-exti.c) and that has to handle by itself the timeout. The first patch of the series completes the Documentation (the 'raw' API is not documented), and the second patch provides with the 'in_atomic' API. Fabien Dessenne (2): hwspinlock: document the hwspinlock 'raw' API hwspinlock: add the 'in_atomic' API Documentation/hwspinlock.txt | 81 ++++++++++++++++++++++++++++++++++++ drivers/hwspinlock/hwspinlock_core.c | 43 +++++++++++++------ include/linux/hwspinlock.h | 61 +++++++++++++++++++++++++-- 3 files changed, 169 insertions(+), 16 deletions(-)