Skip to content
Permalink
Douglas-Anders…
Switch branches/tags

Commits on Apr 16, 2021

  1. drm/panel: panel-simple: Prepare/unprepare are refcounted, not forced

    Historically simple-panel had code to make sure that if prepare() was
    called on an already-prepared panel that it was a no-op. Similarly if
    unprepare() was called on an already-unprepared panel it was also a
    no-op. Essentially it means that these functions always "forced" the
    value to be whatever the caller wanted it to be. You can see that the
    forcing behavior dates back at least as far as 2014 by looking at
    commit 613a633 ("drm/panel: simple: Add proper definition for
    prepare and unprepare").
    
    Apparently the code supporting the historical behavior may not be
    needed [1] and prepare() / unprepare() are supposed to be
    balanced. Let's try removing it and see if anyone breaks! If they do
    then we can have a debate about whether we should change that code or
    revert this patch. :-) If nobody breaks then we've nicely saved a few
    lines of code and some complexity.
    
    [1] https://lore.kernel.org/r/YHePsQgqOau1V5lD@pendragon.ideasonboard.com
    
    Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
    Signed-off-by: Douglas Anderson <dianders@chromium.org>
    dianders authored and intel-lab-lkp committed Apr 16, 2021
  2. arm64: dts: qcom: Link the panel to the bridge's DDC bus

    Adding this link allows the panel code to do things like read the
    EDID.
    
    Signed-off-by: Douglas Anderson <dianders@chromium.org>
    dianders authored and intel-lab-lkp committed Apr 16, 2021
  3. drm/bridge: ti-sn65dsi86: Don't read EDID blob over DDC

    This is really just a revert of commit 58074b0 ("drm/bridge:
    ti-sn65dsi86: Read EDID blob over DDC"), resolving conflicts.
    
    The old code failed to read the EDID properly in a very important
    case: before the bridge's pre_enable() was called. The way things need
    to work:
    1. Read the EDID.
    2. Based on the EDID, decide on video settings and pixel clock.
    3. Enable the bridge w/ the desired settings.
    
    The way things were working:
    1. Try to read the EDID but fail; fall back to hardcoded values.
    2. Based on hardcoded values, decide on video settings and pixel clock.
    3. Enable the bridge w/ the desired settings.
    4. Try again to read the EDID, it works now!
    5. Realize that the hardcoded settings weren't quite right.
    6. Disable / reenable the bridge w/ the right settings.
    
    The reasons for the failures were twofold:
    a) Since we never ran the bridge chip's pre-enable then we never set
       the bit to ignore HPD. This meant the bridge chip didn't even _try_
       to go out on the bus and communicate with the panel.
    b) Even if we fixed things to ignore HPD, the EDID still wouldn't read
       if the panel wasn't on.
    
    Instead of reverting the code, we could fix it to set the HPD bit and
    also power on the panel. However, it also works nicely to just let the
    panel code read the EDID. Now that we've split the driver up we can
    expose the DDC AUX channel bus to the panel node. The panel can take
    charge of reading the EDID.
    
    NOTE: in order for things to work, anyone that needs to read the EDID
    will need to add something that looks like this to their panel in the
    dts:
      ddc-i2c-bus = <&sn65dsi86_bridge>;
    
    Presumably it's OK to land this without waiting for users to add the
    dts property since the EDID reading was a bit broken anyway, was
    "recently" added, and we know we must have the fallback mode to use
    (since the EDID reading was a bit broken).
    
    Suggested-by: Andrzej Hajda <a.hajda@samsung.com>
    Signed-off-by: Douglas Anderson <dianders@chromium.org>
    dianders authored and intel-lab-lkp committed Apr 16, 2021
  4. drm/panel: panel-simple: Cache the EDID as long as we retain power

    It doesn't make sense to go out to the bus and read the EDID over and
    over again. Let's cache it and throw away the cache when we turn power
    off from the panel. Autosuspend means that even if there are several
    calls to read the EDID before we officially turn the power on then we
    should get good use out of this cache.
    
    Signed-off-by: Douglas Anderson <dianders@chromium.org>
    dianders authored and intel-lab-lkp committed Apr 16, 2021
  5. drm/panel: panel-simple: Power the panel when reading the EDID

    I don't believe that it ever makes sense to read the EDID when a panel
    is not powered and the powering on of the panel is the job of
    prepare(). Let's make sure that this happens before we try to read the
    EDID. We use the pm_runtime functions directly rather than directly
    calling the normal prepare() function because the pm_runtime functions
    are definitely refcounted whereas it's less clear if the prepare() one
    is.
    
    NOTE: I'm not 100% sure how EDID reading was working for folks in the
    past, but I can only assume that it was failing on the initial attempt
    and then working only later. This patch, presumably, will fix that. If
    some panel out there really can read the EDID without powering up and
    it's a big advantage to preserve the old behavior we can add a
    per-panel flag. It appears that providing the DDC bus to the panel in
    the past was somewhat uncommon in any case.
    
    Signed-off-by: Douglas Anderson <dianders@chromium.org>
    dianders authored and intel-lab-lkp committed Apr 16, 2021
  6. drm/panel: panel-simple: Remove extra call: drm_connector_update_edid…

    …_property()
    
    As of commit 5186421 ("drm: Introduce epoch counter to
    drm_connector") the drm_get_edid() function calls
    drm_connector_update_edid_property() for us. There's no reason for us
    to call it again.
    
    Signed-off-by: Douglas Anderson <dianders@chromium.org>
    dianders authored and intel-lab-lkp committed Apr 16, 2021
  7. i2c: i2c-core-of: Fix corner case of finding adapter by node

    The of_find_i2c_adapter_by_node() could end up failing to find an
    adapter in certain conditions. Specifically it's possible that
    of_dev_or_parent_node_match() could end up finding an I2C client in
    the list and cause bus_find_device() to stop early even though an I2C
    adapter was present later in the list.
    
    Let's move the i2c_verify_adapter() into the predicate function to
    prevent this. Now we'll properly skip over the I2C client and be able
    to find the I2C adapter.
    
    This issue has always been a potential problem if a single device tree
    node could represent both an I2C client and an adapter. I believe this
    is a sane thing to do if, for instance, an I2C-connected DP bridge
    chip is present. The bridge chip is an I2C client but it can also
    provide an I2C adapter (DDC tunneled over AUX channel). We don't want
    to have to create a sub-node just so a panel can link to it with the
    "ddc-i2c-bus" property.
    
    I believe that this problem got worse, however, with commit
    e814e68 ("i2c: of: Try to find an I2C adapter matching the
    parent"). Starting at that commit it would be even easier to
    accidentally miss finding the adapter.
    
    Signed-off-by: Douglas Anderson <dianders@chromium.org>
    dianders authored and intel-lab-lkp committed Apr 16, 2021
  8. drm/bridge: ti-sn65dsi86: Promote the AUX channel to its own sub-dev

    We'd like to be able to expose the DDC-over-AUX channel bus to our
    panel. This gets into a chicken-and-egg problem because:
    - The panel wants to get its DDC at probe time.
    - The ti-sn65dsi86 MIPI-to-eDP bridge code, which provides the DDC
      bus, wants to get the panel at probe time.
    
    By using a sub device we can fully create the AUX channel bits so that
    the panel can get them. Then the panel can finish probing and the
    bridge can probe.
    
    To accomplish this, we also move registering the AUX channel out of
    the bridge's attach code and do it right at probe time. We use devm to
    manage cleanup.
    
    NOTE: there's a little bit of a trick here. Though the AUX channel can
    run without the MIPI-to-eDP bits of the code, the MIPI-to-eDP bits
    can't run without the AUX channel. We could come up a complicated
    signaling scheme (have the MIPI-to-eDP bits return EPROBE_DEFER for a
    while or wait on some sort of completion), but it seems simple enough
    to just not even bother creating the bridge device until the AUX
    channel probes. That's what we'll do.
    
    Signed-off-by: Douglas Anderson <dianders@chromium.org>
    dianders authored and intel-lab-lkp committed Apr 16, 2021
  9. drm/bridge: ti-sn65dsi86: If refclk, DP AUX can happen w/out pre-enable

    Let's reorganize how we init and turn on the reference clock in the
    code to allow us to turn it on early (even before pre_enable()) so
    that we can read the EDID early. This is handy for eDP because:
    - We always assume that a panel is there.
    - Once we report that a panel is there we get asked to read the EDID.
    - Pre-enable isn't called until we know what pixel clock we want to
      use and we're ready to turn everything on. That's _after_ we get
      asked to read the EDID.
    
    NOTE: the above only works out OK if we "refclk" is provided. Though I
    don't have access to any hardware that uses ti-sn65dsi86 and _doesn't_
    provide a "refclk", I believe that we'll have trouble reading the EDID
    at bootup in that case. Specifically I believe that if there's no
    "refclk" we need the MIPI source clock to be active before we can
    successfully read the EDID. My evidence here is that, in testing, I
    couldn't read the EDID until I turned on the DPPLL in the bridge chip
    and that the DPPLL needs the input clock to be active.
    
    Since this is hard to support, let's punt trying to handle this case
    if there's no "refclk". In that case we'll enable comms in
    pre_enable() like we always did.
    
    I don't believe there are any users of the ti-sn65dsi86 bridge chip
    that _don't_ use "refclk". The bridge chip is _very_ inflexible in
    that mode. The only time I've seen that mode used was for some really
    early prototype hardware that was thrown in the e-waste bin years ago
    when we realized how inflexible it was.
    
    Even if someone is using the bridge chip without the "refclk" they're
    in no worse shape than they were before the (fairly recent) commit
    58074b0 ("drm/bridge: ti-sn65dsi86: Read EDID blob over DDC").
    
    Signed-off-by: Douglas Anderson <dianders@chromium.org>
    dianders authored and intel-lab-lkp committed Apr 16, 2021
  10. drm/bridge: ti-sn65dsi86: Code motion of refclk management functions

    No functional changes--this just makes the diffstat of a future change
    easier to understand.
    
    Signed-off-by: Douglas Anderson <dianders@chromium.org>
    dianders authored and intel-lab-lkp committed Apr 16, 2021
  11. drm/bridge: ti-sn65dsi86: Use pm_runtime autosuspend

    Let's make the bridge use autosuspend with a 500ms delay. This is in
    preparation for promoting DP AUX transfers to their own sub-driver so
    that we're not constantly powering up and down the device as we
    transfer all the chunks.
    
    Signed-off-by: Douglas Anderson <dianders@chromium.org>
    dianders authored and intel-lab-lkp committed Apr 16, 2021
  12. drm/panel: panel-simple: Get rid of hacky HPD chicken-and-egg code

    When I added support for the hpd-gpio to simple-panel in commit
    48834e6 ("drm/panel-simple: Support hpd-gpios for delaying
    prepare()"), I added a special case to handle a circular dependency I
    was running into on the ti-sn65dsi86 bridge chip. On my board the
    hpd-gpio is actually provided by the bridge chip. That was causing
    some circular dependency problems that I had to work around by getting
    the hpd-gpio late.
    
    I've now reorganized the ti-sn65dsi86 bridge chip driver to be a
    collection of sub-drivers. Now the GPIO part can probe separately and
    that breaks the chain. Let's get rid of the old code to clean things
    up.
    
    Signed-off-by: Douglas Anderson <dianders@chromium.org>
    dianders authored and intel-lab-lkp committed Apr 16, 2021
  13. drm/bridge: ti-sn65dsi86: Break GPIO and MIPI-to-eDP bridge into sub-…

    …drivers
    
    Let's use the newly minted aux bus to break up the driver into sub
    drivers. We're not doing a full breakup here: all the code is still in
    the same file and remains largely untouched. The big goal here of
    using sub-drivers is to allow part of our code to finish probing even
    if some other code needs to defer. This can solve some chicken-and-egg
    problems. Specifically:
    - In commit 48834e6 ("drm/panel-simple: Support hpd-gpios for
      delaying prepare()") we had to add a bit of a hack to simpel-panel
      to support HPD showing up late. We can get rid of that hack now
      since the GPIO part of our driver can finish probing early.
    - We have a desire to expose our DDC bus to simple-panel (and perhaps
      to a backlight driver?). That will end up with the same
      chicken-and-egg problem. A future patch to move this to a sub-driver
      will fix it.
    - If/when we support the PWM functionality present in the bridge chip
      for a backlight we'll end up with another chicken-and-egg
      problem. If we allow the PWM to be a sub-driver too then it solves
      this problem.
    
    Signed-off-by: Douglas Anderson <dianders@chromium.org>
    dianders authored and intel-lab-lkp committed Apr 16, 2021
  14. drm/bridge: ti-sn65dsi86: Move all the chip-related init to the start

    This is just code motion of the probe routine to move all the things
    that are for the "whole chip" (instead of the GPIO parts or the
    MIPI-to-eDP parts) together at the start of probe. This is in
    preparation for breaking the driver into sub-drivers.
    
    Since we're using devm for all of the "whole chip" stuff this is
    actually quite easy now.
    
    Signed-off-by: Douglas Anderson <dianders@chromium.org>
    dianders authored and intel-lab-lkp committed Apr 16, 2021
  15. drm/bridge: ti-sn65dsi86: Use devm to do our runtime_disable

    There's no devm_runtime_enable(), but it's easy to use
    devm_add_action_or_reset() and means we don't need to worry about the
    disable in our remove() routine or in error paths.
    
    No functional changes intended by this change.
    
    Signed-off-by: Douglas Anderson <dianders@chromium.org>
    dianders authored and intel-lab-lkp committed Apr 16, 2021
  16. drm/bridge: ti-sn65dsi86: Cleanup managing of drvdata

    Let's:
    - Set the drvdata as soon as it's allocated. This just sets up a
      pointer so there's no downside here.
    - Remove the useless call to i2c_set_clientdata() which is literally
      the same thing as dev_set_drvdata().
    
    No functional changes intended.
    
    Signed-off-by: Douglas Anderson <dianders@chromium.org>
    dianders authored and intel-lab-lkp committed Apr 16, 2021
  17. drm/bridge: ti-sn65dsi86: Add local var for "dev" to simplify probe

    Tiny cleanup for probe so we don't keep having to specify
    "&client->dev" or "pdata->dev". No functional changes intended.
    
    Signed-off-by: Douglas Anderson <dianders@chromium.org>
    dianders authored and intel-lab-lkp committed Apr 16, 2021
  18. drm/bridge: ti-sn65dsi86: Clean debugfs code

    Let's cleanup the debugfs code to:
    - Check for errors.
    - Use devm to manage freeing, which also means we don't need to store
      a pointer in our structure.
    
    Signed-off-by: Douglas Anderson <dianders@chromium.org>
    dianders authored and intel-lab-lkp committed Apr 16, 2021
  19. drm/bridge: ti-sn65dsi86: More renames in prep for sub-devices

    Like the previous patch ("drm/bridge: ti-sn65dsi86: Rename the main
    driver data structure") this is just a no-op rename in preparation for
    splitting the driver up a bit.
    
    Here I've attempted to rename functions / structures making sure that
    anything applicable to the whole chip (instead of just the MIPI to eDP
    bridge part) included "sn65dsi86" somewhere in the name instead of
    just "ti_sn_bridge".
    
    Signed-off-by: Douglas Anderson <dianders@chromium.org>
    dianders authored and intel-lab-lkp committed Apr 16, 2021
  20. drm/bridge: ti-sn65dsi86: Rename the main driver data structure

    In preparation for splitting this driver into sub-drivers, let's
    rename the main data structure so it's clear that it's holding data
    for the whole device and not just the MIPI-eDP bridge part.
    
    This is a no-op change.
    
    Signed-off-by: Douglas Anderson <dianders@chromium.org>
    dianders authored and intel-lab-lkp committed Apr 16, 2021
  21. drm/panel: panel-simple: Use runtime pm to avoid excessive unprepare …

    …/ prepare
    
    Unpreparing and re-preparing a panel can be a really heavy
    operation. Panels datasheets often specify something on the order of
    500ms as the delay you should insert after turning off the panel
    before turning it on again. In addition, turning on a panel can have
    delays on the order of 100ms - 200ms before the panel will assert HPD
    (AKA "panel ready"). The above means that we should avoid turning a
    panel off if we're going to turn it on again shortly.
    
    The above becomes a problem when we want to read the EDID of a
    panel. The way that ordering works is that userspace wants to read the
    EDID of the panel _before_ fully enabling it so that it can set the
    initial mode correctly. However, we can't read the EDID until we power
    it up. This leads to code that does this dance (like
    ps8640_bridge_get_edid()):
    
    1. When userspace requests EDID / the panel modes (through an ioctl),
       we power on the panel just enough to read the EDID and then power
       it off.
    2. Userspace then turns the panel on.
    
    There's likely not much time between step #1 and #2 and so we want to
    avoid powering the panel off and on again between those two steps.
    
    Let's use Runtime PM to help us. We'll move the existing prepare() and
    unprepare() to be runtime resume() and runtime suspend(). Now when we
    want to prepare() or unprepare() we just increment or decrement the
    refcount. We'll default to a 1 second autosuspend delay which seems
    sane given the typical delays we see for panels.
    
    A few notes:
    - It seems the existing unprepare() and prepare() are defined to be
      no-ops if called extra times. We'll preserve that behavior but may
      try to remove it in a future patch.
    - This is a slight change in the ABI of simple panel. If something was
      absolutely relying on the unprepare() to happen instantly that
      simply won't be the case anymore. I'm not aware of anyone relying on
      that behavior, but if there is someone then we'll need to figure out
      how to enable (or disable) this new delayed behavior selectively.
    - In order for this to work we now have a hard dependency on
      "PM". From memory this is a legit thing to assume these days and we
      don't have to find some fallback to keep working if someone wants to
      build their system without "PM".
    
    Signed-off-by: Douglas Anderson <dianders@chromium.org>
    Link: https://lore.kernel.org/r/20210402152701.v3.12.I9e8bd33b49c496745bfac58ea9ab418bd3b6f5ce@changeid
    Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
    dianders authored and intel-lab-lkp committed Apr 16, 2021
  22. drm/bridge: ti-sn65dsi86: Get rid of the useless detect() function

    If we just leave the detect() function as NULL then the upper layers
    assume we're always connected. There's no reason for a stub.
    
    Signed-off-by: Douglas Anderson <dianders@chromium.org>
    Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
    Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
    dianders authored and intel-lab-lkp committed Apr 16, 2021
  23. drm/bridge: ti-sn65dsi86: Move drm_panel_unprepare() to post_disable()

    We prepared the panel in pre_enable() so we should unprepare it in
    post_disable() to match.
    
    Signed-off-by: Douglas Anderson <dianders@chromium.org>
    Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
    Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
    dianders authored and intel-lab-lkp committed Apr 16, 2021
  24. drm/bridge: ti-sn65dsi86: Reorder remove()

    Let's make the remove() function strictly the reverse of the probe()
    function so it's easier to reason about.
    
    This patch was created by code inspection and should move us closer to
    a proper remove.
    
    Signed-off-by: Douglas Anderson <dianders@chromium.org>
    Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
    Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
    dianders authored and intel-lab-lkp committed Apr 16, 2021
  25. drm/bridge: ti-sn65dsi86: Remove incorrectly tagged kerneldoc comment

    A random comment inside a function had "/**" in front of it. That
    doesn't make sense. Remove.
    
    Signed-off-by: Douglas Anderson <dianders@chromium.org>
    Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
    Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
    dianders authored and intel-lab-lkp committed Apr 16, 2021
  26. drm/bridge: ti-sn65dsi86: Simplify refclk handling

    The clock framework makes it simple to deal with an optional clock.
    You can call clk_get_optional() and if the clock isn't specified it'll
    just return NULL without complaint. It's valid to pass NULL to
    enable/disable/prepare/unprepare. Let's make use of this to simplify
    things a tiny bit.
    
    Signed-off-by: Douglas Anderson <dianders@chromium.org>
    Reviewed-by: Robert Foss <robert.foss@linaro.org>
    Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
    Reviewed-by: Stephen Boyd <swboyd@chromium.org>
    Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
    Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
    dianders authored and intel-lab-lkp committed Apr 16, 2021
  27. drm/bridge: Fix the stop condition of drm_bridge_chain_pre_enable()

    The drm_bridge_chain_pre_enable() is not the proper opposite of
    drm_bridge_chain_post_disable(). It continues along the chain to
    _before_ the starting bridge. Let's fix that.
    
    Fixes: 05193dc ("drm/bridge: Make the bridge chain a double-linked list")
    Signed-off-by: Douglas Anderson <dianders@chromium.org>
    Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
    Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
    dianders authored and intel-lab-lkp committed Apr 16, 2021
  28. Add linux-next specific files for 20210416

    Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
    sfrothwell committed Apr 16, 2021
  29. Merge branch 'akpm/master'

    sfrothwell committed Apr 16, 2021
  30. memfd_secret: use unsigned int rather than long as syscall flags type

    Yuri Norov says:
    
      If parameter size is the same for native and compat ABIs, we may
      wire a syscall made by compat client to native handler. This is
      true for unsigned int, but not true for unsigned long or pointer.
    
      That's why I suggest using unsigned int and so avoid creating compat
      entry point.
    
    Use unsigned int as the type of the flags parameter in memfd_secret()
    system call.
    
    Link: https://lkml.kernel.org/r/20210331142345.27532-1-rppt@kernel.org
    Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
    Acked-by: David Hildenbrand <david@redhat.com>
    Acked-by: Yury Norov <yury.norov@gmail.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
    rppt authored and sfrothwell committed Apr 16, 2021
  31. secretmem: test: add basic selftest for memfd_secret(2)

    The test verifies that file descriptor created with memfd_secret does not
    allow read/write operations, that secret memory mappings respect
    RLIMIT_MEMLOCK and that remote accesses with process_vm_read() and
    ptrace() to the secret memory fail.
    
    Link: https://lkml.kernel.org/r/20210303162209.8609-10-rppt@kernel.org
    Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
    Cc: Alexander Viro <viro@zeniv.linux.org.uk>
    Cc: Andy Lutomirski <luto@kernel.org>
    Cc: Arnd Bergmann <arnd@arndb.de>
    Cc: Borislav Petkov <bp@alien8.de>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Christopher Lameter <cl@linux.com>
    Cc: Dan Williams <dan.j.williams@intel.com>
    Cc: Dave Hansen <dave.hansen@linux.intel.com>
    Cc: David Hildenbrand <david@redhat.com>
    Cc: Elena Reshetova <elena.reshetova@intel.com>
    Cc: Hagen Paul Pfeifer <hagen@jauu.net>
    Cc: "H. Peter Anvin" <hpa@zytor.com>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: James Bottomley <jejb@linux.ibm.com>
    Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Matthew Wilcox <willy@infradead.org>
    Cc: Michael Kerrisk <mtk.manpages@gmail.com>
    Cc: Palmer Dabbelt <palmer@dabbelt.com>
    Cc: Palmer Dabbelt <palmerdabbelt@google.com>
    Cc: Paul Walmsley <paul.walmsley@sifive.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Rick Edgecombe <rick.p.edgecombe@intel.com>
    Cc: Roman Gushchin <guro@fb.com>
    Cc: Shakeel Butt <shakeelb@google.com>
    Cc: Shuah Khan <shuah@kernel.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Tycho Andersen <tycho@tycho.ws>
    Cc: Will Deacon <will@kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
    rppt authored and sfrothwell committed Apr 16, 2021
  32. memfd_secret: use unsigned int rather than long as syscall flags type

    Yuri Norov says:
    
      If parameter size is the same for native and compat ABIs, we may
      wire a syscall made by compat client to native handler. This is
      true for unsigned int, but not true for unsigned long or pointer.
    
      That's why I suggest using unsigned int and so avoid creating compat
      entry point.
    
    Use unsigned int as the type of the flags parameter in memfd_secret()
    system call.
    
    Link: https://lkml.kernel.org/r/20210331142345.27532-1-rppt@kernel.org
    Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
    Acked-by: David Hildenbrand <david@redhat.com>
    Acked-by: Yury Norov <yury.norov@gmail.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
    rppt authored and sfrothwell committed Apr 16, 2021
  33. arch, mm: wire up memfd_secret system call where relevant

    Wire up memfd_secret system call on architectures that define
    ARCH_HAS_SET_DIRECT_MAP, namely arm64, risc-v and x86.
    
    Link: https://lkml.kernel.org/r/20210303162209.8609-9-rppt@kernel.org
    Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
    Acked-by: Palmer Dabbelt <palmerdabbelt@google.com>
    Acked-by: Arnd Bergmann <arnd@arndb.de>
    Acked-by: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Alexander Viro <viro@zeniv.linux.org.uk>
    Cc: Andy Lutomirski <luto@kernel.org>
    Cc: Borislav Petkov <bp@alien8.de>
    Cc: Christopher Lameter <cl@linux.com>
    Cc: Dan Williams <dan.j.williams@intel.com>
    Cc: Dave Hansen <dave.hansen@linux.intel.com>
    Cc: David Hildenbrand <david@redhat.com>
    Cc: Elena Reshetova <elena.reshetova@intel.com>
    Cc: Hagen Paul Pfeifer <hagen@jauu.net>
    Cc: "H. Peter Anvin" <hpa@zytor.com>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: James Bottomley <jejb@linux.ibm.com>
    Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Matthew Wilcox <willy@infradead.org>
    Cc: Michael Kerrisk <mtk.manpages@gmail.com>
    Cc: Palmer Dabbelt <palmer@dabbelt.com>
    Cc: Paul Walmsley <paul.walmsley@sifive.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Rick Edgecombe <rick.p.edgecombe@intel.com>
    Cc: Roman Gushchin <guro@fb.com>
    Cc: Shakeel Butt <shakeelb@google.com>
    Cc: Shuah Khan <shuah@kernel.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Tycho Andersen <tycho@tycho.ws>
    Cc: Will Deacon <will@kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
    rppt authored and sfrothwell committed Apr 16, 2021
  34. PM: hibernate: disable when there are active secretmem users

    It is unsafe to allow saving of secretmem areas to the hibernation
    snapshot as they would be visible after the resume and this essentially
    will defeat the purpose of secret memory mappings.
    
    Prevent hibernation whenever there are active secret memory users.
    
    Link: https://lkml.kernel.org/r/20210303162209.8609-8-rppt@kernel.org
    Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
    Cc: Alexander Viro <viro@zeniv.linux.org.uk>
    Cc: Andy Lutomirski <luto@kernel.org>
    Cc: Arnd Bergmann <arnd@arndb.de>
    Cc: Borislav Petkov <bp@alien8.de>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Christopher Lameter <cl@linux.com>
    Cc: Dan Williams <dan.j.williams@intel.com>
    Cc: Dave Hansen <dave.hansen@linux.intel.com>
    Cc: David Hildenbrand <david@redhat.com>
    Cc: Elena Reshetova <elena.reshetova@intel.com>
    Cc: Hagen Paul Pfeifer <hagen@jauu.net>
    Cc: "H. Peter Anvin" <hpa@zytor.com>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: James Bottomley <jejb@linux.ibm.com>
    Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Matthew Wilcox <willy@infradead.org>
    Cc: Michael Kerrisk <mtk.manpages@gmail.com>
    Cc: Palmer Dabbelt <palmer@dabbelt.com>
    Cc: Palmer Dabbelt <palmerdabbelt@google.com>
    Cc: Paul Walmsley <paul.walmsley@sifive.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Rick Edgecombe <rick.p.edgecombe@intel.com>
    Cc: Roman Gushchin <guro@fb.com>
    Cc: Shakeel Butt <shakeelb@google.com>
    Cc: Shuah Khan <shuah@kernel.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Tycho Andersen <tycho@tycho.ws>
    Cc: Will Deacon <will@kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
    rppt authored and sfrothwell committed Apr 16, 2021
  35. memfd_secret: use unsigned int rather than long as syscall flags type

    Yuri Norov says:
    
      If parameter size is the same for native and compat ABIs, we may
      wire a syscall made by compat client to native handler. This is
      true for unsigned int, but not true for unsigned long or pointer.
    
      That's why I suggest using unsigned int and so avoid creating compat
      entry point.
    
    Use unsigned int as the type of the flags parameter in memfd_secret()
    system call.
    
    Link: https://lkml.kernel.org/r/20210331142345.27532-1-rppt@kernel.org
    Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
    Acked-by: David Hildenbrand <david@redhat.com>
    Acked-by: Yury Norov <yury.norov@gmail.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
    rppt authored and sfrothwell committed Apr 16, 2021
Older