[ACC-0316]sync mainline kernel 5.6rc6 ACC patchset into ubuntu HWE kernel branch

Bug #1867591 reported by Fred Kimmy on 2020-03-16
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kunpeng920
Undecided
Ike Panhc
Ubuntu-18.04-hwe
Undecided
Ike Panhc
Ubuntu-20.04
Undecided
Ike Panhc
Upstream-kernel
Undecided
Unassigned
linux (Ubuntu)
Undecided
Ike Panhc

Bug Description

[Bug Description]
roce patchset have merged into mainline 5.6rc2 kernel.

[Steps to Reproduce]
  1)
  2)
  3)

[Actual Results]

[Expected Results]

[Reproducibility]

[Additional information]
  (Firmware version, kernel version, affected hardware, etc. if required):

[Resolution]
crypto: hisilicon/sec2 - Add pbuffer mode for SEC driver
crypto: hisilicon/sec2 - Update IV and MAC operation
crypto: hisilicon/sec2 - Add iommu status check
crypto: hisilicon/sec2 - Add workqueue for SEC driver.
crypto: hisilicon - Use one workqueue per qm instead of per qp
crypto: hisilicon - qm depends on UACCE
crypto: hisilicon - remove redundant assignment of pointer ctx
hisilicon - register zip engine to uacce
hisilicon - Remove module_param uacce_mode
uacce: add uacce driver
uacce: Add documents for uacce
crypto: hisilicon - Fix duplicate print when qm occur multiple errors
crypto: hisilicon - Unify error detect process into qm
crypto: hisilicon - Configure zip RAS error type
crypto: hisilicon - Unify hardware error init/uninit into QM

Ike Panhc (ikepanhc) wrote :

All patches not hit mainline kernel yet.

Changed in kunpeng920:
status: New → Incomplete
Changed in kunpeng920:
assignee: nobody → Taihsiang Ho (taihsiangho)
tags: added: tairadar
Taihsiang Ho (taihsiangho) wrote :

The latest discussion shows it may be in the mainline. We will check later.

Taihsiang Ho (taihsiangho) wrote :

I checked the upstream source today and none of patch from this patchset has landed in the upstream source tree.

Taihsiang Ho (taihsiangho) wrote :

I checked the upstream source today and none of patch from this patchset has landed in the upstream source tree. However, I think they are on the way and may be delivered in the recent 5.7 merge window, e.g. here is a part of SEC driver related patches https://www.spinics.net/lists/linux-crypto/msg46555.html

Changed in kunpeng920:
assignee: Taihsiang Ho (taihsiangho) → Ike Panhc (ikepanhc)
Ike Panhc (ikepanhc) on 2020-04-01
tags: added: ikeradar
Ike Panhc (ikepanhc) wrote :

All patches has been merged into mainline kernel.

Changed in kunpeng920:
status: Incomplete → In Progress
Changed in linux (Ubuntu):
status: New → In Progress
assignee: nobody → Ike Panhc (ikepanhc)
Ike Panhc (ikepanhc) wrote :

Kernel oops when uacce loaded. Please see the attachment oops.txt for details.

The test kernel is available at http://kernel.ubuntu.com/~ikepanhc/lp1867591
and the git branch is available at https://kernel.ubuntu.com/git/ikepanhc/public.git/commit/?h=kunpeng920_wip&id=10299705bb0bb45f8513b31fbad1f20b5b2627ef

Fred Kimmy (kongzizaixian) wrote :

from log: Hardware name: Huawei XA320 V2 /BC82HPNB, BIOS 0.95 08/15/2019

this server is x6000, I think that it is not enabled sec driver. Can you provide this lscpi information.

Ike Panhc (ikepanhc) wrote :

Same oops happens on d061(kreiken) and x6000(segers).

Here is the lspci output of segers

Ike Panhc (ikepanhc) wrote :

oops log on kreiken

Ike Panhc (ikepanhc) wrote :

lspci output on kreiken (d061)

Hi Xinwei,

Can you tell me which patches are for acce and which are for uacce? They looks mixed to me.

--
Ike

On 3/16/20 4:04 PM, Fred Kimmy wrote:
> [Resolution]
> crypto: hisilicon/sec2 - Add pbuffer mode for SEC driver
> crypto: hisilicon/sec2 - Update IV and MAC operation
> crypto: hisilicon/sec2 - Add iommu status check
> crypto: hisilicon/sec2 - Add workqueue for SEC driver.
> crypto: hisilicon - Use one workqueue per qm instead of per qp
> crypto: hisilicon - qm depends on UACCE
> crypto: hisilicon - remove redundant assignment of pointer ctx
> hisilicon - register zip engine to uacce
> hisilicon - Remove module_param uacce_mode
> uacce: add uacce driver
> uacce: Add documents for uacce
> crypto: hisilicon - Fix duplicate print when qm occur multiple errors
> crypto: hisilicon - Unify error detect process into qm
> crypto: hisilicon - Configure zip RAS error type
> crypto: hisilicon - Unify hardware error init/uninit into QM

