mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
nvethernet: Address review comments on HSI changes
Bug 3590939 Change-Id: Id7bf154880a8f566a9807a3c3c7c210766d48c03 Signed-off-by: Sanath Kumar Gampa <sgampa@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2801131 Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2806411 GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com> Tested-by: Revanth Kumar Uppala <ruppala@nvidia.com> Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com> Reviewed-by: Bhadram Varka <vbhadram@nvidia.com> Reviewed-by: Mohan Thadikamalla <mohant@nvidia.com> Reviewed-by: Narayan Reddy <narayanr@nvidia.com> Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
7fc04f1749
commit
6c7d05d9bb
@@ -146,7 +146,7 @@ static irqreturn_t ether_common_isr_thread(int irq, void *data)
|
|||||||
/* Called from ether_hsi_work */
|
/* Called from ether_hsi_work */
|
||||||
if (osi_core->hsi.report_err && irq == 0) {
|
if (osi_core->hsi.report_err && irq == 0) {
|
||||||
osi_core->hsi.report_err = OSI_DISABLE;
|
osi_core->hsi.report_err = OSI_DISABLE;
|
||||||
for (i = 0; i < HSI_MAX_MAC_ERROR_CODE; i++) {
|
for (i = 0; i < OSI_HSI_MAX_MAC_ERROR_CODE; i++) {
|
||||||
if (osi_core->hsi.err_code[i] > 0) {
|
if (osi_core->hsi.err_code[i] > 0) {
|
||||||
error_report.error_code =
|
error_report.error_code =
|
||||||
osi_core->hsi.err_code[i];
|
osi_core->hsi.err_code[i];
|
||||||
@@ -189,7 +189,7 @@ static irqreturn_t ether_common_isr_thread(int irq, void *data)
|
|||||||
|
|
||||||
/* Called from interrupt handler */
|
/* Called from interrupt handler */
|
||||||
if (osi_core->hsi.report_err && irq != 0) {
|
if (osi_core->hsi.report_err && irq != 0) {
|
||||||
for (i = 0; i < HSI_MAX_MAC_ERROR_CODE; i++) {
|
for (i = 0; i < OSI_HSI_MAX_MAC_ERROR_CODE; i++) {
|
||||||
if (osi_core->hsi.err_code[i] > 0 &&
|
if (osi_core->hsi.err_code[i] > 0 &&
|
||||||
osi_core->hsi.report_count_err[i] == OSI_ENABLE) {
|
osi_core->hsi.report_count_err[i] == OSI_ENABLE) {
|
||||||
error_report.error_code =
|
error_report.error_code =
|
||||||
|
|||||||
@@ -519,6 +519,17 @@ static ssize_t hsi_enable_store(struct device *dev,
|
|||||||
} else {
|
} else {
|
||||||
osi_core->hsi.enabled = OSI_ENABLE;
|
osi_core->hsi.enabled = OSI_ENABLE;
|
||||||
dev_info(pdata->dev, "HSI Enabled\n");
|
dev_info(pdata->dev, "HSI Enabled\n");
|
||||||
|
#if (IS_ENABLED(CONFIG_TEGRA_HSIERRRPTINJ))
|
||||||
|
if (osi_core->instance_id == OSI_INSTANCE_ID_EQOS)
|
||||||
|
inst_id = 0;
|
||||||
|
|
||||||
|
ret = hsierrrpt_reg_cb(ip_type[osi_core->mac], inst_id,
|
||||||
|
hsi_inject_err_fsi, pdata);
|
||||||
|
if (ret != 0) {
|
||||||
|
dev_err(pdata->dev, "Err inj callback registration failed: %d",
|
||||||
|
ret);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
} else if (strncmp(buf, "disable", 7) == OSI_NONE) {
|
} else if (strncmp(buf, "disable", 7) == OSI_NONE) {
|
||||||
ioctl_data.arg1_u32 = OSI_DISABLE;
|
ioctl_data.arg1_u32 = OSI_DISABLE;
|
||||||
@@ -529,6 +540,16 @@ static ssize_t hsi_enable_store(struct device *dev,
|
|||||||
} else {
|
} else {
|
||||||
osi_core->hsi.enabled = OSI_DISABLE;
|
osi_core->hsi.enabled = OSI_DISABLE;
|
||||||
dev_info(pdata->dev, "HSI Disabled\n");
|
dev_info(pdata->dev, "HSI Disabled\n");
|
||||||
|
#if (IS_ENABLED(CONFIG_TEGRA_HSIERRRPTINJ))
|
||||||
|
if (osi_core->instance_id == OSI_INSTANCE_ID_EQOS)
|
||||||
|
inst_id = 0;
|
||||||
|
|
||||||
|
ret = hsierrrpt_dereg_cb(ip_type[osi_core->mac], inst_id);
|
||||||
|
if (ret != 0) {
|
||||||
|
dev_err(pdata->dev, "Err inj callback deregistration failed: %d",
|
||||||
|
ret);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
dev_err(pdata->dev,
|
dev_err(pdata->dev,
|
||||||
@@ -3278,6 +3299,20 @@ int ether_sysfs_register(struct ether_priv_data *pdata)
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if (IS_ENABLED(CONFIG_TEGRA_HSIERRRPTINJ)) && defined(HSI_SUPPORT)
|
||||||
|
if (osi_core->use_virtualization == OSI_ENABLE) {
|
||||||
|
if (osi_core->instance_id == OSI_INSTANCE_ID_EQOS)
|
||||||
|
inst_id = 0;
|
||||||
|
ret = hsierrrpt_reg_cb(ip_type[osi_core->mac], inst_id,
|
||||||
|
hsi_inject_err_fsi, pdata);
|
||||||
|
if (ret != 0) {
|
||||||
|
dev_err(pdata->dev, "Err inj callback registration failed: %d",
|
||||||
|
ret);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
/* Create nvethernet sysfs group under /sys/devices/<ether_device>/ */
|
/* Create nvethernet sysfs group under /sys/devices/<ether_device>/ */
|
||||||
return sysfs_create_group(&dev->kobj, ðer_attribute_group);
|
return sysfs_create_group(&dev->kobj, ðer_attribute_group);
|
||||||
}
|
}
|
||||||
@@ -3288,6 +3323,18 @@ void ether_sysfs_unregister(struct ether_priv_data *pdata)
|
|||||||
|
|
||||||
#ifdef CONFIG_DEBUG_FS
|
#ifdef CONFIG_DEBUG_FS
|
||||||
ether_remove_debugfs(pdata);
|
ether_remove_debugfs(pdata);
|
||||||
|
#endif
|
||||||
|
#if (IS_ENABLED(CONFIG_TEGRA_HSIERRRPTINJ)) && defined(HSI_SUPPORT)
|
||||||
|
if (osi_core->use_virtualization == OSI_ENABLE) {
|
||||||
|
if (osi_core->instance_id == OSI_INSTANCE_ID_EQOS)
|
||||||
|
inst_id = 0;
|
||||||
|
|
||||||
|
ret = hsierrrpt_dereg_cb(ip_type[osi_core->mac], inst_id);
|
||||||
|
if (ret != 0) {
|
||||||
|
dev_err(pdata->dev, "Err inj callback deregistration failed: %d",
|
||||||
|
ret);
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
/* Remove nvethernet sysfs group under /sys/devices/<ether_device>/ */
|
/* Remove nvethernet sysfs group under /sys/devices/<ether_device>/ */
|
||||||
sysfs_remove_group(&dev->kobj, ðer_attribute_group);
|
sysfs_remove_group(&dev->kobj, ðer_attribute_group);
|
||||||
|
|||||||
Reference in New Issue
Block a user