Skip to content
Snippets Groups Projects
  1. Oct 11, 2022
  2. Oct 10, 2022
  3. Oct 09, 2022
  4. Sep 29, 2022
  5. Sep 28, 2022
    • Xingui Yang's avatar
      scsi: hisi_sas: Release resource directly in hisi_sas_abort_task() when NCQ error · 64d37f3f
      Xingui Yang authored
      driver inclusion
      category: bugfix
      bugzilla: https://gitee.com/openeuler/kernel/issues/I5SXSB
      
      
      CVE: NA
      
      ------------------------------------------------
      
      When the port is detached, EH will clear ATA_EH_RESET in ehc->i.action when
      call ata_eh_reset(), and device reset won't be executed.
      
      As the disk won't return other I/Os normally after NCQ Error. In addition,
      the abort operation is added, then resource release is safe, so release NCQ
      command lldd resource directly in hisi_sas_abort_task() when NCQ error
      without soft reset to make sure read log command can be executed success
      later. But Soft reset still need to be used in other scenario.
      
      Signed-off-by: default avatarXingui Yang <yangxingui@huawei.com>
      Reviewed-by: default avatarkang fenglong <kangfenglong@huawei.com>
      Signed-off-by: default avatarYongqiang Liu <liuyongqiang13@huawei.com>
      64d37f3f
    • Xingui Yang's avatar
      scsi: hisi_sas: Enable force phy when SATA disk directly connected · f32bc74e
      Xingui Yang authored
      driver inclusion
      category: bugfix
      bugzilla: https://gitee.com/openeuler/kernel/issues/I5QDH7
      
      
      CVE: NA
      
      ----------------------------------
      
      the SAS controller determines the disk to which I/Os are delivered based
      on the port id in the DQ entry when SATA disk directly connected.
      
      When the link is intermittently disconnected during I/O sending and the
      port id changes and is used by another link, data inconsistency on the
      SATA disk may occur during I/O retry. So enable force phy, then force the
      command to be executed in a certain phy, and if the port's phy does not
      match the phy configured in the command, the chip will stop delivering
      I/Os to disk.
      
      Signed-off-by: default avatarXingui Yang <yangxingui@huawei.com>
      Reviewed-by: default avatarkang fenglong <kangfenglong@huawei.com>
      Signed-off-by: default avatarYongqiang Liu <liuyongqiang13@huawei.com>
      f32bc74e
    • Xingui Yang's avatar
      scsi: hisi_sas: Modify v3 HW ATA completion process when SATA disk is in error status · 63c0c05a
      Xingui Yang authored
      driver inclusion
      category: bugfix
      bugzilla: https://gitee.com/openeuler/kernel/issues/I5Q63H
      
      
      CVE: NA
      
      -------------------------------------
      
      When an NCQ error occurs, SAS controller will abnormally complete the I/Os
      that newly delivered to disk, and bit8 in CQ dw3 will be set to 1 to
      indicate current SATA disk is in error status. The current processing flow
      is set ts->stat to SAS_OPEN_REJECT and then sas_ata_task_done() will set
      fis stat to ATA_ERR. After analyzed by ata_eh_analyze_tf(), err_mask will
      set to AC_ERR_HSM. If media error occurs for four times within 10 minutes
      and the chip rejects new I/Os for four times, NCQ will be disabled due to
      excessive errors.
      
      However, if media error occurs multiple times, the NCQ mode shouldn't be
      disabled. Therefore, use sas_task_abort() to handle abnormally completed
      I/Os when SATA disk is in error status.
      
      [10253.397429] hisi_sas_v3_hw 0000:b4:02.0: erroneous completion disk err dev id=2 sas_addr=0x5000000000000605 CQ hdr: 0x400903 0x2007f 0x0 0x80470000
      [10253.397430] hisi_sas_v3_hw 0000:b4:02.0: erroneous completion iptt=135 task= pK-error dev id=2 sas_addr=0x5000000000000605 CQ hdr: 0x203 0x20087 0x0 0x100 Error info: 0x0 0x0 0x0 0x0
      [10253.397432] hisi_sas_v3_hw 0000:b4:02.0: erroneous completion iptt=136 task= pK-error dev id=2 sas_addr=0x5000000000000605 CQ hdr: 0x203 0x20088 0x0 0x100 Error info: 0x0 0x0 0x0 0x0
      
      Signed-off-by: default avatarXingui Yang <yangxingui@huawei.com>
      Reviewed-by: default avatarkang fenglong <kangfenglong@huawei.com>
      Signed-off-by: default avatarYongqiang Liu <liuyongqiang13@huawei.com>
      63c0c05a
    • Hui Tang's avatar
      sched: Fix invalid free for tsk->se.dyn_affi_stats · 46212545
      Hui Tang authored
      hulk inclusion
      category: bugfix
      bugzilla: https://gitee.com/openeuler/kernel/issues/I5TIOZ
      
      
      CVE: NA
      
      --------------------------------
      
      BUG: KASAN: double-free or invalid-free in sched_prefer_cpus_free[...]
      
      Freed by task 0:
       save_stack mm/kasan/kasan.c:448 [inline]
       set_track mm/kasan/kasan.c:460 [inline]
       __kasan_slab_free+0x120/0x228 mm/kasan/kasan.c:521
       kasan_slab_free+0x10/0x18 mm/kasan/kasan.c:528
       slab_free_hook mm/slub.c:1397 [inline]
       slab_free_freelist_hook mm/slub.c:1425 [inline]
       slab_free mm/slub.c:3004 [inline]
       kfree+0x84/0x250 mm/slub.c:3965
       sched_prefer_cpus_free+0x58/0x78 kernel/sched/core.c:7219
       free_task+0xb0/0xe8 kernel/fork.c:463
       __delayed_free_task+0x24/0x30 kernel/fork.c:1716
       __rcu_reclaim kernel/rcu/rcu.h:236 [inline]
       rcu_do_batch+0x200/0x5e0 kernel/rcu/tree.c:2584
       invoke_rcu_callbacks kernel/rcu/tree.c:2897 [inline]
       __rcu_process_callbacks kernel/rcu/tree.c:2864 [inline]
       rcu_process_callbacks+0x470/0xb60 kernel/rcu/tree.c:2881
       __do_softirq+0x2d0/0xba0 kernel/softirq.c:292
      
      Add init of 'tsk->se.dyn_affi_stats == NULL' in dup_task_struct().
      
      Fixes: ebca52ab ("sched: Add statistics for scheduler dynamic affinity")
      Signed-off-by: default avatarHui Tang <tanghui20@huawei.com>
      Reviewed-by: default avatarZhang Qiao <zhangqiao22@huawei.com>
      Signed-off-by: default avatarYongqiang Liu <liuyongqiang13@huawei.com>
      46212545