1. 21 9月, 2011 5 次提交
  2. 20 9月, 2011 3 次提交
    • A
      USB: xHCI: prevent infinite loop when processing MSE event · c2d7b49f
      Andiry Xu 提交于
      When a xHC host is unable to handle isochronous transfer in the
      interval, it reports a Missed Service Error event and skips some tds.
      
      Currently xhci driver handles MSE event in the following ways:
      
      1. When encounter a MSE event, set ep->skip flag, update event ring
         dequeue pointer and return.
      
      2. When encounter the next event on this ep, the driver will run the
         do-while loop, fetch td from ep's td_list to find the td
         corresponding to this event.  All tds missed are marked as short
         transfer(-EXDEV).
      
      The do-while loop will end in two ways:
      
      1. If the td pointed by the event trb is found;
      
      2. If the ep ring's td_list is empty.
      
      However, if a buggy HW reports some unpredicted event (for example, an
      overrun event following a MSE event while the ep ring is actually not
      empty), the driver will never find the td, and it will loop until the
      td_list is empty.
      
      Unfortunately, the spinlock is dropped when give back a urb in the
      do-while loop.  During the spinlock released period, the class driver
      may still submit urbs and add tds to the td_list.  This may cause
      disaster, since the td_list will never be empty and the loop never ends,
      and the system hangs.
      
      To fix this, count the number of TDs on the ep ring before skipping TDs,
      and quit the loop when skipped that number of tds.  This guarantees the
      do-while loop will end after certain number of cycles, and driver will
      not be trapped in an infinite loop.
      Signed-off-by: NAndiry Xu <andiry.xu@amd.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c2d7b49f
    • G
      USB: xhci: Set change bit when warm reset change is set. · 44f4c3ed
      Greg KH 提交于
      Sometimes, when a USB 3.0 device is disconnected, the Intel Panther
      Point xHCI host controller will report a link state change with the
      state set to "SS.Inactive".  This causes the xHCI host controller to
      issue a warm port reset, which doesn't finish before the USB core times
      out while waiting for it to complete.
      
      When the warm port reset does complete, and the xHC gives back a port
      status change event, the xHCI driver kicks khubd.  However, it fails to
      set the bit indicating there is a change event for that port because the
      logic in xhci-hub.c doesn't check for the warm port reset bit.
      
      After that, the warm port status change bit is never cleared by the USB
      core, and the xHC stops reporting port status change bits.  (The xHCI
      spec says it shouldn't report more port events until all change bits are
      cleared.) This means any port changes when a new device is connected
      will never be reported, and the port will seem "dead" until the xHCI
      driver is unloaded and reloaded, or the computer is rebooted.  Fix this
      by making the xHCI driver set the port change bit when a warm port reset
      change bit is set.
      
      A better solution would be to make the USB core handle warm port reset
      in differently, merging the current code with the standard port reset
      code that does an incremental backoff on the timeout, and tries to
      complete the port reset two more times before giving up.  That more
      complicated fix will be merged next window, and this fix will be
      backported to stable.
      
      This should be backported to kernels as old as 3.0, since that was the
      first kernel with commit a11496eb ("xHCI: warm reset support").
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@kernel.org
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      44f4c3ed
    • R
      staging: fix comedi build when ISA_DMA_API is enabled but COMEDI_PCI is not enabled · c19cc78e
      Randy Dunlap 提交于
      Fix build when CONFIG_ISA_DMA_API is enabled but
      CONFIG_COMEDI_PCI[_DRIVERS] is not enabled.
      
      Fixes these build errors:
      
        drivers/staging/comedi/drivers/ni_labpc.c: In function 'labpc_ai_cmd':
        drivers/staging/comedi/drivers/ni_labpc.c:1351: error: implicit declaration of function 'labpc_suggest_transfer_size'
        drivers/staging/comedi/drivers/ni_labpc.c: At top level:
        drivers/staging/comedi/drivers/ni_labpc.c:1802: error: conflicting types for 'labpc_suggest_transfer_size'
        drivers/staging/comedi/drivers/ni_labpc.c:1351: note: previous implicit declaration of 'labpc_suggest_transfer_size' was here
      Signed-off-by: NRandy Dunlap <rdunlap@xenotime.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c19cc78e
  3. 19 9月, 2011 2 次提交
  4. 17 9月, 2011 9 次提交
    • N
      iscsi-target: Fix sendpage breakage with proper padding+DataDigest iovec offsets · 40b05497
      Nicholas Bellinger 提交于
      This patch fixes a bug in the iscsit_fe_sendpage_sg() transmit codepath that
      was originally introduced with the v3.1 iscsi-target merge that incorrectly
      uses hardcoded cmd->iov_data_count values to determine cmd->iov_data[] offsets
      for extra outgoing padding and DataDigest payload vectors.
      
      This code is obviously incorrect for the DataDigest enabled case with sendpage
      offload, and this fix ensures correct operation for padding + DataDigest,
      padding only, and DataDigest only cases.  The bug was introduced during a
      pre-merge change in iscsit_fe_sendpage_sg() to natively use struct scatterlist
      instead of the legacy v3.0 struct se_mem logic.
      
      Cc: Andy Grover <agrover@redhat.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      40b05497
    • D
      can: ti_hecc: include linux/io.h · 34b8686d
      Daniel Mack 提交于
      This fixes a build breakage for OMAP3 boards.
      Signed-off-by: NDaniel Mack <zonque@gmail.com>
      Cc: Wolfgang Grandegger <wg@grandegger.com>
      Cc: netdev@vger.kernel.org
      Acked-by: NWolfgang Grandegger <wg@grandegger.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      34b8686d
    • M
      firewire: ohci: add no MSI quirk for O2Micro controller · f39aa30d
      Ming Lei 提交于
      This fixes https://bugs.launchpad.net/ubuntu/+source/linux/+bug/801719 .
      
      An O2Micro PCI Express FireWire controller,
      "FireWire (IEEE 1394) [0c00]: O2 Micro, Inc. Device [1217:11f7] (rev 05)"
      which is a combination device together with an SDHCI controller and some
      sort of storage controller, misses SBP-2 status writes from an attached
      FireWire HDD.  This problem goes away if MSI is disabled for this
      FireWire controller.
      
      The device reportedly does not require QUIRK_CYCLE_TIMER.
      Signed-off-by: NMing Lei <ming.lei@canonical.com>
      Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (amended changelog)
      Cc: <stable@kernel.org>
      f39aa30d
    • N
      iscsi-target: Disable markers + remove dangerous local scope array usage · 2ff017f5
      Nicholas Bellinger 提交于
      This patch makes iscsi-target explictly disable OFMarker=Yes and IFMarker=yes
      parameter key usage during iscsi login by setting IFMarkInt_Reject and
      OFMarkInt_Reject values in iscsi_enforce_integrity_rules() to effectively
      disable iscsi marker usage.  With this patch, an initiator proposer asking
      to enable either marker parameter keys will be issued a 'No' response, and
      the target sets OFMarkInt + IFMarkInt parameter key response to 'Irrelevant'.
      
      With markers disabled during iscsi login, this patch removes the problematic
      on-stack local-scope array for marker intervals in iscsit_do_rx_data() +
      iscsit_do_tx_data(), and other related marker code in iscsi_target_util.c.
      This fixes a potentional stack smashing scenario with small range markers
      enabled and a large MRDSL as reported by DanC here:
      
      [bug report] target: stack can be smashed
      http://www.spinics.net/lists/target-devel/msg00453.htmlReported-by: NDan Carpenter <error27@gmail.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      2ff017f5
    • N
      target: Skip non hex characters for VPD=0x83 NAA IEEE Registered Extended · 784eb99e
      Nicholas Bellinger 提交于
      This patch adds target_parse_naa_6h_vendor_specific() to address a bug where the
      conversion of PRODUCT SERIAL NUMBER to use hex2bin() in target_emulate_evpd_83()
      was not doing proper isxdigit() checking.  This conversion of the vpd_unit_serial
      configifs attribute is done while generating a VPD=0x83 NAA IEEE Registered
      Extended DESIGNATOR format's 100 bits of unique VENDOR SPECIFIC IDENTIFIER +
      VENDOR SPECIFIC IDENTIFIER EXTENSION area.
      
      This patch allows vpd_unit_serial (VPD=0x80) and the T10 Vendor ID DESIGNATOR
      format (VPD=0x83) to continue to use free-form variable length ASCII values,
      and now skips any non hex characters for fixed length NAA IEEE Registered Extended
      DESIGNATOR format (VPD=0x83) requring the binary conversion.
      
      This was originally reported by Martin after the v3.1-rc1 change to use hex2bin()
      in commit 11650b85 where the use of non hex
      characters in vpd_unit_serial generated different values than the original
      v3.0 internal hex -> binary code.  This v3.1 change caused a problem with
      filesystems who write a NAA DESIGNATOR onto it's ondisk metadata, and this patch
      will (again) change existing values to ensure that non hex characters are not
      included in the fixed length NAA DESIGNATOR.
      
      Note this patch still expects vpd_unit_serial to be set via existing userspace
      methods of uuid generation, and does not do strict formatting via configfs input.
      
      The original bug report and thread can be found here:
      
      NAA breakage
      http://www.spinics.net/lists/target-devel/msg00477.html
      
      The v3.1-rc1 formatting of VPD=0x83 w/o this patch:
      
      VPD INQUIRY: Device Identification page
        Designation descriptor number 1, descriptor length: 20
          designator_type: NAA,  code_set: Binary
          associated with the addressed logical unit
            NAA 6, IEEE Company_id: 0x1405
            Vendor Specific Identifier: 0xffde35ebf
            Vendor Specific Identifier Extension: 0x3092f498ffa820f9
            [0x6001405ffde35ebf3092f498ffa820f9]
        Designation descriptor number 2, descriptor length: 56
          designator_type: T10 vendor identification,  code_set: ASCII
          associated with the addressed logical unit
            vendor id: LIO-ORG
            vendor specific: IBLOCK:ffde35ec-3092-4980-a820-917636ca54f1
      
      The v3.1-final formatting of VPD=0x83 w/ this patch:
      
      VPD INQUIRY: Device Identification page
        Designation descriptor number 1, descriptor length: 20
          designator_type: NAA,  code_set: Binary
          associated with the addressed logical unit
            NAA 6, IEEE Company_id: 0x1405
            Vendor Specific Identifier: 0xffde35ec3
            Vendor Specific Identifier Extension: 0x924980a82091763
            [0x6001405ffde35ec30924980a82091763]
        Designation descriptor number 2, descriptor length: 56
          designator_type: T10 vendor identification,  code_set: ASCII
          associated with the addressed logical unit
            vendor id: LIO-ORG
            vendor specific: IBLOCK:ffde35ec-3092-4980-a820-917636ca54f1
      
      (v2: Fix parsing code to dereference + check for string terminator instead
           of null pointer to ensure a zeroed payload for vpd_unit_serial less
           than 100 bits of NAA DESIGNATOR VENDOR SPECIFIC area.  Also, remove
           the unnecessary bitwise assignment)
      Reported-by: NMartin Svec <martin.svec@zoner.cz>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      784eb99e
    • A
      ibmveth: Fix checksum offload failure handling · fb82fd20
      Anton Blanchard 提交于
      Fix a number of issues in ibmveth_set_csum_offload:
      
      - set_attr6 and clr_attr6 may be used uninitialised
      
      - We store the result of the IPV4 checksum change in ret but overwrite
        it in a couple of places before checking it again later. Add ret4
        to make it obvious what we are doing.
      
      - We weren't clearing the NETIF_F_IP_CSUM and NETIF_F_IPV6_CSUM flags
        if the enable of that hypervisor feature failed.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fb82fd20
    • A
      ibmveth: Checksum offload is always disabled · 91aae1e5
      Anton Blanchard 提交于
      Commit b9367bf3 (net: ibmveth: convert to hw_features) reversed
      a check in ibmveth_set_csum_offload that results in checksum offload
      never being enabled.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Cc: <stable@kernel.org> # 3.0+
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      91aae1e5
    • A
      ibmveth: Fix issue with DMA mapping failure · b93da27f
      Anton Blanchard 提交于
      descs[].fields.address is 32bit which truncates any dma mapping
      errors so dma_mapping_error() fails to catch it.
      
      Use a dma_addr_t to do the comparison. With this patch I was able
      to transfer many gigabytes of data with IOMMU fault injection set
      at 10% probability.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Cc: <stable@kernel.org> # v2.6.37+
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b93da27f
    • B
      ibmveth: Fix DMA unmap error · 33a48ab1
      Brian King 提交于
      Commit 6e8ab30e (ibmveth: Add scatter-gather support) introduced a
      DMA mapping API inconsistency resulting in dma_unmap_page getting
      called on memory mapped via dma_map_single. This was seen when
      CONFIG_DMA_API_DEBUG was enabled. Fix up this API usage inconsistency.
      Signed-off-by: NBrian King <brking@linux.vnet.ibm.com>
      Acked-by: NAnton Blanchard <anton@samba.org>
      Cc: <stable@kernel.org> # v2.6.37+
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      33a48ab1
  5. 16 9月, 2011 21 次提交