Page MenuHomeFreeBSD

Contributor Reviews (base)Project
ActivePublic

Recent Activity

Oct 7 2019

wulf added a comment to D16698: First draft HID over I2C support (Mouse only).

Thanks for the remarks. I'd suggest to stop riding a dead horse and make the switch altogether.

This driver still has some advantages over mine. It supports 12.0-release, sysmouse(8) protocol and it does not require ig4 patching. So, I would prefer it for non-HID trackpads like some Synaptics models. Al least for now.

Oct 7 2019, 7:11 PM · Contributor Reviews (base)
marc.priggemeyer_gmail.com added a comment to D16698: First draft HID over I2C support (Mouse only).

Thanks for the remarks. I'd suggest to stop riding a dead horse and make the switch altogether. It has been pointed out previously that the separation of ACPI and HID over I2C code like it was done here, especially the interrupt handling, was ill-conceived.
Abstraction of HID code was initially considered, but not implemented on my part. Since wulf has already done these things and even has the multitouch part working, switching over is the most sensible thing. This code here was intended to be a first draft and has served its purpose.

Oct 7 2019, 6:16 PM · Contributor Reviews (base)
imp added a comment to D16698: First draft HID over I2C support (Mouse only).
In D16698#478767, @imp wrote:

So with the suggested changes, I'm not able to get very far with the patches in this review. With wulf's code I'm able to get the device probed. With this code, I see the following

Is this code still really considered? wulf's repo is currently actively developed (now even includes the long-awaited and very necessary "HID bus" abstraction), this was last updated in August.
data point: I'm using wulf's code on my Pixelbook, multi-touch works great for both the touchpad and touchscreen.

Oct 7 2019, 5:26 PM · Contributor Reviews (base)
greg_unrelenting.technology added a comment to D16698: First draft HID over I2C support (Mouse only).
In D16698#478767, @imp wrote:

So with the suggested changes, I'm not able to get very far with the patches in this review. With wulf's code I'm able to get the device probed. With this code, I see the following

Oct 7 2019, 2:05 PM · Contributor Reviews (base)
imp added a comment to D16698: First draft HID over I2C support (Mouse only).

So with the suggested changes, I'm not able to get very far with the patches in this review. With wulf's code I'm able to get the device probed. With this code, I see the following:

Oct 7 2019, 1:12 AM · Contributor Reviews (base)
imp added inline comments to D16698: First draft HID over I2C support (Mouse only).
Oct 7 2019, 1:08 AM · Contributor Reviews (base)

Sep 29 2019

rozhuk.im-gmail.com added a comment to D16698: First draft HID over I2C support (Mouse only).

kernel trap 22 with interrupts disabled
panic: spin locks can only use msleep_spin
cpuid = 7 time = 1569790352
KDB: stack backtrace:
#0 0xffffffff805da3fd at kdb_backtrace+0x6d
#1 0xffffffff80594fed at vpanic+0x19d
#2 0xffffffff80594e43 at panic+0x43
#3 0xffffffff8057df32 at unlock_spin+0x12
#4 0xffffffff8053f577 at _cv_wait_sig+0x127
#5 0xffffffff81d1dace at iichid_read+0x8e
#6 0xffffffff804b690a at devfs_read_f+0xda
#7 0xffffffff805f4752 at kern_readv+0x92
#8 0xffffffff805f46b4 at sys_read+0x84
#9 0xffffffff808451d8 at amd64_syscall+0x218
#10 0xffffffff80821270 at fast_syscall_common+0x101

Sep 29 2019, 9:08 PM · Contributor Reviews (base)
wulf added inline comments to D16698: First draft HID over I2C support (Mouse only).
Sep 29 2019, 9:45 AM · Contributor Reviews (base)
wulf added inline comments to D16698: First draft HID over I2C support (Mouse only).
Sep 29 2019, 9:26 AM · Contributor Reviews (base)
wulf added inline comments to D16698: First draft HID over I2C support (Mouse only).
Sep 29 2019, 9:09 AM · Contributor Reviews (base)
rozhuk.im-gmail.com added a comment to D16698: First draft HID over I2C support (Mouse only).

Panic on kldload acpi_iichid in iichid_read()->cv_wait_sig().
FreeBSD 12.1 amd64 @ Asus 505z

Sep 29 2019, 5:04 AM · Contributor Reviews (base)

Aug 25 2019

imp added a comment to D16698: First draft HID over I2C support (Mouse only).

I built this on -current and got an insta-panic when trying to lock a null spin lock in attach...

