From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.7 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80B48C433E0 for ; Tue, 16 Feb 2021 02:18:21 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 306F664DE8 for ; Tue, 16 Feb 2021 02:18:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 306F664DE8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=TWJhWZtHxmbPol0e5znke73qUxe68mWJsckRROsMlVY=; b=1NYfnupWrStUkH/kh/5cHa60T Scj39m9sTC9Cc/RTM5z6XaKelL235uXekA29Mdd/JhNfA6DFliYiJfVK5oWZPKIP3m8XxfroU6AsH rdddlqL804JKA8wcRki14SsY9V9WKySQs3Slsa4D3Nz/RZhU2kKdxmMe/eoRixw5xsB6scihq3pPY WYHpRibOaqEI61Pm9mPsPS25YkM3wrITdMGAWnzq/hKkHz7HO6kbueP+431lEJABy06ttG4x6n2n/ f1fC2rIIzUzC3GaAKYDna7ankdJwl6iPu20zMWlbIWiYvWp4D/r7E0fnB9Vu2YqYfsujv36EXu30Y gx0GFs6Hg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lBpuR-0006JL-Cm; Tue, 16 Feb 2021 02:16:15 +0000 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lBpuO-0006J1-Tc for linux-arm-kernel@lists.infradead.org; Tue, 16 Feb 2021 02:16:13 +0000 Received: by mail-pg1-x532.google.com with SMTP id t26so5318196pgv.3 for ; Mon, 15 Feb 2021 18:16:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=lb/pFWHszNknFvlysVhnuzVrA5hrw2/iv1f49uuCHHc=; b=JI8bTZ/ZGvq50e31unyKdwZwCoOB4y8l9dgZK/MuqjfNS6yi/nhSsRotwpkjqroAOQ 7ZizadhCd0etnXIkksrH6rBq1MPC5tg8tKoHMMHhha1LV6RDNUSxMocBxKX+6yCBlB9i CF2WblOFfA4PuN39N3WBdcIJX4KtMTduaEG6IXYuRwMeZRSmjGcIlDaA+PVs1qZ8DFOX F05hvCPi8IwGPxfPLvPw+juA884nIzZhOfS+Ha+VGwQa4X0cyPhF9Eqs5rt4f9VawxwV 1FGYJoJilbIXAYyAAbgXEpC2arpzt44bEoS6FWlXno5q/jhS+2VjSfeBfgP10ihDRUt9 MeAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=lb/pFWHszNknFvlysVhnuzVrA5hrw2/iv1f49uuCHHc=; b=SoXoIbeTA78eCyT6nCOemQrskfarc2FbFd7DJ2fPjJWGrUvuxtc2VgEkO356HdAIF9 e8H31MGuf11zXAeKWeJ6WmWulyqrThXK3wf/pFRaE168cauCgGh80oOKifbIWCup4jyC xr0fCAoIcJWCuLPOnYxtWl3Ekb83XGBjfJP6l0NeWlGrDbJeioNAMVX6b6C4/jKs6K/l rwXbq1vBj8KFyay+yMmsmMoapdkXOKGryLW8wEoeS9K6/GpX0JJJ+GdzTjj106SYKaM9 X5wUEH3w0owDt5r2h94PRqEnOKl4OnPacb84Zqyar+wvNNp0Fmt/bdoIndm/dh3BLluv oIgw== X-Gm-Message-State: AOAM532Xo5ep5SMYzBXYHaZTepaca1pdMX2LH6fs4h0uv77Zjli0RjKU UF/BCsDXkgGTa7QLRdhUW6I= X-Google-Smtp-Source: ABdhPJzp7SNhYqSVr36CPjTlOyyOihZNlM6Knf+LNC3ReY54DeKBGRIElDZZIw4HLFNecR6kVUhd0g== X-Received: by 2002:a62:c719:0:b029:1ec:c587:3c5a with SMTP id w25-20020a62c7190000b02901ecc5873c5amr1320838pfg.27.1613441770889; Mon, 15 Feb 2021 18:16:10 -0800 (PST) Received: from shinobu ([156.146.35.76]) by smtp.gmail.com with ESMTPSA id b17sm18608375pfl.190.2021.02.15.18.16.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Feb 2021 18:16:10 -0800 (PST) Date: Tue, 16 Feb 2021 11:16:03 +0900 From: William Breathitt Gray To: Jonathan Cameron Subject: Re: [PATCH v8 21/22] counter: 104-quad-8: Replace mutex with spinlock Message-ID: References: <20210214181946.1d2f7e78@archlinux> MIME-Version: 1.0 In-Reply-To: <20210214181946.1d2f7e78@archlinux> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210215_211613_010190_56694100 X-CRM114-Status: GOOD ( 18.15 ) 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: kamel.bouhara@bootlin.com, gwendal@chromium.org, a.fatoum@pengutronix.de, david@lechnology.com, linux-iio@vger.kernel.org, patrick.havelange@essensium.com, alexandre.belloni@bootlin.com, mcoquelin.stm32@gmail.com, linux-kernel@vger.kernel.org, o.rempel@pengutronix.de, kernel@pengutronix.de, fabrice.gasnier@st.com, syednwaris@gmail.com, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, alexandre.torgue@st.com Content-Type: multipart/mixed; boundary="===============7074096587350828388==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============7074096587350828388== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="HfLQjWKfp3+aIQDU" Content-Disposition: inline --HfLQjWKfp3+aIQDU Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Feb 14, 2021 at 06:19:46PM +0000, Jonathan Cameron wrote: > On Fri, 12 Feb 2021 21:13:45 +0900 > William Breathitt Gray wrote: >=20 > > This patch replaces the mutex I/O lock with a spinlock. This is in > > preparation for a subsequent patch adding IRQ support for 104-QUAD-8 > > devices; we can't sleep in an interrupt context, so we'll need to use a > > spinlock instead. > >=20 > > Cc: Syed Nayyar Waris > > Signed-off-by: William Breathitt Gray >=20 > Why do these need to be raw_spin_locks? > Normally only need to do that if in code related to interrupt chips etc, > not their use. >=20 > Jonathan This lock can be taken in an interrupt context in a subsequent patch: counter_push_event() called by quad8_irq_handler() can end up calling the Counter component callbacks which take this lock. We can't use a mutex nor a regular spinlock because those can sleep on RT setups [1] which would result in a deadlock due to the interrupt context here -- so therefore we're left with using raw_spin_lock. [1] https://lwn.net/Articles/367219/ William Breathitt Gray --HfLQjWKfp3+aIQDU Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEk5I4PDJ2w1cDf/bghvpINdm7VJIFAmArKuMACgkQhvpINdm7 VJKp3BAAlS2Vs6gAvh5SArki6q5IaQsXcy9P9ApPJpGXN1aw41Ww/OOyJ8HutGNE jzKXcr4QxWrtrHBeM4S9hz9R4Wo3M+LbGSu8HUz/MY5DyGGglcI6PAb5LDoQS7vQ 4/N1ymMuu5Pmht/uA4ZWA6ZeU54Y0Dor+IXmit1BPBwo7ooYctbNvh+vdoNlZSxg 0sWQPD9m95Vd3FwCuhQ4vzyZXy/FEr5PFiyy0fwa+5Wndof9DbA+5VYcrRBZdB7v a1xiIT8B+0eq7eElaAYM3clZdJwF9utTYMi6oqkrZCU6iMYLZD+W0BhyOcxA4LTO s7KjhqBwS7sDObxEx0JD5OHh+mGU8h7QzZ3hF9o2git8cL3Y22bKMMamTnJRGWay vlU5B7KF8l6Rg8Hf8cfspWC6cwp0iXhA/fNCIjxVDikQr/GxqdkMDHvIxzz7KID5 YCWz1UCBRxOe9hBOBPSa7p/QbPKnk2DFP3RSgwEknaRZag0/6PO4aou0yxFSsGJO f0bI3cp64xK5sE74Mv5T0OFNPdcgtftKi1hES711uJZwyWdoIdz7T4mikmVt2r7D 0N1oeEckjiFzF4wzvMU4KX2NImw/8ef0Dz/XTvSvI6Ae1FVnshCj7sZ4RfrO9W/L 4x84eyP5JTdZeLHhH7M8Fuw2XOYmF/+8Jeye5Os7njSB4+DU6Ig= =Zljx -----END PGP SIGNATURE----- --HfLQjWKfp3+aIQDU-- --===============7074096587350828388== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============7074096587350828388==--