1. 09 6月, 2017 1 次提交
    • V
      cxl: Avoid double free_irq() for psl,slice interrupts · ed45509b
      Vaibhav Jain 提交于
      During an eeh call to cxl_remove can result in double free_irq of
      psl,slice interrupts. This can happen if perst_reloads_same_image == 1
      and call to cxl_configure_adapter() fails during slot_reset
      callback. In such a case we see a kernel oops with following back-trace:
      
      Oops: Kernel access of bad area, sig: 11 [#1]
      Call Trace:
        free_irq+0x88/0xd0 (unreliable)
        cxl_unmap_irq+0x20/0x40 [cxl]
        cxl_native_release_psl_irq+0x78/0xd8 [cxl]
        pci_deconfigure_afu+0xac/0x110 [cxl]
        cxl_remove+0x104/0x210 [cxl]
        pci_device_remove+0x6c/0x110
        device_release_driver_internal+0x204/0x2e0
        pci_stop_bus_device+0xa0/0xd0
        pci_stop_and_remove_bus_device+0x28/0x40
        pci_hp_remove_devices+0xb0/0x150
        pci_hp_remove_devices+0x68/0x150
        eeh_handle_normal_event+0x140/0x580
        eeh_handle_event+0x174/0x360
        eeh_event_handler+0x1e8/0x1f0
      
      This patch fixes the issue of double free_irq by checking that
      variables that hold the virqs (err_hwirq, serr_hwirq, psl_virq) are
      not '0' before un-mapping and resetting these variables to '0' when
      they are un-mapped.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NVaibhav Jain <vaibhav@linux.vnet.ibm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ed45509b
  2. 03 6月, 2017 1 次提交
    • P
      mei: make sysfs modalias format similar as uevent modalias · 6f9193ec
      Pratyush Anand 提交于
      modprobe is not able to resolve sysfs modalias for mei devices.
      
       # cat
      /sys/class/watchdog/watchdog0/device/watchdog/watchdog0/device/modalias
      mei::05b79a6f-4628-4d7f-899d-a91514cb32ab:
       # modprobe --set-version 4.9.6-200.fc25.x86_64 -R
      mei::05b79a6f-4628-4d7f-899d-a91514cb32ab:
      modprobe: FATAL: Module mei::05b79a6f-4628-4d7f-899d-a91514cb32ab: not
      found in directory /lib/modules/4.9.6-200.fc25.x86_64
       # cat /lib/modules/4.9.6-200.fc25.x86_64/modules.alias | grep
      05b79a6f-4628-4d7f-899d-a91514cb32ab
      alias mei:*:05b79a6f-4628-4d7f-899d-a91514cb32ab:*:* mei_wdt
      
      commit b26864ca ("mei: bus: add client protocol
      version to the device alias"), however sysfs modalias
      is still in formmat mei:S:uuid:*.
      
      This patch equates format of uevent and sysfs modalias so that modprobe
      is able to resolve the aliases.
      
      Cc: <stable@vger.kernel.org> 4.7+
      Fixes: commit b26864ca ("mei: bus: add client protocol version to the device alias")
      Signed-off-by: NPratyush Anand <panand@redhat.com>
      Signed-off-by: NTomas Winkler <tomas.winkler@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6f9193ec
  3. 17 5月, 2017 1 次提交
    • T
      misc: pci_endpoint_test: select CRC32 · a20cfc1c
      Tobias Regnery 提交于
      There is the following link error with CONFIG_PCI_ENDPOINT_TEST=y and
      CONFIG_CRC32=m:
      
      drivers/built-in.o: In function 'pci_endpoint_test_ioctl':
      pci_endpoint_test.c:(.text+0xf1251): undefined reference to 'crc32_le'
      pci_endpoint_test.c:(.text+0xf1322): undefined reference to 'crc32_le'
      pci_endpoint_test.c:(.text+0xf13b2): undefined reference to 'crc32_le'
      pci_endpoint_test.c:(.text+0xf141e): undefined reference to 'crc32_le'
      
      Fix this by selecting CRC32 in the PCI_ENDPOINT_TEST kconfig entry.
      
      Fixes: 2c156ac7 ("misc: Add host side PCI driver for PCI test function device")
      Signed-off-by: NTobias Regnery <tobias.regnery@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a20cfc1c
  4. 09 5月, 2017 3 次提交
  5. 03 5月, 2017 1 次提交
  6. 02 5月, 2017 3 次提交
  7. 28 4月, 2017 1 次提交
  8. 20 4月, 2017 1 次提交
    • D
      Annotate hardware config module parameters in drivers/misc/ · 4f1927dc
      David Howells 提交于
      When the kernel is running in secure boot mode, we lock down the kernel to
      prevent userspace from modifying the running kernel image.  Whilst this
      includes prohibiting access to things like /dev/mem, it must also prevent
      access by means of configuring driver modules in such a way as to cause a
      device to access or modify the kernel image.
      
      To this end, annotate module_param* statements that refer to hardware
      configuration and indicate for future reference what type of parameter they
      specify.  The parameter parser in the core sees this information and can
      skip such parameters with an error message if the kernel is locked down.
      The module initialisation then runs as normal, but just sees whatever the
      default values for those parameters is.
      
      Note that we do still need to do the module initialisation because some
      drivers have viable defaults set in case parameters aren't specified and
      some drivers support automatic configuration (e.g. PNP or PCI) in addition
      to manually coded parameters.
      
      This patch annotates drivers in drivers/misc/.
      Suggested-by: NAlan Cox <gnomes@lxorguk.ukuu.org.uk>
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cc: Arnd Bergmann <arnd@arndb.de>
      4f1927dc
  9. 19 4月, 2017 2 次提交
  10. 13 4月, 2017 7 次提交
  11. 09 4月, 2017 3 次提交
  12. 08 4月, 2017 10 次提交
  13. 07 4月, 2017 1 次提交
    • M
      scsi: ses: don't get power status of SES device slot on probe · 75106523
      Mauricio Faria de Oliveira 提交于
      The commit 08024885 ("ses: Add power_status to SES device slot")
      introduced the 'power_status' attribute to enclosure components and
      the associated callbacks.
      
      There are 2 callbacks available to get the power status of a device:
      1) ses_get_power_status() for 'struct enclosure_component_callbacks'
      2) get_component_power_status() for the sysfs device attribute
      (these are available for kernel-space and user-space, respectively.)
      
      However, despite both methods being available to get power status
      on demand, that commit also introduced a call to get power status
      in ses_enclosure_data_process().
      
      This dramatically increased the total probe time for SCSI devices
      on larger configurations, because ses_enclosure_data_process() is
      called several times during the SCSI devices probe and loops over
      the component devices (but that is another problem, another patch).
      
      That results in a tremendous continuous hammering of SCSI Receive
      Diagnostics commands to the enclosure-services device, which does
      delay the total probe time for the SCSI devices __significantly__:
      
        Originally, ~34 minutes on a system attached to ~170 disks:
      
          [ 9214.490703] mpt3sas version 13.100.00.00 loaded
          ...
          [11256.580231] scsi 17:0:177:0: qdepth(16), tagged(1), simple(0),
                         ordered(0), scsi_level(6), cmd_que(1)
      
        With this patch, it decreased to ~2.5 minutes -- a 13.6x faster
      
          [ 1002.992533] mpt3sas version 13.100.00.00 loaded
          ...
          [ 1151.978831] scsi 11:0:177:0: qdepth(16), tagged(1), simple(0),
                         ordered(0), scsi_level(6), cmd_que(1)
      
      Back to the commit discussion.. on the ses_get_power_status() call
      introduced in ses_enclosure_data_process(): impact of removing it.
      
      That may possibly be in place to initialize the power status value
      on device probe.  However, those 2 functions available to retrieve
      that value _do_ automatically refresh/update it.  So the potential
      benefit would be a direct access of the 'power_status' field which
      does not use the callbacks...
      
      But the only reader of 'struct enclosure_component::power_status'
      is the get_component_power_status() callback for sysfs attribute,
      and it _does_ check for and call the .get_power_status callback,
      (which indeed is defined and implemented by that commit), so the
      power status value is, again, automatically updated.
      
      So, the remaining potential for a direct/non-callback access to
      the power_status attribute would be out-of-tree modules -- well,
      for those, if they are for whatever reason interested in values
      that are set during device probe and not up-to-date by the time
      they need it.. well, that would be curious.
      
      Well, to handle that more properly, set the initial power state
      value to '-1' (i.e., uninitialized) instead of '1' (power 'on'),
      and check for it in that callback which may do an direct access
      to the field value _if_ a callback function is not defined.
      Signed-off-by: NMauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
      Fixes: 08024885 ("ses: Add power_status to SES device slot")
      Reviewed-by: NDan Williams <dan.j.williams@intel.com>
      Reviewed-by: NSong Liu <songliubraving@fb.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      75106523
  14. 24 3月, 2017 1 次提交
  15. 22 3月, 2017 1 次提交
    • C
      drivers/misc: Aspeed LPC control fix compile error and warning · 132c93d4
      Cyril Bur 提交于
      pgprot_dmachoerent() is not defined on every architecture. Having
      COMPILE_TEST set for the driver causes it to be compiled on
      architectures which do not have pgprot_dmachoerent():
          drivers/misc/aspeed-lpc-ctrl.c: In function 'aspeed_lpc_ctrl_mmap':
          drivers/misc/aspeed-lpc-ctrl.c:51:9: error: implicit declaration of
              function 'pgprot_dmacoherent' [-Werror=implicit-function-declaration]
              prot = pgprot_dmacoherent(prot);
      
      There are two possible solutions:
          1. Remove COMPILE_TEST to ensure the driver is only compiled on ARM
          2. Use pgprot_noncached() instead of pgprot_dmachoerent()
      
      The first option results in less compile testing of the LPC control
      driver which is undesirable.
      The second option uses a function that is declared on all architectures
      and therefore should always build. Currently there is no practical
      difference between pgprot_noncached() and pgprot_dmachoerent() for the
      aspeed chips that this driver is compatible with. The reason for
      pgprot_dmachoerent() was that there may be chips made at some point in
      the future that could include hardware that pgprot_dmachoerent() could
      optimise for. As none of this hardware has even been announced there
      isn't really a need for pgprot_dmachoerent().
      
      Using pgprot_noncached() is completely correct and optimal for all
      existing hardware on which the LPC control driver will run.
      
      This commit also addresses that phys_addr_t should be printed using %pap
      rather than %x:
          In file included from include/linux/miscdevice.h:6:0,
                           from drivers/misc/aspeed-lpc-ctrl.c:11:
          drivers/misc/aspeed-lpc-ctrl.c: In function 'aspeed_lpc_ctrl_probe':
          drivers/misc/aspeed-lpc-ctrl.c:232:17: warning: format '%x' expects
              argument of type 'unsigned int', but argument 3 has type 'phys_addr_t
              {aka long long unsigned int}' [-Wformat=]
              dev_info(dev, "Loaded at 0x%08x (0x%08x)\n",
      Signed-off-by: NCyril Bur <cyrilbur@gmail.com>
      Reported-by: Nkbuild test robot <fengguang.wu@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      132c93d4
  16. 20 3月, 2017 1 次提交
  17. 17 3月, 2017 2 次提交
    • G
      auxdisplay: charlcd: Extract character LCD core from misc/panel · 39f8ea46
      Geert Uytterhoeven 提交于
      Extract the character LCD core from the Parallel port LCD/Keypad Panel
      driver in the misc subsystem, and convert it into a subdriver in the
      auxdisplay subsystem.  This allows the character LCD core to be used by
      other drivers later.
      
      Compilation is controlled by its own Kconfig symbol CHARLCD, which is to
      be selected by its users, but can be enabled manually for
      compile-testing.
      
      All functions changed their prefix from "lcd_" to "charlcd_", and gained
      a "struct charlcd *" parameter to operate on a specific instance.
      While the driver API thus is ready to support multiple instances, the
      current limitation of a single display (/dev/lcd has a single misc minor
      assigned) is retained.
      
      No functional changes intended.
      Signed-off-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      39f8ea46
    • C
      drivers/misc: Add Aspeed LPC control driver · 6c4e9767
      Cyril Bur 提交于
      In order to manage server systems, there is typically another processor
      known as a BMC (Baseboard Management Controller) which is responsible
      for powering the server and other various elements, sometimes fans,
      often the system flash.
      
      The Aspeed BMC family which is what is used on OpenPOWER machines and a
      number of x86 as well is typically connected to the host via an LPC
      (Low Pin Count) bus (among others).
      
      The LPC bus is an ISA bus on steroids. It's generally used by the
      BMC chip to provide the host with access to the system flash (via MEM/FW
      cycles) that contains the BIOS or other host firmware along with a
      number of SuperIO-style IOs (via IO space) such as UARTs, IPMI
      controllers.
      
      On the BMC chip side, this is all configured via a bunch of registers
      whose content is related to a given policy of what devices are exposed
      at a per system level, which is system/vendor specific, so we don't want
      to bolt that into the BMC kernel. This started with a need to provide
      something nicer than /dev/mem for user space to configure these things.
      
      One important aspect of the configuration is how the MEM/FW space is
      exposed to the host (ie, the x86 or POWER). Some registers in that
      bridge can define a window remapping all or portion of the LPC MEM/FW
      space to a portion of the BMC internal bus, with no specific limits
      imposed in HW.
      
      I think it makes sense to ensure that this window is configured by a
      kernel driver that can apply some serious sanity checks on what it is
      configured to map.
      
      In practice, user space wants to control this by flipping the mapping
      between essentially two types of portions of the BMC address space:
      
         - The flash space. This is a region of the BMC MMIO space that
      more/less directly maps the system flash (at least for reads, writes
      are somewhat more complicated).
      
         - One (or more) reserved area(s) of the BMC physical memory.
      
      The latter is needed for a number of things, such as avoiding letting
      the host manipulate the innards of the BMC flash controller via some
      evil backdoor, we want to do flash updates by routing the window to a
      portion of memory (under control of a mailbox protocol via some
      separate set of registers) which the host can use to write new data in
      bulk and then request the BMC to flash it. There are other uses, such
      as allowing the host to boot from an in-memory flash image rather than
      the one in flash (very handy for continuous integration and test, the
      BMC can just download new images).
      
      It is important to note that due to the way the Aspeed chip lets the
      kernel configure the mapping between host LPC addresses and BMC ram
      addresses the offset within the window must be a multiple of size.
      Not doing so will fragment the accessible space rather than simply
      moving 'zero' upwards. This is caused by the nature of HICR8 being a
      mask and the way host LPC addresses are translated.
      Signed-off-by: NCyril Bur <cyrilbur@gmail.com>
      Reviewed-by: NJoel Stanley <joel@jms.id.au>
      Reviewed-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6c4e9767