1. 11 Apr, 2013 2 commits
  2. 03 Apr, 2013 15 commits
    • Qiang Liu's avatar
      fsl/sata: create a sysfs entry for rx water mark · 7551c40d
      Qiang Liu authored
      Support config RX WATER MARK via sysfs when running at run-time;
      A wrokaround for fix the exception happened to some WD HDD, found on
      WD3000HLFS-01G6U1, WD3000HLFS-01G6U0, some SSD disks. The read performance
      is also regression (about 30%) when use default value.
      
      According to the latest documents, 0x10 is the default value of RX WATER MARK,
      but exception/performance issue happened to some disks mentioned above.
      
      The exception log as below when testing read performance with IOZone:
      ata1.00: exception Emask 0x0 SAct 0x7 SErr 0x800000 action 0x6 frozen
      ata1: SError: { LinkSeq }
      ata1.00: failed command: READ FPDMA QUEUED
      ata1.00: cmd 60/00:00:ff:2c:14/01:00:02:00:00/40 tag 0 ncq 131072 in
      res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
      ata1.00: status: { DRDY }
      ata1.00: failed command: READ FPDMA QUEUED
      ata1.00: cmd 60/00:08:ff:2d:14/01:00:02:00:00/40 tag 1 ncq 131072 in
      res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
      ata1.00: status: { DRDY }
      ata1.00: failed command: WRITE FPDMA QUEUED
      ata1.00: cmd 61/10:10:af:08:6e/00:00:12:00:00/40 tag 2 ncq 8192 out
      res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
      ata1.00: status: { DRDY }
      ata1: hard resetting link
      ata1: Hardreset failed, not off-lined 0
      ata1: Signature Update detected @ 504 msecs
      ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
      ata1.00: configured for UDMA/133
      ata1.00: device reported invalid CHS sector 0
      ata1.00: device reported invalid CHS sector 0
      ata1.00: device reported invalid CHS sector 0
      ata1: EH complete
      
      The exception/performance can be resolved when RX WATER MARK value is 0x16.
      Signed-off-by: default avatarQiang Liu <qiang.liu@freescale.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      7551c40d
    • Aaron Lu's avatar
      libata-acpi: remove redundent code for power resource handling · 7381fe73
      Aaron Lu authored
      With commit:
      bc9b6407
      ACPI / PM: Rework the handling of devices depending on power resources
      
      The ACPI core now takes care of the power resources an acpi device
      depends on in that when the power resources are turned on, any devices
      that are bound to or in the dependent list of this acpi device will be
      runtime resumed. So there is no need for ata acpi code to duplicate this
      effort, and thus, the ata_acpi_(un)register_power_resource functions are
      no longer needed.
      
      The above commit thinks the scsi device is not bound to the acpi device,
      so needs to be added to the dependent list. But actually, it is. So
      there is no need to add it to the dependent list, or it will be runtime
      resumed twice(though this wouldn't cause any problem).
      
      This patch fixes it, and as a result, the
      ata_acpi_(un)register_power_resource and ata_acpi_(un)bind functions
      are removed.
      Signed-off-by: default avatarAaron Lu <aaron.lu@intel.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      7381fe73
    • Jingoo Han's avatar
      sata_highbank: make ahci_highbank_pm_ops static · b1a72d60
      Jingoo Han authored
      Make ahci_highbank_pm_ops static because ahci_highbank_pm_ops is
      not exported.
      Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      b1a72d60
    • Alexandru Gheorghiu's avatar
      pata_octeon_cf: Use resource_size function · b1cbe7d6
      Alexandru Gheorghiu authored
      Use resource_size function instead of explicit computation.
      Patch found using coccinelle.
      Signed-off-by: default avatarAlexandru Gheorghiu <gheorghiuandru@gmail.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      b1cbe7d6
    • Dan Carpenter's avatar
      pata_legacy: bogus clock in opti82c46x_set_piomode() · e0044c98
      Dan Carpenter authored
      "sysclk" is used as an index into a 4 element array.  My static
      checker complains because it can be out of bounds.  From the
      context, it looks like there is a right bit shift missing.
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      e0044c98
    • Jingoo Han's avatar
      pata_at32: use module_platform_driver_probe() · bdfa2e7e
      Jingoo Han authored
      This patch uses module_platform_driver_probe() macro which makes
      the code smaller and simpler.
      Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      bdfa2e7e
    • Krzysztof Mazur's avatar
      [libata] Fix HDIO_DRIVE_* ioctl() Linux 3.9 regression · 6d3bfc7b
      Krzysztof Mazur authored
      On Mon, Mar 25, 2013 at 06:26:50PM +0100, Ronald wrote:
      > In reply to [1]: I have the same issue. Git bisect took 50+ rebuilds xD
      >
      > Smartd does not work anymore since 84a9a8cd ([libata] Set proper SK
      > when CK_COND is set.).
      
      > [1] http://www.spinics.net/lists/linux-ide/msg45268.html
      
      It seems that the SAM_STAT_CHECK_CONDITION is not cleared
      causing -EIO, because that patch modified sensebuf and
      the check for clearing SAM_STAT_CHECK_CONDITION is no longer valid.
      
      Fix that.
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      6d3bfc7b
    • David Woodhouse's avatar
      libata: fix DMA to stack in reading devslp_timing parameters · 8e725c7f
      David Woodhouse authored
      Commit 803739d2 ("[libata] replace
      sata_settings with devslp_timing"), which was also Cc: stable, used a
      stack buffer to receive data from ata_read_log_page(), which triggers
      the following warning:
       ahci 0000:00:1f.2: DMA-API: device driver maps memory fromstack [addr=ffff880140469948]
      
      Fix this by using ap->sector_buf instead of a stack buffer.
      Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
      Cc: stable@kernel.org
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      8e725c7f
    • Youquan Song's avatar
      ata_piix: Fix DVD not dectected at some Haswell platforms · b55f84e2
      Youquan Song authored
      There is a quirk patch 5e5a4f5d
      "ata_piix: make DVD Drive recognisable on systems with Intel Sandybridge
       chipsets(v2)" fixing the 4 ports IDE controller 32bit PIO mode.
      
      We've hit a problem with DVD not recognized on Haswell Desktop platform which
      includes Lynx Point 2-port SATA controller.
      
      This quirk patch disables 32bit PIO on this controller in IDE mode.
      
      v2: Change spelling error in statememnt pointed by Sergei Shtylyov.
      v3: Change comment statememnt and spliting line over 80 characters pointed by
          Libor Pechacek and also rebase the patch against 3.8-rc7 kernel.
      Tested-by: default avatarLee, Chun-Yi <jlee@suse.com>
      Signed-off-by: default avatarYouquan Song <youquan.song@intel.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      b55f84e2
    • Shan Hai's avatar
      libata: Set max sector to 65535 for Slimtype DVD A DS8A8SH drive · a32450e1
      Shan Hai authored
      The Slimtype DVD A  DS8A8SH drive locks up when max sector is smaller than
      65535, and the blow backtrace is observed on locking up:
      
      INFO: task flush-8:32:1130 blocked for more than 120 seconds.
      "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
      flush-8:32      D ffffffff8180cf60     0  1130      2 0x00000000
       ffff880273aef618 0000000000000046 0000000000000005 ffff880273aee000
       ffff880273aee000 ffff880273aeffd8 ffff880273aee010 ffff880273aee000
       ffff880273aeffd8 ffff880273aee000 ffff88026e842ea0 ffff880274a10000
      Call Trace:
       [<ffffffff8168fc2d>] schedule+0x5d/0x70
       [<ffffffff8168fccc>] io_schedule+0x8c/0xd0
       [<ffffffff81324461>] get_request+0x731/0x7d0
       [<ffffffff8133dc60>] ? cfq_allow_merge+0x50/0x90
       [<ffffffff81083aa0>] ? wake_up_bit+0x40/0x40
       [<ffffffff81320443>] ? bio_attempt_back_merge+0x33/0x110
       [<ffffffff813248ea>] blk_queue_bio+0x23a/0x3f0
       [<ffffffff81322176>] generic_make_request+0xc6/0x120
       [<ffffffff81322308>] submit_bio+0x138/0x160
       [<ffffffff811d7596>] ? bio_alloc_bioset+0x96/0x120
       [<ffffffff811d1f61>] submit_bh+0x1f1/0x220
       [<ffffffff811d48b8>] __block_write_full_page+0x228/0x340
       [<ffffffff811d3650>] ? attach_nobh_buffers+0xc0/0xc0
       [<ffffffff811d8960>] ? I_BDEV+0x10/0x10
       [<ffffffff811d8960>] ? I_BDEV+0x10/0x10
       [<ffffffff811d4ab6>] block_write_full_page_endio+0xe6/0x100
       [<ffffffff811d4ae5>] block_write_full_page+0x15/0x20
       [<ffffffff811d9268>] blkdev_writepage+0x18/0x20
       [<ffffffff81142527>] __writepage+0x17/0x40
       [<ffffffff811438ba>] write_cache_pages+0x34a/0x4a0
       [<ffffffff81142510>] ? set_page_dirty+0x70/0x70
       [<ffffffff81143a61>] generic_writepages+0x51/0x80
       [<ffffffff81143ab0>] do_writepages+0x20/0x50
       [<ffffffff811c9ed6>] __writeback_single_inode+0xa6/0x2b0
       [<ffffffff811ca861>] writeback_sb_inodes+0x311/0x4d0
       [<ffffffff811caaa6>] __writeback_inodes_wb+0x86/0xd0
       [<ffffffff811cad43>] wb_writeback+0x1a3/0x330
       [<ffffffff816916cf>] ? _raw_spin_lock_irqsave+0x3f/0x50
       [<ffffffff811b8362>] ? get_nr_inodes+0x52/0x70
       [<ffffffff811cb0ac>] wb_do_writeback+0x1dc/0x260
       [<ffffffff8168dd34>] ? schedule_timeout+0x204/0x240
       [<ffffffff811cb232>] bdi_writeback_thread+0x102/0x2b0
       [<ffffffff811cb130>] ? wb_do_writeback+0x260/0x260
       [<ffffffff81083550>] kthread+0xc0/0xd0
       [<ffffffff81083490>] ? kthread_worker_fn+0x1b0/0x1b0
       [<ffffffff8169a3ec>] ret_from_fork+0x7c/0xb0
       [<ffffffff81083490>] ? kthread_worker_fn+0x1b0/0x1b0
      
       The above trace was triggered by
         "dd if=/dev/zero of=/dev/sr0 bs=2048 count=32768"
      
       It was previously working by accident, since another bug introduced
       by 4dce8ba9 (libata: Use 'bool' return value for ata_id_XXX) caused
       all drives to use maxsect=65535.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarShan Hai <shan.hai@windriver.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      a32450e1
    • Shan Hai's avatar
      libata: Use integer return value for atapi_command_packet_set · d8668fcb
      Shan Hai authored
      The function returns type of ATAPI drives so it should return integer value.
      The commit 4dce8ba9 (libata: Use 'bool' return value for ata_id_XXX) since
      v2.6.39 changed the type of return value from int to bool, the change would
      cause all of the ATAPI class drives to be treated as TYPE_TAPE and the
      max_sectors of the drives to be set to 65535 because of the commit
      f8d8e579(libata: increase 128 KB / cmd limit for ATAPI tape drives), for the
      function would return true for all ATAPI class drives and the TYPE_TAPE is
      defined as 0x01.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarShan Hai <shan.hai@windriver.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      d8668fcb
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · da241efc
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Fix VSOCK layer handling of context ID changes, from Reilly Grant.
      
       2) Now that we have a synchronize_net() in netdev_rx_handler_unregister(),
          we can't let any call sites hold locks.  Unfortunately bonding does,
          so we have to drop the rwlock there a little bit earlier, fix from
          Veaceslav Falico.
      
       3) MAC address setting loop exits one iteration too early in mlx4
          driver, from Yan Burman.
      
       4) Restore ipv6 routes properly upon ifdown/ifup of loopback, from
          Balakumaran Kannan.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
        VSOCK: Handle changes to the VMCI context ID.
        net IPv6 : Fix broken IPv6 routing table after loopback down-up
        cbq: incorrect processing of high limits
        net/mlx4_en: Fix setting initial MAC address
        bonding: get netdev_rx_handler_unregister out of locks
      da241efc
    • Linus Torvalds's avatar
      Merge tag 'regmap-v3.9-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap · 6e8517a9
      Linus Torvalds authored
      Pull regmap fixes from Mark Brown:
       "A small collection of fixes.  The most important ones are those from
        Stephen and Lars-Peter both of which fix cache issues that have been
        lurking for a while but not manifesting noticably enough for anyone to
        report them."
      
      * tag 'regmap-v3.9-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
        regmap: async: Add missing return
        regmap: don't corrupt work buffer in _regmap_raw_write()
        regmap: cache Fix regcache-rbtree sync
        regmap: Initialize `map->debugfs' before regcache
      6e8517a9
    • Linus Torvalds's avatar
      Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux · bd709bd0
      Linus Torvalds authored
      Pull DRM fixes from Dave Airlie:
       "Two core fixes, both regressions, along with some intel and some
        nouveau fixes for regressions and oopses"
      
      * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
        drm: correctly restore mappings if drm_open fails
        drm/nouveau: fix NULL ptr dereference from nv50_disp_intr()
        drm/nouveau: fix handling empty channel list in ioctl's
        drm: don't unlock in the addfb error paths
        drm/i915: Fix build failure
        drm/i915: Be sure to turn hsync/vsync back on at crt enable (v2)
        drm/i915: duct-tape locking when eDP init fails
      bd709bd0
    • Linus Torvalds's avatar
      Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus · aea7fab8
      Linus Torvalds authored
      Pull MIPS fixes from Ralf Baechle:
       "A collection of fixes pretty much across the MIPS code.  Even the
        change to include/linux/signal.h by David Howells' 2a148698 ("Fix
        breakage in MIPS siginfo handling") should be considered MIPS-specific
        as it touches an ifdefed segment that is only relevant to MIPS and
        which unfortunately can't be made to go away entirely."
      
      * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus:
        Fix breakage in MIPS siginfo handling
        Revert "MIPS: BCM63XX: Call board_register_device from device_initcall()"
        MIPS: BCM63XX: Make nvram checksum failure non fatal
        MIPS: Fix code generation for non-DSP capable CPUs
        MIPS: Fix inconsistent formatting inside /proc/cpuinfo
        MIPS: SEAD3: Enable LL/SC.
        MIPS: Get rid of CONFIG_CPU_HAS_LLSC again
        MIPS: Add dependencies for HAVE_ARCH_TRANSPARENT_HUGEPAGE
        MIPS: VR4133: Fix probe for LL/SC.
        MIPS: Fix logic errors in bitops.c
        MIPS: Use CONFIG_CPU_MIPSR2 in csum_partial.S
        MIPS: compat: Return same error ENOSYS as native for invalid operation.
      aea7fab8
  3. 02 Apr, 2013 12 commits
    • Ilija Hadzic's avatar
      drm: correctly restore mappings if drm_open fails · a8ec3a66
      Ilija Hadzic authored
      If first drm_open fails, the error-handling path will
      incorrectly restore inode's mapping to NULL. This can
      cause the crash later on. Fix by separately storing
      away mapping pointers that drm_open can touch and
      restore each from its own respective variable if the
      call fails.
      
      Fixes: https://bugzilla.novell.com/show_bug.cgi?id=807850
      (thanks to Michal Hocko for investigating investigating and
      finding the root cause of the bug)
      
      Reference:
      http://lists.freedesktop.org/archives/dri-devel/2013-March/036564.html
      
      v2: Use one variable to store file and inode mapping
          since they are the same at the function entry.
          Fix spelling mistakes in commit message.
      
      v3: Add reference to the original bug report.
      Reported-by: default avatarMarco Munderloh <munderl@tnt.uni-hannover.de>
      Tested-by: default avatarMarco Munderloh <munderl@tnt.uni-hannover.de>
      Signed-off-by: default avatarIlija Hadzic <ihadzic@research.bell-labs.com>
      Cc: Michal Hocko <mhocko@suse.cz>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      a8ec3a66
    • Dave Airlie's avatar
      Merge branch 'drm-nouveau-fixes-3.9' of... · 7cebefe6
      Dave Airlie authored
      Merge branch 'drm-nouveau-fixes-3.9' of git://anongit.freedesktop.org/git/nouveau/linux-2.6 into drm-next
      
      Oops fixers.
      * 'drm-nouveau-fixes-3.9' of git://anongit.freedesktop.org/git/nouveau/linux-2.6:
        drm/nouveau: fix NULL ptr dereference from nv50_disp_intr()
        drm/nouveau: fix handling empty channel list in ioctl's
      7cebefe6
    • Dave Airlie's avatar
      Merge branch 'drm-intel-fixes' of git://people.freedesktop.org/~danvet/drm-intel into drm-next · 1caa5900
      Dave Airlie authored
      One locking regression fix, and a couple of other i915 ones.
      
      * 'drm-intel-fixes' of git://people.freedesktop.org/~danvet/drm-intel:
        drm: don't unlock in the addfb error paths
        drm/i915: Fix build failure
        drm/i915: Be sure to turn hsync/vsync back on at crt enable (v2)
        drm/i915: duct-tape locking when eDP init fails
      1caa5900
    • Reilly Grant's avatar
      VSOCK: Handle changes to the VMCI context ID. · 990454b5
      Reilly Grant authored
      The VMCI context ID of a virtual machine may change at any time. There
      is a VMCI event which signals this but datagrams may be processed before
      this is handled. It is therefore necessary to be flexible about the
      destination context ID of any datagrams received. (It can be assumed to
      be correct because it is provided by the hypervisor.) The context ID on
      existing sockets should be updated to reflect how the hypervisor is
      currently referring to the system.
      Signed-off-by: default avatarReilly Grant <grantr@vmware.com>
      Acked-by: default avatarAndy King <acking@vmware.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      990454b5
    • Balakumaran Kannan's avatar
      net IPv6 : Fix broken IPv6 routing table after loopback down-up · 25fb6ca4
      Balakumaran Kannan authored
      IPv6 Routing table becomes broken once we do ifdown, ifup of the loopback(lo)
      interface. After down-up, routes of other interface's IPv6 addresses through
      'lo' are lost.
      
      IPv6 addresses assigned to all interfaces are routed through 'lo' for internal
      communication. Once 'lo' is down, those routing entries are removed from routing
      table. But those removed entries are not being re-created properly when 'lo' is
      brought up. So IPv6 addresses of other interfaces becomes unreachable from the
      same machine. Also this breaks communication with other machines because of
      NDISC packet processing failure.
      
      This patch fixes this issue by reading all interface's IPv6 addresses and adding
      them to IPv6 routing table while bringing up 'lo'.
      
      ==Testing==
      Before applying the patch:
      $ route -A inet6
      Kernel IPv6 routing table
      Destination                    Next Hop                   Flag Met Ref Use If
      2000::20/128                   ::                         U    256 0     0 eth0
      fe80::/64                      ::                         U    256 0     0 eth0
      ::/0                           ::                         !n   -1  1     1 lo
      ::1/128                        ::                         Un   0   1     0 lo
      2000::20/128                   ::                         Un   0   1     0 lo
      fe80::xxxx:xxxx:xxxx:xxxx/128  ::                         Un   0   1     0 lo
      ff00::/8                       ::                         U    256 0     0 eth0
      ::/0                           ::                         !n   -1  1     1 lo
      $ sudo ifdown lo
      $ sudo ifup lo
      $ route -A inet6
      Kernel IPv6 routing table
      Destination                    Next Hop                   Flag Met Ref Use If
      2000::20/128                   ::                         U    256 0     0 eth0
      fe80::/64                      ::                         U    256 0     0 eth0
      ::/0                           ::                         !n   -1  1     1 lo
      ::1/128                        ::                         Un   0   1     0 lo
      ff00::/8                       ::                         U    256 0     0 eth0
      ::/0                           ::                         !n   -1  1     1 lo
      $
      
      After applying the patch:
      $ route -A inet6
      Kernel IPv6 routing
      table
      Destination                    Next Hop                   Flag Met Ref Use If
      2000::20/128                   ::                         U    256 0     0 eth0
      fe80::/64                      ::                         U    256 0     0 eth0
      ::/0                           ::                         !n   -1  1     1 lo
      ::1/128                        ::                         Un   0   1     0 lo
      2000::20/128                   ::                         Un   0   1     0 lo
      fe80::xxxx:xxxx:xxxx:xxxx/128  ::                         Un   0   1     0 lo
      ff00::/8                       ::                         U    256 0     0 eth0
      ::/0                           ::                         !n   -1  1     1 lo
      $ sudo ifdown lo
      $ sudo ifup lo
      $ route -A inet6
      Kernel IPv6 routing table
      Destination                    Next Hop                   Flag Met Ref Use If
      2000::20/128                   ::                         U    256 0     0 eth0
      fe80::/64                      ::                         U    256 0     0 eth0
      ::/0                           ::                         !n   -1  1     1 lo
      ::1/128                        ::                         Un   0   1     0 lo
      2000::20/128                   ::                         Un   0   1     0 lo
      fe80::xxxx:xxxx:xxxx:xxxx/128  ::                         Un   0   1     0 lo
      ff00::/8                       ::                         U    256 0     0 eth0
      ::/0                           ::                         !n   -1  1     1 lo
      $
      Signed-off-by: default avatarBalakumaran Kannan <Balakumaran.Kannan@ap.sony.com>
      Signed-off-by: default avatarMaruthi Thotad <Maruthi.Thotad@ap.sony.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      25fb6ca4
    • Vasily Averin's avatar
      cbq: incorrect processing of high limits · f0f6ee1f
      Vasily Averin authored
      currently cbq works incorrectly for limits > 10% real link bandwidth,
      and practically does not work for limits > 50% real link bandwidth.
      Below are results of experiments taken on 1 Gbit link
      
       In shaper | Actual Result
      -----------+---------------
        100M     | 108 Mbps
        200M     | 244 Mbps
        300M     | 412 Mbps
        500M     | 893 Mbps
      
      This happen because of q->now changes incorrectly in cbq_dequeue():
      when it is called before real end of packet transmitting,
      L2T is greater than real time delay, q_now gets an extra boost
      but never compensate it.
      
      To fix this problem we prevent change of q->now until its synchronization
      with real time.
      Signed-off-by: default avatarVasily Averin <vvs@openvz.org>
      Reviewed-by: default avatarAlexey Kuznetsov <kuznet@ms2.inr.ac.ru>
      Acked-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f0f6ee1f
    • Stanislav Kinsbursky's avatar
      ipc: set msg back to -EAGAIN if copy wasn't performed · 2dc958fa
      Stanislav Kinsbursky authored
      Make sure that msg pointer is set back to error value in case of
      MSG_COPY flag is set and desired message to copy wasn't found.  This
      garantees that msg is either a error pointer or a copy address.
      
      Otherwise the last message in queue will be freed without unlinking from
      the queue (which leads to memory corruption) and the dummy allocated
      copy won't be released.
      Signed-off-by: default avatarStanislav Kinsbursky <skinsbursky@parallels.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      2dc958fa
    • Yan Burman's avatar
      net/mlx4_en: Fix setting initial MAC address · bab6a9ea
      Yan Burman authored
      Commit 6bbb6d99 "net/mlx4_en: Optimize Rx fast path filter checks" introduced a regression
      under which the MAC address read from the card was not converted correctly
      (the most significant byte was not handled), fix that.
      Reviewed-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarYan Burman <yanb@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bab6a9ea
    • Veaceslav Falico's avatar
      bonding: get netdev_rx_handler_unregister out of locks · fcd99434
      Veaceslav Falico authored
      Now that netdev_rx_handler_unregister contains synchronize_net(), we need
      to call it outside of bond->lock, cause it might sleep. Also, remove the
      already unneded synchronize_net().
      Signed-off-by: default avatarVeaceslav Falico <vfalico@redhat.com>
      Acked-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fcd99434
    • Linus Torvalds's avatar
      Merge tag 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 118c9a45
      Linus Torvalds authored
      Pull ARM SoC bug fixes from Arnd Bergmann:
       "After a quiet set of fixes for 3.9-rc4, a lot of people woke up and
        sent urgent fixes for 3.9.  I pushed back on a number of them that got
        deferred to 3.10, but these are the ones that seemed important.
      
        Regression in 3.9:
      
         - Multiple regressions in OMAP2+ clock cleanup
         - SH-Mobile frame buffer bug fix that merged here because of
           maintainer MIA
         - ux500 prcmu changes broke DT booting
         - MMCI duplicated regulator setup on ux500
         - New ux500 clock driver broke ethernet on snowball
         - Local interrupt driver for mvebu broke ethernet
         - MVEBU GPIO driver did not get set up right on Orion DT
         - incorrect interrupt number on Orion crypto for DT
      
        Long-standing bugs, including candidates for stable:
      
         - Kirkwood MMC needs to disable invalid card detect pins
         - MV SDIO pinmux was wrong on Mirabox
         - GoFlex Net board file needs to set NAND chip delay
         - MSM timer restart race
         - ep93xx early debug code broke in 3.7
         - i.MX CPU hotplug race
         - Incorrect clock setup for OMAP1 USB
         - Workaround for bad clock setup by some old OMAP4 boot loaders
         - Static I/O mappings on cns3xxx since 3.2"
      
      * tag 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
        ARM: cns3xxx: fix mapping of private memory region
        arm: mvebu: Fix pinctrl for Armada 370 Mirabox SDIO port.
        arm: orion5x: correct IRQ used in dtsi for mv_cesa
        arm: orion5x: fix orion5x.dtsi gpio parameters
        ARM: Kirkwood: fix unused mvsdio gpio pins
        arm: mvebu: Use local interrupt only for the timer 0
        ARM: kirkwood: Fix chip-delay for GoFlex Net
        ARM: ux500: Enable the clock controlling Ethernet on Snowball
        ARM: ux500: Stop passing ios_handler() as an MMCI power controlling call-back
        ARM: ux500: Apply the TCPM and TCDM locations and sizes to dbx5x0 DT
        fbdev: sh_mobile_lcdc: fixup B side hsync adjust settings
        ARM: OMAP: clocks: Delay clk inits atleast until slab is initialized
        ARM: imx: fix sync issue between imx_cpu_die and imx_cpu_kill
        ARM: msm: Stop counting before reprogramming clockevent
        ARM: ep93xx: Fix wait for UART FIFO to be empty
        ARM: OMAP4: PM: fix PM regression introduced by recent clock cleanup
        ARM: OMAP3: hwmod data: keep MIDLEMODE in force-standby for musb
        ARM: OMAP4: clock data: lock USB DPLL on boot
        ARM: OMAP1: fix USB host on 1710
      118c9a45
    • Linus Torvalds's avatar
      Merge branch 'for-3.9' of git://linux-nfs.org/~bfields/linux · f8e9248d
      Linus Torvalds authored
      Pull nfsd bugfix from J Bruce Fields:
       "An xdr decoding error--thanks, Toralf Förster, and Trinity!"
      
      * 'for-3.9' of git://linux-nfs.org/~bfields/linux:
        nfsd4: reject "negative" acl lengths
      f8e9248d
    • Arnd Bergmann's avatar
      Merge tag 'v3.9-rc1_cns3xxx_fixes' of git://git.infradead.org/users/cbou/linux-cns3xxx into fixes · 06d1d8c8
      Arnd Bergmann authored
      From Anton Vorontsov <anton@enomsg.org>:
      
      This tag includes Mac Lin's work to revive CNS3xxx booting:
      
       "Since commit 0536bdf3 (ARM: move iotable mappings within the vmalloc
       region), [...] the pre-defined iotable mappings is not in the vmalloc
       region. [...] move the iotable mappings into the vmalloc region, and
       merge the MPCore private memory region (containing the SCU, the GIC and
       the TWD) as a single region."
      
      Plus there is a small cosmetic fix, also from Mac Lin.
      
      * tag 'v3.9-rc1_cns3xxx_fixes' of git://git.infradead.org/users/cbou/linux-cns3xxx:
        ARM: cns3xxx: fix mapping of private memory region
      
      [arnd: dropped the cosmetic fix from the merge as it is not needed for 3.9]
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      06d1d8c8
  4. 01 Apr, 2013 7 commits
    • Linus Torvalds's avatar
      Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux · fefcdbe4
      Linus Torvalds authored
      Pull virtio fixes from Rusty Russell:
       "One reversion, a tiny leak fix, and a cc:stable locking fix, in two
        parts"
      
      * tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
        virtio: console: add locking around c_ovq operations
        virtio: console: rename cvq_lock to c_ivq_lock
        hw_random: free rng_buffer at module exit
        Revert "virtio_console: Initialize guest_connected=true for rproc_serial"
      fefcdbe4
    • Anatol Pomozov's avatar
      loop: prevent bdev freeing while device in use · c1681bf8
      Anatol Pomozov authored
      struct block_device lifecycle is defined by its inode (see fs/block_dev.c) -
      block_device allocated first time we access /dev/loopXX and deallocated on
      bdev_destroy_inode. When we create the device "losetup /dev/loopXX afile"
      we want that block_device stay alive until we destroy the loop device
      with "losetup -d".
      
      But because we do not hold /dev/loopXX inode its counter goes 0, and
      inode/bdev can be destroyed at any moment. Usually it happens at memory
      pressure or when user drops inode cache (like in the test below). When later in
      loop_clr_fd() we want to use bdev we have use-after-free error with following
      stack:
      
      BUG: unable to handle kernel NULL pointer dereference at 0000000000000280
        bd_set_size+0x10/0xa0
        loop_clr_fd+0x1f8/0x420 [loop]
        lo_ioctl+0x200/0x7e0 [loop]
        lo_compat_ioctl+0x47/0xe0 [loop]
        compat_blkdev_ioctl+0x341/0x1290
        do_filp_open+0x42/0xa0
        compat_sys_ioctl+0xc1/0xf20
        do_sys_open+0x16e/0x1d0
        sysenter_dispatch+0x7/0x1a
      
      To prevent use-after-free we need to grab the device in loop_set_fd()
      and put it later in loop_clr_fd().
      
      The issue is reprodusible on current Linus head and v3.3. Here is the test:
      
        dd if=/dev/zero of=loop.file bs=1M count=1
        while [ true ]; do
          losetup /dev/loop0 loop.file
          echo 2 > /proc/sys/vm/drop_caches
          losetup -d /dev/loop0
        done
      
      [ Doing bdgrab/bput in loop_set_fd/loop_clr_fd is safe, because every
        time we call loop_set_fd() we check that loop_device->lo_state is
        Lo_unbound and set it to Lo_bound If somebody will try to set_fd again
        it will get EBUSY.  And if we try to loop_clr_fd() on unbound loop
        device we'll get ENXIO.
      
        loop_set_fd/loop_clr_fd (and any other loop ioctl) is called under
        loop_device->lo_ctl_mutex. ]
      Signed-off-by: default avatarAnatol Pomozov <anatol.pomozov@gmail.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c1681bf8
    • Linus Torvalds's avatar
      Merge tag 'clk-fixes-for-linus' of git://git.linaro.org/people/mturquette/linux · aae92db9
      Linus Torvalds authored
      Pull tegra clock driver fix from Mike Turquette:
       "Missing base address in Tegra clock driver results in non-operational
        PCIe.  On some devices this means that Ethernet will go uninitialized
        and other devices will fail.  This pull request fixes it with a single
        patch to pass the proper base address in the Tegra clock driver."
      
      * tag 'clk-fixes-for-linus' of git://git.linaro.org/people/mturquette/linux:
        clk: tegra: Allow PLLE training to succeed
      aae92db9
    • Linus Torvalds's avatar
      Merge tag 'for-3.9-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/rwlove/fcoe · dc543f9e
      Linus Torvalds authored
      Pull FCoE fixes from Robert Love:
       "Critical patches to fix FCoE VN2VN mode with new interfaces targeting
        3.9-rc"
      
      * tag 'for-3.9-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/rwlove/fcoe:
        libfcoe: Fix fcoe_sysfs VN2VN mode
        libfc, fcoe, bnx2fc: Split fc_disc_init into fc_disc_{init, config}
        libfc, fcoe, bnx2fc: Always use fcoe_disc_init for discovery layer initialization
        fcoe: Fix deadlock between create and destroy paths
        bnx2fc: Make the fcoe_cltr the SCSI host parent
      dc543f9e
    • Thierry Reding's avatar
      clk: tegra: Allow PLLE training to succeed · 0f1bc12e
      Thierry Reding authored
      Under some circumstances the PLLE needs to be retrained, in which case
      access to the PMC registers is required. Fix this by passing a pointer
      to the PMC registers instead of NULL when registering the PLLE clock.
      Signed-off-by: default avatarThierry Reding <thierry.reding@avionic-design.de>
      Acked-By: default avatarPeter De Schrijver <pdeschrijver@nvidia.com>
      Signed-off-by: default avatarMike Turquette <mturquette@linaro.org>
      0f1bc12e
    • Linus Torvalds's avatar
      Merge branch 'stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile · 3658f360
      Linus Torvalds authored
      Pull arch/tile fix from Chris Metcalf:
       "This change allows newer Tilera boot tools to work correctly with
        current (and stable) kernels by using the right filename to get the
        initramfs from the Tilera hypervisor filesystem."
      
      * 'stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile:
        tile: expect new initramfs name from hypervisor file system
      3658f360
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · ff3421de
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) sadb_msg prepared for IPSEC userspace forgets to initialize the
          satype field, fix from Nicolas Dichtel.
      
       2) Fix mac80211 synchronization during station removal, from Johannes
          Berg.
      
       3) Fix IPSEC sequence number notifications when they wrap, from Steffen
          Klassert.
      
       4) Fix cfg80211 wdev tracing crashes when add_virtual_intf() returns an
          error pointer, from Johannes Berg.
      
       5) In mac80211, don't call into the channel context code with the
          interface list mutex held.  From Johannes Berg.
      
       6) In mac80211, if we don't actually associate, do not restart the STA
          timer, otherwise we can crash.  From Ben Greear.
      
       7) Missing dma_mapping_error() check in e1000, ixgb, and e1000e.  From
          Christoph Paasch.
      
       8) Fix sja1000 driver defines to not conflict with SH port, from Marc
          Kleine-Budde.
      
       9) Don't call il4965_rs_use_green with a NULL station, from Colin Ian
          King.
      
      10) Suspend/Resume in the FEC driver fail because the buffer descriptors
          are not initialized at all the moments in which they should.  Fix
          from Frank Li.
      
      11) cpsw and davinci_emac drivers both use the wrong interface to
          restart a stopped TX queue.  Use netif_wake_queue not
          netif_start_queue, the latter is for initialization/bringup not
          active management of the queue.  From Mugunthan V N.
      
      12) Fix regression in rate calculations done by
          psched_ratecfg_precompute(), missing u64 type promotion.  From
          Sergey Popovich.
      
      13) Fix length overflow in tg3 VPD parsing, from Kees Cook.
      
      14) AOE driver fails to allocate enough headroom, resulting in crashes.
          Fix from Eric Dumazet.
      
      15) RX overflow happens too quickly in sky2 driver because pause packet
          thresholds are not programmed correctly.  From Mirko Lindner.
      
      16) Bonding driver manages arp_interval and miimon settings incorrectly,
          disabling one unintentionally disables both.  Fix from Nikolay
          Aleksandrov.
      
      17) smsc75xx drivers don't program the RX mac properly for jumbo frames.
          Fix from Steve Glendinning.
      
      18) Fix off-by-one in Codel packet scheduler.  From Vijay Subramanian.
      
      19) Fix packet corruption in atl1c by disabling MSI support, from Hannes
          Frederic Sowa.
      
      20) netdev_rx_handler_unregister() needs a synchronize_net() to fix
          crashes in bonding driver unload stress tests.  From Eric Dumazet.
      
      21) rxlen field of ks8851 RX packet descriptors not interpreted
          correctly (it is 12 bits not 16 bits, so needs to be masked after
          shifting the 32-bit value down 16 bits).  Fix from Max Nekludov.
      
      22) Fix missed RX/TX enable in sh_eth driver due to mishandling of link
          change indications.  From Sergei Shtylyov.
      
      23) Fix crashes during spurious ECI interrupts in sh_eth driver, also
          from Sergei Shtylyov.
      
      24) dm9000 driver initialization is done wrong for revision B devices
          with DSP PHY, from Joseph CHANG.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (53 commits)
        DM9000B: driver initialization upgrade
        sh_eth: make 'link' field of 'struct sh_eth_private' *int*
        sh_eth: workaround for spurious ECI interrupt
        sh_eth: fix handling of no LINK signal
        ks8851: Fix interpretation of rxlen field.
        net: add a synchronize_net() in netdev_rx_handler_unregister()
        MAINTAINERS: Update netxen_nic maintainers list
        atl1e: drop pci-msi support because of packet corruption
        net: fq_codel: Fix off-by-one error
        net: calxedaxgmac: Wake-on-LAN fixes
        net: calxedaxgmac: fix rx ring handling when OOM
        net: core: Remove redundant call to 'nf_reset' in 'dev_forward_skb'
        smsc75xx: fix jumbo frame support
        net: fix the use of this_cpu_ptr
        bonding: fix disabling of arp_interval and miimon
        ipv6: don't accept node local multicast traffic from the wire
        sky2: Threshold for Pause Packet is set wrong
        sky2: Receive Overflows not counted
        aoe: reserve enough headroom on skbs
        line up comment for ndo_bridge_getlink
        ...
      ff3421de
  5. 31 Mar, 2013 4 commits
    • Joseph CHANG's avatar
      DM9000B: driver initialization upgrade · 6741f40d
      Joseph CHANG authored
      Fix bug for DM9000 revision B which contain a DSP PHY
      
      DM9000B use DSP PHY instead previouse DM9000 revisions' analog PHY,
      So need extra change in initialization, For
      explicity PHY Reset and PHY init parameter, and
      first DM9000_NCR reset need NCR_MAC_LBK bit by dm9000_probe().
      
      Following DM9000_NCR reset cause by dm9000_open() clear the
      NCR_MAC_LBK bit.
      
      Without this fix, Power-up FIFO pointers error happen around 2%
      rate among Davicom's customers' boards. With this fix, All above
      cases can be solved.
      Signed-off-by: default avatarJoseph CHANG <josright123@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6741f40d
    • Sergei Shtylyov's avatar
      sh_eth: make 'link' field of 'struct sh_eth_private' *int* · 3340d2aa
      Sergei Shtylyov authored
      The 'link' field of 'struct sh_eth_private' has type 'enum phy_state' while the
      'link' field of 'struct phy_device' is merely *int* (having values 0 and 1) and
      the former field gets assigned from the latter. Make the field match, getting
      rid of incorrectly used PHY_DOWN value in assignments/comparisons.
      Signed-off-by: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3340d2aa
    • Sergei Shtylyov's avatar
      sh_eth: workaround for spurious ECI interrupt · 3893b273
      Sergei Shtylyov authored
      At least on Renesas R8A7778, EESR.ECI interrupt seems to fire regardless of its
      mask in EESIPR register. I can 100% reproduce it with the following scenario:
      target is booted with 'ip=on' option, and so IP-Config opens SoC Ether device
      but doesn't get a proper reply and then succeeds with on-board SMC chip; then
      I login and try to bring up the SoC Ether device with 'ifconfig', and I get
      an ECI interrupt once request_irq() is called by sh_eth_open() (while interrupt
      mask in EESIPR register is all 0), if that interrupt is accompanied by a pending
      EESR.FRC (frame receive completion) interrupt, I get kernel oops in sh_eth_rx()
      because sh_eth_ring_init() hasn't been called yet!
      
      The solution I worked out is the following: in sh_eth_interrupt(), mask the
      interrupt status from EESR register with the interrupt mask from EESIPR register
      in order not to handle the disabled interrupts -- but forcing EESIPR.M_ECI bit
      in this mask set because we always need to fully handle EESR.ECI interrupt in
      sh_eth_error() in order to quench it (as it doesn't get cleared by just writing
      1 to the this bit as all the other interrupts).
      
      While at it, remove unneeded initializer for 'intr_status' variable and give it
      *unsigned long* type, matching the type of sh_eth_read()'s result; fix comment.
      Signed-off-by: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Reviewed-by: default avatarMax Filippov <max.filippov@cogentembedded.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3893b273
    • Sergei Shtylyov's avatar
      sh_eth: fix handling of no LINK signal · 1e1b812b
      Sergei Shtylyov authored
      The code handling the absent LINK signal (or the absent PSR register -- which
      reflects the state of this signal) is quite naive and has probably never really
      worked.  It's probably enough to say that this code is executed only on the LINK
      change interrupt (sic!) but even if we actually have the signal and choose to
      ignore it (it might be connected to PHY's link/activity LED output as on the
      Renesas BOCK-W board), sh_eth_adjust_link() on which this code relies to update
      'mdp->link' gets executed later than the LINK change interrupt where it is
      checked, and so RX/TX never get enabled via ECMR register.
      
      So, ignore the LINK changed interrupt iff LINK signal is absent (or just chosen
      not to be used) or PSR register is absent, and enable/disable RX/TX directly in
      sh_eth_adjust_link() in this case.
      Signed-off-by: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1e1b812b