lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <MEYP282MB2697DB3C2C854F72A78BE7F4BBE8A@MEYP282MB2697.AUSP282.PROD.OUTLOOK.COM>
Date:   Tue,  5 Sep 2023 19:26:32 +0800
From:   Jinjian Song <songjinjian@...mail.com>
To:     davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
        pabeni@...hat.com, corbet@....net, loic.poulain@...aro.org,
        ryazanov.s.a@...il.com
Cc:     jiri@...nulli.us, johannes@...solutions.net,
        chandrashekar.devegowda@...el.com, linuxwwan@...el.com,
        chiranjeevi.rapolu@...ux.intel.com, haijun.liu@...iatek.com,
        m.chetan.kumar@...ux.intel.com, ricardo.martinez@...ux.intel.com,
        netdev@...r.kernel.org, linux-doc@...r.kernel.org,
        linux-kernel@...r.kernel.org, nmarupaka@...gle.com,
        vsankar@...ovo.com, danielwinkler@...gle.com,
        Jinjian Song <songjinjian@...mail.com>
Subject: [net-next v3 0/5] net: wwan: t7xx: fw flashing & coredump support

Adds support for t7xx wwan device firmware flashing & coredump collection
using devlink.

On early detection of wwan device in fastboot mode driver sets up CLDMA0 HW
tx/rx queues for raw data transfer and then registers to devlink framework.
On user space application issuing command for firmware update the driver
sends fastboot flash command & firmware to program NAND.

In flashing procedure the fastboot command & response are exchanged between
driver and device. Once firmware flashing is success, user space application
get modem event by sysfs interface.

The devlink param fastboot is set to true via devlink param command.

$ devlink dev param set pci/0000:bdf name fastboot value 1 cmode driverinit

The wwan device is put into fastboot mode via devlink reload command, by
passing `driver_reinit`.

$ devlink dev reload pci/0000:$bdf action driver_reinit

Note: user space application get the fastboot download event of devcie
from /sys/bus/pci/devices/${bdf}/t7xx_event then do remove(echo 1 >
/sys/bus/pci/devices/${bdf}/remove) and rescan(echo 1 > /sys/bus/pci/rescan)
to let driver goes to firmware flash process.

Below is the devlink command usage for firmware flashing

$ devlink dev flash pci/$BDF file ABC.img component ABC

Note: ABC.img is the firmware to be programmed to "ABC" partition.

In case of coredump collection when wwan device encounters an exception
it reboots & stays in fastboot mode for coredump collection by host driver.
On detecting exception state driver collects the core dump, creates the
devlink region & reports an event to user space application for dump
collection. The user space application invokes devlink region read command
for dump collection.

Below are the devlink commands used for coredump collection.

$ devlink region new pci/$BDF/mr_dump
$ devlink region read pci/$BDF/mr_dump snapshot $ID address $ADD length $LEN
$ devlink region del pci/$BDF/mr_dump snapshot $ID

Upon completion of firmware flashing or coredump collection the wwan device
is reset to normal mode using devlink reload command, by passing `fw_activate`.

$ devlink dev reload pci/0000:$bdf action fw_activate

Note: user space application get the reset event of devcie
from /sys/bus/pci/devices/${bdf}/t7xx_event then do remove(echo 1 >
/sys/bus/pci/devices/${bdf}/remove) and rescan(echo 1 > /sys/bus/pci/rescan)
to let driver goes to normal process.

Jinjian Song (5):
  net: wwan: t7xx: Infrastructure for early port configuration
  net: wwan: t7xx: Register with devlink and implement firmware flashing
  net: wwan: t7xx: Creates region & snapshot for coredump log collection
  net: wwan: t7xx: Adds sysfs attribute of modem event
  net: wwan: t7xx: Devlink documentation

 Documentation/networking/devlink/index.rst   |   1 +
 Documentation/networking/devlink/t7xx.rst    | 232 +++++++
 drivers/net/wwan/Kconfig                     |   1 +
 drivers/net/wwan/t7xx/Makefile               |   4 +-
 drivers/net/wwan/t7xx/t7xx_hif_cldma.c       |  47 +-
 drivers/net/wwan/t7xx/t7xx_hif_cldma.h       |  18 +-
 drivers/net/wwan/t7xx/t7xx_modem_ops.c       |   5 +-
 drivers/net/wwan/t7xx/t7xx_pci.c             |  79 ++-
 drivers/net/wwan/t7xx/t7xx_pci.h             |  19 +
 drivers/net/wwan/t7xx/t7xx_port.h            |   6 +
 drivers/net/wwan/t7xx/t7xx_port_ap_msg.c     |  78 +++
 drivers/net/wwan/t7xx/t7xx_port_ap_msg.h     |  11 +
 drivers/net/wwan/t7xx/t7xx_port_flash_dump.c | 695 +++++++++++++++++++
 drivers/net/wwan/t7xx/t7xx_port_flash_dump.h |  85 +++
 drivers/net/wwan/t7xx/t7xx_port_proxy.c      | 118 +++-
 drivers/net/wwan/t7xx/t7xx_port_proxy.h      |  14 +
 drivers/net/wwan/t7xx/t7xx_port_wwan.c       |  27 +-
 drivers/net/wwan/t7xx/t7xx_reg.h             |  28 +-
 drivers/net/wwan/t7xx/t7xx_state_monitor.c   | 137 +++-
 drivers/net/wwan/t7xx/t7xx_state_monitor.h   |   1 +
 20 files changed, 1528 insertions(+), 78 deletions(-)
 create mode 100644 Documentation/networking/devlink/t7xx.rst
 create mode 100644 drivers/net/wwan/t7xx/t7xx_port_ap_msg.c
 create mode 100644 drivers/net/wwan/t7xx/t7xx_port_ap_msg.h
 create mode 100644 drivers/net/wwan/t7xx/t7xx_port_flash_dump.c
 create mode 100644 drivers/net/wwan/t7xx/t7xx_port_flash_dump.h

-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