Skip to content

Commit 4a3107f

Browse files
Rajendra Nayakandersson
authored andcommitted
tty: serial: qcom-geni-serial: Drop the icc bw votes in suspend for console
When using the geni-serial as console, its important to be able to hit the lowest possible power state in suspend, even with no_console_suspend. The only thing that prevents it today on platforms like the sc7180 is the interconnect BW votes, which we certainly don't need when the system is in suspend. So in the suspend handler mark them as ACTIVE_ONLY (0x3) and on resume switch them back to the ALWAYS tag (0x7) Signed-off-by: Rajendra Nayak <[email protected]> Reviewed-by: Akash Asthana <[email protected]> Tested-by: Matthias Kaehlcke <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Andersson <[email protected]>
1 parent 650c8bd commit 4a3107f

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

drivers/soc/qcom/qcom-geni-se.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,15 @@ int geni_icc_set_bw(struct geni_se *se)
771771
}
772772
EXPORT_SYMBOL(geni_icc_set_bw);
773773

774+
void geni_icc_set_tag(struct geni_se *se, u32 tag)
775+
{
776+
int i;
777+
778+
for (i = 0; i < ARRAY_SIZE(se->icc_paths); i++)
779+
icc_set_tag(se->icc_paths[i].path, tag);
780+
}
781+
EXPORT_SYMBOL(geni_icc_set_tag);
782+
774783
/* To do: Replace this by icc_bulk_enable once it's implemented in ICC core */
775784
int geni_icc_enable(struct geni_se *se)
776785
{

drivers/tty/serial/qcom_geni_serial.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1505,16 +1505,30 @@ static int __maybe_unused qcom_geni_serial_sys_suspend(struct device *dev)
15051505
struct uart_port *uport = &port->uport;
15061506
struct qcom_geni_private_data *private_data = uport->private_data;
15071507

1508+
/*
1509+
* This is done so we can hit the lowest possible state in suspend
1510+
* even with no_console_suspend
1511+
*/
1512+
if (uart_console(uport)) {
1513+
geni_icc_set_tag(&port->se, 0x3);
1514+
geni_icc_set_bw(&port->se);
1515+
}
15081516
return uart_suspend_port(private_data->drv, uport);
15091517
}
15101518

15111519
static int __maybe_unused qcom_geni_serial_sys_resume(struct device *dev)
15121520
{
1521+
int ret;
15131522
struct qcom_geni_serial_port *port = dev_get_drvdata(dev);
15141523
struct uart_port *uport = &port->uport;
15151524
struct qcom_geni_private_data *private_data = uport->private_data;
15161525

1517-
return uart_resume_port(private_data->drv, uport);
1526+
ret = uart_resume_port(private_data->drv, uport);
1527+
if (uart_console(uport)) {
1528+
geni_icc_set_tag(&port->se, 0x7);
1529+
geni_icc_set_bw(&port->se);
1530+
}
1531+
return ret;
15181532
}
15191533

15201534
static const struct dev_pm_ops qcom_geni_serial_pm_ops = {

include/linux/qcom-geni-se.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,7 @@ void geni_se_rx_dma_unprep(struct geni_se *se, dma_addr_t iova, size_t len);
454454
int geni_icc_get(struct geni_se *se, const char *icc_ddr);
455455

456456
int geni_icc_set_bw(struct geni_se *se);
457+
void geni_icc_set_tag(struct geni_se *se, u32 tag);
457458

458459
int geni_icc_enable(struct geni_se *se);
459460

0 commit comments

Comments
 (0)