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 C3806CD37A9 for ; Tue, 3 Sep 2024 17:28:12 +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-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=PK9LhMqmY8b61UhUQHd15GQzEH3KrI6nivBCkPiL/iI=; b=4H1CZM2aE+qQmFvZZpf0Nx8ced /r2JFfHQd/z28b0r+12KmSEOBNvDsflRUHID45+JOa06RBQmXNjbsgfhV9FStKl+GRUJwy6Q3uAlC Dw4N+z5zO6Ouyy7t1nwScIstG8jd0yFs0/YJtuxeVmWYHiGbcUHMpM9wxwEa/XuGw0Ul6Cq25Qzzb Oc/oO50K2mSF53Y+UattXVRcyN+WEygFh2WHEEpimtUYvuYPfd/fxLTrxrZvDDTnJN8riwKvVERzC s91BDPfq7xxFtpmhDnhPpq7Hn/Q4d3HqHiT8509xar6wCpk8KW10CKOwB553oFkqtGal/OfDuMaDX 1y3j8K2A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1slXJz-00000001I4b-1luF; Tue, 03 Sep 2024 17:28:03 +0000 Received: from mail-pf1-f174.google.com ([209.85.210.174]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1slXJ2-00000001Htq-2fLE; Tue, 03 Sep 2024 17:27:06 +0000 Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-7141285db14so4779187b3a.1; Tue, 03 Sep 2024 10:27:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725384423; x=1725989223; h=in-reply-to: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=PK9LhMqmY8b61UhUQHd15GQzEH3KrI6nivBCkPiL/iI=; b=wH1RV9Iv981/b9mGPZWG+VkFDb+KY349qWKjAwr0xvXbnQgFF+zvOKvrmE2scob1Ta 3JOvAgARGSKd3Kv1T3I6AwMqzqbkke1JF+pW2Oz9qSUh3TwTd2MkaaEjbz6jQUiEgCRR gTOhhvyGDeAcNoTIGmsklUqm0T1VkzDarc0bGZAfJUbdLdIj0K5q+emV4ochK05LqT2w ydw/+UNgnFmqZb5+nkWVEkSYJ8z/PO7rxmzK82+IERj1qbmeJn7h7v8yrdVDZFXz96bM lmU1nz7oK1lXy19i/mtVfFkqRxrZArR3DlgnQXGcqj6pFYUkurg4vWq/CNf9csXs9RHO FcYw== X-Forwarded-Encrypted: i=1; AJvYcCVFvXdDWbKYDAFS9P3bMVpsCET170qKVd5bgdOUkn7gIB5YoPmgeIasGV+fy7xCaLnhHmfc0KqCOYitVGD9ktXypg==@lists.infradead.org, AJvYcCWqoeLi8rDEjTel+S3lKBeBQkMjcZbYf3kvYSGyMiurEWEOJu4Ehrdz5Ngc7Fb+YvKrvW3YvumxuL76HzXo0wfn@lists.infradead.org X-Gm-Message-State: AOJu0Yz74QyZLCy2xHQKi1y/ASZ4Ozt+0l9nav7rGDdnzY85E2du4YEU RfwDyhvbN2aYHq/aFfjtWb03N/XmHMGNwV2brVi8xzpBRqGVxFtz X-Google-Smtp-Source: AGHT+IHVsC39zTt24vONpcuA61t0th3t0mAHpOCLQNJzp3nJKOCh5DdTR0XF+xGGOUw1xxX9Q+j28Q== X-Received: by 2002:a05:6a00:a0d:b0:707:ffa4:de3f with SMTP id d2e1a72fcca58-7173b618a17mr15439542b3a.17.1725384423445; Tue, 03 Sep 2024 10:27:03 -0700 (PDT) Received: from localhost (fpd11144dd.ap.nuro.jp. [209.17.68.221]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-717785b4db7sm114603b3a.207.2024.09.03.10.27.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 10:27:02 -0700 (PDT) Date: Wed, 4 Sep 2024 02:27:01 +0900 From: Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= To: Bjorn Helgaas Cc: Jim Quinlan , linux-pci@vger.kernel.org, Nicolas Saenz Julienne , Bjorn Helgaas , Lorenzo Pieralisi , Cyril Brulebois , Stanimir Varbanov , Manivannan Sadhasivam , Krzysztof Kozlowski , bcm-kernel-feedback-list@broadcom.com, jim2101024@gmail.com, Florian Fainelli , Lorenzo Pieralisi , Rob Herring , Philipp Zabel , "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" , "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" , open list Subject: Re: [PATCH v6 05/13] PCI: brcmstb: Use bridge reset if available Message-ID: <20240903172701.GA2873479@rocinante> References: <20240903144613.GC1403301@rocinante> <20240903171743.GA255170@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240903171743.GA255170@bhelgaas> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240903_102704_697194_CD7C7616 X-CRM114-Status: GOOD ( 18.16 ) 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 Hello, [...] > > > > > static void brcm_pcie_bridge_sw_init_set_generic(struct brcm_pcie *pcie, u32 val) > > > > > { > > > > > - u32 tmp, mask = RGR1_SW_INIT_1_INIT_GENERIC_MASK; > > > > > - u32 shift = RGR1_SW_INIT_1_INIT_GENERIC_SHIFT; > > > > > + if (val) > > > > > + reset_control_assert(pcie->bridge_reset); > > > > > + else > > > > > + reset_control_deassert(pcie->bridge_reset); > > > > > > > > > > - tmp = readl(pcie->base + PCIE_RGR1_SW_INIT_1(pcie)); > > > > > - tmp = (tmp & ~mask) | ((val << shift) & mask); > > > > > - writel(tmp, pcie->base + PCIE_RGR1_SW_INIT_1(pcie)); > > > > > + if (!pcie->bridge_reset) { > > > > > + u32 tmp, mask = RGR1_SW_INIT_1_INIT_GENERIC_MASK; > > > > > + u32 shift = RGR1_SW_INIT_1_INIT_GENERIC_SHIFT; > > > > > + > > > > > + tmp = readl(pcie->base + PCIE_RGR1_SW_INIT_1(pcie)); > > > > > + tmp = (tmp & ~mask) | ((val << shift) & mask); > > > > > + writel(tmp, pcie->base + PCIE_RGR1_SW_INIT_1(pcie)); > > > > > + } > > > > > > > > This pattern looks goofy: > > > > > > > > reset_control_assert(pcie->bridge_reset); > > > > if (!pcie->bridge_reset) { > > > > ... > > > > > > > > If we're going to test pcie->bridge_reset at all, it should be first > > > > so it's obvious what's going on and the reader doesn't have to go > > > > verify that reset_control_assert() ignores and returns success for a > > > > NULL pointer: > > > > > > > > if (pcie->bridge_reset) { > > > > if (val) > > > > reset_control_assert(pcie->bridge_reset); > > > > else > > > > reset_control_deassert(pcie->bridge_reset); > > > > > > > > return; > > > > } > > > > > > > > u32 tmp, mask = RGR1_SW_INIT_1_INIT_GENERIC_MASK; > > > > ... > > > > > > > Will do. > > [...] > > > > You will do what? If you don't mind me asking. > > Can you just do the rework on the branch, Krzysztof? I think that > will be easier/quicker than having Jim repost the entire series. Will do. That was the idea, I believe. Krzysztof