Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp1376875lqt; Wed, 20 Mar 2024 01:54:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXH2YIf8hk8eHz6BfYpc9dc1lnTUw4xIeZu7kD7UDscjblt1fHAtqFwMkDKXb36gLgxd5Ru2ygLKqUI7Gh+tQDEH0DUjUX92SMIJPVMxQ== X-Google-Smtp-Source: AGHT+IFTz6/GrulPDOVs8tvqEmZoZU4bImQ3sOV1tNJ1a9SZesdJ3qAlTB/x+A+GyyYn3aPheNsU X-Received: by 2002:a05:620a:22a6:b0:788:6218:a737 with SMTP id p6-20020a05620a22a600b007886218a737mr1038891qkh.3.1710924868329; Wed, 20 Mar 2024 01:54:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710924868; cv=pass; d=google.com; s=arc-20160816; b=Cw1OjSsCyREJDJzffHxvf67pfyAiNOEJAUaqW+asHRFV6dDBC6hRIjvI+E1UMcxXyl 8pZylMc7Z8sI6FCbLaIimPEWbmDTKlAn81QpvRGFmqO1xadKr1lYiyvyT10N2TmBW3f9 YfcY7+iQH57r5yZVHCPDhTUXp/cOJKCzj+n8A9STN0S0fVUjypeCx2orRZ8QCb+7ynjW FQjPWPDb37NPJJtuQJV6938u2b6KsIgU8a7bBXozW5l2EErrQyaMut/xshsLcMlLKxjL 4jOjRkpJXpsfBArkZgK5Pmt8faqnpwm5PkPFtHJEECCtd4kJ0RZSnnRUdQ4gRNvua/MW GclQ== 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=/yZvWpY7V/rB8sTUkhqpbq+gEwCmrw8rb+YsJUnif9A=; fh=djbmGzfhOIBiEuIjiKixjllJVwXQyvxW0/7rVR/Ty4o=; b=NRZv2hQjcoymirD9WPQNpASQ8A9Ura/QourI9dDRtSfHRNxvALgtB+AsDGiurJlf5q ZTww8t58OoW6PFd+V0cvn6k0GRUKUhGZOdFI8sHBIUkC6J/LGn0eFgQw0UkIBTb+knDY RwGrecnS5Ma6wIthWSEmfimdNxOP9mtzxtXYtkojjknwJvi65hrdXGBjqwkRoLoPGYdi ViG/jc3caQlc3bbc5bQk1aFSH/4rrz6o8I2CPWNkklClkNMCYc5fWibD20GVJ4Lgxtsp QWZ2y09qSNKixWJPfKDO4h9zzsP9bpEBNGb31Q3iYEqfJLcy3k6zJ7tVy+Lc3RE5ovtW 1pow==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=svykZRpU; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-108650-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-108650-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id az17-20020a05620a171100b0078832072b55si15044344qkb.261.2024.03.20.01.54.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Mar 2024 01:54:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-108650-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=svykZRpU; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-108650-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-108650-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id C66411C21F6E for ; Wed, 20 Mar 2024 08:54:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8866B38DF1; Wed, 20 Mar 2024 08:53:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="svykZRpU" 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 A1A0D38F87; Wed, 20 Mar 2024 08:53:20 +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=1710924800; cv=none; b=XORFvZ5W4slC1/rsu3cCr1U20PsZ1loYLuH6JeRUgWfBFX9frucv39NftOgmbtUMJ9NgERL/HPAos2UL9NfkQLK4a6G/8gsjY75l4J/zIxxwT/B4H8ckF0LCbDpt5Mg/zd92AVuQN9bkQeNOiNtlUJXx8m1K2ltwYN14De7fBXk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710924800; c=relaxed/simple; bh=Hm2riJtd650UaySoI5zk2/Fz4N5cO62JP24YUJdeUFo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ov1M2vhL6dzLThrz7HI/iLzzqqUgtzC+qWLjPHZDncVUfxtkT5uMHi2MKrqpLyny1Ei4jGsXXEIM96wL9nAh3gxEgG0+r9vSO2HZQ6ib74GTW82g7sifukGZLB+Tw8DYZRsl3otoqUMm3/nn1yhRuosUmXag/u6odpG0wwy3BG4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=svykZRpU; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 61CE8C433C7; Wed, 20 Mar 2024 08:53:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710924800; bh=Hm2riJtd650UaySoI5zk2/Fz4N5cO62JP24YUJdeUFo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=svykZRpU4KKqc2BI9hhjROoJQvQX+adJEzBEJQogM9CzMFfwi51Lb3qN7cM+l0Yq9 uO8W+G8fURfyMf0bqCQ9jtdwcVTCuaRiEgWb+LMb507VXhi9si6HPAuENby7dNd7Nn E6ruFi0wK0ahIxkVK+fbLrm8k0/47aMz4/KKlypzdGGUhapz6CbaBGAvQckzVjwZdo lKW7RoTePwUyUTYl8qoxdMvV/Z5B+ffK+dHR7tnswe3/5svHtaDOH9+QIUmzhPblgf LbfDovXAU15Vp5yr/tqWsqjFAhkf/3tx+2HF5EN5DXuaUpMx37z7XFYfxICRbl60aq bonsoz3/1HMqg== Date: Wed, 20 Mar 2024 09:53:14 +0100 From: Niklas Cassel To: mani@kernel.org, kw@linux.com Cc: 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, Frank Li 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 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. Kind regards, Niklas