Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp3135585rdb; Tue, 6 Feb 2024 08:07:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IHHTtfdbsDL66jPuH9qAzkgBbAYCFUV6CQM19oj0Le492X9DjQixBkg+u8IOWPtn+jOulNt X-Received: by 2002:a17:902:a514:b0:1d9:ac42:6ff with SMTP id s20-20020a170902a51400b001d9ac4206ffmr1765870plq.18.1707235637457; Tue, 06 Feb 2024 08:07:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707235637; cv=pass; d=google.com; s=arc-20160816; b=B7QHhJUuxh29JuOdF70R4WId55NuJ5unh/PEXSjixfWr8GiE23cOQFAqKpD3DRh/CD QjVOZ29AAnWHAX1spY8ZBC2Yv1H7IXJlkt4+n+L9/OIVDftpiFKRi5iEKZbDuK/nPmIY YZdriJ/8tJA3uSM2+4aKMTF7IDnjPXcPXoytW8XsJgKp1th8ErDYFLKgU33WMMBssGBn 9/sDdEgLz+ofwXgVLJxO82DBJJaa+NwYV+QcgzJcyXtmBxc/BAMD7FC21DKFrp+eLpi6 O/lnA+sEtLIdKmjMFu3FWbgzEGfvsjzKAfFaF0P6b99f1W7mzkYJ1kyvmyChrMvhkBOd sVOQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=ZCan28bMKu4/QLOXWI8DFZSRkG92ndMcg10Of7DyJDw=; fh=gWEzsOOW2FXV/U3qBpdZMDy45fqO1bg4gNLJIfNmqYQ=; b=EqPLhzfbua2nG4AT/XA6uVETXucKUGkv+x/NkTqrBDYzNwr8N+TEgW3GGgL80XlnYs ctShubJmQ44VrCR6l41vVV+1ICIWOkTdAJCfDRgTW5kCJxwv3RDTPJuZDP33IDNGAXNx MGFakMrWETvVViKR7YxZbuacY023cgi3rnEWbFaeHKCVs27aKT5ByqSMrtAITOursz1b gL0h+fFkDwVMTJwvaXTwgrrZnMeMjD7xC+eqsUjpev+krvx7gwn/d79BafiP3vIf2fc5 PsWCcffg2/EX15HgpiPLmnHTlIAK3IRyLjl4JQQwU8cvwU+zRCOZY+4DuWtwFdpV4RqA FPdw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="S/AOz21X"; 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-55282-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55282-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com X-Forwarded-Encrypted: i=1; AJvYcCV1eoc4ylrueA6Af7ULXrSnDreplP4RFo+XKczVBLfkPa+/RVRrltyaQHJAIB662eo3o8QVZMQgGulYOyhJbv8GbYRZ6BRRk1vuRBF1IQ== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d28-20020a631d1c000000b005cec91fa486si1810246pgd.675.2024.02.06.08.07.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 08:07:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55282-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="S/AOz21X"; 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-55282-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55282-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 868EE286B84 for ; Tue, 6 Feb 2024 15:54:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2CF04134CC6; Tue, 6 Feb 2024 15:54:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="S/AOz21X" 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 A4A0712E1E9; Tue, 6 Feb 2024 15:54:12 +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=1707234854; cv=none; b=P4Hq4C7nwws/sJgFLeKLuTojDI0IF/wEeRbv1ayzjTEnO/4bXiKSRVs4vcPsOaAYs1q9ZHPd453skKiYB3bv3qA3e5kTbVLHUCXq/FxaR1yBElZJMAZY1QP55w/nupL3DO9v4U+00gV8N3Fk1ax5Giipwd2/8PQHcCisPrzq7wE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707234854; c=relaxed/simple; bh=kQhsrTRwdHJ9NWwS8cGdFIDk12FxEBq7Mik2i9lD4q0=; h=From:To:CC:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=Z0Hhr4h7doir+XZzHICAV8evV2PPQALl6EuuKVq6HfjZARDu0XXhmTcXMABvwUt7sTrIlPbrmKVh5bCu1wvneel29se2WSbgiF12J+nQ7+cvh45ZvPPE6MBNHWTmimNCAudiDRxi9qVyZV10X01gVwowOfxKCqxPM4pjRytxfuk= 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=S/AOz21X; 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 fllv0035.itg.ti.com ([10.64.41.0]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 416Fs3tQ123333; Tue, 6 Feb 2024 09:54:03 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1707234843; bh=ZCan28bMKu4/QLOXWI8DFZSRkG92ndMcg10Of7DyJDw=; h=From:To:CC:Subject:In-Reply-To:References:Date; b=S/AOz21XpWPP7fWql4RI0GltgVvT5o32mikL8S7M30PdvWuKvguh3InIR18EiTB6U 6H/+s4rH0Ao3gUoB1Sb8DbV6lSw0y/LZpmcukq9bJYgaE/xMSP1TP/XPq0o4+Fr1jn ef3AR/yxXJIjsJDeVCp0JvhXJWwhs0ownSEbqMi0= Received: from DLEE105.ent.ti.com (dlee105.ent.ti.com [157.170.170.35]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 416Fs3o7063174 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 6 Feb 2024 09:54:03 -0600 Received: from DLEE112.ent.ti.com (157.170.170.23) by DLEE105.ent.ti.com (157.170.170.35) 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 09:54:02 -0600 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DLEE112.ent.ti.com (157.170.170.23) 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 09:54:03 -0600 Received: from localhost (kamlesh.dhcp.ti.com [172.24.227.123]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 416Fs23g018189; Tue, 6 Feb 2024 09:54:02 -0600 From: Kamlesh Gurudasani To: "Kumar, Udit" , CHANDRU DHAVAMANI , Nishanth Menon CC: , , , , , , , , , Subject: Re: [PATCH v2] clk: keystone: sci-clk: Adding support for non contiguous clocks In-Reply-To: References: <20240206104357.3803517-1-u-kumar1@ti.com> <20240206131420.wtitflgav23jto2q@verbally> <871q9pzoiq.fsf@kamlesh.i-did-not-set--mail-host-address--so-tickle-me> Date: Tue, 6 Feb 2024 21:24:01 +0530 Message-ID: <87ttmly4fa.fsf@kamlesh.i-did-not-set--mail-host-address--so-tickle-me> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 "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=A0 I was referring to > > https://elixir.bootlin.com/linux/latest/source/drivers/clk/keystone/sci-c= lk.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 =3D 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 =3D ti_sci_cmd_clk_is_auto; cops->is_on =3D ti_sci_cmd_clk_is_on; cops->is_off =3D ti_sci_cmd_clk_is_off; Which should be safe to call, Chandru can confirm. Regards, Kamlesh > > > >> >> >>> >>> >>>> Regards, >>>> Kamlesh