diff mbox

[tpmdd-devel] Intel NUC and fTPM issue on 4.9.2

Message ID 20170216181905.GA7257@obsidianresearch.com
State New
Headers show

Commit Message

Jason Gunthorpe Feb. 16, 2017, 6:19 p.m. UTC
On Thu, Feb 16, 2017 at 06:10:43PM +0000, Davide Guerri wrote:
>    Hey thanks for the prompt reply.
>    I think you are interested in this:
>       fed40000-fed4087f : MSFT0101:00

Are there more lines below that?

Can you apply this patch and report what the results are?


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

Comments

Davide Guerri Feb. 16, 2017, 6:26 p.m. UTC | #1
No lines including the requested range:

fed10000-fed17fff : pnp 00:06

fed18000-fed18fff : pnp 00:06

fed19000-fed19fff : pnp 00:06

fed20000-fed3ffff : pnp 00:06

fed40000-fed4087f : MSFT0101:00

fed45000-fed8ffff : pnp 00:06

fed90000-fed93fff : pnp 00:06

fee00000-fee00fff : Local APIC

This is the NUC I am using, if that can be useful.

root@vhsv1:~# cat /sys/class/dmi/id/board_name
/sys/class/dmi/id/board_version

NUC6i7KYB

H90766-404

I am compiling the module right as we speak, I will get back to you soon.

On 16 February 2017 at 18:19, Jason Gunthorpe <
jgunthorpe@obsidianresearch.com> wrote:

> On Thu, Feb 16, 2017 at 06:10:43PM +0000, Davide Guerri wrote:
> >    Hey thanks for the prompt reply.
> >    I think you are interested in this:
> >       fed40000-fed4087f : MSFT0101:00
>
> Are there more lines below that?
>
> Can you apply this patch and report what the results are?
>
> diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c
> index a7c870af916c3d..acc54a03d6025d 100644
> --- a/drivers/char/tpm/tpm_crb.c
> +++ b/drivers/char/tpm/tpm_crb.c
> @@ -233,6 +233,8 @@ static void __iomem *crb_map_res(struct device *dev,
> struct crb_priv *priv,
>                 .flags  = IORESOURCE_MEM,
>         };
>
> +       printk("map request is is %pr\n",&new_res);
> +
>         /* Detect a 64 bit address on a 32 bit system */
>         if (start != new_res.start)
>                 return (void __iomem *) ERR_PTR(-EINVAL);
> @@ -267,6 +269,8 @@ static int crb_map_io(struct acpi_device *device,
> struct crb_priv *priv,
>                 return -EINVAL;
>         }
>
> +       printk("ACPI resource is %pr\n",&io_res);
> +
>         priv->iobase = devm_ioremap_resource(dev, &io_res);
>         if (IS_ERR(priv->iobase))
>                 return PTR_ERR(priv->iobase);
>
Davide Guerri Feb. 16, 2017, 6:39 p.m. UTC | #2
[20417.678975] map request is is [mem 0xfed40040-0xfed4006f flags 0x200]

[20417.678990] map request is is [mem 0xfed40080-0xfed40fff flags 0x200]

[20417.678996] tpm_crb MSFT0101:00: can't request region for resource [mem
0xfed40080-0xfed40fff]

[20417.688797] tpm_crb: probe of MSFT0101:00 failed with error -16



On 16 February 2017 at 18:26, Davide Guerri <davide.guerri@gmail.com> wrote:

