Bug 188511

Summary: MSFT0101:00: platform device creation failure - Lenovo YOGA 900-131SK
Product: ACPI Reporter: wendy.wang
Component: Config-OtherAssignee: Chen Yu (yu.c.chen)
Status: RESOLVED PATCH_ALREADY_AVAILABLE    
Severity: normal CC: cosku.bas, lenb, lv.zheng, yu.c.chen
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: v4.9-rc6 Subsystem:
Regression: No Bisected commit-id:
Attachments: dmesg.log
acpidump.log

Description wendy.wang 2016-11-25 08:35:09 UTC
Created attachment 245881 [details]
dmesg.log

ound on SKL Lenovo YOGA 900
Platform: Lenovo YOGA 900-131SK
CPU : i5-6200U 2.30GHz (family: 6, model: 78 stepping: 3) 2Cores/4Threads 

Software
Linux : Ubuntu 14.04.04 64 bits LTS
Kernel: 4.9.0-rc6 from https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
BIOS : C6CN34WW
EC: C6EC31WW
Memory: 4G

After boot up kernel, will detect below failure in dmesg.

[    0.543858] platform MSFT0101:00: failed to claim resource 1
[    0.543862] acpi MSFT0101:00: platform device creation failed: -16

Full dmesg log and ACPI dump attached.
Comment 1 wendy.wang 2016-11-25 08:35:44 UTC
Created attachment 245891 [details]
acpidump.log
Comment 2 Len Brown 2016-11-29 00:40:57 UTC
the generic bug here is that linux should update this error message to output the actual range.

rui: acpidump suggests that resource 1 is low address region.

/proc/iomem or ioports should tell us who already claimed this resource.

then the driver bug that is running into this conflict can be diagnosed.

Can we find out if there is a functional TPM issue on this machine?
Comment 3 Chen Yu 2016-12-08 06:28:08 UTC
root@x-sklu01:/home/sky/image# cat /proc/iomem
00000000-00000fff : reserved
00001000-00057fff : System RAM
00058000-00058fff : reserved
00059000-00085fff : System RAM
00086000-000fffff : reserved
  000a0000-000bffff : PCI Bus 0000:00
  000c0000-000c3fff : PCI Bus 0000:00
  000c4000-000c7fff : PCI Bus 0000:00
  000c8000-000cbfff : PCI Bus 0000:00
  000cc000-000cffff : PCI Bus 0000:00
  000d0000-000d3fff : PCI Bus 0000:00
  000d4000-000d7fff : PCI Bus 0000:00
  000d8000-000dbfff : PCI Bus 0000:00
  000dc000-000dffff : PCI Bus 0000:00
  000f0000-000fffff : System ROM
00100000-707a0fff : System RAM
  02000000-027f0a41 : Kernel code
  027f0a42-02d6b4ff : Kernel data
  02ef1000-03050fff : Kernel bss
707a1000-707a1fff : ACPI Non-volatile Storage
707a2000-707cbfff : reserved
707cc000-70878fff : System RAM
70879000-71178fff : reserved
71179000-8738dfff : System RAM
8738e000-8758dfff : reserved
8758e000-87d7dfff : reserved
87d7e000-87f7dfff : ACPI Non-volatile Storage
87f7e000-87ffdfff : ACPI Tables
87ffe000-87ffefff : System RAM
87fff000-880fffff : reserved
88800000-8b7fffff : reserved
  89800000-8b7fffff : Graphics Stolen Memory
