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 C290B2F7471 for ; Fri, 26 Sep 2025 13:39:29 +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=1758893971; cv=none; b=jWM/km15jj/urxOU0LkkGlRyes8HPvDH0kDNvMvqQ7D/LQBboBv1yJ9u5OhYtA100pYiwOnLc0bOWZlavBGmMwzv5AgFl3PAJnrDJHAvlNRFFbqiYnsInuN+4z0aky0fBLTzrsB2zko1dX2GOAjRitnf9Dh/YRCwq6XHYRjAbOs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758893971; c=relaxed/simple; bh=j48e7ePqhHhvcJSE6F/tY3Q0p1ZzRgdOesq05a6n2Q0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=hVke5oM2alYEeBdjQgQGqkvMNGdrC+Sw1PmN7OBnzub6Lj2PxSbvmMeCEPfpLRgU6HnxeZkwxgctrzS7bj/sYYCaxjtGWxNZcEwJILBkkj2LJce+zDDoutlmPkSgpucVb71QM2ZgPIjvkCfDU6sN8SEnTOHDZm6ktrjQaeN3tNM= 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=izncMGYN; 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="izncMGYN" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 58Q9jqAh024186 for ; Fri, 26 Sep 2025 13:39:29 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= E63HIm6hfUIUCF/NebOyqvn6g+tEqkfrm8u2QMJ5tw8=; b=izncMGYNdUqo8E3w gQZxTs52PektAYwyZSafWsuPESdlDkPK79sbajX8hDHMXorHmH8P9o2HR/1JLQdt OpZW+6yye80afqDWs3iqyNoIkqtWPXvbBVX9S/gz6TOPExAM26rAnehCi8+ij/6a sueHn0d6nN9i76ndyP9gxQ5IuZbpjfjStLS5a4SAtgzA6G85JfQGvC340XrkHuZN EoPyY3RHd44NdBFvJTyblFemUHcRVwdGyCIvhgp2o1W/p0uM55anRT95fpOlt7/Q qxZMGKiAyDNoXBfglP4uWeELZgzvUQsTcvKWbVn3cTo6GyMFTnAuLtMonQp5M3Ai xsnmDw== Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 49drfwgmtp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 26 Sep 2025 13:39:28 +0000 (GMT) Received: by mail-pf1-f197.google.com with SMTP id d2e1a72fcca58-77f3aa0f770so3877283b3a.2 for ; Fri, 26 Sep 2025 06:39:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758893968; x=1759498768; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=E63HIm6hfUIUCF/NebOyqvn6g+tEqkfrm8u2QMJ5tw8=; b=GJ11zDAa872dH4sA0CoGwt5KxjUEKvfGDNH/LV7GCQ15ou1GvDBMLQPEUgq1DURpzP VHgwVKeZNv6Ev/Hxzw5c1Ugy5NLoC3Hn69wd6+0uU7WAhT3BKvCxElJM0iAry+iX4LLw MyChvLGoTv1+IaMvnqhaxtxrK6NUI9JPSajhADntEtx5vmDvW24B8IULAhuxUR8VMiOl ltCMXDASzCkXCDyWiGpygqGB58IjA3wYNH3EnZ9+Ya9/SNVEvUeEj6AqbPUSBumtxkVV 7FYWf0rYEwk+XmmhQkUfR6mO56F4nHbir6DXjGD0rrvAs/rXQ/DVtZh0zBv1n3S9iwla XqMA== X-Forwarded-Encrypted: i=1; AJvYcCXojpw1FX+GINhRtAz4H6DpNQ2fViecWW6yDQ9zkefXxnZWqiU473zQKbAnhgc7YSOgQGRD3SPZI1tU@vger.kernel.org X-Gm-Message-State: AOJu0YxsbqinAsRNrJx+16Ab12azTBKfv+0u9xZELaT5NLMgQUfcg1kY pXleqlYPstH52Go5BQ5uagr3Y5G3KQRummf+dgZgCELjCVyFgWmd93zJDA5ogsiyKGRAZDGGjmN GfhSlbpoBKgy+dczTjj7WGHxb2Cj47SBmXsPwLkh/BGTvRcsqVxj8eIcP+CzywkbW X-Gm-Gg: ASbGncuepq3iqDM8hgR7D013BQ8ziOw6sAuQqOYktZxrbhWwaSk7em3UbHdCuFCNqBt zOKl5MZgjXB9ppD1aYjviBYcQy1eMzdDWdBRGB3eP2qlRiBCpFVj3Uxxj7bSALYsA3Y7bArKQCG Wj2bp5osdhmvxYwkTzYyUq/LTayRL3oYB0rf9EbjJLCIfETbYFFFFeOhFwUAHdvTa0uNHgnRR6a wWdTW3vKljNRp6ljAOtFlu5kwJMksAg4gAjL5bd8m30g2DKq7t/cJtO7BmcedZQQpxE2BAhU+FV ldqiXGeV4RieBfkVxP6gxJgKGRnGB8tpK5JjWdkIsMwjUB0Pf59tuAZknpAWOMI3QETHc2Ml8eo = X-Received: by 2002:a05:6a00:23cc:b0:780:f6db:b1bd with SMTP id d2e1a72fcca58-780fcdd28d1mr8678987b3a.4.1758893967945; Fri, 26 Sep 2025 06:39:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGiaP1HxRLVUpY8VZEiq5l3q06EZMQQVXQhWmy8UEaYDj2MmG+Nz3UAs4qURBGWNpupm3mF0Q== X-Received: by 2002:a05:6a00:23cc:b0:780:f6db:b1bd with SMTP id d2e1a72fcca58-780fcdd28d1mr8678917b3a.4.1758893967264; Fri, 26 Sep 2025 06:39:27 -0700 (PDT) Received: from [192.168.29.113] ([49.43.224.88]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-78102c048fasm4502469b3a.75.2025.09.26.06.39.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 26 Sep 2025 06:39:26 -0700 (PDT) Message-ID: <4a3f9494-27a2-47d6-bdef-0b1bcbd99903@oss.qualcomm.com> Date: Fri, 26 Sep 2025 19:09:17 +0530 Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v6 5/9] PCI: dwc: Implement .start_link(), .stop_link() hooks To: Bjorn Helgaas , Manivannan Sadhasivam Cc: Bjorn Helgaas , Lorenzo Pieralisi , Rob Herring , Krzysztof Kozlowski , Conor Dooley , chaitanya chundru , Bjorn Andersson , Konrad Dybcio , cros-qcom-dts-watchers@chromium.org, Jingoo Han , Bartosz Golaszewski , =?UTF-8?Q?Krzysztof_Wilczy=C5=84ski?= , Catalin Marinas , Will Deacon , quic_vbadigan@quicnic.com, amitk@kernel.org, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, jorge.ramirez@oss.qualcomm.com, linux-arm-kernel@lists.infradead.org, Dmitry Baryshkov References: <20250925172517.GA2169496@bhelgaas> Content-Language: en-US From: Krishna Chaitanya Chundru In-Reply-To: <20250925172517.GA2169496@bhelgaas> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-ORIG-GUID: CB2lkLPSipnu4No5r5_LuJmQtfzK1RmZ X-Authority-Analysis: v=2.4 cv=JKA2csKb c=1 sm=1 tr=0 ts=68d69790 cx=c_pps a=rEQLjTOiSrHUhVqRoksmgQ==:117 a=w+9hNF1SH6wH5mqaHp+xkw==:17 a=IkcTkHD0fZMA:10 a=yJojWOMRYYMA:10 a=EUspDBNiAAAA:8 a=AYVm423qkfQxZcs1cpAA:9 a=QEXdDO2ut3YA:10 a=2VI0MkxyNR6bbpdq8BZq:22 X-Proofpoint-GUID: CB2lkLPSipnu4No5r5_LuJmQtfzK1RmZ X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwOTI2MDA4OSBTYWx0ZWRfX+9UtVklELc9b V7NzVr4RqRt5KtdwRg5i4JwiecwXAC/hsZhVFX2yhJPMaDfYnne4Bwh6TNVw+wZtUE8eiWkOupB D/SUjqgvexbEU81YiPq1gJDifBWuape2zquyOzPltn9gU5eJsThzvFbYzzssH1zqgNA78h8/ZSF cdl3JXlX7TmG5rjTuvqNAuW1UjRNXjcFTPLsbN7cwTyDBsOWMv+bzuduFG8UW+ab+0PClWKCXZc yfZVnU1IEep8StyZDRpo9d6kSu7/D/RM8BYofTLY24VLLP2y+8i0m8UHk39AFv2jFvOp8Llmihv bK/ifwe2AZwQc9Nby9K90AXeKIqz8pFtS4yOlWC/rub9lj1eH2PgM3kV+oBlJaM1AbCDvuSuf7W BdmrkM5d7FsBwmvVM23HOg/I21Lqjg== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1117,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-09-26_04,2025-09-26_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 clxscore=1015 lowpriorityscore=0 phishscore=0 suspectscore=0 bulkscore=0 spamscore=0 malwarescore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2509150000 definitions=main-2509260089 On 9/25/2025 10:55 PM, Bjorn Helgaas wrote: > On Thu, Sep 25, 2025 at 09:49:16PM +0530, Manivannan Sadhasivam wrote: >> On Thu, Sep 25, 2025 at 09:54:16AM -0500, Bjorn Helgaas wrote: >>> On Thu, Aug 28, 2025 at 05:39:02PM +0530, Krishna Chaitanya Chundru wrote: >>>> Implement stop_link() and start_link() function op for dwc drivers. >>>> >>>> Signed-off-by: Krishna Chaitanya Chundru >>>> --- >>>> drivers/pci/controller/dwc/pcie-designware-host.c | 18 ++++++++++++++++++ >>>> 1 file changed, 18 insertions(+) >>>> >>>> diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c >>>> index 952f8594b501254d2b2de5d5e056e16d2aa8d4b7..bcdc4a0e4b4747f2d62e1b67bc1aeda16e35acdd 100644 >>>> --- a/drivers/pci/controller/dwc/pcie-designware-host.c >>>> +++ b/drivers/pci/controller/dwc/pcie-designware-host.c >>>> @@ -722,10 +722,28 @@ void __iomem *dw_pcie_own_conf_map_bus(struct pci_bus *bus, unsigned int devfn, >>>> } >>>> EXPORT_SYMBOL_GPL(dw_pcie_own_conf_map_bus); >>>> >>>> +static int dw_pcie_op_start_link(struct pci_bus *bus) >>>> +{ >>>> + struct dw_pcie_rp *pp = bus->sysdata; >>>> + struct dw_pcie *pci = to_dw_pcie_from_pp(pp); >>>> + >>>> + return dw_pcie_host_start_link(pci); >>> >>> This takes a pci_bus *, which could be any PCI bus, but this only >>> works for root buses because it affects the link from a Root Port. >>> >>> I know the TC9563 is directly below the Root Port in the current >>> topology, but it seems like the ability to configure a Switch with >>> I2C or similar is potentially of general interest, even if the >>> switch is deeper in the hierarchy. >>> >>> Is there a generic way to inhibit link training, e.g., with the >>> Link Disable bit in the Link Control register? If so, this could >>> potentially be done in a way that would work for any vendor and >>> for any Downstream Port, including Root Ports and Switch >>> Downstream Ports. >> >> FWIW, the link should not be stopped for a single device, since it >> could affect other devices in the bus. Imagine if this switch is >> connected to one of the downstream port of another switch. Then >> stopping and starting the link will affect other devices connected >> to the upstream switch as well. > > Link Disable would affect all devices downstream of the bridge where > it is set, same as dw_pcie_op_stop_link(). > >> This driver is doing it right now just because, there is no other >> way to control the switch state machine. Ideally, we would want the >> PERST# to be in asserted stage to keep the device from starting the >> state machine, then program the registers over I2C and deassert >> PERST#. This will work across all of the host controller drivers (if >> they support pwrctrl framework). > > I don't think there's a way to implement .start_link() and > .stop_link() for ACPI unless it's by using Link Disable, which is why > I asked about this. If Link Disable *does* work, it would be a very > generic way to do this because it's part of the PCIe base spec. > Hi Bjorn, We did test as you suggested but unfortunately the setting are not getting reflected we need to explicitly assert perst to make sure pcie is in reset state while applying these settings. - Krishna Chaitanya. > Bjorn >