linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
To: Dennis Chen <barracks510@gmail.com>
Cc: Jiri Kosina <jikos@kernel.org>,
	linux-input <linux-input@vger.kernel.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: Re: [PATCH] HID: multitouch: add support for Type Cover Pro 3
Date: Fri, 1 Jul 2016 16:52:12 +0200	[thread overview]
Message-ID: <20160701145212.GA24234@mail.corp.redhat.com> (raw)
In-Reply-To: <1466840940.28419.6.camel@gmail.com>

Hi,

On Jun 25 2016 or thereabouts, Dennis Chen wrote:
> On Fri, 2016-06-24 at 09:14 +0200, Benjamin Tissoires wrote:
> > Looks like the same issue Andy is seeing on the Surface Book. So I
> > think my patch must have a bug where it resets the quirks set by
> > usbhid. And this is why we are screwed here.
> > 
> 
> Yes, I think that's likely. There doesn't seem to be an issue most of
> the time, so it's not a huge deal. 

I spent a good amount of time trying to figure out where the bug was,
and I couldn't reproduce it either with uhid or even with usb_gadget.
Even KASan doesn't gives any wrong memory access, and I can't understand
why you get this faulty behavior.

So I must say, I am puzzled on why you end up calling
usbhid_init_reports() while the quirk HID_QUIRK_NO_INIT_REPORTS should
be in place.
Would you mind adding some printk() in hid-multitouch to dump the value
of hdev->quirks before and after calling hid_hw_start() in mt_probe()?

Also, ideally, if you could add a dump_stack() in
drivers/hid/usbhid/hid-core.c, right before leaving
usbhid_init_reports(), that would be awesome.

I would have prefer being able to understand myself what is going on,
but it looks like there is something different happening when I do not
have the device.

> 
> > Regarding your disconnect issue, what happens I think is that you
> > disconnect it before the timeout of usb_submit_urb(), and so the usb
> > layer is stuck trying to access the device and can't access the newly
> > plugged one. If you wait enough (initial timeout + new timeout -> 20
> > secs), then the device behaves properly again.
> > 
> 
> That is the behavior I have noticed. Is there any potential fix?
> 

The fix is to not fetch the buggy features that timeout. For that, we
usually set the flag HID_QUIRK_NO_INIT_REPORTS, which prevents it. But
in your case, the code says that the flag is set, while the code is
still called :(

Thanks,
Benjamin


--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2016-07-01 14:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-17 20:47 [PATCH] HID: multitouch: add support for Type Cover Pro 3 Dennis Chen
2016-06-17 21:00 ` Jiri Kosina
2016-06-17 21:11   ` Benjamin Tissoires
2016-06-18 18:53     ` Dennis Chen
2016-06-18 19:45       ` Benjamin Tissoires
2016-06-18 23:13         ` Dennis Chen
2016-06-19 20:48         ` Dennis Chen
2016-06-20  9:59           ` Benjamin Tissoires
2016-06-24  3:38             ` Dennis Chen
2016-06-24  7:14               ` Benjamin Tissoires
2016-06-25  7:49                 ` Dennis Chen
2016-07-01 14:52                   ` Benjamin Tissoires [this message]
2016-07-23 20:13                     ` Dennis Chen
2016-07-25 10:16                       ` Benjamin Tissoires
2016-09-19 16:30                         ` Dennis Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160701145212.GA24234@mail.corp.redhat.com \
    --to=benjamin.tissoires@redhat.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=barracks510@gmail.com \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).