Page MenuHomeFreeBSD

LKPI updates for drm-v4.18
AbandonedPublic

Authored by hselasky on Nov 19 2018, 2:11 AM.
Tags
None
Referenced Files
F81616798: D18041.id.diff
Fri, Apr 19, 1:01 AM
Unknown Object (File)
Mar 19 2024, 7:54 AM
Unknown Object (File)
Jan 29 2024, 2:56 PM
Unknown Object (File)
Dec 23 2023, 11:03 AM
Unknown Object (File)
Dec 18 2023, 7:02 PM
Unknown Object (File)
Nov 21 2023, 12:37 AM
Unknown Object (File)
Oct 27 2023, 6:17 PM
Unknown Object (File)
Oct 25 2023, 1:03 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 20885

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 ↗(On Diff #50901)

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 ↗(On Diff #50901)

Would probably be good to add this to param.h

sys/compat/linuxkpi/common/include/linux/ktime.h
179 ↗(On Diff #50901)

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 ↗(On Diff #50901)

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.