Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1619988rwb; Tue, 29 Nov 2022 16:36:50 -0800 (PST) X-Google-Smtp-Source: AA0mqf5plxRKNcDvv4EPNhjsyZtmSmxhbcan2e+3kmt3Nwc+yrehO6rZQNln76kayoRyn67qonh4 X-Received: by 2002:a17:906:9bf9:b0:7bf:f196:2a55 with SMTP id de57-20020a1709069bf900b007bff1962a55mr10808125ejc.125.1669768610654; Tue, 29 Nov 2022 16:36:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669768610; cv=none; d=google.com; s=arc-20160816; b=LBevIi2abRPIeVq7H3YNkf7cbxsYEjo99Ys8qhNWfEFBkQ+saU9GL12YiD7BIkkOqH 3rATMHI3iT0VIntlhNZltBpYLlVFbRkspXMRkZTR/MMBciSGtAuQ21dueYK8oVDjrypK YvKb44CqFO7tNFtCH6nKm9MU2tS+pal91KHnGknXDpi9lhBAFAqooTRWtV9iY5zRVmKu CO72VtM1LdZeBy4CPiQ9U9wJUt+2c0NAW0yfSxuftUGSFuR/704oSWaqCMAkLwx8n0yV Oduvz7lokfa0B6W8gC0Q6/Hm5+Ux2k0tVAMaQ8W0S9Bl3g0vtCREgAZwX1Cc0O2phmhv FzGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=GVsAs2Za73d6UJPfTz0MZvUiul0X6sklp6MH+CmRL3k=; b=siNicDhzvtwYKrHb3FNY53lezl00KbWqp8QBPy7tdhvJe5UI4OO31aKzUqpGvxxYy8 WwF7MtRg8+d+q1rytSUwDRMbP6u4ai7fEywPnbhVhglIZhNHwcrdInUD0AnJYznpVU0A Kh9NSRcK1qNOefMepWgIoW6eXxzk2pJojBKpKidofilykdOVMmGUOm73eNc5NRWfFpyT N8KP2BHjOTlATJdRfMmYfJVLTY/tHOwKK6hqc6JGa7d+0SkyYHsvosUpRuxrwuO0RKXw K82zY89HuC8TSLr6GKFK1llOwfC3dyoL2VLrr1D1KyeiuZvWRuMjwfsx4M4rL/6W2Q6n HWpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=EL47aYSQ; 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 go15-20020a1709070d8f00b00770534b5a71si14641ejc.858.2022.11.29.16.36.29; Tue, 29 Nov 2022 16:36:50 -0800 (PST) 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=20210112 header.b=EL47aYSQ; 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 S229705AbiK3AH3 (ORCPT + 84 others); Tue, 29 Nov 2022 19:07:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229579AbiK3AH2 (ORCPT ); Tue, 29 Nov 2022 19:07:28 -0500 Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E03057044E; Tue, 29 Nov 2022 16:07:26 -0800 (PST) Received: by mail-lj1-x230.google.com with SMTP id d3so19156525ljl.1; Tue, 29 Nov 2022 16:07:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=GVsAs2Za73d6UJPfTz0MZvUiul0X6sklp6MH+CmRL3k=; b=EL47aYSQjawJcsLLj/QAQ8+YXvjf23CGJROzwdIE7wtldJvsKi46kOiNH8Nl+U7j0h ObfsQI3tr5WATq7qgHwTyBxwj7PrSiOaR02VxnCwSgrUpzSkC3nu+3xCtxPmOe0Nphk6 Mn9IyRHFXOE8Ibc+ru3BYcGdiccptw+GhjdbJx9Nr45UIjV7V7pAW9dD9cgK+8JlAmIe 1XAbJmKZngaT2SEmNzkp0ukKd97UYj4fGz5Q3r+pQqBsu60DmrdKKxYPM6hSNMi7mqWx KbpVERYTp6984IPccQ7mkqg137Bd/28MVaBxB+ZHzbSgINt2Hk07QNRFTFESs4Df6tHR UutQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=GVsAs2Za73d6UJPfTz0MZvUiul0X6sklp6MH+CmRL3k=; b=FCIaIG3ZGXPK3sb2qT3dtlYa1ubtWPYEQsggbmz+pXH4u/41BAflY21hSjsi/kbO81 66au/cNN13Rr9wvE6f2/tSdyQWOIqwXzkJubEkiK71OInZrkJDzpbnNnaXH+XDr42gfi QpeOb4iXJwOqUL5/u2oZHTNAQD+kn0UpOM39FowTgOwC3qUjv+3GeLVlvADzpX67yenn F0FTGgPUauGkF0OO6Oh31/73LTC5Lpf6nzj4jNezQL+uT7KcZFzFgefL5Y00mNyvWpJG XYSnJ7IVvsBwIYaSLwRNTnDdmTAKiv7cXRcmRuIqX4msPZ5DR3wI45HSlcIvyRGrDZ1V YSig== X-Gm-Message-State: ANoB5pll4BWNSefYxLzddvceyKtRw3ZIIetnNr4HUSzViekq8j4B5Y7b FgHIU1BfOaZyRWbplXJpKw8= X-Received: by 2002:a2e:be08:0:b0:277:857:87ab with SMTP id z8-20020a2ebe08000000b00277085787abmr12402330ljq.442.1669766845080; Tue, 29 Nov 2022 16:07:25 -0800 (PST) Received: from mobilestation ([95.79.133.202]) by smtp.gmail.com with ESMTPSA id 11-20020a05651c128b00b0026fc8855c20sm1706704ljc.19.2022.11.29.16.07.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Nov 2022 16:07:24 -0800 (PST) Date: Wed, 30 Nov 2022 03:07:22 +0300 From: Serge Semin To: Bjorn Helgaas Cc: Serge Semin , Rob Herring , Rob Herring , Krzysztof Kozlowski , Bjorn Helgaas , Lorenzo Pieralisi , Cai Huoqing , Robin Murphy , Jingoo Han , Gustavo Pimentel , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Alexey Malahov , Pavel Parkhomenko , Frank Li , Manivannan Sadhasivam , caihuoqing , Vinod Koul , linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v7 17/20] PCI: dwc: Introduce generic resources getter Message-ID: <20221130000722.xfh3q22mo2huhipk@mobilestation> References: <20221127011005.cjzcd6slb6ezy7ix@mobilestation> <20221129183543.GA729294@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221129183543.GA729294@bhelgaas> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 Tue, Nov 29, 2022 at 12:35:43PM -0600, Bjorn Helgaas wrote: > On Sun, Nov 27, 2022 at 04:10:05AM +0300, Serge Semin wrote: > > On Wed, Nov 23, 2022 at 01:44:36PM -0600, Bjorn Helgaas wrote: > > > On Sun, Nov 13, 2022 at 10:12:58PM +0300, Serge Semin wrote: > > > > Thanks for these new generic interfaces in the DWC core! And thanks > > > for the changes in this patch to take advantage of them in the > > > pcie-designware drivers. > > > > > > Do you plan similar changes to other drivers to take advantage of > > > these DWC-generic data and interfaces? If you add generic things to > > > the DWC core but only take advantage of them in your driver, I don't > > > think they are really usefully generic. > > > > Could you be more specific what generic things you are referring to? I > > am asking because the only part of the changes which is used in my > > low-level driver only is introduced in another patch of this series. > > I asked because three of your patches mention "generic" things, but I > didn't see any changes to drivers except pcie-designware: > > PCI: dwc: Introduce generic platform clocks and reset This patch introduces a method to request a generic platform clocks and resets by their names. As I already said these names are defined by the DT-bindings, which are platform-specific. That's why the most of the currently available drivers can't be converted to using it. Instead the new drivers are supposed to be encouraged to use the generic names (in accordance with the generic DW PCIe DT-schema) and the resources request interface (based on the generic DT-bindings) if it suits their design. Anyway I honestly tried to come up with an even more generic interface, which could be used by all the low-level drivers. But due to too much variations of the resource names and their sometimes too complex utilization in the drivers any solution looked too complex. After all of thoughts I decided to keep things simpler. > PCI: dwc: Introduce generic resources getter This patch defines a generic resource getter for the DW PCIe host and end-point drivers. That's why it's called generic. > PCI: dwc: Introduce generic controller capabilities interface This patch introduces an interface to set the device-specific capabilities. Since these capabilities can be marked as available by both the core driver (at least two of them already defined within this patchset) and low-level platform drivers the interface is called as generic. > > I hoped that we would be able to use these to remove some code from > existing drivers, but if they only improve maintainability of future > drivers, that's useful, too. Removing some code is possible for instance from the pcie-visconti.c driver by using the new generic clocks and resets request interface. I've scheduled to create a small patchset which would do that after the rest of my patches pass the review process. -Serge(y) > > Bjorn