mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-24 10:11:26 +03:00
drivers:nvpps:print warn msg in GETEVENT ioctl call
print ptp not running warning msg from NVPPS_GETEVENT ioctl call Existing print msg was coming even before boot completes and hence was printing always. Relocate these warn msgs to print once when NVPPS_GETEVENT ioctl is called Jira ESDP-20108 Change-Id: I41ea5133e3f7d3525e3529fd09058225661d66bb Signed-off-by: Sheetal Tigadoli <stigadoli@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2915293 (cherry picked from commit 1ad9baad22516e8bc83116c8fc9d22b59c000d6a) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2936977 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com> Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
789890bd3e
commit
1a3543c91c
@@ -42,6 +42,8 @@ static DEFINE_MUTEX(s_nvpps_lock);
|
||||
static DEFINE_IDR(s_nvpps_idr);
|
||||
|
||||
static char *interface_name = "eth0";
|
||||
bool print_pri_ptp_failed = true;
|
||||
bool print_sec_ptp_failed = true;
|
||||
|
||||
|
||||
/* platform device instance data */
|
||||
@@ -279,15 +281,10 @@ static void nvpps_get_ts(struct nvpps_device_data *pdev_data, bool in_isr)
|
||||
} else {
|
||||
/* get PTP_TSC concurrent timestamp(using ptp notifier) from MAC driver */
|
||||
if (tegra_get_hwtime(pdev_data->iface_nm, &ptp_tsc_ts, PTP_TSC_HWTIME)) {
|
||||
/* check flag to print ptp failure msg */
|
||||
if (!pdev_data->pri_ptp_failed) {
|
||||
dev_warn_ratelimited(pdev_data->dev,
|
||||
"failed to get PTP_TSC concurrent timestamp from interface(%s)\nMake sure ptp is running\n",
|
||||
pdev_data->iface_nm);
|
||||
pdev_data->pri_ptp_failed = true;
|
||||
}
|
||||
pdev_data->pri_ptp_failed = true;
|
||||
} else {
|
||||
pdev_data->pri_ptp_failed = false;
|
||||
print_pri_ptp_failed = true;
|
||||
phc = ptp_tsc_ts.ptp_ts;
|
||||
tsc = ptp_tsc_ts.tsc_ts / pdev_data->tsc_res_ns;
|
||||
}
|
||||
@@ -301,15 +298,10 @@ static void nvpps_get_ts(struct nvpps_device_data *pdev_data, bool in_isr)
|
||||
* driver for secondary interface
|
||||
*/
|
||||
if (tegra_get_hwtime(pdev_data->sec_iface_nm, &sec_ptp_tsc_ts, PTP_TSC_HWTIME)) {
|
||||
/* check flag to print ptp failure msg */
|
||||
if (!pdev_data->sec_ptp_failed) {
|
||||
dev_warn_ratelimited(pdev_data->dev,
|
||||
"failed to get PTP_TSC concurrent timestamp for secondary interface(%s)\nMake sure ptp is running\n",
|
||||
pdev_data->sec_iface_nm);
|
||||
pdev_data->sec_ptp_failed = true;
|
||||
}
|
||||
pdev_data->sec_ptp_failed = true;
|
||||
} else {
|
||||
pdev_data->sec_ptp_failed = false;
|
||||
print_sec_ptp_failed = true;
|
||||
|
||||
/* Adjust secondary iface's PTP TS to primary iface's concurrent PTP_TSC TS */
|
||||
secondary_phc = sec_ptp_tsc_ts.ptp_ts - (sec_ptp_tsc_ts.tsc_ts - ptp_tsc_ts.tsc_ts);
|
||||
@@ -604,6 +596,22 @@ static long nvpps_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||
|
||||
dev_dbg(pdev_data->dev, "NVPPS_GETEVENT\n");
|
||||
|
||||
/* check flag to print ptp failure msg */
|
||||
if ((pdev_data->pri_ptp_failed) && (print_pri_ptp_failed)) {
|
||||
dev_warn_ratelimited(pdev_data->dev,
|
||||
"failed to get PTP_TSC concurrent timestamp from interface(%s)\nMake sure ptp is running\n",
|
||||
pdev_data->iface_nm);
|
||||
print_pri_ptp_failed = false;
|
||||
}
|
||||
|
||||
/* check flag to print ptp failure msg */
|
||||
if ((pdev_data->sec_ptp_failed) && (print_sec_ptp_failed)) {
|
||||
dev_warn_ratelimited(pdev_data->dev,
|
||||
"failed to get PTP_TSC concurrent timestamp from interface(%s)\nMake sure ptp is running\n",
|
||||
pdev_data->iface_nm);
|
||||
print_sec_ptp_failed = false;
|
||||
}
|
||||
|
||||
/* Return the fetched timestamp */
|
||||
raw_spin_lock_irqsave(&pdev_data->lock, flags);
|
||||
pfile_data->pps_event_id_rd = pdev_data->pps_event_id;
|
||||
|
||||
Reference in New Issue
Block a user