8b800000-dfffffff : PCI Bus 0000:00
  8b800000-8b81ffff : pnp 00:08
  90000000-9fffffff : 0000:00:02.0
  a0000000-a0ffffff : 0000:00:02.0
  a1000000-a10fffff : PCI Bus 0000:02
    a1000000-a10007ff : 0000:02:00.0
    a1001000-a1001fff : 0000:02:00.0
      a1001000-a1001fff : mmc0
  a1100000-a11fffff : PCI Bus 0000:01
    a1100000-a1101fff : 0000:01:00.0
      a1100000-a1101fff : iwlwifi
  a1200000-a120ffff : 0000:00:14.0
    a1200000-a120ffff : xhci-hcd
  a1210000-a121ffff : 0000:00:1f.3
    a1210000-a121ffff : ICH HD audio
  a1220000-a1227fff : 0000:00:04.0
  a1228000-a122bfff : 0000:00:1f.3
    a1228000-a122bfff : ICH HD audio
  a122c000-a122ffff : 0000:00:1f.2
  a1230000-a1231fff : 0000:00:17.0
    a1230000-a1231fff : ahci
  a1232000-a1232fff : 0000:00:14.2
    a1232000-a1232fff : Intel PCH thermal driver
  a1233000-a1233fff : 0000:00:15.0
    a1233000-a12331ff : lpss_dev
      a1233000-a12331ff : lpss_dev
    a1233200-a12332ff : lpss_priv
    a1233800-a1233fff : idma64.0
      a1233800-a1233fff : idma64.0
  a1234000-a1234fff : 0000:00:15.1
    a1234000-a12341ff : lpss_dev
      a1234000-a12341ff : lpss_dev
    a1234200-a12342ff : lpss_priv
    a1234800-a1234fff : idma64.1
      a1234800-a1234fff : idma64.1
  a1235000-a1235fff : 0000:00:15.3
    a1235000-a12351ff : lpss_dev
      a1235000-a12351ff : lpss_dev
    a1235200-a12352ff : lpss_priv
    a1235800-a1235fff : idma64.2
      a1235800-a1235fff : idma64.2
  a1236000-a1236fff : 0000:00:16.0
    a1236000-a1236fff : mei_me
  a1237000-a12377ff : 0000:00:17.0
    a1237000-a12377ff : ahci
  a1238000-a12380ff : 0000:00:1f.4
  a1239000-a12390ff : 0000:00:17.0
    a1239000-a12390ff : ahci
e0000000-efffffff : PCI MMCONFIG 0000 [bus 00-ff]
  e0000000-efffffff : reserved
    e0000000-efffffff : pnp 00:08
fd000000-fe7fffff : reserved
  fd000000-fe7fffff : PCI Bus 0000:00
    fd000000-fdabffff : pnp 00:00
    fdac0000-fdacffff : INT344B:00
      fdac0000-fdacffff : INT344B:00
    fdad0000-fdadffff : pnp 00:00
    fdae0000-fdaeffff : INT344B:00
      fdae0000-fdaeffff : INT344B:00
    fdaf0000-fdafffff : INT344B:00
      fdaf0000-fdafffff : INT344B:00
    fdb00000-fdffffff : pnp 00:00
    fe000000-fe01ffff : pnp 00:00
    fe036000-fe03bfff : pnp 00:00
    fe03d000-fe3fffff : pnp 00:00
    fe410000-fe7fffff : pnp 00:00
feb00000-feb03fff : reserved
fec00000-fec00fff : reserved
  fec00000-fec003ff : IOAPIC 0
fed00000-fed00fff : reserved
  fed00000-fed003ff : HPET 0
    fed00000-fed003ff : PNP0103:00
fed10000-fed19fff : reserved
  fed10000-fed17fff : pnp 00:08
  fed18000-fed18fff : pnp 00:08
  fed19000-fed19fff : pnp 00:08
fed20000-fed3ffff : pnp 00:08
fed40000-fed40fff : MSFT0101:00
fed84000-fed84fff : reserved
fed90000-fed90fff : dmar0
fed91000-fed91fff : dmar1
fee00000-fee00fff : Local APIC
  fee00000-fee00fff : reserved
ff000000-ffffffff : INT0800:00
  ffa00000-ffffffff : reserved
100000000-1737fffff : System RAM
173800000-173ffffff : RAM buffer




root@x-sklu01:/home/sky/image# cat /proc/ioports 
0000-0cf7 : PCI Bus 0000:00
  0000-001f : dma1
  0020-0021 : pic1
  0040-0043 : timer0
  0050-0053 : timer1
  0060-0060 : keyboard
  0062-0062 : PNP0C09:00
    0062-0062 : EC data
  0064-0064 : keyboard
  0066-0066 : PNP0C09:00
    0066-0066 : EC cmd
  0070-0077 : rtc0
  0080-008f : dma page reg
  00a0-00a1 : pic2
  00c0-00df : dma2
  00f0-00ff : fpu
  0680-069f : pnp 00:03
  06a0-06a0 : pnp 00:02
  06a4-06a4 : pnp 00:02
