Commit 621ba7ad authored by Bartosz Golaszewski's avatar Bartosz Golaszewski Committed by Jakub Kicinski

net: stmmac: replace the int_snapshot_en field with a flag

Drop the boolean field of the plat_stmmacenet_data structure in favor of a
simple bitfield flag.
Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: default avatarAndrew Halaney <ahalaney@redhat.com>
Link: https://lore.kernel.org/r/20230710090001.303225-11-brgl@bgdev.plReviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent aa5513f5
...@@ -329,7 +329,7 @@ static int intel_crosststamp(ktime_t *device, ...@@ -329,7 +329,7 @@ static int intel_crosststamp(ktime_t *device,
if (priv->plat->flags & STMMAC_FLAG_EXT_SNAPSHOT_EN) if (priv->plat->flags & STMMAC_FLAG_EXT_SNAPSHOT_EN)
return -EBUSY; return -EBUSY;
priv->plat->int_snapshot_en = 1; priv->plat->flags |= STMMAC_FLAG_INT_SNAPSHOT_EN;
mutex_lock(&priv->aux_ts_lock); mutex_lock(&priv->aux_ts_lock);
/* Enable Internal snapshot trigger */ /* Enable Internal snapshot trigger */
...@@ -350,7 +350,7 @@ static int intel_crosststamp(ktime_t *device, ...@@ -350,7 +350,7 @@ static int intel_crosststamp(ktime_t *device,
break; break;
default: default:
mutex_unlock(&priv->aux_ts_lock); mutex_unlock(&priv->aux_ts_lock);
priv->plat->int_snapshot_en = 0; priv->plat->flags &= ~STMMAC_FLAG_INT_SNAPSHOT_EN;
return -EINVAL; return -EINVAL;
} }
writel(acr_value, ptpaddr + PTP_ACR); writel(acr_value, ptpaddr + PTP_ACR);
...@@ -376,7 +376,7 @@ static int intel_crosststamp(ktime_t *device, ...@@ -376,7 +376,7 @@ static int intel_crosststamp(ktime_t *device,
if (!wait_event_interruptible_timeout(priv->tstamp_busy_wait, if (!wait_event_interruptible_timeout(priv->tstamp_busy_wait,
stmmac_cross_ts_isr(priv), stmmac_cross_ts_isr(priv),
HZ / 100)) { HZ / 100)) {
priv->plat->int_snapshot_en = 0; priv->plat->flags &= ~STMMAC_FLAG_INT_SNAPSHOT_EN;
return -ETIMEDOUT; return -ETIMEDOUT;
} }
...@@ -395,7 +395,7 @@ static int intel_crosststamp(ktime_t *device, ...@@ -395,7 +395,7 @@ static int intel_crosststamp(ktime_t *device,
} }
system->cycles *= intel_priv->crossts_adj; system->cycles *= intel_priv->crossts_adj;
priv->plat->int_snapshot_en = 0; priv->plat->flags &= ~STMMAC_FLAG_INT_SNAPSHOT_EN;
return 0; return 0;
} }
...@@ -609,7 +609,7 @@ static int intel_mgbe_common_data(struct pci_dev *pdev, ...@@ -609,7 +609,7 @@ static int intel_mgbe_common_data(struct pci_dev *pdev,
plat->ext_snapshot_num = AUX_SNAPSHOT0; plat->ext_snapshot_num = AUX_SNAPSHOT0;
plat->crosststamp = intel_crosststamp; plat->crosststamp = intel_crosststamp;
plat->int_snapshot_en = 0; plat->flags &= ~STMMAC_FLAG_INT_SNAPSHOT_EN;
/* Setup MSI vector offset specific to Intel mGbE controller */ /* Setup MSI vector offset specific to Intel mGbE controller */
plat->msi_mac_vec = 29; plat->msi_mac_vec = 29;
......
...@@ -180,7 +180,7 @@ static void timestamp_interrupt(struct stmmac_priv *priv) ...@@ -180,7 +180,7 @@ static void timestamp_interrupt(struct stmmac_priv *priv)
u64 ptp_time; u64 ptp_time;
int i; int i;
if (priv->plat->int_snapshot_en) { if (priv->plat->flags & STMMAC_FLAG_INT_SNAPSHOT_EN) {
wake_up(&priv->tstamp_busy_wait); wake_up(&priv->tstamp_busy_wait);
return; return;
} }
......
...@@ -213,6 +213,7 @@ struct dwmac4_addrs { ...@@ -213,6 +213,7 @@ struct dwmac4_addrs {
#define STMMAC_FLAG_VLAN_FAIL_Q_EN BIT(6) #define STMMAC_FLAG_VLAN_FAIL_Q_EN BIT(6)
#define STMMAC_FLAG_MULTI_MSI_EN BIT(7) #define STMMAC_FLAG_MULTI_MSI_EN BIT(7)
#define STMMAC_FLAG_EXT_SNAPSHOT_EN BIT(8) #define STMMAC_FLAG_EXT_SNAPSHOT_EN BIT(8)
#define STMMAC_FLAG_INT_SNAPSHOT_EN BIT(9)
struct plat_stmmacenet_data { struct plat_stmmacenet_data {
int bus_id; int bus_id;
...@@ -286,7 +287,6 @@ struct plat_stmmacenet_data { ...@@ -286,7 +287,6 @@ struct plat_stmmacenet_data {
struct pci_dev *pdev; struct pci_dev *pdev;
int int_snapshot_num; int int_snapshot_num;
int ext_snapshot_num; int ext_snapshot_num;
bool int_snapshot_en;
int msi_mac_vec; int msi_mac_vec;
int msi_wol_vec; int msi_wol_vec;
int msi_lpi_vec; int msi_lpi_vec;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment