From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 2D07F3FCB22 for ; Mon, 29 Jun 2026 09:21:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782724908; cv=none; b=NVS9tuHw4vRDDvQrY91AFTvbT6XYvzIlw+NcOmStbnnZLIjibCpYt6/zdJ6iFTbqGIOIBeubiK53EDzKKZcRktC3UF2K90oSlDoHzYq06mfEGEFW/R2Mp4NfJC+q/BLkuI5PkQpF2rGGSpZWX539mCzwFhUv2JbYn6JJm0pqmHQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782724908; c=relaxed/simple; bh=tEXdytwln3SqyuvYYX3Y04VgOf7AzAU5hyB3sLNR4xI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=tf8jzzCu+tGW5CrlMzR0YHkY6yNcRSOPQI3MDn175hHRDJJjJ/T/UJEbB6P1sGE81bYV6oBhdogamcoCea/nSVcw5mTs1YOe7ox7CmJUXF3m/o5HVMsRgskrykxMPL1wDk2DYBmn8HRw3N1Xf//CsOV4Juj2D8BSOTf5J1BrRek= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=gILl2WvU; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=ABk99JrD; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="gILl2WvU"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="ABk99JrD" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 65T91OwQ2400899 for ; Mon, 29 Jun 2026 09:21:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= NLDCIDvWiMtamq06GaZ8B9EiMhANn7gwMnT2WeVy/c0=; b=gILl2WvUe8GeJrsC 6MbaDGsDZo7RyhRKQ18LjtvKhGl+0pocnpbs2QpXcs1rq0ndE99Vl3q6U9VB23/2 9k/gnSjLUfQV56jKVjgaRfoxsBI7bb5xU/npa8h64nlVbOKKG/1GUac8MwWfRQvk zPZmvblblXeVxDzg4hXOrrRByR0B0Dc/pkMhwgSzvAsEOSSLadlx7LdzovYurWSk HiwXpOYpD2+2NgUKJSp1SayzhAHC79qpIQ0gyk9gS4DI8wHovRwMUkVLJWMmsarN d9o/+o1WE8LDTSSAZySbJIJIw+5+VraEf9kfV1al97eojCmTY6BdngId4AjkcIin g8GmKQ== Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4f3nq8833v-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 29 Jun 2026 09:21:45 +0000 (GMT) Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-51bf599c27cso391201cf.1 for ; Mon, 29 Jun 2026 02:21:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1782724904; x=1783329704; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=NLDCIDvWiMtamq06GaZ8B9EiMhANn7gwMnT2WeVy/c0=; b=ABk99JrD663eQDlnoKUzAE2jNio47xOlZhCmD7L+oHrOdzk36T4Xupn7fmpMlXu5Yj GEBxsU5vuLriUOLLq22QAmuhKs5FYk9n+h2pBmSUsnx+CcMeLTsFxlgb2fRh6wmS4Fxy 1tMjPhDGeehDgxZwzSH9v/RxIOVzXYriSkZFg491PYEfp6T/zkt1ymTjDUqrcwD4nQr0 5uSKvw5io4G6chptsluvQF7dUWkHZe/W9CUe869IrDamlTkhvwPKYuou7HL74luYSBQK 05DDdZOfIG0JoyF8sCi8V9KWagcnGMB7G2jfdXc1cGwUmvUUj3t/ZAOI3aZ6q2FFgTiy E8mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782724904; x=1783329704; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=NLDCIDvWiMtamq06GaZ8B9EiMhANn7gwMnT2WeVy/c0=; b=rMAx+Ff3ORbk1I2fQL+b3+ZXBS598OpPyT7pBFani912xhJQMGN7Gd3DTw7uPhy/0U qa8yfO7+O9LBnl2YxZIBHdT6uO8MQKuOD07Jh/U8ZnslcTvLQOj0cjjpep9k7zlZm44G FZqR4/iWNjmJZd1MRTjDh1bshFzrfxwVQ+VzUNoJL7IgrQc6jfxRoPUvBqsS3P2H9cSB zlyfhnlH3s4how/bKO+fX/KwUWkC7GXH5FtYJDznYs8uWLPyZ3xaPh5wy9QJ37tiP7pf 98cqWgAlIDYISE4qzssqfNrwkjTd6+2IKFQmaiQmtUQR1vs5Kxzkhlx0hWOVN1xVH2md DSvQ== X-Forwarded-Encrypted: i=1; AFNElJ8zLLvZbWmOsSaJ8Y+YSLV5qKkzXQBW2j1PjG+PDT6kMtG6OEcFihfyymVg4nHxPWStx9Orgiw8BR6Wd0M=@vger.kernel.org X-Gm-Message-State: AOJu0YwaOEyhdBnCICJ2q6JeKI1RxdYpHrV2a0+04rjJrljFebelDn6l fRNu3X8KZMuaCubDMWdnFC8KnFb51KKEvMgzo4sYuyVY+p2/VcGgfEw/rDnBm2HZ/5FE0Xmj49i Mob0oxGA9SMH5Z8n+PZQ2q4gvs3jBOBMbyv9VXVlI4pl3/8tG+6DrMP1SUFoDN/tsPrE= X-Gm-Gg: AfdE7cn+tGXN9H2zYEWcp0Dkxp1VGYNo4AKMMl07JbeyTtvJ4b7HwV40BoWme/YwTg5 k44qqbEHzShM2Cc2J99LHEfUKqskEru8ez0cZFipZQy1c0GiTSHKgwg9JkBx1yuaGBGvc6OtdKt NuKp6PgdZ0jEEMGxpdQSbgXts3Jj0t0RfLF6bXtRYcQc8K1HJ2yjCh89lgqYmMBORz4xS78nCiK kQg6gWaVXt33P4PDm3pMGwD0iG9kXn/31hdm759nZRpzjoPbFhKcKvR/EuOZYtqnSQVsdrpjUtL E3X4QYkGBF8OSfaNUZ+S8YQgdijroKhkpzRayD5g68bi4xpjAfTH7WOvz7mvRep1+JlU6RBEVUA UeX3GAQtjBVwcmxm3L8obHA8lrauIypa0R90= X-Received: by 2002:a05:622a:1813:b0:50e:6311:7380 with SMTP id d75a77b69052e-51a72831d5cmr155230991cf.6.1782724904308; Mon, 29 Jun 2026 02:21:44 -0700 (PDT) X-Received: by 2002:a05:622a:1813:b0:50e:6311:7380 with SMTP id d75a77b69052e-51a72831d5cmr155230661cf.6.1782724903818; Mon, 29 Jun 2026 02:21:43 -0700 (PDT) Received: from [192.168.120.170] ([178.235.128.140]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c127b7619afsm29219266b.4.2026.06.29.02.21.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 29 Jun 2026 02:21:43 -0700 (PDT) Message-ID: <8fbbe66a-839e-4099-991c-f5b2868f03bf@oss.qualcomm.com> Date: Mon, 29 Jun 2026 11:21:40 +0200 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 RFC v4 5/9] phy: qcom: qmp-pcie: Refactor pipe clk register and parse_dt helpers To: Qiang Yu Cc: Dmitry Baryshkov , Manivannan Sadhasivam , Vinod Koul , Neil Armstrong , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel , Bjorn Andersson , Konrad Dybcio , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260518-link_mode_0519-v4-0-269cd73cc5d1@oss.qualcomm.com> <20260518-link_mode_0519-v4-5-269cd73cc5d1@oss.qualcomm.com> <1bbccb16-b91e-4116-a4cd-213a46978fa1@oss.qualcomm.com> Content-Language: en-US From: Konrad Dybcio In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Proofpoint-GUID: fx3WxC5AA87S1uWdyyJtsEvUaw51Xw1l X-Proofpoint-Spam-Info: AW1haW4tMjYwNjI5MDA3NCBTYWx0ZWRfXxKwARQ+k7eeh 82zP84y4NXS+PuTiy/BAZmVAuQCZJuFwqq8q1c6x5fdGCPdUODyjlmOjvQ13x5TI17vpv9rhQxd mFqNWWNgeGmWkstGMsU3a/ugbsttnhQ= X-Proofpoint-ORIG-GUID: fx3WxC5AA87S1uWdyyJtsEvUaw51Xw1l X-Authority-Analysis: v=2.4 cv=PqSjqQM3 c=1 sm=1 tr=0 ts=6a423929 cx=c_pps a=EVbN6Ke/fEF3bsl7X48z0g==:117 a=PRfkaYvzSr8QmIIGAkY2Sg==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_K5XuSEh1TEqbUxoQ0s3:22 a=EUspDBNiAAAA:8 a=OXfuQhhJyhkMGnq2POkA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=a_PwQJl-kcHnX1M80qC6:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjI5MDA3NCBTYWx0ZWRfX57JeteOWPfM5 9pYcH1B61RvJoRnvIzySVKkAhz6MhmNwdUXw5Fc/c8vkGzOdKneMyMQqiRHzumlvHClUjIUFsHn bidJHh3vQmHWQ4Czji3v0HkmblAPjEF+9TixvJVrrLFaVxt6y95F3Nioq8Qrrab2f0m665BFv/E bLZCVZquOOrXufJDC0uPx0HsjX7puvstcXIk/Kv/71+n0ENPRXqR+c0EwaYWjWarkzRNLABrk65 w7BCLDW7Oxoi0N4cNYUk8iLASNDd18qTQx73WpDD33QYrFZCt9O/KbaLyOUmYqlYMAONsBdgoKy n/TQwxnU5Gg6jnjSarhLfbnni/ecu8Lod35+67YMeSqbsX9Rb16tu/8Tc7cDj/40JgabcngZ/q9 zy3whvec1QJNBy01BCyIOMJPiMgPhhDFP6eOnc56sLPKy1oXcRCU8ZohE6Aj6v/gfIMmeHIjZPj YYqcPMt6zWZS3zdz75Q== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-29_02,2026-06-26_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 priorityscore=1501 adultscore=0 clxscore=1015 lowpriorityscore=0 bulkscore=0 malwarescore=0 phishscore=0 suspectscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2606290074 On 6/29/26 7:56 AM, Qiang Yu wrote: > On Tue, Jun 16, 2026 at 04:05:43PM +0200, Konrad Dybcio wrote: >> On 5/29/26 9:02 AM, Qiang Yu wrote: >>> On Thu, May 28, 2026 at 04:48:24PM +0300, Dmitry Baryshkov wrote: >>>> On Fri, May 22, 2026 at 04:27:35PM +0530, Manivannan Sadhasivam wrote: >>>>> On Wed, May 20, 2026 at 07:25:01PM +0300, Dmitry Baryshkov wrote: >>>>>> On Mon, May 18, 2026 at 10:47:16PM -0700, Qiang Yu wrote: >>>>>>> Some QMP PCIe PHY hardware blocks can be split into multiple sub-PHYs >>>>>>> under a single DT node, each requiring its own pipe clock registration and >>>>>>> DT resource mapping. The current helpers are tightly coupled to a single >>>>>>> qmp_pcie instance, which prevents reuse across sub-PHY instances. >>>>>>> >>>>>>> Refactor __phy_pipe_clk_register() as a generic helper and reduce >>>>>>> phy_pipe_clk_register() to a thin wrapper around it. Similarly, extract >>>>>>> qmp_pcie_parse_dt_common() from qmp_pcie_parse_dt() to hold the register- >>>>>>> mapping and pipe-clock setup that will be shared between sub-PHY instances, >>>>>>> with pipe clock names parameterised per instance. >>>>>>> >>>>>>> This is a preparatory step before adding multi-PHY support. No functional >>>>>>> change for existing platforms. >>>>>>> >>>>>>> Signed-off-by: Qiang Yu >>>>>>> --- >>>>>>> drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 76 ++++++++++++++++++-------------- >>>>>>> 1 file changed, 44 insertions(+), 32 deletions(-) >>>>>> >>>>>> I'd suggest splitting the Glymur PHY to a separate driver. Otherwise we >>>>>> end up having too many single-platform, single-device specifics which >>>>>> don't apply to other platforms. >>>>>> >>>>> >>>>> I don't think that's really needed. This shared PHY concept is going to be >>>>> applicable to upcoming SoCs as well. And moreover, the split won't be clean >>>>> either. We still need to reuse a lot of common logic in the 'phy-qcom-qmp-pcie' >>>>> driver and may only end up keeping very minimal code in >>>>> 'phy-qcom-qmp-pcie-glymur'. >>>> >>>> Then splitting makes even more sense. Let's not clutter the existing >>>> driver with too many conditions and options. >>>> >>>>> >>>>> If you are concerned about the file size of 'phy-qcom-qmp-pcie', then we should >>>>> move the SoC specific 'cfg' structs into a separate file as that's what >>>>> occupying majority of the space. >>>> >>>> No, it's really the 'shared' part. >>>> >>> >>> To confirm, are you okay with some code duplication between the new >>> Glymur-specific driver and phy-qcom-qmp-pcie driver. >> >> That's a necessity, to some degree. See e.g. qmp-combo and qmp-usbc >> > I've already prototyped a separate Glymur driver, and it turned out better > than expected — there's actually not much duplication. The parts that do > overlap aren't fully identical either; they tend to diverge once the > Glymur-specific handling is factored in. > > Currently, I meet an issue when tesing the patch, and will post it after > fixing the issue. Good, thank you! Konrad