Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp3069117rdb; Tue, 6 Feb 2024 06:27:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IEwKu/PeuB2CHIZO07U67A3KLzFkKkwQMoojF2DvmZ+4tRY8BqEDEm9TD3TZKQvdJL8RO/a X-Received: by 2002:a05:6a00:98c:b0:6e0:4e7e:ef57 with SMTP id u12-20020a056a00098c00b006e04e7eef57mr2976707pfg.32.1707229639035; Tue, 06 Feb 2024 06:27:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707229639; cv=pass; d=google.com; s=arc-20160816; b=ULr4xPBnlyX340T/RhNBNTYO/aqMO/FNz133lauTYlteOxe07Oo+NEPUQODOgmOPWS c4GcDjJ28aOtje0Ni7RhsZKzjOuSUq+Rj6508uK17Tz8uflMb7J4ueqvi0epQq97fqtk JdEQxjPN6fJ/b+xcTnpiEO7vUpkX1kja10dVsy985WszIbbsqp/X7dKD6EmBtLxu3vDW ZPmhBvnITVh66mNPJfuVy5SDXJ2sCO8zoUXNMTKCLhJcef2IxWqbat9quOpjzxv9b2E/ sT4y7NUvXDOhtocHhz0R/YpXPFf2LNvg3jnn3hSMEkAlzkRuU6AN5dmrLCGCca90Vlq6 yPcQ== 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=MwJ30/bw+pkd0WzAspzpQ+DwdhN3FJqhFcO85PhK8f0=; fh=EiIQjfqzgysDgjBqWRz3OV4SbT67fCvVr7kqZVARNBU=; b=dviZyJCKSHEQdtM/qStL+DZIX4inddPXzKoTaQxpRavU9fDkjnc3VsPSpX9Le5O8F+ WH3z3qJX8gafJPA23rrzO//xySsqDEDaYkeljlecizEhZ9ltn8sAU2XM7GaGoz3RW9av kISDCCpXH8K7wYef/GvhKsPVUm5s9hxVVHx/SWfZvmFiaxlDQp7CViTrr0/TiHcjuCYC sPv/wq8K7mM1k0JBZI3ecxoon6RpLlhg4reLKKH0F01/K5Y56/i2H0Pgqk09EDElToUY mPdoeLbnLfrr1pw7mCkZVg79GNljmeSQv2cZFOFCiXFlRqSILnVqR6nk5j+bEqkOvizX w7kA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=NcbB0qq6; 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-55110-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55110-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; AJvYcCWORyrTIy4+oM8MCwNoKCsQX+2QIuNpYSOw8nkhjQ20LrkTdkzSKZsxYEKT0U/r0rHOnmiSOlKVKC1PZXUaReXH5QTiVIgy9WzV+N6I6A== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id z34-20020a630a62000000b005cdf488ba0asi1702410pgk.746.2024.02.06.06.27.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 06:27:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55110-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=NcbB0qq6; 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-55110-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55110-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 AF5EA2824C6 for ; Tue, 6 Feb 2024 14:27:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DB131132470; Tue, 6 Feb 2024 14:26:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="NcbB0qq6" Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) (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 4676A132C17; Tue, 6 Feb 2024 14:26:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.142 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707229604; cv=none; b=YBd8ywQMqQ/QtkWiYlOerC3tfHuiJ7Jx4fjK103HszFNsahQZnwF23DFaZwQNzmdpH3t6lMyLzntjQiTQY8XoSI2+ESnpnyMslIzwfKso3yK9J231SdaVGCSQPtJvUq8NFDAjndrFy8zjqu52+dzJ5CCNCtpNmjyzklqFa0rae0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707229604; c=relaxed/simple; bh=UX150K6XObyFbEcXUrojgx5zkcHzyVXDC9FA4xQ0Bgk=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=mBZmhNjCv500XKtIpDrcMrF3mtpr3vGd8dwTgXbt0mtMv9M3oRIjnwVK4BAk7dsgIgWhWbQXGI5mQBLm/3zOW+83vEN6R5WjO8Qf2lT9UO1+NpU2yVErIHqDJqEoaqtuT30hiC2w4B38j/46ig5H+at3DktQeUZl+qEe7hfHzkQ= 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=NcbB0qq6; arc=none smtp.client-ip=198.47.19.142 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 fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 416EQZjx046188; Tue, 6 Feb 2024 08:26:35 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1707229595; bh=MwJ30/bw+pkd0WzAspzpQ+DwdhN3FJqhFcO85PhK8f0=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=NcbB0qq6ABT7as00rZgOd0hRxrscr1DrWJHA1I/JjPTRN2DNavZ+adu6r/BSWDQKU gKnMg16D1Zdfz7x4ldWPnjr16TpkqOntBuASNDCzlbdHHg96e8MubZbQvkqSPml5s0 Av9Jpwm4QpxZVi2sKIAo44sh1HdSfqTCZu7OByHo= Received: from DFLE113.ent.ti.com (dfle113.ent.ti.com [10.64.6.34]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 416EQZeK077693 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 6 Feb 2024 08:26:35 -0600 Received: from DFLE100.ent.ti.com (10.64.6.21) by DFLE113.ent.ti.com (10.64.6.34) 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 08:26:35 -0600 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DFLE100.ent.ti.com (10.64.6.21) 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 08:26:35 -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 416EQVlE008028; Tue, 6 Feb 2024 08:26:32 -0600 Message-ID: Date: Tue, 6 Feb 2024 19:56:30 +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> From: CHANDRU DHAVAMANI In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 On 06/02/24 19:45, Kumar, Udit wrote: > > On 2/6/2024 7:24 PM, Kamlesh Gurudasani wrote: >> Nishanth Menon writes: >> >>> On 16:13-20240206, Udit Kumar wrote: >>>> Most of clocks and their parents are defined in contiguous range, >>>> But in few cases, there is gap in clock numbers[0]. >>>> Driver assumes clocks to be in contiguous range, and add their clock >>>> ids incrementally. >>>> >>>> New firmware started returning error while calling get_freq and is_on >>>> API for non-available clock ids. >>>> >>>> In this fix, driver checks and adds only valid clock ids. >>>> >>>> Fixes: 3c13933c6033 ("clk: keystone: sci-clk: add support for >>>> dynamically probing clocks") >>>> >>>> [0] >>>> https://software-dl.ti.com/tisci/esd/latest/5_soc_doc/j7200/clocks.html >>>> >>>> Section Clocks for NAVSS0_CPTS_0 Device, >>>> clock id 12-15 not present. >>>> >>>> Signed-off-by: Udit Kumar >>>>                   while (num_parents--) { >>>> +                    /* Check if this clock id is valid */ >>>> +                    ret = provider->ops->get_freq(provider->sci, >>>> +                        sci_clk->dev_id, clk_id, &freq); >>> 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. > > >> Regards, >> Kamlesh