Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp960585yba; Mon, 1 Apr 2019 22:28:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqz4qMF5TKi/UjJYv+N4HH330MXjyX05XNb9L636Gs8pwwyPaOvycpj4y2LibfI9+Ffy4sC1 X-Received: by 2002:a17:902:a506:: with SMTP id s6mr43874592plq.164.1554182908456; Mon, 01 Apr 2019 22:28:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554182908; cv=none; d=google.com; s=arc-20160816; b=fUa3QByby4X+DYEvNcnC9ygepbSKYzBOTnsBWRFpANJEcECAq3upDnXaq/GPEyRwGK WPUANNBAdFjO+3vzX6Q2C2M+ZF9XWNUSEHXvf4Zir6RquQTUv4hUhGTvHYLQpiv6PDB6 SkoFdvsxbFonmTWSQF9S90srWUTxE7k2eO5ImFyxc3UHvjJlB72qsLEgltFd5cmsKspv dwjUXjS4l2wV+5Cf6a3JfiSPQz4g4M6TZyhTsTYtIj7hjrnCHQr3A2G+LSxozm+HQ0hI VZPUuRT5owjkeRNtfnMyBF6t37kGr6gQ+EWYHyzdzv6XWcp3OluvGHqmBooofccLgyYD kuBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=j7IHpX2GPG5fzUrXw3WYr+TuhDMj45BXnkN5xylkgek=; b=K9N1jsyideCw+wqA8XLGsxK8QGFdWtj7HqXlyklc08FnaBs4fhBuKkSejKr/Bl3Tju 3Nsd5qEp1rCmymKWf4t66stXCYKJEY1wreANGAyTjUjvXSfSuH36U5ixhAZW8qDH9eLa zJIymUS4aWavcS7ReCGWRMfG9+b0Nesi4i+/F/B3Z0cKPftxorGDe3EL5UIq8+m23IUB 2Lc87b20rRWNfUzwAsGcwPq6+YUAirG1KElaOYkalJt1+1kryDR9crTfAH4tsfMZAY2a gFdOTTCJ4Whs8DltMor5ghdkJOxXnyjozrkuzeTvUQMjdIGUK63RvVgwCx0MUH+OvIQQ ZAFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b="WkOl3so/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z6si10156036plo.372.2019.04.01.22.28.13; Mon, 01 Apr 2019 22:28:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b="WkOl3so/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728722AbfDBFDP (ORCPT + 99 others); Tue, 2 Apr 2019 01:03:15 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:57800 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725778AbfDBFDO (ORCPT ); Tue, 2 Apr 2019 01:03:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=j7IHpX2GPG5fzUrXw3WYr+TuhDMj45BXnkN5xylkgek=; b=WkOl3so/abOlVoFrT9N+KsfSj 9zjDH5ZIHEi2QBgNyCJKXkOcfsjFhnHjy36Two3GQz2EUZuCRF5a3/tdNh9XeUntt8h1MUhLFHUbI HIji0D3KYcbhkYf+Cnt+pV9rmmKAHc4adGfa9dTyTYAgoSpUN8LTkGe0bSs9/6SknwtEE=; Received: from [147.50.13.10] (helo=finisterre.ee.mobilebroadband) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hBBZH-0005oA-Ub; Tue, 02 Apr 2019 05:02:40 +0000 Received: by finisterre.ee.mobilebroadband (Postfix, from userid 1000) id 33CCC440082; Tue, 2 Apr 2019 06:02:36 +0100 (BST) Date: Tue, 2 Apr 2019 12:02:36 +0700 From: Mark Brown To: Fletcher Woodruff Cc: linux-kernel@vger.kernel.org, Ben Zhang , Bard Liao , Jaroslav Kysela , Liam Girdwood , Oder Chiou , Takashi Iwai , Curtis Malainey , Ross Zwisler , alsa-devel@alsa-project.org Subject: Re: [PATCH 1/2] ASoC: rt5677: allow multiple interrupt sources Message-ID: <20190402050236.GV2059@sirena.org.uk> References: <20190401205519.34023-1-fletcherw@chromium.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="mmR5Tf+WJGm+vTLg" Content-Disposition: inline In-Reply-To: <20190401205519.34023-1-fletcherw@chromium.org> X-Cookie: Use extra care when cleaning on stairs. User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --mmR5Tf+WJGm+vTLg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 01, 2019 at 02:55:18PM -0600, Fletcher Woodruff wrote: > From: Ben Zhang >=20 > This patch allows headphone plug detect and mic present > detect to be enabled at the same time. This patch implements > an irq_chip with irq_domain directly instead of using > regmap_irq, so that interrupt source line polarities can > be flipped to support irq sharing. regmap-irq should support active high/low, and if it doesn't it can't be a unique thing that only this device wants to implement so the common code should be improved. > + mutex_lock(&rt5677->irq_lock); > + /* > + * Loop to handle interrupts until the last i2c read shows no pending > + * irqs. The interrupt line is shared by multiple interrupt sources. > + * After the regmap_read() below, a new interrupt source line may > + * become high before the regmap_write() finishes, so there isn't a > + * rising edge on the shared interrupt line for the new interrupt. Thus, > + * the loop is needed to avoid missing irqs. > + * > + * A safeguard of 20 loops is used to avoid hanging in the irq handler > + * if there is something wrong with the interrupt status update. The > + * interrupt sources here are audio jack plug/unplug events which > + * shouldn't happen at a high frequency for a long period of time. > + * Empirically, more than 3 loops have never been seen. > + */ > + for (loop =3D 0; loop < 20; loop++) { This looks unrelated to the polarity of the interupt? --mmR5Tf+WJGm+vTLg Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlyi7OkACgkQJNaLcl1U h9Afkwf9FdntMljkuxjoO7lunLTOducb+/sCgTez1Cy1B56H0fZt54s0CAaHFK+9 qmaurcnS5BN4G4nEsLsYuMcgsGnIzUB6cgsg74F1V9YiO61mAieDQyC7WyIFwnPp SK90F7ZZbbgqepooqtQLtRikLnuPOANRpxH1V44OKuKbsleUCkleJAQ8z7wT9Hnb bw+b0vYVi6Zu0ylneUhjekCh3ICYwfMW87/pWlKxGWcKGcPMz23jfDHpHz1g1iCp c2r8Z45+N4vc8/gDsX6g0Pef9MrRPl1IZXS6FuFlXoY+LDt0x/ng5cggaaXYkHi3 v8MhUyHQu7OOI7LS1+AHZ78vKSeKCA== =k5Nd -----END PGP SIGNATURE----- --mmR5Tf+WJGm+vTLg--