> No lines including the requested range:
>
> fed10000-fed17fff : pnp 00:06
>
> fed18000-fed18fff : pnp 00:06
>
> fed19000-fed19fff : pnp 00:06
>
> fed20000-fed3ffff : pnp 00:06
>
> fed40000-fed4087f : MSFT0101:00
>
> fed45000-fed8ffff : pnp 00:06
>
> fed90000-fed93fff : pnp 00:06
>
> fee00000-fee00fff : Local APIC
>
> This is the NUC I am using, if that can be useful.
>
> root@vhsv1:~# cat /sys/class/dmi/id/board_name /sys/class/dmi/id/board_
> version
>
> NUC6i7KYB
>
> H90766-404
>
> I am compiling the module right as we speak, I will get back to you soon.
>
> On 16 February 2017 at 18:19, Jason Gunthorpe <
> jgunthorpe@obsidianresearch.com> wrote:
>
>> On Thu, Feb 16, 2017 at 06:10:43PM +0000, Davide Guerri wrote:
>> >    Hey thanks for the prompt reply.
>> >    I think you are interested in this:
>> >       fed40000-fed4087f : MSFT0101:00
>>
>> Are there more lines below that?
>>
>> Can you apply this patch and report what the results are?
>>
>> diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c
>> index a7c870af916c3d..acc54a03d6025d 100644
>> --- a/drivers/char/tpm/tpm_crb.c
>> +++ b/drivers/char/tpm/tpm_crb.c
>> @@ -233,6 +233,8 @@ static void __iomem *crb_map_res(struct device *dev,
>> struct crb_priv *priv,
>>                 .flags  = IORESOURCE_MEM,
>>         };
>>
>> +       printk("map request is is %pr\n",&new_res);
>> +
>>         /* Detect a 64 bit address on a 32 bit system */
>>         if (start != new_res.start)
>>                 return (void __iomem *) ERR_PTR(-EINVAL);
>> @@ -267,6 +269,8 @@ static int crb_map_io(struct acpi_device *device,
>> struct crb_priv *priv,
>>                 return -EINVAL;
>>         }
>>
>> +       printk("ACPI resource is %pr\n",&io_res);
>> +
>>         priv->iobase = devm_ioremap_resource(dev, &io_res);
>>         if (IS_ERR(priv->iobase))
>>                 return PTR_ERR(priv->iobase);
>>
>
>
>
> --
>
>
> [image: Davide Guerri on about.me]
>
> Davide Guerri
> about.me/davide_guerri
>   <http://about.me/davide_guerri>
>
Davide Guerri Feb. 16, 2017, 6:40 p.m. UTC | #3
Sorry I missed 1 line:

[20417.678952] ACPI resource is [mem 0xfed40000-0xfed4087f flags 0x200]

[20417.678975] map request is is [mem 0xfed40040-0xfed4006f flags 0x200]

[20417.678990] map request is is [mem 0xfed40080-0xfed40fff flags 0x200]

[20417.678996] tpm_crb MSFT0101:00: can't request region for resource [mem
0xfed40080-0xfed40fff]

[20417.688797] tpm_crb: probe of MSFT0101:00 failed with error -16


On 16 February 2017 at 18:39, Davide Guerri <davide.guerri@gmail.com> wrote:

