1. 13 1月, 2019 40 次提交
    • D
      mm, devm_memremap_pages: mark devm_memremap_pages() EXPORT_SYMBOL_GPL · b30ea244
      Dan Williams 提交于
      commit 808153e1187fa77ac7d7dad261ff476888dcf398 upstream.
      
      devm_memremap_pages() is a facility that can create struct page entries
      for any arbitrary range and give drivers the ability to subvert core
      aspects of page management.
      
      Specifically the facility is tightly integrated with the kernel's memory
      hotplug functionality.  It injects an altmap argument deep into the
      architecture specific vmemmap implementation to allow allocating from
      specific reserved pages, and it has Linux specific assumptions about page
      structure reference counting relative to get_user_pages() and
      get_user_pages_fast().  It was an oversight and a mistake that this was
      not marked EXPORT_SYMBOL_GPL from the outset.
      
      Again, devm_memremap_pagex() exposes and relies upon core kernel internal
      assumptions and will continue to evolve along with 'struct page', memory
      hotplug, and support for new memory types / topologies.  Only an in-kernel
      GPL-only driver is expected to keep up with this ongoing evolution.  This
      interface, and functionality derived from this interface, is not suitable
      for kernel-external drivers.
      
      Link: http://lkml.kernel.org/r/154275557457.76910.16923571232582744134.stgit@dwillia2-desk3.amr.corp.intel.comSigned-off-by: NDan Williams <dan.j.williams@intel.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Acked-by: NMichal Hocko <mhocko@suse.com>
      Cc: "Jérôme Glisse" <jglisse@redhat.com>
      Cc: Balbir Singh <bsingharora@gmail.com>
      Cc: Logan Gunthorpe <logang@deltatee.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b30ea244
    • M
      hwpoison, memory_hotplug: allow hwpoisoned pages to be offlined · 2c87072a
      Michal Hocko 提交于
      commit b15c87263a69272423771118c653e9a1d0672caa upstream.
      
      We have received a bug report that an injected MCE about faulty memory
      prevents memory offline to succeed on 4.4 base kernel.  The underlying
      reason was that the HWPoison page has an elevated reference count and the
      migration keeps failing.  There are two problems with that.  First of all
      it is dubious to migrate the poisoned page because we know that accessing
      that memory is possible to fail.  Secondly it doesn't make any sense to
      migrate a potentially broken content and preserve the memory corruption
      over to a new location.
      
      Oscar has found out that 4.4 and the current upstream kernels behave
      slightly differently with his simply testcase
      
      ===
      
      int main(void)
      {
              int ret;
              int i;
              int fd;
              char *array = malloc(4096);
              char *array_locked = malloc(4096);
      
              fd = open("/tmp/data", O_RDONLY);
              read(fd, array, 4095);
      
              for (i = 0; i < 4096; i++)
                      array_locked[i] = 'd';
      
              ret = mlock((void *)PAGE_ALIGN((unsigned long)array_locked), sizeof(array_locked));
              if (ret)
                      perror("mlock");
      
              sleep (20);
      
              ret = madvise((void *)PAGE_ALIGN((unsigned long)array_locked), 4096, MADV_HWPOISON);
              if (ret)
                      perror("madvise");
      
              for (i = 0; i < 4096; i++)
                      array_locked[i] = 'd';
      
              return 0;
      }
      ===
      
      + offline this memory.
      
      In 4.4 kernels he saw the hwpoisoned page to be returned back to the LRU
      list
      kernel:  [<ffffffff81019ac9>] dump_trace+0x59/0x340
      kernel:  [<ffffffff81019e9a>] show_stack_log_lvl+0xea/0x170
      kernel:  [<ffffffff8101ac71>] show_stack+0x21/0x40
      kernel:  [<ffffffff8132bb90>] dump_stack+0x5c/0x7c
      kernel:  [<ffffffff810815a1>] warn_slowpath_common+0x81/0xb0
      kernel:  [<ffffffff811a275c>] __pagevec_lru_add_fn+0x14c/0x160
      kernel:  [<ffffffff811a2eed>] pagevec_lru_move_fn+0xad/0x100
      kernel:  [<ffffffff811a334c>] __lru_cache_add+0x6c/0xb0
      kernel:  [<ffffffff81195236>] add_to_page_cache_lru+0x46/0x70
      kernel:  [<ffffffffa02b4373>] extent_readpages+0xc3/0x1a0 [btrfs]
      kernel:  [<ffffffff811a16d7>] __do_page_cache_readahead+0x177/0x200
      kernel:  [<ffffffff811a18c8>] ondemand_readahead+0x168/0x2a0
      kernel:  [<ffffffff8119673f>] generic_file_read_iter+0x41f/0x660
      kernel:  [<ffffffff8120e50d>] __vfs_read+0xcd/0x140
      kernel:  [<ffffffff8120e9ea>] vfs_read+0x7a/0x120
      kernel:  [<ffffffff8121404b>] kernel_read+0x3b/0x50
      kernel:  [<ffffffff81215c80>] do_execveat_common.isra.29+0x490/0x6f0
      kernel:  [<ffffffff81215f08>] do_execve+0x28/0x30
      kernel:  [<ffffffff81095ddb>] call_usermodehelper_exec_async+0xfb/0x130
      kernel:  [<ffffffff8161c045>] ret_from_fork+0x55/0x80
      
      And that latter confuses the hotremove path because an LRU page is
      attempted to be migrated and that fails due to an elevated reference
      count.  It is quite possible that the reuse of the HWPoisoned page is some
      kind of fixed race condition but I am not really sure about that.
      
      With the upstream kernel the failure is slightly different.  The page
      doesn't seem to have LRU bit set but isolate_movable_page simply fails and
      do_migrate_range simply puts all the isolated pages back to LRU and
      therefore no progress is made and scan_movable_pages finds same set of
      pages over and over again.
      
      Fix both cases by explicitly checking HWPoisoned pages before we even try
      to get reference on the page, try to unmap it if it is still mapped.  As
      explained by Naoya:
      
      : Hwpoison code never unmapped those for no big reason because
      : Ksm pages never dominate memory, so we simply didn't have strong
      : motivation to save the pages.
      
      Also put WARN_ON(PageLRU) in case there is a race and we can hit LRU
      HWPoison pages which shouldn't happen but I couldn't convince myself about
      that.  Naoya has noted the following:
      
      : Theoretically no such gurantee, because try_to_unmap() doesn't have a
      : guarantee of success and then memory_failure() returns immediately
      : when hwpoison_user_mappings fails.
      : Or the following code (comes after hwpoison_user_mappings block) also impli=
      : es
      : that the target page can still have PageLRU flag.
      :
      :         /*
      :          * Torn down by someone else?
      :          */
      :         if (PageLRU(p) && !PageSwapCache(p) && p->mapping =3D=3D NULL) {
      :                 action_result(pfn, MF_MSG_TRUNCATED_LRU, MF_IGNORED);
      :                 res =3D -EBUSY;
      :                 goto out;
      :         }
      :
      : So I think it's OK to keep "if (WARN_ON(PageLRU(page)))" block in
      : current version of your patch.
      
      Link: http://lkml.kernel.org/r/20181206120135.14079-1-mhocko@kernel.orgSigned-off-by: NMichal Hocko <mhocko@suse.com>
      Reviewed-by: NOscar Salvador <osalvador@suse.com>
      Debugged-by: NOscar Salvador <osalvador@suse.com>
      Tested-by: NOscar Salvador <osalvador@suse.com>
      Acked-by: NDavid Hildenbrand <david@redhat.com>
      Acked-by: NNaoya Horiguchi <n-horiguchi@ah.jp.nec.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2c87072a
    • M
      zram: fix double free backing device · e3af83bd
      Minchan Kim 提交于
      commit 5547932dc67a48713eece4fa4703bfdf0cfcb818 upstream.
      
      If blkdev_get fails, we shouldn't do blkdev_put.  Otherwise, kernel emits
      below log.  This patch fixes it.
      
        WARNING: CPU: 0 PID: 1893 at fs/block_dev.c:1828 blkdev_put+0x105/0x120
        Modules linked in:
        CPU: 0 PID: 1893 Comm: swapoff Not tainted 4.19.0+ #453
        Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1 04/01/2014
        RIP: 0010:blkdev_put+0x105/0x120
        Call Trace:
          __x64_sys_swapoff+0x46d/0x490
          do_syscall_64+0x5a/0x190
          entry_SYSCALL_64_after_hwframe+0x49/0xbe
        irq event stamp: 4466
        hardirqs last  enabled at (4465):  __free_pages_ok+0x1e3/0x490
        hardirqs last disabled at (4466):  trace_hardirqs_off_thunk+0x1a/0x1c
        softirqs last  enabled at (3420):  __do_softirq+0x333/0x446
        softirqs last disabled at (3407):  irq_exit+0xd1/0xe0
      
      Link: http://lkml.kernel.org/r/20181127055429.251614-3-minchan@kernel.orgSigned-off-by: NMinchan Kim <minchan@kernel.org>
      Reviewed-by: NSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Reviewed-by: NJoey Pabalinas <joeypabalinas@gmail.com>
      Cc: <stable@vger.kernel.org>	[4.14+]
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e3af83bd
    • D
      fork: record start_time late · bc999b50
      David Herrmann 提交于
      commit 7b55851367136b1efd84d98fea81ba57a98304cf upstream.
      
      This changes the fork(2) syscall to record the process start_time after
      initializing the basic task structure but still before making the new
      process visible to user-space.
      
      Technically, we could record the start_time anytime during fork(2).  But
      this might lead to scenarios where a start_time is recorded long before
      a process becomes visible to user-space.  For instance, with
      userfaultfd(2) and TLS, user-space can delay the execution of fork(2)
      for an indefinite amount of time (and will, if this causes network
      access, or similar).
      
      By recording the start_time late, it much closer reflects the point in
      time where the process becomes live and can be observed by other
      processes.
      
      Lastly, this makes it much harder for user-space to predict and control
      the start_time they get assigned.  Previously, user-space could fork a
      process and stall it in copy_thread_tls() before its pid is allocated,
      but after its start_time is recorded.  This can be misused to later-on
      cycle through PIDs and resume the stalled fork(2) yielding a process
      that has the same pid and start_time as a process that existed before.
      This can be used to circumvent security systems that identify processes
      by their pid+start_time combination.
      
      Even though user-space was always aware that start_time recording is
      flaky (but several projects are known to still rely on start_time-based
      identification), changing the start_time to be recorded late will help
      mitigate existing attacks and make it much harder for user-space to
      control the start_time a process gets assigned.
      Reported-by: NJann Horn <jannh@google.com>
      Signed-off-by: NTom Gundersen <teg@jklm.no>
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bc999b50
    • E
      scsi: lpfc: do not set queue->page_count to 0 if pc_sli4_params.wqpcnt is invalid · d257d429
      Ewan D. Milne 提交于
      commit 4e87eb2f46ea547d12a276b2e696ab934d16cfb6 upstream.
      
      Certain older adapters such as the OneConnect OCe10100 may not have a valid
      wqpcnt value.  In this case, do not set queue->page_count to 0 in
      lpfc_sli4_queue_alloc() as this will prevent the driver from initializing.
      
      Fixes: 895427bd ("scsi: lpfc: NVME Initiator: Base modifications")
      Cc: stable@vger.kernel.org # 4.11+
      Signed-off-by: NEwan D. Milne <emilne@redhat.com>
      Reviewed-by: NLaurence Oberman <loberman@redhat.com>
      Tested-by: NLaurence Oberman <loberman@redhat.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d257d429
    • S
      scsi: zfcp: fix posting too many status read buffers leading to adapter shutdown · 06fd6847
      Steffen Maier 提交于
      commit 60a161b7e5b2a252ff0d4c622266a7d8da1120ce upstream.
      
      Suppose adapter (open) recovery is between opened QDIO queues and before
      (the end of) initial posting of status read buffers (SRBs). This time
      window can be seconds long due to FSF_PROT_HOST_CONNECTION_INITIALIZING
      causing by design looping with exponential increase sleeps in the function
      performing exchange config data during recovery
      [zfcp_erp_adapter_strat_fsf_xconf()]. Recovery triggered by local link up.
      
      Suppose an event occurs for which the FCP channel would send an unsolicited
      notification to zfcp by means of a previously posted SRB.  We saw it with
      local cable pull (link down) in multi-initiator zoning with multiple
      NPIV-enabled subchannels of the same shared FCP channel.
      
      As soon as zfcp_erp_adapter_strategy_open_fsf() starts posting the initial
      status read buffers from within the adapter's ERP thread, the channel does
      send an unsolicited notification.
      
      Since v2.6.27 commit d26ab06e ("[SCSI] zfcp: receiving an unsolicted
      status can lead to I/O stall"), zfcp_fsf_status_read_handler() schedules
      adapter->stat_work to re-fill the just consumed SRB from a work item.
      
      Now the ERP thread and the work item post SRBs in parallel.  Both contexts
      call the helper function zfcp_status_read_refill().  The tracking of
      missing (to be posted / re-filled) SRBs is not thread-safe due to separate
      atomic_read() and atomic_dec(), in order to depend on posting
      success. Hence, both contexts can see
      atomic_read(&adapter->stat_miss) == 1. One of the two contexts posts
      one too many SRB. Zfcp gets QDIO_ERROR_SLSB_STATE on the output queue
      (trace tag "qdireq1") leading to zfcp_erp_adapter_shutdown() in
      zfcp_qdio_handler_error().
      
      An obvious and seemingly clean fix would be to schedule stat_work from the
      ERP thread and wait for it to finish. This would serialize all SRB
      re-fills. However, we already have another work item wait on the ERP
      thread: adapter->scan_work runs zfcp_fc_scan_ports() which calls
      zfcp_fc_eval_gpn_ft(). The latter calls zfcp_erp_wait() to wait for all the
      open port recoveries during zfcp auto port scan, but in fact it waits for
      any pending recovery including an adapter recovery. This approach leads to
      a deadlock.  [see also v3.19 commit 18f87a67 ("zfcp: auto port scan
      resiliency"); v2.6.37 commit d3e1088d
      ("[SCSI] zfcp: No ERP escalation on gpn_ft eval");
      v2.6.28 commit fca55b6f
      ("[SCSI] zfcp: fix deadlock between wq triggered port scan and ERP")
      fixing v2.6.27 commit c57a39a4
      ("[SCSI] zfcp: wait until adapter is finished with ERP during auto-port");
      v2.6.27 commit cc8c2829
      ("[SCSI] zfcp: Automatically attach remote ports")]
      
      Instead make the accounting of missing SRBs atomic for parallel execution
      in both the ERP thread and adapter->stat_work.
      Signed-off-by: NSteffen Maier <maier@linux.ibm.com>
      Fixes: d26ab06e ("[SCSI] zfcp: receiving an unsolicted status can lead to I/O stall")
      Cc: <stable@vger.kernel.org> #2.6.27+
      Reviewed-by: NJens Remus <jremus@linux.ibm.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      06fd6847
    • M
      auxdisplay: charlcd: fix x/y command parsing · 218c8185
      Mans Rullgard 提交于
      [ Upstream commit 9bc30ab82108e6a34dc63bf956b49edf71b1681a ]
      
      The x/y command parsing has been broken since commit 12995706
      ("staging: panel: Fixed checkpatch warning about simple_strtoul()").
      
      Commit b34050fa ("auxdisplay: charlcd: Fix and clean up handling of
      x/y commands") fixed some problems by rewriting the parsing code,
      but also broke things further by removing the check for a complete
      command before attempting to parse it.  As a result, parsing is
      terminated at the first x or y character.
      
      This reinstates the check for a final semicolon.  Whereas the original
      code use strchr(), this is wasteful seeing as the semicolon is always
      at the end of the buffer.  Thus check this character directly instead.
      Signed-off-by: NMans Rullgard <mans@mansr.com>
      Signed-off-by: NMiguel Ojeda <miguel.ojeda.sandonis@gmail.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      218c8185
    • Y
      serial/sunsu: fix refcount leak · dc680524
      Yangtao Li 提交于
      [ Upstream commit d430aff8cd0c57502d873909c184e3b5753f8b88 ]
      
      The function of_find_node_by_path() acquires a reference to the node
      returned by it and that reference needs to be dropped by its caller.
      
      su_get_type() doesn't do that. The match node are used as an identifier
      to compare against the current node, so we can directly drop the refcount
      after getting the node from the path as it is not used as pointer.
      
      Fix this by use a single variable and drop the refcount right after
      of_find_node_by_path().
      Signed-off-by: NYangtao Li <tiny.windzz@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      dc680524
    • D
      qmi_wwan: Fix qmap header retrieval in qmimux_rx_fixup · 08e7661c
      Daniele Palmas 提交于
      [ Upstream commit d667044f49513d55fcfefe4fa8f8d96091782901 ]
      
      This patch fixes qmap header retrieval when modem is configured for
      dl data aggregation.
      Signed-off-by: NDaniele Palmas <dnlplm@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      08e7661c
    • K
      net: netxen: fix a missing check and an uninitialized use · 2fb13e20
      Kangjie Lu 提交于
      [ Upstream commit d134e486e831defd26130770181f01dfc6195f7d ]
      
      When netxen_rom_fast_read() fails, "bios" is left uninitialized and may
      contain random value, thus should not be used.
      
      The fix ensures that if netxen_rom_fast_read() fails, we return "-EIO".
      Signed-off-by: NKangjie Lu <kjlu@umn.edu>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      2fb13e20
    • M
      Input: synaptics - enable SMBus for HP EliteBook 840 G4 · 8bb68ed8
      Mantas Mikulėnas 提交于
      [ Upstream commit 7a71712293ba303aad928f580b89addb0be2892e ]
      
      dmesg reports that "Your touchpad (PNP: SYN3052 SYN0100 SYN0002 PNP0f13)
      says it can support a different bus."
      
      I've tested the offered psmouse.synaptics_intertouch=1 with 4.18.x and
      4.19.x and it seems to work well. No problems seen with suspend/resume.
      
      Also, it appears that RMI/SMBus mode is actually required for 3-4 finger
      multitouch gestures to work -- otherwise they are not reported at all.
      
      Information from dmesg in both modes:
      
        psmouse serio3: synaptics: Touchpad model: 1, fw: 8.2, id: 0x1e2b1,
            caps: 0xf00123/0x840300/0x2e800/0x0, board id: 3139, fw id: 2000742
      
        psmouse serio3: synaptics: Trying to set up SMBus access
        rmi4_smbus 6-002c: registering SMbus-connected sensor
        rmi4_f01 rmi4-00.fn01: found RMI device,
            manufacturer: Synaptics, product: TM3139-001, fw id: 2000742
      Signed-off-by: NMantas Mikulėnas <grawity@gmail.com>
      Reviewed-by: NBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      8bb68ed8
    • U
      gpio: mvebu: only fail on missing clk if pwm is actually to be used · ae247d60
      Uwe Kleine-König 提交于
      [ Upstream commit c8da642d41a6811c21177c9994aa7dc35be67d46 ]
      
      The gpio IP on Armada 370 at offset 0x18180 has neither a clk nor pwm
      registers. So there is no need for a clk as the pwm isn't used anyhow.
      So only check for the clk in the presence of the pwm registers. This fixes
      a failure to probe the gpio driver for the above mentioned gpio device.
      
      Fixes: 757642f9 ("gpio: mvebu: Add limited PWM support")
      Signed-off-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Reviewed-by: NGregory CLEMENT <gregory.clement@bootlin.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      ae247d60
    • B
      lan743x: Remove MAC Reset from initialization · 332fc667
      Bryan Whitehead 提交于
      [ Upstream commit e0e587878f538c9e3400219b6c516b8199dc2042 ]
      
      The MAC Reset was noticed to erase important EEPROM settings.
      It is also unnecessary since a chip wide reset was done earlier
      in initialization, and that reset preserves EEPROM settings.
      
      There for this patch removes the unnecessary MAC specific reset.
      Signed-off-by: NBryan Whitehead <Bryan.Whitehead@microchip.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      332fc667
    • M
      virtio: fix test build after uio.h change · e1b3575c
      Michael S. Tsirkin 提交于
      [ Upstream commit c5c08bed843c2b2c048c16d1296d7631d7c1620e ]
      
      Fixes: d3849953 ("fs: decouple READ and WRITE from the block layer ops")
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      e1b3575c
    • G
      m68k: Fix memblock-related crashes · e46d5bd8
      Geert Uytterhoeven 提交于
      [ Upstream commit bed1369f51901b17108a4bb4f7210aab183bea42 ]
      
      When running the kernel in Fast RAM on Atari:
      
          Ignoring memory chunk at 0x0:0xe00000 before the first chunk
          ...
          Unable to handle kernel NULL pointer dereference at virtual address (ptrval)
          Oops: 00000000
          Modules linked in:
          PC: [<0069dbac>] free_all_bootmem+0x12c/0x186
          SR: 2714  SP: (ptrval)  a2: 005e3314
          d0: 00000000    d1: 0000000a    d2: 00000e00    d3: 00000000
          d4: 005e1fc0    d5: 0000001a    a0: 01000000    a1: 00000000
          Process swapper (pid: 0, task=(ptrval))
          Frame format=7 eff addr=00000736 ssw=0505 faddr=00000736
          wb 1 stat/addr/data: 0000 00000000 00000000
          wb 2 stat/addr/data: 0000 00000000 00000000
          wb 3 stat/addr/data: 0000 00000736 00000000
          push data: 00000000 00000000 00000000 00000000
          Stack from 005e1f84:
                  00000000 0000000a 027d3260 006b5006 00000000 00000000 00000000 00000000
                  0004f062 0003a220 0069e272 005e1ff8 0000054c 00000000 00e00000 00000000
                  00000001 00693cd8 027d3260 0004f062 0003a220 00691be6 00000000 00000000
                  00000000 00000000 00000000 00000000 006b5006 00000000 00690872
          Call Trace: [<0004f062>] printk+0x0/0x18
           [<0003a220>] parse_args+0x0/0x2d4
           [<0069e272>] memblock_virt_alloc_try_nid+0x0/0xa4
           [<00693cd8>] mem_init+0xa/0x5c
           [<0004f062>] printk+0x0/0x18
           [<0003a220>] parse_args+0x0/0x2d4
           [<00691be6>] start_kernel+0x1ca/0x462
           [<00690872>] _sinittext+0x872/0x11f8
          Code: 7a1a eaae 2270 6db0 0061 ef14 2f01 2f03 <96a9> 0736 2203 e589 d681 e78b d6a9 0732 2f03 2f40 0034 4eb9 0069 b8d0 260e 4fef
          Disabling lock debugging due to kernel taint
          Kernel panic - not syncing: Attempted to kill the idle task!
      
      As the kernel must run in the memory chunk with the lowest address,
      ST-RAM is ignored, and removed from the m68k_memory[] array.
      However, it is not removed from memblock, causing a crash later.
      
      More investigation shows that there are 3 places where memory chunks are
      ignored, all after the calls to memblock_add() in m68k_parse_bootinfo(),
      and thus causing crashes:
        1. On classic m68k CPUs with a MMU, paging_init() ignores all memory
           chunks below the first chunk, cfr. above,
        2. On Amigas equipped with a Zorro III bus, config_amiga() ignores all
           Zorro II memory,
        3. If CONFIG_SINGLE_MEMORY_CHUNK=y, m68k_parse_bootinfo() ignores all
           but the first memory chunk.
      
      Fix this by moving the calls to memblock_add() from
      m68k_parse_bootinfo() to paging_init(), after all ignored memory chunks
      have been removed from m68k_memory[].
      Reported-by: NAndreas Schwab <schwab@linux-m68k.org>
      Fixes: 1008a115 ("m68k: switch to MEMBLOCK + NO_BOOTMEM")
      Signed-off-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      e46d5bd8
    • M
      kbuild: fix false positive warning/error about missing libelf · ae206a1a
      Masahiro Yamada 提交于
      [ Upstream commit ef7cfd00b2caf6edeb7f169682b64be2d0a798cf ]
      
      For the same reason as commit 25896d073d8a ("x86/build: Fix compiler
      support check for CONFIG_RETPOLINE"), you cannot put this $(error ...)
      into the parse stage of the top Makefile.
      
      Perhaps I'd propose a more sophisticated solution later, but this is
      the best I can do for now.
      
      Link: https://lkml.org/lkml/2017/12/25/211Reported-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      Reported-by: NBernd Edlinger <bernd.edlinger@hotmail.de>
      Reported-by: NQian Cai <cai@lca.pw>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Tested-by: NQian Cai <cai@lca.pw>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      ae206a1a
    • S
      mac80211: free skb fraglist before freeing the skb · ff014712
      Sara Sharon 提交于
      [ Upstream commit 34b1e0e9efe101822e83cc62d22443ed3867ae7a ]
      
      mac80211 uses the frag list to build AMSDU. When freeing
      the skb, it may not be really freed, since someone is still
      holding a reference to it.
      In that case, when TCP skb is being retransmitted, the
      pointer to the frag list is being reused, while the data
      in there is no longer valid.
      Since we will never get frag list from the network stack,
      as mac80211 doesn't advertise the capability, we can safely
      free and nullify it before releasing the SKB.
      Signed-off-by: NSara Sharon <sara.sharon@intel.com>
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      ff014712
    • J
      nl80211: fix memory leak if validate_pae_over_nl80211() fails · 366fc585
      Johannes Berg 提交于
      [ Upstream commit d350a0f431189517b1af0dbbb605c273231a8966 ]
      
      If validate_pae_over_nl80211() were to fail in nl80211_crypto_settings(),
      we might leak the 'connkeys' allocation. Fix this.
      
      Fixes: 64bf3d4b ("nl80211: Add CONTROL_PORT_OVER_NL80211 attribute")
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      366fc585
    • C
      vxge: ensure data0 is initialized in when fetching firmware version information · 098143bf
      Colin Ian King 提交于
      [ Upstream commit f7db2beb4c2c6cc8111f5ab90fc7363ca91107b6 ]
      
      Currently variable data0 is not being initialized so a garbage value is
      being passed to vxge_hw_vpath_fw_api and this value is being written to
      the rts_access_steer_data0 register.  There are other occurrances where
      data0 is being initialized to zero (e.g. in function
      vxge_hw_upgrade_read_version) so I think it makes sense to ensure data0
      is initialized likewise to 0.
      
      Detected by CoverityScan, CID#140696 ("Uninitialized scalar variable")
      
      Fixes: 8424e00d ("vxge: serialize access to steering control register")
      Signed-off-by: NColin Ian King <colin.king@canonical.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      098143bf
    • J
      lan78xx: Resolve issue with changing MAC address · 945b416a
      Jason Martinsen 提交于
      [ Upstream commit 15515aaaa69659c502003926a2067ee76176148a ]
      
      Current state for the lan78xx driver does not allow for changing the
      MAC address of the interface, without either removing the module (if
      you compiled it that way) or rebooting the machine.  If you attempt to
      change the MAC address, ifconfig will show the new address, however,
      the system/interface will not respond to any traffic using that
      configuration.  A few short-term options to work around this are to
      unload the module and reload it with the new MAC address, change the
      interface to "promisc", or reboot with the correct configuration to
      change the MAC.
      
      This patch enables the ability to change the MAC address via fairly normal means...
      ifdown <interface>
      modify entry in /etc/network/interfaces OR a similar method
      ifup <interface>
      Then test via any network communication, such as ICMP requests to gateway.
      
      My only test platform for this patch has been a raspberry pi model 3b+.
      Signed-off-by: NJason Martinsen <jasonmartinsen@msn.com>
      
      -----
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      945b416a
    • B
      lan743x: Expand phy search for LAN7431 · c26419f3
      Bryan Whitehead 提交于
      [ Upstream commit 0db7d253e9f0ff1a41c602429bea93df221be6ed ]
      
      The LAN7431 uses an external phy, and it can be found anywhere in
      the phy address space. This patch uses phy address 1 for LAN7430
      only. And searches all addresses otherwise.
      Signed-off-by: NBryan Whitehead <Bryan.Whitehead@microchip.com>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      c26419f3
    • A
      net: macb: add missing barriers when reading descriptors · 98876c46
      Anssi Hannula 提交于
      [ Upstream commit 6e0af298066f3b6d99f58989bb0dca6f764b4c6d ]
      
      When reading buffer descriptors on RX or on TX completion, an
      RX_USED/TX_USED bit is checked first to ensure that the descriptors have
      been populated, i.e. the ownership has been transferred. However, there
      are no memory barriers to ensure that the data protected by the
      RX_USED/TX_USED bit is up-to-date with respect to that bit.
      
      Specifically:
      
      - TX timestamp descriptors may be loaded before ctrl is loaded for the
        TX_USED check, which is racy as the descriptors may be updated between
        the loads, causing old timestamp descriptor data to be used.
      
      - RX ctrl may be loaded before addr is loaded for the RX_USED check,
        which is racy as a new frame may be written between the loads, causing
        old ctrl descriptor data to be used.
        This issue exists for both macb_rx() and gem_rx() variants.
      
      Fix the races by adding DMA read memory barriers on those paths and
      reordering the reads in macb_rx().
      
      I have not observed any actual problems in practice caused by these
      being missing, though.
      
      Tested on a ZynqMP based system.
      
      Fixes: 89e5785f ("[PATCH] Atmel MACB ethernet driver")
      Signed-off-by: NAnssi Hannula <anssi.hannula@bitwise.fi>
      Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      98876c46
    • A
      net: macb: fix dropped RX frames due to a race · 6e48c0fc
      Anssi Hannula 提交于
      [ Upstream commit 8159ecab0db9095902d4c73605fb8787f5c7d653 ]
      
      Bit RX_USED set to 0 in the address field allows the controller to write
      data to the receive buffer descriptor.
      
      The driver does not ensure the ctrl field is ready (cleared) when the
      controller sees the RX_USED=0 written by the driver. The ctrl field might
      only be cleared after the controller has already updated it according to
      a newly received frame, causing the frame to be discarded in gem_rx() due
      to unexpected ctrl field contents.
      
      A message is logged when the above scenario occurs:
      
        macb ff0b0000.ethernet eth0: not whole frame pointed by descriptor
      
      Fix the issue by ensuring that when the controller sees RX_USED=0 the
      ctrl field is already cleared.
      
      This issue was observed on a ZynqMP based system.
      
      Fixes: 4df95131 ("net/macb: change RX path for GEM")
      Signed-off-by: NAnssi Hannula <anssi.hannula@bitwise.fi>
      Tested-by: NClaudiu Beznea <claudiu.beznea@microchip.com>
      Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      6e48c0fc
    • A
      net: macb: fix random memory corruption on RX with 64-bit DMA · 873f9a55
      Anssi Hannula 提交于
      [ Upstream commit e100a897bf9b19089e57f236f2398c9e0538900e ]
      
      64-bit DMA addresses are split in upper and lower halves that are
      written in separate fields on GEM. For RX, bit 0 of the address is used
      as the ownership bit (RX_USED). When the RX_USED bit is unset the
      controller is allowed to write data to the buffer.
      
      The driver does not guarantee that the controller already sees the upper
      half when the RX_USED bit is cleared, possibly resulting in the
      controller writing an incoming frame to an address with an incorrect
      upper half and therefore possibly corrupting unrelated system memory.
      
      Fix that by adding the necessary DMA memory barrier between the writes.
      
      This corruption was observed on a ZynqMP based system.
      
      Fixes: fff8019a ("net: macb: Add 64 bit addressing support for GEM")
      Signed-off-by: NAnssi Hannula <anssi.hannula@bitwise.fi>
      Acked-by: NHarini Katakam <harini.katakam@xilinx.com>
      Tested-by: NClaudiu Beznea <claudiu.beznea@microchip.com>
      Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
      Cc: Michal Simek <michal.simek@xilinx.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      873f9a55
    • D
      qed: Fix an error code qed_ll2_start_xmit() · 12024f4f
      Dan Carpenter 提交于
      [ Upstream commit f07d4276892d97671e880190ff195a288b2d8d92 ]
      
      We accidentally deleted the code to set "rc = -ENOMEM;" and this patch
      adds it back.
      
      Fixes: d2201a21 ("qed: No need for LL2 frags indication")
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      12024f4f
    • T
      SUNRPC: Fix a race with XPRT_CONNECTING · 233ba13d
      Trond Myklebust 提交于
      [ Upstream commit cf76785d30712d90185455e752337acdb53d2a5d ]
      
      Ensure that we clear XPRT_CONNECTING before releasing the XPRT_LOCK so that
      we don't have races between the (asynchronous) socket setup code and
      tasks in xprt_connect().
      Signed-off-by: NTrond Myklebust <trond.myklebust@hammerspace.com>
      Tested-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      233ba13d
    • S
      mac80211: fix a kernel panic when TXing after TXQ teardown · 4f784484
      Sara Sharon 提交于
      [ Upstream commit a50e5fb8db83c5b57392204c21ea6c5c4ccefde6 ]
      
      Recently TXQ teardown was moved earlier in ieee80211_unregister_hw(),
      to avoid a use-after-free of the netdev data. However, interfaces
      aren't fully removed at the point, and cfg80211_shutdown_all_interfaces
      can for example, TX a deauth frame. Move the TXQ teardown to the
      point between cfg80211_shutdown_all_interfaces and the free of
      netdev queues, so we can be sure they are torn down before netdev
      is freed, but after there is no ongoing TX.
      
      Fixes: 77cfaf52 ("mac80211: Run TXQ teardown code before de-registering interfaces")
      Signed-off-by: NSara Sharon <sara.sharon@intel.com>
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      4f784484
    • Y
      net: hns: Fix ping failed when use net bridge and send multicast · 97fd4c7f
      Yonglong Liu 提交于
      [ Upstream commit 6adafc356e20189193b38ee6b9af7743078bf6b4 ]
      
      Create a net bridge, add eth and vnet to the bridge. The vnet is used
      by a virtual machine. When ping the virtual machine from the outside
      host and the virtual machine send multicast at the same time, the ping
      package will lost.
      
      The multicast package send to the eth, eth will send it to the bridge too,
      and the bridge learn the mac of eth. When outside host ping the virtual
      mechine, it will match the promisc entry of the eth which is not expected,
      and the bridge send it to eth not to vnet, cause ping lost.
      
      So this patch change promisc tcam entry position to the END of 512 tcam
      entries, which indicate lower priority. And separate one promisc entry to
      two: mc & uc, to avoid package match the wrong tcam entry.
      Signed-off-by: NYonglong Liu <liuyonglong@huawei.com>
      Signed-off-by: NPeng Li <lipeng321@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      97fd4c7f
    • Y
      net: hns: Add mac pcs config when enable|disable mac · 1f89e4e8
      Yonglong Liu 提交于
      [ Upstream commit 726ae5c9e5f0c18eca8ea5296b526242c3e89822 ]
      
      In some case, when mac enable|disable and adjust link, may cause hard to
      link(or abnormal) between mac and phy. This patch adds the code for rx PCS
      to avoid this bug.
      
      Disable the rx PCS when driver disable the gmac, and enable the rx PCS
      when driver enable the mac.
      Signed-off-by: NYonglong Liu <liuyonglong@huawei.com>
      Signed-off-by: NPeng Li <lipeng321@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      1f89e4e8
    • Y
      net: hns: Fix ntuple-filters status error. · b686b8c0
      Yonglong Liu 提交于
      [ Upstream commit 7e74a19ca522aec7c2be201a7ae1d1d57ded409b ]
      
      The ntuple-filters features is forced on by chip.
      But it shows "ntuple-filters: off [fixed]" when use ethtool.
      This patch make it correct with "ntuple-filters: on [fixed]".
      Signed-off-by: NYonglong Liu <liuyonglong@huawei.com>
      Signed-off-by: NPeng Li <lipeng321@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      b686b8c0
    • Y
      net: hns: Avoid net reset caused by pause frames storm · db2ca348
      Yonglong Liu 提交于
      [ Upstream commit a57275d35576fdd89d8c771eedf1e7cf97e0dfa6 ]
      
      There will be a large number of MAC pause frames on the net,
      which caused tx timeout of net device. And then the net device
      was reset to try to recover it. So that is not useful, and will
      cause some other problems.
      
      So need doubled ndev->watchdog_timeo if device watchdog occurred
      until watchdog_timeo up to 40s and then try resetting to recover
      it.
      
      When collecting dfx information such as hardware registers when tx timeout.
      Some registers for count were cleared when read. So need move this task
      before update net state which also read the count registers.
      Signed-off-by: NYonglong Liu <liuyonglong@huawei.com>
      Signed-off-by: NPeng Li <lipeng321@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      db2ca348
    • Y
      net: hns: Free irq when exit from abnormal branch · c8e78cbc
      Yonglong Liu 提交于
      [ Upstream commit c82bd077e1ba3dd586569c733dc6d3dd4b0e43cd ]
      
      1.In "hns_nic_init_irq", if request irq fail at index i,
        the function return directly without releasing irq resources
        that already requested.
      
      2.In "hns_nic_net_up" after "hns_nic_init_irq",
        if exceptional branch occurs, irqs that already requested
        are not release.
      Signed-off-by: NYonglong Liu <liuyonglong@huawei.com>
      Signed-off-by: NPeng Li <lipeng321@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      c8e78cbc
    • Y
      net: hns: Clean rx fbd when ae stopped. · ac9ae193
      Yonglong Liu 提交于
      [ Upstream commit 31f6b61d810654fb3ef43f4d8afda0f44b142fad ]
      
      If there are packets in hardware when changing the speed or duplex,
      it may cause hardware hang up.
      
      This patch adds the code to wait rx fbd clean up when ae stopped.
      Signed-off-by: NYonglong Liu <liuyonglong@huawei.com>
      Signed-off-by: NPeng Li <lipeng321@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      ac9ae193
    • Y
      net: hns: Fixed bug that netdev was opened twice · 1b2f8d7c
      Yonglong Liu 提交于
      [ Upstream commit 5778b13b64eca5549d242686f2f91a2c80c8fa40 ]
      
      After resetting dsaf to try to repair chip error such as ecc error,
      the net device will be open if net interface is up. But at this time
      if there is the users set the net device up with the command ifconfig,
      the net device will be opened twice consecutively.
      
      Function napi_enable was called when open device. And Kernel panic will
      be occurred if it was called twice consecutively. Such as follow:
      static inline void napi_enable(struct napi_struct *n)
      {
               BUG_ON(!test_bit(NAPI_STATE_SCHED, &n->state));
               smp_mb__before_clear_bit();
               clear_bit(NAPI_STATE_SCHED, &n->state);
      }
      
      [37255.571996] Kernel panic - not syncing: BUG!
      [37255.595234] Call trace:
      [37255.597694] [<ffff80000008ab48>] dump_backtrace+0x0/0x1a0
      [37255.603114] [<ffff80000008ad08>] show_stack+0x20/0x28
      [37255.608187] [<ffff8000009c4944>] dump_stack+0x98/0xb8
      [37255.613258] [<ffff8000009c149c>] panic+0x10c/0x26c
      [37255.618070] [<ffff80000070f134>] hns_nic_net_up+0x30c/0x4e0
      [37255.623664] [<ffff80000070f39c>] hns_nic_net_open+0x94/0x12c
      [37255.629346] [<ffff80000084be78>] __dev_open+0xf4/0x168
      [37255.634504] [<ffff80000084c1ac>] __dev_change_flags+0x98/0x15c
      [37255.640359] [<ffff80000084c29c>] dev_change_flags+0x2c/0x68
      [37255.769580] [<ffff8000008dc400>] devinet_ioctl+0x650/0x704
      [37255.775086] [<ffff8000008ddc38>] inet_ioctl+0x98/0xb4
      [37255.780159] [<ffff800000827b7c>] sock_do_ioctl+0x44/0x84
      [37255.785490] [<ffff800000828e04>] sock_ioctl+0x248/0x30c
      [37255.790737] [<ffff80000026dc6c>] do_vfs_ioctl+0x480/0x618
      [37255.796156] [<ffff80000026de94>] SyS_ioctl+0x90/0xa4
      [37255.801139] SMP: stopping secondary CPUs
      [37255.805079] kbox: catch panic event.
      [37255.809586] collected_len = 128928, LOG_BUF_LEN_LOCAL = 131072
      [37255.816103] flush cache 0xffff80003f000000  size 0x800000
      [37255.822192] flush cache 0xffff80003f000000  size 0x800000
      [37255.828289] flush cache 0xffff80003f000000  size 0x800000
      [37255.834378] kbox: no notify die func register. no need to notify
      [37255.840413] ---[ end Kernel panic - not syncing: BUG!
      
      This patchset fix this bug according to the flag NIC_STATE_DOWN.
      Signed-off-by: NYonglong Liu <liuyonglong@huawei.com>
      Signed-off-by: NPeng Li <lipeng321@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      1b2f8d7c
    • Y
      net: hns: Some registers use wrong address according to the datasheet. · 17eeca6e
      Yonglong Liu 提交于
      [ Upstream commit 4ad26f117b6ea0f5d5f1592127bafb5ec65904d3 ]
      
      According to the hip06 datasheet:
      1.Six registers use wrong address:
        RCB_COM_SF_CFG_INTMASK_RING
        RCB_COM_SF_CFG_RING_STS
        RCB_COM_SF_CFG_RING
        RCB_COM_SF_CFG_INTMASK_BD
        RCB_COM_SF_CFG_BD_RINT_STS
        DSAF_INODE_VC1_IN_PKT_NUM_0_REG
      2.The offset of DSAF_INODE_VC1_IN_PKT_NUM_0_REG should be
        0x103C + 0x80 * all_chn_num
      3.The offset to show the value of DSAF_INODE_IN_DATA_STP_DISC_0_REG
        is wrong, so the value of DSAF_INODE_SW_VLAN_TAG_DISC_0_REG will be
        overwrite
      
      These registers are only used in "ethtool -d", so that did not cause ndev
      to misfunction.
      Signed-off-by: NYonglong Liu <liuyonglong@huawei.com>
      Signed-off-by: NPeng Li <lipeng321@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      17eeca6e
    • Y
      net: hns: All ports can not work when insmod hns ko after rmmod. · 341b8840
      Yonglong Liu 提交于
      [ Upstream commit 308c6cafde0147616da45e3a928adae55c428deb ]
      
      There are two test cases:
      1. Remove the 4 modules:hns_enet_drv/hns_dsaf/hnae/hns_mdio,
         and install them again, must use "ifconfig down/ifconfig up"
         command pair to bring port to work.
      
         This patch calls phy_stop function when init phy to fix this bug.
      
      2. Remove the 2 modules:hns_enet_drv/hns_dsaf, and install them again,
         all ports can not use anymore, because of the phy devices register
         failed(phy devices already exists).
      
         Phy devices are registered when hns_dsaf installed, this patch
         removes them when hns_dsaf removed.
      
      The two cases are sometimes related, fixing the second case also requires
      fixing the first case, so fix them together.
      Signed-off-by: NYonglong Liu <liuyonglong@huawei.com>
      Signed-off-by: NPeng Li <lipeng321@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      341b8840
    • Y
      net: hns: Incorrect offset address used for some registers. · 41d54657
      Yonglong Liu 提交于
      [ Upstream commit 4e1d4be681b2c26fd874adbf584bf034573ac45d ]
      
      According to the hip06 Datasheet:
      1. The offset of INGRESS_SW_VLAN_TAG_DISC should be 0x1A00+4*all_chn_num
      2. The offset of INGRESS_IN_DATA_STP_DISC should be 0x1A50+4*all_chn_num
      Signed-off-by: NYonglong Liu <liuyonglong@huawei.com>
      Signed-off-by: NPeng Li <lipeng321@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      41d54657
    • A
      w90p910_ether: remove incorrect __init annotation · 2cd0c6f8
      Arnd Bergmann 提交于
      [ Upstream commit 51367e423c6501a26e67d91a655d2bc892303462 ]
      
      The get_mac_address() function is normally inline, but when it is
      not, we get a warning that this configuration is broken:
      
      WARNING: vmlinux.o(.text+0x4aff00): Section mismatch in reference from the function w90p910_ether_setup() to the function .init.text:get_mac_address()
      The function w90p910_ether_setup() references
      the function __init get_mac_address().
      This is often because w90p910_ether_setup lacks a __init
      
      Remove the __init to make it always do the right thing.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      2cd0c6f8
    • A
      net/tls: Init routines in create_ctx · 997cb503
      Atul Gupta 提交于
      [ Upstream commit 6c0563e442528733219afe15c749eb2cc365da3f ]
      
      create_ctx is called from tls_init and tls_hw_prot
      hence initialize function pointers in common routine.
      Signed-off-by: NAtul Gupta <atul.gupta@chelsio.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      997cb503
    • N
      drivers: net: xgene: Remove unnecessary forward declarations · 7a2b5258
      Nathan Chancellor 提交于
      [ Upstream commit 2ab4c3426c0cf711d7147e3f559638e4ab88960e ]
      
      Clang warns:
      
      drivers/net/ethernet/apm/xgene/xgene_enet_main.c:33:36: warning:
      tentative array definition assumed to have one element
      static const struct acpi_device_id xgene_enet_acpi_match[];
                                         ^
      1 warning generated.
      
      Both xgene_enet_acpi_match and xgene_enet_of_match are defined before
      their uses at the bottom of the file so this is unnecessary. When
      CONFIG_ACPI is disabled, ACPI_PTR becomes NULL so xgene_enet_acpi_match
      doesn't need to be defined.
      Signed-off-by: NNathan Chancellor <natechancellor@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      7a2b5258