Page MenuHomeFreeBSD

LKPI updates for drm-v4.18
AbandonedPublic

Authored by hselasky on Nov 19 2018, 2:11 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 9, 10:57 PM
Unknown Object (File)
Tue, Nov 5, 7:25 PM
Unknown Object (File)
Tue, Nov 5, 4:24 AM
Unknown Object (File)
Fri, Oct 25, 4:18 PM
Unknown Object (File)
Oct 5 2024, 1:17 PM
Unknown Object (File)
Sep 24 2024, 9:25 AM
Unknown Object (File)
Sep 18 2024, 5:23 PM
Unknown Object (File)
Sep 12 2024, 6:56 PM

Details

Summary

Minor additions to the LKPI needed for drm-v4.17

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 21153

Event Timeline

sys/compat/linuxkpi/common/include/linux/sched.h
185

Remove this comment

This function is not portable because applications use sizeof(task->comm) to computer the buffer length which is sizeof(void *) in FreeBSD instead of TASK_COMM_LEN !!

I suggest the following implementation:

static inline const char *
get_task_comm(char *buf, struct task_struct *task)
{

        buf[0] = 0; /* buffer is too small */
        return (task->comm);
}
mmacy retitled this revision from LKPI updates for drm-v4.17 to LKPI updates for drm-v4.18.
  • respond to feedback
  • further changes for 4.18
sys/compat/linuxkpi/common/include/linux/hardirq.h
41

I think something like this might almost do the right thing:

void
_intr_drain_filter(int irq)
{
        struct intr_event *ie;
        struct intr_thread *ithd;
        struct thread *td;

        ie = intr_lookup(irq);
        if (ie == NULL)
                return;
        if (ie->filter == NULL)
                return;

        mtx_lock(&ie->ie_lock);
        phase = ie->ie_phase;
        intr_event_barrier(ie);
        atomic_store_rel_int(&ie->ie_phase, phase);
        mtx_unlock(&ie->ie_lock);

        return;
}
sys/compat/linuxkpi/common/include/linux/kernel.h
133

Would probably be good to add this to param.h

sys/compat/linuxkpi/common/include/linux/ktime.h
179

It doesn't seem like timespec64 will be something else any time soon.

return (timespec_to_ns(ts));

?

sys/compat/linuxkpi/common/include/linux/random.h
51

get_random_int already does this. Maybe just

#define get_random_u32 get_random_int

?

sys/compat/linuxkpi/common/include/linux/fs.h
325

Please don't use C99 comments. use /* */ instead or remove this comment.

From what I know i_private maps to v_data, but I doubt anyone is setting that, especially for open. You could check who is using it. Keeping the code as is doesn't harm. Try to use BSD style: return (0);

Is this patch still relevant?

No, it can be abandoned (but I don't have permission to do it myself)

hselasky abandoned this revision.
hselasky edited reviewers, added: mmacy; removed: hselasky.

Already committed or no longer applicable.