From: Bjorn Helgaas <helgaas@kernel.org>
To: Sai Krishna Gajula <saikrishnag@marvell.com>
Cc: "bhelgaas@google.com" <bhelgaas@google.com>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
"richardcochran@gmail.com" <richardcochran@gmail.com>,
"horms@kernel.org" <horms@kernel.org>,
"vinicius.gomes@intel.com" <vinicius.gomes@intel.com>,
"vadim.fedorenko@linux.dev" <vadim.fedorenko@linux.dev>,
"davem@davemloft.net" <davem@davemloft.net>,
"kuba@kernel.org" <kuba@kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Sunil Kovvuri Goutham <sgoutham@marvell.com>,
Geethasowjanya Akula <gakula@marvell.com>,
Linu Cherian <lcherian@marvell.com>,
Hariprasad Kelam <hkelam@marvell.com>,
Subbaraya Sundeep Bhatta <sbhatta@marvell.com>,
Naveen Mamindlapalli <naveenm@marvell.com>
Subject: Re: [net-next PATCH v2] octeontx2: Add PTP clock driver for Octeon PTM clock.
Date: Mon, 26 Feb 2024 11:00:32 -0600 [thread overview]
Message-ID: <20240226170032.GA202638@bhelgaas> (raw)
In-Reply-To: <BY3PR18MB470764DFFE3E532B8D1851E4A05A2@BY3PR18MB4707.namprd18.prod.outlook.com>
On Mon, Feb 26, 2024 at 03:40:25PM +0000, Sai Krishna Gajula wrote:
> > -----Original Message-----
> > From: Bjorn Helgaas <helgaas@kernel.org>
> > Sent: Wednesday, February 14, 2024 10:59 PM
> > ...
> > On Wed, Feb 14, 2024 at 06:38:53PM +0530, Sai Krishna wrote:
> > > The PCIe PTM(Precision time measurement) protocol provides precise
> > > coordination of events across multiple components like PCIe host
> > > clock, PCIe EP PHC local clocks of PCIe devices. This patch adds
> > > support for ptp clock based PTM clock. We can use this PTP device to
> > > sync the PTM time with CLOCK_REALTIME or other PTP PHC devices using
> > > phc2sys.
> > > +#define PCI_VENDOR_ID_CAVIUM 0x177d
Already defined in pci_ids.h.
> > > +static int __init ptp_oct_ptm_init(void) {
> > > + struct pci_dev *pdev = NULL;
> > > +
> > > + pdev = pci_get_device(PCI_VENDOR_ID_CAVIUM,
> > > + PCI_DEVID_OCTEONTX2_PTP, pdev);
> >
> > pci_get_device() is a sub-optimal method for a driver to claim a device.
> > pci_register_driver() is the preferred method. If you can't use that, a
> > comment here explaining why not would be helpful.
>
> We just want to check the PTP device availability in the system as
> one of the use case is to sync PTM time to PTP.
This doesn't explain why you can't use pci_register_driver(). Can you
clarify that?
> > > + ptm_ctl_addr = ioremap(PEMX_PTM_CTL, 8);
> >
> > Hard-coded register addresses? That can't be right. Shouldn't
> > this be discoverable either as a PCI BAR or via DT or similar
> > firmware interface?
>
> Ack, will explore the DT implementation for register addresses
> access and submit patch V3. Thanks for the review.
I assume the PCI_DEVID_OCTEONTX2_PTP device is a PCIe Endpoint, and
this driver runs on the host? I.e., this driver does not run as
firmware on the Endpoint itself? So if you run lspci on the host, you
would see this device as one of the PCI devices?
If that's the case, a driver would normally operate the device via
MMIO accesses to regions described by PCI BARs. "lspci -v" would show
those addresses.
Bjorn
next prev parent reply other threads:[~2024-02-26 17:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-14 13:08 [net-next PATCH v2] octeontx2: Add PTP clock driver for Octeon PTM clock Sai Krishna
2024-02-14 17:28 ` Bjorn Helgaas
2024-02-26 15:40 ` Sai Krishna Gajula
2024-02-26 17:00 ` Bjorn Helgaas [this message]
2024-02-28 12:37 ` Sai Krishna Gajula
2024-02-28 16:08 ` Bjorn Helgaas
2024-02-29 4:57 ` Sai Krishna Gajula
2024-02-29 15:03 ` Bjorn Helgaas
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=20240226170032.GA202638@bhelgaas \
--to=helgaas@kernel.org \
--cc=bhelgaas@google.com \
--cc=davem@davemloft.net \
--cc=gakula@marvell.com \
--cc=hkelam@marvell.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=lcherian@marvell.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=naveenm@marvell.com \
--cc=netdev@vger.kernel.org \
--cc=richardcochran@gmail.com \
--cc=saikrishnag@marvell.com \
--cc=sbhatta@marvell.com \
--cc=sgoutham@marvell.com \
--cc=vadim.fedorenko@linux.dev \
--cc=vinicius.gomes@intel.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).