Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp301991lqp; Thu, 21 Mar 2024 01:18:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUX+zWQMoWXJVw/iF6SxOZvFSX+s4z2Wjf7Qz0WRE3Ca8VSHg0KyY1GcpuvtSTC6ci6wSuxqgU9/lCmNeSbmF9+B71A45T1N7jHd0bSAA== X-Google-Smtp-Source: AGHT+IFcNTGVaXhOmFSQuLwGMw6pZwXTBlf0PM++CceB0PcWOTEWgnYAhPYm+mH+GUp1whEdSmrT X-Received: by 2002:a17:906:fd89:b0:a46:e377:1468 with SMTP id xa9-20020a170906fd8900b00a46e3771468mr6533591ejb.31.1711009126737; Thu, 21 Mar 2024 01:18:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711009126; cv=pass; d=google.com; s=arc-20160816; b=Kh1GgNnu0z861TmKCpKCP0eSdv8rcSUoB8gmAEYv5fLS5fR3gknONKBqA3QNi/3c0o BrTujaC+tTKkrJxyUvwKrBl0UuRVWsFTgKWUT0mf725QeMZAXZf3zzqBB6EHvdhGGDZ5 3kKWQevL7xju3GjyIg1+1yMbD9EvlXGCiehue7ti+OMPhOZL9VzQA4rjs1M0JCgXBXgF 3uu8Ml8863X/fpkl5TqJfAs3wOnFvPBkU4yybaDUjDmlp/qIijpsCW71G1VMA1QkKKfw 6BfK3K42XVj9lBPZXzqug298GMGRpTUbXrqfgLO+0Oysnpa0LoSMpsuSsgq2/SVvj2m3 6Z+Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=lAe0XIKZxd4FwnCeogeMRvk206rSqGgiTTAQX/AtoMc=; fh=hrAcowkSDjqEaYHyzk6z/J4IGFoM/P2L0gzhhuP02mE=; b=fVlDXlpt7hD9MraAL8QUqWARUfLjKevn+bTk9b0XhlmGo0hncQMlgZ4ZATNKBvmQGk 2C3KK3HWrQZE6a644KuK1S1bgUs3ViRKF8Q5JMm0kE2rnPiVzfos1ZwuBgh0hUCSIjIw Db/j+7HER3sU4e9jVIbE3umBPOCXtWkf2ufqpjcMSNFg9e3Qj9WRtx3OAknk44qT1p6c huOd5cj+BmRFmTvkQsg/dyae3X1PhQ4mdQE/VQcWIzA3En3qB4lU4dJhoRzAdhvIG+eA DI3gz23XzSskH8YHCqFbxjS7pogJR8IukgtF0jdpPsTabRRJ0rUVEeUCGSR9iwMMJe+B mqlg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=A5fMpg58; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-109777-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-109777-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id n21-20020a170906379500b00a46bb7376d9si4099533ejc.1011.2024.03.21.01.18.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 01:18:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-109777-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=A5fMpg58; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-109777-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-109777-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 597381F21A13 for ; Thu, 21 Mar 2024 08:18:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9671D78663; Thu, 21 Mar 2024 08:17:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="A5fMpg58" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9A4167828E; Thu, 21 Mar 2024 08:17:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711009022; cv=none; b=sZELHzswReUNPPZkVJVMDMqNSjTPV00uxVDUGPYQWniUWgfdBz2fSO6/vgDXF9KI+Gbt4ubFPptl1WJhab4W4Niq0Ff0SH0bbpgyqC+aOB+E9IX3yfcXOkrkXpy0GueucOYKP4ywzZz42jPEyiBXQ3oBQGL0GOdveEljeC3Fh2U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711009022; c=relaxed/simple; bh=r2RHfmTbLsPpzlNVzT0ZkM0H54j0pEjMtGKDo+gCUyI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=OELpbBDB515AYPD2nJP1C/+RFAvPyrjVo+8RrWCaDvX1lr9D/QdHVsJze/TNoFlynRdTTd8IoidHhUbnAbmbCIXAMQbe8IIlaUWnSJppXrFUGt4ZyUO5lEAWNHDoTiBYGV4ZQ3YQaVxVxJhvFgO8w26xouBiXWSafcDS495z0EY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=A5fMpg58; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 45234C43390; Thu, 21 Mar 2024 08:16:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711009022; bh=r2RHfmTbLsPpzlNVzT0ZkM0H54j0pEjMtGKDo+gCUyI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=A5fMpg5882WSDUeIpySO5LC8lfYNHNnZLE4DR81NT70whYVhEuoys1M9w5F/nhX/w 7d7m2Wwgk2BXTqoyHD2ljzoVQj939S53AwdhhKsEy7u9xmn6T3XtQtK6SZVyWL2CDU uwqj3BPnTXgIsSDyYVPrNlZ7KD+3VWHuvL7brc6BKQEPUzSBZBnpsoqqDdFkHhzjtX avhkE5lU/D88T6PsdKvfAjka+SCs+ghEJs5DAUv7+BuDIds76Go5GcDtZVGPpDy9n0 XOyLtCmBFrAVsvxYpF6gVnU3RAr8CGZJJi62X/osuhgfg7dlU99kxAse2LFOORBgk4 bkwGIma+N+KgQ== Date: Thu, 21 Mar 2024 09:16:56 +0100 From: Niklas Cassel To: Frank Li Cc: mani@kernel.org, kw@linux.com, niklas.cassel@wdc.com, bhelgaas@google.com, gustavo.pimentel@synopsys.com, imx@lists.linux.dev, jdmason@kudzu.us, jingoohan1@gmail.com, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, lpieralisi@kernel.org, robh@kernel.org Subject: Re: [PATCH v2 1/1] PCI: dwc: Fix index 0 incorrectly being interpreted as a free ATU slot Message-ID: References: <20240304224616.1238966-1-Frank.Li@nxp.com> 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: On Wed, Mar 20, 2024 at 10:29:42AM -0400, Frank Li wrote: > On Wed, Mar 20, 2024 at 09:53:14AM +0100, Niklas Cassel wrote: > > On Wed, Mar 13, 2024 at 12:09:04PM +0100, Niklas Cassel wrote: > > > On Mon, Mar 04, 2024 at 05:46:16PM -0500, Frank Li wrote: > > > > dw_pcie_ep_inbound_atu() > > > > { > > > > ... > > > > if (!ep->bar_to_atu[bar]) > > > > free_win = find_first_zero_bit(ep->ib_window_map, pci->num_ib_windows); > > > > else > > > > free_win = ep->bar_to_atu[bar]; > > > > ... > > > > } > > > > > > > > The atu index 0 is valid case for atu number. The find_first_zero_bit() > > > > will return 6 when second time call into this function if atu is 0. Suppose > > > > it should use branch 'free_win = ep->bar_to_atu[bar]'. > > > > > > > > Change 'bar_to_atu' to free_win + 1. Initialize bar_to_atu as 0 to indicate > > > > it have not allocate atu to the bar. > > > > > > > > Reported-by: Niklas Cassel > > > > Closes: https://lore.kernel.org/linux-pci/ZXt2A+Fusfz3luQV@x1-carbon/T/#u > > > > Fixes: 4284c88fff0e ("PCI: designware-ep: Allow pci_epc_set_bar() update inbound map address") > > > > Reviewed-by: Niklas Cassel > > > > Signed-off-by: Frank Li > > > > --- > > > > > > Any chance of this fix being picked up? > > > > Gentle ping. > > Now it is v6.9 merge windows. You'd better ping two weeks after linus > create v6.9-rc1 tag. I don't follow this logic. Two weeks after v6.9-rc1 is v6.9-rc3. Why wait that long to merge a fix? The PCI pull request for v6.9-rc1 has already been merged. Merging new features (to a submaintainer tree) might temporarily be put on hold in relation to the merge window, but for fixes, it is quite possible to both queue things (in a submaintainer tree), and to send accumulated fixes to Linus during the merge window. I did it myself just a few days ago, and Linus pulled it already: https://lore.kernel.org/linux-ide/171087658094.21820.15365015832308818327.pr-tracker-bot@kernel.org/T/#t Kind regards, Niklas