Aug 25 2019, 5:56 AM · Contributor Reviews (base)
imp added inline comments to D16698: First draft HID over I2C support (Mouse only).
Aug 25 2019, 5:52 AM · Contributor Reviews (base)

Aug 23 2019

wulf added a comment to D16698: First draft HID over I2C support (Mouse only).
In D16698#464917, @imp wrote:

We really have three problems that we need to solve:
(1) iichid
(2) how to get the acpi stuff to automatically add iichid devices

iichid device is a child of acpi bus also, so it can be rephrased as "how to get the acpi stuff to automatically add acpi device with given CID"

(3) How to cope with resume and resets not being quite right for the ig4.

It is not clear which reset is mentioned:

  1. IG4 controller reset (set designware specific parameters like timing counters and so on)
  2. iicbus reset - FIFO flushing, setting of symbol speed and slave address
  3. I2C hid device reset - performed with special I2C command

If it is mentioned in context of @johalun suspend/resume patch, then most probably it misses iicbus reset as it is performed by ig4 driver in a lazy way at a start of next xfer. sc->slave_valid bool variable should be reset to trigger it and I do not see that in @johalun resume method.

Would we make better progress with we split those three issues up into their own reviews?

Aug 23 2019, 1:01 AM · Contributor Reviews (base)

Aug 22 2019

imp added a comment to D16698: First draft HID over I2C support (Mouse only).
In D16698#461247, @wulf wrote:

Hi @marc.priggemeyer_gmail.com,
I wrote iicbus(4) extension which performs ACPI-based enumeration of I2C devices connected to a controller. It is not limited to HID devices and fires at iicbus attach stage.
The extension walks through ACPI children of I2C controller and for each device found it:

  1. Creates iicbus child device
  2. Adds I2C address to ivars
  3. Adds ACPI-handle to iicbus-child ivars, so you can evaluate acpi_get_handle(dev); on iicbus child
  4. Copies all newbus resources from corresponding ACPIbus-hosted device to I2Cbus-hosted one.

It effectively makes a copy of existing ACPI device on top of I2C bus.
It should also fix ig4 bug that brokes allocation of interrupts on ig4 children (Only partially tested yet, I have access only to GPIO devices now)
I think using of this extension should eliminate nasty ACPI<->I2C devices interaction that is found in the patch from current review.
iicbus(4) extension support in my driver (for reference): https://github.com/wulf7/iichid/commit/6f5c3d3eb008848ab9d18e1dcf8fd35ca80e517e
Patch could be found here: https://people.freebsd.org/~wulf/acpi_iicbus.patch

Aug 22 2019, 7:06 PM · Contributor Reviews (base)

Aug 12 2019

wulf added a comment to D16698: First draft HID over I2C support (Mouse only).

I wrote iicbus(4) extension which performs ACPI-based enumeration of I2C devices connected to a controller. It is not limited to HID devices and fires at iicbus attach stage.

Aug 12 2019, 12:15 AM · Contributor Reviews (base)

Jul 29 2019

nikola.lecic_anthesphoria.net added a comment to D16698: First draft HID over I2C support (Mouse only).
In D16698#457967, @wulf wrote:

Could you send me your DSDT table with email? It is too big to be posted here. It can be obtained with

# acpidump -dt

Sure, done.

Jul 29 2019, 1:46 PM · Contributor Reviews (base)
wulf added a comment to D16698: First draft HID over I2C support (Mouse only).

However, loading iichid.ko doesn't go well:

Jul 29 03:00:32 thorium kernel: acpi_iichid0: <HID over I2C (ACPI)> on acpi0
Jul 29 03:00:32 thorium kernel: imt0:   ACPI Hardware ID  : ELAN1200
Jul 29 03:00:32 thorium kernel: imt0:   IICbus addr       : 0x15
Jul 29 03:00:32 thorium kernel: imt0:   HID descriptor reg: 0x01
Jul 29 03:00:32 thorium kernel: imt0: could not retrieve HID descriptor from the device: 3
Jul 29 2019, 1:20 PM · Contributor Reviews (base)
nikola.lecic_anthesphoria.net added a comment to D16698: First draft HID over I2C support (Mouse only).

try to replace 'IG4_CTL_SPEED_STD' string in /usr/src/sys/dev/ichiic/ig4_iic.c file with digit '6' than rebuild and reload ig4.ko .

Jul 29 2019, 1:04 AM · Contributor Reviews (base)
wulf added a comment to D16698: First draft HID over I2C support (Mouse only).
In D16698#457883, @wulf wrote:

Yes, it still prints.

