1. 30 11月, 2013 1 次提交
  2. 28 11月, 2013 1 次提交
    • R
      ATA: Fix port removal ordering · c5700766
      Rafael J. Wysocki 提交于
      After commit bcdde7e2 (sysfs: make __sysfs_remove_dir() recursive)
      Mika Westerberg sees traces analogous to the one below in Thunderbolt
      hot-remove testing:
      
       WARNING: CPU: 0 PID: 4 at fs/sysfs/group.c:214 sysfs_remove_group+0xc6/0xd0()
       sysfs group ffffffff81c6f1e0 not found for kobject 'host7'
       Modules linked in:
       CPU: 0 PID: 4 Comm: kworker/0:0 Not tainted 3.12.0+ #13
       Hardware name:                  /D33217CK, BIOS GKPPT10H.86A.0042.2013.0422.1439 04/22/2013
       Workqueue: kacpi_hotplug acpi_hotplug_work_fn
        0000000000000009 ffff8801002459b0 ffffffff817daab1 ffff8801002459f8
        ffff8801002459e8 ffffffff810436b8 0000000000000000 ffffffff81c6f1e0
        ffff88006d440358 ffff88006d440188 ffff88006e8b4c28 ffff880100245a48
       Call Trace:
        [<ffffffff817daab1>] dump_stack+0x45/0x56
        [<ffffffff810436b8>] warn_slowpath_common+0x78/0xa0
        [<ffffffff81043727>] warn_slowpath_fmt+0x47/0x50
        [<ffffffff811ad319>] ? sysfs_get_dirent_ns+0x49/0x70
        [<ffffffff811ae526>] sysfs_remove_group+0xc6/0xd0
        [<ffffffff81432f7e>] dpm_sysfs_remove+0x3e/0x50
        [<ffffffff8142a0d0>] device_del+0x40/0x1b0
        [<ffffffff8142a24d>] device_unregister+0xd/0x20
        [<ffffffff8144131a>] scsi_remove_host+0xba/0x110
        [<ffffffff8145f526>] ata_host_detach+0xc6/0x100
        [<ffffffff8145f578>] ata_pci_remove_one+0x18/0x20
        [<ffffffff812e8f48>] pci_device_remove+0x28/0x60
        [<ffffffff8142d854>] __device_release_driver+0x64/0xd0
        [<ffffffff8142d8de>] device_release_driver+0x1e/0x30
        [<ffffffff8142d257>] bus_remove_device+0xf7/0x140
        [<ffffffff8142a1b1>] device_del+0x121/0x1b0
        [<ffffffff812e43d4>] pci_stop_bus_device+0x94/0xa0
        [<ffffffff812e437b>] pci_stop_bus_device+0x3b/0xa0
        [<ffffffff812e437b>] pci_stop_bus_device+0x3b/0xa0
        [<ffffffff812e44dd>] pci_stop_and_remove_bus_device+0xd/0x20
        [<ffffffff812fc743>] trim_stale_devices+0x73/0xe0
        [<ffffffff812fc78b>] trim_stale_devices+0xbb/0xe0
        [<ffffffff812fc78b>] trim_stale_devices+0xbb/0xe0
        [<ffffffff812fcb6e>] acpiphp_check_bridge+0x7e/0xd0
        [<ffffffff812fd90d>] hotplug_event+0xcd/0x160
        [<ffffffff812fd9c5>] hotplug_event_work+0x25/0x60
        [<ffffffff81316749>] acpi_hotplug_work_fn+0x17/0x22
        [<ffffffff8105cf3a>] process_one_work+0x17a/0x430
        [<ffffffff8105db29>] worker_thread+0x119/0x390
        [<ffffffff8105da10>] ? manage_workers.isra.25+0x2a0/0x2a0
        [<ffffffff81063a5d>] kthread+0xcd/0xf0
        [<ffffffff81063990>] ? kthread_create_on_node+0x180/0x180
        [<ffffffff817eb33c>] ret_from_fork+0x7c/0xb0
        [<ffffffff81063990>] ? kthread_create_on_node+0x180/0x180
      
      The source of this problem is that SCSI hosts are removed from
      ATA ports after calling ata_tport_delete() which removes the
      port's sysfs directory, among other things.  Now, after commit
      bcdde7e2, the sysfs directory is removed along with all of
      its subdirectories that include the SCSI host's sysfs directory
      and its subdirectories at this point.  Consequently, when
      device_del() is finally called for any child device of the SCSI
      host and tries to remove its "power" group (which is already
      gone then), it triggers the above warning.
      
      To make the warnings go away, change the removal ordering in
      ata_port_detach() so that the SCSI host is removed from the
      port before ata_tport_delete() is called.
      
      References: https://bugzilla.kernel.org/show_bug.cgi?id=65281Reported-and-tested-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Tested-by: NJingoo Han <jg1.han@samsung.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      c5700766
  3. 28 10月, 2013 1 次提交
    • S
      drivers/libata: Set max sector to 65535 for Slimtype DVD A DS8A9SH drive · 0523f037
      Shan Hai 提交于
      The "Slimtype DVD A  DS8A9SH" drive locks up with following backtrace when
      the max sector is smaller than 65535 bytes, fix it by adding a quirk to set
      the max sector to 65535 bytes.
      
      INFO: task flush-11:0:663 blocked for more than 120 seconds.
      "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
      flush-11:0    D 00000000ffff5ceb     0   663      2 0x00000000
       ffff88026d3b1710 0000000000000046 0000000000000001 0000000000000000
       ffff88026f2530c0 ffff88026d365860 ffff88026d3b16e0 ffffffff812ffd52
       ffff88026d4fd3d0 0000000100000001 ffff88026d3b16f0 ffff88026d3b1fd8
      Call Trace:
       [<ffffffff812ffd52>] ? cfq_may_queue+0x52/0xf0
       [<ffffffff81604338>] schedule+0x18/0x30
       [<ffffffff81604392>] io_schedule+0x42/0x60
       [<ffffffff812f22bb>] get_request_wait+0xeb/0x1f0
       [<ffffffff81065660>] ? autoremove_wake_function+0x0/0x40
       [<ffffffff812eb382>] ? elv_merge+0x42/0x210
       [<ffffffff812f26ae>] __make_request+0x8e/0x4e0
       [<ffffffff812f068e>] generic_make_request+0x21e/0x5e0
       [<ffffffff812f0aad>] submit_bio+0x5d/0xd0
       [<ffffffff81141422>] submit_bh+0xf2/0x130
       [<ffffffff8114474c>] __block_write_full_page+0x1dc/0x3a0
       [<ffffffff81143f60>] ? end_buffer_async_write+0x0/0x120
       [<ffffffff811474e0>] ? blkdev_get_block+0x0/0x70
       [<ffffffff811474e0>] ? blkdev_get_block+0x0/0x70
       [<ffffffff81143f60>] ? end_buffer_async_write+0x0/0x120
       [<ffffffff811449ee>] block_write_full_page_endio+0xde/0x100
       [<ffffffff81144a20>] block_write_full_page+0x10/0x20
       [<ffffffff81148703>] blkdev_writepage+0x13/0x20
       [<ffffffff810d7525>] __writepage+0x15/0x40
       [<ffffffff810d7c0f>] write_cache_pages+0x1cf/0x3e0
       [<ffffffff810d7510>] ? __writepage+0x0/0x40
       [<ffffffff810d7e42>] generic_writepages+0x22/0x30
       [<ffffffff810d7e6f>] do_writepages+0x1f/0x40
       [<ffffffff8113ae67>] writeback_single_inode+0xe7/0x3b0
       [<ffffffff8113b574>] writeback_sb_inodes+0x184/0x280
       [<ffffffff8113bedb>] writeback_inodes_wb+0x6b/0x1a0
       [<ffffffff8113c24b>] wb_writeback+0x23b/0x2a0
       [<ffffffff8113c42d>] wb_do_writeback+0x17d/0x190
       [<ffffffff8113c48b>] bdi_writeback_task+0x4b/0xe0
       [<ffffffff810e82a0>] ? bdi_start_fn+0x0/0x100
       [<ffffffff810e8321>] bdi_start_fn+0x81/0x100
       [<ffffffff810e82a0>] ? bdi_start_fn+0x0/0x100
       [<ffffffff8106522e>] kthread+0x8e/0xa0
       [<ffffffff81039274>] ? finish_task_switch+0x54/0xc0
       [<ffffffff81003334>] kernel_thread_helper+0x4/0x10
       [<ffffffff810651a0>] ? kthread+0x0/0xa0
       [<ffffffff81003330>] ? kernel_thread_helper+0x0/0x10
      
       The above trace was triggered by
         "dd if=/dev/zero of=/dev/sr0 bs=2048 count=32768"
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NShan Hai <shan.hai@windriver.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      0523f037
  4. 03 9月, 2013 1 次提交
  5. 25 8月, 2013 2 次提交
  6. 24 8月, 2013 1 次提交
    • A
      ata: acpi: rework the ata acpi bind support · f1bc1e4c
      Aaron Lu 提交于
      Binding ACPI handle to SCSI device has several drawbacks, namely:
      1 During ATA device initialization time, ACPI handle will be needed
        while SCSI devices are not created yet. So each time ACPI handle is
        needed, instead of retrieving the handle by ACPI_HANDLE macro,
        a namespace scan is performed to find the handle for the corresponding
        ATA device. This is inefficient, and also expose a restriction on
        calling path not holding any lock.
      2 The binding to SCSI device tree makes code complex, while at the same
        time doesn't bring us any benefit. All ACPI handlings are still done
        in ATA module, not in SCSI.
      
      Rework the ATA ACPI binding code to bind ACPI handle to ATA transport
      devices(ATA port and ATA device). The binding needs to be done only once,
      since the ATA transport devices do not go away with hotplug. And due to
      this, the flush_work call in hotplug handler for ATA bay is no longer
      needed.
      
      Tested on an Intel test platform for binding and runtime power off for
      ODD(ZPODD) and hard disk; on an ASUS S400C for binding and normal boot
      and S3, where its SATA port node has _SDD and _GTF control methods when
      configured as an AHCI controller and its PATA device node has _GTF
      control method when configured as an IDE controller. SATA PMP binding
      and ATA hotplug is not tested.
      Signed-off-by: NAaron Lu <aaron.lu@intel.com>
      Tested-by: NDirk Griesbach <spamthis@freenet.de>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      f1bc1e4c
  7. 25 6月, 2013 1 次提交
    • A
      libata-acpi: add back ACPI based hotplug functionality · 44521527
      Aaron Lu 提交于
      Commit 30dcf76a "libata: migrate ACPI code over to new bindings"
      mistakenly dropped the code to register hotplug notificaion handler
      for ATA port/devices, causing regression for people using ATA bay,
      as kernel bug #59871 shows.
      
      Fix this by adding back the hotplug notification handler registration
      code.  Since this code has to be run once and notification needs to
      be installed on every ATA port/devices handle no matter if there is
      actual device attached, we can't do this in binding time for ATA
      device ACPI handle, as the binding only occurs when a SCSI device is
      created, i.e. there is device attached.  So introduce the
      ata_acpi_hotplug_init() function to loop scan all ATA ACPI handles
      and if it is available, install the notificaion handler for it during
      ATA init time.
      
      With the ATA ACPI handle binding to SCSI device tree, it is possible
      now that when the SCSI hotplug work removes the SCSI device, the ACPI
      unbind function will find that the corresponding ACPI device has
      already been deleted by dock driver, causing a scaring message like:
      [  128.263966] scsi 4:0:0:0: Oops, 'acpi_handle' corrupt
      Fix this by waiting for SCSI hotplug task finish in our notificaion
      handler, so that the removal of ACPI device done in ACPI unbind
      function triggered by the removal of SCSI device is run earlier when
      ACPI device is still available.
      
      [rjw: Rebased]
      References: https://bugzilla.kernel.org/show_bug.cgi?id=59871Reported-bisected-and-tested-by: NDirk Griesbach <spamthis@freenet.de>
      Signed-off-by: NAaron Lu <aaron.lu@intel.com>
      Acked-by: NTejun Heo <tj@kernel.org>
      Cc: 3.6+ <stable@vger.kernel.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      44521527
  8. 04 6月, 2013 1 次提交
  9. 22 5月, 2013 2 次提交
    • V
      libata: Add atapi_dmadir force flag · 966fbe19
      Vincent Pelletier 提交于
      Some device require DMADIR to be enabled, but are not detected as such
      by atapi_id_dmadir.  One such example is "Asus Serillel 2"
      SATA-host-to-PATA-device bridge: the bridge itself requires DMADIR,
      even if the bridged device does not.
      
      As atapi_dmadir module parameter can cause problems with some devices
      (as per Tejun Heo's memory), enabling it globally may not be possible
      depending on the hardware.
      
      This patch adds atapi_dmadir in the form of a "force" horkage value,
      allowing global, per-bus and per-device control.
      Signed-off-by: NVincent Pelletier <plr.vincent@gmail.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      966fbe19
    • 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
  10. 15 5月, 2013 2 次提交
    • D
      libata: export ata_port port_no attribute via /sys · e628dc99
      David Milburn 提交于
      While registering host controller track port number based upon number
      of ports available on the controller, export port_no attribute through
      /sys. This patch is needed by udev for composing persistent links in
      /dev/disk/by-path.
      
      /sys/devices/pci0000:00/0000:00:1f.2/ata8/ata_port/ata8
      total 0
      lrwxrwxrwx. 1 root root    0 Mar  6 12:43 device -> ../../../ata8
      -r--r--r--. 1 root root 4096 Mar  6 12:43 idle_irq
      -r--r--r--. 1 root root 4096 Mar  6 12:43 nr_pmp_links
      -r--r--r--. 1 root root 4096 Mar  6 12:43 port_no
      drwxr-xr-x. 2 root root    0 Mar  6 12:42 power
      lrwxrwxrwx. 1 root root    0 Mar  6 12:41 subsystem -> ../../../../../../class/ata_port
      -rw-r--r--. 1 root root 4096 Mar  6 12:40 uevent
      1
      Signed-off-by: NDavid Milburn <dmilburn@redhat.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      e628dc99
    • T
      libata: update "Maintained by:" tags · 8c3d3d4b
      Tejun Heo 提交于
      Jeff moved on to a greener pasture.
      
       s/Maintained by: Jeff Garzik/Maintained by: Tejun Heo/g
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Jeff Garzik <jgarzik@pobox.com>
      8c3d3d4b
  11. 04 4月, 2013 2 次提交
    • 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
    • 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
  12. 26 1月, 2013 3 次提交
    • A
      [libata] PM code cleanup for ata port · f5e6d0d0
      Aaron Lu 提交于
      For system freeze, if the port is already runtime suspended, leave it
      alone and just return. The port will be resumed on thaw before it will
      be used.
      
      And since we will call get_noresume for every device during prepare
      phase, and the port is resumed during thaw phase, it can't be in runtime
      suspended state during the poweroff phase. So remove the
      runtime_suspended check in poweroff callback.
      
      And for all suspend(freeze/suspend/poweroff/etc.), there is no need to
      touch the device, so set no_autopsy and no_recovery for them all.
      Signed-off-by: NAaron Lu <aaron.lu@intel.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      f5e6d0d0
    • A
      [libata] pm: differentiate system and runtime pm for ata port · a7ff60db
      Aaron Lu 提交于
      We need to do different things for system PM and runtime PM, e.g. we do
      not need to enable runtime wake for ZPODD when we are doing system
      suspend, etc.
      
      Currently, we use PMSG_SUSPEND for both system suspend and runtime
      suspend and PMSG_ON for both system resume and runtime resume. Change
      this by using PMSG_AUTO_SUSPEND for runtime suspend and PMSG_AUTO_RESUME
      for runtime resume. And since PMSG_ON means no transition, it is changed
      to PMSG_RESUME for ata port's system resume.
      
      The ata_acpi_set_state is modified accordingly, and the sata case and
      pata case is seperated for easy reading.
      Signed-off-by: NAaron Lu <aaron.lu@intel.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      a7ff60db
    • J
      Revert "libata: export host controller number thru /sys" · e175435e
      Jeff Garzik 提交于
      This reverts commit 1757d902.
      
      Discussion continues upstream.
      e175435e
  13. 22 1月, 2013 2 次提交
    • A
      libata: do not suspend port if normal ODD is attached · 7e15e9be
      Aaron Lu 提交于
      For ODDs, the upper layer will poll for media change every few
      seconds, which will make it enter and leave suspend state very
      often. And as each suspend will also cause a hard/soft reset,
      the gain of runtime suspend is very little while the ODD may
      malfunction after constantly being reset. So the idle callback
      here will not proceed to suspend if a non-ZPODD capable ODD is
      attached to the port.
      Signed-off-by: NAaron Lu <aaron.lu@intel.com>
      Acked-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      7e15e9be
    • A
      libata: identify and init ZPODD devices · afe75951
      Aaron Lu 提交于
      The ODD can be enabled for ZPODD if the following three conditions are
      satisfied:
      1 The ODD supports device attention;
      2 The platform can runtime power off the ODD through ACPI;
      3 The ODD is either slot type or drawer type.
      For such ODDs, zpodd_init is called and a new structure is allocated for
      it to store ZPODD related stuffs.
      
      And the zpodd_dev_enabled function is used to test if ZPODD is currently
      enabled for this ODD.
      
      A new config CONFIG_SATA_ZPODD is added to selectively build ZPODD code.
      Signed-off-by: NAaron Lu <aaron.lu@intel.com>
      Acked-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      afe75951
  14. 15 1月, 2013 2 次提交
    • D
      libata: export host controller number thru /sys · 1757d902
      David Milburn 提交于
      As low-level drivers register their host controller(s), keep track
      of the number of controllers and export thru /sys in a <host.port>
      format so that udev can better match up port numbers with a
      specific controller.
      
      # pwd
      /sys/devices/pci0000:00
      # find . -name 'ata*' -print
      
      (2nd controller with port multiplier attached)
      
      ./0000:00:1e.0/0000:05:01.0/ata2.7
      ./0000:00:1e.0/0000:05:01.0/ata2.7/link7/dev7.0/ata_device
      ./0000:00:1e.0/0000:05:01.0/ata2.7/link7/ata_link
      ./0000:00:1e.0/0000:05:01.0/ata2.7/link7.0/dev7.0.0/ata_device
      ./0000:00:1e.0/0000:05:01.0/ata2.7/link7.0/ata_link
      ./0000:00:1e.0/0000:05:01.0/ata2.7/link7.1/dev7.1.0/ata_device
      ./0000:00:1e.0/0000:05:01.0/ata2.7/link7.1/ata_link
      ./0000:00:1e.0/0000:05:01.0/ata2.7/link7.2/dev7.2.0/ata_device
      ./0000:00:1e.0/0000:05:01.0/ata2.7/link7.2/ata_link
      ./0000:00:1e.0/0000:05:01.0/ata2.7/link7.3/dev7.3.0/ata_device
      ./0000:00:1e.0/0000:05:01.0/ata2.7/link7.3/ata_link
      ./0000:00:1e.0/0000:05:01.0/ata2.7/link7.4/dev7.4.0/ata_device
      ./0000:00:1e.0/0000:05:01.0/ata2.7/link7.4/ata_link
      ./0000:00:1e.0/0000:05:01.0/ata2.7/link7.5/dev7.5.0/ata_device
      ./0000:00:1e.0/0000:05:01.0/ata2.7/link7.5/ata_link
      ./0000:00:1e.0/0000:05:01.0/ata2.7/link7.6/dev7.6.0/ata_device
      ./0000:00:1e.0/0000:05:01.0/ata2.7/link7.6/ata_link
      ./0000:00:1e.0/0000:05:01.0/ata2.7/link7.7/dev7.7.0/ata_device
      ./0000:00:1e.0/0000:05:01.0/ata2.7/link7.7/ata_link
      ./0000:00:1e.0/0000:05:01.0/ata2.7/link7.8/dev7.8.0/ata_device
      ./0000:00:1e.0/0000:05:01.0/ata2.7/link7.8/ata_link
      ./0000:00:1e.0/0000:05:01.0/ata2.7/link7.9/dev7.9.0/ata_device
      ./0000:00:1e.0/0000:05:01.0/ata2.7/link7.9/ata_link
      ./0000:00:1e.0/0000:05:01.0/ata2.7/ata_port
      ./0000:00:1e.0/0000:05:01.0/ata2.7/ata_port/ata2.7
      ./0000:00:1e.0/0000:05:01.0/ata2.7/link7.10/dev7.10.0/ata_device
      ./0000:00:1e.0/0000:05:01.0/ata2.7/link7.10/ata_link
      ./0000:00:1e.0/0000:05:01.0/ata2.7/link7.11/dev7.11.0/ata_device
      ./0000:00:1e.0/0000:05:01.0/ata2.7/link7.11/ata_link
      ./0000:00:1e.0/0000:05:01.0/ata2.7/link7.12/dev7.12.0/ata_device
      ./0000:00:1e.0/0000:05:01.0/ata2.7/link7.12/ata_link
      ./0000:00:1e.0/0000:05:01.0/ata2.7/link7.13/dev7.13.0/ata_device
      ./0000:00:1e.0/0000:05:01.0/ata2.7/link7.13/ata_link
      ./0000:00:1e.0/0000:05:01.0/ata2.7/link7.14/dev7.14.0/ata_device
      ./0000:00:1e.0/0000:05:01.0/ata2.7/link7.14/ata_link
      ./0000:00:1e.0/0000:05:01.0/ata2.8
      ./0000:00:1e.0/0000:05:01.0/ata2.8/link8/dev8.0/ata_device
      ./0000:00:1e.0/0000:05:01.0/ata2.8/link8/ata_link
      ./0000:00:1e.0/0000:05:01.0/ata2.8/ata_port
      ./0000:00:1e.0/0000:05:01.0/ata2.8/ata_port/ata2.8
      
      (1st controller)
      
      ./0000:00:1f.2/ata1.1
      ./0000:00:1f.2/ata1.1/link1/dev1.0/ata_device
      ./0000:00:1f.2/ata1.1/link1/ata_link
      ./0000:00:1f.2/ata1.1/ata_port
      ./0000:00:1f.2/ata1.1/ata_port/ata1.1
      ./0000:00:1f.2/ata1.2
      ./0000:00:1f.2/ata1.2/link2/dev2.0/ata_device
      ./0000:00:1f.2/ata1.2/link2/ata_link
      ./0000:00:1f.2/ata1.2/ata_port
      ./0000:00:1f.2/ata1.2/ata_port/ata1.2
      ./0000:00:1f.2/ata1.3
      ./0000:00:1f.2/ata1.3/link3/dev3.0/ata_device
      ./0000:00:1f.2/ata1.3/link3/ata_link
      ./0000:00:1f.2/ata1.3/ata_port
      ./0000:00:1f.2/ata1.3/ata_port/ata1.3
      ./0000:00:1f.2/ata1.4
      ./0000:00:1f.2/ata1.4/link4/dev4.0/ata_device
      ./0000:00:1f.2/ata1.4/link4/ata_link
      ./0000:00:1f.2/ata1.4/ata_port
      ./0000:00:1f.2/ata1.4/ata_port/ata1.4
      ./0000:00:1f.2/ata1.5
      ./0000:00:1f.2/ata1.5/link5/dev5.0/ata_device
      ./0000:00:1f.2/ata1.5/link5/ata_link
      ./0000:00:1f.2/ata1.5/ata_port
      ./0000:00:1f.2/ata1.5/ata_port/ata1.5
      ./0000:00:1f.2/ata1.6
      ./0000:00:1f.2/ata1.6/link6/dev6.0/ata_device
      ./0000:00:1f.2/ata1.6/link6/ata_link
      ./0000:00:1f.2/ata1.6/ata_port
      ./0000:00:1f.2/ata1.6/ata_port/ata1.6
      Signed-off-by: NDavid Milburn <dmilburn@redhat.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      1757d902
    • S
      [libata] replace sata_settings with devslp_timing · 803739d2
      Shane Huang 提交于
      NCQ capability was used to check availability of SATA Settings page
      from Identify Device Data Log, which contains DevSlp timing variables.
      It does not work on some HDDs and leads to error messages.
      
      IDENTIFY word 78 bit 5(Hardware Feature Control) can't work either
      because it is only the sufficient condition of Identify Device data
      log, not the necessary condition.
      
      This patch replaced ata_device->sata_settings with ->devslp_timing
      to only save DevSlp timing variables(8 bytes), instead of the whole
      SATA Settings page(512 bytes).
      
      Addresses https://bugzilla.kernel.org/show_bug.cgi?id=51881Reported-by: NBorislav Petkov <bp@alien8.de>
      Signed-off-by: NShane Huang <shane.huang@amd.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      803739d2
  15. 14 12月, 2012 1 次提交
    • J
      Revert "libata: check SATA_SETTINGS log with HW Feature Ctrl" · 8349e5ae
      Jeff Garzik 提交于
      This reverts commit de90cd71.
      
      Shane Huang writes:
      
        Please suspend this patch because I just received two new
        DevSlp drives but found word 78 bit 5 is _not_ set.
      
        I'm checking with the drive vendor whether he gave me
        the wrong information. If bit 5 is not the necessary and
        sufficient condition, I will implement another patch to
        replace ata_device->sata_settings into ->devslp_timing.
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      8349e5ae
  16. 04 12月, 2012 1 次提交
  17. 03 12月, 2012 3 次提交
  18. 16 11月, 2012 1 次提交
  19. 13 9月, 2012 4 次提交
  20. 25 8月, 2012 1 次提交
  21. 24 8月, 2012 3 次提交
  22. 18 8月, 2012 2 次提交
    • Z
      libata: enable SATA disk fua detection on default · 91895b78
      Zheng Liu 提交于
      Currently, SATA disk fua detection is disabled on default because most of
      devices don't support this feature at that time.  With the development of
      technology, more and more SATA disks support this feature.  So now we can enable
      this detection on default.
      
      Although fua detection is defined as a kernel module parameter, it is too hard
      to set its value because it must be loaded and set before system starts up.
      That needs to modify initrd file.  So it is inconvenient for administrator who
      needs to manage a huge number of servers.
      Signed-off-by: NZheng Liu <wenqing.lz@taobao.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      91895b78
    • J
      [libata] new quirk, lift bridge limits for Buffalo DriveStation Quattro · 04d0f1b8
      Jeff Garzik 提交于
      Michael Eitelwein writes:
      
      I have an external SATA drive that was slowed down by bridge limits. I
      found a solution in a thread on this list posted in 2008: It introduces
      whitelist entries in libata-core.c for devices with well working bridges
      (e.g. email on Fri, 31 Oct 2008 01:45:27 -0400).
      
      I added my device to this whitelist in a custom built kernel and it
      works fine for weeks now. How can I have this device added on the
      whitelist within the official kernel? Is this whitelist mechanism still
      supported or is there a smarter way to achieve whitelisting?
      
      I added the following whitelist entry for my Buffalo DriveStation
      Quattro "BUFFALO HD-QSU2/R5":
      
              /* Devices that do not need bridging limits applied */
              { "MTRON MSP-SATA*",            NULL,   ATA_HORKAGE_BRIDGE_OK, },
              { "BUFFALO HD-QSU2/R5",         NULL,   ATA_HORKAGE_BRIDGE_OK, },
      Reported-by: NMichael Eitelwein <michael@eitelwein.net>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      04d0f1b8
  23. 26 7月, 2012 1 次提交
  24. 20 7月, 2012 1 次提交