Forráskód Böngészése

Enable Kernel Panic through ioctl

- Add  new ioctl command (BT_CMD_KERNEL_PANIC),
so that when it is called, the kernel panics.
- Add unique message that gets printed when
kernel panic.

Change-Id: Ied82749020058fe8e091f7fd5f0f212edb9a7285
Franklin Abreu Bueno 2 éve
szülő
commit
b4c65a7e1e
2 módosított fájl, 14 hozzáadás és 9 törlés
  1. 8 7
      include/btpower.h
  2. 6 2
      pwr/btpower.c

+ 8 - 7
include/btpower.h

@@ -90,13 +90,14 @@ int btpower_aop_mbox_init(struct btpower_platform_data *pdata);
 int bt_aop_pdc_reconfig(struct btpower_platform_data *pdata);
 
 #define WLAN_SW_CTRL_GPIO       "qcom,wlan-sw-ctrl-gpio"
-#define BT_CMD_SLIM_TEST	0xbfac
-#define BT_CMD_PWR_CTRL		0xbfad
-#define BT_CMD_CHIPSET_VERS	0xbfae
-#define BT_CMD_GET_CHIPSET_ID	0xbfaf
-#define BT_CMD_CHECK_SW_CTRL	0xbfb0
-#define BT_CMD_GETVAL_POWER_SRCS	0xbfb1
-#define BT_CMD_SET_IPA_TCS_INFO  0xbfc0
+#define BT_CMD_SLIM_TEST            0xbfac
+#define BT_CMD_PWR_CTRL             0xbfad
+#define BT_CMD_CHIPSET_VERS         0xbfae
+#define BT_CMD_GET_CHIPSET_ID       0xbfaf
+#define BT_CMD_CHECK_SW_CTRL        0xbfb0
+#define BT_CMD_GETVAL_POWER_SRCS    0xbfb1
+#define BT_CMD_SET_IPA_TCS_INFO     0xbfc0
+#define BT_CMD_KERNEL_PANIC         0xbfc1
 
 #ifdef CONFIG_MSM_BT_OOBS
 #define BT_CMD_OBS_SIGNAL_TASK		0xbfd0

+ 6 - 2
pwr/btpower.c

@@ -1339,7 +1339,7 @@ static long bt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		}
 		break;
 	case BT_CMD_GETVAL_POWER_SRCS:
-		pr_err("BT_CMD_GETVAL_POWER_SRCS\n");
+		pr_info("BT_CMD_GETVAL_POWER_SRCS\n");
 		set_gpios_srcs_status("BT_RESET_GPIO", BT_RESET_GPIO_CURRENT,
 			bt_power_pdata->bt_gpio_sys_rst);
 		set_gpios_srcs_status("SW_CTRL_GPIO", BT_SW_CTRL_GPIO_CURRENT,
@@ -1357,9 +1357,13 @@ static long bt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		}
 		break;
 	case BT_CMD_SET_IPA_TCS_INFO:
-		pr_err("%s: BT_CMD_SET_IPA_TCS_INFO\n", __func__);
+		pr_info("%s: BT_CMD_SET_IPA_TCS_INFO\n", __func__);
 		btpower_enable_ipa_vreg(bt_power_pdata);
 		break;
+	case BT_CMD_KERNEL_PANIC:
+		pr_info("%s: BT_CMD_KERNEL_PANIC\n", __func__);
+		panic("subsys-restart: Resetting the SoC - Bluetooth crashed\n");
+		break;
 	default:
 		return -ENOIOCTLCMD;
 	}