Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp353857lqh; Tue, 7 May 2024 00:39:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUtVjystrRlt0nyFY3EFkZFQ+rI+wR5tfrntlcPRg6XPP86lQXgsLMxcG1E+Zb5hFqFZpn9+3yaPPi1i5/t1LcYN7x9OZL+7Z4jQuChiw== X-Google-Smtp-Source: AGHT+IEX4LHHYOKN8z8eYWHxhsp5h25iWjNkUw2kSXCkb4qIdDIFeAmMbM/8ZkxhEd7nV66Ba8Ko X-Received: by 2002:a17:906:7f05:b0:a59:cdc9:6fdf with SMTP id d5-20020a1709067f0500b00a59cdc96fdfmr2988984ejr.4.1715067587483; Tue, 07 May 2024 00:39:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715067587; cv=pass; d=google.com; s=arc-20160816; b=vQEqRUeENktljaa+MaBbYKK0pn8mw4PljXaHn+6Mf/pZe30hVHPhb8Hoa5yqm5o2HJ wjG8kbiKnZ1UpeXkrSGLg+Z6EgH1Br2uutJhJtn4Ox5ov84L5XNQEegvCo3dt87qsBhh 2hF4sz0pnFoAkz0TebmMRFAYw/4jFDhPQKPjQZcjDxDugr9IcYZQzkxfWPSARk5zRYe5 BRzMPgpDPBF68xkgaunCghy4Nie2c8fP49NvWmCHFQkBeDpbYlC4eitKUfqZ22a1vpX1 JGOq21nvjTVWlT4MbBd6QRX6IVAmMjYybDxLkNN7eXMmqN3CbHvXqtG9e20Gbx3syCQE yMOA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:organization:from :content-language:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=ZMqnOvqgeVnBmK3VWvV0WgbsGGu0eLNaPS0UsOkPTT4=; fh=LL3XtT8Mgi4IdPLhjUHXDDw4tcovbrsEVWiB8HesPWo=; b=dF0aEon5VDZQVdxqiOZaPgRf6vUE3vYkvHhaetZawrTd/ES3PuA9JpRe6aqc5pyqzd fVO4QpyuzgIR+LAbiN3KVyQ9QxGJZQWnMEko1vfYtx3u1uJ8D2hwtmkIYS3jTzmUGfoh h6wFGsePU1M/4e+cuI22zEKanWYNlFb6PLQaB7ddGa+mHoqNljNN7W/zKYqnPfqTNDBX XKfdTPpb1Jta/RHi2jfR3ZNR6vbLGRtJ4HqTxBqny2TaL1oTRDGNNpyOfPT0WPHAH73t ZnMa79ruL0XEhmH5fCmVeBsJTdsavtna9YQNuOmjcVuQ0ZYN+UZ06zNf+341BeGZkqiS IhVg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=L9gF+7FZ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-170822-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170822-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 hd9-20020a170907968900b00a59cd2c883esi2148850ejc.0.2024.05.07.00.39.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 00:39:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-170822-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=L9gF+7FZ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-170822-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170822-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 37BEF1F238C3 for ; Tue, 7 May 2024 07:39:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7087E13C3E2; Tue, 7 May 2024 07:39:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="L9gF+7FZ" 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 8C4B3A59; Tue, 7 May 2024 07:39:35 +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=1715067575; cv=none; b=b02KVfIbHs80DEWx0iGuZoVFV9LPsvtd3S1soAOaI53e6X7VYYb4Rd8wLVmgKr9J2ozR0dC/i4EbCj4gvXBqRZemjHQpumFpbDk0As8i/VdB9jGn8xHc3QQGpAvbcOW/K6is1wU7l5UdB5Nxz8SQX/Ts/nKa/rP7aNI/y2R8Zns= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715067575; c=relaxed/simple; bh=rJpFn1AO9QkoOchyzDCE9TfU4pQm9RHy9KJ9ICU1PyM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=D1EsRuKe4uhCEikRUaPWhztRojkrB7Z+GmIYLVPy/9hKsbuIgZVWN7EINiKkkjn375uOOklZW6OXiQQU8YKLY3nNGZJM6UtwxOY6cOw4KN6ZHNc1ANqAhcJtjPFACc0SZ5TWPbXofUylUbvxPonjL0grn4BKIC1ZPU19UvJ7HVE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=L9gF+7FZ; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 609DCC2BBFC; Tue, 7 May 2024 07:39:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715067575; bh=rJpFn1AO9QkoOchyzDCE9TfU4pQm9RHy9KJ9ICU1PyM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=L9gF+7FZ6nHYPWp4shMqyCWwss9CfOmgX3yR+TzEemeEu6/MM9FfL5tmUoHUnJxC/ Ee0P8hN8UE31H1Lezd8mAQ/SOUYZfehRwVYz0o9KQthH2+fnknhPPlNdflrL1mruLJ nPQTRja9UDNtTkqRDZH4yhbiJu9444DCGyxQFI/99Cuje6MKfp9Q3+9VuTAn+qIucx 6EPNF8uPXyEHP2vkM6Z6gfq7RcFbeES9fuwpjlpR/zdX0uS0HMV9vmRc0lPYOb63vU P3oyxFFRNCb1sJvxbK/7Q9GJgE/cPxrWjBqzhBL2qSDgfGTUchkmFvdcE/O/uKkJVw 9G9UXN9PNqeLQ== Message-ID: <41e54b6e-7848-415f-b913-d481509d5e8a@kernel.org> Date: Tue, 7 May 2024 16:39:32 +0900 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] PCI: rockchip-ep: Remove wrong mask on subsys_vendor_id To: Rick Wertenbroek , rick.wertenbroek@heig-vd.ch Cc: stable@vger.kernel.org, Shawn Lin , Lorenzo Pieralisi , =?UTF-8?Q?Krzysztof_Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Heiko Stuebner , linux-pci@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20240403144508.489835-1-rick.wertenbroek@gmail.com> Content-Language: en-US From: Damien Le Moal Organization: Western Digital Research In-Reply-To: <20240403144508.489835-1-rick.wertenbroek@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 4/3/24 23:45, Rick Wertenbroek wrote: > Remove wrong mask on subsys_vendor_id. Both the Vendor ID and Subsystem > Vendor ID are u16 variables and are written to a u32 register of the > controller. The Subsystem Vendor ID was always 0 because the u16 value > was masked incorrectly with GENMASK(31,16) resulting in all lower 16 > bits being set to 0 prior to the shift. > > Remove both masks as they are unnecessary and set the register correctly > i.e., the lower 16-bits are the Vendor ID and the upper 16-bits are the > Subsystem Vendor ID. > > This is documented in the RK3399 TRM section 17.6.7.1.17 > > Fixes: cf590b078391 ("PCI: rockchip: Add EP driver for Rockchip PCIe controller") > Signed-off-by: Rick Wertenbroek > Cc: stable@vger.kernel.org Reviewed-by: Damien Le Moal > --- > drivers/pci/controller/pcie-rockchip-ep.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/drivers/pci/controller/pcie-rockchip-ep.c b/drivers/pci/controller/pcie-rockchip-ep.c > index c9046e97a1d2..37d4bcb8bd5b 100644 > --- a/drivers/pci/controller/pcie-rockchip-ep.c > +++ b/drivers/pci/controller/pcie-rockchip-ep.c > @@ -98,10 +98,9 @@ static int rockchip_pcie_ep_write_header(struct pci_epc *epc, u8 fn, u8 vfn, > > /* All functions share the same vendor ID with function 0 */ > if (fn == 0) { > - u32 vid_regs = (hdr->vendorid & GENMASK(15, 0)) | > - (hdr->subsys_vendor_id & GENMASK(31, 16)) << 16; > - > - rockchip_pcie_write(rockchip, vid_regs, > + rockchip_pcie_write(rockchip, > + hdr->vendorid | > + hdr->subsys_vendor_id << 16, > PCIE_CORE_CONFIG_VENDOR); > } > -- Damien Le Moal Western Digital Research