Received: by 2002:ab2:788f:0:b0:1ee:8f2e:70ae with SMTP id b15csp487508lqi; Thu, 7 Mar 2024 03:18:35 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXNBU/ZL4p25fLTvV/RqK0IK4Wuk1rZ4dAA0qREu/aCpHd/nRSc3aqurxQDh1fklBHp0yajkmYM+Ogu+xWN+HPSl5aMyK11FCOPIbwnsQ== X-Google-Smtp-Source: AGHT+IHlsubrK7aH7412PEgQovo6kV965SYYFstcNRrowjGl+/k7JiEfC+d35oeO+/7tQVeaiIWq X-Received: by 2002:a17:902:dad2:b0:1d9:a15:615d with SMTP id q18-20020a170902dad200b001d90a15615dmr1776635plx.1.1709810314793; Thu, 07 Mar 2024 03:18:34 -0800 (PST) Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id cp10-20020a170902e78a00b001dcf7bfc3eesi9661088plb.282.2024.03.07.03.18.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 03:18:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-95400-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@outlook.com header.s=selector1 header.b=aPCuvyrz; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-95400-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95400-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 0C7AFB213EA for ; Thu, 7 Mar 2024 11:18:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 96A5D128801; Thu, 7 Mar 2024 11:18:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=outlook.com header.i=@outlook.com header.b="aPCuvyrz" Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01olkn2011.outbound.protection.outlook.com [40.92.53.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B21E886AE9; Thu, 7 Mar 2024 11:18:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.92.53.11 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709810294; cv=fail; b=rwbD2WBc8luZG1/QHmJVKCwn3WO1wMFNyG1x0GTvkHAGaU+HWm8Cf3Dmr7FkgxIVioNJ2zxfShPsK4yXC+emebd3Q08TU8vD5aXvtpJ3KLgMdSr2fH9Grgg7XBzjqi3l1JtDHaIKdvYqvrwXP50Ggh3oWni+zsUL00vVPa7RM7I= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709810294; c=relaxed/simple; bh=e1UtNccqSuekjuyKQELIOccWaiKk4Et1imD2EF53NUc=; h=Message-ID:Date:Subject:To:Cc:References:From:In-Reply-To: Content-Type:MIME-Version; b=BfN+rE5IZuhrj07P1o3tjGgDc6MOufkGVlf9dmK4Ir0V7doxYZHv3zVEo9/u9S44FsXmkaobfdhq0c+cLLXKc6bIUBh+2LAeM98F+2/PggP9NrCJw9OKfMvZ8wS7Nn3s96a91et1WuknD+CjioRcgyY9P7Rn9yl4J5At0YGVc7c= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=outlook.com; spf=pass smtp.mailfrom=outlook.com; dkim=pass (2048-bit key) header.d=outlook.com header.i=@outlook.com header.b=aPCuvyrz; arc=fail smtp.client-ip=40.92.53.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=outlook.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=outlook.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nvyyblgLqNMuJgRdTROnw8hWtap5qkncrkTH8/Yf7BkjPtBImcf+MZdIQ0HcMbEQZ5ElsC06ICI0naHrVyOH53jXlJu5n4MBd54JWySLVU2wyAR840BMHrjKYsd8akRRYp10s2ngV3T9kkGJRfkyAHkkICliZ3lfzKLxtyDJuTMoLMyRAko9PiyJ5NxrvircXJjyE2fhbKAKUQRqCCV4+xEohjZMNATZcoC/Xkj+olBB+4OYkh9gPKiJCljro0EOOx5m3KozIunVUiJ1SFR0lbkUxL7G+ZY3Es6wYrBj3UQwr8PqLiKiGTcSbJ2VqHJRoHblSJ5/C5PfCjnhzmm1wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=1OnX/BH6Xjawc0pDowAWuvFe/CmzILBKY/IW+PooznE=; b=RJcUARw4rhF1Q/UrJ6TdHAQZdSJSeL/G5u6ZSrunVNv230cvVrBzVFwH5mNqYsMCIdXuipNbiXkQu/uvAB5d3ksEKIaHegAYDA3/4LgMLtSoaVpiJTKb4E8JHEX/FplXXO8NNnfbGz8Yjr5xt4OKuSvgiz8CWiur905LXXTB+Yh1q6Se2UItMcf2/W0AOOk8bz0/Bv29MmN+Oy//v/+TKLQdShfO7uLX6hlPbuXilk1Y+NFbkt7hoQqg+7YA+mbMvWwkjpgyeZkNGaGh2/yQukTEU3zWBCWrUrCQls4jzd3A1CBKulsc1/r2wRJNSB1lTpTmP9x2jTTu2QSzvC4JUw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1OnX/BH6Xjawc0pDowAWuvFe/CmzILBKY/IW+PooznE=; b=aPCuvyrz/EAlpHlm9g50c504dT8c1gTMQT+u3DCuovMqc27J7hba4vPWVidOjLw4PEYdA2xoILez6Qce/bD4rVBcycXLD82Z5FUKz/wgQTn9+sV1ReAi0gv9IFYmNC9iKzzO2eNcqi1zCB/HqE9liigwbKarQYUSG+gE9mL2SJ+NKAR42wZOe19q8i00gTazvVJn4xa1mXdawUq/r5Adk0JPGuWVMS1EBha/72jvxE8NPbHGMpCKmy6oQdCHuqj9ztzgL68eXaDRQu26Nc+KCP/3j6pQcHXDsFZdTFW9W0QJ1SOTrz3mX3PsnvWU7WIYhPZhr3fI0d8G2C52jUZIcA== Received: from SEZPR06MB6959.apcprd06.prod.outlook.com (2603:1096:101:1ed::14) by TY0PR06MB5610.apcprd06.prod.outlook.com (2603:1096:400:328::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.24; Thu, 7 Mar 2024 11:18:09 +0000 Received: from SEZPR06MB6959.apcprd06.prod.outlook.com ([fe80::aced:cbb9:4616:96d8]) by SEZPR06MB6959.apcprd06.prod.outlook.com ([fe80::aced:cbb9:4616:96d8%2]) with mapi id 15.20.7339.035; Thu, 7 Mar 2024 11:18:09 +0000 Message-ID: Date: Thu, 7 Mar 2024 19:18:05 +0800 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3] clk: set initial best mux parent to current parent with CLK_MUX_ROUND_CLOSEST Content-Language: en-US To: Maxime Ripard Cc: Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240307-mux-v3-1-0885fc1ab2c9@outlook.com> <20240307-hot-hummingbird-of-atheism-87503c@houat> From: Yang Xiwen In-Reply-To: <20240307-hot-hummingbird-of-atheism-87503c@houat> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-TMN: [0GIMtF9n+AeMdnid0UXlEF+1JRk8/WqqWkBxfu4KD+oIeClG5dm7SX3ppXumtX2G] X-ClientProxiedBy: SI1PR02CA0042.apcprd02.prod.outlook.com (2603:1096:4:1f6::17) To SEZPR06MB6959.apcprd06.prod.outlook.com (2603:1096:101:1ed::14) X-Microsoft-Original-Message-ID: <4502b9ff-d0bc-45f6-80d4-2e0ebc75061e@outlook.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB6959:EE_|TY0PR06MB5610:EE_ X-MS-Office365-Filtering-Correlation-Id: 43a4c4d5-c6be-49cc-a22a-08dc3e9844cd X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PvySqgxivn9LzJbd3BpghVovMSIVW2F6IamyKeoBUxdmtLuFTRal9st9e8fRdwIhPv0W3JE3N8Tr8nbhV9wSOK75osuvIL2srZBBQieYlhnx8Neeu922yIAZvnpnjgyLS0zv11/o19oE7xYyA8z6SjYM6WrSvj2UxlxUDHNUNlZXYfOErJYo5b3iRA/01X9i61P4vU9OEF1E+s5f5+DsSRIM6uLiqAu2xNYwd85R4vvZ2kr+AxNLK2K6qzZZVc6cWkNCDltNTSypa3OIXYj2TGvT8zcJ2yH2lfI7BkK1H6SnAYsGXBtPCWNTO7Wh7apXGnvsozbblyPSih6rw4zNLMk/oJKHa+EqJ6xLx/AqwpeQplW3N61xXonYyb/eHGe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B?dXVLcmtoUEppQm5FeGFhYmJzL09Mejl1TllNN2JYVGhIaG85UkN4cExlZHRU?= =?utf-8?B?NjV0blFyZWNVZEt3czVBSTlOam5QM0haKzlxMlBNTlUzcVNWWkJKL3pRVUFM?= =?utf-8?B?RWVERXh0b3E2dXBDOXFOTnJJZ21wd1ZQUU9KR0YyVCtzeCtKUnBoSGQ1SkRX?= =?utf-8?Q?H6uaLtMPRNNCwVC9jy/AqzPnDjq31dP7YPbXt3/?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 43a4c4d5-c6be-49cc-a22a-08dc3e9844cd X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB6959.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2024 11:18:09.2298 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY0PR06MB5610 On 3/7/2024 4:48 PM, Maxime Ripard wrote: > Hi, > > On Thu, Mar 07, 2024 at 10:03:50AM +0800, Yang Xiwen via B4 Relay wrote: >> From: Yang Xiwen >> >> Originally, the initial clock rate is hardcoded to 0, this can lead to >> some problem when setting a very small rate with CLK_MUX_ROUND_CLOSEST. >> >> For example, if the lowest possible rate provided by the mux is 1000Hz, >> setting a rate below 500Hz will fail, because no clock can provide a >> better rate than the non-existant 0Hz. But it should succeed with 1000Hz >> being set. >> >> Setting the initial best parent to current parent could solve this bug. >> >> Signed-off-by: Yang Xiwen > I don't think it would be the way to go. The biggest issue to me is that > it's inconsistent, and only changing the behaviour for a given flag > doesn't solve that. I think the current behavior is odd but conforms to the document if CLK_MUX_ROUND_CLOSEST is not specified. If i understand correctly, the default behavior of mux clocks is to select the closest rate lower than requested rate, and CLK_MUX_ROUND_CLOSEST removes the "lower than" limitation, which is what this version tries to accomplish. > > And again, either way, we should document it. And run it through kernelci. > > Maxime -- Regards, Yang Xiwen