Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2959446rdg; Mon, 16 Oct 2023 23:18:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH5YnBc/TwFp1+/CjNdvC7v8pl2H3PMAn/6ENY6eWOXvR1lkNg04DpLdhKGS2dx+FOQiB9D X-Received: by 2002:a05:6359:2d8d:b0:143:8c4e:283b with SMTP id rn13-20020a0563592d8d00b001438c4e283bmr1408809rwb.0.1697523506516; Mon, 16 Oct 2023 23:18:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697523506; cv=none; d=google.com; s=arc-20160816; b=OgsNy5wSc7GWHySuX8tQuYHifzc++YOpoqrQ6xX8az3By0IGhlPfr7dj+3d2h25Efz vMSWVui5Yw1kyrjGPpC7cxlfLMp+oUG14FHJTsPygOLf+79JP3IoLJFbo9xVQ4M18tx7 Rzv8OpdusQWLZEM+E+3lO1M8dI/UaV2GrR75wKN0Y7PWJGWh8guU8XMV2DOAmR2F08+O mSHTQ+b5zSMckGl3z6qsDm3OEc7h8S32cJo7o7hyER9Ii6q4HOt5RchLidp4jJTqNonN E5r2Nb9vvpgpZUaLluklzX1lBQQAKFI2Fch29X5Ly7EPgOBB6lryhkr1Ip4VgDrR3k3p ijyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:content-transfer-encoding:mime-version :message-id:date:subject:from:dkim-signature; bh=ceHtW9H2siBIBWG0gigB6B/LkLmcRGMR+a2ck1IcBwg=; fh=AL7uOW7XpDa++9W8UyVEmNJlkLbwtkYB45DjIzYa5dA=; b=rjfxP9Z4snyEcb09UVvv6W9j06F8Wi2KaFHtTHPvQUDFXP+asfWgs6+ktsHvmT68t9 s/ksldZDbzTkucI/iVL95VPh6CGJCqKxjiqcbedmna03W90eIPGREGbHyuvJG9E5CzLV YCRjy8aeNDckhBZDmxj/Pr0473KIOy0A4KCCgPejsGf0gyH4dC3ZwYpOZW4mMAwnhRaS OhNZfBeVIq5iuzwLWv8I1StUe8HrAZMneHa7s99ZsYIhm8DT7LJKVcGwP0ORt7kgKQ5m je1ijZSe0+BLQ9YIyjdWS1/JrHIEf0PJwGxt5xkLQUjQVNKRYD5DgTGQ5QLI7qouhuWA wToA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=itGyNKLh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id m22-20020a056a00081600b006be7d402d8csi337072pfk.6.2023.10.16.23.18.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 23:18:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=itGyNKLh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 77D738029C54; Mon, 16 Oct 2023 23:18:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234512AbjJQGSW (ORCPT + 99 others); Tue, 17 Oct 2023 02:18:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234391AbjJQGSV (ORCPT ); Tue, 17 Oct 2023 02:18:21 -0400 Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C027EE8 for ; Mon, 16 Oct 2023 23:18:19 -0700 (PDT) Received: by mail-qt1-x82b.google.com with SMTP id d75a77b69052e-41c157bbd30so1240311cf.0 for ; Mon, 16 Oct 2023 23:18:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697523499; x=1698128299; darn=vger.kernel.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=ceHtW9H2siBIBWG0gigB6B/LkLmcRGMR+a2ck1IcBwg=; b=itGyNKLh5nD1XdD2ScLb24lq0uYk/PmlTQWibS/0cfoFatDws3i48nHE/4rwZpBvik +LyFalHUyQOTCwEpSYYZqKhD0u7pUOOqltZQHRrRtSOnmpBO7Fvn7s/sdpHFf77ogGyF 1PTsEFlGqsY81FU6pKCCdpd/H1Efpb69Uvbzm0Z4sm9vlbTTgJ7YfArMyvv/OOJqCrp7 RS/roOxog5kT2rkvRfXgebzko0STCiL9Dh0Ktk+g3q7CWirIXhyaWXsdrcUAd6exEVYN 0nBMrbcIto55JCDQyluk4RWRLfPMsWYZ9BDaF+3SaI25IwOwlX4BTXMCB1LTrdMH+rpB l4Mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697523499; x=1698128299; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ceHtW9H2siBIBWG0gigB6B/LkLmcRGMR+a2ck1IcBwg=; b=dl6+W5hbtPqkjL70vVeij6muwcRs37uo4WnGITTkixY1id2ed/32AMvGqtV8d+gOnI Y0r9YBTj1wn8hO0FsTh4F7L6do54hrNeP5Pz+Jlpco2gXns5+YQm86ZgWe/brbjpX1zU 2XF0jyA2SINWCgbCx4tfbnsOes+0Htwadk9rvxCpQhbF+4ecRWGJXjorks2uGoupub6k CsmvmrBzlBcSz67Dbw2vimpjpHXH4EH9iNid1jmDePySJEScAzfUffG4NusZV3XUXuPs kaYW/3pci83nfB+ojTMGqmNvrlpTcgc8sWJiLT52+FTfWYeQq0+J2/1/1v+VgAYAUTUr EeQQ== X-Gm-Message-State: AOJu0YwebwQHGk/DunORzIobC5uJ+ZAwAcAAGkaEC8w6x4sQlXzhQXOj VikKjzIi/KTkAhPGJHG/hHkq X-Received: by 2002:a05:6214:1d2d:b0:66d:5ee5:8158 with SMTP id f13-20020a0562141d2d00b0066d5ee58158mr1444238qvd.55.1697523498769; Mon, 16 Oct 2023 23:18:18 -0700 (PDT) Received: from [127.0.1.1] ([117.207.31.199]) by smtp.gmail.com with ESMTPSA id f22-20020a05620a12f600b00765aa3ffa07sm390304qkl.98.2023.10.16.23.18.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 23:18:18 -0700 (PDT) From: Manivannan Sadhasivam Subject: [PATCH 0/2] PCI: dwc: Fix the BAR size programming Date: Tue, 17 Oct 2023 11:47:53 +0530 Message-Id: <20231017-pcie-qcom-bar-v1-0-3e26de07bec0@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIABEnLmUC/x3MQQqAIBBA0avErBvQlIquEi1smmoWpSlEEN49a fkW/7+QOAonGKoXIt+SxJ8Fuq6AdndujLIUQ6Mao5XuMJAwXuQPnF1Esn1ryBhSbKE0IfIqz/8 bp5w/w+Gnn18AAAA= To: Jingoo Han , Gustavo Pimentel , Manivannan Sadhasivam , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Manivannan Sadhasivam X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1599; i=manivannan.sadhasivam@linaro.org; h=from:subject:message-id; bh=Gcs3HOsPBfF3cIkTmKhbvwJROzoVyq0co8h182wgdmE=; b=owEBbQGS/pANAwAKAVWfEeb+kc71AcsmYgBlLicmF9zGtxWxnm6EWnPLFh5TL2I/hR68hJ1zH Tam/uqLLgGJATMEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCZS4nJgAKCRBVnxHm/pHO 9dfhB/9woGeMPND3WMkroRyWsqHjVp1whwd/ogF3rdrot3nWX4fUaqcueDpak9RrFwEDZgbrFb9 O/qOPzSYtzKqFXb3qHDuZA2PBcnqjn1qjkt3wCP4YXdgmjc96pLNqceOJbVh81CoWTVqoFiamHo C9BzkENnesEWp4imFCwGHA69LMob07hExBKMIvVZO8GHK0qnJSaaJrn0ir47nYzzODaNh2yvKcI lAr8fdn3yHK89loUJbefFNqrlDus4Y9PYnn/kfLRqRHirG21jUJp8GM+hXc91iq0WLAgmRO7yFC JtO+wTjsnHqQHvegM8vG3TBej2R2dzmTFcinDNsCcC1/zDHj X-Developer-Key: i=manivannan.sadhasivam@linaro.org; a=openpgp; fpr=C668AEC3C3188E4C611465E7488550E901166008 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 16 Oct 2023 23:18:25 -0700 (PDT) Hello, This series fixes the issue seen on Qcom EP platforms implementing the DWC core while setting the BAR size. Currently, whatever the BAR size getting programmed through pci_epc_set_bar() is not reflected on the host side during enumeration. Debugging that issue revealed that the DWC Spec mandates asserting the DBI CS2 register in addition to DBI CS while programming some read only and shadow registers. On the Qcom EP platforms, the BAR mask register used to program the BAR size is marked as read only (RO). So the driver needs to assert DBI CS2 before programming and deassert it once done. Hence, this series adds two new macros for asserting/deasserting the DBI CS2 while programming BAR size and also introduces a new host callback, dbi_cs2_access() that the vendor drivers can implement. For platforms not requiring the DBI CS2 access, this is a no-op. This series has been tested on Qcom SM8450 based development platform. --- Manivannan Sadhasivam (2): PCI: dwc: Add new accessors to enable/disable DBI CS2 while setting the BAR size PCI: qcom-ep: Implement dbi_cs2_access() function callback for DBI CS2 access drivers/pci/controller/dwc/pcie-designware-ep.c | 6 ++++++ drivers/pci/controller/dwc/pcie-designware.h | 13 +++++++++++++ drivers/pci/controller/dwc/pcie-qcom-ep.c | 14 ++++++++++++++ 3 files changed, 33 insertions(+) --- base-commit: a286439bbc71e8c9bb1660b7d4775efcab6011fa change-id: 20231017-pcie-qcom-bar-c4863c33c0e4 Best regards, -- Manivannan Sadhasivam