From patchwork Thu Sep 12 08:37:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 828148 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2080.outbound.protection.outlook.com [40.107.22.80]) (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 47D1D18BC27; Thu, 12 Sep 2024 08:37:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.80 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726130275; cv=fail; b=fYSOcZIX4AT30nKr2q55BR8rQzPp1OCaeiualRzSMJmaD7JP8/vbUyh2JBW2EH1fvGWQ8SfsQENhmJIvE1tafnCLDnOOLJrBJdCYH8VH+yoSJLWl+8DbZrU2yNk4RhhFbhrseOiQBKW66v9l8TFCW6Es2CMYW1tdxilCso8Xfoo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726130275; c=relaxed/simple; bh=w8lxtiv6rGDcqtr7vWjpaS+V4MZ7S+kvIu0040jveZU=; h=Message-ID:Date:From:Subject:To:Cc:Content-Type:MIME-Version; b=JR8eH3MB7fYsB9BblnJ8Mi5TKDNQhOw4HBMG04oLw6cMrqSWBqo5SxbuysbZIachynBMf6BXN7Jv7hJcqcHiOj9K9Fh8NR+ZDkP1kLnx0u8geHObiSh28O5LCmnhItBDKkT2AFIyJ6g2LTIgE5mtRUzxA8dCd3sx9GSvzaIIRBE= 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=NYOzQNZj; arc=fail smtp.client-ip=40.107.22.80 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="NYOzQNZj" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rmlFzzfzB5tINl/HskwmOOBttjYItsFxkJ7yWBnJEVEY0fQmilhygPedTQk3GVrPSi4vGSFn8/YMlexZZBrqujlCl90hh6gTAMxAjr3M0bs6pzFTwvTr8DV76EPiNw1gx/XhLFp4g4aRcwJ4reNl65KUVgVBMc3vQoXgN4/FHtx1iZ527pdnHxxtnsasqINpd1Wi6MehSjsiTjZZZJkk9PZgDnNAvi2qvGbpJoXICirfOVIAf+yJcOCCVtqePpbtknJu7sE50QfNSvtDpi3/isTDFqYFyS7RMPwplV8Ix/dLj4M08ieoTIXMKg+t1VRh+AKxfo9lVEDITc3X5Ez51A== 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=QbdTVDQtDBVfOVlDf+Y/kjNnVNECLu2Y8iFmPYDXTfA=; b=d0DNm6r7vZrwR9M3Yi0CLhkUKy1ciUtpa02aF60wHNUBqaKmbSyN6ayjI+h77xtMqc4ERn0Q2vPSWdCdzq6b5GfMjVbNnIuCWJ3t2Fp5HtX2Tzt2roF5RPgNlKynqp18rij3b8mNhGOUtvzhGCy6S9poFYOvHpKHW+SgO42cKOe33NWZdTH3YR9MyLDbvsIxJlrEeRxN0zub6JupbXmHLQwOI5BGI1Py1mWh6tjvYO5odWhHgrup7A9ixAD/yhuGsMwbQQOyDItGLR0cgHw112r4bQLp5f78KC/7+Cu9H6Vljt5yiC/wYjJPQT9JIrcwLBmlX4ZoqTT08SuZf5uj+g== 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=QbdTVDQtDBVfOVlDf+Y/kjNnVNECLu2Y8iFmPYDXTfA=; b=NYOzQNZjvkhNxXDL7iOmLpJUcB9K7h3rDc4cTdkbV8mY1q9xKdrTKs34jo05M+Ad3aVxIGF4t/y+lWB0snyHK2wq+EFr5l7tSeYAVPpinI3UkUwqeROtlznozlrulXSlIjNqQp+4IV0ClmfUVB6asobZNVi3DEAa3WjpnQvIJ5BnR1yQvF1DNing1+G/LOBbpF4fzVGAjSTrTauEGgj9MYvwfSZ5U7a9zIoPwPiOedX/zPeVer8DZouxUHCwxPnIhg3C5lnhz6FkuEVlD462gm69P2JmyIVG5MInbZprrYOQeJtwlxk+ANLd4ZVIRIdBuk1oAF9FvopuI3hQA1ReQQ== 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 AS4PR10MB6158.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:586::18) 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 08:37:48 +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 08:37:42 +0000 Message-ID: Date: Thu, 12 Sep 2024 10:37:39 +0200 User-Agent: Mozilla Thunderbird From: Jan Kiszka Subject: [PATCH v3] USB: serial: pl2303: account for deficits of clones Content-Language: en-US To: Greg Kroah-Hartman , Johan Hovold , linux-usb , Linux Kernel Mailing List Cc: =?utf-8?q?Micha=C5=82_Pecio?= 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/jGiVJ2VgPcRWt2P8FbByfrJJAPC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k= X-ClientProxiedBy: FR4P281CA0450.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:c6::11) 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_|AS4PR10MB6158:EE_ X-MS-Office365-Filtering-Correlation-Id: a60a8ef0-52fd-4a93-56b0-08dcd3062b24 X-MS-Exchange-AtpMessageProperties: SA X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info: =?utf-8?q?y1POTuTBwrp91Yk8rSDH15/Iq0T46y+?= =?utf-8?q?379YBvO2awEtaakBNj6eOLR1z6iQaCgYwZS4o7S3S3bZ7oJ5jQCxK3ROWS/bN1Mwa?= =?utf-8?q?RvF4WGlHxNq4n3O+N9qhheUzz5MCC1J9b6XXXinlRrHlN0Za9ee242TRp7sOz551z?= =?utf-8?q?Eyv04paJNNDlLMTgPHYoFN7odgZdK8k1/zvgw+IIiYlB4rURI7V9jRs86jLMFL0s6?= =?utf-8?q?B8jVzgxV/4j0knNQ5htZg8pmHKXMHKWsDLSArpThRDOOa1i5+vxT/h+eDBuh/WACV?= =?utf-8?q?wFOkT6/v48mQHHFAiKmMmQR44ocCwEO7hdyOFnIEbVQkqp+TS4g8TNxbMxaJ6JSxk?= =?utf-8?q?+jQByM6hhUAsyEoTW6w8Q9wQj+kqcHJIxAkNue4JLiSKrq7MvNgNeV68YX+V7kuvq?= =?utf-8?q?Tt0/C8IyOJJNpMBPUaWp6G+l87/sVISFr/cfy6kC6tqbRe8rsG0r+Z0XW6gR5fvxJ?= =?utf-8?q?fTgjdQ7zVWcmyntN+mmUPfpsaAu7cekJbn6Q1CPK0AtB2BdUUD4c1PPdMqRJudkIa?= =?utf-8?q?cPJa1+KCGKKWDJOCna5jlSnNKMpSGanOGxULp40OdrS/7MIUAt+69djGcidBMKBvn?= =?utf-8?q?jDV1YrhcqzdavroV5WSZ/ZrZdcLTlJds6jlBMbUU1W/k3pqgDUomd3+x3FIQM+8jf?= =?utf-8?q?/c/Sw2xHnV0NwnoztcfeXIEXDMD+iLvQoXGWC6vWEniGCwFhpLG0m7DfqtJpX9AH/?= =?utf-8?q?d5iber9XDfVDtxIgAdOZvUIPlWkZB7J/CyxPnD8/mnZegmJQj+WvOkzloL63F9q+i?= =?utf-8?q?mazFtM+5tRnZ05x1Vw41xCbQG3IvjFsmNLyXUJZaoRqUuGYxxIW5eJPv4+URZCBhW?= =?utf-8?q?3J1fFK5g9191x1w3dffcnkBRlIm9uja6iaQvwenwUzS8miOpvmMZ1yQYfsi45eyb3?= =?utf-8?q?2F5WcE7IWPYeHMo6XB2Iy5zAqcH0zeEEbZRy5shjzHJjDUOKxGcGRo3ENDB9hJgys?= =?utf-8?q?FUiDwhC/QxVs7oy/X65jLDnZQiUthIw6Cp/fTCc+1i2NwgP3YW+eZny5MpS3eVNs6?= =?utf-8?q?vDSEUn98DOR0Ygjrs4DeAcPA/ngvJNehicVpnua8mNAb5lZEw+9sFH9cGyqbKcPux?= =?utf-8?q?o440xf/5K82mwJn3fX07ZLHpbnGQP6gKZ5eENHgXzqpSbefYKuxagbWW+nBAbS3l+?= =?utf-8?q?w6dKuWwUDvQTDqaZWH1f95CLxA9WDw/+tWFrebr+CmSimiOw4wJVfRYiXUkryBQDk?= =?utf-8?q?WD6hLKz6ePSVeufzJ8w1mCJSLm2D5a4dMiZb8PkmmGHfz+rkmHrfcCIwB7KSSCImI?= =?utf-8?q?r3a/g0rZtQHTwx/706UP2IiOe/kkVLHyqPA=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)(376014)(1800799024)(366016); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?8VtLR3tbtGpwM25I2ZjUAEdHUNTH?= =?utf-8?q?8bgWfiEo2LQoKeXmv2tHdx2NGp4gGbMJfMCAlb+eoTAxu+FhFpfJpi+sQYBOXGV1H?= =?utf-8?q?x77BKD26+JozcgrATWOQd0mjDjtGejuSuMiAnOmw1vs5V0Fp3oPCP6dRoXNHnRVru?= =?utf-8?q?B4LQfBdTtUItIFHKvqWQe9433mHFUvZ0fN9xpq6PSHyXcMfpoNPQQBxwXfrFtghKH?= =?utf-8?q?gzpWnTpG7MXNgDYMPajiSICqwp1LqkaJDwxhoSwpXOG9a3II/pTgqGw7L9yEagEij?= =?utf-8?q?+6oXCgi1La1Z6KSzfsNsmzgUafhFGhxjAauvvrV4rk84YUxG3NdtC7EvZfwTA2CSK?= =?utf-8?q?chRE87KaQJYIyyfjPpB4AB235A/YIfZSGoQfKaFOz9PciHhHcMCvzotV/i3aAG3Y2?= =?utf-8?q?iVllc+0btuXOvR66OKqUh79c2SMiqZmoZJcMo3S29D/9MCSQLBKUVKjVrkoGrilU/?= =?utf-8?q?mA6kE/IMvl1Ds4Uq2RweEspWnBSZSkOGcrCV3NxecTGRlq+s3pG5hM+yL0QEhUIlI?= =?utf-8?q?G0eore+M6fGalrqhPALAL6WY15Hv3J9Dc2kNpcRQr9z6tOO0aNr7QQ0GbxoEfhKPl?= =?utf-8?q?KF20NZ9M4g/m5rL4gcMs/QHcbpSHCpGYjqzRla/tRb6P0K6+1Hbb1IDxKdkuer4mi?= =?utf-8?q?4SefCIu5PxiDQMITHLl50KnG+nF6vuQO5zHWAv35LFoNaZPV+AUGHFOxPn3iARZ5L?= =?utf-8?q?bZUMeKXhcos20Oix/XhwQNnAMSccNcnGy4ixzD6p53dhd8rXXTOG8eUiORmkj1r8m?= =?utf-8?q?72M/UcfYOWPkNFnBqjC1Hl1vkTBEt6MVBJT/QHZWEIbccIm4nFdRmZRXZ/D4Vo0Pz?= =?utf-8?q?CjZBD1BiK3Fhhp45kMc5+xvilMg68O8feSymT5O5MoAy/NhoNQkb5hQzffGNYIRsQ?= =?utf-8?q?RBMef7ZQ/wUTgELCxxyeHF6TbjKH+/dKOjMclb/HNBSp9oPDgdA/+4c8pdtJc0Ws2?= =?utf-8?q?cfa2sh6uy3sGfcDyyUto4Esomp35TWk1T6/U3F/j5IUGyI6QIotmezBZfcxoIaUzL?= =?utf-8?q?1DeYSVrae6cmKpwMJahlWblPoCIFSEdyFzSnIJggRu6ddIZfOcyMJ9sHclx1s5Qcd?= =?utf-8?q?O9T703FiTMAhpXZoSem/fmbbsimxBtK+JBSX4F4NqmMhQgH8/IdNrjGU29F9anCda?= =?utf-8?q?1qxSdQwFGOA4YkGaC3CPq1O/kvzkuWEuEZYBGNu6vtgIvxgURoftwpvagsh/tSER3?= =?utf-8?q?piAjdEK99asid/rQG0s75ZXl608oNjiSdeyhk7x6a8LHF7xgoK0YhFyRg13BwPxo+?= =?utf-8?q?DMn3XMEVcbJ5WSeu4MLYH2n83AJ9G2YtmWk0+resgR7HYV0JazQeYbhus1ueHy2Si?= =?utf-8?q?0ZA42ppjaPH8PNutsyFcicCrh/QxD0NFf93InByzfMKw6IPhiwv9Wx7Q8vLzEJ5G1?= =?utf-8?q?vfN8utjqPvgtCIPjPwDgeRe6ecdVy50qv9J2yCHNILlyY9yo3vMDkAGMhwRoTCHKe?= =?utf-8?q?JYFpdnnlP7NCC2dismlT2fnb3WFs/5WSxjZLkV5mNbI+orNWAOl0F6/noMmkGXsle?= =?utf-8?q?wetzckKp+sdVjZm+ZBKBRjmKhhUpExD44Q=3D=3D?= X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-Network-Message-Id: a60a8ef0-52fd-4a93-56b0-08dcd3062b24 X-MS-Exchange-CrossTenant-AuthSource: AS4PR10MB6181.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Sep 2024 08:37:42.8241 (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: GiZpojBT5oFxuc8cmh3cOakKcnx4iwNNmv0sM87BtW9wW3pjFtVVA4y5jKgV+NgWuxLni2KgXN6uMG3oeeVPxA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR10MB6158 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 v3: - use quirks field instead of new type (suggested by Michal) drivers/usb/serial/pl2303.c | 41 ++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c index d93f5d584557..bc433178a6b0 100644 --- a/drivers/usb/serial/pl2303.c +++ b/drivers/usb/serial/pl2303.c @@ -31,6 +31,7 @@ #define PL2303_QUIRK_UART_STATE_IDX0 BIT(0) #define PL2303_QUIRK_LEGACY BIT(1) #define PL2303_QUIRK_ENDPOINT_HACK BIT(2) +#define PL2304_QUIRK_NO_BREAK_GETLINE BIT(3) static const struct usb_device_id id_table[] = { { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID), @@ -466,6 +467,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; @@ -488,6 +511,9 @@ static int pl2303_startup(struct usb_serial *serial) spriv->quirks = (unsigned long)usb_get_serial_data(serial); spriv->quirks |= spriv->type->quirks; + if (type == TYPE_HXD && pl2303_is_hxd_clone(serial)) + spriv->quirks |= PL2304_QUIRK_NO_BREAK_GETLINE; + usb_set_serial_data(serial, spriv); if (type != TYPE_HXN) { @@ -724,9 +750,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->quirks & PL2304_QUIRK_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 +1098,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->quirks & PL2304_QUIRK_NO_BREAK_GETLINE) + return -ENOTTY; + if (enable) state = BREAK_ON; else