[sfc-0121]enable the HiSilicon v3xx SFC driver

Bug #1860401 reported by Fred Kimmy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kunpeng920
Fix Released
Undecided
Unassigned
Ubuntu-18.04-hwe
Fix Released
Undecided
Ike Panhc
Ubuntu-20.04
Fix Released
Undecided
Ike Panhc
Upstream-kernel
Fix Released
Undecided
Unassigned
linux (Ubuntu)
Fix Released
Undecided
Ike Panhc

Bug Description

[Bug Description]
enable the HiSilicon v3xx SFC driver

[Steps to Reproduce]
1)
2)
3)

[Actual Results]

[Expected Results]

[Reproducibility]

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

[Resolution]

MAINTAINERS: Add a maintainer for the HiSilicon v3xx SFC driver
spi: Add HiSilicon v3xx SPI NOR flash controller driver
mtd: spi-nor: Fix the writing of the Status Register on micron flashes

CVE References

description: updated
Revision history for this message
dann frazier (dannf) wrote :

I backported this driver from linux-next to the 5.4 focal kernel, but found that it did not load on an x6000:

ubuntu@scobee:~$ lsmod | grep spi
spi_dw_mmio 16384 0
spi_dw 24576 1 spi_dw_mmio
ubuntu@scobee:~$

Marking Incomplete.

Changed in kunpeng920:
status: New → Triaged
status: Triaged → Incomplete
Ike Panhc (ikepanhc)
Changed in kunpeng920:
status: Incomplete → In Progress
assignee: nobody → Ike Panhc (ikepanhc)
Changed in linux (Ubuntu):
status: New → In Progress
assignee: nobody → Ike Panhc (ikepanhc)
Revision history for this message
Ike Panhc (ikepanhc) wrote :

Test build failed after 3 patches cherry-pick from mainline.

/home/ubuntu/ubuntu-focal/drivers/mtd/spi-nor/spi-nor.c: In function ‘st_micron_set_default_init’:
/home/ubuntu/ubuntu-focal/drivers/mtd/spi-nor/spi-nor.c:4393:17: error: ‘SNOR_F_HAS_16BIT_SR’ undeclared (first use in this function); did you mean ‘SNOR_F_HAS_4BAIT’?
  nor->flags &= ~SNOR_F_HAS_16BIT_SR;
                 ^~~~~~~~~~~~~~~~~~~
                 SNOR_F_HAS_4BAIT
/home/ubuntu/ubuntu-focal/drivers/mtd/spi-nor/spi-nor.c:4393:17: note: each undeclared identifier is reported only once for each function it appears in

Revision history for this message
Ike Panhc (ikepanhc) wrote :

SNOR_F_HAS_16BIT_SR is defined in this patch

commit adf1092fa838e870813f2ac152973af311d8ae02
Author: Jungseung Lee <email address hidden>
Date: Mon Dec 2 15:35:06 2019 +0900

    mtd: spi-nor: Support TB selection using SR bit 6

    There are some flashes to use bit 6 of status register for Top/Bottom (TB).
    Use top/bottom bit variable instead of fixed value and support this case.

Revision history for this message
Ike Panhc (ikepanhc) wrote :

Correcting comment #3, this is the correct patch

commit 39d1e3340c73e8f7eb1d6a8cae561c255ca7b1b0
Author: Tudor Ambarus <email address hidden>
Date: Thu Nov 7 08:41:51 2019 +0000

    mtd: spi-nor: Fix clearing of QE bit on lock()/unlock()

Revision history for this message
Ike Panhc (ikepanhc) wrote :

I am confused.

Patch ("mtd: spi-nor: Fix the writing of the Status Register on micron flashes")
fixes 39d1e3340c73 ("mtd: spi-nor: Fix clearing of QE bit on lock()/unlock()")
which depends on more patches if we want to cherry-pick them.

spi-nor provides 2 export functions but are not used in spi-hisi-sfc-v3xx driver.

$ grep EXPORT drivers/mtd/spi-nor/spi-nor.c
EXPORT_SYMBOL_GPL(spi_nor_restore);
EXPORT_SYMBOL_GPL(spi_nor_scan);

I am building kernel with "spi: Add HiSilicon v3xx SPI NOR flash controller driver"
only for test.

Revision history for this message
Ike Panhc (ikepanhc) wrote :

Please test kernel debs at

 https://kernel.ubuntu.com/~ikepanhc/lp1860401.1/

If it works fine, I will submit patch "spi: Add HiSilicon v3xx SPI NOR flash controller driver".

Changed in kunpeng920:
status: In Progress → Incomplete
assignee: Ike Panhc (ikepanhc) → nobody
Revision history for this message
Fred Kimmy (kongzizaixian) wrote :

thank you! I will test it.

Revision history for this message
Fred Kimmy (kongzizaixian) wrote :

ubuntu@ubuntu:~$ dmesg | grep sfc
[ 29.360735] hisi-sfc-v3xx HISI0341:00: hw version 0x351
ubuntu@ubuntu:~$ uname -a
Linux ubuntu 5.4.0-14-generic #17~d20200214t082755~5d13e758ee67~lp1860401 SMP Fri Feb 14 08:28 aarch64 aarch64 aarch64 GNU/Linux
ubuntu@ubuntu:~$ cat /proc/mtd
dev: size erasesize name
mtd0: 01000000 00001000 "spi-PRP0001:00"
ubuntu@ubuntu:~$ lsmod | grep sfc
spi_hisi_sfc_v3xx 16384 0
ubuntu@ubuntu:~$

