From: Johan Hovold <johan-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: "C. SB" <fenugrec-f9SIN1PjVWVBDgjK7y7TUQ@public.gmane.org>
Cc: linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Karl Palsson <karlp-PhA6lrgffZtPR4JQBCEnsQ@public.gmane.org>,
Peter Stuge <peter-Y+HMSxxDrH8@public.gmane.org>
Subject: Re: CH340/341: cannot open twice
Date: Sun, 20 Sep 2015 13:56:02 -0700 [thread overview]
Message-ID: <20150920205602.GA22637@localhost> (raw)
In-Reply-To: <trinity-efc5f19e-b3a1-4cc7-b944-04deb6368aca-1442710334176@3capp-mailcom-lxa02>
[ Please keep everyone on CC including the usb list when responding. ]
On Sun, Sep 20, 2015 at 02:52:14AM +0200, C. SB wrote:
> > device. The reported problems have looked like hardware issues,
> Probably not my case - the device works OK on a winXP box
That's good to know.
> > Could you try the vendor driver and see if that makes the device work so
> > that we'd know for sure?
> Well, it was quite a job to get the driver to compile on linux 4.1.6, and
> I had to kludge a replacement for the deprecated interruptible_sleep_on()
> mechanism. I still can't believe it works (I have no kernel/module experience)
> but apart from an inexplicable 1-2 second delay when close()-ing
> the port, it works in my application (write+read with timeout; TXD-RXD
> connected together in a loopback)
>
> The mfg driver I used was downloaded from WCH at some point. A copy is visible
> on https://github.com/karlp/ch341-linux/blob/master/drivers/CH341SER_LINUX/ch34x.c
> And my patch to get it to compile is quite simple:
> http://pastebin.ca/3167353
> (not sure what the diff/patch guidelines are on this list, I preferred to link)
>
> Note : I probably violate many rules of kernel coding with my use of
> wait_event_interruptible(). Consider this a highly unstable, incompetent patch.
Thanks for verifying that. I've added Karl on CC that I think has some
preliminary code for adding support for newer ch341 devices, and Peter
who has also run into some similar issues.
Hopefully someone with access to these devices can figure out what is
missing in the mainline driver so that they get proper support.
Thanks,
Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2015-09-20 20:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <trinity-deaddc67-9f42-4260-9032-d3eb30b7e8f1-1442696993994@3capp-mailcom-lxa06>
2015-09-19 22:10 ` CH340/341: cannot open twice Johan Hovold
[not found] ` <trinity-efc5f19e-b3a1-4cc7-b944-04deb6368aca-1442710334176@3capp-mailcom-lxa02>
2015-09-20 20:56 ` Johan Hovold [this message]
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=20150920205602.GA22637@localhost \
--to=johan-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
--cc=fenugrec-f9SIN1PjVWVBDgjK7y7TUQ@public.gmane.org \
--cc=karlp-PhA6lrgffZtPR4JQBCEnsQ@public.gmane.org \
--cc=linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=peter-Y+HMSxxDrH8@public.gmane.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).