[PATCH v3 net-next 4/5] net: wwan: t7xx: Enable devlink based fw flashing and coredump collection

Jesse Brandeburg jesse.brandeburg at intel.com
Fri Jan 6 10:50:06 PST 2023


On 1/6/2023 8:27 AM, m.chetan.kumar at linux.intel.com wrote:
> From: M Chetan Kumar <m.chetan.kumar at linux.intel.com>
> 
> Adds support for t7xx wwan device firmware flashing & coredump collection
> using devlink.
> 
> 1> Driver Registers with Devlink framework.
> 2> Implements devlink ops flash_update callback that programs modem fw.
> 3> Creates region & snapshot required for device coredump log collection.
> 
> 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 completion status is
> reported to user space application.
> 
> 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
> 
> Signed-off-by: M Chetan Kumar <m.chetan.kumar at linux.intel.com>
> Signed-off-by: Devegowda Chandrashekar <chandrashekar.devegowda at intel.com>
> Signed-off-by: Mishra Soumya Prakash <soumya.prakash.mishra at intel.com>
> --
> v3:
>   * No Change.
> v2:
>   * Remove devlink pointer inside the port state container.
>   * Rename t7xx_devlink_region_list to t7xx_devlink_region_infos &
>     use region index in initialization.
>   * Change t7xx_devlink_region_infos to const.
>   * Handle remaining packet data if the buffer is less than the skb data.
>   * Drop t7xx_devlink_fb_send_buffer(), push fragmentation logic to
>     t7xx_devlink_port_write().
>   * Add "\n" to log message.
>   * Move mrdump_region allocation to devlink initialization.
>   * Drop snprintf for CTS command fill.
>   * Drop intermediate mdata buffer & zipsize.
>   * For mcmd use strcmp instead of strncmp.
>   * Drop set_fastboot_dl instead use devlink param for fastboot operational mode.
>   * Drop unnecessary logs.
>   * Change t7xx_devlink_create_region to t7xx_devlink_create_regions.
>   * Use BUILD_BUG_ON on array size checks.
>   * Use ARRAY_SIZE inside loop.
>   * Correct indentation.
>   * Drop odd empty line.
>   * Push common devlink initialization code to t7xx_devlink_init.
>   * Use skb_queue_purge instead of running loop to free skbs.
>   * Change t7xx_regions index to enums.
>   * Remove dev in devlink container.
>   * Refactor struct to separate out devlink static and dynamic data structs.
>   * Use min_t.
>   * Drop unnecessary var assginment during initialization.
>   * Change while() to for().
>   * Correct size check.
>   * Rename result to ret.
>   * Clean-up error handling path in t7xx_devlink_fb_get_core & t7xx_devlink_fb_dump_log.
>   * Drop __func__ in log message.
>   * Change NOTY to NOTIFY.
>   * Push channel enable or disable cb to port proxy.
>   * Use array index in t7xx_devlink_region_list initialization.
>   * Drop t7xx_port_proxy_get_port_by_name() instead access port name directly via port_prox.
>   * Drop udev based event reporting logic.
>   * Drop get_core prefix in goto label.
>   * Remove unnessary header files.
>   * Allocate memory for mrdump_region->buf inside get_core.
>   * Remove 'region->buf' in t7xx_devlink_region_snapshot.
>   * Destroy workqueue on following error case in 'devlink_init'.
>   * Remove useless checks(dl->mode) and condition(dl->wq).
>   * Support devlink component versioning.
>   * Kconfig changes to select devlink.

LGTM, but I wouldn't mind having someone with more devlink flash 
experience review.

Reviewed-by: Jesse Brandeburg <jesse.brandeburg at intel.com>





More information about the Linux-mediatek mailing list