1. 08 2月, 2021 2 次提交
  2. 27 1月, 2021 1 次提交
  3. 12 1月, 2021 1 次提交
  4. 03 11月, 2020 1 次提交
  5. 28 10月, 2020 2 次提交
  6. 15 10月, 2020 1 次提交
  7. 14 10月, 2020 1 次提交
    • D
      drivers/base: make device_find_child_by_name() compatible with sysfs inputs · c77f520d
      Dan Williams 提交于
      Use sysfs_streq() in device_find_child_by_name() to allow it to use a
      sysfs input string that might contain a trailing newline.
      
      The other "device by name" interfaces,
      {bus,driver,class}_find_device_by_name(), already account for sysfs
      strings.
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Reviewed-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Ard Biesheuvel <ardb@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Ben Skeggs <bskeggs@redhat.com>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: Brice Goglin <Brice.Goglin@inria.fr>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Dave Jiang <dave.jiang@intel.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Hulk Robot <hulkci@huawei.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Ira Weiny <ira.weiny@intel.com>
      Cc: Jason Gunthorpe <jgg@mellanox.com>
      Cc: Jason Yan <yanaijie@huawei.com>
      Cc: Jeff Moyer <jmoyer@redhat.com>
      Cc: "Jérôme Glisse" <jglisse@redhat.com>
      Cc: Jia He <justin.he@arm.com>
      Cc: Joao Martins <joao.m.martins@oracle.com>
      Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: kernel test robot <lkp@intel.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Mike Rapoport <rppt@linux.ibm.com>
      Cc: Paul Mackerras <paulus@ozlabs.org>
      Cc: Pavel Tatashin <pasha.tatashin@soleen.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
      Cc: Randy Dunlap <rdunlap@infradead.org>
      Cc: Stefano Stabellini <sstabellini@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Tom Lendacky <thomas.lendacky@amd.com>
      Cc: Vishal Verma <vishal.l.verma@intel.com>
      Cc: Vivek Goyal <vgoyal@redhat.com>
      Cc: Wei Yang <richard.weiyang@linux.alibaba.com>
      Cc: Will Deacon <will@kernel.org>
      Link: https://lkml.kernel.org/r/159643102106.4062302.12229802117645312104.stgit@dwillia2-desk3.amr.corp.intel.com
      Link: https://lkml.kernel.org/r/160106114576.30709.2960091665444712180.stgit@dwillia2-desk3.amr.corp.intel.comSigned-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c77f520d
  8. 02 10月, 2020 3 次提交
    • J
      drivers core: Miscellaneous changes for sysfs_emit · 948b3edb
      Joe Perches 提交于
      Change additional instances that could use sysfs_emit and sysfs_emit_at
      that the coccinelle script could not convert.
      
      o macros creating show functions with ## concatenation
      o unbound sprintf uses with buf+len for start of output to sysfs_emit_at
      o returns with ?: tests and sprintf to sysfs_emit
      o sysfs output with struct class * not struct device * arguments
      
      Miscellanea:
      
      o remove unnecessary initializations around these changes
      o consistently use int len for return length of show functions
      o use octal permissions and not S_<FOO>
      o rename a few show function names so DEVICE_ATTR_<FOO> can be used
      o use DEVICE_ATTR_ADMIN_RO where appropriate
      o consistently use const char *output for strings
      o checkpatch/style neatening
      Signed-off-by: NJoe Perches <joe@perches.com>
      Link: https://lore.kernel.org/r/8bc24444fe2049a9b2de6127389b57edfdfe324d.1600285923.git.joe@perches.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      948b3edb
    • J
      drivers core: Remove strcat uses around sysfs_emit and neaten · 973c3911
      Joe Perches 提交于
      strcat is no longer necessary for sysfs_emit and sysfs_emit_at uses.
      
      Convert the strcat uses to sysfs_emit calls and neaten other block
      uses of direct returns to use an intermediate const char *.
      Signed-off-by: NJoe Perches <joe@perches.com>
      Link: https://lore.kernel.org/r/5d606519698ce4c8f1203a2b35797d8254c6050a.1600285923.git.joe@perches.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      973c3911
    • J
      drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions · aa838896
      Joe Perches 提交于
      Convert the various sprintf fmaily calls in sysfs device show functions
      to sysfs_emit and sysfs_emit_at for PAGE_SIZE buffer safety.
      
      Done with:
      
      $ spatch -sp-file sysfs_emit_dev.cocci --in-place --max-width=80 .
      
      And cocci script:
      
      $ cat sysfs_emit_dev.cocci
      @@
      identifier d_show;
      identifier dev, attr, buf;
      @@
      
      ssize_t d_show(struct device *dev, struct device_attribute *attr, char *buf)
      {
      	<...
      	return
      -	sprintf(buf,
      +	sysfs_emit(buf,
      	...);
      	...>
      }
      
      @@
      identifier d_show;
      identifier dev, attr, buf;
      @@
      
      ssize_t d_show(struct device *dev, struct device_attribute *attr, char *buf)
      {
      	<...
      	return
      -	snprintf(buf, PAGE_SIZE,
      +	sysfs_emit(buf,
      	...);
      	...>
      }
      
      @@
      identifier d_show;
      identifier dev, attr, buf;
      @@
      
      ssize_t d_show(struct device *dev, struct device_attribute *attr, char *buf)
      {
      	<...
      	return
      -	scnprintf(buf, PAGE_SIZE,
      +	sysfs_emit(buf,
      	...);
      	...>
      }
      
      @@
      identifier d_show;
      identifier dev, attr, buf;
      expression chr;
      @@
      
      ssize_t d_show(struct device *dev, struct device_attribute *attr, char *buf)
      {
      	<...
      	return
      -	strcpy(buf, chr);
      +	sysfs_emit(buf, chr);
      	...>
      }
      
      @@
      identifier d_show;
      identifier dev, attr, buf;
      identifier len;
      @@
      
      ssize_t d_show(struct device *dev, struct device_attribute *attr, char *buf)
      {
      	<...
      	len =
      -	sprintf(buf,
      +	sysfs_emit(buf,
      	...);
      	...>
      	return len;
      }
      
      @@
      identifier d_show;
      identifier dev, attr, buf;
      identifier len;
      @@
      
      ssize_t d_show(struct device *dev, struct device_attribute *attr, char *buf)
      {
      	<...
      	len =
      -	snprintf(buf, PAGE_SIZE,
      +	sysfs_emit(buf,
      	...);
      	...>
      	return len;
      }
      
      @@
      identifier d_show;
      identifier dev, attr, buf;
      identifier len;
      @@
      
      ssize_t d_show(struct device *dev, struct device_attribute *attr, char *buf)
      {
      	<...
      	len =
      -	scnprintf(buf, PAGE_SIZE,
      +	sysfs_emit(buf,
      	...);
      	...>
      	return len;
      }
      
      @@
      identifier d_show;
      identifier dev, attr, buf;
      identifier len;
      @@
      
      ssize_t d_show(struct device *dev, struct device_attribute *attr, char *buf)
      {
      	<...
      -	len += scnprintf(buf + len, PAGE_SIZE - len,
      +	len += sysfs_emit_at(buf, len,
      	...);
      	...>
      	return len;
      }
      
      @@
      identifier d_show;
      identifier dev, attr, buf;
      expression chr;
      @@
      
      ssize_t d_show(struct device *dev, struct device_attribute *attr, char *buf)
      {
      	...
      -	strcpy(buf, chr);
      -	return strlen(buf);
      +	return sysfs_emit(buf, chr);
      }
      Signed-off-by: NJoe Perches <joe@perches.com>
      Link: https://lore.kernel.org/r/3d033c33056d88bbe34d4ddb62afd05ee166ab9a.1600285923.git.joe@perches.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      aa838896
  9. 22 9月, 2020 1 次提交
  10. 18 9月, 2020 1 次提交
  11. 17 9月, 2020 1 次提交
  12. 05 9月, 2020 2 次提交
  13. 22 8月, 2020 1 次提交
  14. 30 7月, 2020 2 次提交
  15. 25 7月, 2020 1 次提交
  16. 23 7月, 2020 1 次提交
  17. 10 7月, 2020 5 次提交
  18. 18 6月, 2020 1 次提交
  19. 27 5月, 2020 1 次提交
    • S
      driver core: Update device link status correctly for SYNC_STATE_ONLY links · 8c3e315d
      Saravana Kannan 提交于
      When SYNC_STATE_ONLY support was added in commit 05ef983e ("driver
      core: Add device link support for SYNC_STATE_ONLY flag"),
      SYNC_STATE_ONLY links were treated similar to STATELESS links in terms
      of not blocking consumer probe if the supplier hasn't probed yet.
      
      That caused a SYNC_STATE_ONLY device link's status to not get updated.
      Since SYNC_STATE_ONLY device link is no longer useful once the
      consumer probes, commit 21c27f06 ("driver core: Fix
      SYNC_STATE_ONLY device link implementation") addresses the status
      update issue by deleting the SYNC_STATE_ONLY device link instead of
      complicating the status update code.
      
      However, there are still some cases where we need to update the status
      of a SYNC_STATE_ONLY device link. This is because a SYNC_STATE_ONLY
      device link can later get converted into a normal MANAGED device link
      when a normal MANAGED device link is created between a supplier and
      consumer that already have a SYNC_STATE_ONLY device link between them.
      
      If a SYNC_STATE_ONLY device link's status isn't maintained correctly
      till it's converted to a normal MANAGED device link, then the normal
      MANAGED device link will end up with a wrong link status. This can cause
      a warning stack trace[1] when the consumer device probes successfully.
      
      This commit fixes the SYNC_STATE_ONLY device link status update issue
      where it wouldn't transition correctly from DL_STATE_DORMANT or
      DL_STATE_AVAILABLE to DL_STATE_CONSUMER_PROBE. It also resets the status
      back to DL_STATE_DORMANT or DL_STATE_AVAILABLE if the consumer probe
      fails.
      
      [1] - https://lore.kernel.org/lkml/20200522204120.3b3c9ed6@apollo/
      Fixes: 05ef983e ("driver core: Add device link support for SYNC_STATE_ONLY flag")
      Fixes: 21c27f06 ("driver core: Fix SYNC_STATE_ONLY device link implementation")
      Reported-by: NMichael Walle <michael@walle.cc>
      Tested-by: NMichael Walle <michael@walle.cc>
      Signed-off-by: NSaravana Kannan <saravanak@google.com>
      Reviewed-by: NRafael J. Wysocki <rrafael.j.wysocki@intel.com>
      Link: https://lore.kernel.org/r/20200526220928.49939-1-saravanak@google.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8c3e315d
  20. 21 5月, 2020 2 次提交
  21. 19 5月, 2020 1 次提交
    • S
      driver core: Fix SYNC_STATE_ONLY device link implementation · 21c27f06
      Saravana Kannan 提交于
      When SYNC_STATE_ONLY support was added in commit 05ef983e ("driver
      core: Add device link support for SYNC_STATE_ONLY flag"),
      device_link_add() incorrectly skipped adding the new SYNC_STATE_ONLY
      device link to the supplier's and consumer's "device link" list.
      
      This causes multiple issues:
      - The device link is lost forever from driver core if the caller
        didn't keep track of it (caller typically isn't expected to). This is
        a memory leak.
      - The device link is also never visible to any other code path after
        device_link_add() returns.
      
      If we fix the "device link" list handling, that exposes a bunch of
      issues.
      
      1. The device link "status" state management code rightfully doesn't
      handle the case where a DL_FLAG_MANAGED device link exists between a
      supplier and consumer, but the consumer manages to probe successfully
      before the supplier. The addition of DL_FLAG_SYNC_STATE_ONLY links break
      this assumption. This causes device_links_driver_bound() to throw a
      warning when this happens.
      
      Since DL_FLAG_SYNC_STATE_ONLY device links are mainly used for creating
      proxy device links for child device dependencies and aren't useful once
      the consumer device probes successfully, this patch just deletes
      DL_FLAG_SYNC_STATE_ONLY device links once its consumer device probes.
      This way, we avoid the warning, free up some memory and avoid
      complicating the device links "status" state management code.
      
      2. Creating a DL_FLAG_STATELESS device link between two devices that
      already have a DL_FLAG_SYNC_STATE_ONLY device link will result in the
      DL_FLAG_STATELESS flag not getting set correctly. This patch also fixes
      this.
      
      Lastly, this patch also fixes minor whitespace issues.
      
      Cc: stable@vger.kernel.org
      Fixes: 05ef983e ("driver core: Add device link support for SYNC_STATE_ONLY flag")
      Signed-off-by: NSaravana Kannan <saravanak@google.com>
      Reviewed-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Link: https://lore.kernel.org/r/20200519063000.128819-1-saravanak@google.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      21c27f06
  22. 15 5月, 2020 3 次提交
  23. 10 5月, 2020 1 次提交
  24. 05 5月, 2020 1 次提交
  25. 28 4月, 2020 1 次提交
  26. 21 4月, 2020 1 次提交
  27. 20 4月, 2020 1 次提交