1. 22 1月, 2018 2 次提交
    • M
      device property: Introduce fwnode_get_phy_mode() · b28f263b
      Marcin Wojtas 提交于
      Until now there were two almost identical functions for
      obtaining network PHY mode - of_get_phy_mode() and,
      more generic, device_get_phy_mode(). However it is not uncommon,
      that the network interface is represented as a child
      of the actual controller, hence it is not associated
      directly to any struct device, required by the latter
      routine.
      
      This commit allows for getting the PHY mode for
      children nodes in the ACPI world by introducing a new function -
      fwnode_get_phy_mode(). This commit also changes
      device_get_phy_mode() routine to be its wrapper, in order
      to prevent unnecessary duplication.
      Signed-off-by: NMarcin Wojtas <mw@semihalf.com>
      Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b28f263b
    • M
      device property: Introduce fwnode_get_mac_address() · babe2dbb
      Marcin Wojtas 提交于
      Until now there were two almost identical functions for
      obtaining MAC address - of_get_mac_address() and, more generic,
      device_get_mac_address(). However it is not uncommon,
      that the network interface is represented as a child
      of the actual controller, hence it is not associated
      directly to any struct device, required by the latter
      routine.
      
      This commit allows for getting the MAC address for
      children nodes in the ACPI world by introducing a new function -
      fwnode_get_mac_address(). This commit also changes
      device_get_mac_address() routine to be its wrapper, in order
      to prevent unnecessary duplication.
      Signed-off-by: NMarcin Wojtas <mw@semihalf.com>
      Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      babe2dbb
  2. 09 11月, 2017 1 次提交
  3. 12 10月, 2017 1 次提交
  4. 10 10月, 2017 1 次提交
    • J
      device property: Track owner device of device property · 5ab894ae
      Jarkko Nikula 提交于
      Deletion of subdevice will remove device properties associated to parent
      when they share the same firmware node after commit 478573c9 (driver
      core: Don't leak secondary fwnode on device removal).  This was observed
      with a driver adding subdevice that driver wasn't able to read device
      properties after rmmod/modprobe cycle.
      
      Consider the lifecycle of it:
      
      parent device registration
      	ACPI_COMPANION_SET()
      	device_add_properties()
      		pset_copy_set()
      		set_secondary_fwnode(dev, &p->fwnode)
      	device_add()
      
      parent probe
      	read device properties
      	ACPI_COMPANION_SET(subdevice, ACPI_COMPANION(parent))
      	device_add(subdevice)
      
      parent remove
      	device_del(subdevice)
      		device_remove_properties()
      			set_secondary_fwnode(dev, NULL);
      			pset_free()
      
      Parent device will have its primary firmware node pointing to an ACPI
      node and secondary firmware node point to device properties.
      
      ACPI_COMPANION_SET() call in parent probe will set the subdevice's
      firmware node to point to the same 'struct fwnode_handle' and the
      associated secondary firmware node, i.e. the device properties as the
      parent.
      
      When subdevice is deleted in parent remove that will remove those
      device properties and attempt to read device properties in next
      parent probe call will fail.
      
      Fix this by tracking the owner device of device properties and delete
      them only when owner device is being deleted.
      
      Fixes: 478573c9 (driver core: Don't leak secondary fwnode on device removal)
      Cc: 4.9+ <stable@vger.kernel.org> # 4.9+
      Signed-off-by: NJarkko Nikula <jarkko.nikula@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      5ab894ae
  5. 22 7月, 2017 4 次提交
  6. 12 7月, 2017 1 次提交
  7. 22 6月, 2017 5 次提交
  8. 30 3月, 2017 1 次提交
  9. 29 3月, 2017 11 次提交
  10. 07 2月, 2017 3 次提交
  11. 26 6月, 2016 1 次提交
  12. 28 4月, 2016 1 次提交
  13. 09 4月, 2016 1 次提交
  14. 18 3月, 2016 1 次提交
  15. 11 3月, 2016 1 次提交
  16. 09 3月, 2016 1 次提交
    • H
      device property: fwnode->secondary may contain ERR_PTR(-ENODEV) · 77812034
      Heikki Krogerus 提交于
      This fixes BUG triggered when fwnode->secondary is not NULL,
      but has ERR_PTR(-ENODEV) instead.
      
      BUG: unable to handle kernel paging request at ffffffffffffffed
      IP: [<ffffffff81677b86>] __fwnode_property_read_string+0x26/0x160
      PGD 200e067 PUD 2010067 PMD 0
      Oops: 0000 [#1] SMP KASAN
      Modules linked in: dwc3_pci(+) dwc3
      CPU: 0 PID: 1138 Comm: modprobe Not tainted 4.5.0-rc5+ #61
      task: ffff88015aaf5b00 ti: ffff88007b958000 task.ti: ffff88007b958000
      RIP: 0010:[<ffffffff81677b86>]  [<ffffffff81677b86>] __fwnode_property_read_string+0x26/0x160
      RSP: 0018:ffff88007b95eff8  EFLAGS: 00010246
      RAX: fffffbfffffffffd RBX: ffffffffffffffed RCX: ffff88015999cd37
      RDX: dffffc0000000000 RSI: ffffffff81e11bc0 RDI: ffffffffffffffed
      RBP: ffff88007b95f020 R08: 0000000000000000 R09: 0000000000000000
      R10: ffff88007b90f7cf R11: 0000000000000000 R12: ffff88007b95f0a0
      R13: 00000000fffffffa R14: ffffffff81e11bc0 R15: ffff880159ea37a0
      FS:  00007ff35f46c700(0000) GS:ffff88015b800000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
      CR2: ffffffffffffffed CR3: 000000007b8be000 CR4: 00000000001006f0
      Stack:
       ffff88015999cd20 ffffffff81e11bc0 ffff88007b95f0a0 ffff88007b383dd8
       ffff880159ea37a0 ffff88007b95f048 ffffffff81677d03 ffff88007b952460
       ffffffff81e11bc0 ffff88007b95f0a0 ffff88007b95f070 ffffffff81677d40
      Call Trace:
       [<ffffffff81677d03>] fwnode_property_read_string+0x43/0x50
       [<ffffffff81677d40>] device_property_read_string+0x30/0x40
      ...
      
      Fixes: 362c0b30 (device property: Fallback to secondary fwnode if primary misses the property)
      Signed-off-by: NHeikki Krogerus <heikki.krogerus@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      77812034
  17. 01 1月, 2016 2 次提交
  18. 07 12月, 2015 2 次提交