0cf8-0cff : PCI conf1
0d00-ffff : PCI Bus 0000:00
  164e-164f : pnp 00:03
  1800-18fe : pnp 00:03
    1800-1803 : ACPI PM1a_EVT_BLK
    1804-1805 : ACPI PM1a_CNT_BLK
    1808-180b : ACPI PM_TMR
    1810-1815 : ACPI CPU throttle
    1850-1850 : ACPI PM2_CNT_BLK
    1854-1857 : pnp 00:05
    1880-189f : ACPI GPE0_BLK
  2000-20fe : pnp 00:01
  3000-303f : 0000:00:02.0
  3040-305f : 0000:00:1f.4
  3060-307f : 0000:00:17.0
    3060-307f : ahci
  3080-3087 : 0000:00:17.0
    3080-3087 : ahci
  3088-308b : 0000:00:17.0
    3088-308b : ahci
  ffff-ffff : pnp 00:03
    ffff-ffff : pnp 00:03
      ffff-ffff : pnp 00:03
Comment 4 Chen Yu 2016-12-22 04:21:24 UTC
A debug patch to dump the actual conflict resource was sent at https://patchwork.kernel.org/patch/9482779/

And we have:
platform MSFT0101:00: failed to claim resource 1: [mem 0xfed40000-0xfed40fff]
 acpi MSFT0101:00: platform device creation failed: -16
However according to iomem pasted above, this range has been successfully claimed, does it mean we have duplicated MSFT0101 devices?
Comment 5 Chen Yu 2016-12-22 04:21:46 UTC
Device (TPM)
        {
            Name (_HID, "MSFT0101" /* TPM 2.0 Security Device */)  // _HID: Hardware ID
            Name (_STR, Unicode ("TPM 2.0 Device"))  // _STR: Description String
            Name (CRS, ResourceTemplate ()
            {
                Memory32Fixed (ReadOnly,
                    0x00000000,         // Address Base
                    0x00001000,         // Address Length
                    _Y00)
                Memory32Fixed (ReadOnly,
                    0xFED40000,         // Address Base
                    0x00001000,         // Address Length
                    )
            })
Comment 6 Chen Yu 2016-12-26 11:43:20 UTC
The problem is due to the base address of the resource 0 mentioned above, is filled by BIOS dynamically, which is the conflict with the resource declared at resource index 1 [0xfed40000 - 0xfed40fff].


Method (_CRS, 0, Serialized)  // _CRS: Current Resource Settings
{
    CreateDWordField (CRS, \_SB.TPM._Y00._BAS, CBAS)  // _BAS: Base Address
    CBAS = PTTB /* \PTTB */
    PTTA = PTTB /* \PTTB */
    Return (CRS) /* \_SB_.TPM_.CRS_ */
}

The value written by BIOS is determined by what filled in the CBAS, which
is read from  SystemMemory 0x87f64f98:
OperationRegion (MENV, SystemMemory, 0x87F64F98, 0x000D)
Field (MENV, AnyAcc, Lock, Preserve)
{
    MERV,   32,
    PTTS,   8,
    PTTB,   64
}
And the memory address is a bios manipulated address:
87d7e000-87f7dfff : ACPI Non-volatile Storage

As the resource has been successfully claimed, so this error does not impact
the functionality of MSTF0101.
Comment 7 Coşku Baş 2017-01-20 11:38:16 UTC
I'm having the same issue on Xiaomi Air 13 laptop as stated in issue #192501.
This issue is tagged as solved with patch but I don't see the patch except for the debugging purpose. Am I missing something?
Comment 8 Chen Yu 2017-01-22 03:23:32 UTC
(In reply to Coşku Baş from comment #7)
> I'm having the same issue on Xiaomi Air 13 laptop as stated in issue #192501.
> This issue is tagged as solved with patch but I don't see the patch except
> for the debugging purpose. Am I missing something?

You are right. This is a firmware issue, please refer to #Comment 6.