1. 11 6月, 2013 1 次提交
  2. 02 6月, 2013 1 次提交
    • S
      sata_rcar: fix interrupt handling · 52a2a108
      Sergei Shtylyov 提交于
      The driver's interrupt handling code is too picky in deciding whether it should
      handle an interrupt or not which causes completely unneeded spurious interrupts.
      Thus make sata_rcar_{ata|serr}_interrupt() *void*; add ATA status register read
      to sata_rcar_ata_interrupt() to clear an unexpected ATA interrupt -- it doesn't
      get cleared by writing to the SATAINTSTAT register in the interrupt mode we use.
      
      Also, in sata_rcar_ata_interrupt() we should check SATAINTSTAT register only for
      enabled interrupts and we should clear  only those interrupts  that we have read
      as active first time around, because else we have  a  race and risk clearing  an
      interrupt that  can  occur between read  and write of the  SATAINTSTAT  register
      and never registering it...
      Signed-off-by: NSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: stable@vger.kernel.org
      52a2a108
  3. 29 5月, 2013 1 次提交
  4. 22 5月, 2013 2 次提交
    • S
      sata_rcar: clear STOP bit in bmdma_start() method · df7e131f
      Sergei Shtylyov 提交于
      Iff bmdma_setup() has to stop a DMA transfer before starting a new
      one, then the STOP bit in the ATAPI_CONTROL1 register will remain set
      (it's only cleared when setting the START bit to 1) and then
      bmdma_start() method will set both START and STOP bits simultaneously
      which should abort the transfer being just started.  Avoid that by
      explicitly clearing the STOP bit in bmdma_start() method (in this case
      it will be ignored on write).
      Signed-off-by: NSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: stable@vger.kernel.org
      df7e131f
    • V
      libata: make ata_exec_internal_sg honor DMADIR · e771451c
      Vincent Pelletier 提交于
      libata honors DMADIR for regular commands, but not for internal commands
      used (among other) during device initialisation.
      
      This makes SATA-host-to-PATA-device bridges based on Silicon Image SiL3611
      (such as "Abit Serillel 2") end up disabled when used with an ATAPI device
      after a few tries.
      
      Log output of the bridge being hot-plugged with an ATAPI drive:
      
        [ 9631.212901] ata1: exception Emask 0x10 SAct 0x0 SErr 0x40c0000 action 0xe frozen
        [ 9631.212913] ata1: irq_stat 0x00000040, connection status changed
        [ 9631.212923] ata1: SError: { CommWake 10B8B DevExch }
        [ 9631.212939] ata1: hard resetting link
        [ 9632.104962] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
        [ 9632.106393] ata1.00: ATAPI: PIONEER DVD-RW  DVR-115, 1.06, max UDMA/33
        [ 9632.106407] ata1.00: applying bridge limits
        [ 9632.108151] ata1.00: configured for UDMA/33
        [ 9637.105303] ata1.00: qc timeout (cmd 0xa0)
        [ 9637.105324] ata1.00: failed to clear UNIT ATTENTION (err_mask=0x5)
        [ 9637.105335] ata1: hard resetting link
        [ 9638.044599] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
        [ 9638.047878] ata1.00: configured for UDMA/33
        [ 9643.044933] ata1.00: qc timeout (cmd 0xa0)
        [ 9643.044953] ata1.00: failed to clear UNIT ATTENTION (err_mask=0x5)
        [ 9643.044963] ata1: limiting SATA link speed to 1.5 Gbps
        [ 9643.044971] ata1.00: limiting speed to UDMA/33:PIO3
        [ 9643.044979] ata1: hard resetting link
        [ 9643.984225] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
        [ 9643.987471] ata1.00: configured for UDMA/33
        [ 9648.984591] ata1.00: qc timeout (cmd 0xa0)
        [ 9648.984612] ata1.00: failed to clear UNIT ATTENTION (err_mask=0x5)
        [ 9648.984619] ata1.00: disabled
        [ 9649.000593] ata1: hard resetting link
        [ 9649.939902] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
        [ 9649.955864] ata1: EH complete
      
      With this patch, the drive enumerates correctly when libata is loaded with
      atapi_dmadir=1:
      
        [ 9891.810863] ata1: exception Emask 0x10 SAct 0x0 SErr 0x40c0000 action 0xe frozen
        [ 9891.810874] ata1: irq_stat 0x00000040, connection status changed
        [ 9891.810884] ata1: SError: { CommWake 10B8B DevExch }
        [ 9891.810900] ata1: hard resetting link
        [ 9892.762105] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
        [ 9892.763544] ata1.00: ATAPI: PIONEER DVD-RW  DVR-115, 1.06, max UDMA/33, DMADIR
        [ 9892.763558] ata1.00: applying bridge limits
        [ 9892.765393] ata1.00: configured for UDMA/33
        [ 9892.786063] ata1: EH complete
        [ 9892.792062] scsi 0:0:0:0: CD-ROM            PIONEER  DVD-RW  DVR-115  1.06 PQ: 0 ANSI: 5
        [ 9892.798455] sr2: scsi3-mmc drive: 12x/12x writer dvd-ram cd/rw xa/form2 cdda tray
        [ 9892.798837] sr 0:0:0:0: Attached scsi CD-ROM sr2
        [ 9892.799109] sr 0:0:0:0: Attached scsi generic sg6 type 5
      
      Based on a patch by Csaba Halász <csaba.halasz@gmail.com> on linux-ide:
      http://marc.info/?l=linux-ide&m=136121147832295&w=2
      
      tj: minor formatting changes.
      Signed-off-by: NVincent Pelletier <plr.vincent@gmail.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: stable@vger.kernel.org
      e771451c
  5. 17 5月, 2013 1 次提交
  6. 15 5月, 2013 1 次提交
  7. 12 5月, 2013 1 次提交
  8. 01 5月, 2013 3 次提交
    • R
      sata_highbank: Rename proc_name to the module name · 2cc1144a
      Robert Richter 提交于
      mkinitrd looks at /sys/class/scsi_host/host$hostnum/proc_name to find
      the module name of a disk driver. Current name is "highbank-ahci" but
      the module is "sata_highbank". Rename it to match the module name.
      
      Cc: Rob Herring <rob.herring@calxeda.com>
      Cc: Alexander Graf <agraf@suse.de>
      Cc: <stable@vger.kernel.org> v3.7..
      Signed-off-by: NRobert Richter <robert.richter@calxeda.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      2cc1144a
    • L
      ACPI/libata: Restore libata.noacpi support · 19ccee76
      Lv Zheng 提交于
      This patch restores libata.noacpi support to libata-acpi.c.
      There are broken optional control methods for ATA controller devices in the
      real world.  The libata.noacpi has been used for a long time as a
      workaround to deal with issues caused by the broken ASL codes.
      1. The "noacpi" option is introduced by the following commit:
         commit 11ef697b
         Date: Thu, 28 Sep 2006 11:29:01 -0700
         Subject: libata: ACPI and _GTF support
      2. The "noacpi" option is renamed to "libata_noacpi" by the following
         commit:
         commit d7d0dad6
         Date: Wed, 28 Mar 2007 01:57:37 -0400
         Subject: [libata] Disable ACPI by default; fix namespace problems
      3. Some of its logics are changed over time - becomes relying on the
         "acpi_handle" bound to the ATA devices since this commit:
         commit fafbae87
         Date: Tue, 15 May 2007 03:28:16 +0900
         Subject: libata-acpi: implement ata_acpi_associate()
      4. The option is deleted by the following commit:
         commit 30dcf76a
         Date: Mon, 25 Jun 2012 16:13:04 +0800
         Subject: libata: migrate ACPI code over to new bindings
      But the libata.noacpi setup is still left in the kernel without codes to
      implement it.  So the deletion introduces a regression to the Linux.
      This patch disables ATA_ACPI support at runtime by stopping acpi binding
      on the ATA devices to fix this regression.
      This patch is tested by booting a SATA x86-64 kernel or a PATA x86 kernel
      with or without "libata.noacpi=1" kernel command line argument.
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Signed-off-by: NAaron Lu <aaron.lu@intel.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      19ccee76
    • A
      [libata] acpi: make ata_ap_acpi_handle not block · d66af4df
      Aaron Lu 提交于
      Since commit 30dcf76a, ata_ap_acpi_handle will always do a namespace
      walk, which requires acquiring an acpi namespace mutex. This made it
      impossible to be used when calling path has held a spinlock.
      
      For example, it can occur in the following code path for pata_acpi:
      ata_scsi_queuecmd (ap->lock is acquired)
        __ata_scsi_queuecmd
          ata_scsi_translate
            ata_qc_issue
              pacpi_qc_issue
                ata_acpi_stm
                  ata_ap_acpi_handle
                    acpi_get_child
                      acpi_walk_namespace
                        acpi_ut_acquire_mutex (acquire mutex while holding lock)
      This caused scheduling while atomic bug, as reported in bug #56781.
      
      Actually, ata_ap_acpi_handle doesn't have to walk the namespace every
      time it is called, it can simply return the bound acpi handle on the
      corresponding SCSI host. The reason previously it is not done this way
      is, ata_ap_acpi_handle is used in the binding function
      ata_acpi_bind_host by ata_acpi_gtm when the handle is not bound to the
      SCSI host yet. Since we already have the ATA port's handle in its
      binding function, we can simply use it instead of calling
      ata_ap_acpi_handle there. So introduce a new function __ata_acpi_gtm,
      where it will receive an acpi handle param in addition to the ATA port
      which is solely used for debug statement. With this change, we can make
      ata_ap_acpi_handle simply return the bound handle for SCSI host instead
      of walking the acpi namespace now.
      
      Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=56781
      Reported-and-tested-by: <kenzopl@o2.pl>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAaron Lu <aaron.lu@intel.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      d66af4df
  9. 20 4月, 2013 1 次提交
    • A
      ata: arasan: remove the need for platform_data · e34d3865
      Arnd Bergmann 提交于
      This adds a complete DT binding for the arasan device driver. There is
      currently only one user, which is the spear13xx platform, so we don't
      actually have to parse all the properties until another user comes in,
      but this does use the generic DMA binding to find the DMA channel.
      
      The patch is untested so far and is part of a series to convert
      the spear platform over to use the generic DMA binding, so it
      should stay with the rest of the series.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NViresh Kumar <viresh.linux@linaro.org>
      Cc: Vinod Koul <vinod.koul@intel.com>
      Cc: Jeff Garzik <jgarzik@redhat.com>
      Cc: devicetree-discuss@lists.ozlabs.org
      e34d3865
  10. 16 4月, 2013 1 次提交
  11. 12 4月, 2013 7 次提交
  12. 10 4月, 2013 1 次提交
  13. 04 4月, 2013 10 次提交
    • Q
      fsl/sata: create a sysfs entry for rx water mark · 7551c40d
      Qiang Liu 提交于
      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: NQiang Liu <qiang.liu@freescale.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      7551c40d
    • A
      libata-acpi: remove redundent code for power resource handling · 7381fe73
      Aaron Lu 提交于
      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: NAaron Lu <aaron.lu@intel.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      7381fe73
    • J
      sata_highbank: make ahci_highbank_pm_ops static · b1a72d60
      Jingoo Han 提交于
      Make ahci_highbank_pm_ops static because ahci_highbank_pm_ops is
      not exported.
      Signed-off-by: NJingoo Han <jg1.han@samsung.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      b1a72d60
    • A
      pata_octeon_cf: Use resource_size function · b1cbe7d6
      Alexandru Gheorghiu 提交于
      Use resource_size function instead of explicit computation.
      Patch found using coccinelle.
      Signed-off-by: NAlexandru Gheorghiu <gheorghiuandru@gmail.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      b1cbe7d6
    • D
      pata_legacy: bogus clock in opti82c46x_set_piomode() · e0044c98
      Dan Carpenter 提交于
      "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: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      e0044c98
    • J
      pata_at32: use module_platform_driver_probe() · bdfa2e7e
      Jingoo Han 提交于
      This patch uses module_platform_driver_probe() macro which makes
      the code smaller and simpler.
      Signed-off-by: NJingoo Han <jg1.han@samsung.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      bdfa2e7e
    • K
      [libata] Fix HDIO_DRIVE_* ioctl() Linux 3.9 regression · 6d3bfc7b
      Krzysztof Mazur 提交于
      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: NJeff Garzik <jgarzik@redhat.com>
      6d3bfc7b
    • D
      libata: fix DMA to stack in reading devslp_timing parameters · 8e725c7f
      David Woodhouse 提交于
      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: NDavid Woodhouse <David.Woodhouse@intel.com>
      Cc: stable@kernel.org
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      8e725c7f
    • Y
      ata_piix: Fix DVD not dectected at some Haswell platforms · b55f84e2
      Youquan Song 提交于
      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: NLee, Chun-Yi <jlee@suse.com>
      Signed-off-by: NYouquan Song <youquan.song@intel.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      b55f84e2
    • S
      libata: Set max sector to 65535 for Slimtype DVD A DS8A8SH drive · a32450e1
      Shan Hai 提交于
      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: NShan Hai <shan.hai@windriver.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      a32450e1
  14. 20 3月, 2013 1 次提交
  15. 16 3月, 2013 1 次提交
  16. 05 3月, 2013 6 次提交
  17. 04 3月, 2013 1 次提交