Skip to content
Snippets Groups Projects
  1. Oct 19, 2021
  2. Jul 21, 2021
    • Uwe Kleine-König's avatar
      bus: Make remove callback return void · fc7a6209
      Uwe Kleine-König authored
      
      The driver core ignores the return value of this callback because there
      is only little it can do when a device disappears.
      
      This is the final bit of a long lasting cleanup quest where several
      buses were converted to also return void from their remove callback.
      Additionally some resource leaks were fixed that were caused by drivers
      returning an error code in the expectation that the driver won't go
      away.
      
      With struct bus_type::remove returning void it's prevented that newly
      implemented buses return an ignored error code and so don't anticipate
      wrong expectations for driver authors.
      
      Reviewed-by: Tom Rix <trix@redhat.com> (For fpga)
      Reviewed-by: default avatarMathieu Poirier <mathieu.poirier@linaro.org>
      Reviewed-by: Cornelia Huck <cohuck@redhat.com> (For drivers/s390 and drivers/vfio)
      Acked-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> (For ARM, Amba and related parts)
      Acked-by: default avatarMark Brown <broonie@kernel.org>
      Acked-by: Chen-Yu Tsai <wens@csie.org> (for sunxi-rsb)
      Acked-by: default avatarPali Rohár <pali@kernel.org>
      Acked-by: Mauro Carvalho Chehab <mchehab@kernel.org> (for media)
      Acked-by: Hans de Goede <hdegoede@redhat.com> (For drivers/platform)
      Acked-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
      Acked-By: default avatarVinod Koul <vkoul@kernel.org>
      Acked-by: Juergen Gross <jgross@suse.com> (For xen)
      Acked-by: Lee Jones <lee.jones@linaro.org> (For mfd)
      Acked-by: Johannes Thumshirn <jth@kernel.org> (For mcb)
      Acked-by: default avatarJohan Hovold <johan@kernel.org>
      Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> (For slimbus)
      Acked-by: Kirti Wankhede <kwankhede@nvidia.com> (For vfio)
      Acked-by: default avatarMaximilian Luz <luzmaximilian@gmail.com>
      Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> (For ulpi and typec)
      Acked-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> (For ipack)
      Acked-by: Geoff Levand <geoff@infradead.org> (For ps3)
      Acked-by: Yehezkel Bernat <YehezkelShB@gmail.com> (For thunderbolt)
      Acked-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> (For intel_th)
      Acked-by: Dominik Brodowski <linux@dominikbrodowski.net> (For pcmcia)
      Acked-by: Rafael J. Wysocki <rafael@kernel.org> (For ACPI)
      Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org> (rpmsg and apr)
      Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> (For intel-ish-hid)
      Acked-by: Dan Williams <dan.j.williams@intel.com> (For CXL, DAX, and NVDIMM)
      Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com> (For isa)
      Acked-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (For firewire)
      Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> (For hid)
      Acked-by: Thorsten Scherer <t.scherer@eckelmann.de> (For siox)
      Acked-by: Sven Van Asbroeck <TheSven73@gmail.com> (For anybuss)
      Acked-by: Ulf Hansson <ulf.hansson@linaro.org> (For MMC)
      Acked-by: Wolfram Sang <wsa@kernel.org> # for I2C
      Acked-by: default avatarSudeep Holla <sudeep.holla@arm.com>
      Acked-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Acked-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      Acked-by: default avatarFinn Thain <fthain@linux-m68k.org>
      Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Link: https://lore.kernel.org/r/20210713193522.1770306-6-u.kleine-koenig@pengutronix.de
      
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fc7a6209
  3. Feb 02, 2021
  4. Jun 16, 2020
  5. May 05, 2020
    • Rob Herring's avatar
      amba: Retry adding deferred devices at late_initcall · 039599c9
      Rob Herring authored
      
      If amba bus devices defer when adding, the amba bus code simply retries
      adding the devices every 5 seconds. This doesn't work well as it
      completely unsynchronized with starting the init process which can
      happen in less than 5 secs. Add a retry during late_initcall. If the
      amba devices are added, then deferred probe takes over. If the
      dependencies have not probed at this point, then there's no improvement
      over previous behavior. To completely solve this, we'd need to retry
      after every successful probe as deferred probe does.
      
      The list_empty() check now happens outside the mutex, but the mutex
      wasn't necessary in the first place.
      
      This needed to use deferred probe instead of fragile initcall ordering
      on 32-bit VExpress systems where the apb_pclk has a number of probe
      dependencies (vexpress-sysregs, vexpress-config).
      
      Cc: John Stultz <john.stultz@linaro.org>
      Cc: Saravana Kannan <saravanak@google.com>
      Cc: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
      Cc: Geert Uytterhoeven <geert+renesas@glider.be>
      Cc: Russell King <linux@armlinux.org.uk>
      Tested-by: default avatarSudeep Holla <sudeep.holla@arm.com>
      Reviewed-by: default avatarSudeep Holla <sudeep.holla@arm.com>
      Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
      039599c9
  6. Apr 28, 2020
  7. Apr 01, 2020
  8. Mar 26, 2020
  9. Oct 09, 2019
  10. Sep 10, 2019
  11. Jul 30, 2019
    • Suzuki K Poulose's avatar
      drivers: Introduce device lookup variants by of_node · cfba5de9
      Suzuki K Poulose authored
      
      Introduce wrappers for {bus/driver/class}_find_device() to
      locate devices by its of_node.
      
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Maxime Ripard <maxime.ripard@bootlin.com>
      Cc: dri-devel@lists.freedesktop.org
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: devicetree@vger.kernel.org
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Frank Rowand <frowand.list@gmail.com>
      Cc: Heiko Stuebner <heiko@sntech.de>
      Cc: Liam Girdwood <lgirdwood@gmail.com>
      Cc: linux-i2c@vger.kernel.org
      Cc: linux-rockchip@lists.infradead.org
      Cc: linux-spi@vger.kernel.org
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
      Cc: Takashi Iwai <tiwai@suse.com>
      Cc: Alan Tull <atull@kernel.org>
      Cc: linux-fpga@vger.kernel.org
      Cc: Peter Rosin <peda@axentia.se>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Heiner Kallweit <hkallweit1@gmail.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Andrew Lunn <andrew@lunn.ch>
      Cc: Liam Girdwood <lgirdwood@gmail.com>
      Cc: "Rafael J. Wysocki" <rafael@kernel.org>
      Cc: Thor Thayer <thor.thayer@linux.intel.com>
      Cc: Jiri Slaby <jslaby@suse.com>
      Cc: Andrew Lunn <andrew@lunn.ch>
      Cc: Peter Rosin <peda@axentia.se>
      Signed-off-by: default avatarSuzuki K Poulose <suzuki.poulose@arm.com>
      Acked-by: default avatarLee Jones <lee.jones@linaro.org>
      Acked-by: Wolfram Sang <wsa@the-dreams.de> # I2C part
      Acked-by: Moritz Fischer <mdf@kernel.org> # For FPGA part
      Acked-by: default avatarMark Brown <broonie@kernel.org>
      Link: https://lore.kernel.org/r/20190723221838.12024-3-suzuki.poulose@arm.com
      
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cfba5de9
  12. Jun 24, 2019
    • Suzuki K Poulose's avatar
      driver_find_device: Unify the match function with class_find_device() · 92ce7e83
      Suzuki K Poulose authored
      
      The driver_find_device() accepts a match function pointer to
      filter the devices for lookup, similar to bus/class_find_device().
      However, there is a minor difference in the prototype for the
      match parameter for driver_find_device() with the now unified
      version accepted by {bus/class}_find_device(), where it doesn't
      accept a "const" qualifier for the data argument. This prevents
      us from reusing the generic match functions for driver_find_device().
      
      For this reason, change the prototype of the driver_find_device() to
      make the "match" parameter in line with {bus/class}_find_device()
      and adjust its callers to use the const qualifier. Also, we could
      now promote the "data" parameter to const as we pass it down
      as a const parameter to the match functions.
      
      Cc: Corey Minyard <minyard@acm.org>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: "Rafael J. Wysocki" <rafael@kernel.org>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Joerg Roedel <joro@8bytes.org>
      Cc: Peter Oberparleiter <oberpar@linux.ibm.com>
      Cc: Sebastian Ott <sebott@linux.ibm.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Nehal Shah <nehal-bakulchandra.shah@amd.com>
      Cc: Shyam Sundar S K <shyam-sundar.s-k@amd.com>
      Cc: Lee Jones <lee.jones@linaro.org>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: default avatarSuzuki K Poulose <suzuki.poulose@arm.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      92ce7e83
  13. Jun 19, 2019
  14. Jun 05, 2019
  15. May 21, 2019
  16. May 08, 2019
  17. Feb 26, 2019
  18. May 19, 2018
    • Kim Phillips's avatar
      ARM: 8773/1: amba: Export amba_bustype · e9ac68c3
      Kim Phillips authored
      This patch is provided in the context of allowing the Coresight driver
      subsystem to be loaded as modules.  Coresight uses amba_bus in its call
      to bus_find_device() in of_coresight_get_endpoint_device() when
      searching for a configurable endpoint device.  This patch allows
      Coresight to reference amba_bustype when built as a module.
      
      [original LKML submission here: https://lkml.org/lkml/2018/5/9/520
      
      ]
      
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Cc: Alex Williamson <alex.williamson@redhat.com>
      Cc: Eric Auger <eric.auger@redhat.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Todd Kjos <tkjos@google.com>
      Cc: Geert Uytterhoeven <geert+renesas@glider.be>
      Cc: Thierry Reding <treding@nvidia.com>
      Reviewed-by: default avatarRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: default avatarKim Phillips <kim.phillips@arm.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      e9ac68c3
  19. May 14, 2018
  20. May 03, 2018
  21. Apr 26, 2018
  22. Apr 25, 2018
  23. Nov 02, 2017
    • Greg Kroah-Hartman's avatar
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman authored
      
      Many source files in the tree are missing licensing information, which
      makes it harder for compliance tools to determine the correct license.
      
      By default all files without license information are under the default
      license of the kernel, which is GPL version 2.
      
      Update the files which contain no license information with the 'GPL-2.0'
      SPDX license identifier.  The SPDX identifier is a legally binding
      shorthand, which can be used instead of the full boiler plate text.
      
      This patch is based on work done by Thomas Gleixner and Kate Stewart and
      Philippe Ombredanne.
      
      How this work was done:
      
      Patches were generated and checked against linux-4.14-rc6 for a subset of
      the use cases:
       - file had no licensing information it it.
       - file was a */uapi/* one with no licensing information in it,
       - file was a */uapi/* one with existing licensing information,
      
      Further patches will be generated in subsequent months to fix up cases
      where non-standard license headers were used, and references to license
      had to be inferred by heuristics based on keywords.
      
      The analysis to determine which SPDX License Identifier to be applied to
      a file was done in a spreadsheet of side by side results from of the
      output of two independent scanners (ScanCode & Windriver) producing SPDX
      tag:value files created by Philippe Ombredanne.  Philippe prepared the
      base worksheet, and did an initial spot review of a few 1000 files.
      
      The 4.13 kernel was the starting point of the analysis with 60,537 files
      assessed.  Kate Stewart did a file by file comparison of the scanner
      results in the spreadsheet to determine which SPDX license identifier(s)
      to be applied to the file. She confirmed any determination that was not
      immediately clear with lawyers working with the Linux Foundation.
      
      Criteria used to select files for SPDX license identifier tagging was:
       - Files considered eligible had to be source code files.
       - Make and config files were included as candidates if they contained >5
         lines of source
       - File already had some variant of a license header in it (even if <5
         lines).
      
      All documentation files were explicitly excluded.
      
      The following heuristics were used to determine which SPDX license
      identifiers to apply.
      
       - when both scanners couldn't find any license traces, file was
         considered to have no license information in it, and the top level
         COPYING file license applied.
      
         For non */uapi/* files that summary was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0                                              11139
      
         and resulted in the first patch in this series.
      
         If that file was a */uapi/* path one, it was "GPL-2.0 WITH
         Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0 WITH Linux-syscall-note                        930
      
         and resulted in the second patch in this series.
      
       - if a file had some form of licensing information in it, and was one
         of the */uapi/* ones, it was denoted with the Linux-syscall-note if
         any GPL family license was found in the file or had no licensing in
         it (per prior point).  Results summary:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|------
         GPL-2.0 WITH Linux-syscall-note                       270
         GPL-2.0+ WITH Linux-syscall-note                      169
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
         LGPL-2.1+ WITH Linux-syscall-note                      15
         GPL-1.0+ WITH Linux-syscall-note                       14
         ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
         LGPL-2.0+ WITH Linux-syscall-note                       4
         LGPL-2.1 WITH Linux-syscall-note                        3
         ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
         ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1
      
         and that resulted in the third patch in this series.
      
       - when the two scanners agreed on the detected license(s), that became
         the concluded license(s).
      
       - when there was disagreement between the two scanners (one detected a
         license but the other didn't, or they both detected different
         licenses) a manual inspection of the file occurred.
      
       - In most cases a manual inspection of the information in the file
         resulted in a clear resolution of the license that should apply (and
         which scanner probably needed to revisit its heuristics).
      
       - When it was not immediately clear, the license identifier was
         confirmed with lawyers working with the Linux Foundation.
      
       - If there was any question as to the appropriate license identifier,
         the file was flagged for further research and to be revisited later
         in time.
      
      In total, over 70 hours of logged manual review was done on the
      spreadsheet to determine the SPDX license identifiers to apply to the
      source files by Kate, Philippe, Thomas and, in some cases, confirmation
      by lawyers working with the Linux Foundation.
      
      Kate also obtained a third independent scan of the 4.13 code base from
      FOSSology, and compared selected files where the other two scanners
      disagreed against that SPDX file, to see if there was new insights.  The
      Windriver scanner is based on an older version of FOSSology in part, so
      they are related.
      
      Thomas did random spot checks in about 500 files from the spreadsheets
      for the uapi headers and agreed with SPDX license identifier in the
      files he inspected. For the non-uapi files Thomas did random spot checks
      in about 15000 files.
      
      In initial set of patches against 4.14-rc6, 3 files were found to have
      copy/paste license identifier errors, and have been fixed to reflect the
      correct identifier.
      
      Additionally Philippe spent 10 hours this week doing a detailed manual
      inspection and review of the 12,461 patched files from the initial patch
      version early this week with:
       - a full scancode scan run, collecting the matched texts, detected
         license ids and scores
       - reviewing anything where there was a license detected (about 500+
         files) to ensure that the applied SPDX license was correct
       - reviewing anything where there was no detection but the patch license
         was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
         SPDX license was correct
      
      This produced a worksheet with 20 files needing minor correction.  This
      worksheet was then exported into 3 different .csv files for the
      different types of files to be modified.
      
      These .csv files were then reviewed by Greg.  Thomas wrote a script to
      parse the csv files and add the proper SPDX tag to the file, in the
      format that the file expected.  This script was further refined by Greg
      based on the output to detect more types of files automatically and to
      distinguish between header and source .c files (which need different
      comment types.)  Finally Greg ran the script using the .csv files to
      generate the patches.
      
      Reviewed-by: default avatarKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: default avatarPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b2441318
  24. Oct 19, 2017
    • Robin Murphy's avatar
      drivers: flag buses which demand DMA configuration · d89e2378
      Robin Murphy authored
      
      We do not want the common dma_configure() pathway to apply
      indiscriminately to all devices, since there are plenty of buses which
      do not have DMA capability, and if their child devices were used for
      DMA API calls it would only be indicative of a driver bug. However,
      there are a number of buses for which DMA is implicitly expected even
      when not described by firmware - those we whitelist with an automatic
      opt-in to dma_configure(), assuming that the DMA address space and the
      physical address space are equivalent if not otherwise specified.
      
      Commit 72328883 ("of: restrict DMA configuration") introduced a
      short-term fix by comparing explicit bus types, but this approach is far
      from pretty, doesn't scale well, and fails to cope at all with bus
      drivers which may be built as modules, like host1x. Let's refine things
      by making that opt-in a property of the bus type, which neatly addresses
      those problems and lets the decision of whether firmware description of
      DMA capability should be optional or mandatory stay internal to the bus
      drivers themselves.
      
      Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
      Acked-by: default avatarRob Herring <robh@kernel.org>
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Acked-by: default avatarThierry Reding <treding@nvidia.com>
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      d89e2378
  25. Jun 09, 2017
  26. Aug 12, 2016
  27. May 05, 2016
  28. May 01, 2016
  29. Nov 24, 2015
  30. Apr 02, 2015
    • Paul Walmsley's avatar
      ARM: 8334/1: amba: tegra-ahb: detect and correct bogus base address · ce7a10b0
      Paul Walmsley authored
      amba: tegra-ahb: detect and correct bogus base address
      
      From a hardware SoC integration point of view, the starting address of
      this IP block in the existing Tegra SoC DT files is off by 4 bytes
      from the actual base address.  Since we attempt to make old DT files
      forward-compatible with newer kernels, we cannot fix the IP block base
      address in old DT data. This patch works around the problem by
      detecting the four byte base address offset in the driver code, and
      correcting it if it's detected.  (In general, IP block base addresses
      almost always have a null low byte.)
      
      Future SoC DT data for Tegra AHB should use the correct Tegra AHB base
      address, in cases where there is no DT data backward compatibility
      requirement.
      
      This patch is a revision of the patch originally titled
      "amba: tegra-ahb: use correct base address for future chip support".
      This revision implements changes requested by Russell King:
      
      http://marc.info/?l=linux-tegra&m=142658851825062&w=2
      http://marc.info/?l=linux-tegra&m=142658873925178&w=2
      
      
      
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      Cc: Paul Walmsley <pwalmsley@nvidia.com>
      Cc: Alexandre Courbot <gnurou@gmail.com>
      Cc: Hiroshi DOYU <hdoyu@nvidia.com>
      Cc: Stephen Warren <swarren@wwwdotorg.org>
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Cc: linux-kernel@vger.kernel.org
      Acked-by: default avatarStephen Warren <swarren@nvidia.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      ce7a10b0
Loading