Ok. than uncomment pair of debugging printfs in iichid_event_task(). They lie several lines below iichid_intr() sub.
If you get one line with hex data per "something", post it here

If you mean these lines:

device_printf(sc->dev, "no data received\n");

and

DPRINTF(sc, "%*D\n", actual, sc->ibuf, " ");

then I get just this (a single touch):

Jul 29 02:01:08 thorium kernel: something
Jul 29 02:01:08 thorium syslogd: last message repeated 2 times
Jul 29 02:01:08 thorium kernel: imt0: no data received
Jul 29 02:01:08 thorium kernel: something
Jul 29 02:01:08 thorium syslogd: last message repeated 4 times
Jul 29 02:01:08 thorium kernel: imt0: no data received
Jul 29 02:01:08 thorium syslogd: last message repeated 1 times
Jul 29 02:01:08 thorium kernel: something
Jul 29 02:01:08 thorium syslogd: last message repeated 3 times
Jul 29 02:01:08 thorium kernel: imt0: no data received
Jul 29 02:01:08 thorium kernel: something
Jul 29 02:01:08 thorium syslogd: last message repeated 2 times
Jul 29 02:01:08 thorium kernel: imt0: no data received
Jul 29 02:01:08 thorium syslogd: last message repeated 1 times
Jul 29 02:01:08 thorium kernel: something
Jul 29 02:01:08 thorium syslogd: last message repeated 5 times
Jul 29 02:01:08 thorium kernel: imt0: no data received
Jul 29 02:01:08 thorium kernel: something
Jul 29 02:01:08 thorium syslogd: last message repeated 3 times
Jul 29 02:01:08 thorium kernel: imt0: no data received
Jul 29 2019, 12:16 AM · Contributor Reviews (base)
nikola.lecic_anthesphoria.net added a comment to D16698: First draft HID over I2C support (Mouse only).
In D16698#457883, @wulf wrote:

Yes, it still prints.

Ok. than uncomment pair of debugging printfs in iichid_event_task(). They lie several lines below iichid_intr() sub.
If you get one line with hex data per "something", post it here

Jul 29 2019, 12:03 AM · Contributor Reviews (base)

Jul 28 2019

wulf added a comment to D16698: First draft HID over I2C support (Mouse only).

Yes, it still prints.

Jul 28 2019, 11:30 PM · Contributor Reviews (base)
nikola.lecic_anthesphoria.net added a comment to D16698: First draft HID over I2C support (Mouse only).
In D16698#457878, @wulf wrote:
In D16698#457872, @wulf wrote:
In D16698#457847, @wulf wrote:

then comment out imt_set_input_mode() call in imt_attach() subroutine (imt.c) and insert printf("something\n"); into iichid_intr() sub (iichid.c)
If it print something on the console when you touching trackpad surface?

Yes! :) It prints "something".

It should print continuously if you'd move your finger

Jul 28 2019, 11:18 PM · Contributor Reviews (base)
wulf added a comment to D16698: First draft HID over I2C support (Mouse only).
In D16698#457872, @wulf wrote:
In D16698#457847, @wulf wrote:

then comment out imt_set_input_mode() call in imt_attach() subroutine (imt.c) and insert printf("something\n"); into iichid_intr() sub (iichid.c)
If it print something on the console when you touching trackpad surface?

Yes! :) It prints "something".

Jul 28 2019, 10:53 PM · Contributor Reviews (base)
nikola.lecic_anthesphoria.net added a comment to D16698: First draft HID over I2C support (Mouse only).
In D16698#457872, @wulf wrote:
In D16698#457847, @wulf wrote:

then comment out imt_set_input_mode() call in imt_attach() subroutine (imt.c) and insert printf("something\n"); into iichid_intr() sub (iichid.c)
If it print something on the console when you touching trackpad surface?

Jul 28 2019, 10:41 PM · Contributor Reviews (base)
wulf added a comment to D16698: First draft HID over I2C support (Mouse only).
In D16698#457847, @wulf wrote:
Jul 28 2019, 10:00 PM · Contributor Reviews (base)
nikola.lecic_anthesphoria.net added a comment to D16698: First draft HID over I2C support (Mouse only).
In D16698#457847, @wulf wrote:

Here it is.

Attach phase looks good now
Try to replace iichid_set_power() and iichid_reset() subroutine bodies in iichid.c with return(0);

Jul 28 2019, 9:23 PM · Contributor Reviews (base)
wulf added a comment to D16698: First draft HID over I2C support (Mouse only).

Here it is.

