1. 25 8月, 2020 1 次提交
  2. 23 8月, 2020 1 次提交
    • T
      l2tp: remove tunnel and session debug flags field · eee049c0
      Tom Parkin 提交于
      The l2tp subsystem now uses standard kernel logging APIs for
      informational and warning messages, and tracepoints for debug
      information.
      
      Now that the tunnel and session debug flags are unused, remove the field
      from the core structures.
      
      Various system calls (in the case of l2tp_ppp) and netlink messages
      handle the getting and setting of debug flags.  To avoid userspace
      breakage don't modify the API of these calls; simply ignore set
      requests, and send dummy data for get requests.
      Signed-off-by: NTom Parkin <tparkin@katalix.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      eee049c0
  3. 22 8月, 2020 1 次提交
  4. 21 8月, 2020 1 次提交
  5. 20 8月, 2020 4 次提交
  6. 19 8月, 2020 2 次提交
    • X
      ipv6: some fixes for ipv6_dev_find() · 4ef1a7cb
      Xin Long 提交于
      This patch is to do 3 things for ipv6_dev_find():
      
        As David A. noticed,
      
        - rt6_lookup() is not really needed. Different from __ip_dev_find(),
          ipv6_dev_find() doesn't have a compatibility problem, so remove it.
      
        As Hideaki suggested,
      
        - "valid" (non-tentative) check for the address is also needed.
          ipv6_chk_addr() calls ipv6_chk_addr_and_flags(), which will
          traverse the address hash list, but it's heavy to be called
          inside ipv6_dev_find(). This patch is to reuse the code of
          ipv6_chk_addr_and_flags() for ipv6_dev_find().
      
        - dev parameter is passed into ipv6_dev_find(), as link-local
          addresses from user space has sin6_scope_id set and the dev
          lookup needs it.
      
      Fixes: 81f6cb31 ("ipv6: add ipv6_dev_find()")
      Suggested-by: NYOSHIFUJI Hideaki <hideaki.yoshifuji@miraclelinux.com>
      Reported-by: NDavid Ahern <dsahern@gmail.com>
      Signed-off-by: NXin Long <lucien.xin@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4ef1a7cb
    • J
      netlink: make NLA_BINARY validation more flexible · 8aa26c57
      Johannes Berg 提交于
      Add range validation for NLA_BINARY, allowing validation of any
      combination of combination minimum or maximum lengths, using the
      existing NLA_POLICY_RANGE()/NLA_POLICY_FULL_RANGE() macros, just
      like for integers where the value is checked.
      
      Also make NLA_POLICY_EXACT_LEN(), NLA_POLICY_EXACT_LEN_WARN()
      and NLA_POLICY_MIN_LEN() special cases of this, removing the old
      types NLA_EXACT_LEN and NLA_MIN_LEN.
      
      This allows us to save some code where both minimum and maximum
      lengths are requires, currently the policy only allows maximum
      (NLA_BINARY), minimum (NLA_MIN_LEN) or exact (NLA_EXACT_LEN), so
      a range of lengths cannot be accepted and must be checked by the
      code that consumes the attributes later.
      
      Also, this allows advertising the correct ranges in the policy
      export to userspace. Here, NLA_MIN_LEN and NLA_EXACT_LEN already
      were special cases of NLA_BINARY with min and min/max length
      respectively.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8aa26c57
  7. 18 8月, 2020 3 次提交
  8. 15 8月, 2020 14 次提交
  9. 14 8月, 2020 2 次提交
    • C
      dma-pool: fix coherent pool allocations for IOMMU mappings · 9420139f
      Christoph Hellwig 提交于
      When allocating coherent pool memory for an IOMMU mapping we don't care
      about the DMA mask.  Move the guess for the initial GFP mask into the
      dma_direct_alloc_pages and pass dma_coherent_ok as a function pointer
      argument so that it doesn't get applied to the IOMMU case.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Tested-by: NAmit Pundir <amit.pundir@linaro.org>
      9420139f
    • E
      random32: add a tracepoint for prandom_u32() · 94c7eb54
      Eric Dumazet 提交于
      There has been some heat around prandom_u32() lately, and some people
      were wondering if there was a simple way to determine how often
      it was used, before considering making it maybe 10 times more expensive.
      
      This tracepoint exports the generated pseudo random value.
      
      Tested:
      
      perf list | grep prandom_u32
        random:prandom_u32                                 [Tracepoint event]
      
      perf record -a [-g] [-C1] -e random:prandom_u32 sleep 1
      [ perf record: Woken up 0 times to write data ]
      [ perf record: Captured and wrote 259.748 MB perf.data (924087 samples) ]
      
      perf report --nochildren
          ...
          97.67%  ksoftirqd/1     [kernel.vmlinux]  [k] prandom_u32
                  |
                  ---prandom_u32
                     prandom_u32
                     |
                     |--48.86%--tcp_v4_syn_recv_sock
                     |          tcp_check_req
                     |          tcp_v4_rcv
                     |          ...
                      --48.81%--tcp_conn_request
                                tcp_v4_conn_request
                                tcp_rcv_state_process
                                ...
      perf script
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Cc: Willy Tarreau <w@1wt.eu>
      Cc: Sedat Dilek <sedat.dilek@gmail.com>
      Tested-by: NSedat Dilek <sedat.dilek@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      94c7eb54
  10. 13 8月, 2020 11 次提交
    • O
      xen: Sync up with the canonical protocol definition in Xen · 6f92337b
      Oleksandr Andrushchenko 提交于
      This is the sync up with the canonical definition of the
      display protocol in Xen.
      
      1. Add protocol version as an integer
      
      Version string, which is in fact an integer, is hard to handle in the
      code that supports different protocol versions. To simplify that
      also add the version as an integer.
      
      2. Pass buffer offset with XENDISPL_OP_DBUF_CREATE
      
      There are cases when display data buffer is created with non-zero
      offset to the data start. Handle such cases and provide that offset
      while creating a display buffer.
      
      3. Add XENDISPL_OP_GET_EDID command
      
      Add an optional request for reading Extended Display Identification
      Data (EDID) structure which allows better configuration of the
      display connectors over the configuration set in XenStore.
      With this change connectors may have multiple resolutions defined
      with respect to detailed timing definitions and additional properties
      normally provided by displays.
      
      If this request is not supported by the backend then visible area
      is defined by the relevant XenStore's "resolution" property.
      
      If backend provides extended display identification data (EDID) with
      XENDISPL_OP_GET_EDID request then EDID values must take precedence
      over the resolutions defined in XenStore.
      
      4. Bump protocol version to 2.
      Signed-off-by: NOleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
      Reviewed-by: NJuergen Gross <jgross@suse.com>
      Link: https://lore.kernel.org/r/20200813062113.11030-5-andr2000@gmail.comSigned-off-by: NJuergen Gross <jgross@suse.com>
      6f92337b
    • A
      mfd: Replace HTTP links with HTTPS ones · 4f4ed454
      Alexander A. Klimov 提交于
      Rationale:
      Reduces attack surface on kernel devs opening the links for MITM
      as HTTPS traffic is much harder to manipulate.
      
      Deterministic algorithm:
      For each file:
        If not .svg:
          For each line:
            If doesn't contain `\bxmlns\b`:
              For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
      	  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
                  If both the HTTP and HTTPS versions
                  return 200 OK and serve the same content:
                    Replace HTTP with HTTPS.
      Signed-off-by: NAlexander A. Klimov <grandmaster@al2klimov.de>
      Acked-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      4f4ed454
    • C
      mfd: mfd-core: Add mechanism for removal of a subset of children · 114294d2
      Charles Keepax 提交于
      Currently, the only way to remove MFD children is with a call to
      mfd_remove_devices, which will remove all the children. Under
      some circumstances it is useful to remove only a subset of the
      child devices. For example if some additional clean up is required
      between removal of certain child devices.
      
      To accomplish this a level field is added to mfd_cell, the normal
      mfd_remove_devices is modified to not remove devices that are set
      to a higher level and a corresponding mfd_remove_devices_late
      function is added to remove those children.
      
      See further discussion at:
      https://lore.kernel.org/lkml/20200616075834.GF2608702@dell/Suggested-by: NLee Jones <lee.jones@linaro.org>
      Signed-off-by: NCharles Keepax <ckeepax@opensource.cirrus.com>
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      114294d2
    • R
      mfd: max77693-private: Drop a duplicated word · e7b85500
      Randy Dunlap 提交于
      Drop the repeated word "in" in a comment.
      Signed-off-by: NRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      e7b85500
    • R
      mfd: da9055: pdata.h: Drop a duplicated word · 23ef2b64
      Randy Dunlap 提交于
      Drop the repeated word "that" in a comment.
      Signed-off-by: NRandy Dunlap <rdunlap@infradead.org>
      Acked-by: NAdam Thomson <Adam.Thomson.Opensource@diasemi.com>
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      23ef2b64
    • A
      mfd: da9063: Add support for latest DA silicon revision · 9ece3601
      Adam Thomson 提交于
      This update adds new regmap tables to support the latest DA silicon
      which will automatically be selected based on the chip and variant
      information read from the device.
      Signed-off-by: NAdam Thomson <Adam.Thomson.Opensource@diasemi.com>
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      9ece3601
    • A
      mfd: da9063: Fix revision handling to correctly select reg tables · 091c6110
      Adam Thomson 提交于
      The current implementation performs checking in the i2c_probe()
      function of the variant_code but does this immediately after the
      containing struct has been initialised as all zero. This means the
      check for variant code will always default to using the BB tables
      and will never select AD. The variant code is subsequently set
      by device_init() and later used by the RTC so really it's a little
      fortunate this mismatch works.
      
      This update adds raw I2C read access functionality to read the chip
      and variant/revision information (common to all revisions) so that
      it can subsequently correctly choose the proper regmap tables for
      real initialisation.
      Signed-off-by: NAdam Thomson <Adam.Thomson.Opensource@diasemi.com>
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      091c6110
    • M
      mfd: smsc-ece1099: Remove driver · 7d2594cd
      Michael Walle 提交于
      This MFD driver has no user. The keypad driver of this device never made
      it into the kernel. Therefore, this driver is useless. Remove it.
      Signed-off-by: NMichael Walle <michael@walle.cc>
      Cc: Sourav Poddar <sourav.poddar@ti.com>
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      7d2594cd
    • L
      mfd: core: Add OF_MFD_CELL_REG() helper · 44e6171e
      Lee Jones 提交于
      Extend current list of helpers to provide support for parent drivers
      wishing to match specific child devices to particular OF nodes.
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      44e6171e
    • L
      mfd: core: Fix formatting of MFD helpers · d097965b
      Lee Jones 提交于
      Remove unnecessary '\'s and leading tabs.
      
      This will help to clean-up future diffs when subsequent changes are
      made.
      
      Hint: The aforementioned changes follow this patch.
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      d097965b
    • L
      mfd: core: Make a best effort attempt to match devices with the correct of_nodes · 466a62d7
      Lee Jones 提交于
      Currently, when a child platform device (sometimes referred to as a
      sub-device) is registered via the Multi-Functional Device (MFD) API,
      the framework attempts to match the newly registered platform device
      with its associated Device Tree (OF) node.  Until now, the device has
      been allocated the first node found with an identical OF compatible
      string.  Unfortunately, if there are, say for example '3' devices
      which are to be handled by the same driver and therefore have the same
      compatible string, each of them will be allocated a pointer to the
      *first* node.
      
      An example Device Tree entry might look like this:
      
        mfd_of_test {
                compatible = "mfd,of-test-parent";
                #address-cells = <0x02>;
                #size-cells = <0x02>;
      
                child@aaaaaaaaaaaaaaaa {
                        compatible = "mfd,of-test-child";
                        reg = <0xaaaaaaaa 0xaaaaaaaa 0 0x11>,
                              <0xbbbbbbbb 0xbbbbbbbb 0 0x22>;
                };
      
                child@cccccccc {
                        compatible = "mfd,of-test-child";
                        reg = <0x00000000 0xcccccccc 0 0x33>;
                };
      
                child@dddddddd00000000 {
                        compatible = "mfd,of-test-child";
                        reg = <0xdddddddd 0x00000000 0 0x44>;
                };
        };
      
      When used with example sub-device registration like this:
      
        static const struct mfd_cell mfd_of_test_cell[] = {
              OF_MFD_CELL("mfd-of-test-child", NULL, NULL, 0, 0, "mfd,of-test-child"),
              OF_MFD_CELL("mfd-of-test-child", NULL, NULL, 0, 1, "mfd,of-test-child"),
              OF_MFD_CELL("mfd-of-test-child", NULL, NULL, 0, 2, "mfd,of-test-child")
        };
      
      ... the current implementation will result in all devices being allocated
      the first OF node found containing a matching compatible string:
      
        [0.712511] mfd-of-test-child mfd-of-test-child.0: Probing platform device: 0
        [0.712710] mfd-of-test-child mfd-of-test-child.0: Using OF node: child@aaaaaaaaaaaaaaaa
        [0.713033] mfd-of-test-child mfd-of-test-child.1: Probing platform device: 1
        [0.713381] mfd-of-test-child mfd-of-test-child.1: Using OF node: child@aaaaaaaaaaaaaaaa
        [0.713691] mfd-of-test-child mfd-of-test-child.2: Probing platform device: 2
        [0.713889] mfd-of-test-child mfd-of-test-child.2: Using OF node: child@aaaaaaaaaaaaaaaa
      
      After this patch each device will be allocated a unique OF node:
      
        [0.712511] mfd-of-test-child mfd-of-test-child.0: Probing platform device: 0
        [0.712710] mfd-of-test-child mfd-of-test-child.0: Using OF node: child@aaaaaaaaaaaaaaaa
        [0.713033] mfd-of-test-child mfd-of-test-child.1: Probing platform device: 1
        [0.713381] mfd-of-test-child mfd-of-test-child.1: Using OF node: child@cccccccc
        [0.713691] mfd-of-test-child mfd-of-test-child.2: Probing platform device: 2
        [0.713889] mfd-of-test-child mfd-of-test-child.2: Using OF node: child@dddddddd00000000
      
      Which is fine if all OF nodes are identical.  However if we wish to
      apply an attribute to particular device, we really need to ensure the
      correct OF node will be associated with the device containing the
      correct address.  We accomplish this by matching the device's address
      expressed in DT with one provided during sub-device registration.
      Like this:
      
        static const struct mfd_cell mfd_of_test_cell[] = {
              OF_MFD_CELL_REG("mfd-of-test-child", NULL, NULL, 0, 1, "mfd,of-test-child", 0xdddddddd00000000),
              OF_MFD_CELL_REG("mfd-of-test-child", NULL, NULL, 0, 2, "mfd,of-test-child", 0xaaaaaaaaaaaaaaaa),
              OF_MFD_CELL_REG("mfd-of-test-child", NULL, NULL, 0, 3, "mfd,of-test-child", 0x00000000cccccccc)
        };
      
      This will ensure a specific device (designated here using the
      platform_ids; 1, 2 and 3) is matched with a particular OF node:
      
        [0.712511] mfd-of-test-child mfd-of-test-child.0: Probing platform device: 0
        [0.712710] mfd-of-test-child mfd-of-test-child.0: Using OF node: child@dddddddd00000000
        [0.713033] mfd-of-test-child mfd-of-test-child.1: Probing platform device: 1
        [0.713381] mfd-of-test-child mfd-of-test-child.1: Using OF node: child@aaaaaaaaaaaaaaaa
        [0.713691] mfd-of-test-child mfd-of-test-child.2: Probing platform device: 2
        [0.713889] mfd-of-test-child mfd-of-test-child.2: Using OF node: child@cccccccc
      
      This implementation is still not infallible, hence the mention of
      "best effort" in the commit subject.  Since we have not *insisted* on
      the existence of 'reg' properties (in some scenarios they just do not
      make sense) and no device currently uses the new 'of_reg' attribute,
      we have to make an on-the-fly judgement call whether to associate the
      OF node anyway.  Which we do in cases where parent drivers haven't
      specified a particular OF node to match to.  So there is a *slight*
      possibility of the following result (note: the implementation here is
      convoluted, but it shows you one means by which this process can
      still break):
      
        /*
         * First entry will match to the first OF node with matching compatible
         * Second will fail, since the first took its OF node and is no longer available
         * Third will succeed
         */
        static const struct mfd_cell mfd_of_test_cell[] = {
              OF_MFD_CELL("mfd-of-test-child", NULL, NULL, 0, 1, "mfd,of-test-child"),
      	OF_MFD_CELL_REG("mfd-of-test-child", NULL, NULL, 0, 2, "mfd,of-test-child", 0xaaaaaaaaaaaaaaaa),
              OF_MFD_CELL_REG("mfd-of-test-child", NULL, NULL, 0, 3, "mfd,of-test-child", 0x00000000cccccccc)
        };
      
      The result:
      
        [0.753869] mfd-of-test-parent mfd_of_test: Registering 3 devices
        [0.756597] mfd-of-test-child: Failed to locate of_node [id: 2]
        [0.759999] mfd-of-test-child mfd-of-test-child.1: Probing platform device: 1
        [0.760314] mfd-of-test-child mfd-of-test-child.1: Using OF node: child@aaaaaaaaaaaaaaaa
        [0.760908] mfd-of-test-child mfd-of-test-child.2: Probing platform device: 2
        [0.761183] mfd-of-test-child mfd-of-test-child.2: No OF node associated with this device
        [0.761621] mfd-of-test-child mfd-of-test-child.3: Probing platform device: 3
        [0.761899] mfd-of-test-child mfd-of-test-child.3: Using OF node: child@cccccccc
      
      We could code around this with some pre-parsing semantics, but the
      added complexity required to cover each and every corner-case is not
      justified.  Merely patching the current failing (via this patch) is
      already working with some pretty small corner-cases.  Other issues
      should be patched in the parent drivers which can be achieved simply
      by implementing OF_MFD_CELL_REG().
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      466a62d7