Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2754620lqz; Wed, 3 Apr 2024 07:45:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVy65Oly2SJFu0pkFnJGDIZwbmUsPc3v0lVmjDr8Ci1lMPjyIkM5veMzm8XKYVnvPK33br4+lysol5Tnnj2xMns0wtCcJP3lKSZkPMSEQ== X-Google-Smtp-Source: AGHT+IHDiNe/OYMH5/5Eg6/zmKWL/+E9GYUDeLkYk6WhSAQLX92i0UFelIPg48PITZKIjq4/fZdO X-Received: by 2002:a17:90a:fb4e:b0:2a2:9b49:1ad3 with SMTP id iq14-20020a17090afb4e00b002a29b491ad3mr1690112pjb.13.1712155542949; Wed, 03 Apr 2024 07:45:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712155542; cv=pass; d=google.com; s=arc-20160816; b=0sPpX4J6U+xEhCPjUMLBlZ8/OpRQmWyh903DxD0mUu9tSTb6cjHYOeQoEv4l8ue5ff ey9ubbqnx66002chPozt/5FPhjFymIUpWQQfnxKkdgocE/C8A+VzU9hlBFeNKeQqa4/T jLG8eCCbyqe8EqTAtE3UC3T7Fuk5udFAOY3jGJ1RCUer2V7kTuUF20zjmbeizqEOpk6M dfuEy8DHciNIyNnsOkKBZeJIclpsJddem8HfMrs7p2ijEn4DgFw6L1wMRVVSldVgbDK6 UD7L2v2uxp0nU/9Parlcc9Bu9zgL3UhfLlH5qLe6R8/W1xwnQPk4YptznqzUtjHhapHk rZZw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=s3Pkic51g7rrTopzQNi+VbYIAqH2ghyU0XlcWsnfQ8s=; fh=nLbZD6SPWfjuAs9NpLnfxaljSzYV7j24fSo2/mRiZ/o=; b=nTbMh3kqVrZ9JQfhp0/8Xpgr4IUNABVn2kcM/9fMVqnK9lPIZZb+fJdndG/7T9/akp J9iltDNEE7BERIUHFnd/0BaoQ5pR2Fqv3ECZBGnaBpz6llw3AbAe+daUOSBfhBOROrds ZLjZxT2T5/Sg+RwnxCY+sJERg2EyeskawC5L6Hepsm1P0iXp/xuE6kItT2Yz+RLRghWR qyaPlEQm9R2gv4fOlFXASCmvnJ3qzglKhPzdhKJrgJxP3iFmSRKVNDawyQF49t06X17w sZC+ixQDSUk6kt7pQ3jxVDW6VncFSc1In5ebusi1PaBps/g3w7F4FUsSegCV9xrcjNKQ PHag==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Dggfug2I; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-129991-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-129991-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id lt14-20020a17090b354e00b002a2b5b86913si402690pjb.158.2024.04.03.07.45.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 07:45:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-129991-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Dggfug2I; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-129991-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-129991-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 967D928C4EE for ; Wed, 3 Apr 2024 14:45:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1D7E1149003; Wed, 3 Apr 2024 14:45:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Dggfug2I" 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 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-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-kernel@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