Loading Documentation/devicetree/bindings/arm/msm/bam_dmux.txt +2 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,7 @@ Optional properties: Default is 2048. Other possible values are 4096, 8192, and 16384. -qcom,no-cpu-affinity: boolean value indicating that workqueue CPU affinity is not required. -qcom,fast-shutdown: boolean value to support fast shutdown time. Example: Loading @@ -23,4 +24,5 @@ Example: qcom,rx-ring-size = <64>; qcom,max-rx-mtu = <8192>; qcom,no-cpu-affinity; qcom,fast-shutdown; }; drivers/soc/qcom/bam_dmux.c +16 −6 Original line number Diff line number Diff line Loading @@ -230,8 +230,10 @@ static struct srcu_struct bam_dmux_srcu; /* A2 power collaspe */ #define UL_TIMEOUT_DELAY 1000 /* in ms */ #define UL_FAST_TIMEOUT_DELAY 100 /* in ms */ #define SHUTDOWN_TIMEOUT_MS 500 #define UL_WAKEUP_TIMEOUT_MS 2000 static uint32_t ul_timeout_delay = UL_TIMEOUT_DELAY; static void toggle_apps_ack(void); static void reconnect_to_bam(void); static void disconnect_to_bam(void); Loading Loading @@ -1811,7 +1813,7 @@ static void ul_timeout(struct work_struct *work) ret = write_trylock_irqsave(&ul_wakeup_lock, flags); if (!ret) { /* failed to grab lock, reschedule and bail */ schedule_delayed_work(&ul_timeout_work, msecs_to_jiffies(UL_TIMEOUT_DELAY)); msecs_to_jiffies(ul_timeout_delay)); return; } if (bam_is_connected) { Loading @@ -1835,7 +1837,7 @@ static void ul_timeout(struct work_struct *work) __func__, ul_packet_written); ul_packet_written = 0; schedule_delayed_work(&ul_timeout_work, msecs_to_jiffies(UL_TIMEOUT_DELAY)); msecs_to_jiffies(ul_timeout_delay)); } else { ul_powerdown(); } Loading Loading @@ -1922,7 +1924,7 @@ static void ul_wakeup(void) if (likely(do_vote_dfab)) vote_dfab(); schedule_delayed_work(&ul_timeout_work, msecs_to_jiffies(UL_TIMEOUT_DELAY)); msecs_to_jiffies(ul_timeout_delay)); bam_is_connected = 1; mutex_unlock(&wakeup_lock); return; Loading Loading @@ -1967,7 +1969,7 @@ static void ul_wakeup(void) bam_is_connected = 1; BAM_DMUX_LOG("%s complete\n", __func__); schedule_delayed_work(&ul_timeout_work, msecs_to_jiffies(UL_TIMEOUT_DELAY)); msecs_to_jiffies(ul_timeout_delay)); mutex_unlock(&wakeup_lock); } Loading Loading @@ -2667,8 +2669,15 @@ static int bam_dmux_probe(struct platform_device *pdev) no_cpu_affinity = of_property_read_bool(pdev->dev.of_node, "qcom,no-cpu-affinity"); rc = of_property_read_bool(pdev->dev.of_node, "qcom,fast-shutdown"); if (rc) { ul_timeout_delay = UL_FAST_TIMEOUT_DELAY; } BAM_DMUX_LOG( "%s: base:%p size:%x irq:%d satellite:%d num_buffs:%d dl_mtu:%x cpu-affinity:%d\n", "%s: base:%p size:%x irq:%d satellite:%d num_buffs:%d dl_mtu:%x cpu-affinity:%d ul_timeout_delay:%d\n", __func__, (void *)(uintptr_t)a2_phys_base, a2_phys_size, Loading @@ -2676,7 +2685,8 @@ static int bam_dmux_probe(struct platform_device *pdev) satellite_mode, num_buffers, dl_mtu, no_cpu_affinity); no_cpu_affinity, ul_timeout_delay); } else { /* fallback to default init data */ a2_phys_base = A2_PHYS_BASE; a2_phys_size = A2_PHYS_SIZE; Loading Loading
Documentation/devicetree/bindings/arm/msm/bam_dmux.txt +2 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,7 @@ Optional properties: Default is 2048. Other possible values are 4096, 8192, and 16384. -qcom,no-cpu-affinity: boolean value indicating that workqueue CPU affinity is not required. -qcom,fast-shutdown: boolean value to support fast shutdown time. Example: Loading @@ -23,4 +24,5 @@ Example: qcom,rx-ring-size = <64>; qcom,max-rx-mtu = <8192>; qcom,no-cpu-affinity; qcom,fast-shutdown; };
drivers/soc/qcom/bam_dmux.c +16 −6 Original line number Diff line number Diff line Loading @@ -230,8 +230,10 @@ static struct srcu_struct bam_dmux_srcu; /* A2 power collaspe */ #define UL_TIMEOUT_DELAY 1000 /* in ms */ #define UL_FAST_TIMEOUT_DELAY 100 /* in ms */ #define SHUTDOWN_TIMEOUT_MS 500 #define UL_WAKEUP_TIMEOUT_MS 2000 static uint32_t ul_timeout_delay = UL_TIMEOUT_DELAY; static void toggle_apps_ack(void); static void reconnect_to_bam(void); static void disconnect_to_bam(void); Loading Loading @@ -1811,7 +1813,7 @@ static void ul_timeout(struct work_struct *work) ret = write_trylock_irqsave(&ul_wakeup_lock, flags); if (!ret) { /* failed to grab lock, reschedule and bail */ schedule_delayed_work(&ul_timeout_work, msecs_to_jiffies(UL_TIMEOUT_DELAY)); msecs_to_jiffies(ul_timeout_delay)); return; } if (bam_is_connected) { Loading @@ -1835,7 +1837,7 @@ static void ul_timeout(struct work_struct *work) __func__, ul_packet_written); ul_packet_written = 0; schedule_delayed_work(&ul_timeout_work, msecs_to_jiffies(UL_TIMEOUT_DELAY)); msecs_to_jiffies(ul_timeout_delay)); } else { ul_powerdown(); } Loading Loading @@ -1922,7 +1924,7 @@ static void ul_wakeup(void) if (likely(do_vote_dfab)) vote_dfab(); schedule_delayed_work(&ul_timeout_work, msecs_to_jiffies(UL_TIMEOUT_DELAY)); msecs_to_jiffies(ul_timeout_delay)); bam_is_connected = 1; mutex_unlock(&wakeup_lock); return; Loading Loading @@ -1967,7 +1969,7 @@ static void ul_wakeup(void) bam_is_connected = 1; BAM_DMUX_LOG("%s complete\n", __func__); schedule_delayed_work(&ul_timeout_work, msecs_to_jiffies(UL_TIMEOUT_DELAY)); msecs_to_jiffies(ul_timeout_delay)); mutex_unlock(&wakeup_lock); } Loading Loading @@ -2667,8 +2669,15 @@ static int bam_dmux_probe(struct platform_device *pdev) no_cpu_affinity = of_property_read_bool(pdev->dev.of_node, "qcom,no-cpu-affinity"); rc = of_property_read_bool(pdev->dev.of_node, "qcom,fast-shutdown"); if (rc) { ul_timeout_delay = UL_FAST_TIMEOUT_DELAY; } BAM_DMUX_LOG( "%s: base:%p size:%x irq:%d satellite:%d num_buffs:%d dl_mtu:%x cpu-affinity:%d\n", "%s: base:%p size:%x irq:%d satellite:%d num_buffs:%d dl_mtu:%x cpu-affinity:%d ul_timeout_delay:%d\n", __func__, (void *)(uintptr_t)a2_phys_base, a2_phys_size, Loading @@ -2676,7 +2685,8 @@ static int bam_dmux_probe(struct platform_device *pdev) satellite_mode, num_buffers, dl_mtu, no_cpu_affinity); no_cpu_affinity, ul_timeout_delay); } else { /* fallback to default init data */ a2_phys_base = A2_PHYS_BASE; a2_phys_size = A2_PHYS_SIZE; Loading