1. 19 12月, 2015 6 次提交
  2. 18 12月, 2015 1 次提交
  3. 17 12月, 2015 2 次提交
  4. 16 12月, 2015 11 次提交
  5. 15 12月, 2015 8 次提交
  6. 14 12月, 2015 3 次提交
  7. 13 12月, 2015 1 次提交
  8. 12 12月, 2015 8 次提交
    • M
      parisc iommu: fix panic due to trying to allocate too large region · e46e31a3
      Mikulas Patocka 提交于
      When using the Promise TX2+ SATA controller on PA-RISC, the system often
      crashes with kernel panic, for example just writing data with the dd
      utility will make it crash.
      
      Kernel panic - not syncing: drivers/parisc/sba_iommu.c: I/O MMU @ 000000000000a000 is out of mapping resources
      
      CPU: 0 PID: 18442 Comm: mkspadfs Not tainted 4.4.0-rc2 #2
      Backtrace:
       [<000000004021497c>] show_stack+0x14/0x20
       [<0000000040410bf0>] dump_stack+0x88/0x100
       [<000000004023978c>] panic+0x124/0x360
       [<0000000040452c18>] sba_alloc_range+0x698/0x6a0
       [<0000000040453150>] sba_map_sg+0x260/0x5b8
       [<000000000c18dbb4>] ata_qc_issue+0x264/0x4a8 [libata]
       [<000000000c19535c>] ata_scsi_translate+0xe4/0x220 [libata]
       [<000000000c19a93c>] ata_scsi_queuecmd+0xbc/0x320 [libata]
       [<0000000040499bbc>] scsi_dispatch_cmd+0xfc/0x130
       [<000000004049da34>] scsi_request_fn+0x6e4/0x970
       [<00000000403e95a8>] __blk_run_queue+0x40/0x60
       [<00000000403e9d8c>] blk_run_queue+0x3c/0x68
       [<000000004049a534>] scsi_run_queue+0x2a4/0x360
       [<000000004049be68>] scsi_end_request+0x1a8/0x238
       [<000000004049de84>] scsi_io_completion+0xfc/0x688
       [<0000000040493c74>] scsi_finish_command+0x17c/0x1d0
      
      The cause of the crash is not exhaustion of the IOMMU space, there is
      plenty of free pages. The function sba_alloc_range is called with size
      0x11000, thus the pages_needed variable is 0x11. The function
      sba_search_bitmap is called with bits_wanted 0x11 and boundary size is
      0x10 (because dma_get_seg_boundary(dev) returns 0xffff).
      
      The function sba_search_bitmap attempts to allocate 17 pages that must not
      cross 16-page boundary - it can't satisfy this requirement
      (iommu_is_span_boundary always returns true) and fails even if there are
      many free entries in the IOMMU space.
      
      How did it happen that we try to allocate 17 pages that don't cross
      16-page boundary? The cause is in the function iommu_coalesce_chunks. This
      function tries to coalesce adjacent entries in the scatterlist. The
      function does several checks if it may coalesce one entry with the next,
      one of those checks is this:
      
      	if (startsg->length + dma_len > max_seg_size)
      		break;
      
      When it finishes coalescing adjacent entries, it allocates the mapping:
      
      sg_dma_len(contig_sg) = dma_len;
      dma_len = ALIGN(dma_len + dma_offset, IOVP_SIZE);
      sg_dma_address(contig_sg) =
      	PIDE_FLAG
      	| (iommu_alloc_range(ioc, dev, dma_len) << IOVP_SHIFT)
      	| dma_offset;
      
      It is possible that (startsg->length + dma_len > max_seg_size) is false
      (we are just near the 0x10000 max_seg_size boundary), so the funcion
      decides to coalesce this entry with the next entry. When the coalescing
      succeeds, the function performs
      	dma_len = ALIGN(dma_len + dma_offset, IOVP_SIZE);
      And now, because of non-zero dma_offset, dma_len is greater than 0x10000.
      iommu_alloc_range (a pointer to sba_alloc_range) is called and it attempts
      to allocate 17 pages for a device that must not cross 16-page boundary.
      
      To fix the bug, we must make sure that dma_len after addition of
      dma_offset and alignment doesn't cross the segment boundary. I.e. change
      	if (startsg->length + dma_len > max_seg_size)
      		break;
      to
      	if (ALIGN(dma_len + dma_offset + startsg->length, IOVP_SIZE) > max_seg_size)
      		break;
      
      This patch makes this change (it precalculates max_seg_boundary at the
      beginning of the function iommu_coalesce_chunks). I also added a check
      that the mapping length doesn't exceed dma_get_seg_boundary(dev) (it is
      not needed for Promise TX2+ SATA, but it may be needed for other devices
      that have dma_get_seg_boundary lower than dma_get_max_seg_size).
      Signed-off-by: NMikulas Patocka <mpatocka@redhat.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NHelge Deller <deller@gmx.de>
      e46e31a3
    • B
      sfc: only use RSS filters if we're using RSS · f1c2ef40
      Bert Kenward 提交于
      Without this, filter insertion on a VF would fail if only one channel
      was in use. This would include the unicast station filter and therefore
      no traffic would be received.
      Signed-off-by: NBert Kenward <bkenward@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f1c2ef40
    • M
      bnxt_en: Implement missing tx timeout reset logic. · 028de140
      Michael Chan 提交于
      The reset logic calls bnxt_close_nic() and bnxt_open_nic() under rtnl_lock
      from bnxt_sp_task.  BNXT_STATE_IN_SP_TASK must be cleared before calling
      bnxt_close_nic() to avoid deadlock.
      
      v2: Fixed white space error.  Thanks Dave.
      Signed-off-by: NMichael Chan <mchan@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      028de140
    • M
      bnxt_en: Don't cancel sp_task from bnxt_close_nic(). · 4cebdcec
      Michael Chan 提交于
      When implementing driver reset from tx_timeout in the next patch,
      bnxt_close_nic() will be called from the sp_task workqueue.  Calling
      cancel_work() on sp_task will hang the workqueue.
      
      Instead, set a new bit BNXT_STATE_IN_SP_TASK when bnxt_sp_task() is running.
      bnxt_close_nic() will wait for BNXT_STATE_IN_SP_TASK to clear before
      proceeding.
      Signed-off-by: NMichael Chan <mchan@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4cebdcec
    • M
      bnxt_en: Change bp->state to bitmap. · caefe526
      Michael Chan 提交于
      This allows multiple independent bits to be set for various states.
      Subsequent patches to implement tx timeout reset will require this.
      Signed-off-by: NMichael Chan <mchan@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      caefe526
    • M
      bnxt_en: Fix bitmap declaration to work on 32-bit arches. · de68f5de
      Michael Chan 提交于
      The declaration of the bitmap vf_req_snif_bmap using fixed array of
      unsigned long will only work on 64-bit archs.  Use DECLARE_BITMAP instead
      which will work on all archs.
      Signed-off-by: NMichael Chan <mchan@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      de68f5de
    • A
      phy: micrel: Fix finding PHY properties in MAC node. · 651df218
      Andrew Lunn 提交于
      commit 8b63ec18 ("phylib: Make PHYs children of their MDIO bus,
      not the bus' parent.")  changed the parenting of PHY devices, making
      them a child of the MDIO bus, instead of the MAC device. This broken
      the Micrel PHY driver which has a deprecated feature of allowing PHY
      properties to be placed into the MAC node.
      
      In order to find the MAC node, we need to walk up the tree of devices
      until we find one with an OF node attached.
      Reported-by: NDinh Nguyen <dinguyen@opensource.altera.com>
      Suggested-by: NDavid Daney <david.daney@cavium.com>
      Acked-by: NDavid Daney <david.daney@cavium.com>
      Fixes: 8b63ec18 ("phylib: Make PHYs children of their MDIO bus, not the bus' parent.")
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Tested-by: NDinh Nguyen <dinguyen@opensource.altera.com>
      Acked-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      651df218
    • A
      USB: add quirk for devices with broken LPM · ad87e032
      Alan Stern 提交于
      Some USB device / host controller combinations seem to have problems
      with Link Power Management.  For example, Steinar found that his xHCI
      controller wouldn't handle bandwidth calculations correctly for two
      video cards simultaneously when LPM was enabled, even though the bus
      had plenty of bandwidth available.
      
      This patch introduces a new quirk flag for devices that should remain
      disabled for LPM, and creates quirk entries for Steinar's devices.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Reported-by: NSteinar H. Gunderson <sgunderson@bigfoot.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ad87e032