1. 27 3月, 2020 4 次提交
  2. 30 1月, 2020 1 次提交
  3. 26 12月, 2019 1 次提交
    • S
      libata: Fix retrieving of active qcs · 8385d756
      Sascha Hauer 提交于
      ata_qc_complete_multiple() is called with a mask of the still active
      tags.
      
      mv_sata doesn't have this information directly and instead calculates
      the still active tags from the started tags (ap->qc_active) and the
      finished tags as (ap->qc_active ^ done_mask)
      
      Since 28361c40 the hw_tag and tag are no longer the same and the
      equation is no longer valid. In ata_exec_internal_sg() ap->qc_active is
      initialized as 1ULL << ATA_TAG_INTERNAL, but in hardware tag 0 is
      started and this will be in done_mask on completion. ap->qc_active ^
      done_mask becomes 0x100000000 ^ 0x1 = 0x100000001 and thus tag 0 used as
      the internal tag will never be reported as completed.
      
      This is fixed by introducing ata_qc_get_active() which returns the
      active hardware tags and calling it where appropriate.
      
      This is tested on mv_sata, but sata_fsl and sata_nv suffer from the same
      problem. There is another case in sata_nv that most likely needs fixing
      as well, but this looks a little different, so I wasn't confident enough
      to change that.
      
      Fixes: 28361c40 ("libata: add extra internal command")
      Cc: stable@vger.kernel.org
      Tested-by: NPali Rohár <pali.rohar@gmail.com>
      Signed-off-by: NSascha Hauer <s.hauer@pengutronix.de>
      
      Add missing export of ata_qc_get_active(), as per Pali.
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      8385d756
  4. 01 11月, 2019 2 次提交
    • J
      ata: make qc_prep return ata_completion_errors · 95364f36
      Jiri Slaby 提交于
      In case a driver wants to return an error from qc_prep, return enum
      ata_completion_errors. sata_mv is one of those drivers -- see the next
      patch. Other drivers return the newly defined AC_ERR_OK.
      
      [v2] use enum ata_completion_errors and AC_ERR_OK.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: linux-ide@vger.kernel.org
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      95364f36
    • J
      libata: Ensure ata_port probe has completed before detach · 130f4caf
      John Garry 提交于
      With CONFIG_DEBUG_TEST_DRIVER_REMOVE set, we may find the following WARN:
      
      [   23.452574] ------------[ cut here ]------------
      [   23.457190] WARNING: CPU: 59 PID: 1 at drivers/ata/libata-core.c:6676 ata_host_detach+0x15c/0x168
      [   23.466047] Modules linked in:
      [   23.469092] CPU: 59 PID: 1 Comm: swapper/0 Not tainted 5.4.0-rc1-00010-g5b83fd27752b-dirty #296
      [   23.477776] Hardware name: Huawei D06 /D06, BIOS Hisilicon D06 UEFI RC0 - V1.16.01 03/15/2019
      [   23.486286] pstate: a0c00009 (NzCv daif +PAN +UAO)
      [   23.491065] pc : ata_host_detach+0x15c/0x168
      [   23.495322] lr : ata_host_detach+0x88/0x168
      [   23.499491] sp : ffff800011cabb50
      [   23.502792] x29: ffff800011cabb50 x28: 0000000000000007
      [   23.508091] x27: ffff80001137f068 x26: ffff8000112c0c28
      [   23.513390] x25: 0000000000003848 x24: ffff0023ea185300
      [   23.518689] x23: 0000000000000001 x22: 00000000000014c0
      [   23.523987] x21: 0000000000013740 x20: ffff0023bdc20000
      [   23.529286] x19: 0000000000000000 x18: 0000000000000004
      [   23.534584] x17: 0000000000000001 x16: 00000000000000f0
      [   23.539883] x15: ffff0023eac13790 x14: ffff0023eb76c408
      [   23.545181] x13: 0000000000000000 x12: ffff0023eac13790
      [   23.550480] x11: ffff0023eb76c228 x10: 0000000000000000
      [   23.555779] x9 : ffff0023eac13798 x8 : 0000000040000000
      [   23.561077] x7 : 0000000000000002 x6 : 0000000000000001
      [   23.566376] x5 : 0000000000000002 x4 : 0000000000000000
      [   23.571674] x3 : ffff0023bf08a0bc x2 : 0000000000000000
      [   23.576972] x1 : 3099674201f72700 x0 : 0000000000400284
      [   23.582272] Call trace:
      [   23.584706]  ata_host_detach+0x15c/0x168
      [   23.588616]  ata_pci_remove_one+0x10/0x18
      [   23.592615]  ahci_remove_one+0x20/0x40
      [   23.596356]  pci_device_remove+0x3c/0xe0
      [   23.600267]  really_probe+0xdc/0x3e0
      [   23.603830]  driver_probe_device+0x58/0x100
      [   23.608000]  device_driver_attach+0x6c/0x90
      [   23.612169]  __driver_attach+0x84/0xc8
      [   23.615908]  bus_for_each_dev+0x74/0xc8
      [   23.619730]  driver_attach+0x20/0x28
      [   23.623292]  bus_add_driver+0x148/0x1f0
      [   23.627115]  driver_register+0x60/0x110
      [   23.630938]  __pci_register_driver+0x40/0x48
      [   23.635199]  ahci_pci_driver_init+0x20/0x28
      [   23.639372]  do_one_initcall+0x5c/0x1b0
      [   23.643199]  kernel_init_freeable+0x1a4/0x24c
      [   23.647546]  kernel_init+0x10/0x108
      [   23.651023]  ret_from_fork+0x10/0x18
      [   23.654590] ---[ end trace 634a14b675b71c13 ]---
      
      With KASAN also enabled, we may also get many use-after-free reports.
      
      The issue is that when CONFIG_DEBUG_TEST_DRIVER_REMOVE is set, we may
      attempt to detach the ata_port before it has been probed.
      
      This is because the ata_ports are async probed, meaning that there is no
      guarantee that the ata_port has probed prior to detach. When the ata_port
      does probe in this scenario, we get all sorts of issues as the detach may
      have already happened.
      
      Fix by ensuring synchronisation with async_synchronize_full(). We could
      alternatively use the cookie returned from the ata_port probe
      async_schedule() call, but that means managing the cookie, so more
      complicated.
      Signed-off-by: NJohn Garry <john.garry@huawei.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      130f4caf
  5. 03 7月, 2019 1 次提交
  6. 13 6月, 2019 1 次提交
  7. 21 5月, 2019 1 次提交
  8. 07 2月, 2019 1 次提交
  9. 04 12月, 2018 1 次提交
  10. 13 11月, 2018 1 次提交
  11. 26 10月, 2018 1 次提交
  12. 20 9月, 2018 1 次提交
  13. 28 8月, 2018 1 次提交
  14. 30 7月, 2018 1 次提交
    • S
      ata: ahci: Support state with min power but Partial low power state · a5ec5a7b
      Srinivas Pandruvada 提交于
      Currently when min_power policy is selected, the partial low power state
      is not entered and link will try aggressively enter to only slumber state.
      Add a new policy which still enable DEVSLP but also try to enter partial
      low power state. This policy is presented as "min_power_with_partial".
      
      For information the difference between partial and slumber
      Partial – PHY logic is powered up, and in a reduced power state. The link
      PM exit latency to active state maximum is 10 ns.
      Slumber – PHY logic is powered up, and in a reduced power state. The link
      PM exit latency to active state maximum is 10 ms.
      Devslp – PHY logic is powered down. The link PM exit latency from this
      state to active state maximum is 20 ms, unless otherwise specified by
      DETO.
      Suggested-and-reviewed-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      a5ec5a7b
  15. 13 7月, 2018 1 次提交
  16. 02 7月, 2018 1 次提交
    • H
      ahci: Disable LPM on Lenovo 50 series laptops with a too old BIOS · 240630e6
      Hans de Goede 提交于
      There have been several reports of LPM related hard freezes about once
      a day on multiple Lenovo 50 series models. Strange enough these reports
      where not disk model specific as LPM issues usually are and some users
      with the exact same disk + laptop where seeing them while other users
      where not seeing these issues.
      
      It turns out that enabling LPM triggers a firmware bug somewhere, which
      has been fixed in later BIOS versions.
      
      This commit adds a new ahci_broken_lpm() function and a new ATA_FLAG_NO_LPM
      for dealing with this.
      
      The ahci_broken_lpm() function contains DMI match info for the 4 models
      which are known to be affected by this and the DMI BIOS date field for
      known good BIOS versions. If the BIOS date is older then the one in the
      table LPM will be disabled and a warning will be printed.
      
      Note the BIOS dates are for known good versions, some older versions may
      work too, but we don't know for sure, the table is using dates from BIOS
      versions for which users have confirmed that upgrading to that version
      makes the problem go away.
      
      Unfortunately I've been unable to get hold of the reporter who reported
      that BIOS version 2.35 fixed the problems on the W541 for him. I've been
      able to verify the DMI_SYS_VENDOR and DMI_PRODUCT_VERSION from an older
      dmidecode, but I don't know the exact BIOS date as reported in the DMI.
      Lenovo keeps a changelog with dates in their release notes, but the
      dates there are the release dates not the build dates which are in DMI.
      So I've chosen to set the date to which we compare to one day past the
      release date of the 2.34 BIOS. I plan to fix this with a follow up
      commit once I've the necessary info.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      240630e6
  17. 20 6月, 2018 1 次提交
    • J
      scsi: libsas: dynamically allocate and free ata host · 2fa4a326
      Jason Yan 提交于
      Commit 2623c7a5 ("libata: add refcounting to ata_host") v4.17+ introduced
      refcounting to ata_host and will increase or decrease the refcount when
      adding or deleting transport ATA port.
      
      Now the ata host for libsas is embedded in domain_device, and the ->kref
      member is not initialized. Afer we add ata transport class, ata_host_get()
      will be called when adding transport ATA port and a warning will be
      triggered as below:
      
      refcount_t: increment on 0; use-after-free.
      WARNING: CPU: 2 PID: 103 at
      lib/refcount.c:153 refcount_inc+0x40/0x48 ......  Call trace:
       refcount_inc+0x40/0x48
       ata_host_get+0x10/0x18
       ata_tport_add+0x40/0x120
       ata_sas_tport_add+0xc/0x14
       sas_ata_init+0x7c/0xc8
       sas_discover_domain+0x380/0x53c
       process_one_work+0x12c/0x288
       worker_thread+0x58/0x3f0
       kthread+0xfc/0x128
       ret_from_fork+0x10/0x18
      
      And also when removing transport ATA port ata_host_put() will be called and
      another similar warning will be triggered. If the refcount decreased to
      zero, the ata host will be freed. But this ata host is only part of
      domain_device, it cannot be freed directly.
      
      So we have to change this embedded static ata host to a dynamically
      allocated ata host and initialize the ->kref member. To use ata_host_get()
      and ata_host_put() in libsas, we need to move the declaration of these
      functions to the public libata.h and export them.
      
      Fixes: b6240a4d ("scsi: libsas: add transport class for ATA devices")
      Signed-off-by: NJason Yan <yanaijie@huawei.com>
      CC: John Garry <john.garry@huawei.com>
      CC: Taras Kondratiuk <takondra@cisco.com>
      CC: Tejun Heo <tj@kernel.org>
      Acked-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      2fa4a326
  18. 13 6月, 2018 1 次提交
    • K
      treewide: kzalloc() -> kcalloc() · 6396bb22
      Kees Cook 提交于
      The kzalloc() function has a 2-factor argument form, kcalloc(). This
      patch replaces cases of:
      
              kzalloc(a * b, gfp)
      
      with:
              kcalloc(a * b, gfp)
      
      as well as handling cases of:
      
              kzalloc(a * b * c, gfp)
      
      with:
      
              kzalloc(array3_size(a, b, c), gfp)
      
      as it's slightly less ugly than:
      
              kzalloc_array(array_size(a, b), c, gfp)
      
      This does, however, attempt to ignore constant size factors like:
      
              kzalloc(4 * 1024, gfp)
      
      though any constants defined via macros get caught up in the conversion.
      
      Any factors with a sizeof() of "unsigned char", "char", and "u8" were
      dropped, since they're redundant.
      
      The Coccinelle script used for this was:
      
      // Fix redundant parens around sizeof().
      @@
      type TYPE;
      expression THING, E;
      @@
      
      (
        kzalloc(
      -	(sizeof(TYPE)) * E
      +	sizeof(TYPE) * E
        , ...)
      |
        kzalloc(
      -	(sizeof(THING)) * E
      +	sizeof(THING) * E
        , ...)
      )
      
      // Drop single-byte sizes and redundant parens.
      @@
      expression COUNT;
      typedef u8;
      typedef __u8;
      @@
      
      (
        kzalloc(
      -	sizeof(u8) * (COUNT)
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(__u8) * (COUNT)
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(char) * (COUNT)
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(unsigned char) * (COUNT)
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(u8) * COUNT
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(__u8) * COUNT
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(char) * COUNT
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(unsigned char) * COUNT
      +	COUNT
        , ...)
      )
      
      // 2-factor product with sizeof(type/expression) and identifier or constant.
      @@
      type TYPE;
      expression THING;
      identifier COUNT_ID;
      constant COUNT_CONST;
      @@
      
      (
      - kzalloc
      + kcalloc
        (
      -	sizeof(TYPE) * (COUNT_ID)
      +	COUNT_ID, sizeof(TYPE)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(TYPE) * COUNT_ID
      +	COUNT_ID, sizeof(TYPE)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(TYPE) * (COUNT_CONST)
      +	COUNT_CONST, sizeof(TYPE)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(TYPE) * COUNT_CONST
      +	COUNT_CONST, sizeof(TYPE)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(THING) * (COUNT_ID)
      +	COUNT_ID, sizeof(THING)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(THING) * COUNT_ID
      +	COUNT_ID, sizeof(THING)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(THING) * (COUNT_CONST)
      +	COUNT_CONST, sizeof(THING)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(THING) * COUNT_CONST
      +	COUNT_CONST, sizeof(THING)
        , ...)
      )
      
      // 2-factor product, only identifiers.
      @@
      identifier SIZE, COUNT;
      @@
      
      - kzalloc
      + kcalloc
        (
      -	SIZE * COUNT
      +	COUNT, SIZE
        , ...)
      
      // 3-factor product with 1 sizeof(type) or sizeof(expression), with
      // redundant parens removed.
      @@
      expression THING;
      identifier STRIDE, COUNT;
      type TYPE;
      @@
      
      (
        kzalloc(
      -	sizeof(TYPE) * (COUNT) * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        kzalloc(
      -	sizeof(TYPE) * (COUNT) * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        kzalloc(
      -	sizeof(TYPE) * COUNT * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        kzalloc(
      -	sizeof(TYPE) * COUNT * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        kzalloc(
      -	sizeof(THING) * (COUNT) * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      |
        kzalloc(
      -	sizeof(THING) * (COUNT) * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      |
        kzalloc(
      -	sizeof(THING) * COUNT * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      |
        kzalloc(
      -	sizeof(THING) * COUNT * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      )
      
      // 3-factor product with 2 sizeof(variable), with redundant parens removed.
      @@
      expression THING1, THING2;
      identifier COUNT;
      type TYPE1, TYPE2;
      @@
      
      (
        kzalloc(
      -	sizeof(TYPE1) * sizeof(TYPE2) * COUNT
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
        , ...)
      |
        kzalloc(
      -	sizeof(TYPE1) * sizeof(THING2) * (COUNT)
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
        , ...)
      |
        kzalloc(
      -	sizeof(THING1) * sizeof(THING2) * COUNT
      +	array3_size(COUNT, sizeof(THING1), sizeof(THING2))
        , ...)
      |
        kzalloc(
      -	sizeof(THING1) * sizeof(THING2) * (COUNT)
      +	array3_size(COUNT, sizeof(THING1), sizeof(THING2))
        , ...)
      |
        kzalloc(
      -	sizeof(TYPE1) * sizeof(THING2) * COUNT
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
        , ...)
      |
        kzalloc(
      -	sizeof(TYPE1) * sizeof(THING2) * (COUNT)
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
        , ...)
      )
      
      // 3-factor product, only identifiers, with redundant parens removed.
      @@
      identifier STRIDE, SIZE, COUNT;
      @@
      
      (
        kzalloc(
      -	(COUNT) * STRIDE * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	COUNT * (STRIDE) * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	COUNT * STRIDE * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	(COUNT) * (STRIDE) * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	COUNT * (STRIDE) * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	(COUNT) * STRIDE * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	(COUNT) * (STRIDE) * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	COUNT * STRIDE * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      )
      
      // Any remaining multi-factor products, first at least 3-factor products,
      // when they're not all constants...
      @@
      expression E1, E2, E3;
      constant C1, C2, C3;
      @@
      
      (
        kzalloc(C1 * C2 * C3, ...)
      |
        kzalloc(
      -	(E1) * E2 * E3
      +	array3_size(E1, E2, E3)
        , ...)
      |
        kzalloc(
      -	(E1) * (E2) * E3
      +	array3_size(E1, E2, E3)
        , ...)
      |
        kzalloc(
      -	(E1) * (E2) * (E3)
      +	array3_size(E1, E2, E3)
        , ...)
      |
        kzalloc(
      -	E1 * E2 * E3
      +	array3_size(E1, E2, E3)
        , ...)
      )
      
      // And then all remaining 2 factors products when they're not all constants,
      // keeping sizeof() as the second factor argument.
      @@
      expression THING, E1, E2;
      type TYPE;
      constant C1, C2, C3;
      @@
      
      (
        kzalloc(sizeof(THING) * C2, ...)
      |
        kzalloc(sizeof(TYPE) * C2, ...)
      |
        kzalloc(C1 * C2 * C3, ...)
      |
        kzalloc(C1 * C2, ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(TYPE) * (E2)
      +	E2, sizeof(TYPE)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(TYPE) * E2
      +	E2, sizeof(TYPE)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(THING) * (E2)
      +	E2, sizeof(THING)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(THING) * E2
      +	E2, sizeof(THING)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	(E1) * E2
      +	E1, E2
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	(E1) * (E2)
      +	E1, E2
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	E1 * E2
      +	E1, E2
        , ...)
      )
      Signed-off-by: NKees Cook <keescook@chromium.org>
      6396bb22
  19. 31 5月, 2018 1 次提交
    • H
      libata: Drop SanDisk SD7UB3Q*G1001 NOLPM quirk · 2cfce3a8
      Hans de Goede 提交于
      Commit 184add2c ("libata: Apply NOLPM quirk for SanDisk
      SD7UB3Q*G1001 SSDs") disabled LPM for SanDisk SD7UB3Q*G1001 SSDs.
      
      This has lead to several reports of users of that SSD where LPM
      was working fine and who know have a significantly increased idle
      power consumption on their laptops.
      
      Likely there is another problem on the T450s from the original
      reporter which gets exposed by the uncore reaching deeper sleep
      states (higher PC-states) due to LPM being enabled. The problem as
      reported, a hardfreeze about once a day, already did not sound like
      it would be caused by LPM and the reports of the SSD working fine
      confirm this. The original reporter is ok with dropping the quirk.
      
      A X250 user has reported the same hard freeze problem and for him
      the problem went away after unrelated updates, I suspect some GPU
      driver stack changes fixed things.
      
      TL;DR: The original reporters problem were triggered by LPM but not
      an LPM issue, so drop the quirk for the SSD in question.
      
      BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1583207
      Cc: stable@vger.kernel.org
      Cc: Richard W.M. Jones <rjones@redhat.com>
      Cc: Lorenzo Dalrio <lorenzo.dalrio@gmail.com>
      Reported-by: NLorenzo Dalrio <lorenzo.dalrio@gmail.com>
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Acked-by: N"Richard W.M. Jones" <rjones@redhat.com>
      2cfce3a8
  20. 21 5月, 2018 1 次提交
    • S
      libata: blacklist Micron 500IT SSD with MU01 firmware · 136d769e
      Sudip Mukherjee 提交于
      While whitelisting Micron M500DC drives, the tweaked blacklist entry
      enabled queued TRIM from M500IT variants also. But these do not support
      queued TRIM. And while using those SSDs with the latest kernel we have
      seen errors and even the partition table getting corrupted.
      
      Some part from the dmesg:
      [    6.727384] ata1.00: ATA-9: Micron_M500IT_MTFDDAK060MBD, MU01, max UDMA/133
      [    6.727390] ata1.00: 117231408 sectors, multi 16: LBA48 NCQ (depth 31/32), AA
      [    6.741026] ata1.00: supports DRM functions and may not be fully accessible
      [    6.759887] ata1.00: configured for UDMA/133
      [    6.762256] scsi 0:0:0:0: Direct-Access     ATA      Micron_M500IT_MT MU01 PQ: 0 ANSI: 5
      
      and then for the error:
      [  120.860334] ata1.00: exception Emask 0x1 SAct 0x7ffc0007 SErr 0x0 action 0x6 frozen
      [  120.860338] ata1.00: irq_stat 0x40000008
      [  120.860342] ata1.00: failed command: SEND FPDMA QUEUED
      [  120.860351] ata1.00: cmd 64/01:00:00:00:00/00:00:00:00:00/a0 tag 0 ncq dma 512 out
               res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x5 (timeout)
      [  120.860353] ata1.00: status: { DRDY }
      [  120.860543] ata1: hard resetting link
      [  121.166128] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
      [  121.166376] ata1.00: supports DRM functions and may not be fully accessible
      [  121.186238] ata1.00: supports DRM functions and may not be fully accessible
      [  121.204445] ata1.00: configured for UDMA/133
      [  121.204454] ata1.00: device reported invalid CHS sector 0
      [  121.204541] sd 0:0:0:0: [sda] tag#18 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x08
      [  121.204546] sd 0:0:0:0: [sda] tag#18 Sense Key : 0x5 [current]
      [  121.204550] sd 0:0:0:0: [sda] tag#18 ASC=0x21 ASCQ=0x4
      [  121.204555] sd 0:0:0:0: [sda] tag#18 CDB: opcode=0x93 93 08 00 00 00 00 00 04 28 80 00 00 00 30 00 00
      [  121.204559] print_req_error: I/O error, dev sda, sector 272512
      
      After few reboots with these errors, and the SSD is corrupted.
      After blacklisting it, the errors are not seen and the SSD does not get
      corrupted any more.
      
      Fixes: 243918be ("libata: Do not blacklist Micron M500DC")
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NSudip Mukherjee <sudipm.mukherjee@gmail.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      136d769e
  21. 14 5月, 2018 1 次提交
    • F
      libata: Apply NOLPM quirk for SAMSUNG PM830 CXM13D1Q. · 76936e9a
      François Cami 提交于
      Without this patch the drive errors out regularly:
      
      [    1.090154] ata1.00: ATA-8: SAMSUNG SSD PM830 mSATA 256GB,
      CXM13D1Q, max UDMA/133
      (...)
      [  345.154996] ata1.00: exception Emask 0x40 SAct 0x0 SErr 0xc0800 action 0x6
      [  345.155006] ata1.00: irq_stat 0x40000001
      [  345.155013] ata1: SError: { HostInt CommWake 10B8B }
      [  345.155018] ata1.00: failed command: SET FEATURES
      [  345.155032] ata1.00: cmd ef/05:e1:00:00:00/00:00:00:00:00/40 tag 7
                              res 51/04:e1:00:00:00/00:00:00:00:00/40 Emask 0x41 (internal error)
      [  345.155038] ata1.00: status: { DRDY ERR }
      [  345.155042] ata1.00: error: { ABRT }
      [  345.155051] ata1: hard resetting link
      [  345.465661] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
      [  345.466955] ata1.00: configured for UDMA/133
      [  345.467085] ata1: EH complete
      Signed-off-by: NFrançois Cami <fcami@fedoraproject.org>
      Acked-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      76936e9a
  22. 12 5月, 2018 6 次提交
  23. 11 5月, 2018 1 次提交
  24. 09 5月, 2018 1 次提交
  25. 27 4月, 2018 2 次提交
    • H
      libata: Apply NOLPM quirk for SanDisk SD7UB3Q*G1001 SSDs · 184add2c
      Hans de Goede 提交于
      Richard Jones has reported that using med_power_with_dipm on a T450s
      with a Sandisk SD7UB3Q256G1001 SSD (firmware version X2180501) is
      causing the machine to hang.
      
      Switching the LPM to max_performance fixes this, so it seems that
      this Sandisk SSD does not handle LPM well.
      
      Note in the past there have been bug-reports about the following
      Sandisk models not working with min_power, so we may need to extend
      the quirk list in the future: name - firmware
      Sandisk SD6SB2M512G1022I   - X210400
      Sandisk SD6PP4M-256G-1006  - A200906
      
      Cc: stable@vger.kernel.org
      Cc: Richard W.M. Jones <rjones@redhat.com>
      Reported-and-tested-by: NRichard W.M. Jones <rjones@redhat.com>
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      184add2c
    • H
      libata: Apply NOLPM quirk for SAMSUNG MZMPC128HBFU-000MV SSD · b5b4d3a5
      Hans de Goede 提交于
      Kevin Shanahan reports the following repeating errors when using LPM,
      causing long delays accessing the disk:
      
        Apr 23 10:21:43 link kernel: ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x50000 action 0x6 frozen
        Apr 23 10:21:43 link kernel: ata1: SError: { PHYRdyChg CommWake }
        Apr 23 10:21:43 link kernel: ata1.00: failed command: WRITE DMA
        Apr 23 10:21:43 link kernel: ata1.00: cmd ca/00:08:60:5d:cd/00:00:00:00:00/e1 tag 9 dma 4096 out
                                              res 50/01:01:01:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
        Apr 23 10:21:43 link kernel: ata1.00: status: { DRDY }
        Apr 23 10:21:43 link kernel: ata1.00: error: { AMNF }
        Apr 23 10:21:43 link kernel: ata1: hard resetting link
        Apr 23 10:21:43 link kernel: ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
        Apr 23 10:21:43 link kernel: ata1.00: configured for UDMA/133
        Apr 23 10:21:43 link kernel: ata1: EH complete
      
      These go away when switching from med_power_with_dipm to medium_power.
      
      This is somewhat weird as the PM830 datasheet explicitly mentions DIPM
      being supported and the idle power-consumption is specified with DIPM
      enabled.
      
      There are many OEM customized firmware versions for the PM830, so for now
      lets assume this is firmware version specific and blacklist LPM based on
      the firmware version.
      
      Cc: Kevin Shanahan <kevin@shanahan.id.au>
      Reported-by: NKevin Shanahan <kevin@shanahan.id.au>
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      b5b4d3a5
  26. 27 3月, 2018 1 次提交
  27. 19 3月, 2018 3 次提交
    • H
      libata: Modify quirks for MX100 to limit NCQ_TRIM quirk to MU01 version · d418ff56
      Hans de Goede 提交于
      When commit 9c7be59f ("libata: Apply NOLPM quirk to Crucial MX100
      512GB SSDs") was added it inherited the ATA_HORKAGE_NO_NCQ_TRIM quirk
      from the existing "Crucial_CT*MX100*" entry, but that entry sets model_rev
      to "MU01", where as the entry adding the NOLPM quirk sets it to NULL.
      
      This means that after this commit we no apply the NO_NCQ_TRIM quirk to
      all "Crucial_CT512MX100*" SSDs even if they have the fixed "MU02"
      firmware. This commit splits the "Crucial_CT512MX100*" quirk into 2
      quirks, one for the "MU01" firmware and one for all other firmware
      versions, so that we once again only apply the NO_NCQ_TRIM quirk to the
      "MU01" firmware version.
      
      Fixes: 9c7be59f ("libata: Apply NOLPM quirk to ... MX100 512GB SSDs")
      Cc: stable@vger.kernel.org
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      d418ff56
    • H
      libata: Make Crucial BX100 500GB LPM quirk apply to all firmware versions · 3bf7b5d6
      Hans de Goede 提交于
      Commit b17e5729 ("libata: disable LPM for Crucial BX100 SSD 500GB
      drive"), introduced a ATA_HORKAGE_NOLPM quirk for Crucial BX100 500GB SSDs
      but limited this to the MU02 firmware version, according to:
      http://www.crucial.com/usa/en/support-ssd-firmware
      
      MU02 is the last version, so there are no newer possibly fixed versions
      and if the MU02 version has broken LPM then the MU01 almost certainly
      also has broken LPM, so this commit changes the quirk to apply to all
      firmware versions.
      
      Fixes: b17e5729 ("libata: disable LPM for Crucial BX100 SSD 500GB...")
      Cc: stable@vger.kernel.org
      Cc: Kai-Heng Feng <kai.heng.feng@canonical.com>
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      3bf7b5d6
    • H
      libata: Apply NOLPM quirk to Crucial M500 480 and 960GB SSDs · 62ac3f73
      Hans de Goede 提交于
      There have been reports of the Crucial M500 480GB model not working
      with LPM set to min_power / med_power_with_dipm level.
      
      It has not been tested with medium_power, but that typically has no
      measurable power-savings.
      
      Note the reporters Crucial_CT480M500SSD3 has a firmware version of MU03
      and there is a MU05 update available, but that update does not mention any
      LPM fixes in its changelog, so the quirk matches all firmware versions.
      
      In my experience the LPM problems with (older) Crucial SSDs seem to be
      limited to higher capacity versions of the SSDs (different firmware?),
      so this commit adds a NOLPM quirk for the 480 and 960GB versions of the
      M500, to avoid LPM causing issues with these SSDs.
      
      Cc: stable@vger.kernel.org
      Reported-and-tested-by: NMartin Steigerwald <martin@lichtvoll.de>
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      62ac3f73
  28. 14 3月, 2018 1 次提交