Revision history for this message
Fred Kimmy (kongzizaixian) wrote :

I use your provided deb to test this sfc driver. this sfc driver have been enabled.

Ike Panhc (ikepanhc)
Changed in kunpeng920:
status: Incomplete → In Progress
Revision history for this message
Andrew Cloke (andrew-cloke) wrote :
Revision history for this message
Ike Panhc (ikepanhc) wrote :

Patch ("spi: Add HiSilicon v3xx SPI NOR flash controller driver") has been applied to focal/master-next

https://lists.ubuntu.com/archives/kernel-team/2020-February/107823.html

Changed in kunpeng920:
status: In Progress → Fix Committed
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote :

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-focal' to 'verification-done-focal'. If the problem still exists, change the tag 'verification-needed-focal' to 'verification-failed-focal'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-focal
Revision history for this message
Ike Panhc (ikepanhc) wrote :

Thanks. 5.4.0-18.22 works fine to me.

tags: added: verification-done-focal
removed: verification-needed-focal
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (81.5 KiB)

This bug was fixed in the package linux - 5.4.0-18.22

---------------
linux (5.4.0-18.22) focal; urgency=medium

  * focal/linux: 5.4.0-18.22 -proposed tracker (LP: #1866488)

  * Packaging resync (LP: #1786013)
    - [Packaging] resync getabis
    - [Packaging] update helper scripts

  * Add sysfs attribute to show remapped NVMe (LP: #1863621)
    - SAUCE: ata: ahci: Add sysfs attribute to show remapped NVMe device count

  * [20.04 FEAT] Compression improvements in Linux kernel (LP: #1830208)
    - lib/zlib: add s390 hardware support for kernel zlib_deflate
    - s390/boot: rename HEAP_SIZE due to name collision
    - lib/zlib: add s390 hardware support for kernel zlib_inflate
    - s390/boot: add dfltcc= kernel command line parameter
    - lib/zlib: add zlib_deflate_dfltcc_enabled() function
    - btrfs: use larger zlib buffer for s390 hardware compression
    - [Config] Introducing s390x specific kernel config option CONFIG_ZLIB_DFLTCC

  * [UBUNTU 20.04] s390x/pci: increase CONFIG_PCI_NR_FUNCTIONS to 512 in kernel
    config (LP: #1866056)
    - [Config] Increase CONFIG_PCI_NR_FUNCTIONS from 64 to 512 starting with focal
      on s390x

  * CONFIG_IP_MROUTE_MULTIPLE_TABLES is not set (LP: #1865332)
    - [Config] CONFIG_IP_MROUTE_MULTIPLE_TABLES=y

  * Dell XPS 13 9300 Intel 1650S wifi [34f0:1651] fails to load firmware
    (LP: #1865962)
    - iwlwifi: remove IWL_DEVICE_22560/IWL_DEVICE_FAMILY_22560
    - iwlwifi: 22000: fix some indentation
    - iwlwifi: pcie: rx: use rxq queue_size instead of constant
    - iwlwifi: allocate more receive buffers for HE devices
    - iwlwifi: remove some outdated iwl22000 configurations
    - iwlwifi: assume the driver_data is a trans_cfg, but allow full cfg

  * [FOCAL][REGRESSION] Intel Gen 9 brightness cannot be controlled
    (LP: #1861521)
    - Revert "USUNTU: SAUCE: drm/i915: Force DPCD backlight mode on Dell Precision
      4K sku"
    - Revert "UBUNTU: SAUCE: drm/i915: Force DPCD backlight mode on X1 Extreme 2nd
      Gen 4K AMOLED panel"
    - SAUCE: drm/dp: Introduce EDID-based quirks
    - SAUCE: drm/i915: Force DPCD backlight mode on X1 Extreme 2nd Gen 4K AMOLED
      panel
    - SAUCE: drm/i915: Force DPCD backlight mode for some Dell CML 2020 panels

  * [20.04 FEAT] Enable proper kprobes on ftrace support (LP: #1865858)
    - s390/ftrace: save traced function caller
    - s390: support KPROBES_ON_FTRACE

  * alsa/sof: load different firmware on different platforms (LP: #1857409)
    - ASoC: SOF: Intel: hda: use fallback for firmware name
    - ASoC: Intel: acpi-match: split CNL tables in three
    - ASoC: SOF: Intel: Fix CFL and CML FW nocodec binary names.

  * [UBUNTU 20.04] Enable CONFIG_NET_SWITCHDEV in kernel config for s390x
    starting with focal (LP: #1865452)
    - [Config] Enable CONFIG_NET_SWITCHDEV in kernel config for s390x starting
      with focal

  * Focal update: v5.4.24 upstream stable release (LP: #1866333)
    - io_uring: grab ->fs as part of async offload
    - EDAC: skx_common: downgrade message importance on missing PCI device
    - net: dsa: b53: Ensure the default VID is untagged
    - net: fib_rules: Correctly set table field when table number exceeds 8 bit...

Changed in linux (Ubuntu):
status: In Progress → Fix Released
Ike Panhc (ikepanhc)
Changed in kunpeng920:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.