Received: by 2002:a05:7412:2a8a:b0:fc:a2b0:25d7 with SMTP id u10csp100919rdh; Tue, 6 Feb 2024 21:34:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IGn6mvdWWrbEt2/ZRhZhIG1dNFRnq1vf3qQUdOO18n1kELbI245h2ovNDYpL1wu3jm9oNFC X-Received: by 2002:a17:906:3e56:b0:a37:f60d:1cf3 with SMTP id t22-20020a1709063e5600b00a37f60d1cf3mr3144797eji.7.1707284081480; Tue, 06 Feb 2024 21:34:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707284081; cv=pass; d=google.com; s=arc-20160816; b=h9n4wRKWlz2bi1jTvoVO6zifwHiw3WhldjqBzBV0MXF2GYUSGCyZ2bGiEysaXuEBLC ubX/fT4fcAtsbbediG58ZGA9y2ytlZGVkmSEw5M4bXU5Mds6mU9yB4fJAY7dyVWbI3b0 h9gt4uMYUTtKlZcah0mj0H5iqtxEf/H5EgskiuyFKnvK7+skTM9+9+Cx7Sm1jEgLlvRG SNXlRxDcS07IuqUqLk8+ztva4HRMnTd7aHE951sx4+opKHvqxH8y5374ooSvEWi8nUoL XOc4S3VniVcV9ISvxzOKOC8V/7uIfj24sevcnFvGPaKnN3v/v95yzh5dzPM8OaYG22Nm f9JQ== 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:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=iRmefxTu3nU+jSjCWHu54KxXXwApbQgyUthBZ1sSZHs=; fh=lyo7uI6iMzlLguyfVv0Yn3Zh4256wVMsYgGlNCsEl6g=; b=znOlP+ZJOseXc+NKV/U8ZfnY40umYdH88zg2EVWA+w2CmDNm1f7WTjomCMZ8bLBYXG 5u1w8dE/jmbJ1XdS7+bY1r8joEFPQDu8D3mRBCrLUyQ3TAs4viLbLcLCRJIEtyp4werX n/XxZPqy96SqMaWDCWh76u2F2Hcq+I5kYWYKmeo5dm0X+vuag9gjqXROLaENSK6KdH8D u6yYK/6VhV7flZ2s8xaNifluaAFzT8y0RdaDnC2uZT9b0GYZywQESjnIed8YgJu0Zlcn ZoaGttXLwvqNLXpWFwlVAQKQ3PgzxsrPs6qrGVdXbBYR2P1QEDJYXwkcca/JItlAwZx3 hxuw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=xjNkYLLQ; 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-55975-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55975-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; AJvYcCW2jLtKBuFcI9RTrHqz5zDZBQKGt/TnRKn/r03lVb4D/1iyV52hAngIKDlDoLeDqnlWWSQ1s0ZW8E7DGoc3xWosb4fo0DeOVw9iQs+zOg== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id b13-20020a170906490d00b00a384f283fd0si446942ejq.693.2024.02.06.21.34.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 21:34:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55975-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=xjNkYLLQ; 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-55975-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55975-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 3DE301F25B62 for ; Wed, 7 Feb 2024 05:34:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AEB7614AB7; Wed, 7 Feb 2024 05:34:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="xjNkYLLQ" 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 EFDAE1CD1E; Wed, 7 Feb 2024 05:34:31 +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=1707284073; cv=none; b=rqetDIjJKkujzX8FeERE9iKfHMOC/yIJG+rWDsG7/oMwOKOXY8qh3va0cXu3X2bET9R4Ia0cvbe6ZQCQv944SvTEPElsN49FAidcNf8vN2CJ5gUpXL5TJhRxrR/QhuAqkNgx0DyYJBb8xd3mkTqNCIdna4r2KenVglwwaXUFH+w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707284073; c=relaxed/simple; bh=/vwFyEuN+SciqLKd3L2Vv0FZcwpX+FovUMX7WH9gDf0=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=jPNxNl5YEkI4XqonznXJlq8EBmEatKXqcdIGmvFH6H7nJEfmPj8zoj0vXwy+st1j2MbUg1P/IjIXVrCtJ8Udg+If16FIsrh/H7yb1tBoJTMO5YIj0FfKpTF67qHT7s55dubs2Pdx8CNu9QfMRspXDYoO9EujBWM1BdPC40K0cCM= 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=xjNkYLLQ; 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 fllv0034.itg.ti.com ([10.64.40.246]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 4175Y6aa067259; Tue, 6 Feb 2024 23:34:06 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1707284046; bh=iRmefxTu3nU+jSjCWHu54KxXXwApbQgyUthBZ1sSZHs=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=xjNkYLLQH4kg5BXxsb9vfbrUNI7/xn/sNjgCqjm0kwXbC7NcbjBjWrBRR+LUqpCl4 547nvaNdml+hCKYfkyLYZ9eMQK1FbIOHgg04e58sM4qInRwG1yp1t3Wf/2h3zLtm47 6UOwzJkDFyc1SOs1f/h57h2GMYT1NK1Q7Q/LP6cA= Received: from DLEE109.ent.ti.com (dlee109.ent.ti.com [157.170.170.41]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 4175Y53p120442 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 6 Feb 2024 23:34:06 -0600 Received: from DLEE106.ent.ti.com (157.170.170.36) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Tue, 6 Feb 2024 23:34:05 -0600 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DLEE106.ent.ti.com (157.170.170.36) 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; Tue, 6 Feb 2024 23:34:05 -0600 Received: from [172.24.20.156] (lt5cd2489kgj.dhcp.ti.com [172.24.20.156]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 4175XrFZ073161; Tue, 6 Feb 2024 23:33:55 -0600 Message-ID: Date: Wed, 7 Feb 2024 11:03:52 +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 To: Kamlesh Gurudasani , CHANDRU DHAVAMANI , 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> Content-Language: en-US From: "Kumar, Udit" In-Reply-To: <87ttmly4fa.fsf@kamlesh.i-did-not-set--mail-host-address--so-tickle-me> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 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 ? > > Which should be safe to call, Chandru can confirm. > > Regards, > Kamlesh >> >> >>> >>>> >>>>> Regards, >>>>> Kamlesh