public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>,
	tpmdd-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org,
	Martin Wilck <Martin.Wilck@ts.fujitsu.com>,
	Peter Huewe <peterhuewe@gmx.de>
Subject: Re: [PATCH 1/2] tpm_tis: Disable interrupt auto probing on a per-device basis
Date: Tue, 1 Dec 2015 08:17:43 +0100	[thread overview]
Message-ID: <20151201071743.GP10431@pengutronix.de> (raw)
In-Reply-To: <1448911632-20070-2-git-send-email-jgunthorpe@obsidianresearch.com>

Hello Jason,

On Mon, Nov 30, 2015 at 12:27:11PM -0700, Jason Gunthorpe wrote:
> Instead of clearing the global interrupts flag when any device
> does not have an interrupt just pass -1 through tpm_info.irq.

Is there a reason not to use 0 for the invalid irq?

> The only thing that asks for autoprobing is the force=1 path.
> 
> Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
> ---
>  drivers/char/tpm/tpm_tis.c | 16 +++++++---------
>  1 file changed, 7 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
> index 8a3509cb10da..0a2d94f3d679 100644
> --- a/drivers/char/tpm/tpm_tis.c
> +++ b/drivers/char/tpm/tpm_tis.c
> @@ -69,7 +69,7 @@ enum tis_defaults {
>  struct tpm_info {
>  	unsigned long start;
>  	unsigned long len;
> -	unsigned int irq;
> +	int irq;
>  };
>  
>  static struct tpm_info tis_default_info = {
> @@ -807,7 +807,7 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info,
>  	/* INTERRUPT Setup */
>  	init_waitqueue_head(&chip->vendor.read_queue);
>  	init_waitqueue_head(&chip->vendor.int_queue);
> -	if (interrupts) {
> +	if (interrupts && tpm_info->irq != -1) {
>  		if (tpm_info->irq) {

There is even a check for irq == 0 that could be reused maybe?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

  reply	other threads:[~2015-12-01  7:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-30 19:27 tpm_tis: Clean up force module parameter Jason Gunthorpe
2015-11-30 19:27 ` [PATCH 1/2] tpm_tis: Disable interrupt auto probing on a per-device basis Jason Gunthorpe
2015-12-01  7:17   ` Uwe Kleine-König [this message]
2015-12-01 17:26     ` Jason Gunthorpe
2015-11-30 19:27 ` [PATCH 2/2] tpm_tis: Clean up the force=1 module parameter Jason Gunthorpe
2015-12-01  7:28   ` Uwe Kleine-König
2015-12-01  8:35     ` Jarkko Sakkinen
2015-12-01 17:43       ` Jason Gunthorpe
2015-12-01 20:51         ` Jarkko Sakkinen
2015-12-01 17:35     ` Jason Gunthorpe
2015-12-01 11:50   ` [tpmdd-devel] " Wilck, Martin
2015-12-01 17:39     ` Jason Gunthorpe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151201071743.GP10431@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=Martin.Wilck@ts.fujitsu.com \
    --cc=jarkko.sakkinen@linux.intel.com \
    --cc=jgunthorpe@obsidianresearch.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterhuewe@gmx.de \
    --cc=tpmdd-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox