Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933984AbdCJTfr (ORCPT ); Fri, 10 Mar 2017 14:35:47 -0500 Received: from mx0a-00010702.pphosted.com ([148.163.156.75]:55953 "EHLO mx0b-00010702.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933921AbdCJTfh (ORCPT ); Fri, 10 Mar 2017 14:35:37 -0500 Date: Fri, 10 Mar 2017 13:35:29 -0600 From: Julia Cartwright To: Ray Jui CC: Linus Walleij , Alexandre Courbot , Florian Fainelli , Scott Branden , , , Thomas Gleixner , Subject: Re: [PATCH 07/19] gpio: bcm-kona: make use of raw_spinlock variants Message-ID: <20170310193529.GC32162@jcartwri.amer.corp.natinst.com> References: <77d635877e765a6b4b0935debfe5836e554572c0.1489015238.git.julia@ni.com> <78b657c5-0f6a-6481-a0cf-e241c0632c7f@broadcom.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="VrqPEDrXMn8OVzN4" Content-Disposition: inline In-Reply-To: <78b657c5-0f6a-6481-a0cf-e241c0632c7f@broadcom.com> User-Agent: Mutt/1.7.2 (2016-11-26) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-03-10_13:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1702020001 definitions=main-1703100152 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-03-10_13:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=30 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=30 reason=mlx scancount=1 engine=8.0.1-1702020001 definitions=main-1703100152 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2669 Lines: 65 --VrqPEDrXMn8OVzN4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 10, 2017 at 09:28:08AM -0800, Ray Jui wrote: > Hi Julia/Linus, > > On 3/9/2017 8:21 AM, Julia Cartwright wrote: > > The bcm-kona gpio driver currently implements an irq_chip for handling > > interrupts; due to how irq_chip handling is done, it's necessary for the > > irq_chip methods to be invoked from hardirq context, even on a a > > real-time kernel. Because the spinlock_t type becomes a "sleeping" > > spinlock w/ RT kernels, it is not suitable to be used with irq_chips. > >=20 > > A quick audit of the operations under the lock reveal that they do only > > minimal, bounded work, and are therefore safe to do under a raw spinloc= k. > > This is new to me. But it seems like, for the vast majority cases, user > can still continue to use spin_lock as it is without needing to worry > about the underlying difference between standard or RT kernels. If by "user" you mean, "driver developer", then yes. For most driver authors, the distinction between raw and non-raw spinlocks is irrelevant, they can use spinlocks and everything will work out just fine w/ mainline and on RT. > But in certain cases, e.g., irq_chips, extra care needs to be done, > i.e., swtching to use raw spin lock to make sure that it is not > blocking in the case of RT. Correct, on RT the goal is to push as much as possible into a preemptible context, including driver interrupts, etc. However, there are still codepaths which necessarily need to be executed in hardirq context, including anything necessary to support scheduling. This includes: interrupt-dispatching (irq_chips), timers, and the scheduler itself, which is why this "core" code must use the raw spinlock variants. > Is such API use change well accepted by the open source community > already? In what way is this an API change? The API isn't changing, what's changing in this patch is to fix what is an irq_chip implementation which is _currently broken_ on RT. Julia --VrqPEDrXMn8OVzN4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEgKAEF431w1EL96k9jNrC4UVNdG8FAljC//4ACgkQjNrC4UVN dG/x5ggAvhT5tl0zoDREsBiBBablzKg3wl199DoDyvb0D3TRcas4H9oKA06Tz4qj I3T1xWvynqDVPOhqi9xQEPOXNcCcbi45Jwf+ixjYZcb42aTKJWXu0iBixldGDYIQ BpDAaW6CHhhWyVcL2ZeT33fMqOhBaAZLMpInzP9NLb6wVSyeWbF2dN/sILOMUPXn DjTyRsju95+aKeyo1E21JHbAmFtgSmmdFGP52oqmrNJhfiek1NKhVFoe3iGjt0tf Idq8FcbFJIhoXNnAGHYXY3WAXOcmTHs7HIJr85KdjUkemxNgAkc/MKTbEJbd23dH 6WSI6vrFjY7Oflm6BRQ0s0hC7zTXKQ== =iVnh -----END PGP SIGNATURE----- --VrqPEDrXMn8OVzN4--