From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756037AbaIWCp0 (ORCPT ); Mon, 22 Sep 2014 22:45:26 -0400 Received: from mx1.scotdoyle.com ([23.226.141.211]:52371 "EHLO mx1.scotdoyle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752247AbaIWCpX (ORCPT ); Mon, 22 Sep 2014 22:45:23 -0400 Date: Tue, 23 Sep 2014 02:44:51 +0000 (UTC) From: Scot Doyle To: Jason Gunthorpe cc: Michael Mullin , Peter Huewe , Ashley Lai , Marcel Selhorst , Luigi Semenzato , tpmdd-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH v8] tpm_tis: verify interrupt during init In-Reply-To: <20140922171338.GB28082@obsidianresearch.com> Message-ID: References: <20140827214743.GC11183@obsidianresearch.com> <20140828165348.GE11183@obsidianresearch.com> <20140830174920.GA26218@obsidianresearch.com> <20140902172015.GD13956@obsidianresearch.com> <20140908220238.GB6204@obsidianresearch.com> <20140922171338.GB28082@obsidianresearch.com> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 22 Sep 2014, Jason Gunthorpe wrote: > On Thu, Sep 11, 2014 at 12:50:00AM +0000, Scot Doyle wrote: >> + if (!priv->irq_tested) { > > I think the sleep and check is still needed here, the IRQ delivery > could race relative to the MMIO read of completion, a sleep is the > only way we could attempt to synchronize them.. > >> + disable_interrupts(chip); >> + dev_err(chip->dev, >> + FW_BUG "TPM interrupt not working, polling instead\n"); >> + } >> + priv->irq_tested = true; >> + return rc; >> +} We re-tested this v9 patch. It has the msleep(1) added just above this section for better formatting, as well as a devm_kzalloc check in tpm_tis_init. Thanks!