Jul 28 2019, 8:38 PM · Contributor Reviews (base)
wulf added a comment to D16698: First draft HID over I2C support (Mouse only).

Updated D16698 builds and runs fine on 12-STABLE though it still lacks resume support.
I must admit I wasn't able to test https://github.com/wulf7/iichid. The module didn't work for me:
Jul 28 18:20:49 bsdondell kernel: imt0: IRQ allocation failed. Fallback to sampling.

Jul 28 2019, 7:29 PM · Contributor Reviews (base)
zarychtam_plan-b.pwste.edu.pl added a comment to D16698: First draft HID over I2C support (Mouse only).

Updated D16698 builds and runs fine on 12-STABLE though it still lacks resume support.

Jul 28 2019, 5:05 PM · Contributor Reviews (base)
nikola.lecic_anthesphoria.net added a comment to D16698: First draft HID over I2C support (Mouse only).
In D16698#457750, @wulf wrote:

All done, no difference, nothing happens with evemu-record. :(

What is in your dmesg log? Please post it including device attachment part

Jul 28 2019, 1:26 PM · Contributor Reviews (base)
wulf added a comment to D16698: First draft HID over I2C support (Mouse only).

All done, no difference, nothing happens with evemu-record. :(

Jul 28 2019, 9:22 AM · Contributor Reviews (base)

Jul 27 2019

nikola.lecic_anthesphoria.net added a comment to D16698: First draft HID over I2C support (Mouse only).
In D16698#457552, @wulf wrote:

Touching/pressing/doing anything with touchpad produces absolutely nothing.

Ouuuch. I forgot one important thing! ig4.ko must be fixed before this driver get used. I am sorry.
Just add following snippet to ig4iic_pci_methods array in /usr/src/sys/dev/ichiic/ig4_pci.c and rebuild kernel or ig4.ko

/* Bus interface */
DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource),
DEVMETHOD(bus_release_resource, bus_generic_release_resource),
DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource),
DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource),
DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource),
Jul 27 2019, 11:47 PM · Contributor Reviews (base)
wulf added a comment to D16698: First draft HID over I2C support (Mouse only).

Touching/pressing/doing anything with touchpad produces absolutely nothing.

Jul 27 2019, 9:23 AM · Contributor Reviews (base)

Jul 23 2019

nikola.lecic_anthesphoria.net added a comment to D16698: First draft HID over I2C support (Mouse only).
In D16698#456208, @wulf wrote:

Sorry, no difference.

I enabled debugging output in imt.c so please:

  1. Update sources
  2. make && sudo kldload ./iichid.ko
  3. sudo sysctl hw.imt.debug=6
  4. sudo evemu-record /dev/input/event<touchpad unit number>
  5. Do a touch for half an second
  6. Post dmesg output starting form first imt0: line
Jul 23 2019, 12:23 AM · Contributor Reviews (base)

Jul 22 2019

wulf added a comment to D16698: First draft HID over I2C support (Mouse only).

Sorry, no difference.

I enabled debugging output in imt.c so please:

Jul 22 2019, 10:27 AM · Contributor Reviews (base)
nikola.lecic_anthesphoria.net added a comment to D16698: First draft HID over I2C support (Mouse only).
In D16698#456090, @wulf wrote:

The only problem -- the device is still dead;

I fixed one bug, so try one more time

Jul 22 2019, 12:46 AM · Contributor Reviews (base)

Jul 21 2019

wulf added a comment to D16698: First draft HID over I2C support (Mouse only).

The only problem -- the device is still dead;

I fixed one bug, so try one more time

it generates nothing with libinput debug-events, and no events in xev.

libinput debug-events is not the right tool to debug evdev. evemu-record from devel/evemu port is better

Jul 21 2019, 11:35 PM · Contributor Reviews (base)
nikola.lecic_anthesphoria.net added a comment to D16698: First draft HID over I2C support (Mouse only).
In D16698#455907, @wulf wrote:

Unlike with previous driver, I don't see /dev/input/event3 (HID over IIC) anymore.

That is expected as it ignored any touchpads
I added some basic touchpad support (surface touches only, no buttons) so you can try it again
Unfortunately, it is untested.

Jul 21 2019, 2:34 PM · Contributor Reviews (base)
wulf added a comment to D16698: First draft HID over I2C support (Mouse only).

Unlike with previous driver, I don't see /dev/input/event3 (HID over IIC) anymore.

That is expected as it ignored any touchpads

Jul 21 2019, 12:56 PM · Contributor Reviews (base)

Jul 20 2019

