From: Vidya Sagar <vidyas@nvidia.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: <jingoohan1@gmail.com>, <gustavo.pimentel@synopsys.com>,
<lorenzo.pieralisi@arm.com>, <andrew.murray@arm.com>,
<bhelgaas@google.com>, <kishon@ti.com>,
<thierry.reding@gmail.com>, <Jisheng.Zhang@synaptics.com>,
<jonathanh@nvidia.com>, <linux-pci@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <kthota@nvidia.com>,
<mmaddireddy@nvidia.com>, <sagar.tv@gmail.com>
Subject: Re: [PATCH 1/4] PCI: dwc: Add new feature to skip core initialization
Date: Fri, 29 Nov 2019 20:10:10 +0530 [thread overview]
Message-ID: <80d610bf-71d8-d2c1-9c75-b0a58cb5c8ed@nvidia.com> (raw)
In-Reply-To: <20191127094844.GA21122@infradead.org>
On 11/27/2019 3:18 PM, Christoph Hellwig wrote:
> On Wed, Nov 13, 2019 at 02:38:48PM +0530, Vidya Sagar wrote:
>> + if (ep->ops->get_features) {
>> + epc_features = ep->ops->get_features(ep);
>> + if (epc_features->skip_core_init)
>> + return 0;
>> }
>>
>> + return dw_pcie_ep_init_complete(ep);
>
> This calling convention is strange. Just split the early part of
> dw_pcie_ep_init into an dw_pcie_ep_early and either add a tiny
> wrapper like:
>
> int dw_pcie_ep_init(struct dw_pcie_ep *ep)
> {
> int error;
>
> error = dw_pcie_ep_init_early(ep);
> if (error)
> return error;
> return dw_pcie_ep_init_late(ep);
> }
>
> or just open code that in the few callers. That keeps the calling
> conventions much simpler and avoids relying on a callback and flag.
I'm not sure if I got this right. I think in any case, code that is going to be
part of dw_pcie_ep_init_late() needs to depend on callback and flag right?
I mean, unless it is confirmed (by calling the get_features() callback and
checking whether or not the core is available for programming) dw_pcie_ep_init_late()
can't be called right?
Please let me know if I'm missing something here.
- Vidya Sagar
>
next prev parent reply other threads:[~2019-11-29 14:40 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-13 9:08 [PATCH 0/4] Add support to defer core initialization Vidya Sagar
2019-11-13 9:08 ` [PATCH 1/4] PCI: dwc: Add new feature to skip " Vidya Sagar
2019-11-27 8:14 ` Kishon Vijay Abraham I
2019-11-27 8:40 ` Vidya Sagar
2019-11-27 9:18 ` Kishon Vijay Abraham I
2019-11-27 9:48 ` Christoph Hellwig
2019-11-29 14:40 ` Vidya Sagar [this message]
2019-12-05 9:59 ` Vidya Sagar
2019-12-05 10:04 ` Kishon Vijay Abraham I
2020-01-03 9:40 ` Vidya Sagar
2019-11-13 9:08 ` [PATCH 2/4] PCI: endpoint: Add notification for core init completion Vidya Sagar
2019-11-27 8:18 ` Kishon Vijay Abraham I
2019-11-27 8:22 ` Kishon Vijay Abraham I
2019-11-13 9:08 ` [PATCH 3/4] PCI: dwc: Add API to notify core initialization completion Vidya Sagar
2019-11-13 9:08 ` [PATCH 4/4] PCI: pci-epf-test: Add support to defer core initialization Vidya Sagar
2019-11-27 9:20 ` Kishon Vijay Abraham I
2019-12-01 14:29 ` Vidya Sagar
2019-12-05 11:22 ` Kishon Vijay Abraham I
2020-01-03 9:40 ` Vidya Sagar
2019-11-18 6:55 ` [PATCH 0/4] " Vidya Sagar
2019-11-18 16:43 ` Jingoo Han
2019-11-25 4:33 ` Vidya Sagar
2019-11-25 4:45 ` Kishon Vijay Abraham I
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=80d610bf-71d8-d2c1-9c75-b0a58cb5c8ed@nvidia.com \
--to=vidyas@nvidia.com \
--cc=Jisheng.Zhang@synaptics.com \
--cc=andrew.murray@arm.com \
--cc=bhelgaas@google.com \
--cc=gustavo.pimentel@synopsys.com \
--cc=hch@infradead.org \
--cc=jingoohan1@gmail.com \
--cc=jonathanh@nvidia.com \
--cc=kishon@ti.com \
--cc=kthota@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=mmaddireddy@nvidia.com \
--cc=sagar.tv@gmail.com \
--cc=thierry.reding@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).