Skip to contentSkip to conversation

tpm: Switch to platform_get_irq_optional()

PATCH Superseded Hans de Goede 3 participants 14 messages Oct 19, 2019 – Oct 28, 2019

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tpm: Switch to platform_get_irq_optional()

Since commit 7723f4c5ecdb ("driver core: platform: Add an error message to platform_get_irq*()"), platform_get_irq() will call dev_err() on an error, as the IRQ usage in the tpm_tis driver is optional, this is undesirable.

Specifically this leads to this new false-positive error being logged:

[    5.135413] tpm_tis MSFT0101:00: IRQ index 0 not found

This commit switches to platform_get_irq_optional(), which does not log an error, fixing this.

---
 drivers/char/tpm/tpm_tis.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/tpm/tpm_tis.c +1 -1
index e4fdde93ed4c..e7df342a317d 100644
@@ -286,7 +286,7 @@ static int tpm_tis_plat_probe(struct platform_device *pdev)
 	}
 	tpm_info.res = *res;
 
-	tpm_info.irq = platform_get_irq(pdev, 0);
+	tpm_info.irq = platform_get_irq_optional(pdev, 0);
 	if (tpm_info.irq <= 0) {
 		if (pdev != force_pdev)
 			tpm_info.irq = -1;
Signature · 1 line
2.23.0
#1 lore raw
Quoted 3 lines · Hans de Goede

Since commit 7723f4c5ecdb ("driver core: platform: Add an error message to platform_get_irq*()"), platform_get_irq() will call dev_err() on an error, as the IRQ usage in the tpm_tis driver is optional, this is undesirable.

This should have a fixes line for the above, or maybe the commit that addtion the _optional version..

Jason

#2 lore raw
Quoted 7 lines · Jason Gunthorpe
Quoted 3 lines · Hans de Goede

Since commit 7723f4c5ecdb ("driver core: platform: Add an error message to platform_get_irq*()"), platform_get_irq() will call dev_err() on an error, as the IRQ usage in the tpm_tis driver is optional, this is undesirable.

This should have a fixes line for the above, or maybe the commit that addtion the _optional version..

Is this fixing something?

/Jarkko

#3 lore raw
Quoted 10 lines · Jarkko Sakkinen
Quoted 7 lines · Jason Gunthorpe
Quoted 3 lines · Hans de Goede

Since commit 7723f4c5ecdb ("driver core: platform: Add an error message to platform_get_irq*()"), platform_get_irq() will call dev_err() on an error, as the IRQ usage in the tpm_tis driver is optional, this is undesirable.

This should have a fixes line for the above, or maybe the commit that addtion the _optional version..

Is this fixing something?

Yes, an earlier commit caused new bogus warnings to appear, this is fixing that regression

Jason

#4 lore raw
In reply to Hans de Goede
Quoted 11 lines · Hans de Goede

Since commit 7723f4c5ecdb ("driver core: platform: Add an error message to platform_get_irq*()"), platform_get_irq() will call dev_err() on an error, as the IRQ usage in the tpm_tis driver is optional, this is undesirable.

Specifically this leads to this new false-positive error being logged:

[    5.135413] tpm_tis MSFT0101:00: IRQ index 0 not found

This commit switches to platform_get_irq_optional(), which does not log an error, fixing this.

Cc <[email protected]> # 5.4.x

Incorrect format (should be wo '<' and '>').

Also, not sure why this should be backported to stable kernel anyway.

/Jarkko

#5 lore raw

Hi,

Quoted 8 lines · Jarkko Sakkinen
Quoted 7 lines · Hans de Goede

Since commit 7723f4c5ecdb ("driver core: platform: Add an error message to platform_get_irq*()"), platform_get_irq() will call dev_err() on an error, as the IRQ usage in the tpm_tis driver is optional, this is undesirable.

Specifically this leads to this new false-positive error being logged:

[    5.135413] tpm_tis MSFT0101:00: IRQ index 0 not found
Quoted 6 lines
Quoted 4 lines

This commit switches to platform_get_irq_optional(), which does not log an error, fixing this.

Cc <[email protected]> # 5.4.x

Incorrect format (should be wo '<' and '>').

According to:

https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html

the '<' and '>' should be added when adding a # <kerner>

Quoted 1 line

Also, not sure why this should be backported to stable kernel anyway.

Because false-positive error messages are bad and cause users to file false-positive bug-reports.

Regards,

Hans

#6 lore raw
Quoted 16 lines · Hans de Goede

Hi,

Quoted 13 lines · Jarkko Sakkinen
Quoted 11 lines · Hans de Goede

Since commit 7723f4c5ecdb ("driver core: platform: Add an error message to platform_get_irq*()"), platform_get_irq() will call dev_err() on an error, as the IRQ usage in the tpm_tis driver is optional, this is undesirable.

Specifically this leads to this new false-positive error being logged:

[    5.135413] tpm_tis MSFT0101:00: IRQ index 0 not found

This commit switches to platform_get_irq_optional(), which does not log an error, fixing this.

Cc <[email protected]> # 5.4.x
Quoted 7 lines
Quoted 1 line

Incorrect format (should be wo '<' and '>').

According to:

https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html

the '<' and '>' should be added when adding a # <kerner>

OK, right so it was. This first patch that I'm reviewing with such commit.

Quoted 4 lines
Quoted 1 line

Also, not sure why this should be backported to stable kernel anyway.

Because false-positive error messages are bad and cause users to file false-positive bug-reports.

Neither categorizes into a regression albeit being unfortunate glitches.

/Jarkko

#7 lore raw

Hi,

Quoted 28 lines · Jarkko Sakkinen
Quoted 16 lines · Hans de Goede

Hi,

Quoted 13 lines · Jarkko Sakkinen
Quoted 11 lines · Hans de Goede

Since commit 7723f4c5ecdb ("driver core: platform: Add an error message to platform_get_irq*()"), platform_get_irq() will call dev_err() on an error, as the IRQ usage in the tpm_tis driver is optional, this is undesirable.

Specifically this leads to this new false-positive error being logged:

[    5.135413] tpm_tis MSFT0101:00: IRQ index 0 not found

This commit switches to platform_get_irq_optional(), which does not log an error, fixing this.

Cc <[email protected]> # 5.4.x
Quoted 7 lines
Quoted 1 line

Incorrect format (should be wo '<' and '>').

According to:

https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html

the '<' and '>' should be added when adding a # <kerner>

OK, right so it was. This first patch that I'm reviewing with such commit.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Also, not sure why this should be backported to stable kernel anyway.

Because false-positive error messages are bad and cause users to file false-positive bug-reports.

Neither categorizes into a regression albeit being unfortunate glitches.

The stable series also does other small fixes, such as adding new pci/usb-ids, etc. This clearly falls within this. IMHO ideally this should go to a 5.4-rc# making the whole discussion moot, but since I was afraid it would not make 5.4, I added the Cc: stable.

Regards,

Hans

#8 lore raw
Quoted 36 lines · Hans de Goede

Hi,

Quoted 33 lines · Jarkko Sakkinen
Quoted 16 lines · Hans de Goede

Hi,

Quoted 13 lines · Jarkko Sakkinen
Quoted 11 lines · Hans de Goede

Since commit 7723f4c5ecdb ("driver core: platform: Add an error message to platform_get_irq*()"), platform_get_irq() will call dev_err() on an error, as the IRQ usage in the tpm_tis driver is optional, this is undesirable.

Specifically this leads to this new false-positive error being logged:

[    5.135413] tpm_tis MSFT0101:00: IRQ index 0 not found

This commit switches to platform_get_irq_optional(), which does not log an error, fixing this.

Cc <[email protected]> # 5.4.x
Quoted 7 lines
Quoted 1 line

Incorrect format (should be wo '<' and '>').

According to:

https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html

the '<' and '>' should be added when adding a # <kerner>

OK, right so it was. This first patch that I'm reviewing with such commit.

Quoted 4 lines
Quoted 1 line

Also, not sure why this should be backported to stable kernel anyway.

Because false-positive error messages are bad and cause users to file false-positive bug-reports.

Quoted 7 lines
Quoted 2 lines

Neither categorizes into a regression albeit being unfortunate glitches.

The stable series also does other small fixes, such as adding new pci/usb-ids, etc. This clearly falls within this. IMHO ideally this should go to a 5.4-rc# making the whole discussion moot, but since I was afraid it would not make 5.4, I added the Cc: stable.

I get adding PCI/USB id as it extends the hardware support for the stable kernel without risking its stability. This patch is factors less useful.

/Jarkko

#9 lore raw

Hi,

Quoted 40 lines · Jarkko Sakkinen
Quoted 39 lines · Hans de Goede

Hi,

Quoted 35 lines · Jarkko Sakkinen
Quoted 16 lines · Hans de Goede

Hi,

Quoted 13 lines · Jarkko Sakkinen
Quoted 11 lines · Hans de Goede

Since commit 7723f4c5ecdb ("driver core: platform: Add an error message to platform_get_irq*()"), platform_get_irq() will call dev_err() on an error, as the IRQ usage in the tpm_tis driver is optional, this is undesirable.

Specifically this leads to this new false-positive error being logged:

[    5.135413] tpm_tis MSFT0101:00: IRQ index 0 not found

This commit switches to platform_get_irq_optional(), which does not log an error, fixing this.

Cc <[email protected]> # 5.4.x
Quoted 7 lines
Quoted 1 line

Incorrect format (should be wo '<' and '>').

According to:

https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html

the '<' and '>' should be added when adding a # <kerner>

OK, right so it was. This first patch that I'm reviewing with such commit.

Quoted 4 lines
Quoted 1 line

Also, not sure why this should be backported to stable kernel anyway.

Because false-positive error messages are bad and cause users to file false-positive bug-reports.

Neither categorizes into a regression albeit being unfortunate glitches.

Quoted 8 lines
Quoted 4 lines

The stable series also does other small fixes, such as adding new pci/usb-ids, etc. This clearly falls within this. IMHO ideally this should go to a 5.4-rc# making the whole discussion moot, but since I was afraid it would not make 5.4, I added the Cc: stable.

I get adding PCI/USB id as it extends the hardware support for the stable kernel without risking its stability. This patch is factors less useful.

It also has about 0% chance of causing regressions and it does help to avoid false--positive bug reports.

TBH I'm quite surprised we are even having this discussion...

Regards,

Hans

#10 lore raw
Quoted 52 lines · Hans de Goede

Hi,

Quoted 40 lines · Jarkko Sakkinen
Quoted 39 lines · Hans de Goede

Hi,

Quoted 35 lines · Jarkko Sakkinen
Quoted 16 lines · Hans de Goede

Hi,

Quoted 13 lines · Jarkko Sakkinen
Quoted 11 lines · Hans de Goede

Since commit 7723f4c5ecdb ("driver core: platform: Add an error message to platform_get_irq*()"), platform_get_irq() will call dev_err() on an error, as the IRQ usage in the tpm_tis driver is optional, this is undesirable.

Specifically this leads to this new false-positive error being logged:

[    5.135413] tpm_tis MSFT0101:00: IRQ index 0 not found

This commit switches to platform_get_irq_optional(), which does not log an error, fixing this.

Cc <[email protected]> # 5.4.x
Quoted 7 lines
Quoted 1 line

Incorrect format (should be wo '<' and '>').

According to:

https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html

the '<' and '>' should be added when adding a # <kerner>

OK, right so it was. This first patch that I'm reviewing with such commit.

Quoted 4 lines
Quoted 1 line

Also, not sure why this should be backported to stable kernel anyway.

Because false-positive error messages are bad and cause users to file false-positive bug-reports.

Neither categorizes into a regression albeit being unfortunate glitches.

Quoted 8 lines
Quoted 4 lines

The stable series also does other small fixes, such as adding new pci/usb-ids, etc. This clearly falls within this. IMHO ideally this should go to a 5.4-rc# making the whole discussion moot, but since I was afraid it would not make 5.4, I added the Cc: stable.

I get adding PCI/USB id as it extends the hardware support for the stable kernel without risking its stability. This patch is factors less useful.

Quoted 8 lines

It also has about 0% chance of causing regressions and it does help to avoid false--positive bug reports.

TBH I'm quite surprised we are even having this discussion...

Regards,

Hans

Why do you think that way?

I mean the commit does not even have a fixes line. It already obviously implies that this kind of discussion is mandatory. Your reasoning in this discussion does make sense. The problem is really the commit message supplied.

I'd guess something like this would be more appropriate:

"
platform_get_irq() calls dev_err() on an error. As the IRQ usage in the tpm_tis driver is optional, this is undesirable.

Specifically this leads to this new false-positive error being logged:

[    5.135413] tpm_tis MSFT0101:00: IRQ index 0 not found

This commit switches to platform_get_irq_optional(), which does not log an error, fixing this.

Fixes 7723f4c5ecdb ("driver core: platform: Add an error message to platform_get_irq*()"
Cc <[email protected]> # 5.4.x

"

You should confirm this by sending v2 either what I proposed unmodified or with the changes that you see appropriate.

/Jarkko

#11 lore raw
Quoted 16 lines · Jarkko Sakkinen

Why do you think that way?

I mean the commit does not even have a fixes line. It already obviously implies that this kind of discussion is mandatory. Your reasoning in this discussion does make sense. The problem is really the commit message supplied.

I'd guess something like this would be more appropriate:

"
platform_get_irq() calls dev_err() on an error. As the IRQ usage in the tpm_tis driver is optional, this is undesirable.

Specifically this leads to this new false-positive error being logged:

[    5.135413] tpm_tis MSFT0101:00: IRQ index 0 not found
Quoted 7 lines

This commit switches to platform_get_irq_optional(), which does not log an error, fixing this.

Fixes 7723f4c5ecdb ("driver core: platform: Add an error message to platform_get_irq*()"
Cc <[email protected]> # 5.4.x

"

This is much better, yes

Jason

#12 lore raw
In reply to Jarkko Sakkinen

Hi,

Quoted 81 lines · Jarkko Sakkinen
Quoted 52 lines · Hans de Goede

Hi,

Quoted 40 lines · Jarkko Sakkinen
Quoted 39 lines · Hans de Goede

Hi,

Quoted 35 lines · Jarkko Sakkinen
Quoted 16 lines · Hans de Goede

Hi,

Quoted 13 lines · Jarkko Sakkinen
Quoted 11 lines · Hans de Goede

Since commit 7723f4c5ecdb ("driver core: platform: Add an error message to platform_get_irq*()"), platform_get_irq() will call dev_err() on an error, as the IRQ usage in the tpm_tis driver is optional, this is undesirable.

Specifically this leads to this new false-positive error being logged:

[    5.135413] tpm_tis MSFT0101:00: IRQ index 0 not found

This commit switches to platform_get_irq_optional(), which does not log an error, fixing this.

Cc <[email protected]> # 5.4.x
Quoted 7 lines
Quoted 1 line

Incorrect format (should be wo '<' and '>').

According to:

https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html

the '<' and '>' should be added when adding a # <kerner>

OK, right so it was. This first patch that I'm reviewing with such commit.

Quoted 4 lines
Quoted 1 line

Also, not sure why this should be backported to stable kernel anyway.

Because false-positive error messages are bad and cause users to file false-positive bug-reports.

Neither categorizes into a regression albeit being unfortunate glitches.

Quoted 8 lines
Quoted 4 lines

The stable series also does other small fixes, such as adding new pci/usb-ids, etc. This clearly falls within this. IMHO ideally this should go to a 5.4-rc# making the whole discussion moot, but since I was afraid it would not make 5.4, I added the Cc: stable.

I get adding PCI/USB id as it extends the hardware support for the stable kernel without risking its stability. This patch is factors less useful.

Quoted 8 lines

It also has about 0% chance of causing regressions and it does help to avoid false--positive bug reports.

TBH I'm quite surprised we are even having this discussion...

Regards,

Hans

Why do you think that way?

I mean the commit does not even have a fixes line. It already obviously implies that this kind of discussion is mandatory. Your reasoning in this discussion does make sense. The problem is really the commit message supplied.

I'd guess something like this would be more appropriate:

"
platform_get_irq() calls dev_err() on an error. As the IRQ usage in the tpm_tis driver is optional, this is undesirable.

Specifically this leads to this new false-positive error being logged:

[    5.135413] tpm_tis MSFT0101:00: IRQ index 0 not found

This commit switches to platform_get_irq_optional(), which does not log an error, fixing this.

Quoted 7 lines
Fixes 7723f4c5ecdb ("driver core: platform: Add an error message to platform_get_irq*()"
Cc <[email protected]> # 5.4.x

"

You should confirm this by sending v2 either what I proposed unmodified or with the changes that you see appropriate.

Ok, this is fine with me, I will send v2 with the updated commit msg right away.

Regards,

Hans

#13 lore raw
Quoted 1 line · Hans de Goede

Ok, this is fine with me, I will send v2 with the updated commit msg right away.

Thank you, appreciate it.

/Jarkko