Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp4232036rwb; Mon, 31 Jul 2023 03:54:34 -0700 (PDT) X-Google-Smtp-Source: APBJJlG/t7e3zFFUj1cFpOX02fCK2iiLjXQXv3PDZNiIgO23+M6S/B5AdZrOA2dsA3CqbAnXBm/1 X-Received: by 2002:a17:902:70c5:b0:1bc:2bd:8523 with SMTP id l5-20020a17090270c500b001bc02bd8523mr3962843plt.24.1690800873809; Mon, 31 Jul 2023 03:54:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690800873; cv=none; d=google.com; s=arc-20160816; b=N129R3/auiqwvq8ggJDVDrAbaguhw5FG3nYqAM1IOFKs+CQa7vJa0zevqB5lCTlzNZ BGiNsO8GK/FdZb4dPcmsvXI0w76sUqGE+MPUonrcEUcF8919YAmQjGQa5qDT69ZDCY39 XYLCyQgkOe4WQ8/Rhhr2W/dDYJeBPBDXuj/spIpQiDYSqRmB58Y3JnyUoPFHlk52wKYh 6PAoRf+/CckPDhBOkHQcXxKLsjU4yjC8dd66KcD4Fb+mLlagh0imWYs/nkzPaV/9/FFy Nj+PUg5GIodjBPtbItZLyzkY6X0EQ5pHcfiZIVunjr5cm7LXmuRC+bYBzoSqGztobX8U farA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=y6btwtxFM0exA7hajr4yQPObG72hgpwZQHb0o/diXn8=; fh=DDP1NZC2DkOJX4o8GfvLjxvXfhxE2Sfi7lJESTm3VeU=; b=bo0AKg77HxbC77jy5foyVGCxCAGQ0dc7afiR0CuscUeDQYWrlEYSEGFZtsAGLsN1a+ HRsWoGnuM36+lb6SvjGRSbYUtMKEJ3XB5UeJqqZdnisMbDIz7c3RhkhKemDI5uCrR8bC 20BOztNdyId4hUxXqDjbPXjlhVDfe4/+9PDFMRvxn1gH7BYo4IfXKhD7fYBkaJtal29Y pw4FE/okJ7Hrc4RxSjStRAHnSmWGmtF/tOY0SJl2TvgazVSJFRCmcV4diI+yC4RrFRl1 XnPta811y8cqEzl15UpCqgfvJN8Ty0moHpzYBwG2S75BPspAqvQ3Oapl80TcTjAuRcZ2 hGcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="KYGP/raz"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j4-20020a170903028400b001bbae3ae2bcsi21746plr.413.2023.07.31.03.54.21; Mon, 31 Jul 2023 03:54:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="KYGP/raz"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231594AbjGaKBq (ORCPT + 99 others); Mon, 31 Jul 2023 06:01:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231297AbjGaKBT (ORCPT ); Mon, 31 Jul 2023 06:01:19 -0400 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F091D3598; Mon, 31 Jul 2023 02:59:32 -0700 (PDT) Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-99bccc9ec02so684228666b.2; Mon, 31 Jul 2023 02:59:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690797569; x=1691402369; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=y6btwtxFM0exA7hajr4yQPObG72hgpwZQHb0o/diXn8=; b=KYGP/raz1IL6SXz9GdbWlegE4tKzmySleQiJiEGnai6C+nJmxDJp+0DqPvH1sJAWDa o8c9+MdioOU3zMbVBRWb0jVLuw4ZhMcAuF0+5Be3d+QPyk/ODbFKcYwhVgHz1Yw0gUmu OKYhrI/OANqx2fS9VE6yhVCNakZw1OYVFWNmbYtk2Q7hycUQIZFQzwCaqol4IMiIAoNc ZY5JlKXzpoBKFq/EAou7z/1GDYtKlOE7XQtFH7V5S1O+fdWPZ2QAhQgEn8tXTaDBaZS9 lYxkKXxBkpOcOwl4XZ2nQNQe5ItCo98rDX+k0wJ+1Bt0fwsEE8evnf299mTaKvZqHGwf 1mKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690797569; x=1691402369; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=y6btwtxFM0exA7hajr4yQPObG72hgpwZQHb0o/diXn8=; b=PdI4j4P9I2VsoGkrqBAr7Po85JT8PuHIx3WagNg8Jn9r0Pcb+D3D/hmr+omSHTqo+C S3gY0LifZSaBpirEa64iFQcYZd8DIGhpddd0fhKQr5/+qtyUfkXaT6ohHY4m8ZoHuMgM GWZvGL+KoWWwHHeV2S8NuUR67iOtAwwv4c7XbTlp575v5HT12/FnsD237dK5jgx9eCmi El+qCbEQ9xIHlH+oRxLFkfkyV/uBkhmtEHKPTYN63efW9gxJgYj8noCXy5AuzwTBzCUv PHouve+bmqI0OXfgQGZ7M9/BfQ8Q5N61NrlmlWFcL4D29+ipfgbfq14/orqRC3dL458d 22vQ== X-Gm-Message-State: ABy/qLZdr46hLLdkFOvf3I9VKLgMMCy2DkprlMtdjBfd4D8pFEdbSi3q 4sH+vCPwnUQgIo8Z3lkGAHM= X-Received: by 2002:a17:906:2219:b0:99b:e5c3:2e45 with SMTP id s25-20020a170906221900b0099be5c32e45mr6118052ejs.28.1690797568995; Mon, 31 Jul 2023 02:59:28 -0700 (PDT) Received: from [192.168.3.32] ([213.149.38.169]) by smtp.gmail.com with ESMTPSA id x23-20020a1709065ad700b009893b06e9e3sm5991877ejs.225.2023.07.31.02.59.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 31 Jul 2023 02:59:28 -0700 (PDT) Message-ID: Date: Mon, 31 Jul 2023 11:59:26 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH V5] PCI: qcom: Fixing broken pcie enumeration for 2_3_3 configs ops To: Sricharan Ramabadhran , agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, robh@kernel.org, mani@kernel.org, lpieralisi@kernel.org, bhelgaas@google.com, kw@linux.com, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, gregkh@linuxfoundation.org, dmitry.baryshkov@linaro.org Cc: stable@vger.kernel.org References: <20230724063429.3980462-1-quic_srichara@quicinc.com> Content-Language: en-US From: Robert Marko In-Reply-To: <20230724063429.3980462-1-quic_srichara@quicinc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 On 24. 07. 2023. 08:34, Sricharan Ramabadhran wrote: > PARF_SLV_ADDR_SPACE_SIZE_2_3_3 macro is used for IPQ8074 2_3_3 post_init. > PCIe slave addr register offset is 0x358, but was wrongly changed to > 0x168 as a part of commit 39171b33f652 ("PCI: qcom: Remove PCIE20_ prefix > from register definitions"). Fixing it, by using the right macro and remove > the unused PARF_SLV_ADDR_SPACE_SIZE_2_3_3. > > Without this access to the registers of slave addr space like iATU etc > are broken leading to pcie enumeration failure. > > Fixes: 39171b33f652 ("PCI: qcom: Remove PCIE20_ prefix from register definitions") > Cc: > Reviewed-by: Manivannan Sadhasivam > Reviewed-by: Konrad Dybcio > Signed-off-by: Sricharan Ramabadhran I can confirm this fixes Gen2 PCIe on Xiaomi AX9000 (IPQ8072A) so: Tested-by: Robert Marko > --- > [v5] Fixed subject, commit log > [v4] Fix commit sub and added '' reviewed-by tag > [v3] Added reviewed-by tag, fixed subject, commit text > [v2] Fixed the 'fixes tag' correctly, subject, right macro usage > > drivers/pci/controller/dwc/pcie-qcom.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c > index 4ab30892f6ef..8418894b3de7 100644 > --- a/drivers/pci/controller/dwc/pcie-qcom.c > +++ b/drivers/pci/controller/dwc/pcie-qcom.c > @@ -43,7 +43,6 @@ > #define PARF_PHY_REFCLK 0x4c > #define PARF_CONFIG_BITS 0x50 > #define PARF_DBI_BASE_ADDR 0x168 > -#define PARF_SLV_ADDR_SPACE_SIZE_2_3_3 0x16c /* Register offset specific to IP ver 2.3.3 */ > #define PARF_MHI_CLOCK_RESET_CTRL 0x174 > #define PARF_AXI_MSTR_WR_ADDR_HALT 0x178 > #define PARF_AXI_MSTR_WR_ADDR_HALT_V2 0x1a8 > @@ -810,8 +809,7 @@ static int qcom_pcie_post_init_2_3_3(struct qcom_pcie *pcie) > u16 offset = dw_pcie_find_capability(pci, PCI_CAP_ID_EXP); > u32 val; > > - writel(SLV_ADDR_SPACE_SZ, > - pcie->parf + PARF_SLV_ADDR_SPACE_SIZE_2_3_3); > + writel(SLV_ADDR_SPACE_SZ, pcie->parf + PARF_SLV_ADDR_SPACE_SIZE); > > val = readl(pcie->parf + PARF_PHY_CTRL); > val &= ~PHY_TEST_PWR_DOWN; >