From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (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 E9C802848A7 for ; Thu, 26 Mar 2026 12:56:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774529773; cv=none; b=miNG0w5zhI/V5ExX7J6pM92gPJmXeEm8Sj9A7hD2pYq/y8SBSWi0043PSjdO9QJRqYD6roh6RfbjL5b9XdRqAXu01OeVqSvY8ZBhRubizej0g7uQGMJUjA2gff3ljrLUCCH+AK3K+j3uJ3uu7jJSiNrjXdhdvxjd1fiKFaPHOwg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774529773; c=relaxed/simple; bh=AOyK9K7He9jaWEQcI0TLML2gpG/QGkSkNBxuQXYT1yc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=VBt/tA1PQDZ69fpc7lymuAD5yPlK9THzJidaCXcSkyOyoiEuvKYVG2C9FKxNf4fs4gbv5gjL+rIMtwSOTe5PKz7ncVLza3g2OgUasMdqNg/yYfEwBiTm+q7kKqk/poGsTAoqPRJn6Oj0kkzVjs4WDOjf9x6BZ+beyNGys5bGtos= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=KQhxWVqm; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="KQhxWVqm" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-4852e9ca034so9566805e9.2 for ; Thu, 26 Mar 2026 05:56:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1774529770; x=1775134570; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=v53LCrPXAsR6yI+88VBtN+4JZC9PqA7W1DCpmW7oQMM=; b=KQhxWVqmIDKZj8pG7iMOWyg01iAWIJGnIXDPbSc6mez85fbhulOa2RfJStsIfd6irK +8lwYtZlzdL0gU7qZ53QUXfPbgAFP6dfXE79KezzfGq7S8W6y4ABqoSS0db2Q/J7Cag5 /7F/uWyyp+jVLrNR9msAaMYwgxNEZ9xYFJmIoOQaMocPtLipWpMRvDx+VgGtdN+FGGXM dR69jS4u5fdxISlSdAHLf3V+vym9tyfApJARZSjRSL4aNQfpWV5fBEOzDnEBEMEyvtbA k3XsHx5/TuvBOBiBtgr5SGM87HuoE9dDXfAiHtsduian3PpW6BtuDtQMm3cn9lrqG3AW 4vBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774529770; x=1775134570; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=v53LCrPXAsR6yI+88VBtN+4JZC9PqA7W1DCpmW7oQMM=; b=FXaDlfQwR+2yumeKEcJZtACekTFNy7pdAtTVMd+msJxtBzNrtlLRsK8+j1kzT6YELD 53miFdEZdajMUirf1znbdFPFqCnFtg/HHrKE8enVAifyWrXJFsw1RZ/jRUFTdOBYwT9u iIThzVyFw2uhfKBiRLv9MczxBNIwaDs2H5zg4Bo/kXBsvEhdXXUBm2LEKS4YLeKQKdn/ nS6qP7lFDzzB0QK9Bg4wbzAej1COPPLgSrUu+L+HDVHw3zERE2d2Kl0FPfEMiS1EGXvM hIt+jtXJsYYjrwKZJS8Pfg78pSt/IXD9JsvL70cGJCaOjhfniRvJ8iyn5330rIIzEZ4w HS3Q== X-Forwarded-Encrypted: i=1; AJvYcCUgLgOwddE3w9hYLf04s9CpCaNcnK1LeDRvoyosgXIuO2Jfk7apyyOWBXNq2kD9RTt8EhlIpdXA8yVcUNU=@vger.kernel.org X-Gm-Message-State: AOJu0YwaRWGY432j45Xc5EV4GVrXXb4kRewe2DdrRH4IMAqJXPeoR7S6 Nq189S7zB9hbXTihr6yxb8GNImORVLhURIvl15q1JimlMTN1Hg0CgyzId7BiKlVdu5bXHVHKtbI quA2l X-Gm-Gg: ATEYQzzLBrdu2JMbvz8JD/sYrp2Flh6ooSKGMOjewUqX4cvAlADGS7VvUkUoHEL73K2 XkGH8BNbmGg1PCR8UuztxguoHveVWofEuMBxJqacR2xSfl86oeBImQ7kMNppJsvkaWtfC61suUS eJG35CLcL3piwUI6Fo2RH8v5FPsZYBWss4fCNBQaF/EjVJiLUi2weW86U1ipn9qV4GtZqmR5Aji 7CX+4lGlbnqgjoVHFIn1eZRyngM0kUz6bZVVPKEeZzNjuxtJQLnKfHmd+8gl6asxXCyF3vQfagF R0/z0Rmhg9iNsu/U5xLRVban+ueoZrMWMwL4ltc+i9yyQNVavi6fgBVnrsK9F49p2rlzte1QEm/ hWy7MJRyXGKVvcSEDVtFB6RNhDpiO9yJJ6i19YeGzCGWQq5FG7EfMt3PD04bi+937v2jmPM2oBG Oz5syskeGP8yDaO+dM7TGYThLkkywbJWY= X-Received: by 2002:a05:600c:3490:b0:486:f8e9:add5 with SMTP id 5b1f17b1804b1-48716042c08mr111608235e9.19.1774529770172; Thu, 26 Mar 2026 05:56:10 -0700 (PDT) Received: from [192.168.50.4] ([82.78.167.216]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48722c789ecsm28316645e9.4.2026.03.26.05.56.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 26 Mar 2026 05:56:09 -0700 (PDT) Message-ID: <693acd52-987e-4018-ae02-386dbd430462@tuxon.dev> Date: Thu, 26 Mar 2026 14:56:07 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 5/5] PCI: rzg3s-host: Add support for RZ/V2H(P) SoC To: "Lad, Prabhakar" Cc: Claudiu Beznea , Bjorn Helgaas , Lorenzo Pieralisi , =?UTF-8?Q?Krzysztof_Wilczy=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel , Geert Uytterhoeven , Magnus Damm , Wolfram Sang , John Madieu , linux-pci@vger.kernel.org, linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Biju Das , Fabrizio Castro , Lad Prabhakar References: <20260318124450.163471-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20260318124450.163471-6-prabhakar.mahadev-lad.rj@bp.renesas.com> <605e8d4c-09e7-4d11-acdb-7829a85eacc3@tuxon.dev> Content-Language: en-US From: Claudiu Beznea In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, Prabhakar, On 3/25/26 13:53, Lad, Prabhakar wrote: >> from [1]: >> "For example, if rzg3s_pcie_resets_prepare_and_get() returns -EPROBE_DEFER, >> the static variable is never decremented. On subsequent probe retries, >> the variable will be artificially inflated, eventually causing the bounds >> check to fail and returning a permanent -EINVAL. This would also prevent >> driver unbind and rebind from working correctly." >> > The other alternative would be the below, where we wouldn't need to > use the num-lanes property but would need a comparison with the DT > compatible, Or move rzv2h_num_total_lanes outside of rzv2h_pcie_setup_lanes() and reset it on failure path. > > + for_each_compatible_node(np, NULL, "renesas,r9a09g057-pcie") { If it's possible I would avoid spreading compatibles though the file but instead use driver data where possible. Thank you, Claudiu > + if (of_device_is_available(np)) > + count++; > + } > + if (!count) > + return 0; > + > + /* If both PCIe channels are enabled configure the LINK_MASTER > in x2 lane mode. > + * If only one channel is enabled check the port index and if > port1 is enabled > + * configure the LINK_MASTER in x2 lane mode, otherwise keep > it in x4 lane mode. > + */ > + if (count == RZV2H_MAX_PCIE_PORTS || > + (count == 1 && host->channel == 1)) > + host->link_mode = RZV2H_PCIE_MODE_DUAL_X2; > + else > + host->link_mode = RZV2H_PCIE_MODE_SINGLE_X4;