From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) (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 A8E85433A8; Wed, 3 Apr 2024 14:45:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712155534; cv=none; b=B6AQ/6EpmNIoDyyIw0z0c3EkLUxaCM8eqnflcuR1d7hIQ4c1yaJaTfB5w1Yl4BTWTZrrxSXjULHDCe7n1x6ZgAQIlV1idVnAP5uztfBFVhOAt8+YH11U4b8Gxjv2EESpYxetxioje2G4JMhTuW+t5Zz6LZF2KyXVcyNG20dyb2Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712155534; c=relaxed/simple; bh=j4lapdM/IHpzoQhUS5ceN/z7x1vBh5mHgZ9hkb7uiJo=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=Hg2Oe8yPZElRz1MNU1q+y5jVaRoiLeA4beW1s8q1Q0aopPZQoaUSWBa8NA6Ov3/cGWerwjwX0xWdFCeZO9+vRktqCJaaOq9BGOQzOhGCWN3fQ2cx3Oq78WVa2ASez4MCZHpBWE1sYSvDBNftvDjXk6PEeii168YrIu53X9g1nK8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Dggfug2I; arc=none smtp.client-ip=209.85.208.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Dggfug2I" Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-56e0acaf69aso917951a12.1; Wed, 03 Apr 2024 07:45:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712155531; x=1712760331; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=s3Pkic51g7rrTopzQNi+VbYIAqH2ghyU0XlcWsnfQ8s=; b=Dggfug2IF4SKtplkij0+WztWAyBnqf1OR+GNYx2KhpFA6IQZlJw9X+g6tD9lcj47N1 jkmQ1jV2hruRU1WGhk1zJGjRs4wCmPaQf4ISreloxaaoJ4FabdBYUxlO/hliaIzLidNN NVhYDw/93vPIDjrgWTseuCdh0H7Zgg0so/yY5PixbhQoS39QD36nGVGgKudDWpOk6I2Y pqzL6P4cRZFbgPi4+KpomMGz3OHr7EMOXtuctmXywLV18//ncvMvUHw1xsGxgZugd5Gy /iUi1OEEvnjFKrZGC5/bj4hItJEX75otOJIBm7xorAd3GvHOpLo1M1X7yA73Dq8EHfdg bn8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712155531; x=1712760331; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=s3Pkic51g7rrTopzQNi+VbYIAqH2ghyU0XlcWsnfQ8s=; b=QZMkY3IMUCZb5T90rcSmz/PeyCNNxyp85jcpkFnt7fUu7RL+xkZH5jeDUHE7IYUa8n Z8IcgDKUz1OCtXjrjDUXCWH07woTL0rIrlgu25QTR8U0XXrG1v3bF0b3lfngNRiFjFCh sXQDUF36xatN1P70fNh1IzLIMRYXWMqcYb0++Y8EpZOfmTMK9wUUgVHeluQzIqKT8j/Y u0F5UR5aJVknbEziX18M+ufQXa+nxBohDMwrq/USBqWpBanh2Zjzn0FsxSZzXgKreqQw bOoDAnhCEq0t3lErR6cbIxsp3MjPOOGrsJHWYlpR0zsE5Hn6+Kl7txHC00iN7S0vmRWD SrSA== X-Forwarded-Encrypted: i=1; AJvYcCXKGsG9iiRQpGWlXVXYA+33Xr9MdvLlPkFLDfrWgyx/TZVwm6MReYsdaSU3m0koYr5ewFf9AzFlLn1u4Yva3EULp4jusjgymR1fjO186EQ1JgzOHci+CpRvoDCq95LcObIHTclNEZsQIHeGY8JkA5LBcvqu1VN39C5MiOy8Jx7I X-Gm-Message-State: AOJu0Yyp9WUCGNHPNgdVhv0AGYs/d+hpEKvOGOP2lKHerP/+ckkVylLX lb/8mNdjE4oOG6SIoPqPerqrxE4xXLL2sQbbbh2rDotS4mKX/Ro9 X-Google-Smtp-Source: AGHT+IGUKnmalWHmdHqzQg31S41xmoGwv8cZpjceJSBvGia7muB7V+oQVkfF70cW8QCJGV1MPIMf1A== X-Received: by 2002:a17:906:da8e:b0:a4e:379b:753f with SMTP id xh14-20020a170906da8e00b00a4e379b753fmr11844116ejb.23.1712155530775; Wed, 03 Apr 2024 07:45:30 -0700 (PDT) Received: from A13PC04R.einet.ad.eivd.ch ([193.134.219.72]) by smtp.googlemail.com with ESMTPSA id s26-20020a1709066c9a00b00a46e92e583bsm7921536ejr.149.2024.04.03.07.45.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 07:45:30 -0700 (PDT) From: Rick Wertenbroek To: rick.wertenbroek@heig-vd.ch Cc: dlemoal@kernel.org, Rick Wertenbroek , stable@vger.kernel.org, Shawn Lin , Lorenzo Pieralisi , =?UTF-8?q?Krzysztof=20Wilczy=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 Subject: [PATCH] PCI: rockchip-ep: Remove wrong mask on subsys_vendor_id Date: Wed, 3 Apr 2024 16:45:08 +0200 Message-Id: <20240403144508.489835-1-rick.wertenbroek@gmail.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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); } -- 2.25.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4CE08CD128A for ; Wed, 3 Apr 2024 14:45:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=KS92/ofUv0kIkG14vaoGNeTO9+hg7R0rFmv7fxkrYng=; b=SUEo30hDqmjQ5a 4jypGRF6LInfHEKtgITVtzxkkFQrI0TW8ygbDO47KLy84eUMhWCYppFSHxTF8pvwNbovB3A+/JCOI 2IvkiBsFKy+F6L20NTopMOmDLb17hMpJalwrII41kDtnMWnE2uU1DpevbW/EePypeHGzkAn4z2Vay F8zhPjWdjp2AfluNxpWBq3UkDr/XSElXGBHuelLEGIdif1awkipWxOx34JfjLO9QjV4B90TgvifUc NUDbPJ4uzMJLTXVXVpg3A+rM/VeYchIRWWebl3owK+jNeAdg0EKY33BD92pX6pfn8498xeHAAo+ER FSdwehPQY7BpwhiS3SjA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rs1rw-0000000GXfc-3GuJ; Wed, 03 Apr 2024 14:45:40 +0000 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rs1rs-0000000GXdb-2vNI; Wed, 03 Apr 2024 14:45:38 +0000 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a44665605f3so741529466b.2; Wed, 03 Apr 2024 07:45:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712155531; x=1712760331; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=s3Pkic51g7rrTopzQNi+VbYIAqH2ghyU0XlcWsnfQ8s=; b=heGmzgOWIWSYObsRLS8htv9ep4urZ87zI9dfzwsQ99vbwASefsELIxc5dUDPY1VB2Z ReCl9olqdOk1jAAFHCoKM7bkqSQu5FJDDbfRGocs1scbOlciVZpWo+Do+PZAXl4I5EPD 9AUqs+CJEv5rcB2SgrYl6cQ0e7OR6Hbko4P4i2vof3zB+cH6xWoL0tvjVR6A3ljqFmjD xKtqjfXKPg9uF5z2nQZEwPkJo1vpZRl8FPELYpmlPCwBm3OiM48t5stKoDaK0bIRFiek k+NRxW6UUzYOqbKWPnxD06fBTBS/MQC+oV/mHLfDxTwxQTlO46Y8e3PpTdA4iGF5WLEW 8MSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712155531; x=1712760331; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=s3Pkic51g7rrTopzQNi+VbYIAqH2ghyU0XlcWsnfQ8s=; b=UE733/Z/LgbmsahTInDY01Dbb+FDjSir05yosg5gEDdnecpde2IUWqkE4zzW0bJrIJ Hz0sgVSc7lC3hAU05vL1Qwr64Yq+IwMIiZN3MvqDefPh5BfRswzY14yZwDNBbh9TG476 Jo1Jzg6P9yW8F8xpQk17RiDUKWZ2fZzv8OUjmHo1O8Prsm/seJm4KFfJhL51uy2a83tg 6Zr0F4U7Pk7dMTzAsPPMHjSRIzYFYqpqNwfVguTH7O/W5KuIXd45+PzZbScTwAJ4prw2 BBdy93GVsg4Gw3pzfsTi24SrVYs0sdGSjrP4MVzh1KrjEdPYpmNAyrfuC1R1jJfG/s5c FwHA== X-Forwarded-Encrypted: i=1; AJvYcCUvZP/pxrl2wgR4xozrH+wTEhypokAe5jt0mlBa4Ki5HzFEgyFEBOo/uVf4BbBUxI9oC/CroU2g1G+F4/OsrHOzZ4mm+QeJ6J8wof7tit+1g4TggDKqhzd6V+YrVib+19+G1hpoq9DHMy0aOBAourk1E6GLIn7Yz8g= X-Gm-Message-State: AOJu0Yz96yic5AH2D2ajk3Jt/vLPV6xkixKXimp1x7JCbov82/fyUTq2 R01tRUFAh6N0zIpZCc9X7Fd++0YZkGVIvrR5vPrMp3Uh/gCm2wWo X-Google-Smtp-Source: AGHT+IGUKnmalWHmdHqzQg31S41xmoGwv8cZpjceJSBvGia7muB7V+oQVkfF70cW8QCJGV1MPIMf1A== X-Received: by 2002:a17:906:da8e:b0:a4e:379b:753f with SMTP id xh14-20020a170906da8e00b00a4e379b753fmr11844116ejb.23.1712155530775; Wed, 03 Apr 2024 07:45:30 -0700 (PDT) Received: from A13PC04R.einet.ad.eivd.ch ([193.134.219.72]) by smtp.googlemail.com with ESMTPSA id s26-20020a1709066c9a00b00a46e92e583bsm7921536ejr.149.2024.04.03.07.45.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 07:45:30 -0700 (PDT) From: Rick Wertenbroek To: rick.wertenbroek@heig-vd.ch Cc: dlemoal@kernel.org, Rick Wertenbroek , stable@vger.kernel.org, Shawn Lin , Lorenzo Pieralisi , =?UTF-8?q?Krzysztof=20Wilczy=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 Subject: [PATCH] PCI: rockchip-ep: Remove wrong mask on subsys_vendor_id Date: Wed, 3 Apr 2024 16:45:08 +0200 Message-Id: <20240403144508.489835-1-rick.wertenbroek@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240403_074536_763173_6F71D64C X-CRM114-Status: GOOD ( 11.79 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org 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 --- 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); } -- 2.25.1 _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 709F8CD1292 for ; Wed, 3 Apr 2024 14:45:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=toV5OzHRA68DV7bj5cFmyYcRjyArOr4uAbea0vWPgQA=; b=DpNmFkwjmL+9qF W0luKD7AB8rBd/7tZlmUPC8mTde37uIHfecfBH/kt6nBF/y2XePRqa2SS/QjGbyVj0juPl9CKyf93 hFJMyaFKAS7CNeiJqeSU6/ovFKYVxBJdJRPPwEzY0sQlAWInlbQZwlf97OxniquqY89FplMMiOHLV es45uEvN3ejfOTnlMVPaj1t9HSpoqe0CiSbAHfwZ10bikM6k9cretPUZaqGtV53cQjrJbrBb8ZCPN o5Im70o79n3wP8vDm5qqxUM6SIO80Anc18ZCiLdKdhFRswrSn5OLi2173iYAQeuLx6W9N5tseZv2N 6G/InbyW6jZRDYmwB2jQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rs1rx-0000000GXfi-14RE; Wed, 03 Apr 2024 14:45:41 +0000 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rs1rs-0000000GXdb-2vNI; Wed, 03 Apr 2024 14:45:38 +0000 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a44665605f3so741529466b.2; Wed, 03 Apr 2024 07:45:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712155531; x=1712760331; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=s3Pkic51g7rrTopzQNi+VbYIAqH2ghyU0XlcWsnfQ8s=; b=heGmzgOWIWSYObsRLS8htv9ep4urZ87zI9dfzwsQ99vbwASefsELIxc5dUDPY1VB2Z ReCl9olqdOk1jAAFHCoKM7bkqSQu5FJDDbfRGocs1scbOlciVZpWo+Do+PZAXl4I5EPD 9AUqs+CJEv5rcB2SgrYl6cQ0e7OR6Hbko4P4i2vof3zB+cH6xWoL0tvjVR6A3ljqFmjD xKtqjfXKPg9uF5z2nQZEwPkJo1vpZRl8FPELYpmlPCwBm3OiM48t5stKoDaK0bIRFiek k+NRxW6UUzYOqbKWPnxD06fBTBS/MQC+oV/mHLfDxTwxQTlO46Y8e3PpTdA4iGF5WLEW 8MSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712155531; x=1712760331; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=s3Pkic51g7rrTopzQNi+VbYIAqH2ghyU0XlcWsnfQ8s=; b=UE733/Z/LgbmsahTInDY01Dbb+FDjSir05yosg5gEDdnecpde2IUWqkE4zzW0bJrIJ Hz0sgVSc7lC3hAU05vL1Qwr64Yq+IwMIiZN3MvqDefPh5BfRswzY14yZwDNBbh9TG476 Jo1Jzg6P9yW8F8xpQk17RiDUKWZ2fZzv8OUjmHo1O8Prsm/seJm4KFfJhL51uy2a83tg 6Zr0F4U7Pk7dMTzAsPPMHjSRIzYFYqpqNwfVguTH7O/W5KuIXd45+PzZbScTwAJ4prw2 BBdy93GVsg4Gw3pzfsTi24SrVYs0sdGSjrP4MVzh1KrjEdPYpmNAyrfuC1R1jJfG/s5c FwHA== X-Forwarded-Encrypted: i=1; AJvYcCUvZP/pxrl2wgR4xozrH+wTEhypokAe5jt0mlBa4Ki5HzFEgyFEBOo/uVf4BbBUxI9oC/CroU2g1G+F4/OsrHOzZ4mm+QeJ6J8wof7tit+1g4TggDKqhzd6V+YrVib+19+G1hpoq9DHMy0aOBAourk1E6GLIn7Yz8g= X-Gm-Message-State: AOJu0Yz96yic5AH2D2ajk3Jt/vLPV6xkixKXimp1x7JCbov82/fyUTq2 R01tRUFAh6N0zIpZCc9X7Fd++0YZkGVIvrR5vPrMp3Uh/gCm2wWo X-Google-Smtp-Source: AGHT+IGUKnmalWHmdHqzQg31S41xmoGwv8cZpjceJSBvGia7muB7V+oQVkfF70cW8QCJGV1MPIMf1A== X-Received: by 2002:a17:906:da8e:b0:a4e:379b:753f with SMTP id xh14-20020a170906da8e00b00a4e379b753fmr11844116ejb.23.1712155530775; Wed, 03 Apr 2024 07:45:30 -0700 (PDT) Received: from A13PC04R.einet.ad.eivd.ch ([193.134.219.72]) by smtp.googlemail.com with ESMTPSA id s26-20020a1709066c9a00b00a46e92e583bsm7921536ejr.149.2024.04.03.07.45.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 07:45:30 -0700 (PDT) From: Rick Wertenbroek To: rick.wertenbroek@heig-vd.ch Cc: dlemoal@kernel.org, Rick Wertenbroek , stable@vger.kernel.org, Shawn Lin , Lorenzo Pieralisi , =?UTF-8?q?Krzysztof=20Wilczy=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 Subject: [PATCH] PCI: rockchip-ep: Remove wrong mask on subsys_vendor_id Date: Wed, 3 Apr 2024 16:45:08 +0200 Message-Id: <20240403144508.489835-1-rick.wertenbroek@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240403_074536_763173_6F71D64C X-CRM114-Status: GOOD ( 11.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- 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); } -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel