Thread (18 messages) 18 messages, 3 authors, 2021-01-23

Re: [PATCH RESEND v8 2/4] input: elants: support old touch report format

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2020-12-11 20:30:23
Also in: lkml

On Fri, Dec 11, 2020 at 06:04:01PM +0100, Michał Mirosław wrote:
On Fri, Dec 11, 2020 at 07:39:33PM +0300, Dmitry Osipenko wrote:
quoted
11.12.2020 19:09, Michał Mirosław пишет:
quoted
On Thu, Dec 10, 2020 at 11:29:40PM -0800, Dmitry Torokhov wrote:
quoted
Hi Michał,
On Fri, Dec 11, 2020 at 07:53:56AM +0100, Michał Mirosław wrote:
quoted
@@ -998,17 +1011,18 @@ static irqreturn_t elants_i2c_irq(int irq, void *_dev)
 			}
 
 			report_len = ts->buf[FW_HDR_LENGTH] / report_count;
-			if (report_len != PACKET_SIZE) {
+			if (report_len != PACKET_SIZE &&
+			    report_len != PACKET_SIZE_OLD) {
 				dev_err(&client->dev,
-					"mismatching report length: %*ph\n",
+					"unsupported report length: %*ph\n",
 					HEADER_SIZE, ts->buf);
Do I understand this correctly that the old packets are only observed on
EKTF3624? If so can we expand the check so that we only accept packets
with "old" size when we know we are dealing with this device?
We only have EKTF3624 and can't be sure there are no other chips needing this.
In practice this older packet format should be seen only on 3624, but
nevertheless we could make it more explicit by adding the extra chip_id
checks.

It won't be difficult to change it in the future if will be needed.

I think the main point that Dmitry Torokhov conveys here is that we
should minimize the possible impact on the current EKT3500 code since we
don't have definitive answers regarding the firmware differences among
the hardware variants.
The only possible impact here is that older firmware instead of breaking
would suddenly work. Maybe we can accept such a risk?
These are not controllers we'll randomly find in devices: Windows boxes
use I2C HID, Chrome devices use "new" firmware, so that leaves random
ARM where someone needs to consciously add proper compatible before the
driver will engage with the controller.

I would prefer we were conservative and not accept potentially invalid
data.

Thanks.

-- 
Dmitry
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help