Fred Kimmy (kongzizaixian) wrote :

crypto: hisilicon/sec2 - Add pbuffer mode for SEC driver
 crypto: hisilicon/sec2 - Update IV and MAC operation
 crypto: hisilicon/sec2 - Add iommu status check
 crypto: hisilicon/sec2 - Add workqueue for SEC driver.

this aboving sec2 optimize code have a small bug, we have fixing it and can you revert aboving four patches?

crypto: hisilicon - Use one workqueue per qm instead of per qp
 crypto: hisilicon - qm depends on UACCE
 crypto: hisilicon - remove redundant assignment of pointer ctx
 hisilicon - register zip engine to uacce
 hisilicon - Remove module_param uacce_mode
 uacce: add uacce driver
 uacce: Add documents for uacce
 crypto: hisilicon - Fix duplicate print when qm occur multiple errors
 crypto: hisilicon - Unify error detect process into qm
 crypto: hisilicon - Configure zip RAS error type
 crypto: hisilicon - Unify hardware error init/uninit into QM

this aboving 11 ACC patches is not problem and you merge it.

Ike Panhc (ikepanhc) wrote :

[ 34.456012] hisi_dma 0000:7b:00.0: Adding to iommu group 51
[ 34.457088] hisi_dma 0000:7b:00.0: enabling device (0000 -> 0002)
[ 34.471321] hisi_hpre 0000:79:00.0: Adding to iommu group 52
[ 34.472683] hisi_hpre 0000:79:00.0: fail to alloc uacce (-22)
[ 34.472694] hisi_hpre 0000:79:00.0: enabling device (0000 -> 0002)
[ 34.498524] hisi_dma 0000:bb:00.0: Adding to iommu group 53
[ 34.499459] hisi_dma 0000:bb:00.0: enabling device (0000 -> 0002)
[ 34.505307] hisi_hpre 0000:b9:00.0: Adding to iommu group 54
[ 34.510790] hisi_zip 0000:75:00.0: Adding to iommu group 55
[ 34.512105] hisi_zip 0000:75:00.0: fail to alloc uacce (-22)
[ 34.512113] hisi_zip 0000:75:00.0: enabling device (0000 -> 0002)
[ 34.514789] hisi_sec2 0000:76:00.0: Adding to iommu group 56
[ 34.516596] hisi_sec2 0000:76:00.0: fail to alloc uacce (-22)
[ 34.516604] hisi_sec2 0000:76:00.0: enabling device (0000 -> 0002)
[ 34.520416] hisi_hpre 0000:b9:00.0: fail to alloc uacce (-22)
[ 34.520427] hisi_hpre 0000:b9:00.0: enabling device (0000 -> 0002)
[ 34.522426] hisi_zip 0000:b5:00.0: Adding to iommu group 57
[ 34.523552] hisi_zip 0000:b5:00.0: fail to alloc uacce (-22)
[ 34.523557] hisi_zip 0000:b5:00.0: enabling device (0000 -> 0002)
[ 34.540976] IPMI message handler: version 39.2
[ 34.573254] ipmi device interface
[ 34.577557] hisi_sec2 0000:b6:00.0: Adding to iommu group 58
[ 34.578736] hisi_sec2 0000:b6:00.0: fail to alloc uacce (-22)
[ 34.578744] hisi_sec2 0000:b6:00.0: enabling device (0000 -> 0002)

In dmesg it says uacce can not link with those crypto drivers.

Looks like these drivers are not ready and we don't have test case yet.
I believe we shall submit after driver is mature and also work on its test case.

Andrew Cloke (andrew-cloke) wrote :

Marking as incomplete while waiting for a test case for the uacce driver module from HiSilicon.

Changed in kunpeng920:
status: In Progress → Incomplete
Fred Kimmy (kongzizaixian) wrote :

this following patch will fix sec2 boot bug:

crypto: hisilicon/sec2 - modify the SEC probe process
https://www.spinics.net/lists/linux-crypto/msg47550.html

can you open CONFIG_CRYPTO_TEST=m and CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=m to test acc driver?

Ike Panhc (ikepanhc) wrote :

I will test the patch. However, since this patch is very new (4 days on mailing list only), I will start backport process after it is merged into mainline kernel.

