From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754368AbdGJTi7 (ORCPT ); Mon, 10 Jul 2017 15:38:59 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:57792 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752158AbdGJTi6 (ORCPT ); Mon, 10 Jul 2017 15:38:58 -0400 Date: Mon, 10 Jul 2017 21:38:56 +0200 From: Pavel Machek To: Linus Torvalds Cc: Sebastian Reichel , Thomas Gleixner , LKML , Andrew Morton , Ingo Molnar , "H. Peter Anvin" , Tony Lindgren Subject: Re: [GIT pull] irq updates for 4.13 Message-ID: <20170710193856.GA14693@amd> References: <20170710133505.eo6w73kq2327n34p@earth> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="KsGdsel6WgEHnImy" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --KsGdsel6WgEHnImy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > > This patch apparently breaks OMAP platform: > > > > 46e48e257360f0845fe17089713cbad4db611e70 is the first bad commit > > commit 46e48e257360f0845fe17089713cbad4db611e70 > > Author: Thomas Gleixner > > Date: Thu Jun 29 23:33:38 2017 +0200 > > > > genirq: Move irq resource handling out of spinlocked region > > > > Boot failure log from Droid 4: > > [ ... snip snip ..] > > > > Droid 4 boots current master again after applying the patch below > > (which is git revet of above patch, but I provide the patch, since > > it did not revet cleanly). >=20 > Hmm. Do you actually need the full revert? >=20 > I think it's only the __setup_irq() part that looks like it may be garbag= e. >=20 > For example, I think it releases the resources twice if the > __irq_set_trigger() call fails. >=20 > But it looks questionably in other ways too - notably, the change to > make the request call be in the same context as the freeing is done is > apparently done entirely for symmetry reasons, not for any actual > *reason* reasons. >=20 > So I suspect just the __setup_irq() parts should be reverted, because > they look both buggy and pointless. But the actual *real* part of the > patch was the two-liner __free_irq() part, and that looks sane to me. >=20 > So Sebastian, can you test if it's ok to revert just the __setup_irq() > part, but leave the smaller part in __free_irq() that just moves the > irq_release_resources() around at freeing time? If I understood it correctly, you wanted to test this: And yes, this is enough to fix boot on N900 for me. Thanks, Pavel commit 285358d48dec82f13fa76724bff434897883d188 Author: Pavel Date: Mon Jul 10 21:35:25 2017 +0200 diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 5624b2d..528bfc3 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -1168,14 +1168,6 @@ __setup_irq(unsigned int irq, struct irq_desc *desc,= struct irqaction *new) new->flags &=3D ~IRQF_ONESHOT; =20 mutex_lock(&desc->request_mutex); - if (!desc->action) { - ret =3D irq_request_resources(desc); - if (ret) { - pr_err("Failed to request resources for %s (irq %d) on irqchip %s\n", - new->name, irq, desc->irq_data.chip->name); - goto out_mutex; - } - } =20 chip_bus_lock(desc); =20 @@ -1279,6 +1271,13 @@ __setup_irq(unsigned int irq, struct irq_desc *desc,= struct irqaction *new) } =20 if (!shared) { + ret =3D irq_request_resources(desc); + if (ret) { + pr_err("Failed to request resources for %s (irq %d) on irqchip %s\n", + new->name, irq, desc->irq_data.chip->name); + goto out_unlock; + } + init_waitqueue_head(&desc->wait_for_threads); =20 /* Setup the type (level, edge polarity) if configured: */ @@ -1387,10 +1386,6 @@ __setup_irq(unsigned int irq, struct irq_desc *desc,= struct irqaction *new) =20 chip_bus_sync_unlock(desc); =20 - if (!desc->action) - irq_release_resources(desc); - -out_mutex: mutex_unlock(&desc->request_mutex); =20 out_thread: --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --KsGdsel6WgEHnImy Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAllj19AACgkQMOfwapXb+vI9MwCfZV1i1TffjyywDQ7EzKB/hOcN M7oAmwcL5bKY+0w+nghUqNurn6eUVfJH =Px1M -----END PGP SIGNATURE----- --KsGdsel6WgEHnImy--