* Re: [PATCH 1/3] mfd: apple-ibridge: Add Apple iBridge MFD driver.
From: Life is hard, and then you die @ 2019-04-25 8:19 UTC (permalink / raw)
To: Benjamin Tissoires
Cc: Jiri Kosina, Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
Peter Meerwald-Stadler, Lee Jones, open list:HID CORE LAYER,
linux-iio, lkml
In-Reply-To: <CAO-hwJLMZvBGheEtH_iU+mBtE4T3OsT6W+=1x-ewzGGP5Fxp4Q@mail.gmail.com>
Hi Benjamin,
Thank you for looking at this.
On Wed, Apr 24, 2019 at 04:18:23PM +0200, Benjamin Tissoires wrote:
> On Mon, Apr 22, 2019 at 5:13 AM Ronald Tschalär <ronald@innovation.ch> wrote:
> >
> > The iBridge device provides access to several devices, including:
> > - the Touch Bar
> > - the iSight webcam
> > - the light sensor
> > - the fingerprint sensor
> >
> > This driver provides the core support for managing the iBridge device
> > and the access to the underlying devices. In particular, since the
> > functionality for the touch bar and light sensor is exposed via USB HID
> > interfaces, and the same HID device is used for multiple functions, this
> > driver provides a multiplexing layer that allows multiple HID drivers to
> > be registered for a given HID device. This allows the touch bar and ALS
> > driver to be separated out into their own modules.
>
> Sorry for coming late to the party, but IMO this series is far too
> complex for what you need.
>
> As I read this and the first comment of drivers/mfd/apple-ibridge.c,
> you need to have a HID driver that multiplex 2 other sub drivers
> through one USB communication.
> For that, you are using MFD, platform driver and you own sauce instead
> of creating a bus.
Basically correct. To be a bit more precise, there are currently two
hid-devices and two drivers (touchbar and als) involved, with
connections as follows (pardon the ugly ascii art):
hdev1 --- tb-drv
/
/
/
hdev2 --- als-drv
i.e. the touchbar driver talks to both hdev's, and hdev2's events
(reports) are processed by both drivers (though each handles different
reports).
> So, how about we reuse entirely the HID subsystem which already
> provides the capability you need (assuming I am correct above).
> hid-logitech-dj already does the same kind of stuff and you could:
> - create drivers/hid/hid-ibridge.c that handles USB_ID_PRODUCT_IBRIDGE
> - hid-ibridge will then register itself to the hid subsystem with a
> call to hid_hw_start(hdev, HID_CONNECT_HIDRAW) and
> hid_device_io_start(hdev) to enable the events (so you don't create
> useless input nodes for it)
> - then you add your 2 new devices by calling hid_allocate_device() and
> then hid_add_device(). You can even create a new HID group
> APPLE_IBRIDGE and allocate 2 new PIDs for them to distinguish them
> from the actual USB device.
> - then you have 2 brand new HID devices you can create their driver as
> a regular ones.
>
> hid-ibridge.c would just need to behave like any other hid transport
> driver (see logi_dj_ll_driver in drivers/hid/hid-logitech-dj.c) and
> you can get rid of at least the MFD and the platform part of your
> drivers.
>
> Does it makes sense or am I missing something obvious in the middle?
Yes, I think I understand, and I think this can work. Basically,
instead of demux'ing at the hid-driver level as I am doing now (i.e.
the iBridge hid-driver forwarding calls to the sub-hid-drivers), we
demux at the hid-device level (events forwarded from iBridge hdev to
all "virtual" sub-hdev's, and requests from sub-hdev's forwarded to
the original hdev via an iBridge ll_driver attached to the
sub-hdev's).
So I would need to create 3 new "virtual" hid-devices (instances) as
follows:
hdev1 --- vhdev1 --- tb-drv
/
-- vhdev2 --
/
hdev2 --- vhdev3 --- als-drv
(vhdev1 is probably not strictly necessary, but makes things more
consistent).
> I have one other comment below.
>
> Note that I haven't read the whole series as I'd like to first get
> your feedback with my comment above.
Agreed: let's first get the overall strategy stabilized (also so I
can avoid having to rewrite the code too many more times ;-) ).
[snip]
> > +static __u8 *appleib_report_fixup(struct hid_device *hdev, __u8 *rdesc,
> > + unsigned int *rsize)
> > +{
> > + /* Some fields have a size of 64 bits, which according to HID 1.11
> > + * Section 8.4 is not valid ("An item field cannot span more than 4
> > + * bytes in a report"). Furthermore, hid_field_extract() complains
>
> this must have been fixed in 94a9992f7dbdfb28976b565af220e0c4a117144a
> which is part of v5.1, so not sure you actually need the report
> descriptor fixup at all.
Wasn't aware of this change - thanks. Yes, with that the warning
message should be gone and this fixup can be avoided.
One thing I find strange, though, is that while 94a9992f7dbd changes
the condition at which the warning is emitted, it still truncates the
value to 32 bits, albeit completely silently now for lengths between
32 and 256 bits. I.e. I'm somewhat surprised that hid_field_extract()
(and __extract() ) weren't updated to actually return the full values
for longer fields. Either that, or the callers of hid_field_extract()
changed to read longer fields in 32 bit chunks.
Cheers,
Ronald
^ permalink raw reply
* Re: [PATCH v3 7/8] HID: logitech: Enable high-resolution scrolling on Logitech mice
From: Clément VUCHENER @ 2019-04-25 8:24 UTC (permalink / raw)
To: Benjamin Tissoires
Cc: Harry Cutts, Peter Hutterer, open list:HID CORE LAYER,
Dmitry Torokhov, Jiri Kosina, Linus Torvalds, Nestor Lopez Casado,
lkml
In-Reply-To: <CAO-hwJJkyK_qPEL37QLd3kLuwB2rFBk+5FWg1UCfgr-FzxZ5aw@mail.gmail.com>
Le jeu. 25 avr. 2019 à 09:40, Benjamin Tissoires
<benjamin.tissoires@redhat.com> a écrit :
>
> Hi Clément,
>
> On Wed, Apr 24, 2019 at 5:34 PM Clément VUCHENER
> <clement.vuchener@gmail.com> wrote:
> >
> > Hi Benjamin,
> >
> > I tried again to add hi-res wheel support for the G500 with Hans de
> > Goede's latest patch series you've just merged in for-5.2/logitech, it
> > is much better but there is still some issues.
> >
> > The first one is the device index, I need to use device index 0
> > instead 0xff. I added a quick and dirty quirk (stealing in the
> > QUIRK_CLASS range since the normal quirk range looks full) to change
> > the device index assigned in __hidpp_send_report. After that the
> > device is correctly initialized and the wheel multiplier is set.
>
> Hmm, maybe we should restrain a little bit the reserved quirks...
> But actually, .driver_data and .quirks are both unsigned long, so you
> should be able to use the 64 bits.
Only on 64 bits architectures, or is the kernel forcing long integers
to be 64 bits everywhere?
>
> >
> > The second issue is that wheel values are not actually scaled
> > according to the multiplier. I get 7/8 full scroll event for each
> > wheel step. I think it happens because the mouse is split in two
> > devices. The first device has the wheel events, and the second device
> > has the HID++ reports. The wheel multiplier is only set on the second
> > device (where the hi-res mode is enabled) and does not affect the
> > wheel events from the first one.
>
> I would think this have to do with the device not accepting the
> command instead. Can you share some raw logs of the events (ideally
> with hid-recorder from
> https://gitlab.freedesktop.org/libevdev/hid-tools)?
I already checked with usbmon and double-checked by querying the
register. The flag is set and accepted by the device and it behaves
accordingly: it sends about 8 wheel events per step.
hid-recorder takes hidraw nodes as parameters, how do I use it to
record the initialization by the driver?
>
> Cheers,
> Benjamin
>
> >
> > Le mer. 19 déc. 2018 à 21:35, Benjamin Tissoires
> > <benjamin.tissoires@redhat.com> a écrit :
> > >
> > > On Wed, Dec 19, 2018 at 11:57 AM Clément VUCHENER
> > > <clement.vuchener@gmail.com> wrote:
> > > >
> > > > Le sam. 15 déc. 2018 à 15:45, Clément VUCHENER
> > > > <clement.vuchener@gmail.com> a écrit :
> > > > >
> > > > > Le ven. 14 déc. 2018 à 19:37, Harry Cutts <hcutts@chromium.org> a écrit :
> > > > > >
> > > > > > Hi Clement,
> > > > > >
> > > > > > On Fri, 14 Dec 2018 at 05:47, Clément VUCHENER
> > > > > > <clement.vuchener@gmail.com> wrote:
> > > > > > > Hi, The G500s (and the G500 too, I think) does support the "scrolling
> > > > > > > acceleration" bit. If I set it, I get around 8 events for each wheel
> > > > > > > "click", this is what this driver expects, right? If I understood
> > > > > > > correctly, I should try this patch with the
> > > > > > > HIDPP_QUIRK_HI_RES_SCROLL_1P0 quirk set for my mouse.
> > > > > >
> > > > > > Thanks for the info! Yes, that should work.
> > > > >
> > > > > Well, it is not that simple. I get "Device not connected" errors for
> > > > > both interfaces of the mouse.
> > > >
> > > > I suspect the device is not responding because the hid device is not
> > > > started. When is hid_hw_start supposed to be called? It is called
> > > > early for HID_QUIRK_CLASS_G920 but later for other device. So the
> > > > device is not started when hidpp_is_connected is called. Is this
> > > > because most of the device in this driver are not real HID devices but
> > > > DJ devices? How should non-DJ devices be treated?
> > >
> > > Hi Clement,
> > >
> > > I have a series I sent last September that allows to support non DJ
> > > devices on logitech-hidpp
> > > (https://patchwork.kernel.org/project/linux-input/list/?series=16359).
> > >
> > > In its current form, with the latest upstream kernel, the series will
> > > oops during the .event() callback, which is easy enough to fix.
> > > However, I am currently trying to make it better as a second or third
> > > reading made me realized that there was a bunch of non-sense in it and
> > > a proper support would require slightly more work for the non unifying
> > > receiver case.
> > >
> > > I hope I'll be able to send out something by the end of the week.
> > >
> > > Cheers,
> > > Benjamin
^ permalink raw reply
* Re: [PATCH v3 7/8] HID: logitech: Enable high-resolution scrolling on Logitech mice
From: Benjamin Tissoires @ 2019-04-25 8:45 UTC (permalink / raw)
To: Clément VUCHENER
Cc: Harry Cutts, Peter Hutterer, open list:HID CORE LAYER,
Dmitry Torokhov, Jiri Kosina, Linus Torvalds, Nestor Lopez Casado,
lkml
In-Reply-To: <CAM4jgCrLRxOx-qtq8Wfbc1xmYkNHG9vsRSk_BBK5OPgkLyVYnQ@mail.gmail.com>
On Thu, Apr 25, 2019 at 10:25 AM Clément VUCHENER
<clement.vuchener@gmail.com> wrote:
>
> Le jeu. 25 avr. 2019 à 09:40, Benjamin Tissoires
> <benjamin.tissoires@redhat.com> a écrit :
> >
> > Hi Clément,
> >
> > On Wed, Apr 24, 2019 at 5:34 PM Clément VUCHENER
> > <clement.vuchener@gmail.com> wrote:
> > >
> > > Hi Benjamin,
> > >
> > > I tried again to add hi-res wheel support for the G500 with Hans de
> > > Goede's latest patch series you've just merged in for-5.2/logitech, it
> > > is much better but there is still some issues.
> > >
> > > The first one is the device index, I need to use device index 0
> > > instead 0xff. I added a quick and dirty quirk (stealing in the
> > > QUIRK_CLASS range since the normal quirk range looks full) to change
> > > the device index assigned in __hidpp_send_report. After that the
> > > device is correctly initialized and the wheel multiplier is set.
> >
> > Hmm, maybe we should restrain a little bit the reserved quirks...
> > But actually, .driver_data and .quirks are both unsigned long, so you
> > should be able to use the 64 bits.
>
> Only on 64 bits architectures, or is the kernel forcing long integers
> to be 64 bits everywhere?
Damnit, you are correct, there is no such enforcement :/
>
> >
> > >
> > > The second issue is that wheel values are not actually scaled
> > > according to the multiplier. I get 7/8 full scroll event for each
> > > wheel step. I think it happens because the mouse is split in two
> > > devices. The first device has the wheel events, and the second device
> > > has the HID++ reports. The wheel multiplier is only set on the second
> > > device (where the hi-res mode is enabled) and does not affect the
> > > wheel events from the first one.
> >
> > I would think this have to do with the device not accepting the
> > command instead. Can you share some raw logs of the events (ideally
> > with hid-recorder from
> > https://gitlab.freedesktop.org/libevdev/hid-tools)?
>
> I already checked with usbmon and double-checked by querying the
> register. The flag is set and accepted by the device and it behaves
> accordingly: it sends about 8 wheel events per step.
OK, that's what I wanted to see.
>
> hid-recorder takes hidraw nodes as parameters, how do I use it to
> record the initialization by the driver?
You can't. But it doesn't really matter here because I wanted to check
what your mouse is actually sending after the initialization.
So if I read correctly: the mouse is sending high res data but
evemu-recorder shows one REL_WHEEL event every 7/8 clicks?
Cheers,
Benjamin
> > > Le mer. 19 déc. 2018 à 21:35, Benjamin Tissoires
> > > <benjamin.tissoires@redhat.com> a écrit :
> > > >
> > > > On Wed, Dec 19, 2018 at 11:57 AM Clément VUCHENER
> > > > <clement.vuchener@gmail.com> wrote:
> > > > >
> > > > > Le sam. 15 déc. 2018 à 15:45, Clément VUCHENER
> > > > > <clement.vuchener@gmail.com> a écrit :
> > > > > >
> > > > > > Le ven. 14 déc. 2018 à 19:37, Harry Cutts <hcutts@chromium.org> a écrit :
> > > > > > >
> > > > > > > Hi Clement,
> > > > > > >
> > > > > > > On Fri, 14 Dec 2018 at 05:47, Clément VUCHENER
> > > > > > > <clement.vuchener@gmail.com> wrote:
> > > > > > > > Hi, The G500s (and the G500 too, I think) does support the "scrolling
> > > > > > > > acceleration" bit. If I set it, I get around 8 events for each wheel
> > > > > > > > "click", this is what this driver expects, right? If I understood
> > > > > > > > correctly, I should try this patch with the
> > > > > > > > HIDPP_QUIRK_HI_RES_SCROLL_1P0 quirk set for my mouse.
> > > > > > >
> > > > > > > Thanks for the info! Yes, that should work.
> > > > > >
> > > > > > Well, it is not that simple. I get "Device not connected" errors for
> > > > > > both interfaces of the mouse.
> > > > >
> > > > > I suspect the device is not responding because the hid device is not
> > > > > started. When is hid_hw_start supposed to be called? It is called
> > > > > early for HID_QUIRK_CLASS_G920 but later for other device. So the
> > > > > device is not started when hidpp_is_connected is called. Is this
> > > > > because most of the device in this driver are not real HID devices but
> > > > > DJ devices? How should non-DJ devices be treated?
> > > >
> > > > Hi Clement,
> > > >
> > > > I have a series I sent last September that allows to support non DJ
> > > > devices on logitech-hidpp
> > > > (https://patchwork.kernel.org/project/linux-input/list/?series=16359).
> > > >
> > > > In its current form, with the latest upstream kernel, the series will
> > > > oops during the .event() callback, which is easy enough to fix.
> > > > However, I am currently trying to make it better as a second or third
> > > > reading made me realized that there was a bunch of non-sense in it and
> > > > a proper support would require slightly more work for the non unifying
> > > > receiver case.
> > > >
> > > > I hope I'll be able to send out something by the end of the week.
> > > >
> > > > Cheers,
> > > > Benjamin
^ permalink raw reply
* Re: [PATCH v3 7/8] HID: logitech: Enable high-resolution scrolling on Logitech mice
From: Clément VUCHENER @ 2019-04-25 9:28 UTC (permalink / raw)
To: Benjamin Tissoires
Cc: Harry Cutts, Peter Hutterer, open list:HID CORE LAYER,
Dmitry Torokhov, Jiri Kosina, Linus Torvalds, Nestor Lopez Casado,
lkml
In-Reply-To: <CAO-hwJ+r1TUQLZqdpNFD4AWC3URro3=Tc56gjV52i=aWrCbL8A@mail.gmail.com>
Le jeu. 25 avr. 2019 à 10:45, Benjamin Tissoires
<benjamin.tissoires@redhat.com> a écrit :
>
> On Thu, Apr 25, 2019 at 10:25 AM Clément VUCHENER
> <clement.vuchener@gmail.com> wrote:
> >
> > Le jeu. 25 avr. 2019 à 09:40, Benjamin Tissoires
> > <benjamin.tissoires@redhat.com> a écrit :
> > >
> > > Hi Clément,
> > >
> > > On Wed, Apr 24, 2019 at 5:34 PM Clément VUCHENER
> > > <clement.vuchener@gmail.com> wrote:
> > > >
> > > > Hi Benjamin,
> > > >
> > > > I tried again to add hi-res wheel support for the G500 with Hans de
> > > > Goede's latest patch series you've just merged in for-5.2/logitech, it
> > > > is much better but there is still some issues.
> > > >
> > > > The first one is the device index, I need to use device index 0
> > > > instead 0xff. I added a quick and dirty quirk (stealing in the
> > > > QUIRK_CLASS range since the normal quirk range looks full) to change
> > > > the device index assigned in __hidpp_send_report. After that the
> > > > device is correctly initialized and the wheel multiplier is set.
> > >
> > > Hmm, maybe we should restrain a little bit the reserved quirks...
> > > But actually, .driver_data and .quirks are both unsigned long, so you
> > > should be able to use the 64 bits.
> >
> > Only on 64 bits architectures, or is the kernel forcing long integers
> > to be 64 bits everywhere?
>
> Damnit, you are correct, there is no such enforcement :/
>
> >
> > >
> > > >
> > > > The second issue is that wheel values are not actually scaled
> > > > according to the multiplier. I get 7/8 full scroll event for each
> > > > wheel step. I think it happens because the mouse is split in two
> > > > devices. The first device has the wheel events, and the second device
> > > > has the HID++ reports. The wheel multiplier is only set on the second
> > > > device (where the hi-res mode is enabled) and does not affect the
> > > > wheel events from the first one.
> > >
> > > I would think this have to do with the device not accepting the
> > > command instead. Can you share some raw logs of the events (ideally
> > > with hid-recorder from
> > > https://gitlab.freedesktop.org/libevdev/hid-tools)?
> >
> > I already checked with usbmon and double-checked by querying the
> > register. The flag is set and accepted by the device and it behaves
> > accordingly: it sends about 8 wheel events per step.
>
> OK, that's what I wanted to see.
>
> >
> > hid-recorder takes hidraw nodes as parameters, how do I use it to
> > record the initialization by the driver?
>
> You can't. But it doesn't really matter here because I wanted to check
> what your mouse is actually sending after the initialization.
>
> So if I read correctly: the mouse is sending high res data but
> evemu-recorder shows one REL_WHEEL event every 7/8 clicks?
It is HID++ 1.0, there is no special high res data report, it sends
standard HID mouse wheel report, but more of them.
To be clear, here is a recording using the modified kernel. I moved
the wheel one step up (8 events are generated), then one step down (8
events again + a 2-event bump).
# EVEMU 1.3
# Kernel: 5.0.0logitech+
# DMI: dmi:bvnAmericanMegatrendsInc.:bvr1.40:bd01/17/2019:svnMicro-StarInternationalCo.,Ltd.:pnMS-7B98:pvr1.0:rvnMicro-StarInternationalCo.,Ltd.:rnZ390-APRO(MS-7B98):rvr1.0:cvnMicro-StarInternationalCo.,Ltd.:ct3:cvr1.0:
# Input device name: "Logitech G500"
# Input device ID: bus 0x03 vendor 0x46d product 0xc068 version 0x111
# Supported events:
# Event type 0 (EV_SYN)
# Event code 0 (SYN_REPORT)
# Event code 1 (SYN_CONFIG)
# Event code 2 (SYN_MT_REPORT)
# Event code 3 (SYN_DROPPED)
# Event code 4 ((null))
# Event code 5 ((null))
# Event code 6 ((null))
# Event code 7 ((null))
# Event code 8 ((null))
# Event code 9 ((null))
# Event code 10 ((null))
# Event code 11 ((null))
# Event code 12 ((null))
# Event code 13 ((null))
# Event code 14 ((null))
# Event code 15 (SYN_MAX)
# Event type 1 (EV_KEY)
# Event code 272 (BTN_LEFT)
# Event code 273 (BTN_RIGHT)
# Event code 274 (BTN_MIDDLE)
# Event code 275 (BTN_SIDE)
# Event code 276 (BTN_EXTRA)
# Event code 277 (BTN_FORWARD)
# Event code 278 (BTN_BACK)
# Event code 279 (BTN_TASK)
# Event code 280 ((null))
# Event code 281 ((null))
# Event code 282 ((null))
# Event code 283 ((null))
# Event code 284 ((null))
# Event code 285 ((null))
# Event code 286 ((null))
# Event code 287 ((null))
# Event type 2 (EV_REL)
# Event code 0 (REL_X)
# Event code 1 (REL_Y)
# Event code 6 (REL_HWHEEL)
# Event code 8 (REL_WHEEL)
# Event code 11 ((null))
# Event code 12 ((null))
# Event type 4 (EV_MSC)
# Event code 4 (MSC_SCAN)
# Properties:
N: Logitech G500
I: 0003 046d c068 0111
P: 00 00 00 00 00 00 00 00
B: 00 0b 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 ff ff 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 02 43 19 00 00 00 00 00 00
B: 03 00 00 00 00 00 00 00 00
B: 04 10 00 00 00 00 00 00 00
B: 05 00 00 00 00 00 00 00 00
B: 11 00 00 00 00 00 00 00 00
B: 12 00 00 00 00 00 00 00 00
B: 14 00 00 00 00 00 00 00 00
B: 15 00 00 00 00 00 00 00 00
B: 15 00 00 00 00 00 00 00 00
################################
# Waiting for events #
################################
E: 0.000001 0002 0008 0001 # EV_REL / REL_WHEEL 1
E: 0.000001 0002 000b 0120 # EV_REL / (null) 120
E: 0.000001 0000 0000 0000 # ------------ SYN_REPORT (0) ---------- +0ms
E: 0.042009 0002 0008 0001 # EV_REL / REL_WHEEL 1
E: 0.042009 0002 000b 0120 # EV_REL / (null) 120
E: 0.042009 0000 0000 0000 # ------------ SYN_REPORT (0) ---------- +42ms
E: 0.075016 0002 0008 0001 # EV_REL / REL_WHEEL 1
E: 0.075016 0002 000b 0120 # EV_REL / (null) 120
E: 0.075016 0000 0000 0000 # ------------ SYN_REPORT (0) ---------- +33ms
E: 0.107977 0002 0008 0001 # EV_REL / REL_WHEEL 1
E: 0.107977 0002 000b 0120 # EV_REL / (null) 120
E: 0.107977 0000 0000 0000 # ------------ SYN_REPORT (0) ---------- +32ms
E: 0.124979 0002 0008 0001 # EV_REL / REL_WHEEL 1
E: 0.124979 0002 000b 0120 # EV_REL / (null) 120
E: 0.124979 0000 0000 0000 # ------------ SYN_REPORT (0) ---------- +17ms
E: 0.141950 0002 0008 0001 # EV_REL / REL_WHEEL 1
E: 0.141950 0002 000b 0120 # EV_REL / (null) 120
E: 0.141950 0000 0000 0000 # ------------ SYN_REPORT (0) ---------- +17ms
E: 0.152950 0002 0008 0001 # EV_REL / REL_WHEEL 1
E: 0.152950 0002 000b 0120 # EV_REL / (null) 120
E: 0.152950 0000 0000 0000 # ------------ SYN_REPORT (0) ---------- +11ms
E: 0.170943 0002 0008 0001 # EV_REL / REL_WHEEL 1
E: 0.170943 0002 000b 0120 # EV_REL / (null) 120
E: 0.170943 0000 0000 0000 # ------------ SYN_REPORT (0) ---------- +18ms
E: 1.452035 0002 0008 -001 # EV_REL / REL_WHEEL -1
E: 1.452035 0002 000b -120 # EV_REL / (null) -120
E: 1.452035 0000 0000 0000 # ------------ SYN_REPORT (0) ---------- +1282ms
E: 1.535031 0002 0008 -001 # EV_REL / REL_WHEEL -1
E: 1.535031 0002 000b -120 # EV_REL / (null) -120
E: 1.535031 0000 0000 0000 # ------------ SYN_REPORT (0) ---------- +83ms
E: 1.574981 0002 0008 -001 # EV_REL / REL_WHEEL -1
E: 1.574981 0002 000b -120 # EV_REL / (null) -120
E: 1.574981 0000 0000 0000 # ------------ SYN_REPORT (0) ---------- +39ms
E: 1.702039 0002 0008 -001 # EV_REL / REL_WHEEL -1
E: 1.702039 0002 000b -120 # EV_REL / (null) -120
E: 1.702039 0000 0000 0000 # ------------ SYN_REPORT (0) ---------- +128ms
E: 1.713031 0002 0008 -001 # EV_REL / REL_WHEEL -1
E: 1.713031 0002 000b -120 # EV_REL / (null) -120
E: 1.713031 0000 0000 0000 # ------------ SYN_REPORT (0) ---------- +11ms
E: 1.724036 0002 0008 -001 # EV_REL / REL_WHEEL -1
E: 1.724036 0002 000b -120 # EV_REL / (null) -120
E: 1.724036 0000 0000 0000 # ------------ SYN_REPORT (0) ---------- +11ms
E: 1.731006 0002 0008 -001 # EV_REL / REL_WHEEL -1
E: 1.731006 0002 000b -120 # EV_REL / (null) -120
E: 1.731006 0000 0000 0000 # ------------ SYN_REPORT (0) ---------- +7ms
E: 1.740043 0002 0008 -001 # EV_REL / REL_WHEEL -1
E: 1.740043 0002 000b -120 # EV_REL / (null) -120
E: 1.740043 0000 0000 0000 # ------------ SYN_REPORT (0) ---------- +9ms
E: 1.765013 0002 0008 -001 # EV_REL / REL_WHEEL -1
E: 1.765013 0002 000b -120 # EV_REL / (null) -120
E: 1.765013 0000 0000 0000 # ------------ SYN_REPORT (0) ---------- +25ms
E: 1.975044 0002 0008 0001 # EV_REL / REL_WHEEL 1
E: 1.975044 0002 000b 0120 # EV_REL / (null) 120
E: 1.975044 0000 0000 0000 # ------------ SYN_REPORT (0) ---------- +210ms
Here is the corresponding hid-recorder:
D: 0
R: 67 05 01 09 02 a1 01 09 01 a1 00 05 09 19 01 29 10 15 00 25 01 95
10 75 01 81 02 05 01 16 01 80 26 ff 7f 75 10 95 02 09 30 09 31 81 06
15 81 25 7f 75 08 95 01 09 38 81 06 05 0c 0a 38 02 95 01 81 06 c0 c0
N: Logitech G500
P: usb-0000:00:14.0-2/input0
I: 3 046d c068
D: 0
E: 0.000000 8 00 00 00 00 00 00 01 00
E: 0.041957 8 00 00 00 00 00 00 01 00
E: 0.074966 8 00 00 00 00 00 00 01 00
E: 0.107932 8 00 00 00 00 00 00 01 00
E: 0.124933 8 00 00 00 00 00 00 01 00
E: 0.141897 8 00 00 00 00 00 00 01 00
E: 0.152900 8 00 00 00 00 00 00 01 00
E: 0.170892 8 00 00 00 00 00 00 01 00
E: 1.452000 8 00 00 00 00 00 00 ff 00
E: 1.535009 8 00 00 00 00 00 00 ff 00
E: 1.574928 8 00 00 00 00 00 00 ff 00
E: 1.702009 8 00 00 00 00 00 00 ff 00
E: 1.713009 8 00 00 00 00 00 00 ff 00
E: 1.724001 8 00 00 00 00 00 00 ff 00
E: 1.730963 8 00 00 00 00 00 00 ff 00
E: 1.740005 8 00 00 00 00 00 00 ff 00
E: 1.764977 8 00 00 00 00 00 00 ff 00
E: 1.975014 8 00 00 00 00 00 00 01 00
The hi-res events should +/-15 instead of +/-120, and less REL_WHEEL
events should be generated. This looks like the multiplier is set to 1
instead of 8.
kernel log shows the multiplier is set but only for one of the two devices:
input: Logitech G500 as
/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/0003:046D:C068.0006/input/input25
hid-generic 0003:046D:C068.0006: input,hidraw5: USB HID v1.11 Mouse
[Logitech G500] on usb-0000:00:14.0-2/input0
input: Logitech G500 Keyboard as
/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.1/0003:046D:C068.0007/input/input26
input: Logitech G500 Consumer Control as
/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.1/0003:046D:C068.0007/input/input27
hid-generic 0003:046D:C068.0007: input,hiddev97,hidraw6: USB HID v1.11
Keyboard [Logitech G500] on usb-0000:00:14.0-2/input1
input: Logitech G500 as
/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/0003:046D:C068.0006/input/input30
logitech-hidpp-device 0003:046D:C068.0006: input,hidraw5: USB HID
v1.11 Mouse [Logitech G500] on usb-0000:00:14.0-2/input0
logitech-hidpp-device 0003:046D:C068.0007: HID++ 1.0 device connected.
logitech-hidpp-device 0003:046D:C068.0007: multiplier = 8
input: Logitech G500 as
/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.1/0003:046D:C068.0007/input/input31
logitech-hidpp-device 0003:046D:C068.0007: input,hiddev97,hidraw6: USB
HID v1.11 Keyboard [Logitech G500] on usb-0000:00:14.0-2/input1
>
> Cheers,
> Benjamin
>
> > > > Le mer. 19 déc. 2018 à 21:35, Benjamin Tissoires
> > > > <benjamin.tissoires@redhat.com> a écrit :
> > > > >
> > > > > On Wed, Dec 19, 2018 at 11:57 AM Clément VUCHENER
> > > > > <clement.vuchener@gmail.com> wrote:
> > > > > >
> > > > > > Le sam. 15 déc. 2018 à 15:45, Clément VUCHENER
> > > > > > <clement.vuchener@gmail.com> a écrit :
> > > > > > >
> > > > > > > Le ven. 14 déc. 2018 à 19:37, Harry Cutts <hcutts@chromium.org> a écrit :
> > > > > > > >
> > > > > > > > Hi Clement,
> > > > > > > >
> > > > > > > > On Fri, 14 Dec 2018 at 05:47, Clément VUCHENER
> > > > > > > > <clement.vuchener@gmail.com> wrote:
> > > > > > > > > Hi, The G500s (and the G500 too, I think) does support the "scrolling
> > > > > > > > > acceleration" bit. If I set it, I get around 8 events for each wheel
> > > > > > > > > "click", this is what this driver expects, right? If I understood
> > > > > > > > > correctly, I should try this patch with the
> > > > > > > > > HIDPP_QUIRK_HI_RES_SCROLL_1P0 quirk set for my mouse.
> > > > > > > >
> > > > > > > > Thanks for the info! Yes, that should work.
> > > > > > >
> > > > > > > Well, it is not that simple. I get "Device not connected" errors for
> > > > > > > both interfaces of the mouse.
> > > > > >
> > > > > > I suspect the device is not responding because the hid device is not
> > > > > > started. When is hid_hw_start supposed to be called? It is called
> > > > > > early for HID_QUIRK_CLASS_G920 but later for other device. So the
> > > > > > device is not started when hidpp_is_connected is called. Is this
> > > > > > because most of the device in this driver are not real HID devices but
> > > > > > DJ devices? How should non-DJ devices be treated?
> > > > >
> > > > > Hi Clement,
> > > > >
> > > > > I have a series I sent last September that allows to support non DJ
> > > > > devices on logitech-hidpp
> > > > > (https://patchwork.kernel.org/project/linux-input/list/?series=16359).
> > > > >
> > > > > In its current form, with the latest upstream kernel, the series will
> > > > > oops during the .event() callback, which is easy enough to fix.
> > > > > However, I am currently trying to make it better as a second or third
> > > > > reading made me realized that there was a bunch of non-sense in it and
> > > > > a proper support would require slightly more work for the non unifying
> > > > > receiver case.
> > > > >
> > > > > I hope I'll be able to send out something by the end of the week.
> > > > >
> > > > > Cheers,
> > > > > Benjamin
^ permalink raw reply
* Re: [PATCH v3 7/8] HID: logitech: Enable high-resolution scrolling on Logitech mice
From: Benjamin Tissoires @ 2019-04-25 9:35 UTC (permalink / raw)
To: Clément VUCHENER
Cc: Harry Cutts, Peter Hutterer, open list:HID CORE LAYER,
Dmitry Torokhov, Jiri Kosina, Linus Torvalds, Nestor Lopez Casado,
lkml
In-Reply-To: <CAM4jgCrT7fAm1gi0L=Ux1GyxdH26cP8e_Dy36dEHF6Lf2F0rAQ@mail.gmail.com>
On Thu, Apr 25, 2019 at 11:29 AM Clément VUCHENER
<clement.vuchener@gmail.com> wrote:
>
> Le jeu. 25 avr. 2019 à 10:45, Benjamin Tissoires
> <benjamin.tissoires@redhat.com> a écrit :
> >
> > On Thu, Apr 25, 2019 at 10:25 AM Clément VUCHENER
> > <clement.vuchener@gmail.com> wrote:
> > >
> > > Le jeu. 25 avr. 2019 à 09:40, Benjamin Tissoires
> > > <benjamin.tissoires@redhat.com> a écrit :
> > > >
> > > > Hi Clément,
> > > >
> > > > On Wed, Apr 24, 2019 at 5:34 PM Clément VUCHENER
> > > > <clement.vuchener@gmail.com> wrote:
> > > > >
> > > > > Hi Benjamin,
> > > > >
> > > > > I tried again to add hi-res wheel support for the G500 with Hans de
> > > > > Goede's latest patch series you've just merged in for-5.2/logitech, it
> > > > > is much better but there is still some issues.
> > > > >
> > > > > The first one is the device index, I need to use device index 0
> > > > > instead 0xff. I added a quick and dirty quirk (stealing in the
> > > > > QUIRK_CLASS range since the normal quirk range looks full) to change
> > > > > the device index assigned in __hidpp_send_report. After that the
> > > > > device is correctly initialized and the wheel multiplier is set.
> > > >
> > > > Hmm, maybe we should restrain a little bit the reserved quirks...
> > > > But actually, .driver_data and .quirks are both unsigned long, so you
> > > > should be able to use the 64 bits.
> > >
> > > Only on 64 bits architectures, or is the kernel forcing long integers
> > > to be 64 bits everywhere?
> >
> > Damnit, you are correct, there is no such enforcement :/
> >
> > >
> > > >
> > > > >
> > > > > The second issue is that wheel values are not actually scaled
> > > > > according to the multiplier. I get 7/8 full scroll event for each
> > > > > wheel step. I think it happens because the mouse is split in two
> > > > > devices. The first device has the wheel events, and the second device
> > > > > has the HID++ reports. The wheel multiplier is only set on the second
> > > > > device (where the hi-res mode is enabled) and does not affect the
> > > > > wheel events from the first one.
> > > >
> > > > I would think this have to do with the device not accepting the
> > > > command instead. Can you share some raw logs of the events (ideally
> > > > with hid-recorder from
> > > > https://gitlab.freedesktop.org/libevdev/hid-tools)?
> > >
> > > I already checked with usbmon and double-checked by querying the
> > > register. The flag is set and accepted by the device and it behaves
> > > accordingly: it sends about 8 wheel events per step.
> >
> > OK, that's what I wanted to see.
> >
> > >
> > > hid-recorder takes hidraw nodes as parameters, how do I use it to
> > > record the initialization by the driver?
> >
> > You can't. But it doesn't really matter here because I wanted to check
> > what your mouse is actually sending after the initialization.
> >
> > So if I read correctly: the mouse is sending high res data but
> > evemu-recorder shows one REL_WHEEL event every 7/8 clicks?
>
> It is HID++ 1.0, there is no special high res data report, it sends
> standard HID mouse wheel report, but more of them.
>
> To be clear, here is a recording using the modified kernel. I moved
> the wheel one step up (8 events are generated), then one step down (8
> events again + a 2-event bump).
>
> # EVEMU 1.3
[snipped]
> E: 1.975014 8 00 00 00 00 00 00 01 00
>
> The hi-res events should +/-15 instead of +/-120, and less REL_WHEEL
> events should be generated. This looks like the multiplier is set to 1
> instead of 8.
>
> kernel log shows the multiplier is set but only for one of the two devices:
>
> input: Logitech G500 as
> /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/0003:046D:C068.0006/input/input25
> hid-generic 0003:046D:C068.0006: input,hidraw5: USB HID v1.11 Mouse
> [Logitech G500] on usb-0000:00:14.0-2/input0
> input: Logitech G500 Keyboard as
> /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.1/0003:046D:C068.0007/input/input26
> input: Logitech G500 Consumer Control as
> /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.1/0003:046D:C068.0007/input/input27
> hid-generic 0003:046D:C068.0007: input,hiddev97,hidraw6: USB HID v1.11
> Keyboard [Logitech G500] on usb-0000:00:14.0-2/input1
> input: Logitech G500 as
> /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/0003:046D:C068.0006/input/input30
> logitech-hidpp-device 0003:046D:C068.0006: input,hidraw5: USB HID
> v1.11 Mouse [Logitech G500] on usb-0000:00:14.0-2/input0
> logitech-hidpp-device 0003:046D:C068.0007: HID++ 1.0 device connected.
> logitech-hidpp-device 0003:046D:C068.0007: multiplier = 8
> input: Logitech G500 as
> /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.1/0003:046D:C068.0007/input/input31
> logitech-hidpp-device 0003:046D:C068.0007: input,hiddev97,hidraw6: USB
> HID v1.11 Keyboard [Logitech G500] on usb-0000:00:14.0-2/input1
>
Oh, now I see. And yes you are correct.
I wonder if we should not consider the mouse in hid-logitech-dj then.
And let hid-logitech-dj merge the 2 nodes together into one hidpp
device, and so we are facing a "regular" HID++ device which is
consistent.
Unfortunately, I am not sure I'll have the time to work on it this week :/
Cheers,
Benjamin
> >
> > > > > Le mer. 19 déc. 2018 à 21:35, Benjamin Tissoires
> > > > > <benjamin.tissoires@redhat.com> a écrit :
> > > > > >
> > > > > > On Wed, Dec 19, 2018 at 11:57 AM Clément VUCHENER
> > > > > > <clement.vuchener@gmail.com> wrote:
> > > > > > >
> > > > > > > Le sam. 15 déc. 2018 à 15:45, Clément VUCHENER
> > > > > > > <clement.vuchener@gmail.com> a écrit :
> > > > > > > >
> > > > > > > > Le ven. 14 déc. 2018 à 19:37, Harry Cutts <hcutts@chromium.org> a écrit :
> > > > > > > > >
> > > > > > > > > Hi Clement,
> > > > > > > > >
> > > > > > > > > On Fri, 14 Dec 2018 at 05:47, Clément VUCHENER
> > > > > > > > > <clement.vuchener@gmail.com> wrote:
> > > > > > > > > > Hi, The G500s (and the G500 too, I think) does support the "scrolling
> > > > > > > > > > acceleration" bit. If I set it, I get around 8 events for each wheel
> > > > > > > > > > "click", this is what this driver expects, right? If I understood
> > > > > > > > > > correctly, I should try this patch with the
> > > > > > > > > > HIDPP_QUIRK_HI_RES_SCROLL_1P0 quirk set for my mouse.
> > > > > > > > >
> > > > > > > > > Thanks for the info! Yes, that should work.
> > > > > > > >
> > > > > > > > Well, it is not that simple. I get "Device not connected" errors for
> > > > > > > > both interfaces of the mouse.
> > > > > > >
> > > > > > > I suspect the device is not responding because the hid device is not
> > > > > > > started. When is hid_hw_start supposed to be called? It is called
> > > > > > > early for HID_QUIRK_CLASS_G920 but later for other device. So the
> > > > > > > device is not started when hidpp_is_connected is called. Is this
> > > > > > > because most of the device in this driver are not real HID devices but
> > > > > > > DJ devices? How should non-DJ devices be treated?
> > > > > >
> > > > > > Hi Clement,
> > > > > >
> > > > > > I have a series I sent last September that allows to support non DJ
> > > > > > devices on logitech-hidpp
> > > > > > (https://patchwork.kernel.org/project/linux-input/list/?series=16359).
> > > > > >
> > > > > > In its current form, with the latest upstream kernel, the series will
> > > > > > oops during the .event() callback, which is easy enough to fix.
> > > > > > However, I am currently trying to make it better as a second or third
> > > > > > reading made me realized that there was a bunch of non-sense in it and
> > > > > > a proper support would require slightly more work for the non unifying
> > > > > > receiver case.
> > > > > >
> > > > > > I hope I'll be able to send out something by the end of the week.
> > > > > >
> > > > > > Cheers,
> > > > > > Benjamin
^ permalink raw reply
* Re: [PATCH 1/3] mfd: apple-ibridge: Add Apple iBridge MFD driver.
From: Benjamin Tissoires @ 2019-04-25 9:39 UTC (permalink / raw)
To: Life is hard, and then you die
Cc: Jiri Kosina, Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
Peter Meerwald-Stadler, Lee Jones, open list:HID CORE LAYER,
linux-iio, lkml
In-Reply-To: <20190425081948.GB31301@innovation.ch>
On Thu, Apr 25, 2019 at 10:19 AM Life is hard, and then you die
<ronald@innovation.ch> wrote:
>
>
> Hi Benjamin,
>
> Thank you for looking at this.
>
> On Wed, Apr 24, 2019 at 04:18:23PM +0200, Benjamin Tissoires wrote:
> > On Mon, Apr 22, 2019 at 5:13 AM Ronald Tschalär <ronald@innovation.ch> wrote:
> > >
> > > The iBridge device provides access to several devices, including:
> > > - the Touch Bar
> > > - the iSight webcam
> > > - the light sensor
> > > - the fingerprint sensor
> > >
> > > This driver provides the core support for managing the iBridge device
> > > and the access to the underlying devices. In particular, since the
> > > functionality for the touch bar and light sensor is exposed via USB HID
> > > interfaces, and the same HID device is used for multiple functions, this
> > > driver provides a multiplexing layer that allows multiple HID drivers to
> > > be registered for a given HID device. This allows the touch bar and ALS
> > > driver to be separated out into their own modules.
> >
> > Sorry for coming late to the party, but IMO this series is far too
> > complex for what you need.
> >
> > As I read this and the first comment of drivers/mfd/apple-ibridge.c,
> > you need to have a HID driver that multiplex 2 other sub drivers
> > through one USB communication.
> > For that, you are using MFD, platform driver and you own sauce instead
> > of creating a bus.
>
> Basically correct. To be a bit more precise, there are currently two
> hid-devices and two drivers (touchbar and als) involved, with
> connections as follows (pardon the ugly ascii art):
>
> hdev1 --- tb-drv
> /
> /
> /
> hdev2 --- als-drv
>
> i.e. the touchbar driver talks to both hdev's, and hdev2's events
> (reports) are processed by both drivers (though each handles different
> reports).
>
> > So, how about we reuse entirely the HID subsystem which already
> > provides the capability you need (assuming I am correct above).
> > hid-logitech-dj already does the same kind of stuff and you could:
> > - create drivers/hid/hid-ibridge.c that handles USB_ID_PRODUCT_IBRIDGE
> > - hid-ibridge will then register itself to the hid subsystem with a
> > call to hid_hw_start(hdev, HID_CONNECT_HIDRAW) and
> > hid_device_io_start(hdev) to enable the events (so you don't create
> > useless input nodes for it)
> > - then you add your 2 new devices by calling hid_allocate_device() and
> > then hid_add_device(). You can even create a new HID group
> > APPLE_IBRIDGE and allocate 2 new PIDs for them to distinguish them
> > from the actual USB device.
> > - then you have 2 brand new HID devices you can create their driver as
> > a regular ones.
> >
> > hid-ibridge.c would just need to behave like any other hid transport
> > driver (see logi_dj_ll_driver in drivers/hid/hid-logitech-dj.c) and
> > you can get rid of at least the MFD and the platform part of your
> > drivers.
> >
> > Does it makes sense or am I missing something obvious in the middle?
>
> Yes, I think I understand, and I think this can work. Basically,
> instead of demux'ing at the hid-driver level as I am doing now (i.e.
> the iBridge hid-driver forwarding calls to the sub-hid-drivers), we
> demux at the hid-device level (events forwarded from iBridge hdev to
> all "virtual" sub-hdev's, and requests from sub-hdev's forwarded to
> the original hdev via an iBridge ll_driver attached to the
> sub-hdev's).
>
> So I would need to create 3 new "virtual" hid-devices (instances) as
> follows:
>
> hdev1 --- vhdev1 --- tb-drv
> /
> -- vhdev2 --
> /
> hdev2 --- vhdev3 --- als-drv
>
> (vhdev1 is probably not strictly necessary, but makes things more
> consistent).
Oh, ok.
How about the following:
hdev1 and hdev2 are merged together in hid-apple-ibridge.c, and then
this driver creates 2 virtual hid drivers that are consistent
like
hdev1---ibridge-drv---vhdev1---tb-drv
hdev2--/ \--vhdev2---als-drv
>
> > I have one other comment below.
> >
> > Note that I haven't read the whole series as I'd like to first get
> > your feedback with my comment above.
>
> Agreed: let's first get the overall strategy stabilized (also so I
> can avoid having to rewrite the code too many more times ;-) ).
>
> [snip]
> > > +static __u8 *appleib_report_fixup(struct hid_device *hdev, __u8 *rdesc,
> > > + unsigned int *rsize)
> > > +{
> > > + /* Some fields have a size of 64 bits, which according to HID 1.11
> > > + * Section 8.4 is not valid ("An item field cannot span more than 4
> > > + * bytes in a report"). Furthermore, hid_field_extract() complains
> >
> > this must have been fixed in 94a9992f7dbdfb28976b565af220e0c4a117144a
> > which is part of v5.1, so not sure you actually need the report
> > descriptor fixup at all.
>
> Wasn't aware of this change - thanks. Yes, with that the warning
> message should be gone and this fixup can be avoided.
>
> One thing I find strange, though, is that while 94a9992f7dbd changes
> the condition at which the warning is emitted, it still truncates the
> value to 32 bits, albeit completely silently now for lengths between
> 32 and 256 bits. I.e. I'm somewhat surprised that hid_field_extract()
> (and __extract() ) weren't updated to actually return the full values
> for longer fields. Either that, or the callers of hid_field_extract()
> changed to read longer fields in 32 bit chunks.
facepalm.
Yep this commit is just hiding the dust under the carpet. Let's raise
that and request a revert :/
Cheers,
Benjamin
>
>
> Cheers,
>
> Ronald
>
^ permalink raw reply
* Re: [PATCH] HID: Increase maximum report size allowed by hid_field_extract()
From: Benjamin Tissoires @ 2019-04-25 9:42 UTC (permalink / raw)
To: Kai-Heng Feng
Cc: Jiri Kosina, open list:HID CORE LAYER, lkml, Ronald Tschalär
In-Reply-To: <20190308051117.21899-1-kai.heng.feng@canonical.com>
Hi,
On Fri, Mar 8, 2019 at 6:11 AM Kai-Heng Feng
<kai.heng.feng@canonical.com> wrote:
>
> Commit 71f6fa90a353 ("HID: increase maximum global item tag report size
> to 256") increases the max report size from 128 to 256.
>
> We also need to update the report size in hid_field_extract() otherwise
> it complains and truncates now valid report size:
> [ 406.165461] hid-sensor-hub 001F:8086:22D8.0002: hid_field_extract() called with n (192) > 32! (kworker/5:1)
>
> BugLink: https://bugs.launchpad.net/bugs/1818547
> Fixes: 71f6fa90a353 ("HID: increase maximum global item tag report size to 256")
> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
> ---
> drivers/hid/hid-core.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
> index 9993b692598f..860e21ec6a49 100644
> --- a/drivers/hid/hid-core.c
> +++ b/drivers/hid/hid-core.c
> @@ -1301,10 +1301,10 @@ static u32 __extract(u8 *report, unsigned offset, int n)
> u32 hid_field_extract(const struct hid_device *hid, u8 *report,
> unsigned offset, unsigned n)
Ronald (Cc-ed) raised quite a good point:
what's the benefit of removing the error message if this function (and
__extract) can only report an unsigned 32 bits value?
My take is we should revert 94a9992f7dbdfb28976b upstream and think at
a better solution.
Cheers,
Benjamin
> {
> - if (n > 32) {
> - hid_warn(hid, "hid_field_extract() called with n (%d) > 32! (%s)\n",
> + if (n > 256) {
> + hid_warn(hid, "hid_field_extract() called with n (%d) > 256! (%s)\n",
> n, current->comm);
> - n = 32;
> + n = 256;
> }
>
> return __extract(report, offset, n);
> --
> 2.17.1
>
^ permalink raw reply
* Re: [PATCH v3 7/8] HID: logitech: Enable high-resolution scrolling on Logitech mice
From: Clément VUCHENER @ 2019-04-25 12:35 UTC (permalink / raw)
To: Benjamin Tissoires
Cc: Harry Cutts, Peter Hutterer, open list:HID CORE LAYER,
Dmitry Torokhov, Jiri Kosina, Linus Torvalds, Nestor Lopez Casado,
lkml
In-Reply-To: <CAO-hwJKYtNMYEY1iFm-Nh0_+ZJBvPrXmBUPftwbuFd0ugqWVww@mail.gmail.com>
Le jeu. 25 avr. 2019 à 11:35, Benjamin Tissoires
<benjamin.tissoires@redhat.com> a écrit :
>
> On Thu, Apr 25, 2019 at 11:29 AM Clément VUCHENER
> <clement.vuchener@gmail.com> wrote:
> >
> > Le jeu. 25 avr. 2019 à 10:45, Benjamin Tissoires
> > <benjamin.tissoires@redhat.com> a écrit :
> > >
> > > On Thu, Apr 25, 2019 at 10:25 AM Clément VUCHENER
> > > <clement.vuchener@gmail.com> wrote:
> > > >
> > > > Le jeu. 25 avr. 2019 à 09:40, Benjamin Tissoires
> > > > <benjamin.tissoires@redhat.com> a écrit :
> > > > >
> > > > > Hi Clément,
> > > > >
> > > > > On Wed, Apr 24, 2019 at 5:34 PM Clément VUCHENER
> > > > > <clement.vuchener@gmail.com> wrote:
> > > > > >
> > > > > > Hi Benjamin,
> > > > > >
> > > > > > I tried again to add hi-res wheel support for the G500 with Hans de
> > > > > > Goede's latest patch series you've just merged in for-5.2/logitech, it
> > > > > > is much better but there is still some issues.
> > > > > >
> > > > > > The first one is the device index, I need to use device index 0
> > > > > > instead 0xff. I added a quick and dirty quirk (stealing in the
> > > > > > QUIRK_CLASS range since the normal quirk range looks full) to change
> > > > > > the device index assigned in __hidpp_send_report. After that the
> > > > > > device is correctly initialized and the wheel multiplier is set.
> > > > >
> > > > > Hmm, maybe we should restrain a little bit the reserved quirks...
> > > > > But actually, .driver_data and .quirks are both unsigned long, so you
> > > > > should be able to use the 64 bits.
> > > >
> > > > Only on 64 bits architectures, or is the kernel forcing long integers
> > > > to be 64 bits everywhere?
> > >
> > > Damnit, you are correct, there is no such enforcement :/
> > >
> > > >
> > > > >
> > > > > >
> > > > > > The second issue is that wheel values are not actually scaled
> > > > > > according to the multiplier. I get 7/8 full scroll event for each
> > > > > > wheel step. I think it happens because the mouse is split in two
> > > > > > devices. The first device has the wheel events, and the second device
> > > > > > has the HID++ reports. The wheel multiplier is only set on the second
> > > > > > device (where the hi-res mode is enabled) and does not affect the
> > > > > > wheel events from the first one.
> > > > >
> > > > > I would think this have to do with the device not accepting the
> > > > > command instead. Can you share some raw logs of the events (ideally
> > > > > with hid-recorder from
> > > > > https://gitlab.freedesktop.org/libevdev/hid-tools)?
> > > >
> > > > I already checked with usbmon and double-checked by querying the
> > > > register. The flag is set and accepted by the device and it behaves
> > > > accordingly: it sends about 8 wheel events per step.
> > >
> > > OK, that's what I wanted to see.
> > >
> > > >
> > > > hid-recorder takes hidraw nodes as parameters, how do I use it to
> > > > record the initialization by the driver?
> > >
> > > You can't. But it doesn't really matter here because I wanted to check
> > > what your mouse is actually sending after the initialization.
> > >
> > > So if I read correctly: the mouse is sending high res data but
> > > evemu-recorder shows one REL_WHEEL event every 7/8 clicks?
> >
> > It is HID++ 1.0, there is no special high res data report, it sends
> > standard HID mouse wheel report, but more of them.
> >
> > To be clear, here is a recording using the modified kernel. I moved
> > the wheel one step up (8 events are generated), then one step down (8
> > events again + a 2-event bump).
> >
> > # EVEMU 1.3
> [snipped]
> > E: 1.975014 8 00 00 00 00 00 00 01 00
> >
> > The hi-res events should +/-15 instead of +/-120, and less REL_WHEEL
> > events should be generated. This looks like the multiplier is set to 1
> > instead of 8.
> >
> > kernel log shows the multiplier is set but only for one of the two devices:
> >
> > input: Logitech G500 as
> > /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/0003:046D:C068.0006/input/input25
> > hid-generic 0003:046D:C068.0006: input,hidraw5: USB HID v1.11 Mouse
> > [Logitech G500] on usb-0000:00:14.0-2/input0
> > input: Logitech G500 Keyboard as
> > /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.1/0003:046D:C068.0007/input/input26
> > input: Logitech G500 Consumer Control as
> > /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.1/0003:046D:C068.0007/input/input27
> > hid-generic 0003:046D:C068.0007: input,hiddev97,hidraw6: USB HID v1.11
> > Keyboard [Logitech G500] on usb-0000:00:14.0-2/input1
> > input: Logitech G500 as
> > /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/0003:046D:C068.0006/input/input30
> > logitech-hidpp-device 0003:046D:C068.0006: input,hidraw5: USB HID
> > v1.11 Mouse [Logitech G500] on usb-0000:00:14.0-2/input0
> > logitech-hidpp-device 0003:046D:C068.0007: HID++ 1.0 device connected.
> > logitech-hidpp-device 0003:046D:C068.0007: multiplier = 8
> > input: Logitech G500 as
> > /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.1/0003:046D:C068.0007/input/input31
> > logitech-hidpp-device 0003:046D:C068.0007: input,hiddev97,hidraw6: USB
> > HID v1.11 Keyboard [Logitech G500] on usb-0000:00:14.0-2/input1
> >
>
> Oh, now I see. And yes you are correct.
>
> I wonder if we should not consider the mouse in hid-logitech-dj then.
> And let hid-logitech-dj merge the 2 nodes together into one hidpp
> device, and so we are facing a "regular" HID++ device which is
> consistent.
This would change how userspace see the devices, isn't it? And I don't
like the dj hidraw nodes, they mess with the device index: you get
answers with a device index different from the one used in the
corresponding request.
>
> Unfortunately, I am not sure I'll have the time to work on it this week :/
>
> Cheers,
> Benjamin
>
> > >
> > > > > > Le mer. 19 déc. 2018 à 21:35, Benjamin Tissoires
> > > > > > <benjamin.tissoires@redhat.com> a écrit :
> > > > > > >
> > > > > > > On Wed, Dec 19, 2018 at 11:57 AM Clément VUCHENER
> > > > > > > <clement.vuchener@gmail.com> wrote:
> > > > > > > >
> > > > > > > > Le sam. 15 déc. 2018 à 15:45, Clément VUCHENER
> > > > > > > > <clement.vuchener@gmail.com> a écrit :
> > > > > > > > >
> > > > > > > > > Le ven. 14 déc. 2018 à 19:37, Harry Cutts <hcutts@chromium.org> a écrit :
> > > > > > > > > >
> > > > > > > > > > Hi Clement,
> > > > > > > > > >
> > > > > > > > > > On Fri, 14 Dec 2018 at 05:47, Clément VUCHENER
> > > > > > > > > > <clement.vuchener@gmail.com> wrote:
> > > > > > > > > > > Hi, The G500s (and the G500 too, I think) does support the "scrolling
> > > > > > > > > > > acceleration" bit. If I set it, I get around 8 events for each wheel
> > > > > > > > > > > "click", this is what this driver expects, right? If I understood
> > > > > > > > > > > correctly, I should try this patch with the
> > > > > > > > > > > HIDPP_QUIRK_HI_RES_SCROLL_1P0 quirk set for my mouse.
> > > > > > > > > >
> > > > > > > > > > Thanks for the info! Yes, that should work.
> > > > > > > > >
> > > > > > > > > Well, it is not that simple. I get "Device not connected" errors for
> > > > > > > > > both interfaces of the mouse.
> > > > > > > >
> > > > > > > > I suspect the device is not responding because the hid device is not
> > > > > > > > started. When is hid_hw_start supposed to be called? It is called
> > > > > > > > early for HID_QUIRK_CLASS_G920 but later for other device. So the
> > > > > > > > device is not started when hidpp_is_connected is called. Is this
> > > > > > > > because most of the device in this driver are not real HID devices but
> > > > > > > > DJ devices? How should non-DJ devices be treated?
> > > > > > >
> > > > > > > Hi Clement,
> > > > > > >
> > > > > > > I have a series I sent last September that allows to support non DJ
> > > > > > > devices on logitech-hidpp
> > > > > > > (https://patchwork.kernel.org/project/linux-input/list/?series=16359).
> > > > > > >
> > > > > > > In its current form, with the latest upstream kernel, the series will
> > > > > > > oops during the .event() callback, which is easy enough to fix.
> > > > > > > However, I am currently trying to make it better as a second or third
> > > > > > > reading made me realized that there was a bunch of non-sense in it and
> > > > > > > a proper support would require slightly more work for the non unifying
> > > > > > > receiver case.
> > > > > > >
> > > > > > > I hope I'll be able to send out something by the end of the week.
> > > > > > >
> > > > > > > Cheers,
> > > > > > > Benjamin
^ permalink raw reply
* Re: [PATCH v3 12/26] compat_ioctl: move more drivers to compat_ptr_ioctl
From: Mauro Carvalho Chehab @ 2019-04-25 15:21 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Alexander Viro, linux-fsdevel, y2038, linux-kernel,
Jason Gunthorpe, Daniel Vetter, Greg Kroah-Hartman, David Sterba,
Darren Hart, Jonathan Cameron, Bjorn Andersson, devel, qat-linux,
linux-crypto, linux-media, dri-devel, linaro-mm-sig, amd-gfx,
linux-input, linux-iio, linux-rdma, linux-nvdimm, linux-nvme,
linux-pci
In-Reply-To: <20190416202701.127745-1-arnd@arndb.de>
Em Tue, 16 Apr 2019 22:25:33 +0200
Arnd Bergmann <arnd@arndb.de> escreveu:
> The .ioctl and .compat_ioctl file operations have the same prototype so
> they can both point to the same function, which works great almost all
> the time when all the commands are compatible.
>
> One exception is the s390 architecture, where a compat pointer is only
> 31 bit wide, and converting it into a 64-bit pointer requires calling
> compat_ptr(). Most drivers here will ever run in s390, but since we now
> have a generic helper for it, it's easy enough to use it consistently.
>
> I double-checked all these drivers to ensure that all ioctl arguments
> are used as pointers or are ignored, but are not interpreted as integer
> values.
>
> Acked-by: Jason Gunthorpe <jgg@mellanox.com>
> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> Acked-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Acked-by: David Sterba <dsterba@suse.com>
> Acked-by: Darren Hart (VMware) <dvhart@infradead.org>
> Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/android/binder.c | 2 +-
> drivers/crypto/qat/qat_common/adf_ctl_drv.c | 2 +-
> drivers/dma-buf/dma-buf.c | 4 +---
> drivers/dma-buf/sw_sync.c | 2 +-
> drivers/dma-buf/sync_file.c | 2 +-
> drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 2 +-
> drivers/hid/hidraw.c | 4 +---
> drivers/iio/industrialio-core.c | 2 +-
> drivers/infiniband/core/uverbs_main.c | 4 ++--
> drivers/media/rc/lirc_dev.c | 4 +---
If I understand your patch description well, using compat_ptr_ioctl
only works if the driver is not for s390, right?
In thesis, nothing prevents to use LIRC API on s390 - as this isn't
a driver but, instead, RC core feature to expose raw remote controller
codes to userspace.
Yet, lirc_dev will only work if the system has a remote controller driver.
Well, we don't have any for s390. Despite we don't have such driver,
I can't possible see why someone would use a remote controller for a
mainframe :-p
Anyway, if someone ever come with such driver/usecase, reverting this
change (or adding an #ifdef to check if arch is 390) should be
pretty straight forward.
So:
Acked-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
> drivers/mfd/cros_ec_dev.c | 4 +---
> drivers/misc/vmw_vmci/vmci_host.c | 2 +-
> drivers/nvdimm/bus.c | 4 ++--
> drivers/nvme/host/core.c | 2 +-
> drivers/pci/switch/switchtec.c | 2 +-
> drivers/platform/x86/wmi.c | 2 +-
> drivers/rpmsg/rpmsg_char.c | 4 ++--
> drivers/sbus/char/display7seg.c | 2 +-
> drivers/sbus/char/envctrl.c | 4 +---
> drivers/scsi/3w-xxxx.c | 4 +---
> drivers/scsi/cxlflash/main.c | 2 +-
> drivers/scsi/esas2r/esas2r_main.c | 2 +-
> drivers/scsi/pmcraid.c | 4 +---
> drivers/staging/android/ion/ion.c | 4 +---
> drivers/staging/vme/devices/vme_user.c | 2 +-
> drivers/tee/tee_core.c | 2 +-
> drivers/usb/class/cdc-wdm.c | 2 +-
> drivers/usb/class/usbtmc.c | 4 +---
> drivers/virt/fsl_hypervisor.c | 2 +-
> fs/btrfs/super.c | 2 +-
> fs/ceph/dir.c | 2 +-
> fs/ceph/file.c | 2 +-
> fs/fuse/dev.c | 2 +-
> fs/notify/fanotify/fanotify_user.c | 2 +-
> fs/userfaultfd.c | 2 +-
> net/rfkill/core.c | 2 +-
> 36 files changed, 39 insertions(+), 57 deletions(-)
>
> diff --git a/drivers/android/binder.c b/drivers/android/binder.c
> index 4b9c7ca492e6..48109ade7234 100644
> --- a/drivers/android/binder.c
> +++ b/drivers/android/binder.c
> @@ -5998,7 +5998,7 @@ const struct file_operations binder_fops = {
> .owner = THIS_MODULE,
> .poll = binder_poll,
> .unlocked_ioctl = binder_ioctl,
> - .compat_ioctl = binder_ioctl,
> + .compat_ioctl = compat_ptr_ioctl,
> .mmap = binder_mmap,
> .open = binder_open,
> .flush = binder_flush,
> diff --git a/drivers/crypto/qat/qat_common/adf_ctl_drv.c b/drivers/crypto/qat/qat_common/adf_ctl_drv.c
> index abc7a7f64d64..ef0e482ee04f 100644
> --- a/drivers/crypto/qat/qat_common/adf_ctl_drv.c
> +++ b/drivers/crypto/qat/qat_common/adf_ctl_drv.c
> @@ -68,7 +68,7 @@ static long adf_ctl_ioctl(struct file *fp, unsigned int cmd, unsigned long arg);
> static const struct file_operations adf_ctl_ops = {
> .owner = THIS_MODULE,
> .unlocked_ioctl = adf_ctl_ioctl,
> - .compat_ioctl = adf_ctl_ioctl,
> + .compat_ioctl = compat_ptr_ioctl,
> };
>
> struct adf_ctl_drv_info {
> diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
> index 7c858020d14b..0cb336fe6324 100644
> --- a/drivers/dma-buf/dma-buf.c
> +++ b/drivers/dma-buf/dma-buf.c
> @@ -325,9 +325,7 @@ static const struct file_operations dma_buf_fops = {
> .llseek = dma_buf_llseek,
> .poll = dma_buf_poll,
> .unlocked_ioctl = dma_buf_ioctl,
> -#ifdef CONFIG_COMPAT
> - .compat_ioctl = dma_buf_ioctl,
> -#endif
> + .compat_ioctl = compat_ptr_ioctl,
> };
>
> /*
> diff --git a/drivers/dma-buf/sw_sync.c b/drivers/dma-buf/sw_sync.c
> index 32dcf7b4c935..411de6a8a0ad 100644
> --- a/drivers/dma-buf/sw_sync.c
> +++ b/drivers/dma-buf/sw_sync.c
> @@ -419,5 +419,5 @@ const struct file_operations sw_sync_debugfs_fops = {
> .open = sw_sync_debugfs_open,
> .release = sw_sync_debugfs_release,
> .unlocked_ioctl = sw_sync_ioctl,
> - .compat_ioctl = sw_sync_ioctl,
> + .compat_ioctl = compat_ptr_ioctl,
> };
> diff --git a/drivers/dma-buf/sync_file.c b/drivers/dma-buf/sync_file.c
> index 4f6305ca52c8..0949f91eb85f 100644
> --- a/drivers/dma-buf/sync_file.c
> +++ b/drivers/dma-buf/sync_file.c
> @@ -488,5 +488,5 @@ static const struct file_operations sync_file_fops = {
> .release = sync_file_release,
> .poll = sync_file_poll,
> .unlocked_ioctl = sync_file_ioctl,
> - .compat_ioctl = sync_file_ioctl,
> + .compat_ioctl = compat_ptr_ioctl,
> };
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
> index 083bd8114db1..5d6ac7885aa7 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
> @@ -49,7 +49,7 @@ static const char kfd_dev_name[] = "kfd";
> static const struct file_operations kfd_fops = {
> .owner = THIS_MODULE,
> .unlocked_ioctl = kfd_ioctl,
> - .compat_ioctl = kfd_ioctl,
> + .compat_ioctl = compat_ptr_ioctl,
> .open = kfd_open,
> .mmap = kfd_mmap,
> };
> diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c
> index 9fc51eff1079..e7284d38b66d 100644
> --- a/drivers/hid/hidraw.c
> +++ b/drivers/hid/hidraw.c
> @@ -476,9 +476,7 @@ static const struct file_operations hidraw_ops = {
> .release = hidraw_release,
> .unlocked_ioctl = hidraw_ioctl,
> .fasync = hidraw_fasync,
> -#ifdef CONFIG_COMPAT
> - .compat_ioctl = hidraw_ioctl,
> -#endif
> + .compat_ioctl = compat_ptr_ioctl,
> .llseek = noop_llseek,
> };
>
> diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
> index 4700fd5d8c90..eed1bea257b4 100644
> --- a/drivers/iio/industrialio-core.c
> +++ b/drivers/iio/industrialio-core.c
> @@ -1635,7 +1635,7 @@ static const struct file_operations iio_buffer_fileops = {
> .owner = THIS_MODULE,
> .llseek = noop_llseek,
> .unlocked_ioctl = iio_ioctl,
> - .compat_ioctl = iio_ioctl,
> + .compat_ioctl = compat_ptr_ioctl,
> };
>
> static int iio_check_unique_scan_index(struct iio_dev *indio_dev)
> diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c
> index 70b7d80431a9..ac4321d7c800 100644
> --- a/drivers/infiniband/core/uverbs_main.c
> +++ b/drivers/infiniband/core/uverbs_main.c
> @@ -1120,7 +1120,7 @@ static const struct file_operations uverbs_fops = {
> .release = ib_uverbs_close,
> .llseek = no_llseek,
> .unlocked_ioctl = ib_uverbs_ioctl,
> - .compat_ioctl = ib_uverbs_ioctl,
> + .compat_ioctl = compat_ptr_ioctl,
> };
>
> static const struct file_operations uverbs_mmap_fops = {
> @@ -1131,7 +1131,7 @@ static const struct file_operations uverbs_mmap_fops = {
> .release = ib_uverbs_close,
> .llseek = no_llseek,
> .unlocked_ioctl = ib_uverbs_ioctl,
> - .compat_ioctl = ib_uverbs_ioctl,
> + .compat_ioctl = compat_ptr_ioctl,
> };
>
> static struct ib_client uverbs_client = {
> diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c
> index f862f1b7f996..9ccc7e9cbc8e 100644
> --- a/drivers/media/rc/lirc_dev.c
> +++ b/drivers/media/rc/lirc_dev.c
> @@ -730,9 +730,7 @@ static const struct file_operations lirc_fops = {
> .owner = THIS_MODULE,
> .write = ir_lirc_transmit_ir,
> .unlocked_ioctl = ir_lirc_ioctl,
> -#ifdef CONFIG_COMPAT
> - .compat_ioctl = ir_lirc_ioctl,
> -#endif
> + .compat_ioctl = compat_ptr_ioctl,
> .read = ir_lirc_read,
> .poll = ir_lirc_poll,
> .open = ir_lirc_open,
> diff --git a/drivers/mfd/cros_ec_dev.c b/drivers/mfd/cros_ec_dev.c
> index d275deaecb12..4a602a40d75c 100644
> --- a/drivers/mfd/cros_ec_dev.c
> +++ b/drivers/mfd/cros_ec_dev.c
> @@ -251,9 +251,7 @@ static const struct file_operations fops = {
> .release = ec_device_release,
> .read = ec_device_read,
> .unlocked_ioctl = ec_device_ioctl,
> -#ifdef CONFIG_COMPAT
> - .compat_ioctl = ec_device_ioctl,
> -#endif
> + .compat_ioctl = compat_ptr_ioctl,
> };
>
> static void cros_ec_class_release(struct device *dev)
> diff --git a/drivers/misc/vmw_vmci/vmci_host.c b/drivers/misc/vmw_vmci/vmci_host.c
> index 997f92543dd4..5bb406dabe85 100644
> --- a/drivers/misc/vmw_vmci/vmci_host.c
> +++ b/drivers/misc/vmw_vmci/vmci_host.c
> @@ -969,7 +969,7 @@ static const struct file_operations vmuser_fops = {
> .release = vmci_host_close,
> .poll = vmci_host_poll,
> .unlocked_ioctl = vmci_host_unlocked_ioctl,
> - .compat_ioctl = vmci_host_unlocked_ioctl,
> + .compat_ioctl = compat_ptr_ioctl,
> };
>
> static struct miscdevice vmci_host_miscdev = {
> diff --git a/drivers/nvdimm/bus.c b/drivers/nvdimm/bus.c
> index 7bbff0af29b2..065ebd584482 100644
> --- a/drivers/nvdimm/bus.c
> +++ b/drivers/nvdimm/bus.c
> @@ -1167,7 +1167,7 @@ static const struct file_operations nvdimm_bus_fops = {
> .owner = THIS_MODULE,
> .open = nd_open,
> .unlocked_ioctl = nd_ioctl,
> - .compat_ioctl = nd_ioctl,
> + .compat_ioctl = compat_ptr_ioctl,
> .llseek = noop_llseek,
> };
>
> @@ -1175,7 +1175,7 @@ static const struct file_operations nvdimm_fops = {
> .owner = THIS_MODULE,
> .open = nd_open,
> .unlocked_ioctl = nvdimm_ioctl,
> - .compat_ioctl = nvdimm_ioctl,
> + .compat_ioctl = compat_ptr_ioctl,
> .llseek = noop_llseek,
> };
>
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 2c43e12b70af..560929bee5ce 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -2739,7 +2739,7 @@ static const struct file_operations nvme_dev_fops = {
> .owner = THIS_MODULE,
> .open = nvme_dev_open,
> .unlocked_ioctl = nvme_dev_ioctl,
> - .compat_ioctl = nvme_dev_ioctl,
> + .compat_ioctl = compat_ptr_ioctl,
> };
>
> static ssize_t nvme_sysfs_reset(struct device *dev,
> diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c
> index e22766c79fe9..3a54b4b616e2 100644
> --- a/drivers/pci/switch/switchtec.c
> +++ b/drivers/pci/switch/switchtec.c
> @@ -1006,7 +1006,7 @@ static const struct file_operations switchtec_fops = {
> .read = switchtec_dev_read,
> .poll = switchtec_dev_poll,
> .unlocked_ioctl = switchtec_dev_ioctl,
> - .compat_ioctl = switchtec_dev_ioctl,
> + .compat_ioctl = compat_ptr_ioctl,
> };
>
> static void link_event_work(struct work_struct *work)
> diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
> index 7b26b6ccf1a0..dded9cef42f4 100644
> --- a/drivers/platform/x86/wmi.c
> +++ b/drivers/platform/x86/wmi.c
> @@ -889,7 +889,7 @@ static const struct file_operations wmi_fops = {
> .read = wmi_char_read,
> .open = wmi_char_open,
> .unlocked_ioctl = wmi_ioctl,
> - .compat_ioctl = wmi_ioctl,
> + .compat_ioctl = compat_ptr_ioctl,
> };
>
> static int wmi_dev_probe(struct device *dev)
> diff --git a/drivers/rpmsg/rpmsg_char.c b/drivers/rpmsg/rpmsg_char.c
> index eea5ebbb5119..507bfe163883 100644
> --- a/drivers/rpmsg/rpmsg_char.c
> +++ b/drivers/rpmsg/rpmsg_char.c
> @@ -290,7 +290,7 @@ static const struct file_operations rpmsg_eptdev_fops = {
> .write_iter = rpmsg_eptdev_write_iter,
> .poll = rpmsg_eptdev_poll,
> .unlocked_ioctl = rpmsg_eptdev_ioctl,
> - .compat_ioctl = rpmsg_eptdev_ioctl,
> + .compat_ioctl = compat_ptr_ioctl,
> };
>
> static ssize_t name_show(struct device *dev, struct device_attribute *attr,
> @@ -451,7 +451,7 @@ static const struct file_operations rpmsg_ctrldev_fops = {
> .open = rpmsg_ctrldev_open,
> .release = rpmsg_ctrldev_release,
> .unlocked_ioctl = rpmsg_ctrldev_ioctl,
> - .compat_ioctl = rpmsg_ctrldev_ioctl,
> + .compat_ioctl = compat_ptr_ioctl,
> };
>
> static void rpmsg_ctrldev_release_device(struct device *dev)
> diff --git a/drivers/sbus/char/display7seg.c b/drivers/sbus/char/display7seg.c
> index a36e4cf1841d..c9f60656f54d 100644
> --- a/drivers/sbus/char/display7seg.c
> +++ b/drivers/sbus/char/display7seg.c
> @@ -155,7 +155,7 @@ static long d7s_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
> static const struct file_operations d7s_fops = {
> .owner = THIS_MODULE,
> .unlocked_ioctl = d7s_ioctl,
> - .compat_ioctl = d7s_ioctl,
> + .compat_ioctl = compat_ptr_ioctl,
> .open = d7s_open,
> .release = d7s_release,
> .llseek = noop_llseek,
> diff --git a/drivers/sbus/char/envctrl.c b/drivers/sbus/char/envctrl.c
> index 1a6e7224017c..dd2dfa85fc68 100644
> --- a/drivers/sbus/char/envctrl.c
> +++ b/drivers/sbus/char/envctrl.c
> @@ -714,9 +714,7 @@ static const struct file_operations envctrl_fops = {
> .owner = THIS_MODULE,
> .read = envctrl_read,
> .unlocked_ioctl = envctrl_ioctl,
> -#ifdef CONFIG_COMPAT
> - .compat_ioctl = envctrl_ioctl,
> -#endif
> + .compat_ioctl = compat_ptr_ioctl,
> .open = envctrl_open,
> .release = envctrl_release,
> .llseek = noop_llseek,
> diff --git a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c
> index 2b1e0d503020..fb6444d0409c 100644
> --- a/drivers/scsi/3w-xxxx.c
> +++ b/drivers/scsi/3w-xxxx.c
> @@ -1049,9 +1049,7 @@ static int tw_chrdev_open(struct inode *inode, struct file *file)
> static const struct file_operations tw_fops = {
> .owner = THIS_MODULE,
> .unlocked_ioctl = tw_chrdev_ioctl,
> -#ifdef CONFIG_COMPAT
> - .compat_ioctl = tw_chrdev_ioctl,
> -#endif
> + .compat_ioctl = compat_ptr_ioctl,
> .open = tw_chrdev_open,
> .release = NULL,
> .llseek = noop_llseek,
> diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c
> index 7096810fd222..e13d5de1d76e 100644
> --- a/drivers/scsi/cxlflash/main.c
> +++ b/drivers/scsi/cxlflash/main.c
> @@ -3589,7 +3589,7 @@ static const struct file_operations cxlflash_chr_fops = {
> .owner = THIS_MODULE,
> .open = cxlflash_chr_open,
> .unlocked_ioctl = cxlflash_chr_ioctl,
> - .compat_ioctl = cxlflash_chr_ioctl,
> + .compat_ioctl = compat_ptr_ioctl,
> };
>
> /**
> diff --git a/drivers/scsi/esas2r/esas2r_main.c b/drivers/scsi/esas2r/esas2r_main.c
> index fdbda5c05aa0..80c5a235d193 100644
> --- a/drivers/scsi/esas2r/esas2r_main.c
> +++ b/drivers/scsi/esas2r/esas2r_main.c
> @@ -613,7 +613,7 @@ static int __init esas2r_init(void)
>
> /* Handle ioctl calls to "/proc/scsi/esas2r/ATTOnode" */
> static const struct file_operations esas2r_proc_fops = {
> - .compat_ioctl = esas2r_proc_ioctl,
> + .compat_ioctl = compat_ptr_ioctl,
> .unlocked_ioctl = esas2r_proc_ioctl,
> };
>
> diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
> index e338d7a4f571..c0a1a1218c56 100644
> --- a/drivers/scsi/pmcraid.c
> +++ b/drivers/scsi/pmcraid.c
> @@ -3988,9 +3988,7 @@ static const struct file_operations pmcraid_fops = {
> .open = pmcraid_chr_open,
> .fasync = pmcraid_chr_fasync,
> .unlocked_ioctl = pmcraid_chr_ioctl,
> -#ifdef CONFIG_COMPAT
> - .compat_ioctl = pmcraid_chr_ioctl,
> -#endif
> + .compat_ioctl = compat_ptr_ioctl,
> .llseek = noop_llseek,
> };
>
> diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
> index 92c2914239e3..1663c163edca 100644
> --- a/drivers/staging/android/ion/ion.c
> +++ b/drivers/staging/android/ion/ion.c
> @@ -567,9 +567,7 @@ static long ion_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
> static const struct file_operations ion_fops = {
> .owner = THIS_MODULE,
> .unlocked_ioctl = ion_ioctl,
> -#ifdef CONFIG_COMPAT
> - .compat_ioctl = ion_ioctl,
> -#endif
> + .compat_ioctl = compat_ptr_ioctl,
> };
>
> static int debug_shrink_set(void *data, u64 val)
> diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
> index 6a33aaa1a49f..fd0ea4dbcb91 100644
> --- a/drivers/staging/vme/devices/vme_user.c
> +++ b/drivers/staging/vme/devices/vme_user.c
> @@ -494,7 +494,7 @@ static const struct file_operations vme_user_fops = {
> .write = vme_user_write,
> .llseek = vme_user_llseek,
> .unlocked_ioctl = vme_user_unlocked_ioctl,
> - .compat_ioctl = vme_user_unlocked_ioctl,
> + .compat_ioctl = compat_ptr_ioctl,
> .mmap = vme_user_mmap,
> };
>
> diff --git a/drivers/tee/tee_core.c b/drivers/tee/tee_core.c
> index 17c64fccbb10..eb97acf09868 100644
> --- a/drivers/tee/tee_core.c
> +++ b/drivers/tee/tee_core.c
> @@ -684,7 +684,7 @@ static const struct file_operations tee_fops = {
> .open = tee_open,
> .release = tee_release,
> .unlocked_ioctl = tee_ioctl,
> - .compat_ioctl = tee_ioctl,
> + .compat_ioctl = compat_ptr_ioctl,
> };
>
> static void tee_release_device(struct device *dev)
> diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c
> index 9e9caff905d5..d48c032580d0 100644
> --- a/drivers/usb/class/cdc-wdm.c
> +++ b/drivers/usb/class/cdc-wdm.c
> @@ -724,7 +724,7 @@ static const struct file_operations wdm_fops = {
> .release = wdm_release,
> .poll = wdm_poll,
> .unlocked_ioctl = wdm_ioctl,
> - .compat_ioctl = wdm_ioctl,
> + .compat_ioctl = compat_ptr_ioctl,
> .llseek = noop_llseek,
> };
>
> diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
> index 4942122b2346..bbd0308b13f5 100644
> --- a/drivers/usb/class/usbtmc.c
> +++ b/drivers/usb/class/usbtmc.c
> @@ -2220,9 +2220,7 @@ static const struct file_operations fops = {
> .release = usbtmc_release,
> .flush = usbtmc_flush,
> .unlocked_ioctl = usbtmc_ioctl,
> -#ifdef CONFIG_COMPAT
> - .compat_ioctl = usbtmc_ioctl,
> -#endif
> + .compat_ioctl = compat_ptr_ioctl,
> .fasync = usbtmc_fasync,
> .poll = usbtmc_poll,
> .llseek = default_llseek,
> diff --git a/drivers/virt/fsl_hypervisor.c b/drivers/virt/fsl_hypervisor.c
> index 8ba726e600e9..fbf02bf60f62 100644
> --- a/drivers/virt/fsl_hypervisor.c
> +++ b/drivers/virt/fsl_hypervisor.c
> @@ -703,7 +703,7 @@ static const struct file_operations fsl_hv_fops = {
> .poll = fsl_hv_poll,
> .read = fsl_hv_read,
> .unlocked_ioctl = fsl_hv_ioctl,
> - .compat_ioctl = fsl_hv_ioctl,
> + .compat_ioctl = compat_ptr_ioctl,
> };
>
> static struct miscdevice fsl_hv_misc_dev = {
> diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
> index 120e4340792a..162ea4b6b417 100644
> --- a/fs/btrfs/super.c
> +++ b/fs/btrfs/super.c
> @@ -2307,7 +2307,7 @@ static const struct super_operations btrfs_super_ops = {
> static const struct file_operations btrfs_ctl_fops = {
> .open = btrfs_control_open,
> .unlocked_ioctl = btrfs_control_ioctl,
> - .compat_ioctl = btrfs_control_ioctl,
> + .compat_ioctl = compat_ptr_ioctl,
> .owner = THIS_MODULE,
> .llseek = noop_llseek,
> };
> diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
> index 7c060cb22aa3..a493b957713f 100644
> --- a/fs/ceph/dir.c
> +++ b/fs/ceph/dir.c
> @@ -1785,7 +1785,7 @@ const struct file_operations ceph_dir_fops = {
> .open = ceph_open,
> .release = ceph_release,
> .unlocked_ioctl = ceph_ioctl,
> - .compat_ioctl = ceph_ioctl,
> + .compat_ioctl = compat_ptr_ioctl,
> .fsync = ceph_fsync,
> .lock = ceph_lock,
> .flock = ceph_flock,
> diff --git a/fs/ceph/file.c b/fs/ceph/file.c
> index 9f53c3d99304..9b5fe7eee3c1 100644
> --- a/fs/ceph/file.c
> +++ b/fs/ceph/file.c
> @@ -2112,7 +2112,7 @@ const struct file_operations ceph_file_fops = {
> .splice_read = generic_file_splice_read,
> .splice_write = iter_file_splice_write,
> .unlocked_ioctl = ceph_ioctl,
> - .compat_ioctl = ceph_ioctl,
> + .compat_ioctl = compat_ptr_ioctl,
> .fallocate = ceph_fallocate,
> .copy_file_range = ceph_copy_file_range,
> };
> diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
> index 9971a35cf1ef..dcdb26068b71 100644
> --- a/fs/fuse/dev.c
> +++ b/fs/fuse/dev.c
> @@ -2354,7 +2354,7 @@ const struct file_operations fuse_dev_operations = {
> .release = fuse_dev_release,
> .fasync = fuse_dev_fasync,
> .unlocked_ioctl = fuse_dev_ioctl,
> - .compat_ioctl = fuse_dev_ioctl,
> + .compat_ioctl = compat_ptr_ioctl,
> };
> EXPORT_SYMBOL_GPL(fuse_dev_operations);
>
> diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c
> index a90bb19dcfa2..a55aa029a308 100644
> --- a/fs/notify/fanotify/fanotify_user.c
> +++ b/fs/notify/fanotify/fanotify_user.c
> @@ -523,7 +523,7 @@ static const struct file_operations fanotify_fops = {
> .fasync = NULL,
> .release = fanotify_release,
> .unlocked_ioctl = fanotify_ioctl,
> - .compat_ioctl = fanotify_ioctl,
> + .compat_ioctl = compat_ptr_ioctl,
> .llseek = noop_llseek,
> };
>
> diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c
> index 89800fc7dc9d..f93dcf8c996f 100644
> --- a/fs/userfaultfd.c
> +++ b/fs/userfaultfd.c
> @@ -1901,7 +1901,7 @@ static const struct file_operations userfaultfd_fops = {
> .poll = userfaultfd_poll,
> .read = userfaultfd_read,
> .unlocked_ioctl = userfaultfd_ioctl,
> - .compat_ioctl = userfaultfd_ioctl,
> + .compat_ioctl = compat_ptr_ioctl,
> .llseek = noop_llseek,
> };
>
> diff --git a/net/rfkill/core.c b/net/rfkill/core.c
> index abca57040f37..3b2f6ea44397 100644
> --- a/net/rfkill/core.c
> +++ b/net/rfkill/core.c
> @@ -1323,7 +1323,7 @@ static const struct file_operations rfkill_fops = {
> .release = rfkill_fop_release,
> #ifdef CONFIG_RFKILL_INPUT
> .unlocked_ioctl = rfkill_fop_ioctl,
> - .compat_ioctl = rfkill_fop_ioctl,
> + .compat_ioctl = compat_ptr_ioctl,
> #endif
> .llseek = no_llseek,
> };
Thanks,
Mauro
^ permalink raw reply
* Re: [PATCH v3 12/26] compat_ioctl: move more drivers to compat_ptr_ioctl
From: Arnd Bergmann @ 2019-04-25 15:32 UTC (permalink / raw)
To: Mauro Carvalho Chehab
Cc: linux-nvme, Sean Young, linux-iio, Daniel Vetter, linux-pci,
dri-devel, Bjorn Andersson, sparclinux, driverdevel, linux-scsi,
linux-nvdimm, linux-rdma, qat-linux, amd-gfx, Jason Gunthorpe,
open list:HID CORE LAYER, Darren Hart, Linux Media Mailing List,
linux-remoteproc, linaro-mm-sig, Alexander Viro, Jonathan Cameron,
David Sterba, ceph
In-Reply-To: <20190425122153.450fc094@coco.lan>
On Thu, Apr 25, 2019 at 5:22 PM Mauro Carvalho Chehab
<mchehab+samsung@kernel.org> wrote:
> Em Tue, 16 Apr 2019 22:25:33 +0200 Arnd Bergmann <arnd@arndb.de> escreveu:
>
> If I understand your patch description well, using compat_ptr_ioctl
> only works if the driver is not for s390, right?
No, the purpose of compat_ptr_ioctl() is to make sure it works
everywhere including s390.
Even on s390 it tends to work most of the time, but for correctness
the upper bit of a 32-bit pointer needs to be cleared, as
compat_ptr_ioctl does, in case some application passes a pointer
with that bit set. [IIRC, in the instruction pointer, the high bit is set, in
data references it is ignored but usually cleared, but it may be left
on for IP-relative address generation]
Arnd
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply
* Re: [PATCH v3 12/26] compat_ioctl: move more drivers to compat_ptr_ioctl
From: Al Viro @ 2019-04-25 15:35 UTC (permalink / raw)
To: Mauro Carvalho Chehab
Cc: Arnd Bergmann, linux-fsdevel, y2038, linux-kernel,
Jason Gunthorpe, Daniel Vetter, Greg Kroah-Hartman, David Sterba,
Darren Hart, Jonathan Cameron, Bjorn Andersson, devel, qat-linux,
linux-crypto, linux-media, dri-devel, linaro-mm-sig, amd-gfx,
linux-input, linux-iio, linux-rdma, linux-nvdimm, linux-nvme,
linux-pci
In-Reply-To: <20190425122153.450fc094@coco.lan>
On Thu, Apr 25, 2019 at 12:21:53PM -0300, Mauro Carvalho Chehab wrote:
> If I understand your patch description well, using compat_ptr_ioctl
> only works if the driver is not for s390, right?
No; s390 is where "oh, just set ->compat_ioctl same as ->unlocked_ioctl
and be done with that; compat_ptr() is a no-op anyway" breaks. IOW,
s390 is the reason for having compat_ptr_ioctl() in the first place;
that thing works on all biarch architectures, as long as all stuff
handled by ->ioctl() takes pointer to arch-independent object as
argument. IOW,
argument ignored => OK
any arithmetical type => no go, compat_ptr() would bugger it
pointer to int => OK
pointer to string => OK
pointer to u64 => OK
pointer to struct {u64 addr; char s[11];} => OK
pointer to long => needs explicit handler
pointer to struct {void *addr; char s[11];} => needs explicit handler
pointer to struct {int x; u64 y;} => needs explicit handler on amd64
For "just use ->unlocked_ioctl for ->ioctl" we have
argument ignored => OK
any arithmetical type => OK
any pointer => instant breakage on s390, in addtion to cases that break
with compat_ptr_ioctl().
Probably some form of that ought to go into commit message for compat_ptr_ioctl()
introduction...
^ permalink raw reply
* Re: [PATCH v3 12/26] compat_ioctl: move more drivers to compat_ptr_ioctl
From: Mauro Carvalho Chehab @ 2019-04-25 15:53 UTC (permalink / raw)
To: Al Viro
Cc: Arnd Bergmann, linux-fsdevel, y2038, linux-kernel,
Jason Gunthorpe, Daniel Vetter, Greg Kroah-Hartman, David Sterba,
Darren Hart, Jonathan Cameron, Bjorn Andersson, devel, qat-linux,
linux-crypto, linux-media, dri-devel, linaro-mm-sig, amd-gfx,
linux-input, linux-iio, linux-rdma, linux-nvdimm, linux-nvme,
linux-pci
In-Reply-To: <20190425153534.GS2217@ZenIV.linux.org.uk>
Em Thu, 25 Apr 2019 16:35:34 +0100
Al Viro <viro@zeniv.linux.org.uk> escreveu:
> On Thu, Apr 25, 2019 at 12:21:53PM -0300, Mauro Carvalho Chehab wrote:
>
> > If I understand your patch description well, using compat_ptr_ioctl
> > only works if the driver is not for s390, right?
>
> No; s390 is where "oh, just set ->compat_ioctl same as ->unlocked_ioctl
> and be done with that; compat_ptr() is a no-op anyway" breaks. IOW,
> s390 is the reason for having compat_ptr_ioctl() in the first place;
> that thing works on all biarch architectures, as long as all stuff
> handled by ->ioctl() takes pointer to arch-independent object as
> argument. IOW,
> argument ignored => OK
> any arithmetical type => no go, compat_ptr() would bugger it
> pointer to int => OK
That's the case for all LIRC ioctls: they all use a pointer to u32
argument.
> pointer to string => OK
> pointer to u64 => OK
> pointer to struct {u64 addr; char s[11];} => OK
> pointer to long => needs explicit handler
> pointer to struct {void *addr; char s[11];} => needs explicit handler
> pointer to struct {int x; u64 y;} => needs explicit handler on amd64
> For "just use ->unlocked_ioctl for ->ioctl" we have
> argument ignored => OK
> any arithmetical type => OK
> any pointer => instant breakage on s390, in addtion to cases that break
> with compat_ptr_ioctl().
>
> Probably some form of that ought to go into commit message for compat_ptr_ioctl()
> introduction...
Agreed.
Thanks,
Mauro
^ permalink raw reply
* Re: [PATCH v3 12/26] compat_ioctl: move more drivers to compat_ptr_ioctl
From: Arnd Bergmann @ 2019-04-25 15:55 UTC (permalink / raw)
To: Al Viro
Cc: Sean Young, linux-iio-u79uwXL29TY76Z2rM5mHXA, Daniel Vetter,
linux-pci, dri-devel, Bjorn Andersson, sparclinux,
Mauro Carvalho Chehab, driverdevel, linux-scsi,
linux-nvdimm-hn68Rpc1hR1g9hUCZPvPmw, y2038 Mailman List,
qat-linux-ral2JQCrhuEAvxtiuMwx3w,
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Jason Gunthorpe,
open list:HID CORE LAYER, Darren Hart, Linux Media Mailing List,
linux-remoteproc-u79uwXL29TY76Z2rM5mHXA,
linaro-mm-sig-cunTk1MwBs8s++Sfvej+rw,
linux-nvme-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Jonathan Cameron,
David Sterba
In-Reply-To: <20190425153534.GS2217-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
On Thu, Apr 25, 2019 at 5:35 PM Al Viro <viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org> wrote:
>
> On Thu, Apr 25, 2019 at 12:21:53PM -0300, Mauro Carvalho Chehab wrote:
>
> > If I understand your patch description well, using compat_ptr_ioctl
> > only works if the driver is not for s390, right?
>
> No; s390 is where "oh, just set ->compat_ioctl same as ->unlocked_ioctl
> and be done with that; compat_ptr() is a no-op anyway" breaks. IOW,
> s390 is the reason for having compat_ptr_ioctl() in the first place;
> that thing works on all biarch architectures, as long as all stuff
> handled by ->ioctl() takes pointer to arch-independent object as
> argument. IOW,
> argument ignored => OK
> any arithmetical type => no go, compat_ptr() would bugger it
> pointer to int => OK
> pointer to string => OK
> pointer to u64 => OK
> pointer to struct {u64 addr; char s[11];} => OK
To be extra pedantic, the 'struct {u64 addr; char s[11];} '
case is also broken on x86, because sizeof (obj) is smaller
on i386, even though the location of the members are
the same. i.e. you can copy_from_user() this, but not
copy_to_user(), which overwrites 4 bytes after the end of
the 20-byte user structure.
Arnd
^ permalink raw reply
* [PATCH 1/2] Input: add KEY_KBD_LAYOUT_NEXT
From: Dmitry Torokhov @ 2019-04-25 16:38 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires; +Cc: linux-input, linux-kernel, gwink
The HID usage tables define a key to cycle through a set of keyboard
layouts, let's add corresponding keycode.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
include/uapi/linux/input-event-codes.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h
index 64cee116928e..85387c76c24f 100644
--- a/include/uapi/linux/input-event-codes.h
+++ b/include/uapi/linux/input-event-codes.h
@@ -606,6 +606,7 @@
#define KEY_SCREENSAVER 0x245 /* AL Screen Saver */
#define KEY_VOICECOMMAND 0x246 /* Listening Voice Command */
#define KEY_ASSISTANT 0x247 /* AL Context-aware desktop assistant */
+#define KEY_KBD_LAYOUT_NEXT 0x248 /* AC Next Keyboard Layout Select */
#define KEY_BRIGHTNESS_MIN 0x250 /* Set Brightness to Minimum */
#define KEY_BRIGHTNESS_MAX 0x251 /* Set Brightness to Maximum */
--
2.21.0.593.g511ec345e18-goog
^ permalink raw reply related
* [PATCH 2/2] HID: input: add mapping for KEY_KBD_LAYOUT_NEXT
From: Dmitry Torokhov @ 2019-04-25 16:38 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires; +Cc: linux-input, linux-kernel, gwink
In-Reply-To: <20190425163846.51730-1-dmitry.torokhov@gmail.com>
HUTRR56 defined a new usage code on consumer page to cycle through
set of keyboard layouts, let's add this mapping.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/hid/hid-input.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index b607286a0bc8..0579b8d3f912 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -1051,6 +1051,8 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
case 0x28b: map_key_clear(KEY_FORWARDMAIL); break;
case 0x28c: map_key_clear(KEY_SEND); break;
+ case 0x29d: map_key_clear(KEY_KBD_LAYOUT_NEXT); break;
+
case 0x2c7: map_key_clear(KEY_KBDINPUTASSIST_PREV); break;
case 0x2c8: map_key_clear(KEY_KBDINPUTASSIST_NEXT); break;
case 0x2c9: map_key_clear(KEY_KBDINPUTASSIST_PREVGROUP); break;
--
2.21.0.593.g511ec345e18-goog
^ permalink raw reply related
* Re: [PATCH v3 12/26] compat_ioctl: move more drivers to compat_ptr_ioctl
From: Al Viro @ 2019-04-25 16:42 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Mauro Carvalho Chehab, Linux FS-devel Mailing List,
y2038 Mailman List, Linux Kernel Mailing List, Jason Gunthorpe,
Daniel Vetter, Greg Kroah-Hartman, David Sterba, Darren Hart,
Jonathan Cameron, Bjorn Andersson, driverdevel, qat-linux,
open list:HARDWARE RANDOM NUMBER GENERATOR CORE,
Linux Media Mailing List, dri-devel, linaro-mm-sig
In-Reply-To: <CAK8P3a2HmiYQJ2FV2FgLiFsD8M9UKteC9Jetx7ja06PQVZWYfA@mail.gmail.com>
On Thu, Apr 25, 2019 at 05:55:23PM +0200, Arnd Bergmann wrote:
> On Thu, Apr 25, 2019 at 5:35 PM Al Viro <viro@zeniv.linux.org.uk> wrote:
> >
> > On Thu, Apr 25, 2019 at 12:21:53PM -0300, Mauro Carvalho Chehab wrote:
> >
> > > If I understand your patch description well, using compat_ptr_ioctl
> > > only works if the driver is not for s390, right?
> >
> > No; s390 is where "oh, just set ->compat_ioctl same as ->unlocked_ioctl
> > and be done with that; compat_ptr() is a no-op anyway" breaks. IOW,
> > s390 is the reason for having compat_ptr_ioctl() in the first place;
> > that thing works on all biarch architectures, as long as all stuff
> > handled by ->ioctl() takes pointer to arch-independent object as
> > argument. IOW,
> > argument ignored => OK
> > any arithmetical type => no go, compat_ptr() would bugger it
> > pointer to int => OK
> > pointer to string => OK
> > pointer to u64 => OK
> > pointer to struct {u64 addr; char s[11];} => OK
>
> To be extra pedantic, the 'struct {u64 addr; char s[11];} '
> case is also broken on x86, because sizeof (obj) is smaller
> on i386, even though the location of the members are
> the same. i.e. you can copy_from_user() this, but not
> copy_to_user(), which overwrites 4 bytes after the end of
> the 20-byte user structure.
D'oh! FWIW, it might be worth putting into Documentation/ somewhere;
basically, what is and what isn't biarch-neutral.
Or arch-neutral, for that matter - it's very close. The only real
exception, IIRC, is an extra twist on m68k, where int behaves
like x86 long long - its alignment is only half its size, so
sizeof(struct {char c; int x;}) is 6, not 8 as everywhere
else. Irrelevant for biarch, thankfully (until somebody gets insane
enough to implement 64bit coldfire, kernel port for it *and* biarch
support for m68k binaries on that thing, that is)...
^ permalink raw reply
* Re: [PATCH 1/2] HID: wacom: Don't set tool type until we're in range
From: Jason Gerecke @ 2019-04-25 17:47 UTC (permalink / raw)
To: Sasha Levin; +Cc: Jason Gerecke, Linux Input, Ping Cheng, # v3.17+
In-Reply-To: <20190425121505.3AD33218AD@mail.kernel.org>
I can produce a version of this patch specific to v4.14.113. Please
let me know the proper process for submitting such a patch.
Jason
---
Now instead of four in the eights place /
you’ve got three, ‘Cause you added one /
(That is to say, eight) to the two, /
But you can’t take seven from three, /
So you look at the sixty-fours....
On Thu, Apr 25, 2019 at 5:15 AM Sasha Levin <sashal@kernel.org> wrote:
>
> Hi,
>
> [This is an automated email]
>
> This commit has been processed because it contains a "Fixes:" tag,
> fixing commit: a48324de6d4d HID: wacom: Bluetooth IRQ for Intuos Pro should handle prox/range.
>
> The bot has tested the following trees: v5.0.9, v4.19.36, v4.14.113.
>
> v5.0.9: Build OK!
> v4.19.36: Build OK!
> v4.14.113: Failed to apply! Possible dependencies:
> Unable to calculate
>
>
> How should we proceed with this patch?
>
> --
> Thanks,
> Sasha
^ permalink raw reply
* Re: [PATCH 2/2] HID: wacom: Don't report anything prior to the tool entering range
From: Jason Gerecke @ 2019-04-25 17:47 UTC (permalink / raw)
To: Sasha Levin; +Cc: Jason Gerecke, Linux Input, Ping Cheng, # v3.17+
In-Reply-To: <20190425121506.7EBEC218B0@mail.kernel.org>
I can produce a version of this patch specific to v4.14.113. Please
let me know the proper process for submitting such a patch.
Jason
---
Now instead of four in the eights place /
you’ve got three, ‘Cause you added one /
(That is to say, eight) to the two, /
But you can’t take seven from three, /
So you look at the sixty-fours....
On Thu, Apr 25, 2019 at 5:15 AM Sasha Levin <sashal@kernel.org> wrote:
>
> Hi,
>
> [This is an automated email]
>
> This commit has been processed because it contains a "Fixes:" tag,
> fixing commit: a48324de6d4d HID: wacom: Bluetooth IRQ for Intuos Pro should handle prox/range.
>
> The bot has tested the following trees: v5.0.9, v4.19.36, v4.14.113.
>
> v5.0.9: Build OK!
> v4.19.36: Build OK!
> v4.14.113: Failed to apply! Possible dependencies:
> 87046b6c995c ("HID: wacom: Add support for 3rd generation Intuos BT")
> c947218951da ("HID: wacom: Add support for One by Wacom (CTL-472 / CTL-672)")
>
>
> How should we proceed with this patch?
>
> --
> Thanks,
> Sasha
^ permalink raw reply
* Re: [PATCH 0/5] Add of_ functions for device_link_add()
From: Rob Herring @ 2019-04-25 18:07 UTC (permalink / raw)
To: Benjamin Gaignard
Cc: Wysocki, Rafael J, Dmitry Torokhov, Mark Rutland, Bastien Nocera,
Frank Rowand, Marco Felsch, Guido Günther, Yannick Fertre,
Arnd Bergmann, Linux Input, devicetree,
linux-kernel@vger.kernel.org, linux-stm32, Mark Brown
In-Reply-To: <20190424101913.1534-1-benjamin.gaignard@st.com>
On Wed, Apr 24, 2019 at 5:19 AM Benjamin Gaignard
<benjamin.gaignard@st.com> wrote:
>
> It could happen that we need to control suspend/resume ordering between
> devices without obvious consumer/supplier link. For example when touchscreens
> and DSI panels share the same reset line, in this case we need to be sure
> of pm_runtime operations ordering between those two devices to correctly
> perform reset.
> DSI panel and touchscreen aren't sharing any heriachical relationship (unlike
> I2C client and I2C bus or regulator client and regulator provider) so we need
> to describe this in device-tree.
Needing to know which touchscreen is attached to a panel could be
important to describe if you have multiple displays.
Doesn't the reset subsystem already have some support for shared
resets? Seems like it could provide clients with struct device or
device_node ptrs to other devices sharing a reset.
>
> This series introduce of_device_links_{add,remove} and devm_of_device_links_add()
> helpers to find and parse 'links-add' property in a device-tree node.
Going to document that property somewhere? :)
I think this is too generic and coupled to Linux. It doesn't have any
information as to what is the dependency or connection nor what the
direction of the dependency is.
I'm not convinced we need to solve this generically vs. defining
something for this specific example.
Rob
^ permalink raw reply
* Re: [PATCH] HID: Increase maximum report size allowed by hid_field_extract()
From: Kai-Heng Feng @ 2019-04-25 18:29 UTC (permalink / raw)
To: Benjamin Tissoires
Cc: Jiri Kosina, open list:HID CORE LAYER, lkml, Ronald Tschalär
In-Reply-To: <CAO-hwJLDuMZuqKiawnkq3YxL6T9SqNGqQ1Q_Vs=kMKmsx6SD0w@mail.gmail.com>
at 17:42, Benjamin Tissoires <benjamin.tissoires@redhat.com> wrote:
> Hi,
>
>
> On Fri, Mar 8, 2019 at 6:11 AM Kai-Heng Feng
> <kai.heng.feng@canonical.com> wrote:
>> Commit 71f6fa90a353 ("HID: increase maximum global item tag report size
>> to 256") increases the max report size from 128 to 256.
>>
>> We also need to update the report size in hid_field_extract() otherwise
>> it complains and truncates now valid report size:
>> [ 406.165461] hid-sensor-hub 001F:8086:22D8.0002: hid_field_extract()
>> called with n (192) > 32! (kworker/5:1)
>>
>> BugLink: https://bugs.launchpad.net/bugs/1818547
>> Fixes: 71f6fa90a353 ("HID: increase maximum global item tag report size
>> to 256")
>> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
>> ---
>> drivers/hid/hid-core.c | 6 +++---
>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
>> index 9993b692598f..860e21ec6a49 100644
>> --- a/drivers/hid/hid-core.c
>> +++ b/drivers/hid/hid-core.c
>> @@ -1301,10 +1301,10 @@ static u32 __extract(u8 *report, unsigned
>> offset, int n)
>> u32 hid_field_extract(const struct hid_device *hid, u8 *report,
>> unsigned offset, unsigned n)
>
> Ronald (Cc-ed) raised quite a good point:
> what's the benefit of removing the error message if this function (and
> __extract) can only report an unsigned 32 bits value?
I didn’t spot this, sorry.
>
> My take is we should revert 94a9992f7dbdfb28976b upstream and think at
> a better solution.
I think using a new fix to replace it will be a better approach, as it at
least partially solves the issue.
Kai-Heng
>
> Cheers,
> Benjamin
>
>> {
>> - if (n > 32) {
>> - hid_warn(hid, "hid_field_extract() called with n (%d) >
>> 32! (%s)\n",
>> + if (n > 256) {
>> + hid_warn(hid, "hid_field_extract() called with n (%d) >
>> 256! (%s)\n",
>> n, current->comm);
>> - n = 32;
>> + n = 256;
>> }
>>
>> return __extract(report, offset, n);
>> —
>> 2.17.1
^ permalink raw reply
* Re: [PATCH v10 02/11] dt-bindings: power: supply: add DT bindings for max77650
From: Rob Herring @ 2019-04-25 18:34 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Liam Girdwood, Greg Kroah-Hartman, linux-kernel, linux-gpio,
devicetree, linux-input, linux-leds, linux-pm,
Bartosz Golaszewski
In-Reply-To: <20190423090451.23711-3-brgl@bgdev.pl>
On Tue, 23 Apr 2019 11:04:42 +0200, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>
> Add the DT binding document for the battery charger module of max77650.
>
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> ---
> .../power/supply/max77650-charger.txt | 28 +++++++++++++++++++
> 1 file changed, 28 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/power/supply/max77650-charger.txt
>
Reviewed-by: Rob Herring <robh@kernel.org>
^ permalink raw reply
* Re: [PATCH 0/5] Add of_ functions for device_link_add()
From: Dmitry Torokhov @ 2019-04-25 19:24 UTC (permalink / raw)
To: Rob Herring
Cc: Benjamin Gaignard, Wysocki, Rafael J, Mark Rutland,
Bastien Nocera, Frank Rowand, Marco Felsch, Guido Günther,
Yannick Fertre, Arnd Bergmann, Linux Input, DTML,
linux-kernel@vger.kernel.org, linux-stm32, Mark Brown
In-Reply-To: <CAL_JsqJp9f3Sv08igSyR38Z5eXnAYWMNY29U5qEGLp=r2YReRw@mail.gmail.com>
On Thu, Apr 25, 2019 at 11:08 AM Rob Herring <robh+dt@kernel.org> wrote:
>
> On Wed, Apr 24, 2019 at 5:19 AM Benjamin Gaignard
> <benjamin.gaignard@st.com> wrote:
> >
> > It could happen that we need to control suspend/resume ordering between
> > devices without obvious consumer/supplier link. For example when touchscreens
> > and DSI panels share the same reset line, in this case we need to be sure
> > of pm_runtime operations ordering between those two devices to correctly
> > perform reset.
> > DSI panel and touchscreen aren't sharing any heriachical relationship (unlike
> > I2C client and I2C bus or regulator client and regulator provider) so we need
> > to describe this in device-tree.
>
> Needing to know which touchscreen is attached to a panel could be
> important to describe if you have multiple displays.
>
> Doesn't the reset subsystem already have some support for shared
> resets? Seems like it could provide clients with struct device or
> device_node ptrs to other devices sharing a reset.
>
> >
> > This series introduce of_device_links_{add,remove} and devm_of_device_links_add()
> > helpers to find and parse 'links-add' property in a device-tree node.
>
> Going to document that property somewhere? :)
>
> I think this is too generic and coupled to Linux. It doesn't have any
> information as to what is the dependency or connection nor what the
> direction of the dependency is.
>
> I'm not convinced we need to solve this generically vs. defining
> something for this specific example.
I am pretty sure there will be more drivers needing complex
dependencies. Doesn't ACPI allow defining relationship between devices
that goes beyond the tree structure?
Thanks.
--
Dmitry
^ permalink raw reply
* Re: [PATCH v3 12/26] compat_ioctl: move more drivers to compat_ptr_ioctl
From: Johannes Berg @ 2019-04-25 21:25 UTC (permalink / raw)
To: Arnd Bergmann, Al Viro
Cc: Sean Young, linux-iio-u79uwXL29TY76Z2rM5mHXA, Daniel Vetter,
linux-pci, dri-devel, Bjorn Andersson, sparclinux,
Mauro Carvalho Chehab, driverdevel, linux-scsi,
linux-nvdimm-hn68Rpc1hR1g9hUCZPvPmw, y2038 Mailman List,
qat-linux-ral2JQCrhuEAvxtiuMwx3w,
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Jason Gunthorpe,
open list:HID CORE LAYER, Darren Hart, Linux Media Mailing List,
linux-remoteproc-u79uwXL29TY76Z2rM5mHXA,
linaro-mm-sig-cunTk1MwBs8s++Sfvej+rw,
linux-nvme-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Jonathan Cameron,
David Sterba
In-Reply-To: <CAK8P3a2HmiYQJ2FV2FgLiFsD8M9UKteC9Jetx7ja06PQVZWYfA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Thu, 2019-04-25 at 17:55 +0200, Arnd Bergmann wrote:
> On Thu, Apr 25, 2019 at 5:35 PM Al Viro <viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org> wrote:
> >
> > On Thu, Apr 25, 2019 at 12:21:53PM -0300, Mauro Carvalho Chehab wrote:
> >
> > > If I understand your patch description well, using compat_ptr_ioctl
> > > only works if the driver is not for s390, right?
> >
> > No; s390 is where "oh, just set ->compat_ioctl same as ->unlocked_ioctl
> > and be done with that; compat_ptr() is a no-op anyway" breaks. IOW,
> > s390 is the reason for having compat_ptr_ioctl() in the first place;
> > that thing works on all biarch architectures, as long as all stuff
> > handled by ->ioctl() takes pointer to arch-independent object as
> > argument. IOW,
> > argument ignored => OK
> > any arithmetical type => no go, compat_ptr() would bugger it
> > pointer to int => OK
> > pointer to string => OK
> > pointer to u64 => OK
> > pointer to struct {u64 addr; char s[11];} => OK
>
> To be extra pedantic, the 'struct {u64 addr; char s[11];} '
> case is also broken on x86, because sizeof (obj) is smaller
> on i386, even though the location of the members are
> the same. i.e. you can copy_from_user() this
Actually, you can't even do that because the struct might sit at the end
of a page and then you'd erroneously fault in this case.
We had this a while ago with struct ifreq, see commit 98406133dd and its
parents.
johannes
^ permalink raw reply
* Re: [PATCH v10 00/11] mfd: add support for max77650 PMIC
From: Sebastian Reichel @ 2019-04-25 21:46 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Pavel Machek, Lee Jones, Rob Herring, Mark Rutland, Linus Walleij,
Dmitry Torokhov, Jacek Anaszewski, Liam Girdwood,
Greg Kroah-Hartman, Linux Kernel Mailing List,
open list:GPIO SUBSYSTEM, devicetree, Linux Input,
Linux LED Subsystem, Linux PM list, Bartosz Golaszewski
In-Reply-To: <CAMRc=McN78_gJw_T4EPucM8veTC9XRUu7TGJ0J+zPsU=0Hu2GQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1230 bytes --]
Hi,
On Wed, Apr 24, 2019 at 10:45:00AM +0200, Bartosz Golaszewski wrote:
> śr., 24 kwi 2019 o 10:31 Pavel Machek <pavel@denx.de> napisał(a):
> >
> > On Tue 2019-04-23 11:04:40, Bartosz Golaszewski wrote:
> > > From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> > >
> > > This series adds support for max77650 ultra low-power PMIC. It provides
> > > the core mfd driver and a set of five sub-drivers for the regulator,
> > > power supply, gpio, leds and input subsystems.
> > >
> > > Patches 1-4 add the DT binding documents. Patch 5 documents mfd_add_devices().
> > > Patches 6-10 add all drivers. Last patch adds a MAINTAINERS entry for this
> > > device.
> > >
> > > The regulator part is already upstream.
> >
> > I see v10 in my inbox... and acks from all over the place, but patches
> > not going in. Who takes these? I don't think I need another 10
> > versions in my inbox...
> > Pavel
>
> I think Lee Jones should take them through the MFD tree. With the ack
> from Sebastian Reichel on the driver part and the example in the
> charger binding fixed I think they are ready to be picked up.
Fine with me.
-- Sebastian
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply
* Re: [PATCH 0/5] Add of_ functions for device_link_add()
From: Rob Herring @ 2019-04-25 23:02 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Benjamin Gaignard, Wysocki, Rafael J, Mark Rutland,
Bastien Nocera, Frank Rowand, Marco Felsch, Guido Günther,
Yannick Fertre, Arnd Bergmann, Linux Input, DTML,
linux-kernel@vger.kernel.org, linux-stm32, Mark Brown
In-Reply-To: <CAKdAkRTUsJ4TU7BrSNXCKiQGZnArao9o_qk7i0xSzYJ1SGU14A@mail.gmail.com>
On Thu, Apr 25, 2019 at 2:24 PM Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
>
> On Thu, Apr 25, 2019 at 11:08 AM Rob Herring <robh+dt@kernel.org> wrote:
> >
> > On Wed, Apr 24, 2019 at 5:19 AM Benjamin Gaignard
> > <benjamin.gaignard@st.com> wrote:
> > >
> > > It could happen that we need to control suspend/resume ordering between
> > > devices without obvious consumer/supplier link. For example when touchscreens
> > > and DSI panels share the same reset line, in this case we need to be sure
> > > of pm_runtime operations ordering between those two devices to correctly
> > > perform reset.
> > > DSI panel and touchscreen aren't sharing any heriachical relationship (unlike
> > > I2C client and I2C bus or regulator client and regulator provider) so we need
> > > to describe this in device-tree.
> >
> > Needing to know which touchscreen is attached to a panel could be
> > important to describe if you have multiple displays.
> >
> > Doesn't the reset subsystem already have some support for shared
> > resets? Seems like it could provide clients with struct device or
> > device_node ptrs to other devices sharing a reset.
> >
> > >
> > > This series introduce of_device_links_{add,remove} and devm_of_device_links_add()
> > > helpers to find and parse 'links-add' property in a device-tree node.
> >
> > Going to document that property somewhere? :)
> >
> > I think this is too generic and coupled to Linux. It doesn't have any
> > information as to what is the dependency or connection nor what the
> > direction of the dependency is.
> >
> > I'm not convinced we need to solve this generically vs. defining
> > something for this specific example.
>
> I am pretty sure there will be more drivers needing complex
> dependencies. Doesn't ACPI allow defining relationship between devices
> that goes beyond the tree structure?
Can't speak to ACPI, but I assume you where implying ACPI supports
this so DT should too.
Almost every binding we have is defining relationships between
devices. Interrupts, clocks, gpio, pinctrl, etc. all do this. To use a
similar example to the one here, we already define the relationship
between a display and a backlight with a 'backlight' property in the
display node. Why should touchscreen be any different than backlight?
What really concerns me here is folks just add relationships to
'links-add' which are already captured in DT (such as backlight) just
because they'll get it for free and not have to go add support to
handle each specific binding.
Rob
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox