1. 25 4月, 2020 2 次提交
    • R
      PM: sleep: core: Rework the power.may_skip_resume handling · 0fe8a1be
      Rafael J. Wysocki 提交于
      Because the power.may_skip_resume device status bit is taken
      into account in combination with the DPM_FLAG_LEAVE_SUSPENDED
      driver flag, it can be set to 'true' for all devices in the
      "suspend" phase of a suspend-resume cycle, so do that.
      
      Then, neither the PM core nor the middle-layer (sybsystem) code
      handling it needs to set it to 'true' any more and it just has
      to be cleared if there is a reason to avoid skipping the "noirq"
      and "early" resume callbacks provided by the driver, so update
      the code in question accordingly.
      Suggested-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Acked-by: NBjorn Helgaas <bhelgaas@google.com>
      0fe8a1be
    • R
      PM: sleep: core: Do not skip callbacks in the resume phase · 6e176bf8
      Rafael J. Wysocki 提交于
      The current code in device_resume_noirq() causes the entire early
      resume and resume phases of device suspend to be skipped for
      devices for which the noirq resume phase have been skipped (due
      to the LEAVE_SUSPENDED flag being set) on the premise that those
      devices should stay in runtime-suspend after system-wide resume.
      
      However, that may not be correct in two situations.  First, the
      middle layer (subsystem) noirq resume callback may be missing for
      a given device, but its early resume callback may be present and it
      may need to do something even if it decides to skip the driver
      callback.  Second, if the device's wakeup settings were adjusted
      in the suspend phase without resuming the device (that was in
      runtime suspend at that time), they most likely need to be
      adjusted again in the resume phase and so the driver callback
      in that phase needs to be run.
      
      For the above reason, modify the core to allow the middle layer
      ->resume_late callback to run even if its ->resume_noirq callback
      is missing (and the core has skipped the driver-level callback
      in that phase) and to allow all device callbacks to run in the
      resume phase.  Also make the core set the PM-runtime status of
      devices with SMART_SUSPEND set whose resume callbacks are not
      skipped to "active" in the "noirq" resume phase and update the
      affected subsystems (PCI and ACPI) accordingly.
      
      After this change, middle-layer (subsystem) callbacks will always
      be invoked in all phases of system suspend and resume and driver
      callbacks will always run in the prepare, suspend, resume, and
      complete phases for all devices.
      
      For devices with SMART_SUSPEND set, driver callbacks will be
      skipped in the late and noirq phases of system suspend if those
      devices remain in runtime suspend in __device_suspend_late().
      Driver callbacks will also be skipped for them during the
      noirq and early phases of the "thaw" transition related to
      hibernation in that case.
      
      Setting LEAVE_SUSPENDED means that the driver allows its callbacks
      to be skipped in the noirq and early phases of system resume, but
      some additional conditions need to be met for that to happen (among
      other things, the power.may_skip_resume flag needs to be set for the
      device during system suspend for the driver callbacks to be skipped
      during the subsequent resume transition).
      
      For all devices with SMART_SUSPEND set whose driver callbacks are
      invoked during system resume, the PM-runtime status will be set to
      "active" (by the core).
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Acked-by: NBjorn Helgaas <bhelgaas@google.com>
      6e176bf8
  2. 20 4月, 2020 2 次提交
    • R
      PM: sleep: core: Fold functions into their callers · 30205377
      Rafael J. Wysocki 提交于
      Fold four functions in the PM core that each have only one caller
      now into their callers.
      
      No intentional functional impact.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      30205377
    • R
      PM: sleep: core: Simplify the SMART_SUSPEND flag handling · 107d47b2
      Rafael J. Wysocki 提交于
      The code to handle the SMART_SUSPEND driver PM flag is hard to follow
      and somewhat inconsistent with respect to devices without middle-layer
      (subsystem) callbacks.
      
      Namely, for those devices the core takes the role of a middle layer
      in providing the expected ordering of execution of callbacks (under
      the assumption that the drivers setting SMART_SUSPEND can reuse their
      PM-runtime callbacks directly for system-wide suspend).  To that end,
      it prevents driver ->suspend_late and ->suspend_noirq callbacks from
      being executed for devices that are still runtime-suspended in
      __device_suspend_late(), because running the same callback funtion
      that was previously run by PM-runtime for them may be invalid.
      
      However, it does that only for devices without any middle-layer
      callbacks for the late/noirq/early suspend/resume phases even
      though it would be simpler and more consistent to skip the
      driver-lavel callbacks for all devices with SMART_SUSPEND set
      that are runtime-suspended in __device_suspend_late().
      
      Simplify the code in accordance with the above observation.
      Suggested-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      107d47b2
  3. 19 4月, 2020 1 次提交
  4. 17 4月, 2020 17 次提交
  5. 16 4月, 2020 7 次提交
    • M
      irqchip/gic-v4.1: Update effective affinity of virtual SGIs · 4b2dfe1e
      Marc Zyngier 提交于
      Although the vSGIs are not directly visible to the host, they still
      get moved around by the CPU hotplug, for example. This results in
      the kernel moaning on the console, such as:
      
        genirq: irq_chip GICv4.1-sgi did not update eff. affinity mask of irq 38
      
      Updating the effective affinity on set_affinity() fixes it.
      Reviewed-by: NZenghui Yu <yuzenghui@huawei.com>
      Signed-off-by: NMarc Zyngier <maz@kernel.org>
      4b2dfe1e
    • M
      irqchip/gic-v4.1: Add support for VPENDBASER's Dirty+Valid signaling · 96806229
      Marc Zyngier 提交于
      When a vPE is made resident, the GIC starts parsing the virtual pending
      table to deliver pending interrupts. This takes place asynchronously,
      and can at times take a long while. Long enough that the vcpu enters
      the guest and hits WFI before any interrupt has been signaled yet.
      The vcpu then exits, blocks, and now gets a doorbell. Rince, repeat.
      
      In order to avoid the above, a (optional on GICv4, mandatory on v4.1)
      feature allows the GIC to feedback to the hypervisor whether it is
      done parsing the VPT by clearing the GICR_VPENDBASER.Dirty bit.
      The hypervisor can then wait until the GIC is ready before actually
      running the vPE.
      
      Plug the detection code as well as polling on vPE schedule. While
      at it, tidy-up the kernel message that displays the GICv4 optional
      features.
      Reviewed-by: NZenghui Yu <yuzenghui@huawei.com>
      Signed-off-by: NMarc Zyngier <maz@kernel.org>
      96806229
    • B
      drm/nouveau/sec2/gv100-: add missing MODULE_FIRMWARE() · 92f673a1
      Ben Skeggs 提交于
      ASB was failing to load on Turing GPUs when firmware is being loaded
      from initramfs, leaving the GPU in an odd state and causing suspend/
      resume to fail.
      
      Add missing MODULE_FIRMWARE() lines for initramfs generators.
      Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
      Cc: <stable@vger.kernel.org> # 5.6
      92f673a1
    • J
      net: tulip: make early_486_chipsets static · ae5a44bb
      Jason Yan 提交于
      Fix the following sparse warning:
      
      drivers/net/ethernet/dec/tulip/tulip_core.c:1280:28: warning: symbol
      'early_486_chipsets' was not declared. Should it be static?
      Reported-by: NHulk Robot <hulkci@huawei.com>
      Signed-off-by: NJason Yan <yanaijie@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ae5a44bb
    • V
      net: mscc: ocelot: fix untagged packet drops when enslaving to vlan aware bridge · 87b0f983
      Vladimir Oltean 提交于
      To rehash a previous explanation given in commit 1c44ce56 ("net:
      mscc: ocelot: fix vlan_filtering when enslaving to bridge before link is
      up"), the switch driver operates the in a mode where a single VLAN can
      be transmitted as untagged on a particular egress port. That is the
      "native VLAN on trunk port" use case.
      
      The configuration for this native VLAN is driven in 2 ways:
       - Set the egress port rewriter to strip the VLAN tag for the native
         VID (as it is egress-untagged, after all).
       - Configure the ingress port to drop untagged and priority-tagged
         traffic, if there is no native VLAN. The intention of this setting is
         that a trunk port with no native VLAN should not accept untagged
         traffic.
      
      Since both of the above configurations for the native VLAN should only
      be done if VLAN awareness is requested, they are actually done from the
      ocelot_port_vlan_filtering function, after the basic procedure of
      toggling the VLAN awareness flag of the port.
      
      But there's a problem with that simplistic approach: we are trying to
      juggle with 2 independent variables from a single function:
       - Native VLAN of the port - its value is held in port->vid.
       - VLAN awareness state of the port - currently there are some issues
         here, more on that later*.
      The actual problem can be seen when enslaving the switch ports to a VLAN
      filtering bridge:
       0. The driver configures a pvid of zero for each port, when in
          standalone mode. While the bridge configures a default_pvid of 1 for
          each port that gets added as a slave to it.
       1. The bridge calls ocelot_port_vlan_filtering with vlan_aware=true.
          The VLAN-filtering-dependent portion of the native VLAN
          configuration is done, considering that the native VLAN is 0.
       2. The bridge calls ocelot_vlan_add with vid=1, pvid=true,
          untagged=true. The native VLAN changes to 1 (change which gets
          propagated to hardware).
       3. ??? - nobody calls ocelot_port_vlan_filtering again, to reapply the
          VLAN-filtering-dependent portion of the native VLAN configuration,
          for the new native VLAN of 1. One can notice that after toggling "ip
          link set dev br0 type bridge vlan_filtering 0 && ip link set dev br0
          type bridge vlan_filtering 1", the new native VLAN finally makes it
          through and untagged traffic finally starts flowing again. But
          obviously that shouldn't be needed.
      
      So it is clear that 2 independent variables need to both re-trigger the
      native VLAN configuration. So we introduce the second variable as
      ocelot_port->vlan_aware.
      
      *Actually both the DSA Felix driver and the Ocelot driver already had
      each its own variable:
       - Ocelot: ocelot_port_private->vlan_aware
       - Felix: dsa_port->vlan_filtering
      but the common Ocelot library needs to work with a single, common,
      variable, so there is some refactoring done to move the vlan_aware
      property from the private structure into the common ocelot_port
      structure.
      
      Fixes: 97bb69e1 ("net: mscc: ocelot: break apart ocelot_vlan_port_apply")
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: NHoratiu Vultur <horatiu.vultur@microchip.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      87b0f983
    • D
      i2c: tegra: Synchronize DMA before termination · 8814044f
      Dmitry Osipenko 提交于
      DMA transfer could be completed, but CPU (which handles DMA interrupt)
      may get too busy and can't handle the interrupt in a timely manner,
      despite of DMA IRQ being raised. In this case the DMA state needs to
      synchronized before terminating DMA transfer in order not to miss the
      DMA transfer completion.
      Signed-off-by: NDmitry Osipenko <digetx@gmail.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      8814044f
    • D
      i2c: tegra: Better handle case where CPU0 is busy for a long time · a900aeac
      Dmitry Osipenko 提交于
      Boot CPU0 always handle I2C interrupt and under some rare circumstances
      (like running KASAN + NFS root) it may stuck in uninterruptible state for
      a significant time. In this case we will get timeout if I2C transfer is
      running on a sibling CPU, despite of IRQ being raised. In order to handle
      this rare condition, the IRQ status needs to be checked after completion
      timeout.
      Signed-off-by: NDmitry Osipenko <digetx@gmail.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      a900aeac
  6. 15 4月, 2020 11 次提交