Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp947536pxk; Thu, 10 Sep 2020 03:00:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhPk0JOJ1kVNBhIQ2ukhh3kbpx2DWvFqlioc/gjSqOCdlVW8c4IakgjCR9SZKotsX/JfDM X-Received: by 2002:a17:906:8682:: with SMTP id g2mr7803722ejx.110.1599732034534; Thu, 10 Sep 2020 03:00:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599732034; cv=none; d=google.com; s=arc-20160816; b=vVVArXZmvzMUJx0Ohg7gTF0AGAUCYUgcaE98uJpVJo89FrTLppSYAuxKNaTCfwMJxE eoPCdfeb0Huaira4tv96DO4Fn7RLTzyYacPNNss7z60we1h2hn9buJEWpvV+1fuJzeoI OtR8aY/WslyAgIIygjyXCPC7ORoQMZiUE4Rykjr5oOZ3sSf3hju6dw6LDteRU8t5QYAn L1ufiR6F85gun/8a8GcIftSBxwibJN5Go7xQHAYUDXDPMKbHrMtPkq7B9v8x8SQ00Vyp hB0UrM1c51LuBo6dpqV98ii4V33+WTjF2MXP0QPDxOPFTw8ScX4pgjIYkk9cZ7UznZg6 Z5pQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=cNKKEVXDuSToEJHGCjB9CeCjjlP0fF8TiMWgKzUqA3M=; b=uwZVuEcR5twe1NVYSroAJKvCIOVokRtpcjjalJnonbrm88KnM8Oh91Aemn9nz0eeIR DvfSnPpDaL3RmF83Zm5WayHrFtsLWl3YQRNc4JomI39MfQ9utW4OiV77eFsPVeLqV1MQ nKyYQQpCzfTJaWNztZKMezhw/8qu44Nzb6qHlDv96VIuD7fBXG1iuaXPl4Wc3oVkjecw jh9LMmUlN2tST/RqipEzrhSDMXSPD08ydIM9TvnKJbOqX8pJiwriCe2ZWsf/LbBDRiNB s2MkIZvUi+dN4/sMJ2BO1tMjDjNN2DSFEMDajDm8ESUCULNkxiQDHEKXNlRmw0+BpNn7 L+xw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cb11si3210265edb.361.2020.09.10.03.00.11; Thu, 10 Sep 2020 03:00:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730688AbgIJJ7X (ORCPT + 99 others); Thu, 10 Sep 2020 05:59:23 -0400 Received: from marcansoft.com ([212.63.210.85]:48630 "EHLO mail.marcansoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730627AbgIJJ6B (ORCPT ); Thu, 10 Sep 2020 05:58:01 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: marcan@marcan.st) by mail.marcansoft.com (Postfix) with ESMTPSA id 1551E419AD; Thu, 10 Sep 2020 09:57:49 +0000 (UTC) Subject: Re: [PATCH v2] usb: serial: Repair FTDI FT232R bricked eeprom To: James Hilliard , Greg Kroah-Hartman Cc: Johan Hovold , Lars Melin , Oliver Neukum , linux-usb@vger.kernel.org, Linux Kernel Mailing List , Russ Dill References: <20200909193419.2006744-1-james.hilliard1@gmail.com> <1599706954.10822.3.camel@suse.de> <20200910080850.GD24441@localhost> <20200910085541.GA1099591@kroah.com> From: Hector Martin Message-ID: <26a723e4-e166-6377-875a-f737a15dc6b1@marcansoft.com> Date: Thu, 10 Sep 2020 18:57:47 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: es-ES Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/09/2020 18.52, James Hilliard wrote: > So I'm having trouble coming up with a reliable way to fix this in userspace, > I've already got quite a few moving parts there as is and most of what I > come up with seems like it would not work reliably, at least for automatically > repairing the eeprom. I'm confused as to why this is hard to fix in userspace. You already said you have userspace code binding to the proper VID/PID, so your code won't find the bricked device. Then it's just a matter of having a udev rule run the unbricker when it detects the bad device (which should issue a USB reset when it's done reprogramming, making the device appear as the right VID/PID), thus effectively doing the same thing the kernel does. If this is embedded and not using udev, then substitute whatever equivalent you have. If you're polling for the device at runtime instead and don't have a device manager, just poll for the VID 0 device too and apply the fix. I can't think of a scenario where this would be difficult to fix in userspace... -- Hector Martin (hector@marcansoft.com) Public Key: https://mrcn.st/pub