Skip to content

Commit

Permalink
Merge tag 'staging-6.10-rc6' of git://git.kernel.org/pub/scm/linux/ke…
Browse files Browse the repository at this point in the history
…rnel/git/gregkh/staging

Pull staging driver fixes from Greg KH:
 "Here are two small staging driver fixes for 6.10-rc6, both for the
  vc04_services drivers:

   - build fix if CONFIG_DEBUGFS was not set

   - initialization check fix that was much reported.

  Both of these have been in linux-next this week with no reported
  issues"

* tag 'staging-6.10-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
  staging: vchiq_debugfs: Fix build if CONFIG_DEBUG_FS is not set
  staging: vc04_services: vchiq_arm: Fix initialisation check
  • Loading branch information
Linus Torvalds committed Jun 30, 2024
2 parents 3e33448 + fcdd7b7 commit 12529aa
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ int vchiq_initialise(struct vchiq_state *state, struct vchiq_instance **instance
* block forever.
*/
for (i = 0; i < VCHIQ_INIT_RETRIES; i++) {
if (state)
if (vchiq_remote_initialised(state))
break;
usleep_range(500, 600);
}
Expand Down Expand Up @@ -1202,7 +1202,7 @@ void vchiq_dump_platform_instances(struct vchiq_state *state, struct seq_file *f
{
int i;

if (!state)
if (!vchiq_remote_initialised(state))
return;

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,11 @@ struct vchiq_state {
struct opaque_platform_state *platform_state;
};

static inline bool vchiq_remote_initialised(const struct vchiq_state *state)
{
return state->remote && state->remote->initialised;
}

struct bulk_waiter {
struct vchiq_bulk *bulk;
struct completion event;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ void vchiq_debugfs_deinit(void)

#else /* CONFIG_DEBUG_FS */

void vchiq_debugfs_init(void)
void vchiq_debugfs_init(struct vchiq_state *state)
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1170,6 +1170,11 @@ static int vchiq_open(struct inode *inode, struct file *file)

dev_dbg(state->dev, "arm: vchiq open\n");

if (!vchiq_remote_initialised(state)) {
dev_dbg(state->dev, "arm: vchiq has no connection to VideoCore\n");
return -ENOTCONN;
}

instance = kzalloc(sizeof(*instance), GFP_KERNEL);
if (!instance)
return -ENOMEM;
Expand Down Expand Up @@ -1200,7 +1205,7 @@ static int vchiq_release(struct inode *inode, struct file *file)

dev_dbg(state->dev, "arm: instance=%p\n", instance);

if (!state) {
if (!vchiq_remote_initialised(state)) {
ret = -EPERM;
goto out;
}
Expand Down

0 comments on commit 12529aa

Please sign in to comment.