From: "Hector Martin \"marcan\"" <hector@marcansoft.com>
To: Oliver Neukum <oneukum@suse.de>,
James Hilliard <james.hilliard1@gmail.com>,
linux-usb@vger.kernel.org
Cc: Johan Hovold <johan@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org, Russ Dill <Russ.Dill@gmail.com>
Subject: Re: [PATCH v2] usb: serial: Repair FTDI FT232R bricked eeprom
Date: Thu, 10 Sep 2020 12:17:13 +0900 [thread overview]
Message-ID: <D2C1360E-65CC-410A-8B39-48F7340FEFCE@marcansoft.com> (raw)
In-Reply-To: <1599706954.10822.3.camel@suse.de>
On September 10, 2020 12:02:34 PM GMT+09:00, Oliver Neukum <oneukum@suse.de> wrote:
>Am Mittwoch, den 09.09.2020, 13:34 -0600 schrieb James Hilliard:
>> This patch detects and reverses the effects of the malicious FTDI
>> Windows driver version 2.12.00(FTDIgate).
>
>Hi,
>
>this raises questions.
>Should we do this unconditionally without asking?
>Does this belong into kernel space?
I agree; this is very cute, but does it really need to be an automatic Linux feature? Presumably someone looking to fix a bricked FTDI chip can just run my script, and those who just want to use those chips with Linux already can since the driver binds to the zero PID.
I am deeply amused by the idea of Linux automatically fixing problems caused by malicious Windows drivers, but thinking objectively, I'm not sure if that's the right thing to do.
>
>> +static int ftdi_repair_brick(struct usb_serial_port *port)
>> +{
>> + struct ftdi_private *priv = usb_get_serial_port_data(port);
>> + int orig_latency;
>> + int rv;
>> + u16 *eeprom_data;
>> + u16 checksum;
>> + int eeprom_size;
>> + int result;
>> +
>> + switch (priv->chip_type) {
>> + case FT232RL:
>> + eeprom_size = 0x40;
>> + break;
>> + default:
>> + /* Unsupported for brick repair */
>> + return 0;
>> + }
>> +
>> + /* Latency timer needs to be 0x77 to unlock EEPROM programming */
>> + if (priv->latency != 0x77) {
>> + orig_latency = priv->latency;
>> + priv->latency = 0x77;
>> + rv = write_latency_timer(port);
>> + priv->latency = orig_latency;
>> + if (rv < 0)
>> + return -EIO;
>> + }
>
>Do you really want to change this without returning to the original?
>
> Regards
> Oliver
--
Hector Martin "marcan" (hector@marcansoft.com)
Public key: https://mrcn.st/pub
next prev parent reply other threads:[~2020-09-10 3:25 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-09 19:34 James Hilliard
2020-09-10 3:02 ` Oliver Neukum
2020-09-10 3:17 ` Hector Martin "marcan" [this message]
2020-09-10 3:46 ` James Hilliard
2020-09-10 3:49 ` Hector Martin "marcan"
2020-09-10 4:39 ` James Hilliard
2020-09-10 3:40 ` James Hilliard
2020-09-10 3:46 ` Hector Martin "marcan"
2020-09-10 4:07 ` James Hilliard
2020-09-10 5:33 ` Lars Melin
2020-09-10 6:48 ` James Hilliard
2020-09-10 8:01 ` James Hilliard
2020-09-10 8:08 ` Johan Hovold
2020-09-10 8:17 ` James Hilliard
2020-09-10 8:55 ` Greg Kroah-Hartman
2020-09-10 9:52 ` James Hilliard
2020-09-10 9:57 ` Hector Martin
2020-09-10 18:51 ` James Hilliard
2020-09-10 19:54 ` Hector Martin
2020-09-11 6:09 ` Greg Kroah-Hartman
2020-09-10 5:49 ` Greg Kroah-Hartman
2020-09-10 6:45 ` James Hilliard
2020-09-10 8:10 ` Hector Martin
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=D2C1360E-65CC-410A-8B39-48F7340FEFCE@marcansoft.com \
--to=hector@marcansoft.com \
--cc=Russ.Dill@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=james.hilliard1@gmail.com \
--cc=johan@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=oneukum@suse.de \
/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
all inboxes | Powered by JetHome®