Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: qcom: gcc-sdm845: Do not use shared clk_ops for QUPs

Similar to the earlier fixes meant for sm8x50 and x1e platforms,
we have to stop using the shared clk ops for sdm845 QUPs as well.

As Stephen Boyd pointed out in earlier fixes, there wasn't a problem
to mark QUP clks shared until we started parking shared RCGs at clk
registration time in commit 01a0a6cc8cfd ("clk: qcom: Park shared RCGs
upon registration"). Parking at init is actually harmful to the UART
when earlycon is used. If the device is pumping out data while the
frequency changes and we see garbage on the serial console until the
driver can probe and actually set a proper frequency.

This patch reverts the QUP clk sharing ops part of commit 06391eddb60a
("clk: qcom: Add Global Clock controller (GCC) driver for SDM845"), so
that the QUPs on sdm845 don't get parked during clk registration and
break UART operations.

Fixes: 01a0a6cc8cfd ("clk: qcom: Park shared RCGs upon registration")
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Link: https://lore.kernel.org/r/20241209174912.2526928-1-amit.pundir@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>

authored by

Amit Pundir and committed by
Bjorn Andersson
f760a4bb 898b72fa

+16 -16
+16 -16
drivers/clk/qcom/gcc-sdm845.c
··· 449 449 .name = "gcc_qupv3_wrap0_s0_clk_src", 450 450 .parent_data = gcc_parent_data_0, 451 451 .num_parents = ARRAY_SIZE(gcc_parent_data_0), 452 - .ops = &clk_rcg2_shared_ops, 452 + .ops = &clk_rcg2_ops, 453 453 }; 454 454 455 455 static struct clk_rcg2 gcc_qupv3_wrap0_s0_clk_src = { ··· 465 465 .name = "gcc_qupv3_wrap0_s1_clk_src", 466 466 .parent_data = gcc_parent_data_0, 467 467 .num_parents = ARRAY_SIZE(gcc_parent_data_0), 468 - .ops = &clk_rcg2_shared_ops, 468 + .ops = &clk_rcg2_ops, 469 469 }; 470 470 471 471 static struct clk_rcg2 gcc_qupv3_wrap0_s1_clk_src = { ··· 481 481 .name = "gcc_qupv3_wrap0_s2_clk_src", 482 482 .parent_data = gcc_parent_data_0, 483 483 .num_parents = ARRAY_SIZE(gcc_parent_data_0), 484 - .ops = &clk_rcg2_shared_ops, 484 + .ops = &clk_rcg2_ops, 485 485 }; 486 486 487 487 static struct clk_rcg2 gcc_qupv3_wrap0_s2_clk_src = { ··· 497 497 .name = "gcc_qupv3_wrap0_s3_clk_src", 498 498 .parent_data = gcc_parent_data_0, 499 499 .num_parents = ARRAY_SIZE(gcc_parent_data_0), 500 - .ops = &clk_rcg2_shared_ops, 500 + .ops = &clk_rcg2_ops, 501 501 }; 502 502 503 503 static struct clk_rcg2 gcc_qupv3_wrap0_s3_clk_src = { ··· 513 513 .name = "gcc_qupv3_wrap0_s4_clk_src", 514 514 .parent_data = gcc_parent_data_0, 515 515 .num_parents = ARRAY_SIZE(gcc_parent_data_0), 516 - .ops = &clk_rcg2_shared_ops, 516 + .ops = &clk_rcg2_ops, 517 517 }; 518 518 519 519 static struct clk_rcg2 gcc_qupv3_wrap0_s4_clk_src = { ··· 529 529 .name = "gcc_qupv3_wrap0_s5_clk_src", 530 530 .parent_data = gcc_parent_data_0, 531 531 .num_parents = ARRAY_SIZE(gcc_parent_data_0), 532 - .ops = &clk_rcg2_shared_ops, 532 + .ops = &clk_rcg2_ops, 533 533 }; 534 534 535 535 static struct clk_rcg2 gcc_qupv3_wrap0_s5_clk_src = { ··· 545 545 .name = "gcc_qupv3_wrap0_s6_clk_src", 546 546 .parent_data = gcc_parent_data_0, 547 547 .num_parents = ARRAY_SIZE(gcc_parent_data_0), 548 - .ops = &clk_rcg2_shared_ops, 548 + .ops = &clk_rcg2_ops, 549 549 }; 550 550 551 551 static struct clk_rcg2 gcc_qupv3_wrap0_s6_clk_src = { ··· 561 561 .name = "gcc_qupv3_wrap0_s7_clk_src", 562 562 .parent_data = gcc_parent_data_0, 563 563 .num_parents = ARRAY_SIZE(gcc_parent_data_0), 564 - .ops = &clk_rcg2_shared_ops, 564 + .ops = &clk_rcg2_ops, 565 565 }; 566 566 567 567 static struct clk_rcg2 gcc_qupv3_wrap0_s7_clk_src = { ··· 577 577 .name = "gcc_qupv3_wrap1_s0_clk_src", 578 578 .parent_data = gcc_parent_data_0, 579 579 .num_parents = ARRAY_SIZE(gcc_parent_data_0), 580 - .ops = &clk_rcg2_shared_ops, 580 + .ops = &clk_rcg2_ops, 581 581 }; 582 582 583 583 static struct clk_rcg2 gcc_qupv3_wrap1_s0_clk_src = { ··· 593 593 .name = "gcc_qupv3_wrap1_s1_clk_src", 594 594 .parent_data = gcc_parent_data_0, 595 595 .num_parents = ARRAY_SIZE(gcc_parent_data_0), 596 - .ops = &clk_rcg2_shared_ops, 596 + .ops = &clk_rcg2_ops, 597 597 }; 598 598 599 599 static struct clk_rcg2 gcc_qupv3_wrap1_s1_clk_src = { ··· 609 609 .name = "gcc_qupv3_wrap1_s2_clk_src", 610 610 .parent_data = gcc_parent_data_0, 611 611 .num_parents = ARRAY_SIZE(gcc_parent_data_0), 612 - .ops = &clk_rcg2_shared_ops, 612 + .ops = &clk_rcg2_ops, 613 613 }; 614 614 615 615 static struct clk_rcg2 gcc_qupv3_wrap1_s2_clk_src = { ··· 625 625 .name = "gcc_qupv3_wrap1_s3_clk_src", 626 626 .parent_data = gcc_parent_data_0, 627 627 .num_parents = ARRAY_SIZE(gcc_parent_data_0), 628 - .ops = &clk_rcg2_shared_ops, 628 + .ops = &clk_rcg2_ops, 629 629 }; 630 630 631 631 static struct clk_rcg2 gcc_qupv3_wrap1_s3_clk_src = { ··· 641 641 .name = "gcc_qupv3_wrap1_s4_clk_src", 642 642 .parent_data = gcc_parent_data_0, 643 643 .num_parents = ARRAY_SIZE(gcc_parent_data_0), 644 - .ops = &clk_rcg2_shared_ops, 644 + .ops = &clk_rcg2_ops, 645 645 }; 646 646 647 647 static struct clk_rcg2 gcc_qupv3_wrap1_s4_clk_src = { ··· 657 657 .name = "gcc_qupv3_wrap1_s5_clk_src", 658 658 .parent_data = gcc_parent_data_0, 659 659 .num_parents = ARRAY_SIZE(gcc_parent_data_0), 660 - .ops = &clk_rcg2_shared_ops, 660 + .ops = &clk_rcg2_ops, 661 661 }; 662 662 663 663 static struct clk_rcg2 gcc_qupv3_wrap1_s5_clk_src = { ··· 673 673 .name = "gcc_qupv3_wrap1_s6_clk_src", 674 674 .parent_data = gcc_parent_data_0, 675 675 .num_parents = ARRAY_SIZE(gcc_parent_data_0), 676 - .ops = &clk_rcg2_shared_ops, 676 + .ops = &clk_rcg2_ops, 677 677 }; 678 678 679 679 static struct clk_rcg2 gcc_qupv3_wrap1_s6_clk_src = { ··· 689 689 .name = "gcc_qupv3_wrap1_s7_clk_src", 690 690 .parent_data = gcc_parent_data_0, 691 691 .num_parents = ARRAY_SIZE(gcc_parent_data_0), 692 - .ops = &clk_rcg2_shared_ops, 692 + .ops = &clk_rcg2_ops, 693 693 }; 694 694 695 695 static struct clk_rcg2 gcc_qupv3_wrap1_s7_clk_src = {