Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp111752rdd; Mon, 8 Jan 2024 20:37:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IGJH7hMD0Lw2KiK5lp2rEX2hSXNurd+18FY5YQs2fs6ntOdIJutJ10YLGRQ9lq5Ool1UZ7s X-Received: by 2002:a17:902:aa97:b0:1d4:691e:817f with SMTP id d23-20020a170902aa9700b001d4691e817fmr4581163plr.126.1704775076096; Mon, 08 Jan 2024 20:37:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704775076; cv=none; d=google.com; s=arc-20160816; b=XPrq0eKoV5I36MXwAu3zZAs6v6FARVdx+PvYVURjEXCJtK+6szg0Gl77f+ChnfVfvI MU+qSlQUAHqRBtNp3AVCdJuW1mv93NHb2B8ZuDciXSLCc2xRghYzLyVxONSxOPprF3Wc i+dsxr1TZWC14a9XRPPkomk1MevktDlsIDHDQbrgUPUPPg1kInBgpU35UZoKbIfxuczA ByoO9bfEhOpuiv+7b7tDx4nc5941USYGgqu4AkJieG5XMK/tyLpnuXY6yY59SGly13Y7 P5Xec93deWDfKvHK34TDOsg9KLIemlH87hxeRktJTVtzaecEbXhxMTQJrLC7VhoRoBbo 5z4A== ARC-Message-Signature: i=1; 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; bh=CtN3ZmJcpck/YIjWiYKe7RqUHRSvK9EmrpKHkflf+yc=; fh=/RgO0P96TThm97LzQ5IOsWMYo381OYAgMYZzaF3XKQ4=; b=XCWVj/b5R7ezZy1Ip99g8oqKo/pepTICoQNcu51bZG21GZfaZMrxTZ10X5KMQTo2ha i5oOZ8qLKMNXYf+bGzHNPEL+8IVTg/CfUVCIA0Rr6uvKVUU5TXY1lEyKBacpB3qLT3E1 XJu23JLnywLCSXoPwm+4kh0cNhs8naOF3wg8FC/Q2Sg7QWx98dnAylYhszb4ASkB8x/U qE+0hJy9LW5q0+n6tG+AjxXS94b9pkLGBWh123T4cINbwfqZ8c8q0NXUF3pnY1IHFg7a snuG0lGm7tC6f0f4pe0WjMouhVriIYYytEHBFYeS4sAt5A1c4piX6CkKMm3CczPbZ6xs Klww== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-20377-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20377-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linux.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id y2-20020a170902700200b001d0be32b0c2si898878plk.48.2024.01.08.20.37.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 20:37:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-20377-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-20377-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20377-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linux.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 1CD49B2350F for ; Tue, 9 Jan 2024 04:37:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4A9896D6D3; Tue, 9 Jan 2024 04:37:26 +0000 (UTC) Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) (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 8C7626126; Tue, 9 Jan 2024 04:37:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pg1-f178.google.com with SMTP id 41be03b00d2f7-517ab9a4a13so1960521a12.1; Mon, 08 Jan 2024 20:37:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704775044; x=1705379844; 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=CtN3ZmJcpck/YIjWiYKe7RqUHRSvK9EmrpKHkflf+yc=; b=MkyN5/F85gE0KCmuusdVEfSYpsXjxYPtbnfor0+gOQIWJEzrMP2rPjB3d2Z5CIrTLY 1I8fydasRI6F7eqPhtsgV3FgmTtFuWV+y3Ijyjn16Yl3uPxViP08hLc7/+p9YGSSSaDB LuQq8tN57Ei2d0KYsoJGW7/8GI2CqoWTfH5i+xvLPdtG3cCtiIZudXLySClCQR3FNFJR foYhagdIs5Dt9TyprJou7K/v5JY45RkgKIkCQlvMeR5rnb38kEBb5rApDIBvEeJC2Bi4 hivPA0y3b30Qwdd6d2VFx52eqmKzKxmmIVtwWWG+49GrfcRq/qepJy3+O321Hd/XUEIx vppA== X-Gm-Message-State: AOJu0Yyh2iq1wpWS21XE3bAc3QkAqLUiLzFZrdnF4hZAnlzcrghj8TO2 cFCDGlc22MirPNhYm8Lqmi8= X-Received: by 2002:a05:6a20:4298:b0:199:ee99:86fb with SMTP id o24-20020a056a20429800b00199ee9986fbmr571650pzj.44.1704775043784; Mon, 08 Jan 2024 20:37:23 -0800 (PST) Received: from localhost (fpd11144dd.ap.nuro.jp. [209.17.68.221]) by smtp.gmail.com with ESMTPSA id jx7-20020a17090b46c700b0028c05e64f3csm806325pjb.7.2024.01.08.20.37.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 20:37:23 -0800 (PST) Date: Tue, 9 Jan 2024 13:37:21 +0900 From: Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= To: Jianjun Wang Cc: Lorenzo Pieralisi , Rob Herring , Bjorn Helgaas , Matthias Brugger , AngeloGioacchino Del Regno , Ryder Lee , linux-pci@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, jieyy.yang@mediatek.com, chuanjia.liu@mediatek.com, qizhong.cheng@mediatek.com, jian.yang@mediatek.com Subject: Re: [PATCH v2] PCI: mediatek-gen3: Fix translation window Message-ID: <20240109043721.GA3337479@rocinante> References: <20231023081423.18559-1-jianjun.wang@mediatek.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: <20231023081423.18559-1-jianjun.wang@mediatek.com> Hello, > The size of translation table should be a power of 2, using fls() > cannot get the proper value when the size is not a power of 2. For > example, fls(0x3e00000) - 1 = 25, hence the PCIe translation window > size will be set to 0x2000000 instead of the expected size 0x3e00000. > > Fix translation window by splitting the MMIO space to multiple tables if > its size is not a power of 2. Applied to controller/mediatek, thank you! [1/1] PCI: mediatek-gen3: Fix translation window size calculation https://git.kernel.org/pci/pci/c/8b7b89ef507c Krzysztof