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 74B93D21690 for ; Tue, 15 Oct 2024 13:02:24 +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=gQ2ExxafYH8pysjVtyTxWl0xH3aoVpQcW06brvyTYc4=; b=wTpE1TEXqyl4TOhevrDfcGQusD co+enoX0p7ZA+6JZ7RLshA4T0NuCKis1HCgS9LeTOeWi8AWTUCslfZcvids2JEhfnkxhSB8LzVVHs xtVmlRseUtliDvVbnsd34rnT7OdYXJT2YnGB5UsPJFAf+tM8DUansN9OiZidBy2XcOUzPE95IClBB 7erSNSXyr/QYZGCQvJLxxG9p4YLN1p6Fg/4pf7R8HotQCGKGB52YDCAmwDxC+RdVt2PkDYY4ZW09A TOBNcxbzwpQW4/TT7fK9BZOM1mwUqEZsIsolVE18Q29oqeVhNRXP7HnxzQI4SvBj0wdSpRQTlb+QM Uqxpkffg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0hBj-00000008Giv-13we; Tue, 15 Oct 2024 13:02:11 +0000 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t0h9U-00000008GNU-23wZ for linux-arm-kernel@lists.infradead.org; Tue, 15 Oct 2024 12:59:54 +0000 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-20caccadbeeso39526715ad.2 for ; Tue, 15 Oct 2024 05:59:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728997191; x=1729601991; 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=gQ2ExxafYH8pysjVtyTxWl0xH3aoVpQcW06brvyTYc4=; b=srcpZfCstUD896/1gISGRyG1+i76yFUPUMoVJENPxglhzJ2OS5SWBz8h2gm6P4YJpk fRMr1/aKLoWo0xU+3WAl2WnsRdAhBzWSBKC3TIxGy68o6/Mp9DInZadSa9eO3Htgm60L tUi5ykpu6z5Ig9VL+l8t8toyfMQYH41BcQRlo5AXFaE+bx1GL+yJUWq7G5XsRfYPkBli SNiXt012o7oCc3sPHrBezoIbHez6GTq+zGQL+URKR9kM2vphbACs5aiVb51ZNy0jGMWL ZcoeKSvBEEpaiWFo9LI6rfCE8iTMQYHRewzQ7iWAGS6Li7D1INlODmZ/10GE6Fh2r5MO LcbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728997191; x=1729601991; 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=gQ2ExxafYH8pysjVtyTxWl0xH3aoVpQcW06brvyTYc4=; b=A4J4S8tZOkRxt/oOEFNwbgMJahiOQwgt1m+RJl/kw2hJAlQ2cJUwINDHzCaPCmyY6b pzedYxZzl6EmGIBUvWtYrghJq/YnkdtpHa2GvvL2n8C514/8kdcDtwKKjwlvdWhr1Dim YAUY2oouve4nK7D/3d6vHHVlXzK/n1f0fa6TPLKutzMrFVfK9uhOEKH/XEU0olINGVdi 190vtL/fAl85uS/CZ5w8AEBY+ceM4OvZLcrQRF/xBZRxxyDil9Hgh9HkNxyDYPOxbHLw ARM831ZEeRAXXnWoD4OdA7nxCJjmLrtSgYTPTenOXfZLF5w+/Rwu42hPaONTQ8Wa9o5c rNqA== X-Forwarded-Encrypted: i=1; AJvYcCWPd2/+qhd7Ku45bHtG0vP4EHCJbbgWP5Jp9jXqHL/pgJnRYV3rblVDaz5HjteSeSg9bpp6K0rOUb3UfyYCm5pt@lists.infradead.org X-Gm-Message-State: AOJu0YxRb8GOuPDqrMUvZw9WN1/D7WXAK5/cBF3Jb81Wu3roaTgBCh1h 8OrDPnEtAu+Rgl65+rWh46ws251aFWmgq6pLdjFe8UX4zK8CId+tBU2zsUtgRA== X-Google-Smtp-Source: AGHT+IHkGuzbGfZUwoftrk6pBddGB0A/KcBGkupentXwPJMsPJLg9KJR/+RBkXTL5DL7BPN+340c5w== X-Received: by 2002:a17:903:2301:b0:20b:7e1f:bff2 with SMTP id d9443c01a7336-20ca145921fmr210209595ad.17.1728997190673; Tue, 15 Oct 2024 05:59:50 -0700 (PDT) Received: from thinkpad ([220.158.156.88]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20d17f84f5bsm11534205ad.7.2024.10.15.05.59.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2024 05:59:50 -0700 (PDT) Date: Tue, 15 Oct 2024 18:29:45 +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 v8 2/3] PCI: rockchip: Simplify reset control handling by using reset_control_bulk*() function Message-ID: <20241015125945.llbyg6w7viucw5rh@thinkpad> References: <20241014135210.224913-1-linux.amoon@gmail.com> <20241014135210.224913-3-linux.amoon@gmail.com> <20241015051141.g6fh222zrkvnn4l6@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-20241015_055952_560922_A5753221 X-CRM114-Status: GOOD ( 29.05 ) 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 Tue, Oct 15, 2024 at 02:30:23PM +0530, Anand Moon wrote: > Hi Manivannan, > > Thanks for your review comments. > > On Tue, 15 Oct 2024 at 10:41, Manivannan Sadhasivam > wrote: > > > > On Mon, Oct 14, 2024 at 07:22:03PM +0530, Anand Moon wrote: > > > Refactor the reset control handling in the Rockchip PCIe driver, > > > introduce 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. > > > > > > Spilt the reset controller in two groups as per the > > > RK3399 TM 17.5.8.1 PCIe Initialization Sequence > > > 17.5.8.1.1 PCIe as Root Complex. > > > > > > 6. De-assert the PIPE_RESET_N/MGMT_STICKY_RESET_N/MGMT_RESET_N/RESET_N > > > simultaneously. > > > > > > > I'd reword it slightly: > > > > Following the recommendations in 'Rockchip RK3399 TRM v1.3 Part2': > > > > 1. Split the reset controls into two groups as per section '17.5.8.1.1 PCIe > > as Root Complex'. > > > > 2. Deassert the 'Pipe, MGMT Sticky, MGMT, Core' resets in groups as per section > > '17.5.8.1.1 PCIe as Root Complex'. This is accomplished using the > > reset_control_bulk APIs. > > > > > - devm_reset_control_bulk_get_exclusive(): Allows the driver to get all > > > resets defined in the DT thereby removing the hardcoded reset names > > > in the driver. > > > - reset_control_bulk_assert(): Allows the driver to assert the resets > > > defined in the driver. > > > - reset_control_bulk_deassert(): Allows the driver to deassert the resets > > > defined in the driver. > > > > > > > No need to list out the APIs. Just add them to the first paragraph itself to > > explain how they are used. > > > > Here is a short version of the commit message. > > Introduce a more robust and efficient method for assert and deassert > the reset controller using the reset_control_bulk*() API. > Simplify reset handling for the core clocks reset unit with the > reset_control_bulk APIs. > > devm_reset_control_bulk_get_exclusive(): Obtain all resets from the > device tree, removing hardcoded names. > reset_control_bulk_assert(): assert the resets defined in the driver. > reset_control_bulk_deassert(): deassert the resets defined in the driver.. > How about, "Currently, the driver acquires and asserts/deasserts the resets individually thereby making the driver complex to read. But this can be simplified by using the reset_control_bulk APIs. Use devm_reset_control_bulk_get_exclusive() API to acquire all the resets and use reset_control_bulk_{assert/deassert}() APIs to assert/deassert them in bulk. Also follow the recommendations provided in 'Rockchip RK3399 TRM v1.3 Part2': ..." - Mani > Following the recommendations in 'Rockchip RK3399 TRM v1.3 Part2': > > 1. Split the reset controls into two groups as per section '17.5.8.1.1 PCIe > as Root Complex'. > > 2. Deassert the 'Pipe, MGMT Sticky, MGMT, Core' resets in groups as per section > '17.5.8.1.1 PCIe as Root Complex'. This is accomplished using the > reset_control_bulk APIs. > > Does this look good to you? Let me know if you need any further adjustments! > > I will fix this for CLK bulk as well. > > > > Signed-off-by: Anand Moon > > > > Some nitpicks below. Rest looks good. > > I will fix these in the next version. > > > - Mani > > > > -- > > மணிவண்ணன் சதாசிவம் > > Thanks > -Anand -- மணிவண்ணன் சதாசிவம்