@@ -549,12 +549,13 @@ static struct kunit_suite clk_range_test_suite = {
549549};
550550
551551/*
552- * Test that if we have several subsequent calls to
553- * clk_set_rate_range(), the core will reevaluate whether a new rate is
554- * needed each and every time.
552+ * Test that if:
553+ * - we have several subsequent calls to clk_set_rate_range();
554+ * - and we have a round_rate ops that always return the maximum
555+ * frequency allowed;
555556 *
556- * With clk_dummy_maximize_rate_ops, this means that the rate will
557- * trail along the maximum as it evolves .
557+ * The clock will run at the minimum of all maximum boundaries
558+ * requested, even if those boundaries aren't there anymore .
558559 */
559560static void clk_range_test_set_range_rate_maximized (struct kunit * test )
560561{
@@ -595,16 +596,18 @@ static void clk_range_test_set_range_rate_maximized(struct kunit *test)
595596
596597 rate = clk_get_rate (clk );
597598 KUNIT_ASSERT_GT (test , rate , 0 );
598- KUNIT_EXPECT_EQ (test , rate , DUMMY_CLOCK_RATE_2 );
599+ KUNIT_EXPECT_EQ (test , rate , DUMMY_CLOCK_RATE_2 - 1000 );
599600}
600601
601602/*
602- * Test that if we have several subsequent calls to
603- * clk_set_rate_range(), across multiple users, the core will reevaluate
604- * whether a new rate is needed each and every time.
603+ * Test that if:
604+ * - we have several subsequent calls to clk_set_rate_range(), across
605+ * multiple users;
606+ * - and we have a round_rate ops that always return the maximum
607+ * frequency allowed;
605608 *
606- * With clk_dummy_maximize_rate_ops, this means that the rate will
607- * trail along the maximum as it evolves .
609+ * The clock will run at the minimum of all maximum boundaries
610+ * requested, even if those boundaries aren't there anymore .
608611 */
609612static void clk_range_test_multiple_set_range_rate_maximized (struct kunit * test )
610613{
@@ -650,7 +653,7 @@ static void clk_range_test_multiple_set_range_rate_maximized(struct kunit *test)
650653
651654 rate = clk_get_rate (clk );
652655 KUNIT_ASSERT_GT (test , rate , 0 );
653- KUNIT_EXPECT_EQ (test , rate , DUMMY_CLOCK_RATE_2 );
656+ KUNIT_EXPECT_EQ (test , rate , DUMMY_CLOCK_RATE_1 );
654657
655658 clk_put (user2 );
656659 clk_put (user1 );
@@ -670,12 +673,13 @@ static struct kunit_suite clk_range_maximize_test_suite = {
670673};
671674
672675/*
673- * Test that if we have several subsequent calls to
674- * clk_set_rate_range(), the core will reevaluate whether a new rate is
675- * needed each and every time.
676+ * Test that if:
677+ * - we have several subsequent calls to clk_set_rate_range()
678+ * - and we have a round_rate ops that always return the minimum
679+ * frequency allowed;
676680 *
677- * With clk_dummy_minimize_rate_ops, this means that the rate will
678- * trail along the minimum as it evolves .
681+ * The clock will run at the maximum of all minimum boundaries
682+ * requested, even if those boundaries aren't there anymore .
679683 */
680684static void clk_range_test_set_range_rate_minimized (struct kunit * test )
681685{
@@ -716,16 +720,18 @@ static void clk_range_test_set_range_rate_minimized(struct kunit *test)
716720
717721 rate = clk_get_rate (clk );
718722 KUNIT_ASSERT_GT (test , rate , 0 );
719- KUNIT_EXPECT_EQ (test , rate , DUMMY_CLOCK_RATE_1 );
723+ KUNIT_EXPECT_EQ (test , rate , DUMMY_CLOCK_RATE_1 + 1000 );
720724}
721725
722726/*
723- * Test that if we have several subsequent calls to
724- * clk_set_rate_range(), across multiple users, the core will reevaluate
725- * whether a new rate is needed each and every time.
727+ * Test that if:
728+ * - we have several subsequent calls to clk_set_rate_range(), across
729+ * multiple users;
730+ * - and we have a round_rate ops that always return the minimum
731+ * frequency allowed;
726732 *
727- * With clk_dummy_minimize_rate_ops, this means that the rate will
728- * trail along the minimum as it evolves .
733+ * The clock will run at the maximum of all minimum boundaries
734+ * requested, even if those boundaries aren't there anymore .
729735 */
730736static void clk_range_test_multiple_set_range_rate_minimized (struct kunit * test )
731737{
@@ -767,7 +773,7 @@ static void clk_range_test_multiple_set_range_rate_minimized(struct kunit *test)
767773
768774 rate = clk_get_rate (clk );
769775 KUNIT_ASSERT_GT (test , rate , 0 );
770- KUNIT_EXPECT_EQ (test , rate , DUMMY_CLOCK_RATE_1 );
776+ KUNIT_EXPECT_EQ (test , rate , DUMMY_CLOCK_RATE_2 );
771777
772778 clk_put (user2 );
773779 clk_put (user1 );
0 commit comments