diff mbox

[tpmdd-devel,v2,1/3] tpm_tis: Fix IRQ autoprobing when using platform_device

Message ID 1493913205-18276-2-git-send-email-jgunthorpe@obsidianresearch.com
State New
Headers show

Commit Message

Jason Gunthorpe May 4, 2017, 3:53 p.m. UTC
The test was backwards, triggering IRQ autoprobing if the firmware
did not specify an IRQ, instead of triggering it only when the
module force parameter was specified.

Since autoprobing is not enabled on !x86 and the platform device is
currently only used on !x86, or with force, this has gone unnoticed.

Fixes: 00194826e6be ("tpm_tis: Clean up the force=1 module parameter")
Tested-by: Jerry Snitselaar <jsnitsel@redhat.com>
Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
---
 drivers/char/tpm/tpm_tis.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jarkko Sakkinen May 8, 2017, 11:45 p.m. UTC | #1
On Thu, May 04, 2017 at 09:53:23AM -0600, Jason Gunthorpe wrote:
> The test was backwards, triggering IRQ autoprobing if the firmware
> did not specify an IRQ, instead of triggering it only when the
> module force parameter was specified.
> 
> Since autoprobing is not enabled on !x86 and the platform device is
> currently only used on !x86, or with force, this has gone unnoticed.
> 
> Fixes: 00194826e6be ("tpm_tis: Clean up the force=1 module parameter")
> Tested-by: Jerry Snitselaar <jsnitsel@redhat.com>
> Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>

Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>

> ---
>  drivers/char/tpm/tpm_tis.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
> index c7e1384f1b0802..56ce2bb1916693 100644
> --- a/drivers/char/tpm/tpm_tis.c
> +++ b/drivers/char/tpm/tpm_tis.c
> @@ -336,7 +336,7 @@ static int tpm_tis_plat_probe(struct platform_device *pdev)
>  	if (res) {
>  		tpm_info.irq = res->start;
>  	} else {
> -		if (pdev == force_pdev)
> +		if (pdev != force_pdev)
>  			tpm_info.irq = -1;
>  		else
>  			/* When forcing auto probe the IRQ */
> -- 
> 2.7.4
> 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Jarkko Sakkinen May 9, 2017, 2:03 p.m. UTC | #2
On Tue, May 09, 2017 at 02:45:02AM +0300, Jarkko Sakkinen wrote:
> On Thu, May 04, 2017 at 09:53:23AM -0600, Jason Gunthorpe wrote:
> > The test was backwards, triggering IRQ autoprobing if the firmware
> > did not specify an IRQ, instead of triggering it only when the
> > module force parameter was specified.
> > 
> > Since autoprobing is not enabled on !x86 and the platform device is
> > currently only used on !x86, or with force, this has gone unnoticed.
> > 
> > Fixes: 00194826e6be ("tpm_tis: Clean up the force=1 module parameter")
> > Tested-by: Jerry Snitselaar <jsnitsel@redhat.com>
> > Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
> 
> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>

Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>

/Jarkko

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Jarkko Sakkinen May 9, 2017, 2:21 p.m. UTC | #3
On Tue, May 09, 2017 at 05:03:01PM +0300, Jarkko Sakkinen wrote:
> On Tue, May 09, 2017 at 02:45:02AM +0300, Jarkko Sakkinen wrote:
> > On Thu, May 04, 2017 at 09:53:23AM -0600, Jason Gunthorpe wrote:
> > > The test was backwards, triggering IRQ autoprobing if the firmware
> > > did not specify an IRQ, instead of triggering it only when the
> > > module force parameter was specified.
> > > 
> > > Since autoprobing is not enabled on !x86 and the platform device is
> > > currently only used on !x86, or with force, this has gone unnoticed.
> > > 
> > > Fixes: 00194826e6be ("tpm_tis: Clean up the force=1 module parameter")
> > > Tested-by: Jerry Snitselaar <jsnitsel@redhat.com>
> > > Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
> > 
> > Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> 
> Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>

Applied.

/Jarkko

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
diff mbox

Patch

diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
index c7e1384f1b0802..56ce2bb1916693 100644
--- a/drivers/char/tpm/tpm_tis.c
+++ b/drivers/char/tpm/tpm_tis.c
@@ -336,7 +336,7 @@  static int tpm_tis_plat_probe(struct platform_device *pdev)
 	if (res) {
 		tpm_info.irq = res->start;
 	} else {
-		if (pdev == force_pdev)
+		if (pdev != force_pdev)
 			tpm_info.irq = -1;
 		else
 			/* When forcing auto probe the IRQ */