nikola.lecic_anthesphoria.net added a comment to D16698: First draft HID over I2C support (Mouse only).
In D16698#455669, @wulf wrote:

@wulf, please explain how to test this driver. Should I just compile new iichid.ko (running make in the input directory),

just unpack it at your $HOME. Than

make && sudo kldload ./iichid.ko

[...]

Jul 20 2019, 3:18 PM · Contributor Reviews (base)

Jul 19 2019

wulf added a comment to D16698: First draft HID over I2C support (Mouse only).

@wulf, please explain how to test this driver. Should I just compile new iichid.ko (running make in the input directory),

just unpack it at your $HOME. Than

make && sudo kldload ./iichid.ko

leaving all other modules built from the source of this thread?

drivers from this review should be at least unloaded from kernel. There is no need to revert D16698 patch. Just don't try to kldload both modules in between reboots.

Should I remove evdev support from the kernel?

No need. It links with evdev unconditionally

Can you please share your xorg configuration?

I do not have any specific xorg.conf options. Any evdev-awared autoconfiguration backend should work out of box. See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196678 for example.

Jul 19 2019, 9:31 PM · Contributor Reviews (base)
wulf added a comment to D16698: First draft HID over I2C support (Mouse only).

Parsed:

0x05, 0x0D,        // Usage Page (Digitizer)
0x09, 0x05,        // Usage (Touch Pad)
0xA1, 0x01,        // Collection (Application)
0x85, 0x04,        //   Report ID (4)
0x09, 0x22,        //   Usage (Finger)
0xA1, 0x02,        //   Collection (Logical)
Jul 19 2019, 9:13 PM · Contributor Reviews (base)
nikola.lecic_anthesphoria.net added a comment to D16698: First draft HID over I2C support (Mouse only).
In D16698#455371, @wulf wrote:

We have the wmt driver but right now it's *touchscreen*-only and (of course) USB-only.

I have half-completed (it is working for me!) WIP port of wmt for i2c bus https://github.com/wulf7/iichid.

Jul 19 2019, 12:21 AM · Contributor Reviews (base)

Jul 18 2019

nikola.lecic_anthesphoria.net added a comment to D16698: First draft HID over I2C support (Mouse only).
In D16698#455403, @wulf wrote:

OS driver or userland applications just do not have enough information as finger coords or count to support doublefinger scroll or multifinger taps.

I wrote a simple util to dump report descriptor from I2C HID device

.
It accepts 3 input parameters: iic device path, i2c bus address and i2c HID register and prints report descriptor of given I2C device on stdout. This report descriptor can be further analyzed with any tool (e.g. web-based http://eleccelerator.com/usbdescreqparser/) to examine HID device capabilities.

Jul 18 2019, 11:38 PM · Contributor Reviews (base)
wulf added a comment to D16698: First draft HID over I2C support (Mouse only).

OS driver or userland applications just do not have enough information as finger coords or count to support doublefinger scroll or multifinger taps.

I wrote a simple util to dump report descriptor from I2C HID device

.
It accepts 3 input parameters: iic device path, i2c bus address and i2c HID register and prints report descriptor of given I2C device on stdout. This report descriptor can be further analyzed with any tool (e.g. web-based http://eleccelerator.com/usbdescreqparser/) to examine HID device capabilities.

Jul 18 2019, 9:59 PM · Contributor Reviews (base)
wulf added a comment to D16698: First draft HID over I2C support (Mouse only).

I see. Sigh. Anyway, some people from this thread reported that two finger scrolling *does* work, including @johalun himself in his announcement:

If I do two finger horizontal scroll I don't get any event callbacks at all while I do for vertical. Could this be something that has to be enabled by sending some command to the device?

Jul 18 2019, 9:45 PM · Contributor Reviews (base)
wulf added a comment to D16698: First draft HID over I2C support (Mouse only).

We have the wmt driver but right now it's *touchscreen*-only and (of course) USB-only.

Jul 18 2019, 9:34 PM · Contributor Reviews (base)
nikola.lecic_anthesphoria.net added a comment to D16698: First draft HID over I2C support (Mouse only).

EVDEV is still optional and the driver won't compile without the #ifdefs if it's not enabled. Just recently I think it has been enabled by default.

Jul 18 2019, 7:13 PM · Contributor Reviews (base)
johalun added a comment to D16698: First draft HID over I2C support (Mouse only).

hm. EVDEV_SUPPORT enables evdev in "legacy" drivers like psm, ums, ukbd etc. I'm not sure why @johalun added ifdefs for that here, this is a new driver :)

Jul 18 2019, 4:30 PM · Contributor Reviews (base)