Received: by 2002:a05:7412:2a8a:b0:fc:a2b0:25d7 with SMTP id u10csp154632rdh; Wed, 7 Feb 2024 00:06:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IEj2TVLOuf3wDACwhzU087hzLl3Clntf31EyCVrc6kL6/oci+rbY2FhMlRdx4ux+wdKtgFZ X-Received: by 2002:a05:6870:a710:b0:219:cea4:6bd4 with SMTP id g16-20020a056870a71000b00219cea46bd4mr989510oam.38.1707293195110; Wed, 07 Feb 2024 00:06:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707293195; cv=pass; d=google.com; s=arc-20160816; b=eVdr2CZkLsCt14sBRFBHoaQSIBD0wGBOyh2qDeS6sxQQ4rKzCLP0i5ydeg15yj/hD6 s0jAGjvJI5BIcUuoJgGo8IsfD/PyGW6ME2adXz7+GtD//AXXJ4M2v1LWY6oe6qxf8ULw agTmqt8X7RUQw0/PyG0HMJ2L0JlN/T1uow6rtPq0dLPjrLIgLHGZwdU9Zz0FPd7JPyRQ vYXdrCw2EdJQUNNFVRRKoDwtGLkoIumlSu3ssd0Np5NrhqopKb0QCLEVcMaJgtw+c0wm wumjdh9z1ZLYLwPL2pgeM8Jp43xZBuiiR9Psjn+8M/0Tgur6/w1CwqTuR2BumAT8ZtkZ RQNg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=cYHxqfbAMZy5YcllbR7IzjQ6cA/xPUZllesIYQkr87I=; fh=1RYxheYaHg2uxk9l/y7tP2bKEXQa09fiSV61S2Czr2U=; b=jLbJigWpEx4RYItxlIqpGIJ8KskSXPaO1l2rZdgSozVIJ0KlQq7gnkQtfbu0xKVK0x U9eNM1fdwG5cMbQfpdieUEyqnzVGh7FvjK3yA7B6fMAIgpwrefJaIZlj0j898PjXr7Dv KJauLIqN+zJDZmux225eq7LdLJ0hI8AAmW1+mLFkNEXGdPYFWE4imGd9npS3h8TgxVkg bWncPmKCAwopVR0lF8kfvs4WOC9g/6tCPKbuvuA8AxbMaca1RLeHDEMgnaIOHVygDip4 ubJXtl2EHcmo4JQZh8Nn3wO2O5+iJjMSMM0p9dvsvjccDhsvKL8c2MNHzQacCrjIdgMj GhzQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=k7g2xvuH; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-56097-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56097-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com X-Forwarded-Encrypted: i=2; AJvYcCXrNkYHPzVYMPxJ3762jpytUkIuLg3c9RG8ZmCC/fFCj0laNjtXmWii3kjFxRRRuljWhXvUkny7Nvs5mxDT3y8hO/gKYxAQcy9ZomW7gQ== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id ca28-20020a056a02069c00b005ce3cd4ed95si1084726pgb.94.2024.02.07.00.06.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 00:06:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-56097-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=k7g2xvuH; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-56097-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56097-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.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 66EE6B2609E for ; Wed, 7 Feb 2024 08:06:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 53683200AE; Wed, 7 Feb 2024 08:06:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="k7g2xvuH" Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) (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 66B87200A4; Wed, 7 Feb 2024 08:06:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.23.249 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707293181; cv=none; b=IYp62c6+iDggEKt7Z/Y027PPaoZuuYyUr1+jYgkqfDm15CulDL+zbAAWiwT9Usf0KR4AG2YADqj0TfT3vN6lBn/z/5KzeIhfZZMQ/8ajH/HaZ332iPpJrXGiKWZSOZk7KUVljP7rbfeXlc1rcXhQ9C08ElXAkjklsE8Re9tGEfo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707293181; c=relaxed/simple; bh=0akLjgta1i5BwmXhrQQ86/PzQcGvJya4mfnU7574Grw=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=WmXCCo9dHyid5BTRS/HJZ83O3dcwClp/zUPmesn5/cREVhp35SKVa3X8BwoNvt7j2nWdtZwDoTuaxqOrmjq99deXRRYFcVAASTOX9mVRJiNaDw582YcdoPnHHYf6s6IR29ZYXZJCsIvicXaEICrKxfQd4CgJfCCN5jnp/9LnM9M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=k7g2xvuH; arc=none smtp.client-ip=198.47.23.249 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 41786AmG111110; Wed, 7 Feb 2024 02:06:10 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1707293170; bh=cYHxqfbAMZy5YcllbR7IzjQ6cA/xPUZllesIYQkr87I=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=k7g2xvuHASWzgVNETsP3hMuXhzzgmzJO8I33XXDvEEjZnj2aymFkitTZCfxHjIKGp NO2E5gZ+v4FmI4/Irc+5QXBxAJz+gwyOHUZhssCe3MBYseGElRVbMZANuEobf67J+D OH72v657HWUi92w9N9H5MmbnOjjAjFxIrl2K49KU= Received: from DFLE107.ent.ti.com (dfle107.ent.ti.com [10.64.6.28]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 41786Ahi008231 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 7 Feb 2024 02:06:10 -0600 Received: from DFLE111.ent.ti.com (10.64.6.32) by DFLE107.ent.ti.com (10.64.6.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Wed, 7 Feb 2024 02:06:10 -0600 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Wed, 7 Feb 2024 02:06:10 -0600 Received: from [10.24.69.14] (chandru.dhcp.ti.com [10.24.69.14]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 417866mQ072127; Wed, 7 Feb 2024 02:06:06 -0600 Message-ID: <5f54ee18-b3df-4918-9d5e-b765a6714ea2@ti.com> Date: Wed, 7 Feb 2024 13:36:05 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] clk: keystone: sci-clk: Adding support for non contiguous clocks Content-Language: en-US To: "Kumar, Udit" , Kamlesh Gurudasani , Nishanth Menon , CC: , , , , , , , , References: <20240206104357.3803517-1-u-kumar1@ti.com> <20240206131420.wtitflgav23jto2q@verbally> <871q9pzoiq.fsf@kamlesh.i-did-not-set--mail-host-address--so-tickle-me> <87ttmly4fa.fsf@kamlesh.i-did-not-set--mail-host-address--so-tickle-me> <4398af20-3396-4a5c-8fcb-a7b3d0d6f15b@ti.com> <978c8110-3083-4fc2-a348-d7f97fd7839c@ti.com> From: CHANDRU DHAVAMANI In-Reply-To: <978c8110-3083-4fc2-a348-d7f97fd7839c@ti.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 On 07/02/24 13:03, Kumar, Udit wrote: > > On 2/7/2024 12:53 PM, CHANDRU DHAVAMANI wrote: >> >> On 07/02/24 11:03, Kumar, Udit wrote: >>> >>> On 2/6/2024 9:24 PM, Kamlesh Gurudasani wrote: >>>> "Kumar, Udit" writes: >>>> >>>>>>>>> get_freq is a bit expensive as it has to walk the clock tree >>>>>>>>> to find >>>>>>>>> the clock frequency (at least the first time?). just wondering if >>>>>>>>> there is lighter alternative here? >>>>>>>>> >>>>>>>> How about get_clock? Doesn't read the registers at least. >>>>>>> Said API needs, some flags to be passed, >>>>>>> >>>>>>> Can those flag be set to zero, Chandru ? >>>>>> >>>>>> get_clock doesn't require any flags to be passed. >>>>> >>>>> May be firmware does not need it but  I was referring to >>>>> >>>>> https://elixir.bootlin.com/linux/latest/source/drivers/clk/keystone/sci-clk.c#L78 >>>>> >>>> Just took a look, >>>> >>>> I now understand the reason for confusion, >>>> >>>> #define TI_SCI_MSG_SET_CLOCK_STATE    0x0100 >>>> #define TI_SCI_MSG_GET_CLOCK_STATE    0x0101 >>>> >>>> cops->get_clock = ti_sci_cmd_get_clock;  --> refers to >>>> TI_SCI_MSG_SET_CLOCK_STATE >>>> That's why we are passing the flag from linux for get_clock >>>> >>>> Linux is using terminology of get/put. >>>> >>>> As Chandru pointed, we don't have to pass flags, cause he is refering >>>> to TI_SCI_MSG_GET_CLOCK_STATE >>>> >>>> Below functions passes TI_SCI_MSG_GET_CLOCK_STATE to DM, which is what >>>> we actually want. >>>> cops->is_auto = ti_sci_cmd_clk_is_auto; >>>> cops->is_on = ti_sci_cmd_clk_is_on; >>>> cops->is_off = ti_sci_cmd_clk_is_off; >>> >>> >>> I think calling ti_sci_cmd_clk_is_auto should be good . other >>> functions needs current state and requested state. >>> >>> Chandru ? >>> >> >> ti_sci_cmd_clk_is_auto is internal function to linux. >> For TI_SCI_MSG_GET_CLOCK_STATE, linux only needs to pass pointers to >> the variables where result will be stored. > > > Yes this internal function calls TI_SCI_MSG_GET_CLOCK_STATE > Okay. We can use TI_SCI_MSG_GET_CLOCK_STATE to check to if clock is valid or not. > >> >> >>>> >>>> Which should be safe to call, Chandru can confirm. >>>> >>>> Regards, >>>> Kamlesh >>>>> >>>>> >>>>>> >>>>>>> >>>>>>>> Regards, >>>>>>>> Kamlesh