From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 0889E3FF8B3 for ; Mon, 15 Jun 2026 15:05:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781535924; cv=none; b=jyxv6hwmId1qgZLcegkaEfpDmCPqPunH2j+E0HqSrZlJBtLtGz1P/TbV+lQf4etXT0LSBG0Mwl8ZOA8Frwjw8SZIpOCsULfDw7XGkSG1zKxpi2CpH7fe+udnpoxRNBwUz/pOolVRbjJYlQg6HmP/fKcR6yTPaoGX1nUN14DhOZg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781535924; c=relaxed/simple; bh=qiJePkb77wcQ8uQMKyB7K1EajheX5tE398lCjm2qbrw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FTTVOFqRPAPvs0eERaffZL5g7+Ytm9pSrxgYJWbvmXrjIeUERpo7+tKDqwkAOTlMnrwkgL6/IkmF7wesEgLtbabomRUFetUiLZt9lgKYCb1UdBdBPgw9KXSp3irwTEci7d3dyCM21jldR9G1Fkn0trBbFrscKbWZ1IynvSxPWyM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=T/VpYkAy; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=jqyhQpOf; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="T/VpYkAy"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="jqyhQpOf" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781535914; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Px5Xu7MhZIEsVfuisoAxF+/5T0Fd35a+WXu6g8v35xE=; b=T/VpYkAyKg0wf53MsDfD+clAyZ6yip4+opevRv6rtHAzhy0OqoR+ub7TKc3e6QoFTacFuc eQEfv4qIR0tIxEzt0SJsKQ8CnNKbZd0Bv3jhl0n3vRG5KrpX7jNkylBimBpFkzHOkLK2Ge u18mJm2ln6LfRXnloLQc33ry3JfVlFo= Received: from mail-ua1-f70.google.com (mail-ua1-f70.google.com [209.85.222.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-288-EyUCYe2JPcyQZ9sD_u-YBw-1; Mon, 15 Jun 2026 11:04:56 -0400 X-MC-Unique: EyUCYe2JPcyQZ9sD_u-YBw-1 X-Mimecast-MFC-AGG-ID: EyUCYe2JPcyQZ9sD_u-YBw_1781535893 Received: by mail-ua1-f70.google.com with SMTP id a1e0cc1a2514c-963d7eabc83so3466690241.3 for ; Mon, 15 Jun 2026 08:04:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1781535893; x=1782140693; darn=vger.kernel.org; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Px5Xu7MhZIEsVfuisoAxF+/5T0Fd35a+WXu6g8v35xE=; b=jqyhQpOfTMleP3Ak7MC+7q7rV3drfNo8b5CtiF2F1DUZIFLZ3qLtnEkek0zgmbU7aM FkmQgN2Ik9RQfObFzX/gky0LduevPMi2a6sMv3NkT1XrV2P/8Bd6DIWbwP76VjNPQn4B 5iKyrL/rTcFp9BxLBw/zEKG4+8CvsY9au9wKCniCPJBWYuMaGdpSR34sKOarP3QoDKyT /IblLWiSUh5qpqlAZ6yvaAQjXf2eguvfvBZKCfQ3On4MVD5fPvF3BodhG183hI6YG3+F cAFBp4ZsElJIoWnwEYDNnNUIFgsllmlLpB1BtNAMI1YKu2MqtVVbQA5oDV149cchsaL0 xMnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781535893; x=1782140693; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Px5Xu7MhZIEsVfuisoAxF+/5T0Fd35a+WXu6g8v35xE=; b=MTiB4ThnctBBNiH45KnVtPUbmYYje8gSShjFfTE9d0KmofzIhguWVEcyqnXuXuOxou SjsVRtFNEMVuvdJ0k/aL6ErANW2vhmogWUJ70UBHFbQu/t7fFtgZf1t5MA+12ITMO9fy KbvkWc3HId78GWgY43FsqpV7zDlwQGcs22WNUSqZrhM83Q0Vzx/wPusG76uS+WlWWT0R cqOJvRI2cOPaevaTioB48IsrXm2ec3iknyI+LMDWOQl3ifbsUegvGwTZXcg49F3dgPf5 ucKDYxC2zvl5Bpz03TOfhYGKgdiJuLUib1wZaDtwmR/IieB8UqjNkjtsSVaLHb5tjkXT /f4g== X-Forwarded-Encrypted: i=1; AFNElJ8NLDRCCa6rBn8bKhDwcFILnGkOHbNTg7uXt/sVOCI4uI4nC+75dlo0vjuzCXr+xbIHka5lDEqTmI0=@vger.kernel.org X-Gm-Message-State: AOJu0Yy2D0iJO7wVJlWiWVc7KfdY7fGGiFb/HsXZn1tWABEPCkEjIuSg elz/G8r2MusiqgGWcaBq4WlYAWuSzqkb3QLzOPQpeEbm7+/xgPTZfrQ2dj5yjwhDDQvpqCXnnTJ AkXXIb+N2JRRF6L1CAv0fALxFBuYH/9qsINLVvCXEx1I2+ovYACGSs5wuBoqMVg== X-Gm-Gg: Acq92OGcijlBmzieRSpxNqzKSihYe9zBeeZeTTKlKHC+G9z021zsJbYN1ITi6lyP+jS Ubcz1zM08X0na/nrh6g9CFcgviBT2v2IhWtHy/VGm8XQkA33Cxj9ix7V5tuKSmDQkCepxTfFhDu cZ5SWdm7gPDYMHllsk96qzn2qOjNXGPBrQpACKdrP9EZ2HRdcDdNY2dN9QVA+a/ObRKcumKGYq1 Z37HZfoJdUJGQk/oPT9PxieF9S+UG+XOrBaCfjqW8TFXM28KPyncmTKLZ1obG4naojItJEsAn8j GjOxH2FyFKO4NVWTn+Pun8aZ3nbPzsM3oTNJyhzHNhUjBg7V6k61oCcIxUzboImK27wA8sBl184 lR94x9dU4cdHUowu0NqErLXVZDPP6b2hDlXx7fqDbIOpZkHZ5A5GYnMLC X-Received: by 2002:a05:6102:330d:b0:631:ff40:22b2 with SMTP id ada2fe7eead31-71e88aba506mr7937962137.2.1781535893176; Mon, 15 Jun 2026 08:04:53 -0700 (PDT) X-Received: by 2002:a05:6102:330d:b0:631:ff40:22b2 with SMTP id ada2fe7eead31-71e88aba506mr7937894137.2.1781535892692; Mon, 15 Jun 2026 08:04:52 -0700 (PDT) Received: from redhat.com (c-73-183-52-120.hsd1.pa.comcast.net. [73.183.52.120]) by smtp.gmail.com with ESMTPSA id af79cd13be357-91619ed7215sm1095261585a.7.2026.06.15.08.04.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jun 2026 08:04:51 -0700 (PDT) Date: Mon, 15 Jun 2026 11:04:49 -0400 From: Brian Masney To: Konrad Dybcio Cc: Dmitry Baryshkov , Val Packett , Saravana Kannan , Abel Vesa , Maxime Ripard , Michael Turquette , Stephen Boyd , Russell King , Bjorn Andersson , Hans de Goede , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: Re: [PATCH 2/4] clk: qcom: common: introduce qcom_cc_sync_state() Message-ID: References: <20260603-clk-sync-state-v1-0-457120eed200@redhat.com> <20260603-clk-sync-state-v1-2-457120eed200@redhat.com> <2f6dbc37-7ee5-4cef-b39e-455494fb31fd@packett.cool> <68a86037-bba0-4cab-8a1f-b0be78f259db@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/2.3.1 (2026-03-20) Hi Konrad / Dmitry, On Mon, Jun 15, 2026 at 04:51:35PM +0200, Konrad Dybcio wrote: > On 6/15/26 4:48 PM, Brian Masney wrote: > > On Mon, Jun 15, 2026 at 04:33:17PM +0200, Konrad Dybcio wrote: > >> On 6/15/26 4:24 PM, Brian Masney wrote: > >>> On Sun, Jun 07, 2026 at 01:30:03PM +0300, Dmitry Baryshkov wrote: > >>>> On Sun, Jun 07, 2026 at 01:43:06AM -0300, Val Packett wrote: > >>>>> > >>>>> On 6/6/26 8:15 AM, Dmitry Baryshkov wrote: > >>>>>> On Wed, Jun 03, 2026 at 10:21:47AM -0400, Brian Masney wrote: > >>>>>>> Several qcom clk providers currently have a sync_state helper set to > >>>>>>> icc_sync_state(). With an upcoming change to the clk framework, if > >>>>>>> sync_state is not defined for the device, then the clk framework sets it > >>>>>>> to clk_sync_state(). > >>>>>>> [..] > >>>>>>> @@ -464,5 +466,12 @@ int qcom_cc_probe_by_index(struct platform_device *pdev, int index, > >>>>>>> } > >>>>>>> EXPORT_SYMBOL_GPL(qcom_cc_probe_by_index); > >>>>>>> +void qcom_cc_sync_state(struct device *dev) > >>>>>>> +{ > >>>>>>> + icc_sync_state(dev); > >>>>>> Only if desc->icc_hws != 0, otherwise it will mess the interconnect > >>>>>> internals. You might need to set drvdata to desc. > >>>>> > >>>>> Hmm… > >>>>> > >>>>> Currently icc_sync_state does not seem to use the dev argument at all. > >>>>> > >>>>> How would something get messed up, now or whenever icc_sync_state changes? > >>>>> o.0 > >>>> > >>>> Yes :-( > >>> > >>> Sorry about the delayed response since I was out of town all last week. > >>> Just to be clear, the missing check for 'desc->icc_hws != 0' is a bug that > >>> existed prior to my change, and I should label it as such with a Fixes > >>> tag when I post my next version? > >> > >> Up until this change, having icc_hws > 0 but lacking icc_sync_state > >> (or the reverse) would be be considered programmer error > > > > icc_hws > 0 but lacking icc_sync_state (or the reverse) makes sense as a > > programmer error. However... > > > >> Starting with patch 4, this gets assigned unconditionally, so there's > >> no prior bug to be fixed > > > > I don't see where that situation happens here. All of the places where > > icc_sync_state() was previously called, the new code now calls > > qcom_cc_sync_state() -> icc_sync_state(). (There is > > qcom_msm8996_cbf_icc_sync_state() that needs to be modified.) > > > > In patch 4 of this series, it sets up a framework level sync_state() > > callback with dev_set_drv_sync_state(). If a sync_state already exists, > > then that call will fail with -EBUSY, and it will leave the existing > > sync_state() intact. So it's not calling sync_state twice. I will > > clarify that on the comment. > > Dmitry and I are referring to the situation where the clock driver isn't > an interconnect provider but icc_sync_state() still executes. That could > not have been the case before, since most clock drivers didn't come with > any sort of .sync_state() I'm sorry if I am being really dense here. Let's ignore clk-cbf-8996.c since that has a separate issue. The other 6 drivers in this patch today all have this pattern: static struct platform_driver foo_driver = { ... .driver = { ... .sync_state = icc_sync_state, }, }; I'm changing it to call qcom_cc_sync_state(), which will call icc_sync_state(). So everywhere where icc_sync_state() is called today it will still be called after the series is applied. All of the other clk drivers will just call clk_sync_state() directly that's set at the framework level. Brian