[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e5nhd5hgu7peewiaxn6wdjlopaixntgu7zc6d7twhjgglt46rh@hymyien7z5wy>
Date: Fri, 5 Sep 2025 20:26:24 +0530
From: Manivannan Sadhasivam <mani@...nel.org>
To: Vivek.Pernamitta@...cinc.com
Cc: mhi@...ts.linux.dev, linux-arm-msm@...r.kernel.org,
linux-kernel@...r.kernel.org, Vivek Pernamitta <quic_vpernami@...cinc.com>
Subject: Re: [PATCH v3 4/6] bus: mhi: host: pci_generic: Remove MHI driver
and ensure graceful device recovery
On Thu, Aug 21, 2025 at 06:25:36PM GMT, Vivek.Pernamitta@...cinc.com wrote:
> From: Vivek Pernamitta <quic_vpernami@...cinc.com>
>
> So, When the MHI driver is removed from the host side, it is essential to
> ensure a clean and stable recovery of the device.
You need to mention why it is essential. What will happen otherwise.
> This commit introduces
> the following steps to achieve that:
>
> 1. Disable SR-IOV for any SR-IOV-enabled devices on the Physical Function.
> 2. Perform a SOC_RESET on the PF to fully reset the device.
>
> Disabling SR-IOV ensures all Virtual Functions (VFs) are properly shutdown,
> preventing issues during the reset process. The SOC_RESET guarantees that
> the PF is restored to a known good state.
>
Again, no reasoning was provided why this is necessary.
> Note:
> - The QDU100 platform supports 1 PF and 16 VFs.
> - QDU100 does not support Function Level Reset (FLR) due to a hardware
> limitation. As a result, SOC_RESET is used to reset the device.
> - On QDU100, any VF failure can cause the entire endpoint (EP)
> to go down, making this recovery mechanism critical.
>
This comment about QDU100 doesn't belong to this patch as this patch is not at
all related to QDU100.
> Signed-off-by: Vivek Pernamitta <quic_vpernami@...cinc.com>
> ---
> drivers/bus/mhi/host/pci_generic.c | 14 +++++++++++++-
> 1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/bus/mhi/host/pci_generic.c b/drivers/bus/mhi/host/pci_generic.c
> index 351b177cdf84057fb5a4e2f5b52279d7f1da41c2..f922cca0ab633aeae942587f0c40038342ce9c33 100644
> --- a/drivers/bus/mhi/host/pci_generic.c
> +++ b/drivers/bus/mhi/host/pci_generic.c
> @@ -45,6 +45,8 @@
> * @sideband_wake: Devices using dedicated sideband GPIO for wakeup instead
> * of inband wake support (such as sdx24)
> * @no_m3: M3 not supported
> + * @reset_on_remove: Set true for devices support SOC reset and perform it
> + * while drivee remove
driver
Maybe reword it to:
'Set true for devices that require SoC during driver removal'
> */
> struct mhi_pci_dev_info {
> const struct mhi_controller_config *config;
> @@ -58,6 +60,7 @@ struct mhi_pci_dev_info {
> unsigned int mru_default;
> bool sideband_wake;
> bool no_m3;
> + bool reset_on_remove;
> };
>
> #define MHI_CHANNEL_CONFIG_UL(ch_num, ch_name, el_count, ev_ring) \
> @@ -300,6 +303,7 @@ static const struct mhi_pci_dev_info mhi_qcom_qdu100_info = {
> .dma_data_width = 32,
> .sideband_wake = false,
> .no_m3 = true,
> + .reset_on_remove = true,
> };
>
> static const struct mhi_channel_config mhi_qcom_sa8775p_channels[] = {
> @@ -1039,6 +1043,7 @@ struct mhi_pci_device {
> struct work_struct recovery_work;
> struct timer_list health_check_timer;
> unsigned long status;
> + bool reset_on_remove;
> };
>
> static int mhi_pci_read_reg(struct mhi_controller *mhi_cntrl,
> @@ -1323,7 +1328,6 @@ static int mhi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
> else
> mhi_cntrl_config = info->config;
>
> - /* Initialize health check monitor only for Physical functions */
Spurious change?
- Mani
--
மணிவண்ணன் சதாசிவம்
Powered by blists - more mailing lists