From patchwork Thu Sep 12 07:05:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 828150 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2074.outbound.protection.outlook.com [40.107.21.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0642318950A; Thu, 12 Sep 2024 07:05:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.74 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726124723; cv=fail; b=iYS6+/4Kle+8TKHE1sRzf+CR05TcIA8rSPz2K8ZV/siZssS4uLkPfvCRLlmBZz49ZgTlgyY1wsLlmmD9aIkGdFByy88L6WzINTdi/LqIebBUyC7F0GWwN6isJNsJbHmICEyNkKyO6PN4RVbL/VV2vOWLJ2NYPg4IjAELWFCVQ8k= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726124723; c=relaxed/simple; bh=MSOBo6GSedwgdzJV58UweWNT3l7NbpCNSefqErEYvn0=; h=Message-ID:Date:From:Subject:To:Content-Type:MIME-Version; b=A6OWxPhvqv/hj3sbiWLZXM4ZjLDLiQ79jsqUkivTtbRKHAIKn8k/q1MCg0GJKbw7Gb5+J694c3H9mnFXZ8FDUmqYDXbPvhFZZmZjGI7PkoOT1NvegYm7CXqbI6r1HkN+fEO/b2tuMEgbe1RWFGyAL38V4jx6QjE0qBKAGQ5IBF4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=siemens.com; spf=pass smtp.mailfrom=siemens.com; dkim=pass (2048-bit key) header.d=siemens.com header.i=@siemens.com header.b=B9SjkHAT; arc=fail smtp.client-ip=40.107.21.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=siemens.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=siemens.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=siemens.com header.i=@siemens.com header.b="B9SjkHAT" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iV4RIe0w0IcTOYIPEa+LGDpkxLjn1rNzi5UKTyzYWNw7x6n7nmjv44geP60rZyRyuHNsFZy1KcR4DnUf+cDzxgZur6epMfk9s79ffw+TlgZdoU4bEhzVz6UEBKis8fHwoZeYP6eHbWNpg/A+VtG94LAm+vWNzy7zGeBzPouZNYJVCV69FBGTwr4gql6lr9mO1lytEpTd1fW9FHegar0EGttwWgZsGeF09kgf1NQcGeeG151HlXXmjb00GcMtfBkk0N1xxF1hZOTzWGtfhWiMNUwy1MMr+l46ZFTurPvW+LnXwfOzCLFuGV80PST52P/hp6msiuvju0PYGf/Yl28ITQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OT4udsYdUlOrPL/pzGbryYdu42VtNCls+SWefI4bNDw=; b=Y/2UV7zJf/dorr+ihhiwoAWAPchFuAE5Jo9D7z8+y3NXbK/bC5160A5rsd9rtHyUHezEMHtUclle+BjBdDBannSzrlTToVsTuOpcvTWxvnOhf3zvBSzTJcOXw/dupo4ZJ4fpv0ENr5Lw+UcMK0Hm9tkwDCjQJPO6NYsqTNGEfUwLedbqq272kCoS/AK1kfwx825clbRmE0YemnpppPIxRyo6GtqdtwMD1UTioWfnSjqyruztgK32ZTGdUXf+dTtubn36+4RV6FltqYkvEPD83UnJ3sMTRTtq7vk+Ze4z/GZzYdTEWo8AwXwLgs33bSVp7Mu3vNh/6uwcH6vLGV1kLw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=siemens.com; dmarc=pass action=none header.from=siemens.com; dkim=pass header.d=siemens.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=siemens.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OT4udsYdUlOrPL/pzGbryYdu42VtNCls+SWefI4bNDw=; b=B9SjkHAT6U6zIWUcb9asrUz3j9AUteq4usB/P/vCYT2itwG8GOWk+zxCpPgg+11WxGiZ3nogbcFAv3Hje0vjej0t5u6bg1FfTF+aUhjjF6klVFzdJh4j6u02udisq7gncIqfdOYY622Elp2g04lcT1m8BTCLbNKEsr0e3vedcPGLPmRoljyyt9aZ6vrSc8CDes1f1cbhqbh62vvR4UlY1XL1M/MIgotyo1GVDTk4+PbsoTSIbCgvSwA2TSMQ37hwuVMf/8vgUZwKmzMTwkHgT4BDFmtH4DXh15ujnbywUmt8zSffCGlz1WRCk2I5zq9MrXBi7arraDKO2UqwnSMZtQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=siemens.com; Received: from AS4PR10MB6181.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:588::19) by AS4PR10MB5797.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:504::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.17; Thu, 12 Sep 2024 07:05:17 +0000 Received: from AS4PR10MB6181.EURPRD10.PROD.OUTLOOK.COM ([fe80::8fe1:7e71:cf4a:7408]) by AS4PR10MB6181.EURPRD10.PROD.OUTLOOK.COM ([fe80::8fe1:7e71:cf4a:7408%3]) with mapi id 15.20.7962.016; Thu, 12 Sep 2024 07:05:17 +0000 Message-ID: Date: Thu, 12 Sep 2024 09:05:15 +0200 User-Agent: Mozilla Thunderbird From: Jan Kiszka Subject: [PATCH v2] USB: serial: pl2303: account for deficits of clones Content-Language: en-US To: Greg Kroah-Hartman , Johan Hovold , linux-usb , Linux Kernel Mailing List Autocrypt: addr=jan.kiszka@siemens.com; keydata= xsFNBGZY+hkBEACkdtFD81AUVtTVX+UEiUFs7ZQPQsdFpzVmr6R3D059f+lzr4Mlg6KKAcNZ uNUqthIkgLGWzKugodvkcCK8Wbyw+1vxcl4Lw56WezLsOTfu7oi7Z0vp1XkrLcM0tofTbClW xMA964mgUlBT2m/J/ybZd945D0wU57k/smGzDAxkpJgHBrYE/iJWcu46jkGZaLjK4xcMoBWB I6hW9Njxx3Ek0fpLO3876bszc8KjcHOulKreK+ezyJ01Hvbx85s68XWN6N2ulLGtk7E/sXlb 79hylHy5QuU9mZdsRjjRGJb0H9Buzfuz0XrcwOTMJq7e7fbN0QakjivAXsmXim+s5dlKlZjr L3ILWte4ah7cGgqc06nFb5jOhnGnZwnKJlpuod3pc/BFaFGtVHvyoRgxJ9tmDZnjzMfu8YrA +MVv6muwbHnEAeh/f8e9O+oeouqTBzgcaWTq81IyS56/UD6U5GHet9Pz1MB15nnzVcyZXIoC roIhgCUkcl+5m2Z9G56bkiUcFq0IcACzjcRPWvwA09ZbRHXAK/ao/+vPAIMnU6OTx3ejsbHn oh6VpHD3tucIt+xA4/l3LlkZMt5FZjFdkZUuAVU6kBAwElNBCYcrrLYZBRkSGPGDGYZmXAW/ VkNUVTJkRg6MGIeqZmpeoaV2xaIGHBSTDX8+b0c0hT/Bgzjv8QARAQABzSNKYW4gS2lzemth IDxqYW4ua2lzemthQHNpZW1lbnMuY29tPsLBlAQTAQoAPhYhBABMZH11cs99cr20+2mdhQqf QXvYBQJmWPvXAhsDBQkFo5qABQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJEGmdhQqfQXvY zPAP/jGiVJ2VgPcRWt2P8FbByfrJJAPCsos+SZpncRi7tl9yTEpS+t57h7myEKPdB3L+kxzg K3dt1UhYp4FeIHA3jpJYaF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8) To AS4PR10MB6181.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:588::19) Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS4PR10MB6181:EE_|AS4PR10MB5797:EE_ X-MS-Office365-Filtering-Correlation-Id: 2519d0f1-e9ae-42c5-0f9d-08dcd2f94197 X-MS-Exchange-AtpMessageProperties: SA X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?lj1XY7MplBbxV37ZfxnNKkY622Erymy?= =?utf-8?q?PxrZoWx3N0IMPimpn8AbjqEUvNMsR0t9DS6NYkkOeY+Hg40SXdDc+zJSKqqsadpre?= =?utf-8?q?E+BaXbWvjEiv30e6E02Rze9oVurL/hYf0hv/sw1Q6SI3XL8ArQn/OebQdlrjFLVjm?= =?utf-8?q?JGmkMm17W4DDMcAihEpei7zRJIngz56Nr5QuXqa0xBXBHLylRpZfygu7Q1H4iiN2p?= =?utf-8?q?8FU/if6Eq/VkUy+ljn47Kd0xnWCTUabWWqBJEFDq4wSQq7GwBd6T20YKY6lZhm2Oq?= =?utf-8?q?WXuwnUS3C0Nx0E9cZWSEIhcjp837x3i6m9LxwA5+UPiknwDuhKIKhmO0DhRXNBQZH?= =?utf-8?q?QyYOrZ4KYxNv30FgFloUp6NCXn6iH73jv4IQHq3hmEUJFsgEtkCBsG9L3UrRAxdFI?= =?utf-8?q?TyD5MxgbULxjjoRXKUL1tmrrWvt08aaPOlB1r/M9+5s4Tql4nKvlFVN7Qp433U6aV?= =?utf-8?q?1lY1UZTgPE71/JaWIJ20CfZsxptkdAmKtlQgtU+HUagP+8tEWyEkdjc+cwTr3myvB?= =?utf-8?q?OZro9Iybys0pz0NK8eBusdMT944+F5m8chQWR5x/9SPdMqz82bS3s8CZLphTGRWD/?= =?utf-8?q?0cVTsdlv30YxJiPQxyTSHoNyitFOUjhekXbO6mfaMaZcVZVhQYM4zKPjA9WhEx1Y7?= =?utf-8?q?IGOA5pKpIci12ni3kyvbz8YVS6nq2C6S+hkqf0Q59DdHIMERlgEr5sFrms0CBuRQr?= =?utf-8?q?8ODBq3RZGI/v29n96UK5ksn188bcrI5k84tMAPIAslABSBmWT12SWXyftA5sMpUD8?= =?utf-8?q?eXvfciE3j5612lCV3/iQYoqIYCW0woGJs0TDDyFpFaJgtIXkUHyFAlZAwCSC5Fm9/?= =?utf-8?q?5ynhB7v5Eti8BLBqGdnGb+um8JD/U+dcI6yZdg0Q2IEhqyjNCFoS72cJB1cKK1HCB?= =?utf-8?q?9MzZsuEUNXSNywmdP8/d1hab3mGycAFn53r+SyXf/4nKhbXAr7HwsOFO6ROloGPAV?= =?utf-8?q?BUWfbVo7/VhwqFmG7wU9Msn+VD49zEw71yLY6NKOed0XB7PAbXRRM1zMLybIfb5xM?= =?utf-8?q?DpR9I4HLybI5xGLyaG/6tyPRuWy4bLnsFg/icpvSrd4EfIpvG7aCnZQd608wAR5p+?= =?utf-8?q?GvmALGseezmcyxwiFVcZOIWjHLypekOanccwenD/9KArHPYHp/wjgE9oos1Efpp3a?= =?utf-8?q?1+Ubh2gf8HyVGnZ+g7gw4IfvTW8OVaLoPKH6fGm5o2BODZvxtGe74pg9Tv/fCATAb?= =?utf-8?q?h47Xr910/MTvy8tx5XDd4DGoljJHMcoeITnIMqfy9kwqQEc90wfDsJH27yrwM15z0?= =?utf-8?q?VYdmm8WHZgUWUu4f5WGCzv0kc9aA0gfYzIw=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS4PR10MB6181.EURPRD10.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014); DIR:OUT; SFP:1101; X-MS-Ex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VYCb+SLOjAJkQz?= =?utf-8?q?ItiGymLpR+RKGAqpLlsaSG9PuYX9uk3tlNdYZ0IuTbwiF4kKQsi3iRztNK8g5ZVsC?= =?utf-8?q?UaOTyjSh7gqKYFLIkmaUU8HPIf3v7yPMSTjq3eKrV9mcvvrc168hIDMojrI+oxnrO?= =?utf-8?q?P45myp1N5G/UHlBhqimSYByo4PSmBs2tyWVBf+SJi0i0kchkTG11iP4F5oKiXFgnt?= =?utf-8?q?K4zrmptg7NvWcsIRxJvvACl6kUV/LRXFXdr1WaKALLr2YNdrdl81wkdecMzr1pccL?= =?utf-8?q?OjMp4IeM0hfZhIZw6YU8r3I8CFbbGIIXpcXqZpvrVyiJy4MQgDygxnOk2pOmBHsDs?= =?utf-8?q?y2bT480/Zt2AxvSaR9X8ZGF6lh8opRe/CDCZXlJrx4+V4QVaMPhSVlBVGfTLihfO2?= =?utf-8?q?Ao4QJ6qlJSgNJXfqtDFddpBaNXOA+/L7ZGPFxHlDCUItW4xHSoPhQAH9ckl7o804n?= =?utf-8?q?DpwA485aFbWGo8NIqmptjG08+WU7YVWrly3Nmw3mDRaJoNFklbEj5yO3se1cwZXs0?= =?utf-8?q?Yw6JfORVVEv5FOH+4eNZ3S5cnpwOIvOlz/ODlmDCBBYCM0XMj9DjqYQ1u8EKJVrQd?= =?utf-8?q?koa6rAvrn7+OpzDd85u7DP3dJVxYAACIuzR/bZuaddVjjjtjhCHL4TXqpOpjHnSiT?= =?utf-8?q?ywH1OXPO1sXELiWz2WgNHt5kDfmKCVmh+TD+cDD84fuy1cgZ2WrqXmN2/SoW2swXD?= =?utf-8?q?h7MyiI/bVlKoUWCisETJKmObK8dsMXdcsQ=3D=3D?= X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2519d0f1-e9ae-42c5-0f9d-08dcd2f94197 X-MS-Exchange-CrossTenant-AuthSource: AS4PR10MB6181.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Sep 2024 07:05:16.9816 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 38ae3bcd-9579-4fd4-adda-b42e1495d55a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 6HWO1Jv17Sr7k7IQWUkISl1NP9Xdu6rUKJmDDbZrjHbo3O2RT7ZNzRRr4uf/1vEf+4jZppMik/1Nn5dFYUEGhQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR10MB5797 From: Jan Kiszka There are apparently incomplete clones of the HXD type chip in use. Those return -EPIPE on GET_LINE_REQUEST and BREAK_REQUEST. Avoid flooding the kernel log with those errors. Detect them during startup and then use the line_settings cache instead of GET_LINE_REQUEST. Signal missing break support via -ENOTTY. Signed-off-by: Jan Kiszka --- Changes in v2: - probe for clone and avoid unsupported requests further on drivers/usb/serial/pl2303.c | 47 ++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c index d93f5d584557..a61ae0d0c4ac 100644 --- a/drivers/usb/serial/pl2303.c +++ b/drivers/usb/serial/pl2303.c @@ -181,6 +181,7 @@ enum pl2303_type { TYPE_TA, TYPE_TB, TYPE_HXD, + TYPE_HXD_CLONE, TYPE_HXN, TYPE_COUNT }; @@ -192,6 +193,7 @@ struct pl2303_type_data { unsigned int no_autoxonxoff:1; unsigned int no_divisors:1; unsigned int alt_divisors:1; + unsigned int no_break_getline:1; }; struct pl2303_serial_private { @@ -232,6 +234,11 @@ static const struct pl2303_type_data pl2303_type_data[TYPE_COUNT] = { .name = "HXD", .max_baud_rate = 12000000, }, + [TYPE_HXD_CLONE] = { + .name = "HXD", + .max_baud_rate = 12000000, + .no_break_getline = true, + }, [TYPE_HXN] = { .name = "G", .max_baud_rate = 12000000, @@ -466,6 +473,28 @@ static int pl2303_detect_type(struct usb_serial *serial) return -ENODEV; } +static bool pl2303_is_hxd_clone(struct usb_serial *serial) +{ + struct usb_device *udev = serial->dev; + unsigned char *buf; + int ret; + + buf = kmalloc(7, GFP_KERNEL); + if (!buf) { + dev_err(&serial->interface->dev, + "could not check for clone type, not enough memory\n"); + return false; + } + + ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), + GET_LINE_REQUEST, GET_LINE_REQUEST_TYPE, + 0, 0, buf, 7, 100); + + kfree(buf); + + return ret == -EPIPE; +} + static int pl2303_startup(struct usb_serial *serial) { struct pl2303_serial_private *spriv; @@ -484,6 +513,9 @@ static int pl2303_startup(struct usb_serial *serial) if (!spriv) return -ENOMEM; + if (type == TYPE_HXD && pl2303_is_hxd_clone(serial)) + type = TYPE_HXD_CLONE; + spriv->type = &pl2303_type_data[type]; spriv->quirks = (unsigned long)usb_get_serial_data(serial); spriv->quirks |= spriv->type->quirks; @@ -724,9 +756,18 @@ static void pl2303_encode_baud_rate(struct tty_struct *tty, static int pl2303_get_line_request(struct usb_serial_port *port, unsigned char buf[7]) { - struct usb_device *udev = port->serial->dev; + struct usb_serial *serial = port->serial; + struct pl2303_serial_private *spriv = usb_get_serial_data(serial); + struct usb_device *udev = serial->dev; int ret; + if (spriv->type->no_break_getline) { + struct pl2303_private *priv = usb_get_serial_port_data(port); + + memcpy(buf, priv->line_settings, 7); + return 0; + } + ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), GET_LINE_REQUEST, GET_LINE_REQUEST_TYPE, 0, 0, buf, 7, 100); @@ -1063,9 +1104,13 @@ static int pl2303_carrier_raised(struct usb_serial_port *port) static int pl2303_set_break(struct usb_serial_port *port, bool enable) { struct usb_serial *serial = port->serial; + struct pl2303_serial_private *spriv = usb_get_serial_data(serial); u16 state; int result; + if (spriv->type->no_break_getline) + return -ENOTTY; + if (enable) state = BREAK_ON; else