Ike Panhc (ikepanhc) wrote :

Another cherry-pick is needed for patch "crypto: hisilicon/sec2 - modify the SEC probe process"

/home/ubuntu/focal/drivers/crypto/hisilicon/sec2/sec_main.c: In function ‘sec_qm_init’:
/home/ubuntu/focal/drivers/crypto/hisilicon/sec2/sec_main.c:770:5: error: ‘struct hisi_qm’ has no member named ‘qm_list’
   qm->qm_list = &sec_devices;
     ^~
/home/ubuntu/focal/drivers/crypto/hisilicon/sec2/sec_main.c:770:18: error: ‘sec_devices’ undeclared (first use in this function); did you mean ‘sec_dev_ids’?
   qm->qm_list = &sec_devices;
                  ^~~~~~~~~~~
                  sec_dev_ids

Andrew Cloke (andrew-cloke) wrote :

Xinwei has commented that this patchset may also fix bug# 1867900

Ike Panhc (ikepanhc) wrote :

Cherry-pick all patches from mainline kernel for drivers/crypto/hisilicon but patch ("crypto:hisilicon/sec2 -modify the SEC probe process") mentioned in #17 still causes build failure.

/home/ubuntu/focal/drivers/crypto/hisilicon/sec2/sec_main.c: In function ‘sec_qm_init’:
/home/ubuntu/focal/drivers/crypto/hisilicon/sec2/sec_main.c:750:7: error: ‘struct hisi_qm’ has no member named ‘qm_list’; did you mean ‘list’?
   qm->qm_list = &sec_devices;
       ^~~~~~~
       list
/home/ubuntu/focal/scripts/Makefile.build:273: recipe for target 'drivers/crypto/hisilicon/sec2/sec_main.o' failed
make[6]: *** [drivers/crypto/hisilicon/sec2/sec_main.o] Error 1

There is no qm_list in 'struct qm'. Is there any patch in kernel mailing list I shall also cherry-pick?

Here are the patches I cherry-picked from mainline kernel.

2ecc5dbe1be2 crypto: hisilicon - Fix build error
050edd48773c crypto: hisilicon/sec2 - Add new create qp process
866208000dc5 crypto: hisilicon/hpre - Optimize finding hpre device process
2d5c3b667630 crypto: hisilicon/zip - Use hisi_qm_alloc_qps_node() when init ctx
f9b281b9d419 crypto: hisilicon/qm - Put device finding logic into QM
41fb76b52f88 crypto: hisilicon/sec2 - Add pbuffer mode for SEC driver
a498705a1413 crypto: hisilicon/sec2 - Update IV and MAC operation
0d96187b2254 crypto: hisilicon/sec2 - Add iommu status check
4bd0e47188d5 crypto: hisilicon/sec2 - Add workqueue for SEC driver.
e446154072f6 crypto: hisilicon - Use one workqueue per qm instead of per qp
1c50a05a8175 crypto: hisilicon - qm depends on UACCE
830f9ba1bd19 crypto: hisilicon - remove redundant assignment of pointer ctx
890db5d419c6 crypto: hisilicon - register zip engine to uacce
dd057c5c9923 crypto: hisilicon - Remove module_param uacce_mode
392303395a8f uacce: add uacce driver
aac67f627ed7 uacce: Add documents for uacce
ec8710741e72 crypto: hisilicon - Fix duplicate print when qm occur multiple errors
4eec3fe442fe crypto: hisilicon - Unify error detect process into qm
0fe67e5b898e crypto: hisilicon - Configure zip RAS error type
f70dbcab45dd crypto: hisilicon - Unify hardware error init/uninit into QM

dann frazier (dannf) wrote :

@Ike: it looks like that patch depends on this other patch set, which is currently in linux-next:
  https://www.spinics.net/lists/linux-crypto/msg46951.html

To avoid backporting that, perhaps you could drop the qm_list assignment.

That said, I don't see a valid SRU justification for any of these.

Ike Panhc (ikepanhc) wrote :

Thanks for suggestion but I do not feel comfortable drop a line from a patch before perfectly understanding everything in drivers. If Hisilicon can help on backporting or test case, that will be much helpful.

Ike Panhc (ikepanhc) wrote :

Cherry-pick patches in #21 and solve build issue as suggestion in #22. The test kernel can boot without error in dmesg.

But bug 1867900 still exist with the test kernel.

I will provide kernel debs and git branch later.

Andrew Cloke (andrew-cloke) wrote :

Next step is to wait for the patch described in comment #17 to be integrated into the upstream kernel.

Ike Panhc (ikepanhc) on 2020-07-01
tags: removed: ikeradar
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers