]> Git Repo - J-linux.git/commitdiff
mhi: pci_generic: Print warning in case of firmware crash
authorLoic Poulain <[email protected]>
Wed, 3 Feb 2021 16:39:42 +0000 (17:39 +0100)
committerManivannan Sadhasivam <[email protected]>
Fri, 5 Feb 2021 12:28:49 +0000 (17:58 +0530)
Print warning when MHI detects sys error.

Signed-off-by: Loic Poulain <[email protected]>
Reviewed-by: Hemant Kumar <[email protected]>
Reviewed-by: Manivannan Sadhasivam <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Manivannan Sadhasivam <[email protected]>
drivers/bus/mhi/pci_generic.c

index 444693e3fd72ad55d01823b0f891d64d75e9cbd8..2476041f8d56d5816c5a1d45e50f6a96edda1836 100644 (file)
@@ -217,7 +217,17 @@ static void mhi_pci_write_reg(struct mhi_controller *mhi_cntrl,
 static void mhi_pci_status_cb(struct mhi_controller *mhi_cntrl,
                              enum mhi_callback cb)
 {
+       struct pci_dev *pdev = to_pci_dev(mhi_cntrl->cntrl_dev);
+
        /* Nothing to do for now */
+       switch (cb) {
+       case MHI_CB_FATAL_ERROR:
+       case MHI_CB_SYS_ERROR:
+               dev_warn(&pdev->dev, "firmware crashed (%u)\n", cb);
+               break;
+       default:
+               break;
+       }
 }
 
 static bool mhi_pci_is_alive(struct mhi_controller *mhi_cntrl)
This page took 0.053206 seconds and 4 git commands to generate.