From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755439AbbITNuG (ORCPT ); Sun, 20 Sep 2015 09:50:06 -0400 Received: from mout.gmx.net ([212.227.17.22]:56438 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755293AbbITNuE (ORCPT ); Sun, 20 Sep 2015 09:50:04 -0400 Subject: Re: [PATCH v2 2/2] ARM: irqchip: mxs: add Alpascale ASM9260 support To: Marc Zyngier References: <1442567922-14538-1-git-send-email-linux@rempel-privat.de> <1442567922-14538-3-git-send-email-linux@rempel-privat.de> <20150918114256.74ab823a@arm.com> <55FCF85E.8060909@rempel-privat.de> <20150920122843.7cc93682@arm.com> Cc: linux-kernel@vger.kernel.org, jason@lakedaemon.net, tglx@linutronix.de, Oleksij Rempel From: Oleksij Rempel Message-ID: <55FEB90F.8080109@rempel-privat.de> Date: Sun, 20 Sep 2015 15:47:59 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20150920122843.7cc93682@arm.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="3Kfnt2g7q89jAgi52mK30KXaSBnGrWDbC" X-Provags-ID: V03:K0:lhSKZx1XRmKy4MTfCHSNS3I/BRztvkBGGGjJViA4o/pPJnTT0ry TobvT6gH+hCRPxvg8jmiQz/r7UnEw2JdyYjbKqPro6F9vZuto+q/rksL/p8tZfZXDrjZX3F TAwtUqcotsYWvxpjQvVg2CIB5ckdMPSlas4nAWhahMaf0yWu1YOOzYQGhhGuNfPzxm9nWeI ZND8Q0r0mgBz9CEa1041A== X-UI-Out-Filterresults: notjunk:1;V01:K0:OpLdegevxCs=:h+XDTpRs+OEt/A6WLUQKZA 4wJjjrspK4sQ7xY0ikNuajLE/J9HYtnet4PUMfy2vDa/fDposFRrC52XBZTdYK1rIk4VV955g giib0S4xCc5PWrLE8MfdGMA3e3ooBWra/0gGDvRDBAhJqlNDJeuxzpnlDsal7MJHHc95XyC6X AilZMjI93tXs5HCVRAUWZ/B0ypz7DzVt6HhycC3nuyvlwYdeMn9SRYc9t2tk0nEe7OnW1xNdj QdUaUEM/xw7EPidXIAc8EznxYqPWNKl6SihWyCGBC0oGoq/luLIK5jmXc8Nz77eLqLM7ijRay aHPZV5sLcyLW9gfDkpOEtTO0bQGECJ/togW+/x6PoXjbkY3zi36CvBB4483ObHcKUMeWZ6u/c CVWHYf3HVCjZ4vhBnOxfVA22ZrATie3biriyLzlHj49GuKFYuKUKO7LNCSeRQLYOTa6YLvKna nzPFxj3Yix7oexqoJiyP0pJY2ugLM31KhW70w++xYzJNdyjzwDaX6vn6rX1COefzlRZc5SebK vTb9DNKkzN2Yv6t41Hthna2tV5vd8C9e43edNHscrf9rNXiATnHglhmdQG4yBVGN0OPRzc4jE wvtpEAnRQpcZQ3Er35exTxZfJqMDJn1vf8xK9mWYiTUcnXhDhfbkrFcBmhuFHKZpR2595ZK9w ZM0+0DTe0xZ4wKzQwS3bZBJDhDr3aSkPWzARbvFt7SbqFDPIulqCRvGIIYV5JIjPO/HMIuCRw 3KLBQN8jcvy4bm0Y Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --3Kfnt2g7q89jAgi52mK30KXaSBnGrWDbC Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Am 20.09.2015 um 13:28 schrieb Marc Zyngier: > On Sat, 19 Sep 2015 07:53:34 +0200 > Oleksij Rempel wrote: >=20 >> Am 18.09.2015 um 12:42 schrieb Marc Zyngier: >>> On Fri, 18 Sep 2015 11:18:42 +0200 >>> Oleksij Rempel wrote: >> >=20 > [...] >=20 >>>> +static void asm9260_mask_irq(struct irq_data *d) >>>> +{ >>>> + raw_spin_lock(&icoll_lock); >>>> + __raw_writel(icoll_intr_bitshift(d, BM_ICOLL_INTR_ENABLE), >>>> + icoll_intr_reg(d) + CLR_REG); >>>> + raw_spin_unlock(&icoll_lock); >>>> +} >>>> + >>>> +static void asm9260_unmask_irq(struct irq_data *d) >>>> +{ >>>> + raw_spin_lock(&icoll_lock); >>>> + __raw_writel(ASM9260_BM_CLEAR_BIT(d->hwirq), >>>> + icoll_priv.clear + >>>> + ASM9260_HW_ICOLL_CLEARn(d->hwirq)); >>>> + >>>> + __raw_writel(icoll_intr_bitshift(d, BM_ICOLL_INTR_ENABLE), >>>> + icoll_intr_reg(d) + SET_REG); >>>> + raw_spin_unlock(&icoll_lock); >>>> +} >>> >>> Can you please explain the rational for this lock? mask/unmask use >>> different registers, and it is not obvious to me what race you are >>> trying to avoid here. >> >> Uff... in one of earliest reviews i was asked to add lock.. >> I also was asked to add asm9260 to some existing driver. Not sure if i= t >> is still making sense. >=20 > Adding or removing a lock is not about what people ask you to do. It is= > about requirements dictated by either the HW (you need to perform > a given sequence atomically with respect to another code sequence), the= > kernel, or both. So I'd like to understand what is the underlying > reason for this lock. It is not disabling interrupts, so it could end > up being called in an interrupt context -> deadlock. You right. > So either the HW requires it and you have the wrong accessors, or it > doesn't, and you can remove it. Either way, we need to know. >=20 > M. I don't see any need to lock it. --=20 Regards, Oleksij --3Kfnt2g7q89jAgi52mK30KXaSBnGrWDbC Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iF4EAREIAAYFAlX+uYMACgkQHwImuRkmbWkFkAD/eDqmnD3WoRTEReK4EKK4eFSs addmZWkY1TlybysBXO8A/i9weVVk4T+FiFjkpdpT0Qlr7f1hQlp2lYCQFHkq4XJv =bRpO -----END PGP SIGNATURE----- --3Kfnt2g7q89jAgi52mK30KXaSBnGrWDbC--