linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Does probing of TIS with interrupts work
@ 2019-08-13  3:39 Stefan Berger
  2019-08-13 12:28 ` Jason Gunthorpe
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Berger @ 2019-08-13  3:39 UTC (permalink / raw)
  To: linux-integrity, Jarkko Sakkinen; +Cc: Marc-André Lureau

I have tried to get probing of TIS with interrupts to work on a module 
and I am wondering whether it works for anyone. I noticed it tries to 
probe while locality 0 is released and the TPM_CHIP_FLAG_IRQ is never 
set, so it never gets to certain places in the code. To get it to work I 
had to add a patch like this one here to tpm_tis_core_init:

@ -981,11 +1023,16 @@ int tpm_tis_core_init(struct device *dev, struct 
tpm_tis_data *priv, int irq,
                 }

                 if (irq) {
+                       tpm_chip_start(chip);
+                       printk(KERN_INFO "%s %d: chip->flags & 
TPM_CHIP_FLAG_IRQ = %x\n",
+                            __func__, __LINE__, chip->flags & 
TPM_CHIP_FLAG_IRQ);
+                       chip->flags |= TPM_CHIP_FLAG_IRQ;
                         tpm_tis_probe_irq_single(chip, intmask, 
IRQF_SHARED,
                                                  irq);
                         if (!(chip->flags & TPM_CHIP_FLAG_IRQ))
                                 dev_err(&chip->dev, FW_BUG
                                         "TPM interrupt not working, 
polling instead\n");
+                       tpm_chip_stop(chip);
                 } else {
                         tpm_tis_probe_irq(chip, intmask);
                 }


Can this be right ?

    Stefan


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Does probing of TIS with interrupts work
  2019-08-13  3:39 Does probing of TIS with interrupts work Stefan Berger
@ 2019-08-13 12:28 ` Jason Gunthorpe
  2019-08-15 21:17   ` Jarkko Sakkinen
  0 siblings, 1 reply; 4+ messages in thread
From: Jason Gunthorpe @ 2019-08-13 12:28 UTC (permalink / raw)
  To: Stefan Berger; +Cc: linux-integrity, Jarkko Sakkinen, Marc-André Lureau

On Mon, Aug 12, 2019 at 11:39:27PM -0400, Stefan Berger wrote:
> I have tried to get probing of TIS with interrupts to work on a module and I
> am wondering whether it works for anyone. I noticed it tries to probe while
> locality 0 is released and the TPM_CHIP_FLAG_IRQ is never set, so it never
> gets to certain places in the code. To get it to work I had to add a patch
> like this one here to tpm_tis_core_init:

It worked a long time ago, probably bitrotted

We should probably drop it entirely if it doesn't even work today and
nobody has complained.

Jason

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Does probing of TIS with interrupts work
  2019-08-13 12:28 ` Jason Gunthorpe
@ 2019-08-15 21:17   ` Jarkko Sakkinen
  2019-08-20 10:41     ` Stefan Berger
  0 siblings, 1 reply; 4+ messages in thread
From: Jarkko Sakkinen @ 2019-08-15 21:17 UTC (permalink / raw)
  To: Jason Gunthorpe; +Cc: Stefan Berger, linux-integrity, Marc-André Lureau

On Tue, Aug 13, 2019 at 09:28:38AM -0300, Jason Gunthorpe wrote:
> On Mon, Aug 12, 2019 at 11:39:27PM -0400, Stefan Berger wrote:
> > I have tried to get probing of TIS with interrupts to work on a module and I
> > am wondering whether it works for anyone. I noticed it tries to probe while
> > locality 0 is released and the TPM_CHIP_FLAG_IRQ is never set, so it never
> > gets to certain places in the code. To get it to work I had to add a patch
> > like this one here to tpm_tis_core_init:
> 
> It worked a long time ago, probably bitrotted
> 
> We should probably drop it entirely if it doesn't even work today and
> nobody has complained.

I'd prefer to fix this.

/Jarkko

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Does probing of TIS with interrupts work
  2019-08-15 21:17   ` Jarkko Sakkinen
@ 2019-08-20 10:41     ` Stefan Berger
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Berger @ 2019-08-20 10:41 UTC (permalink / raw)
  To: Jarkko Sakkinen, Jason Gunthorpe; +Cc: linux-integrity, Marc-André Lureau

On 8/15/19 5:17 PM, Jarkko Sakkinen wrote:
> On Tue, Aug 13, 2019 at 09:28:38AM -0300, Jason Gunthorpe wrote:
>> On Mon, Aug 12, 2019 at 11:39:27PM -0400, Stefan Berger wrote:
>>> I have tried to get probing of TIS with interrupts to work on a module and I
>>> am wondering whether it works for anyone. I noticed it tries to probe while
>>> locality 0 is released and the TPM_CHIP_FLAG_IRQ is never set, so it never
>>> gets to certain places in the code. To get it to work I had to add a patch
>>> like this one here to tpm_tis_core_init:
>> It worked a long time ago, probably bitrotted
>>
>> We should probably drop it entirely if it doesn't even work today and
>> nobody has complained.
> I'd prefer to fix this.

I'll post a patch...

     Stefan



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-08-20 10:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-13  3:39 Does probing of TIS with interrupts work Stefan Berger
2019-08-13 12:28 ` Jason Gunthorpe
2019-08-15 21:17   ` Jarkko Sakkinen
2019-08-20 10:41     ` Stefan Berger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).