Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp304736lqt; Thu, 6 Jun 2024 04:21:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVtfCzEpQuanBE4XMrXFEzhmw9sk+P3I8U1Hdn+IHRRd3WCSRmHzRTnvl5Xu6bvzad0wHctm3C3Sgi+0Dh75YshhMtRvTAdZioDXbmoag== X-Google-Smtp-Source: AGHT+IG85e3PsGoC4rkVVq9GdBzcZvuqVnF3ntw6lKfw5B4tOj9THMCeLby6ljNJL979PtPOHXcX X-Received: by 2002:a05:6359:4c89:b0:18d:9114:eb1e with SMTP id e5c5f4694b2df-19c6ca09f45mr556269255d.22.1717672919284; Thu, 06 Jun 2024 04:21:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717672919; cv=pass; d=google.com; s=arc-20160816; b=tZpb/PGY4SclpyPOZyQBLTg94FDkxPpmIo5PPMdkoS9Q6cvG/6sWfy0hJ5VoF7pyjC GT5eU2o+++HhrdR6RDRXGKtsJPg8Aa29qhWSlW1GU68C9tMNw5+LagdLa29DJyOqJNuZ UtRgCUwmQLMgJcNPgu/1A/aMOogwkb5ifrNH5Gj1vKKRqDV/F7aA18Q4bSjJvaXAAia0 /BW7Xp0qctNf6c3h/fl8/a87oDSKTJp0kHFSg3tGivrQMxAmpkmPDXjJhbvIaYHev0H5 ijE0yd8gEYkH/Gt+6mLOu1s7Bgrp/VJH3W329znwpZ88tjKyHJXwAULEI1TpVLoKWwIt lsZA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ZHhYe9SXX81VO9UiinRj2/vpq4eEiarfDw7Bhml8Hpc=; fh=b7pi59FcddbOkqjC/StRM3NasbmNqNndPp1vZL4laCM=; b=onQBfUVI9x3qyOvgAxvSQ8HOjWxx1M5zME2KgyxflEToI6jXGFvNC0MguzyKz0L5Ph V2LG1FwyXTAJ3E3Gw/4E9nck+AvR5mQd2jtOGkjKXl0Yb9uG6VE2ymm95CEBpZdE9bzQ Wp6YlLRsYFYfulYb31LzSxCoKCiVSrvaKdKTlYrNwT9tcqwb8KacL67rJhSAETgEUzzX 6+G9fHy35vxFeGyJ/JXbd2YC0eCuEotDX/ZMF+pak9qSvCUhRvz83Kj1ip8CqEl3s+mf ZhbgmYlHKtF4zGH8GEqvW4eLqpki9NfshM4NNkOlTzgihT1k75XtYsGnuapJ8D857eqr qGEw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=VjgECtmK; 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-204142-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204142-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-6de2760bd2bsi1013727a12.549.2024.06.06.04.21.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 04:21:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204142-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=VjgECtmK; 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-204142-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204142-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id A4A88B22C92 for ; Thu, 6 Jun 2024 10:53:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 54E9E1953A2; Thu, 6 Jun 2024 10:53:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="VjgECtmK" 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 C393C2E639; Thu, 6 Jun 2024 10:53:26 +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=1717671208; cv=none; b=uVrDZU3QpuEcPwmnA6rxoZG1/Kwc77RH7q6a1ue9KA9nlYiT8PVt1kjR315Y6slAWsleA5iKHKRq/ff7xfw01A4VCz8aEVStS0d+ZQyEU38EWjG2EvVl1H59NzAB1bdwJcrMBSYNjNdbPGCr3b4Y0heAPuCt6O35f5Stk34zOtQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717671208; c=relaxed/simple; bh=ZpuzNlwMqe4oHu3girJ5a0z9IYHGTkMdZYPNlhM+SdQ=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=lItDjD6IFjyoeQ8YZUHT2DlJwkwNfiS1xkWL6MNj6EE6BMBNWmkcRS3muUDu0si/Lo7/B1rBk+oh/1tm42l7334Yt3zwk7//S0El3wOdj2zeO8Kp3inDTZuu5Wb51xHHvKvgre17M6yKywzZ1SSPNQGC762FsA3FtNlugZhXDKk= 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=VjgECtmK; 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 456AqZ4k067178; Thu, 6 Jun 2024 05:52:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1717671155; bh=ZHhYe9SXX81VO9UiinRj2/vpq4eEiarfDw7Bhml8Hpc=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=VjgECtmKCuhCXw6iZwOgDvXfZncWFe9iL8P5si5yVX3gRYm/GMZXQMhQQuKYOMOsv fKWS8rOLCPNIB8l4894jY5tdDgBTqnqQbbrXnFWAziOcyC52SvpcNcvHVIFre6iBqR VijY43WsvZoGGvEIqkAjZdYup9nrh6S/UUewJDlQ= Received: from DLEE105.ent.ti.com (dlee105.ent.ti.com [157.170.170.35]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 456AqZLg053435 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 6 Jun 2024 05:52:35 -0500 Received: from DLEE111.ent.ti.com (157.170.170.22) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Thu, 6 Jun 2024 05:52:35 -0500 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DLEE111.ent.ti.com (157.170.170.22) 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; Thu, 6 Jun 2024 05:52:35 -0500 Received: from localhost (uda0492258.dhcp.ti.com [172.24.227.9]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 456AqYOG071819; Thu, 6 Jun 2024 05:52:34 -0500 Date: Thu, 6 Jun 2024 16:22:33 +0530 From: Siddharth Vadapalli To: Manivannan Sadhasivam CC: Vignesh Raghavendra , Siddharth Vadapalli , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Richard Zhu , Lucas Stach , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Minghuan Lian , Mingkai Hu , Roy Zang , Jesper Nilsson , Jingoo Han , Srikanth Thokala , Marek Vasut , Yoshihiro Shimoda , Thierry Reding , Jonathan Hunter , Kunihiko Hayashi , Masami Hiramatsu , Kishon Vijay Abraham I , , , , , , , , , , , , Niklas Cassel Subject: Re: [PATCH 3/5] PCI: dwc: ep: Add a generic dw_pcie_ep_linkdown() API to handle Link Down event Message-ID: References: <20240606-pci-deinit-v1-0-4395534520dc@linaro.org> <20240606-pci-deinit-v1-3-4395534520dc@linaro.org> 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="us-ascii" Content-Disposition: inline In-Reply-To: <20240606-pci-deinit-v1-3-4395534520dc@linaro.org> X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 On Thu, Jun 06, 2024 at 12:56:36PM +0530, Manivannan Sadhasivam wrote: > As per the PCIe base spec r5.0, section 5.2, Link Down event can happen > under any of the following circumstances: > > 1. Fundamental/Hot reset > 2. Link disable transmission by upstream component > 3. Moving from L2/L3 to L0 > > In those cases, Link Down causes some non-sticky DWC registers to loose the > state (like REBAR, etc...). So the drivers need to reinitialize them to > function properly once the link comes back again. > > This is not a problem for drivers supporting PERST# IRQ, since they can > reinitialize the registers in the PERST# IRQ callback. But for the drivers > not supporting PERST#, there is no way they can reinitialize the registers > other than relying on Link Down IRQ received when the link goes down. So > let's add a DWC generic API dw_pcie_ep_linkdown() that reinitializes the > non-sticky registers and also notifies the EPF drivers about link going > down. > > This API can also be used by the drivers supporting PERST# to handle the > scenario (2) mentioned above. > > NOTE: For the sake of code organization, move the dw_pcie_ep_linkup() > definition just above dw_pcie_ep_linkdown(). > > Reviewed-by: Niklas Cassel > Signed-off-by: Manivannan Sadhasivam This patch already seems to be present in linux-next: https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git/commit/?id=3d2e425263e2674713220379ad04e925efdb731d&h=next Other patches in this series also seem to be merged. [...] Regards, Siddharth.