From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D0218D1A44A for ; Sat, 12 Oct 2024 08:02:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=SwGEkgRRa1cwEpEXYHn8Jfzmui7uZXkgrh+X/zl8+Zg=; b=LCIv5QbalWc07+tnk1U0BIk1qh Xd8ZUZrK1j33kYUivJmQ6M2AlLhvhJZ1Zc2oDRSA8Y3IMrQPrGaj18qB92NBYg7EpkwFuZSLixfKo KCcBYcluONwM/DpUHq5AtjitzFUo2GXYEnTRDo3t13Q/JJ/XKZy+Zt/m2DRIHgfi6dUQxosunjORD 3x4BT7qXOxo49BaHe3ItuWPH1ct6Bn0IJnDHpyj0NVkHImNWPUPMct49/krtdmMiLdmBzdvlO+3+Z Liw6iO4xEuPj4bpxF6bjrAafI46oipfzgjRfihktra6xRS74T+NvMIu6RjXpJNeJdbO2S3QD0LWc7 NHY1uBsg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1szX4V-00000000nMn-2QG7; Sat, 12 Oct 2024 08:01:55 +0000 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1szX37-00000000n8o-0DVJ for linux-arm-kernel@lists.infradead.org; Sat, 12 Oct 2024 08:00:30 +0000 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-20c7edf2872so21692875ad.1 for ; Sat, 12 Oct 2024 01:00:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728720028; x=1729324828; darn=lists.infradead.org; h=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=SwGEkgRRa1cwEpEXYHn8Jfzmui7uZXkgrh+X/zl8+Zg=; b=hw6kGqdL/BGkvo2vs14DpR3RMZ/H9nWmZPJifF/WnUf6R9LwctmWPgm8mTfecJHilF 7bIASQpnzILuWgKoYqnfKyqjvrn38PBuQjgJXVQtFgcXXLjB9mIpn1wXMJfMj460Z7h/ G3HpQqqszeKCHjmcr09kOaEhtzaXm4SPYFQrsAF4HpySgxgerjMigBlvHjdebMj3rVyH QOatSJPUqm6jG2GBTA01xlWjI4pbVtTE68ZOjjh/nKSbg98ngK0+sYRxxdmcPOtXs8yH ak0YQTcu37Lrf/+siWjYmuj6QzxY+LEWnijFC6J//sX67gEgg0uD0omgi9RlXUtCddFR F+8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728720028; x=1729324828; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=SwGEkgRRa1cwEpEXYHn8Jfzmui7uZXkgrh+X/zl8+Zg=; b=H5qrJlj90V8PWpP2FWQKH6KontDwPXPgKrwaa4J0NymAEjoeiKe+WsEq98G1M3kKTM k7kWFLq86jBiVsoklc50w4QHQVhmI3mgBcZMIp+HoAg4Qcrve1MNYv+2HcJUTm3P+yQ9 86FVAobksNoPM1JI94TLfYKblaKxQd8zKfpbpe99dszEEEiMFf671/X41qLToemsD2qV 2/jpEUJ3wsGF2zC/VnFpq0tbOUKImQgCwskY6adMh9zjIhUB4/em1x7D+Wg9rVf4taIC Z7gHk0/GLHQYOYC/gg2YlzxXaMR7HUpxYUwMw+mYAkcznxfBSiFiGIsa7yp06794unZY QNmg== X-Forwarded-Encrypted: i=1; AJvYcCUdjo+W+w33VQq307tSWN4NftTDUHe+16EIdaWyPBmL+YpKb1CzgdwX3qiloMepAIVTbochMQdZHin1GY0DkfvA@lists.infradead.org X-Gm-Message-State: AOJu0YyWZ3buGu3tTI7wAmnGwGKuMsgOYY0DY1Y4lUlGHYHMiUWfzg4V wpsOROgKKZwS6ERRI6/ur4bIRvnSOfOhnTqa41H86OeQtxK7Sfm6O1YK712WQw== X-Google-Smtp-Source: AGHT+IFcLuA6Pa/yDRB0ro7g9hMgXsIhUc1ZpWkdd3AW+bO3wyX3tthtl51Bioe/OrN9QKN7qtOYwQ== X-Received: by 2002:a17:903:2b10:b0:20b:db4:d913 with SMTP id d9443c01a7336-20ca037aa44mr78217775ad.11.1728720028121; Sat, 12 Oct 2024 01:00:28 -0700 (PDT) Received: from thinkpad ([220.158.156.122]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20c8bad9968sm33450665ad.6.2024.10.12.01.00.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Oct 2024 01:00:24 -0700 (PDT) Date: Sat, 12 Oct 2024 13:30:19 +0530 From: Manivannan Sadhasivam To: Anand Moon Cc: Shawn Lin , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Heiko Stuebner , Philipp Zabel , "open list:PCIE DRIVER FOR ROCKCHIP" , "open list:PCIE DRIVER FOR ROCKCHIP" , "moderated list:ARM/Rockchip SoC support" , open list Subject: Re: [PATCH v7 2/3] PCI: rockchip: Simplify reset control handling by using reset_control_bulk*() function Message-ID: <20241012080019.cdgq63rwj6oi4bg7@thinkpad> References: <20241012050611.1908-1-linux.amoon@gmail.com> <20241012050611.1908-3-linux.amoon@gmail.com> <20241012061834.ksbtcaw3c7iacnye@thinkpad> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241012_010029_121783_A96ACC67 X-CRM114-Status: GOOD ( 27.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sat, Oct 12, 2024 at 12:55:32PM +0530, Anand Moon wrote: > Hi Manivannan, > > Thanks for your review comments. > > On Sat, 12 Oct 2024 at 11:48, Manivannan Sadhasivam > wrote: > > > > On Sat, Oct 12, 2024 at 10:36:04AM +0530, Anand Moon wrote: > > > Refactor the reset control handling in the Rockchip PCIe driver, > > > introducing a more robust and efficient method for assert and > > > deassert reset controller using reset_control_bulk*() API. Using the > > > reset_control_bulk APIs, the reset handling for the core clocks reset > > > unit becomes much simpler. > > > > > > > Same comments as previous patch. > > > I will explain more about this. > > > Spilt the reset controller in two groups as pre the RK3399 TRM. > > > > *per > > > > Also please state the TRM name and section for reference. > > > Yes > > > After power up, the software driver should de-assert the reset of PCIe PHY, > > > then wait the PLL locked by polling the status, if PLL > > > has locked, then can de-assert the reset simultaneously > > > driver need to De-assert the reset pins simultionaly. > > > > > > PIPE_RESET_N/MGMT_STICKY_RESET_N/MGMT_RESET_N/RESET_N. > > > > > > - replace devm_reset_control_get_exclusive() with > > > devm_reset_control_bulk_get_exclusive(). > > > - replace reset_control_assert with > > > reset_control_bulk_assert(). > > > - replace reset_control_deassert with > > > reset_control_bulk_deassert(). > > > > > > Signed-off-by: Anand Moon > > > --- > > > v7: replace devm_reset_control_bulk_get_optional_exclusive() > > > with devm_reset_control_bulk_get_exclusive() > > > update the functional changes. > > > V6: Add reason for the split of the RESET pins. > > > v5: Fix the De-assert reset core as per the TRM > > > De-assert the PIPE_RESET_N/MGMT_STICKY_RESET_N/MGMT_RESET_N/RESET_N > > > simultaneously. > > > v4: use dev_err_probe in error path. > > > v3: Fix typo in commit message, dropped reported by. > > > v2: Fix compilation error reported by Intel test robot > > > fixed checkpatch warning. > > > --- > > > drivers/pci/controller/pcie-rockchip.c | 151 +++++-------------------- > > > drivers/pci/controller/pcie-rockchip.h | 26 +++-- > > > 2 files changed, 49 insertions(+), 128 deletions(-) > > > > > > diff --git a/drivers/pci/controller/pcie-rockchip.c b/drivers/pci/controller/pcie-rockchip.c > > > index 2777ef0cb599..9a118e2b8cbd 100644 > > > --- a/drivers/pci/controller/pcie-rockchip.c > > > +++ b/drivers/pci/controller/pcie-rockchip.c [...] > > > @@ -256,31 +181,15 @@ int rockchip_pcie_init_port(struct rockchip_pcie *rockchip) > > > * Please don't reorder the deassert sequence of the following > > > * four reset pins. > > > > I don't think my earlier comment on this addressed. Why are you changing the > > reset order? Why can't you have the resets in below (older) order? > > > > static const char * const rockchip_pci_core_rsts[] = { > > mgmt-sticky", > > "core", > > "mgmt", > > "pipe", > > }; > I will add a comment on this above. Sorry, I don't get your response. My suggestion was to keep the resets sorted as the original order (also indicated by my above snippet). - Mani -- மணிவண்ணன் சதாசிவம்