From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 82B073D0938 for ; Mon, 29 Jun 2026 07:27:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782718072; cv=none; b=M/t+QvBjkP0jfziUmJtyvvT3NJdKJfpcEmKCYsv8jm1oWaEsSh/5De/s6GZgWWkSvG2dm60Cle0mB8E9yAl3AliIKEZllBsr6vqJZctpYKLiHEaHLBk38KUhBrMw1V5S5Xph2OM4laH/rXDl2W6QjGCmUvouryFwt5zMa0/5yg4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782718072; c=relaxed/simple; bh=Y/HfCNCRUg9RLoYb4CuHK8wg90NBmdpKZjXTXnDvd+Y=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=AjWLeoZn/bTDF/DewfmgnbSxLmyRZYrU4ybUniupoBM9fpRQwPBGjAkb3JxT2ffAF/n1YaLVoM7nEGnamUEnYVmVkNsd6I2YZNl6C55PX1uoO18USBFtSACQN6Wj1fT4LIxvIS0v/D4FdBxtcFJ+WGg7NSrgUISXB8fMD0JGFjE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=E7+xRpGt; arc=none smtp.client-ip=209.85.221.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="E7+xRpGt" Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-47122683cf3so601695f8f.0 for ; Mon, 29 Jun 2026 00:27:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1782718067; x=1783322867; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:subject:cc :to:from:date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=eBV8+Lqv6LzBCkekw0TZncRmTA/42jKif/q/Zf74Sfc=; b=E7+xRpGtRu7dSjhFPn9FyBhPLhGCoJhqvwq0JPQ05G7Y1BTzKZYoGetL3Y+2Lq+DGT iOz3BojVYQ3IUij9omW9xmvfF7pP3V/P9/BsOArE6Sdy0jk4/mxkUK/FI4qUeyZE585v rXhCoTAtbAMeF0GVKKW2wW2BpoIkV7ZF4xIuFwpa2aaLPhsQpoMQXnLv3/2uRY4SI3gv mMPVdBiDKl6ca3yOmhzHq2KCXT8bcewyuDRqYPBMS2qYruNFjQYLlSysoQBHMm1HiX4D m1jVg6EIyUsNv16dKareDhkvjxgCImTqsJgHukAM6hlX9YJe5XIF4gEn05qzainzNoQT rqgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782718067; x=1783322867; h=in-reply-to:content-disposition:mime-version:references:subject:cc :to:from:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eBV8+Lqv6LzBCkekw0TZncRmTA/42jKif/q/Zf74Sfc=; b=Z/4VGgNAxFCOdQX9RYePerQVhYB2pxRDeLSYZtVOh20i8dnPm3/lYgtQNhACTLc10y /472INFMs8krutFqzOKtQ3uZmHeMv+t4TjLZUEIv7GPpDet4k11UHZcTM6kUKEU89qUe fhZKLwe1PNCFnRQJjJKlmbeZpxhfxytZ46KbUK9AD/8vQLyKn5zalHlmROXFPKKhuX3L 8Kd+7/ipjZcZfwPubQTMZVDf4UIOQQay/hGsUJzfhK4zkVI+k9ZNXP3l1+z7uRBNim8F B68AN/E9AORGTAf7KFIqWp2T2R5bh+nXWXNmWAspAgSgxuCiIOcHnoYysWS6q6fF3uRA hkVw== X-Forwarded-Encrypted: i=1; AFNElJ+s8CXvxz8ONWWCY1wMLZ89rlHVZgsXtYya982jhkbUNUmKizXw3PhBB7JazjyWrzp/HLkMFRVe/9Bpf5k=@vger.kernel.org X-Gm-Message-State: AOJu0YxyTyaePtEdMMYepfsZYFwkQcrGyr1xNmgsUQYmx/Ym9eeQeJIG keHMCDM5mYr3+5aVt45oovQc3jfB3ZJ4GtdYXp5cBnaa4kjHXpLfj4M6 X-Gm-Gg: AfdE7cldG1VUP/EcCC2uYD33UjlJPWBdIbRNOqjPlL4RxZ3gDx5HJZ8o3107+gByt4Z /Ipx+d4jo+SH8D/Owm/OPbpSV1MszoJKhc0rocnp4aIFD2hA0Jn16fzrFN2oy5vGwEon01biuDe a0yjA12ScYgn/mGF9wXxGEJ4GL/4n4vnc9YaXlPcrEc2bzXhP24PyGMaB+hjmBzwqyASJAN40kt X25yKC8ZnRPO4qBL03pV+ykaEZrQJ3Z+4ILMKhHcKp7V8hJUwyBq+JMpBJ9BaHIs6vo65qxdX6r 7ClyNYeewvAh/9UwJWIx6xQE6dNnYZ5rxaE26WY4iUKWLUg7n6UJismGRC/ILJm0zfneQoENBoH KDej11JRhNyoHhRwLY9qO+w7QXTydxydiunBNl5pDPe3CeFEubJbayU40xap70XN+2otughI8OB AF5bb3xmBP9LETWXh+PoXRTndlgDFKditqthxKAMlFeYJ65j+h76ykcUdfs1jviAze9tc= X-Received: by 2002:a05:600c:8b14:b0:493:b2e8:637c with SMTP id 5b1f17b1804b1-493b2e86404mr14198305e9.1.1782718066323; Mon, 29 Jun 2026 00:27:46 -0700 (PDT) Received: from Ansuel-XPS. (host-80-183-219-152.pool80183.interbusiness.it. [80.183.219.152]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-472c7bec9c2sm12681213f8f.12.2026.06.29.00.27.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jun 2026 00:27:45 -0700 (PDT) Message-ID: <6a421e71.39c9bec7.1462ca.d6ce@mx.google.com> X-Google-Original-Message-ID: Date: Mon, 29 Jun 2026 09:27:42 +0200 From: Christian Marangi To: Philipp Zabel Cc: Bjorn Helgaas , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Ryder Lee , Michael Turquette , Stephen Boyd , Brian Masney , Matthias Brugger , AngeloGioacchino Del Regno , Jianjun Wang , linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v3 2/4] clk: en7523: add support for dedicated PCIe PERSTOUT reset References: <20260627121450.3529133-1-ansuelsmth@gmail.com> <20260627121450.3529133-3-ansuelsmth@gmail.com> <68b43224e0a124c055fc228b3a254fc7908dbcdd.camel@pengutronix.de> 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: <68b43224e0a124c055fc228b3a254fc7908dbcdd.camel@pengutronix.de> On Mon, Jun 29, 2026 at 09:07:22AM +0200, Philipp Zabel wrote: > On Sa, 2026-06-27 at 14:14 +0200, Christian Marangi wrote: > > Add support for resetting the PCIe lines with the PERSTOUT reset. These > > special reset are controlled by the PCIC register and are specific to each > > of the 3 PCIe lines. > > > > Notice that reset logic is inverted for these bit where 0 is assert and 1 > > deassert. This is intenrally handled in the reset function. > ^^ > typo: internally > Thanks! > > PCI enable/disable are updated to drop PERSTOUT bits in favor dedicated > > reset handling. > > > > Signed-off-by: Christian Marangi > > --- > > drivers/clk/clk-en7523.c | 39 ++++++++++++++++++++++++++++----------- > > 1 file changed, 28 insertions(+), 11 deletions(-) > > > > diff --git a/drivers/clk/clk-en7523.c b/drivers/clk/clk-en7523.c > > index 1ab0e2eca5d3..c9b21d9bf2f3 100644 > > --- a/drivers/clk/clk-en7523.c > > +++ b/drivers/clk/clk-en7523.c > [...] > > @@ -754,14 +756,21 @@ static int en7523_reset_update(struct reset_controller_dev *rcdev, > > unsigned long id, bool assert) > > { > > struct en_rst_data *rst_data = container_of(rcdev, struct en_rst_data, rcdev); > > - void __iomem *addr = rst_data->base + rst_data->bank_ofs[id / RST_NR_PER_BANK]; > > + u32 offset = rst_data->bank_ofs[id / RST_NR_PER_BANK]; > > + void __iomem *addr = rst_data->base + offset; > > + bool inverted = false; > > u32 val; > > > > + /* For PCIC reset logic is inverted, 0:assert 1:deassert*/ > > + if (offset == REG_NP_SCU_PCIC) > > + inverted = true; > > + > > val = readl(addr); > > + val &= ~BIT(id % RST_NR_PER_BANK); > > if (assert) > > - val |= BIT(id % RST_NR_PER_BANK); > > + val |= inverted ? 0 : BIT(id % RST_NR_PER_BANK); > > else > > - val &= ~BIT(id % RST_NR_PER_BANK); > > + val |= inverted ? BIT(id % RST_NR_PER_BANK) : 0; > > You can simplify this into a single (assert ^ inverted) condition. > Yep I know but I feel this would decrease readability of the logic. Do you think it's worth it? > regards > Philipp -- Ansuel