> [20417.678975] map request is is [mem 0xfed40040-0xfed4006f flags 0x200]
>
> [20417.678990] map request is is [mem 0xfed40080-0xfed40fff flags 0x200]
>
> [20417.678996] tpm_crb MSFT0101:00: can't request region for resource [mem
> 0xfed40080-0xfed40fff]
>
> [20417.688797] tpm_crb: probe of MSFT0101:00 failed with error -16
>
>
>
> On 16 February 2017 at 18:26, Davide Guerri <davide.guerri@gmail.com>
> wrote:
>
>> No lines including the requested range:
>>
>> fed10000-fed17fff : pnp 00:06
>>
>> fed18000-fed18fff : pnp 00:06
>>
>> fed19000-fed19fff : pnp 00:06
>>
>> fed20000-fed3ffff : pnp 00:06
>>
>> fed40000-fed4087f : MSFT0101:00
>>
>> fed45000-fed8ffff : pnp 00:06
>>
>> fed90000-fed93fff : pnp 00:06
>>
>> fee00000-fee00fff : Local APIC
>>
>> This is the NUC I am using, if that can be useful.
>>
>> root@vhsv1:~# cat /sys/class/dmi/id/board_name
>> /sys/class/dmi/id/board_version
>>
>> NUC6i7KYB
>>
>> H90766-404
>>
>> I am compiling the module right as we speak, I will get back to you soon.
>>
>> On 16 February 2017 at 18:19, Jason Gunthorpe <
>> jgunthorpe@obsidianresearch.com> wrote:
>>
>>> On Thu, Feb 16, 2017 at 06:10:43PM +0000, Davide Guerri wrote:
>>> >    Hey thanks for the prompt reply.
>>> >    I think you are interested in this:
>>> >       fed40000-fed4087f : MSFT0101:00
>>>
>>> Are there more lines below that?
>>>
>>> Can you apply this patch and report what the results are?
>>>
>>> diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c
>>> index a7c870af916c3d..acc54a03d6025d 100644
>>> --- a/drivers/char/tpm/tpm_crb.c
>>> +++ b/drivers/char/tpm/tpm_crb.c
>>> @@ -233,6 +233,8 @@ static void __iomem *crb_map_res(struct device *dev,
>>> struct crb_priv *priv,
>>>                 .flags  = IORESOURCE_MEM,
>>>         };
>>>
>>> +       printk("map request is is %pr\n",&new_res);
>>> +
>>>         /* Detect a 64 bit address on a 32 bit system */
>>>         if (start != new_res.start)
>>>                 return (void __iomem *) ERR_PTR(-EINVAL);
>>> @@ -267,6 +269,8 @@ static int crb_map_io(struct acpi_device *device,
>>> struct crb_priv *priv,
>>>                 return -EINVAL;
>>>         }
>>>
>>> +       printk("ACPI resource is %pr\n",&io_res);
>>> +
>>>         priv->iobase = devm_ioremap_resource(dev, &io_res);
>>>         if (IS_ERR(priv->iobase))
>>>                 return PTR_ERR(priv->iobase);
>>>
>>
>>
>>
>> --
>>
>>
>> [image: Davide Guerri on about.me]
>>
>> Davide Guerri
>> about.me/davide_guerri
>>   <http://about.me/davide_guerri>
>>
>
>
>
> --
>
>
> [image: Davide Guerri on about.me]
>
> Davide Guerri
> about.me/davide_guerri
>   <http://about.me/davide_guerri>
>
Jarkko Sakkinen Feb. 16, 2017, 8:27 p.m. UTC | #4
On Thu, Feb 16, 2017 at 06:26:29PM +0000, Davide Guerri wrote:
>    No lines including the requested range:
> 
>    fed10000-fed17fff : pnp 00:06
> 
>    fed18000-fed18fff : pnp 00:06
> 
>    fed19000-fed19fff : pnp 00:06
> 
>    fed20000-fed3ffff : pnp 00:06
> 
>    fed40000-fed4087f : MSFT0101:00

It really looks like that the BIOS is reporting wrong value.
Have you tried to update it?

/Jarkko

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Davide Guerri Feb. 16, 2017, 9:01 p.m. UTC | #5
> On 16 Feb 2017, at 8:27 pm, Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> wrote:
> 
> On Thu, Feb 16, 2017 at 06:26:29PM +0000, Davide Guerri wrote:
>>   No lines including the requested range:
>> 
>>   fed10000-fed17fff : pnp 00:06
>> 
>>   fed18000-fed18fff : pnp 00:06
>> 
>>   fed19000-fed19fff : pnp 00:06
>> 
>>   fed20000-fed3ffff : pnp 00:06
>> 
>>   fed40000-fed4087f : MSFT0101:00
> 
> It really looks like that the BIOS is reporting wrong value.
> Have you tried to update it?
> 
> /Jarkko

Hi Jarkko,
I apologise for having used an HTML user agent, I hadn't one configured for this account and I just used the google UI.

So, I can try upgrading it. But I wonder whether acpi_enforce_resources=lax would work around the issue.
I am trying that later and I will let you know.

Thanks,
 Davide.
------------------------------------------------------------------------------
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_crb.c b/drivers/char/tpm/tpm_crb.c
index a7c870af916c3d..acc54a03d6025d 100644
--- a/drivers/char/tpm/tpm_crb.c
+++ b/drivers/char/tpm/tpm_crb.c
@@ -233,6 +233,8 @@  static void __iomem *crb_map_res(struct device *dev, struct crb_priv *priv,
 		.flags	= IORESOURCE_MEM,
 	};
 
+	printk("map request is is %pr\n",&new_res);
+
 	/* Detect a 64 bit address on a 32 bit system */
 	if (start != new_res.start)
 		return (void __iomem *) ERR_PTR(-EINVAL);
@@ -267,6 +269,8 @@  static int crb_map_io(struct acpi_device *device, struct crb_priv *priv,
 		return -EINVAL;
 	}
 
+	printk("ACPI resource is %pr\n",&io_res);
+
 	priv->iobase = devm_ioremap_resource(dev, &io_res);
 	if (IS_ERR(priv->iobase))
 		return PTR_ERR(priv->iobase);