]> www.infradead.org Git - users/jedix/linux-maple.git/commit
i40e: use a mutex instead of spinlock in PTP user entry points
authorJacob Keller <jacob.e.keller@intel.com>
Wed, 5 Oct 2016 16:30:43 +0000 (09:30 -0700)
committerDhaval Giani <dhaval.giani@oracle.com>
Wed, 8 Mar 2017 00:40:51 +0000 (19:40 -0500)
commite46d5425469a99aed96d0874852cbf69f6098cae
tree9e5f9c42561376bb08a80035b567c5d2e6f223b5
parent877bde5c946b6c7abc226d48b82b05a9fbb65913
i40e: use a mutex instead of spinlock in PTP user entry points

Orabug: 24568124

We need a locking mechanism to protect the hardware SYSTIME register
which is split over 2 values, and has internal hardware latching. We
can't allow multiple accesses at the same time. However....

The spinlock_t is overkill here, especially use of spin_lock_irqsave,
since every PTP access will halt hardirqs. Notice that the only places
which need the SYSTIME value are user context and are capable of sleeping.
Thus, it is safe to use a mutex here instead of the spinlock.

Change-ID: I971761a89b58c6aad953590162e85a327fbba232
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 195512629c956286265dcfeeea2028c42ee0c483)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
drivers/net/ethernet/intel/i40e/i40e.h
drivers/net/ethernet/intel/i40e/i40e_ptp.c