lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190402050236.GV2059@sirena.org.uk>
Date:   Tue, 2 Apr 2019 12:02:36 +0700
From:   Mark Brown <broonie@...nel.org>
To:     Fletcher Woodruff <fletcherw@...omium.org>
Cc:     linux-kernel@...r.kernel.org, Ben Zhang <benzh@...omium.org>,
        Bard Liao <bardliao@...ltek.com>,
        Jaroslav Kysela <perex@...ex.cz>,
        Liam Girdwood <lgirdwood@...il.com>,
        Oder Chiou <oder_chiou@...ltek.com>,
        Takashi Iwai <tiwai@...e.com>,
        Curtis Malainey <cujomalainey@...omium.org>,
        Ross Zwisler <zwisler@...gle.org>, alsa-devel@...a-project.org
Subject: Re: [PATCH 1/2] ASoC: rt5677: allow multiple interrupt sources

On Mon, Apr 01, 2019 at 02:55:18PM -0600, Fletcher Woodruff wrote:
> From: Ben Zhang <benzh@...omium.org>
> 
> 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 = 0; loop < 20; loop++) {

This looks unrelated to the polarity of the interupt?

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