From: Oded Gabbay <oded.gabbay@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: gregkh@linuxfoundation.org, Tomer Tayar <ttayar@habana.ai>
Subject: [PATCH 09/15] habanalabs: Remove unneeded function pointers
Date: Sun, 17 Mar 2019 21:59:21 +0200 [thread overview]
Message-ID: <20190317195927.26238-10-oded.gabbay@gmail.com> (raw)
In-Reply-To: <20190317195927.26238-1-oded.gabbay@gmail.com>
From: Tomer Tayar <ttayar@habana.ai>
Remove pointers to ASIC-specific functions and instead call the functions
explicitly as they are not accessed from outside the ASIC-specific files.
Signed-off-by: Tomer Tayar <ttayar@habana.ai>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
---
drivers/misc/habanalabs/goya/goya.c | 12 +++---------
drivers/misc/habanalabs/goya/goyaP.h | 4 +---
2 files changed, 4 insertions(+), 12 deletions(-)
diff --git a/drivers/misc/habanalabs/goya/goya.c b/drivers/misc/habanalabs/goya/goya.c
index 7e98383ec774..466464c026e0 100644
--- a/drivers/misc/habanalabs/goya/goya.c
+++ b/drivers/misc/habanalabs/goya/goya.c
@@ -299,7 +299,6 @@ static u32 goya_all_events[] = {
GOYA_ASYNC_EVENT_ID_DMA_BM_CH4
};
-static int goya_armcp_info_get(struct hl_device *hdev);
static void goya_mmu_prepare(struct hl_device *hdev, u32 asid);
static int goya_mmu_clear_pgt_range(struct hl_device *hdev);
static int goya_mmu_set_dram_default_page(struct hl_device *hdev);
@@ -539,10 +538,9 @@ static void goya_fetch_psoc_frequency(struct hl_device *hdev)
static int goya_late_init(struct hl_device *hdev)
{
struct asic_fixed_properties *prop = &hdev->asic_prop;
- struct goya_device *goya = hdev->asic_specific;
int rc;
- rc = goya->armcp_info_get(hdev);
+ rc = goya_armcp_info_get(hdev);
if (rc) {
dev_err(hdev->dev, "Failed to get armcp info\n");
return rc;
@@ -629,9 +627,6 @@ static int goya_sw_init(struct hl_device *hdev)
if (!goya)
return -ENOMEM;
- goya->test_cpu_queue = goya_test_cpu_queue;
- goya->armcp_info_get = goya_armcp_info_get;
-
/* according to goya_init_iatu */
goya->ddr_bar_cur_addr = DRAM_PHYS_BASE;
@@ -2969,7 +2964,6 @@ int goya_test_cpu_queue(struct hl_device *hdev)
static int goya_test_queues(struct hl_device *hdev)
{
- struct goya_device *goya = hdev->asic_specific;
int i, rc, ret_val = 0;
for (i = 0 ; i < NUMBER_OF_EXT_HW_QUEUES ; i++) {
@@ -2979,7 +2973,7 @@ static int goya_test_queues(struct hl_device *hdev)
}
if (hdev->cpu_queues_enable) {
- rc = goya->test_cpu_queue(hdev);
+ rc = goya_test_cpu_queue(hdev);
if (rc)
ret_val = -EINVAL;
}
@@ -4657,7 +4651,7 @@ int goya_send_heartbeat(struct hl_device *hdev)
return hl_fw_send_heartbeat(hdev);
}
-static int goya_armcp_info_get(struct hl_device *hdev)
+int goya_armcp_info_get(struct hl_device *hdev)
{
struct goya_device *goya = hdev->asic_specific;
struct asic_fixed_properties *prop = &hdev->asic_prop;
diff --git a/drivers/misc/habanalabs/goya/goyaP.h b/drivers/misc/habanalabs/goya/goyaP.h
index ae5e41bc8f7f..b99d92f197eb 100644
--- a/drivers/misc/habanalabs/goya/goyaP.h
+++ b/drivers/misc/habanalabs/goya/goyaP.h
@@ -143,9 +143,6 @@ enum goya_fw_component {
};
struct goya_device {
- int (*test_cpu_queue)(struct hl_device *hdev);
- int (*armcp_info_get)(struct hl_device *hdev);
-
/* TODO: remove hw_queues_lock after moving to scheduler code */
spinlock_t hw_queues_lock;
@@ -176,6 +173,7 @@ void goya_debugfs_led_set(struct hl_device *hdev, u8 led, u8 state);
void goya_set_pll_profile(struct hl_device *hdev, enum hl_pll_frequency freq);
void goya_add_device_attr(struct hl_device *hdev,
struct attribute_group *dev_attr_grp);
+int goya_armcp_info_get(struct hl_device *hdev);
void goya_init_security(struct hl_device *hdev);
u64 goya_get_max_power(struct hl_device *hdev);
void goya_set_max_power(struct hl_device *hdev, u64 value);
--
2.17.1
next prev parent reply other threads:[~2019-03-17 19:59 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-17 19:59 [PATCH 00/15] habanalabs: various improvements and updates Oded Gabbay
2019-03-17 19:59 ` [PATCH 01/15] habanalabs: add new device CPU boot status Oded Gabbay
2019-03-17 19:59 ` [PATCH 02/15] habanalabs: rename goya_non_fatal_events array to all events Oded Gabbay
2019-03-17 19:59 ` [PATCH 03/15] habanalabs: remove implicit include from header files Oded Gabbay
2019-03-17 19:59 ` [PATCH 04/15] habanalabs: Move device CPU code into common file Oded Gabbay
2019-03-17 19:59 ` [PATCH 05/15] habanalabs: use EQ MSI/X ID per chip Oded Gabbay
2019-03-17 19:59 ` [PATCH 06/15] habanalabs: remove unused defines Oded Gabbay
2019-03-17 19:59 ` [PATCH 07/15] habanalabs: ratelimit warnings at start of IOCTLs Oded Gabbay
2019-03-17 19:59 ` [PATCH 08/15] habanalabs: Move PCI code into common file Oded Gabbay
2019-03-17 19:59 ` Oded Gabbay [this message]
2019-03-17 19:59 ` [PATCH 10/15] uapi/habanalabs: add some comments in habanalabs.h Oded Gabbay
2019-03-17 19:59 ` [PATCH 11/15] habanalabs: Add a printout with the name of a busy engine Oded Gabbay
2019-03-17 19:59 ` [PATCH 12/15] habanalabs: Allow accessing DRAM virtual addresses via debugfs Oded Gabbay
2019-03-17 19:59 ` [PATCH 13/15] habanalabs: add MMU shadow mapping Oded Gabbay
2019-03-17 19:59 ` [PATCH 14/15] habanalabs: keep track of the device's dma mask Oded Gabbay
2019-03-17 19:59 ` [PATCH 15/15] habanalabs: never fail hard reset of device Oded Gabbay
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=20190317195927.26238-10-oded.gabbay@gmail.com \
--to=oded.gabbay@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ttayar@habana.ai \
/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).