1. 06 10月, 2017 1 次提交
    • J
      dm raid: fix incorrect status output at the end of a "recover" process · 41dcf197
      Jonathan Brassow 提交于
      There are three important fields that indicate the overall health and
      status of an array: dev_health, sync_ratio, and sync_action.  They tell
      us the condition of the devices in the array, and the degree to which
      the array is synchronized.
      
      This commit fixes a condition that is reported incorrectly.  When a member
      of the array is being rebuilt or a new device is added, the "recover"
      process is used to synchronize it with the rest of the array.  When the
      process is complete, but the sync thread hasn't yet been reaped, it is
      possible for the state of MD to be:
       mddev->recovery = [ MD_RECOVERY_RUNNING MD_RECOVERY_RECOVER MD_RECOVERY_DONE ]
       curr_resync_completed = <max dev size> (but not MaxSector)
       and all rdevs to be In_sync.
      This causes the 'array_in_sync' output parameter that is passed to
      rs_get_progress() to be computed incorrectly and reported as 'false' --
      or not in-sync.  This in turn causes the dev_health status characters to
      be reported as all 'a', rather than the proper 'A'.
      
      This can cause erroneous output for several seconds at a time when tools
      will want to be checking the condition due to events that are raised at
      the end of a sync process.  Fix this by properly calculating the
      'array_in_sync' return parameter in rs_get_progress().
      
      Also, remove an unnecessary intermediate 'recovery_cp' variable in
      rs_get_progress().
      Signed-off-by: NJonathan Brassow <jbrassow@redhat.com>
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      41dcf197
  2. 05 10月, 2017 9 次提交
  3. 04 10月, 2017 12 次提交
    • M
      dm crypt: reject sector_size feature if device length is not aligned to it · 783874b0
      Milan Broz 提交于
      If a crypt mapping uses optional sector_size feature, additional
      restrictions to mapped device segment size must be applied in
      constructor, otherwise the device activation will fail later.
      
      Fixes: 8f0009a2 ("dm crypt: optionally support larger encryption sector size")
      Cc: stable@vger.kernel.org # 4.12+
      Signed-off-by: NMilan Broz <gmazyland@gmail.com>
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      783874b0
    • C
      nvme-pci: Use PCI bus address for data/queues in CMB · 8969f1f8
      Christoph Hellwig 提交于
      Currently, NVMe PCI host driver is programming CMB dma address as
      I/O SQs addresses. This results in failures on systems where 1:1
      outbound mapping is not used (example Broadcom iProc SOCs) because
      CMB BAR will be progammed with PCI bus address but NVMe PCI EP will
      try to access CMB using dma address.
      
      To have CMB working on systems without 1:1 outbound mapping, we
      program PCI bus address for I/O SQs instead of dma address. This
      approach will work on systems with/without 1:1 outbound mapping.
      
      Based on a report and previous patch from Abhishek Shah.
      
      Fixes: 8ffaadf7 ("NVMe: Use CMB for the IO SQes if available")
      Cc: stable@vger.kernel.org
      Reported-by: NAbhishek Shah <abhishek.shah@broadcom.com>
      Tested-by: NAbhishek Shah <abhishek.shah@broadcom.com>
      Reviewed-by: NKeith Busch <keith.busch@intel.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      8969f1f8
    • M
      zram: fix null dereference of handle · ae94264e
      Minchan Kim 提交于
      In testing I found handle passed to zs_map_object in __zram_bvec_read is
      NULL so eh kernel goes oops in pin_object().
      
      The reason is there is no routine to check the slot's freeing after
      getting the slot's lock.  This patch fixes it.
      
      [minchan@kernel.org: v2]
        Link: http://lkml.kernel.org/r/1505887347-10881-1-git-send-email-minchan@kernel.org
      Link: http://lkml.kernel.org/r/1505788488-26723-1-git-send-email-minchan@kernel.org
      Fixes: 1f7319c7 ("zram: partial IO refactoring")
      Signed-off-by: NMinchan Kim <minchan@kernel.org>
      Reviewed-by: NSergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ae94264e
    • I
      rapidio: remove global irq spinlocks from the subsystem · 31d1e130
      Ioan Nicu 提交于
      Locking of config and doorbell operations should be done only if the
      underlying hardware requires it.
      
      This patch removes the global spinlocks from the rapidio subsystem and
      moves them to the mport drivers (fsl_rio and tsi721), only to the
      necessary places.  For example, local config space read and write
      operations (lcread/lcwrite) are atomic in all existing drivers, so there
      should be no need for locking, while the cread/cwrite operations which
      generate maintenance transactions need to be synchronized with a lock.
      
      Later, each driver could chose to use a per-port lock instead of a
      global one, or even more granular locking.
      
      Link: http://lkml.kernel.org/r/20170824113023.GD50104@nokia.comSigned-off-by: NIoan Nicu <ioan.nicu.ext@nokia.com>
      Signed-off-by: NFrank Kunz <frank.kunz@nokia.com>
      Acked-by: NAlexandre Bounine <alexandre.bounine@idt.com>
      Cc: Matt Porter <mporter@kernel.crashing.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Nicholas Piggin <npiggin@gmail.com>
      Cc: Randy Dunlap <rdunlap@infradead.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      31d1e130
    • S
      android: binder: drop lru lock in isolate callback · a1b2289c
      Sherry Yang 提交于
      Drop the global lru lock in isolate callback before calling
      zap_page_range which calls cond_resched, and re-acquire the global lru
      lock before returning.  Also change return code to LRU_REMOVED_RETRY.
      
      Use mmput_async when fail to acquire mmap sem in an atomic context.
      
      Fix "BUG: sleeping function called from invalid context"
      errors when CONFIG_DEBUG_ATOMIC_SLEEP is enabled.
      
      Also restore mmput_async, which was initially introduced in commit
      ec8d7c14 ("mm, oom_reaper: do not mmput synchronously from the oom
      reaper context"), and was removed in commit 21292580 ("mm: oom: let
      oom_reap_task and exit_mmap run concurrently").
      
      Link: http://lkml.kernel.org/r/20170914182231.90908-1-sherryy@android.com
      Fixes: f2517eb7 ("android: binder: Add global lru shrinker to binder")
      Signed-off-by: NSherry Yang <sherryy@android.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Reported-by: NKyle Yan <kyan@codeaurora.org>
      Acked-by: NArve Hjønnevåg <arve@android.com>
      Acked-by: NMichal Hocko <mhocko@suse.com>
      Cc: Martijn Coenen <maco@google.com>
      Cc: Todd Kjos <tkjos@google.com>
      Cc: Riley Andrews <riandrews@android.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Cc: Hillf Danton <hdanton@sina.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Andrea Arcangeli <aarcange@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Hoeun Ryu <hoeun.ryu@gmail.com>
      Cc: Christopher Lameter <cl@linux.com>
      Cc: Vegard Nossum <vegard.nossum@oracle.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a1b2289c
    • D
      net: stmmac: dwmac-rk: Add RK3128 GMAC support · 05946876
      David Wu 提交于
      Add constants and callback functions for the dwmac on rk3128 soc.
      As can be seen, the base structure is the same, only registers
      and the bits in them moved slightly.
      Signed-off-by: NDavid Wu <david.wu@rock-chips.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      05946876
    • J
      null_blk: change configfs dependency to select · 6cd1a6fe
      Jens Axboe 提交于
      A recent commit made null_blk depend on configfs, which is kind of
      annoying since you now have to find this dependency and enable that
      as well. Discovered this since I no longer had null_blk available
      on a box I needed to debug, since it got killed when the config
      updated after the configfs change was merged.
      
      Fixes: 3bf2bd20 ("nullb: add configfs interface")
      Reviewed-by: NShaohua Li <shli@fb.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      6cd1a6fe
    • A
      rndis_host: support Novatel Verizon USB730L · 63ba395c
      Aleksander Morgado 提交于
      Treat the ef/04/01 interface class/subclass/protocol combination used
      by the Novatel Verizon USB730L (1410:9030) as a possible RNDIS
      interface.
      
       T:  Bus=01 Lev=02 Prnt=02 Port=01 Cnt=02 Dev#= 17 Spd=480 MxCh= 0
       D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  3
       P:  Vendor=1410 ProdID=9030 Rev=03.10
       S:  Manufacturer=Novatel Wireless
       S:  Product=MiFi USB730L
       S:  SerialNumber=0123456789ABCDEF
       C:  #Ifs= 3 Cfg#= 1 Atr=80 MxPwr=500mA
       I:  If#= 0 Alt= 0 #EPs= 1 Cls=ef(misc ) Sub=04 Prot=01 Driver=rndis_host
       I:  If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=rndis_host
       I:  If#= 2 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid
      
      Once the network interface is brought up, the user just needs to run a
      DHCP client to get IP address and routing setup.
      
      As a side note, other Novatel Verizon USB730L models with the same
      vid:pid end up exposing a standard ECM interface which doesn't require
      any other kernel update to make it work.
      Signed-off-by: NAleksander Morgado <aleksander@aleksander.es>
      Reviewed-by: NBjørn Mork <bjorn@mork.no>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      63ba395c
    • I
      drm/i915: Fix DDI PHY init if it was already on · 71300132
      Imre Deak 提交于
      The common lane power down flag of a DPIO PHY has a funky semantic:
      after the initial enabling of the PHY (so from a disabled state) this
      flag will be clear. It will be set only after the PHY will be used for
      the first time (for instance due to enabling the corresponding pipe) and
      then become unused (due to disabling the pipe). During the initial PHY
      enablement we don't know which of the above phases we are in, so move
      the check for the flag where this is known, the HW readout code. This is
      where the rest of lane power down status checks are done anyway.
      
      This fixes at least a problem on GLK where after module reloading, the
      common lane power down flag of PHY1 is set, but the PHY is actually
      powered-on and properly set up. The GRC readout code for other PHYs will
      hence think that PHY1 is not powered initially and disable it after the
      GRC readout. This will cause the AUX power well related to PHY1 to get
      disabled in a stuck state, timing out when we try to enable it later.
      
      Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
      Fixes: e93da0a0 ("drm/i915/bxt: Sanitiy check the PHY lane power down status")
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102777Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20171002135307.26117-1-imre.deak@intel.com
      (cherry picked from commit e19c1eb8)
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      71300132
    • L
      ide: fix IRQ assignment for PCI bus order probing · b1f9e5e3
      Lorenzo Pieralisi 提交于
      We used to assign IRQs for all devices at boot-time, before any drivers
      claimed devices.  The following commits:
      
        30fdfb92 ("PCI: Add a call to pci_assign_irq() in pci_device_probe()")
        0e4c2eeb ("alpha/PCI: Replace pci_fixup_irqs() call with host bridge IRQ mapping hooks")
      
      changed this so we now call pci_assign_irq() from pci_device_probe() when
      we call a driver's probe method.
      
      The ide_scan_pcibus() path (enabled by CONFIG_IDEPCI_PCIBUS_ORDER) bypasses
      pci_device_probe() so it can guarantee devices are claimed in order of PCI
      bus address.  It calls the driver's probe method directly, so it misses the
      pci_assign_irq() call (and other PCI initialization functions), which
      causes failures like this:
      
        ide0: disabled, no IRQ
        ide0: failed to initialize IDE interface
        ide0: disabling port
        cmd64x 0000:00:02.0: IDE controller (0x1095:0x0646 rev 0x07)
        CMD64x_IDE 0000:00:02.0: BAR 0: can't reserve [io  0x8050-0x8057]
        cmd64x 0000:00:02.0: can't reserve resources
        CMD64x_IDE: probe of 0000:00:02.0 failed with error -16
        ide_generic: please use "probe_mask=0x3f" module parameter for probing
        all legacy ISA IDE ports
        ------------[ cut here ]------------
        WARNING: CPU: 0 PID: 1 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x94/0xd0
        sysfs: cannot create duplicate filename '/class/ide_port/ide0'
        ...
      
        Trace:
        [<fffffc000048c9f4>] sysfs_warn_dup+0x94/0xd0
        [<fffffc0000330928>] warn_slowpath_fmt+0x58/0x70
        [<fffffc000048c9f4>] sysfs_warn_dup+0x94/0xd0
        [<fffffc0000486d40>] kernfs_path_from_node+0x30/0x60
        [<fffffc00004874ac>] kernfs_put+0x16c/0x2c0
        [<fffffc00004874ac>] kernfs_put+0x16c/0x2c0
        [<fffffc000048d010>] sysfs_do_create_link_sd.isra.2+0x100/0x120
        [<fffffc00005b9d64>] device_add+0x2a4/0x7c0
        [<fffffc00005ba5cc>] device_create_groups_vargs+0x14c/0x170
        [<fffffc00005ba518>] device_create_groups_vargs+0x98/0x170
        [<fffffc00005ba690>] device_create+0x50/0x70
        [<fffffc00005df36c>] ide_host_register+0x48c/0xa00
        [<fffffc00005df330>] ide_host_register+0x450/0xa00
        [<fffffc00005ba2a0>] device_register+0x20/0x50
        [<fffffc00005df330>] ide_host_register+0x450/0xa00
        [<fffffc00005df944>] ide_host_add+0x64/0xe0
        [<fffffc000079b41c>] kobject_uevent_env+0x16c/0x710
        [<fffffc0000310288>] do_one_initcall+0x68/0x260
        [<fffffc00007b13bc>] kernel_init+0x1c/0x1a0
        ...
        ---[ end trace 24a70433c3e4d374 ]---
        ide0: disabling port
      
      Fix the IRQ allocation issue by calling pci_assign_irq() from
      ide_scan_pcidev() before probing the IDE PCI drivers, so that IRQs for a
      given PCI device are allocated for the IDE PCI drivers to use them for
      device configuration.
      
      Fixes: 30fdfb92 ("PCI: Add a call to pci_assign_irq() in pci_device_probe()")
      Fixes: 0e4c2eeb ("alpha/PCI: Replace pci_fixup_irqs() call with host bridge IRQ mapping hooks")
      Link: http://lkml.kernel.org/r/32ec730f-c1b0-5584-cd35-f8a809122b96@roeck-us.netReported-by: NGuenter Roeck <linux@roeck-us.net>
      Tested-by: NGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      [bhelgaas: changelog]
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Matt Turner <mattst88@gmail.com>
      b1f9e5e3
    • B
      ide: pci: free PCI BARs on initialization failure · a06876a7
      Bartlomiej Zolnierkiewicz 提交于
      Recent pci_assign_irq() changes uncovered a problem with missing freeing of
      PCI BARs on PCI IDE host initialization failure:
      
        ide0: disabled, no IRQ
        ide0: failed to initialize IDE interface
        ide0: disabling port
        cmd64x 0000:00:02.0: IDE controller (0x1095:0x0646 rev 0x07)
        CMD64x_IDE 0000:00:02.0: BAR 0: can't reserve [io  0x8050-0x8057]
        cmd64x 0000:00:02.0: can't reserve resources
        CMD64x_IDE: probe of 0000:00:02.0 failed with error -16
      
      Fix the problem by adding missing freeing of PCI BARs to
      ide_setup_pci_controller() and ide_pci_init_two().
      
      Fixes: 30fdfb92 ("PCI: Add a call to pci_assign_irq() in pci_device_probe()")
      Fixes: 0e4c2eeb ("alpha/PCI: Replace pci_fixup_irqs() call with host bridge IRQ mapping hooks")
      Link: http://lkml.kernel.org/r/32ec730f-c1b0-5584-cd35-f8a809122b96@roeck-us.netReported-by: NGuenter Roeck <linux@roeck-us.net>
      Tested-by: NGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: NBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      [bhelgaas: add Fixes:]
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Matt Turner <mattst88@gmail.com>
      a06876a7
    • B
      ide: free hwif->portdev on hwif_init() failure · d410a641
      Bartlomiej Zolnierkiewicz 提交于
      Recent pci_assign_irq() changes uncovered a problem with missing freeing of
      ide_port class instance on hwif_init() failure in ide_host_register():
      
        ide0: disabled, no IRQ
        ide0: failed to initialize IDE interface
        ide0: disabling port
        cmd64x 0000:00:02.0: IDE controller (0x1095:0x0646 rev 0x07)
        CMD64x_IDE 0000:00:02.0: BAR 0: can't reserve [io  0x8050-0x8057]
        cmd64x 0000:00:02.0: can't reserve resources
        CMD64x_IDE: probe of 0000:00:02.0 failed with error -16
        ide_generic: please use "probe_mask=0x3f" module parameter for probing all legacy ISA IDE ports
        ------------[ cut here ]------------
        WARNING: CPU: 0 PID: 1 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x94/0xd0
        sysfs: cannot create duplicate filename '/class/ide_port/ide0'
        ...
      
        Trace:
        [<fffffc00003308a0>] __warn+0x160/0x190
        [<fffffc000048c9f4>] sysfs_warn_dup+0x94/0xd0
        [<fffffc0000330928>] warn_slowpath_fmt+0x58/0x70
        [<fffffc000048c9f4>] sysfs_warn_dup+0x94/0xd0
        [<fffffc0000486d40>] kernfs_path_from_node+0x30/0x60
        [<fffffc00004874ac>] kernfs_put+0x16c/0x2c0
        [<fffffc00004874ac>] kernfs_put+0x16c/0x2c0
        [<fffffc000048d010>] sysfs_do_create_link_sd.isra.2+0x100/0x120
        [<fffffc00005b9d64>] device_add+0x2a4/0x7c0
        [<fffffc00005ba5cc>] device_create_groups_vargs+0x14c/0x170
        [<fffffc00005ba518>] device_create_groups_vargs+0x98/0x170
        [<fffffc00005ba690>] device_create+0x50/0x70
        [<fffffc00005df36c>] ide_host_register+0x48c/0xa00
        [<fffffc00005df330>] ide_host_register+0x450/0xa00
        [<fffffc00005ba2a0>] device_register+0x20/0x50
        [<fffffc00005df330>] ide_host_register+0x450/0xa00
        [<fffffc00005df944>] ide_host_add+0x64/0xe0
        [<fffffc000079b41c>] kobject_uevent_env+0x16c/0x710
        [<fffffc0000310288>] do_one_initcall+0x68/0x260
        [<fffffc00007b13bc>] kernel_init+0x1c/0x1a0
        [<fffffc00007b13a0>] kernel_init+0x0/0x1a0
        [<fffffc0000311868>] ret_from_kernel_thread+0x18/0x20
        [<fffffc00007b13a0>] kernel_init+0x0/0x1a0
      
        ---[ end trace 24a70433c3e4d374 ]---
        ide0: disabling port
      
      Fix the problem by adding missing code to ide_host_register().
      
      Fixes: 30fdfb92 ("PCI: Add a call to pci_assign_irq() in pci_device_probe()")
      Fixes: 0e4c2eeb ("alpha/PCI: Replace pci_fixup_irqs() call with host bridge IRQ mapping hooks")
      Link: http://lkml.kernel.org/r/32ec730f-c1b0-5584-cd35-f8a809122b96@roeck-us.netReported-by: NGuenter Roeck <linux@roeck-us.net>
      Tested-by: NGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: NBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      [bhelgaas: add Fixes:]
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Matt Turner <mattst88@gmail.com>
      d410a641
  4. 03 10月, 2017 5 次提交
    • J
      nbd: fix -ERESTARTSYS handling · 6e60a3bb
      Josef Bacik 提交于
      Christoph made it so that if we return'ed BLK_STS_RESOURCE whenever we
      got ERESTARTSYS from sending our packets we'd return BLK_STS_OK, which
      means we'd never requeue and just hang.  We really need to return the
      right value from the upper layer.
      
      Fixes: fc17b653 ("blk-mq: switch ->queue_rq return value to blk_status_t")
      Signed-off-by: NJosef Bacik <jbacik@fb.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      6e60a3bb
    • C
      drm/sun4i: hdmi: Disable clks in bind function error path and unbind function · cb1dab0e
      Chen-Yu Tsai 提交于
      The HDMI driver enables the bus and mod clocks in the bind function, but
      does not disable them if it then bails our due to any errors. Neither
      does it disable the clocks in the unbind function.
      
      Fix this by adding a proper error path to the bind function, and
      clk_disable_unprepare calls to the unbind function.
      
      Also rename the err_cleanup_connector label to err_cleanup_encoder,
      since it is the encoder that gets cleaned up.
      
      Fixes: 9c568101 ("drm/sun4i: Add HDMI support")
      Signed-off-by: NChen-Yu Tsai <wens@csie.org>
      Acked-by: NMaxime Ripard <maxime.ripard@free-electrons.com>
      Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20170929082306.16193-6-wens@csie.org
      cb1dab0e
    • A
      ahci: don't ignore result code of ahci_reset_controller() · d312fefe
      Ard Biesheuvel 提交于
      ahci_pci_reset_controller() calls ahci_reset_controller(), which may
      fail, but ignores the result code and always returns success. This
      may result in failures like below
      
        ahci 0000:02:00.0: version 3.0
        ahci 0000:02:00.0: enabling device (0000 -> 0003)
        ahci 0000:02:00.0: SSS flag set, parallel bus scan disabled
        ahci 0000:02:00.0: controller reset failed (0xffffffff)
        ahci 0000:02:00.0: failed to stop engine (-5)
          ... repeated many times ...
        ahci 0000:02:00.0: failed to stop engine (-5)
        Unable to handle kernel paging request at virtual address ffff0000093f9018
          ...
        PC is at ahci_stop_engine+0x5c/0xd8 [libahci]
        LR is at ahci_deinit_port.constprop.12+0x1c/0xc0 [libahci]
          ...
        [<ffff000000a17014>] ahci_stop_engine+0x5c/0xd8 [libahci]
        [<ffff000000a196b4>] ahci_deinit_port.constprop.12+0x1c/0xc0 [libahci]
        [<ffff000000a197d8>] ahci_init_controller+0x80/0x168 [libahci]
        [<ffff000000a260f8>] ahci_pci_init_controller+0x60/0x68 [ahci]
        [<ffff000000a26f94>] ahci_init_one+0x75c/0xd88 [ahci]
        [<ffff000008430324>] local_pci_probe+0x3c/0xb8
        [<ffff000008431728>] pci_device_probe+0x138/0x170
        [<ffff000008585e54>] driver_probe_device+0x2dc/0x458
        [<ffff0000085860e4>] __driver_attach+0x114/0x118
        [<ffff000008583ca8>] bus_for_each_dev+0x60/0xa0
        [<ffff000008585638>] driver_attach+0x20/0x28
        [<ffff0000085850b0>] bus_add_driver+0x1f0/0x2a8
        [<ffff000008586ae0>] driver_register+0x60/0xf8
        [<ffff00000842f9b4>] __pci_register_driver+0x3c/0x48
        [<ffff000000a3001c>] ahci_pci_driver_init+0x1c/0x1000 [ahci]
        [<ffff000008083918>] do_one_initcall+0x38/0x120
      
      where an obvious hardware level failure results in an unnecessary 15 second
      delay and a subsequent crash.
      
      So record the result code of ahci_reset_controller() and relay it, rather
      than ignoring it.
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      d312fefe
    • P
      mlxsw: spectrum_router: Track RIF of IPIP next hops · de0f43c0
      Petr Machata 提交于
      When considering whether to set RTNH_F_OFFLOAD flag on an IPv6 route,
      mlxsw_sp_fib6_entry_offload_set() looks up the mlxsw_sp_nexthop
      corresponding to a given route, and decides based on whether the next
      hop's offloaded flag was set. When looking for the matching next hop, it
      also takes into account the device of the route, which must match next
      hop's RIF.
      
      IPIP next hops however hitherto didn't set the RIF. As a result, IPv6
      routes forwarding traffic to IP-in-IP netdevices are never marked as
      offloaded, even when they actually are.
      
      Thus track RIF of IPIP next hops the same way as that of ETHERNET next
      hops.
      
      Fixes: 8f28a309 ("mlxsw: spectrum_router: Support IPv6 overlay encap")
      Signed-off-by: NPetr Machata <petrm@mellanox.com>
      Reviewed-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      de0f43c0
    • P
      mlxsw: spectrum_router: Move VRF refcounting · 28a04c7b
      Petr Machata 提交于
      When creating a new RIF, bumping RIF count of the containing VR is the
      last thing to be done. Symmetrically, when destroying a RIF, RIF count
      is first dropped and only then the rest of the cleanup proceeds.
      
      That's a problem for loopback RIFs. Those hold two VR references: one
      for overlay and one for underlay. mlxsw_sp_rif_destroy() releases the
      overlay one, and the deconfigure() callback the underlay one. But if
      both overlay and underlay are the same, and if there are no other
      artifacts holding the VR alive, this put actually destroys the VR. Later
      on, when mlxsw_sp_rif_destroy() calls mlxsw_sp_vr_put() for the same VR,
      the VR will already have been released and the kernel crashes with NULL
      pointer dereference.
      
      The underlying problem is that the RIF under destruction ends up
      referencing the overlay VR much longer than it claims: all the way until
      the call to mlxsw_sp_vr_put(). So line up the reference counting
      properly to reflect this. Make corresponding changes in
      mlxsw_sp_rif_create() as well for symmetry.
      
      Fixes: 6ddb7426 ("mlxsw: spectrum_router: Introduce loopback RIFs")
      Signed-off-by: NPetr Machata <petrm@mellanox.com>
      Reviewed-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      28a04c7b
  5. 02 10月, 2017 6 次提交
  6. 01 10月, 2017 2 次提交
  7. 29 9月, 2017 5 次提交