1. 25 8月, 2013 3 次提交
  2. 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
  3. 16 7月, 2013 1 次提交
  4. 07 6月, 2013 1 次提交
  5. 22 5月, 2013 1 次提交
    • 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
  6. 15 5月, 2013 1 次提交
    • 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
  7. 04 4月, 2013 1 次提交
    • 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
  8. 26 1月, 2013 1 次提交
  9. 22 1月, 2013 1 次提交
    • 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
  10. 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
  11. 03 12月, 2012 2 次提交
  12. 13 9月, 2012 1 次提交
    • S
      ahci: implement aggressive SATA device sleep support · 65fe1f0f
      Shane Huang 提交于
      Device Sleep is a feature as described in AHCI 1.3.1 Technical Proposal.
      This feature enables an HBA and SATA storage device to enter the DevSleep
      interface state, enabling lower power SATA-based systems.
      
      Aggressive Device Sleep enables the HBA to assert the DEVSLP signal as
      soon as there are no commands outstanding to the device and the port
      specific Device Sleep idle timer has expired. This enables autonomous
      entry into the DevSleep interface state without waiting for software
      in power sensitive systems.
      
      This patch enables Aggressive Device Sleep only if both host controller
      and device support it.
      
      Tested on AMD reference board together with Device Sleep supported device
      sample.
      Signed-off-by: NShane Huang <shane.huang@amd.com>
      Reviewed-by: NAaron Lu <aaron.lwe@gmail.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      65fe1f0f
  13. 24 8月, 2012 3 次提交
  14. 20 7月, 2012 1 次提交
  15. 29 6月, 2012 2 次提交
  16. 08 5月, 2012 1 次提交
  17. 23 4月, 2012 1 次提交
    • D
      [SCSI] libsas, libata: fix start of life for a sas ata_port · b2024459
      Dan Williams 提交于
      This changes the ordering of initialization and probing events from:
        1/ allocate rphy in PORTE_BYTES_DMAED, DISCE_REVALIDATE_DOMAIN
        2/ allocate ata_port and schedule port probe in DISCE_PROBE
      ...to:
        1/ allocate ata_port in PORTE_BYTES_DMAED, DISCE_REVALIDATE_DOMAIN
        2/ allocate rphy in PORTE_BYTES_DMAED, DISCE_REVALIDATE_DOMAIN
        3/ schedule port probe in DISCE_PROBE
      
      This ordering prevents PHYE_SIGNAL_LOSS_EVENTS from sneaking in to
      destrory ata devices before they have been fully initialized:
      
        BUG: unable to handle kernel paging request at 0000000000003b10
        IP: [<ffffffffa0053d7e>] sas_ata_end_eh+0x12/0x5e [libsas]
        ...
        [<ffffffffa004d1af>] sas_unregister_common_dev+0x78/0xc9 [libsas]
        [<ffffffffa004d4d4>] sas_unregister_dev+0x4f/0xad [libsas]
        [<ffffffffa004d5b1>] sas_unregister_domain_devices+0x7f/0xbf [libsas]
        [<ffffffffa004c487>] sas_deform_port+0x61/0x1b8 [libsas]
        [<ffffffffa004bed0>] sas_phye_loss_of_signal+0x29/0x2b [libsas]
      
      ...and kills the awkward "sata domain_device briefly existing in the
      domain without an ata_port" state.
      Reported-by: NMichal Kosciowski <michal.kosciowski@intel.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Acked-by: NJeff Garzik <jgarzik@redhat.com>
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      b2024459
  18. 01 3月, 2012 1 次提交
  19. 20 2月, 2012 1 次提交
    • D
      [SCSI] libsas: execute transport link resets with libata-eh via host workqueue · 81c757bc
      Dan Williams 提交于
      Link resets leave ata affiliations intact, so arrange for libsas to make
      an effort to avoid dropping the device due to a slow-to-recover link.
      Towards this end carry out reset in the host workqueue so that it can
      check for ata devices and kick the reset request to libata.  Hard
      resets, in contrast, bypass libata since they are meant for associating
      an ata device with another initiator in the domain (tears down
      affiliations).
      
      Need to add a new transport_sas_phy_reset() since the current
      sas_phy_reset() is a utility function to libsas lldds.  They are not
      prepared for it to loop back into eh.
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      81c757bc
  20. 01 11月, 2011 1 次提交
  21. 03 10月, 2011 1 次提交
  22. 24 7月, 2011 2 次提交
    • J
      ata: Add and use ata_print_version_once · 06296a1e
      Joe Perches 提交于
      Use a single mechanism to show driver version.
      Reduces text a tiny bit too.
      
      Remove uses of static int printed_version
      Add and use ata_print_version(const struct device *, const char *ver)
      and ata_print_version_once.
      
      $ size drivers/ata/built-in.*
         text	   data	    bss	    dec	    hex	filename
       544969	  73893	 116584	 735446	  b38d6	drivers/ata/built-in.allyesconfig.ata.o
       543870	  73893	 116592	 734355	  b34ad	drivers/ata/built-in.allyesconfig.print_once.o
       141328	  14689	   4220	 160237	  271ed	drivers/ata/built-in.defconfig.ata.o
       141212	  14689	   4220	 160121	  27179	drivers/ata/built-in.defconfig.print_once.o
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NJeff Garzik <jgarzik@pobox.com>
      06296a1e
    • J
      ata: Convert ata_<foo>_printk(KERN_<LEVEL> to ata_<foo>_<level> · a9a79dfe
      Joe Perches 提交于
      Saves text by removing nearly duplicated text format strings by
      creating ata_<foo>_printk functions and printf extension %pV.
      
      ata defconfig size shrinks ~5% (~8KB), allyesconfig ~2.5% (~13KB)
      
      Format string duplication comes from:
      
       #define ata_link_printk(link, lv, fmt, args...) do { \
             if (sata_pmp_attached((link)->ap) || (link)->ap->slave_link)    \
                     printk("%sata%u.%02u: "fmt, lv, (link)->ap->print_id,   \
                            (link)->pmp , ##args); \
             else \
                     printk("%sata%u: "fmt, lv, (link)->ap->print_id , ##args); \
             } while(0)
      
      Coalesce long formats.
      
      $ size drivers/ata/built-in.*
         text	   data	    bss	    dec	    hex	filename
       544969	  73893	 116584	 735446	  b38d6	drivers/ata/built-in.allyesconfig.ata.o
       558429	  73893	 117864	 750186	  b726a	drivers/ata/built-in.allyesconfig.dev_level.o
       141328	  14689	   4220	 160237	  271ed	drivers/ata/built-in.defconfig.ata.o
       149567	  14689	   4220	 168476	  2921c	drivers/ata/built-in.defconfig.dev_level.o
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NJeff Garzik <jgarzik@pobox.com>
      a9a79dfe
  23. 20 5月, 2011 1 次提交
  24. 24 4月, 2011 2 次提交
  25. 31 3月, 2011 1 次提交
  26. 14 3月, 2011 1 次提交
  27. 02 3月, 2011 5 次提交