Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp195260rdb; Thu, 19 Oct 2023 01:18:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEhN8Q+jxDUANuNF+LCH7HjjBdVE//raEAsFg1d1HW/KYhLOii4eMoKsRIao3gxf1mviCb8 X-Received: by 2002:a05:6e02:1b03:b0:34f:6d6c:79bd with SMTP id i3-20020a056e021b0300b0034f6d6c79bdmr1991971ilv.28.1697703520504; Thu, 19 Oct 2023 01:18:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697703520; cv=none; d=google.com; s=arc-20160816; b=ngu0QXyOFdp6LzsJ+zlhOMfbsmYvvMKvVGqY4hpxnqUJ+mX92U4AlCavtZ8Gf4Bk80 AvvukOFtGbONAhQOWNfkPWMR36kzLRygl1YfCdIgtIO1T1e96YjWUnv2BVkLGZjgIt5e RqGKXDU2BBkZqP0ZJABF5QMi60FQtHyfFDNaJbMDvxU70y3s6JJLvyzaiqGHhTJ8vgOU 3D88XqMCr2QjRoZHihtTKoPbEPMzuLSCaGhNE93aHD2fEjEEWCRGw+jXSWnKFN7FL2Qz ZRhr2KLWR97w3aQdDF+4uKU5pls9t8/DuH7+bGn+r7+BEt05adkOkvZ7s3hhWeSbxr4G fWDg== 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 :references:to:content-language:subject:cc:user-agent:mime-version :date:message-id:dkim-signature; bh=Wa8s9G9TX8ZZJjeLXajpX2z+m7oQdM2kGBrLbOxOhTw=; fh=voVX45xS6sUXY5sGcN0gTJ/erA6asoS6yJWc1UQeD5M=; b=zRUk5g4LxMHgjzIfiqRTeVhWS4S0oBXKmL84s5OCkszlT1iYWVPcyw3PWgZCMRMLiV E+JVcO3J7XOTDn+ouBUwk2Eq5pp9nrHEmnoL93cIGr00XkAVtxD5oT5Sddnb0gWvdKni IRFO6l1N03PNrJPJTPT9+/nFMeEa2reHc/kzqFd8s8mW8iV/kGZWqK+xR4JkqWj0Xw4n r6y4rFhpbamNUefgOUodP52yXCq+nD9pu25FXx0lK9bu31/AvuhbPz3SxcNnMBqK9GCJ DvT2ERxPoAcfIguDrIc9qXCaAeG5eKwOC/JJDiyqRjyU8OXsKLsQslauhvHnjqEHLkG2 4hOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Tkz+6AUQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id 67-20020a630246000000b005b4a9b2f404si3915132pgc.710.2023.10.19.01.18.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 01:18:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Tkz+6AUQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id CCF0182DAFD1; Thu, 19 Oct 2023 01:18:37 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232813AbjJSISX (ORCPT + 99 others); Thu, 19 Oct 2023 04:18:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232850AbjJSISV (ORCPT ); Thu, 19 Oct 2023 04:18:21 -0400 Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B85912D; Thu, 19 Oct 2023 01:18:20 -0700 (PDT) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 39J8Hh66099414; Thu, 19 Oct 2023 03:17:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1697703463; bh=Wa8s9G9TX8ZZJjeLXajpX2z+m7oQdM2kGBrLbOxOhTw=; h=Date:CC:Subject:To:References:From:In-Reply-To; b=Tkz+6AUQhgQbQ/hnXyO4Wkp3GG9ldhyXBYB4/mA6tr8qomMwbGNLUUWMiXzySNYwi IYpBqDdkGOAZF7i5l9for5+ZZ9gJPo3VosbMFOH+KOIqGnJnkW/Nj/JtUfeuCJZjh1 FFoTAujZsa0UAehJ3NLOdyrobqp773m0KRobTY30= Received: from DFLE100.ent.ti.com (dfle100.ent.ti.com [10.64.6.21]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 39J8Hhdm067675 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 19 Oct 2023 03:17:43 -0500 Received: from DFLE110.ent.ti.com (10.64.6.31) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Thu, 19 Oct 2023 03:17:43 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE110.ent.ti.com (10.64.6.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Thu, 19 Oct 2023 03:17:43 -0500 Received: from [172.24.227.9] (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 39J8Hc0u107836; Thu, 19 Oct 2023 03:17:39 -0500 Message-ID: <08cb761b-e6ca-446a-9594-bc5a9733b470@ti.com> Date: Thu, 19 Oct 2023 13:47:38 +0530 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird CC: , , , , , , , , , Subject: Re: [PATCH v2] PCI: keystone: Fix ks_pcie_v3_65_add_bus() for AM654x SoC Content-Language: en-US To: Serge Semin References: <20231018075038.2740534-1-s-vadapalli@ti.com> <6b74d547-bdaf-41e3-8046-ce295a0ecf03@ti.com> From: Siddharth Vadapalli In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,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 fry.vger.email 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 (fry.vger.email [0.0.0.0]); Thu, 19 Oct 2023 01:18:38 -0700 (PDT) Hello Serge, On 19/10/23 10:07, Siddharth Vadapalli wrote: > > > On 18/10/23 17:45, Serge Semin wrote: >> On Wed, Oct 18, 2023 at 05:26:53PM +0530, Siddharth Vadapalli wrote: ... > > Sure. Thank you for the suggestion. I will leave ks_pcie_ops as-is for the older > 3.65 controller while adding the ks_pcie_am6_ops without the .add_bus method for > the newer 4.90 controller. I assume this should be acceptable since the > pci-keystone.c driver only has two controller versions, namely 3.65a and 4.90a, > with the new 4.90a controller only applicable to AM654x SoC which is already > being distinguished in the driver using the is_am6 flag. > > In the v3 patch, I will add the following: > > static struct pci_ops ks_pcie_am6_ops = { > .map_bus = dw_pcie_own_conf_map_bus, > .read = pci_generic_config_read, > .write = pci_generic_config_write, > }; > > and also update ks_pcie_host_init() to the following: > if(ks_pcie->is_am6) > pp->bridge->ops = &ks_pcie_am6_ops; > else > pp->bridge->ops = &ks_pcie_ops; > >> >> Meanwhile your fix look more like a workaround. The >> ks_pcie_v3_65_add_bus() function will be still called for the AM6x >> v4.90 controllers, which based on its semantic would be and will be >> wrong in any case. So instead of noop-ing the function it would be >> better to just drop it being called for the new controllers. > > Yes, I will drop it for the new 4.90a controller rather than making it a no-op. I have posted the v3 patch at: https://lore.kernel.org/r/20231019081330.2975470-1-s-vadapalli@ti.com/ implementing your suggestion of adding a new pci_ops structure. Please review it and let me know in case of any feedback. -- Regards, Siddharth.