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 24DF03FFAAD for ; Mon, 15 Jun 2026 15:04:55 +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=1781535897; cv=none; b=L1AOEQNsrkkjVgICcgemrRuaMNSCjWoltGqi/t5ZjfRESU5qOfBWwaBvDAxnQAPy0akOVWCF2Xq03mn1UVGgLtRfmHNPxfagsybV2yfr2IS0mNYJAYmPX8JUnYNdTkwArC06Sl8fhlXogVozhkz2V1IrwPklJ8zBFJadNtfsbeA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781535897; c=relaxed/simple; bh=qiJePkb77wcQ8uQMKyB7K1EajheX5tE398lCjm2qbrw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Cm4bqKx/xkqRFoBjccYGGNS0blkXspWoCljNsdZ9PS8j8wK1kvvoElfmms7VaBxPmr3EFSTYMXzW7jwwdzQnGX42QDycvG4JMUc73nqnV1ihZ4GhdTRCtOLc7dqFVXuQzdDSQn2RNqLTO6z1vHD81PEotC+SjmO/NEDZQWo27w0= 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=DpjF2U5d; 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="DpjF2U5d"; 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=1781535895; 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=DpjF2U5dbb5ywWyn5uJZkyv7cClTpNklEIIbBZLK70u4tsPoxpRJVRy5h53zh/XELYx+f5 jDeE2keko6HMLxMr1vVXQUQK+FLBOfOYhdQfcie12HFqhwJRFC1n/yQ+fy2fV3gnSefsdw W6bLIImMkKUdOwMRtWvLNI4rlXPMo84= Received: from mail-vs1-f71.google.com (mail-vs1-f71.google.com [209.85.217.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-532-1YF8nl3CMruwz6mzBsoFsg-1; Mon, 15 Jun 2026 11:04:54 -0400 X-MC-Unique: 1YF8nl3CMruwz6mzBsoFsg-1 X-Mimecast-MFC-AGG-ID: 1YF8nl3CMruwz6mzBsoFsg_1781535893 Received: by mail-vs1-f71.google.com with SMTP id ada2fe7eead31-6cff652cc58so4889794137.3 for ; Mon, 15 Jun 2026 08:04:53 -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=CfRTSyIary1aJvBPGK+7GA6t65mnW/lEvd/92gn9ZjBHG6f4H0d+soQzWr0V//i6OM o/3A6oyXtxLs+d78d3hje1SftcYVvyP9zKeDZZSy14hdZSFTGjdiBS8gfliE3x3L1ME7 vnXDl016QW0ou3IzkOwLXsHvV6tucGj4n1qjwj+d5s1efLJl93X3YPCBmj2cQ7ZWJ9+p 4imoFwGg/2kzjIr3Q+QDZ7ewsQ+gc6nDbLtJVo+X0motWTpT9iCX1DF+DWsEGAN2roYt IBWYOhBpcvGXKLYfxM7Vcj9rxI1dMFjnaKh85J/Ol0St3g0hdYasgzdX4/KSgND0+cwf qnUw== X-Forwarded-Encrypted: i=1; AFNElJ9Q7pagzxyNI0qlKskjfGdxvRsldAW0fH1GU4BIerfC5thDdeka0cl33KzvxYOUy0Q6pExO7P8aN31RiZQ=@vger.kernel.org X-Gm-Message-State: AOJu0YwqlsjyvqWeratqRTmkO5jqy0NCAJcAGjWyU/fwQZGmYVBGLdRr LDw7VLqYs1gMQQBzdddN2y++m8m9LUjQJpHFtkvdACLnk7IzJ2vgvuLYEKMCsFLwGVM16qyNtKa utLIAYhWQssvzZVcX/BkF/0BacO9+OyQhxCPPomb9OZj05+0dONPhmBWVk2rw/BqIgA== X-Gm-Gg: Acq92OGI5pZsrMcy9It92q5KLWgiafK4IG4ixf/IGC8HOeoVeH5EughkIzdK+k3Ajmq qdLYbShbRygl4VwHuNLaVCOZVd08ihWnhj+BlGkU9oB32fd28qqdqd8Xu6S/MoxbxjVTQgUOJuL 1RzRh9PHZclMQbreslDGVXSv2O8IOqRr6GtHY5y6Rpwmi06eHty7BeruQ62XRCdioJpgcsfLPhJ UVYARz1vUWhEUsS7Yy8b1+sAbmeG/Wd+2Cry4aU/lvNbt/Ja0jSIrBltlbywoDgCPHFfjH4OV8A THuyZ6xuqVC78t0glMSBeUbLCIhnh3dkuBa7yEMPT6TMDIvQXQckNch1HDJY4x1Hiuv8H5Cvr0E 2fF6qbtfFzta8Uxi6V3l7wAQduN5OT9JNC2CpCWLbqRFffRFG/NUjbQ5l X-Received: by 2002:a05:6102:330d:b0:631:ff40:22b2 with SMTP id ada2fe7eead31-71e88aba506mr7937966137.2.1781535893191; 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-kernel@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