From patchwork Wed Apr 3 07:41:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guanbing Huang X-Patchwork-Id: 785968 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01olkn2106.outbound.protection.outlook.com [40.92.52.106]) (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 E8FDF5D91E; Wed, 3 Apr 2024 07:41:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.92.52.106 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712130109; cv=fail; b=R+yXaxkJlxMiiB/uxpHHl16T5DV5RG8fowILoyI+5R2GIkNVt/Ato187VJqGj5CE65IVASanayvnYs8fNOWIihxPb4XhoQf4a+kuU4Q4BQr4EwPTJCB5sxufwrGwjSdnsmpBoVXn+jDmRa55s8Ih8xglK3uIcjk8ENn1ysuLmic= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712130109; c=relaxed/simple; bh=y5MBC1wZqRNlAlC7Q8MbbTEywrxX8OETnD14mktOMCE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=oArkN0O/vvrUjzyK7mhXzRLopUVEXQ3EsPigdqF20uq9GSW05o2fle7bLbtrDiXOpaAA+UYmkUc90ye+0iLLGLCxzYM9SpE8Ld11uOD7eim7A5ujPexAgOG5nhm0OGSe9F3WL28ecjgMcADggLyNUMCrl6EKXv/OITwiKCi51co= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=outlook.com; spf=pass smtp.mailfrom=outlook.com; dkim=pass (2048-bit key) header.d=outlook.com header.i=@outlook.com header.b=cpl3+Sso; arc=fail smtp.client-ip=40.92.52.106 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=outlook.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=outlook.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=outlook.com header.i=@outlook.com header.b="cpl3+Sso" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i61DxgcdnsIz4W1nY7k2zR5RV0Dri7Rbi0m3XQDYEJUEdFBVoNqpJfQpvesY40DMLZESnaI9Zl3JHcGHS/jEXuvk0RE13x8+PKlOA15Amv42k812iwsxc8reFvuWSGXt9TrcN9l3FnDBG/dORjR7i66C44vUm1SjUqlewoqlUSCr4DKVddFfSkwLiT3WmJsZy7FoXdGJbaaUnNBq/qkipeXmfg+jaDTadTOzhsDh5BAIAgbJWFVoQR8GFEONBk6DeJRbYoDhBCeswFiY77zvkdFAbWFdg+9Mm+dji8zZTJ6t/6n1SZF4mgt74yVctxR3KqAN/A/OnlDVSVQyPayWzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=83md5WSWcVzebHf/A+5fljk4rOv4GvAK1ZrAb7I3TWI=; b=F8QzEDbS06IxTEsyoJZQQNVHfPSxdDUouJnKK3229DWsiHaCl3M/fhV2atvpEbFEBPfCweFWjsb9y5KFgJUhfbyO2H0uktVb2RuKmtmrevhTG6tEGtHKiBLkszVLsLg4iyOc6tq4xGBSzyX5/TMqqx4T/FIbDOPa67LHMPeAZH/Q6s+f33t7TcrwToLeNWigPDC6pdAdsIblRrMg6C5B/Frc4UIv4pJpAQxug9lr4XdOd9zqvw90GP1Ylgq1nJ7rAtpwrmH2e5O6RFrsHkb/oGwxop+11tgLmBYseWyIyaFSwfgB7xK1dWu33J7AqFCX+cDeKtpFhSlVGW8OOwMwZQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=83md5WSWcVzebHf/A+5fljk4rOv4GvAK1ZrAb7I3TWI=; b=cpl3+SsoFKwsPYp0eAKaHnpE8IWmB/u3xt9SZIc6zM5/KR0GM5kxKSxidyXsBYcCQp5PIzo8/FktVfvpn648RKxyHciVQbb8pWoSK0v3ems2wRBm/2xK+m21NkL3owXPQDUgnRGmKlnTfZ2RLOPyNyC7fSUDA+zPx6AUhswtyDG73HI42xkZ7mPUG/BA3cmKVgLGNY4a87ZYAOkm9S0hL45orJ7dj8zTOqai+2TQScsPrmho7cwkoYj4Od6h/89GgyLWW8dxnleLphLEjDo1DrCjH4+ssAFmwF7nIJsc0paWnRmYmITzq9IxbqyU3J6/j8DlfKgiv3qZUH7pqeDEXQ== Received: from PSAPR06MB4952.apcprd06.prod.outlook.com (2603:1096:301:a3::11) by TYZPR06MB7169.apcprd06.prod.outlook.com (2603:1096:405:b7::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.45; Wed, 3 Apr 2024 07:41:42 +0000 Received: from PSAPR06MB4952.apcprd06.prod.outlook.com ([fe80::45cb:f62c:d9bc:b12b]) by PSAPR06MB4952.apcprd06.prod.outlook.com ([fe80::45cb:f62c:d9bc:b12b%7]) with mapi id 15.20.7409.042; Wed, 3 Apr 2024 07:41:42 +0000 From: Guanbing Huang To: gregkh@linuxfoundation.org, andriy.shevchenko@intel.com, rafael.j.wysocki@intel.com Cc: linux-acpi@vger.kernel.org, tony@atomide.com, john.ogness@linutronix.de, yangyicong@hisilicon.com, jirislaby@kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, lvjianmin@loongson.cn, albanhuang@tencent.com, tombinfan@tencent.com Subject: [PATCH v4 1/3] pnp: Add dev_is_pnp() macro Date: Wed, 3 Apr 2024 15:41:28 +0800 Message-ID: X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240403074130.93811-1-albanhuang@outlook.com> References: <20240403074130.93811-1-albanhuang@outlook.com> X-TMN: [tW5Jjevm/8o494xJH/n9cdndo2d6Dlhc] X-ClientProxiedBy: SI1PR02CA0053.apcprd02.prod.outlook.com (2603:1096:4:1f5::8) To PSAPR06MB4952.apcprd06.prod.outlook.com (2603:1096:301:a3::11) X-Microsoft-Original-Message-ID: <20240403074130.93811-2-albanhuang@outlook.com> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PSAPR06MB4952:EE_|TYZPR06MB7169:EE_ X-MS-Office365-Filtering-Correlation-Id: 8dbcaebf-b261-49bd-f274-08dc53b180e5 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QMyamEH4gMp9zby7wSxr6HiZhxRhHjyHsqnUv0n1uuvYDn2W9wi+TQ7YCzdO4qWFlk3crX8SZidd7KK7TOjKOHiE1QN5IUW+efHkca8a7jXGO2V4KG5ODSVwDR3rk4BTOOGSFXvqp8kbXPp45LiOJTw2+m0kvedPae9eNCVdjGcnY7wPJtXLqlGKrdrYXqyDraQAhrJAPzxfQIBmWQBLFiaBKEJhQ+VLQpUDs06SSCglGZLiF/u68fvi0vJQ0/xgu7Az2eN9Tejrk418vHJ5Ryw6PdvcAi9q9Xkq+n1NoJFORmBIrF5zaRTnyCFrFwQthrYmvLCs+GjyltoKYxyfKYmV/e6Bo0cwReMFr4b7yVxjucB5icsZpCq2QBIlBjd+d9t8m+yNB018fL5dVgATxHTvc5lopamutOXx8egm8RSxz3vtuOFjZYHVEd7xOFgP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ClAcqFqM0mGVYmYLjgx38rfB4calNTLVbsT/uZPdsIh/lsEkuGXatXaFQjggDo2HcphRguWMYb0qWIBAQB+N533gC/Ho+wl9JZp39HI/xA7SoHE91ziuMbBLZNEQfl0AsHy6N7mrW7fpGqIxziF9aNIC2BFrxbqnf9vxuNMAiZeRb9wndgd2ZrmFxR4iHjURrDCC+Sbd+nt7e+kAoYWeUmbZcKZqME9wsSofZ7MlBlCuYwk4irEghhWB14aM8OvXB7/XwOieS/h3rbV2/tfKQwxBjorwh5BhR8QCzZzJK4kAV1kQVXGT7tqfg7UoT4UL5HmTiDissvDqFsCcrKElgNYFacmjxu3XDVX97Trfevo= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8dbcaebf-b261-49bd-f274-08dc53b180e5 X-MS-Exchange-CrossTenant-AuthSource: PSAPR06MB4952.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2024 07:41:41.8837 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB7169 From: Guanbing Huang Add dev_is_pnp() macro to determine whether the device is a pnp device. Signed-off-by: Guanbing Huang Reviewed-by: Bing Fan Tested-by: Linheng Du --- include/linux/pnp.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/pnp.h b/include/linux/pnp.h index ddbe7c3ca4ce..792921c06594 100644 --- a/include/linux/pnp.h +++ b/include/linux/pnp.h @@ -502,6 +502,8 @@ static inline void pnp_unregister_driver(struct pnp_driver *drv) { } #endif /* CONFIG_PNP */ +#define dev_is_pnp(d) ((d)->bus == &pnp_bus_type) + /** * module_pnp_driver() - Helper macro for registering a PnP driver * @__pnp_driver: pnp_driver struct From patchwork Wed Apr 3 07:41:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guanbing Huang X-Patchwork-Id: 785455 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01olkn2106.outbound.protection.outlook.com [40.92.52.106]) (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 C9C5B67C43; Wed, 3 Apr 2024 07:41:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.92.52.106 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712130111; cv=fail; b=upZ/VYGhMocSAqkLWaLtBSobNDl9m9HcZmhsq0TCd5Y3Pblb6HtH9ohMoFmXLHzxlzobZJx2mlIntNo13WDomfiAkLGadGMtNqK40JUR5xNOXIgDh2kWwVyenmT1FqL1aG3FVFHkpPO1+Qcb9L6g7BUP4VLsrrxgw1ZAqnKQHz8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712130111; c=relaxed/simple; bh=BPijApgv0DO3dC5Tw68krrcSTmUS5oVyqjVyHbg/H88=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=K7GRJpiX1KKRgtJkM46Y3ZOxVwon4AGHoJqbY5bMf7i4LR71Vlkw+mT7RNSTR26r7y1L/vAvenDOeVTvh/Fv2RA+XTIoriuTxSwwoH3xJtm49aY8JwvFgOPJsXX1orFEm2EsCoqMSSJNyjQN0jSUMa4Xco22SVwmkOhhcK8tPE0= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=outlook.com; spf=pass smtp.mailfrom=outlook.com; dkim=pass (2048-bit key) header.d=outlook.com header.i=@outlook.com header.b=S88lasBD; arc=fail smtp.client-ip=40.92.52.106 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=outlook.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=outlook.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=outlook.com header.i=@outlook.com header.b="S88lasBD" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZMUKwp4IQeAFgFs4RAw2WT7kD1QDQBi0uHb+2PsaRX6P7qb48rLjXeafF4APkR7B2hHBY+0plw/GBCqtKF4s5xU0237uEjisKghWgXmyMzykzUt6MxmtBOt2VevfYtxUrfQhJdwoSEXajHyfWcbLuPDTWDUmVJVJnRTxeoMRB9YDt/5pJj5uFj4Z3C7K5UEWOxhQbCaFSpCDMt/SXgLCaXuI9J5bwXwK1CeJrB3na2fBx5tsJrWplne4EId+qZnQwcKwvBpv96CxCAjHBCxpmP2+3tMZV/FQayaLdQ5CVjytob8I69NCEcmO2OIDrSDhmSfuGNn5DtV7SdVyIxHczg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=LDMKCZs7jwo0WmkpqK3Rx7uGKvy5/neIxL7zsaHYLZU=; b=kET/jGb/Y60J+4jcUiQ0TdrBwQYIGJKypnFsayiLwaJpbmN29wSUjyrRxj+puSYMoTIIbdGJFlbGQCHS1ejHmcJDO56Oy0znbQ4C33MMc9PKjCsPh+po1ulLTE7oYC788T/GtFGQWpOzMuXMOQ5WWwxSHmj5ejhEf2Btm9TLuDIOkkKOa6WKfe08+Va+O8dUlMfn4+1EjJZgh7Mb1ux7iRpGnEByYovAU3LVRzf/McBydBn4BF+shVlW0ht6bFUNcySZyizgj8U3nyXghPYX8gI2pYhifPWhrozcCsjQLypA8eSEsQYpg06HkIkfkStoyz4u9JS6XHyqHhD74U+QLA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LDMKCZs7jwo0WmkpqK3Rx7uGKvy5/neIxL7zsaHYLZU=; b=S88lasBDaVD9/msRMEBVD8G2pyiQUhHwkizo9TNeiQGmhisZ1IUfVoF7UbB0eugg2pcdOiO7WeZGCFmfRw0g3Cgcwzz9Q9HfLldng7MacG6s8fCKzprW9HOOQpvDzp71cdPY6rqO0btQW4yU0gDw5qjVkCVDuoHG2+tXNigjTtd38Kz2zbrUzhunBtR++7T8Xu/q1OuQ9FC5qyIQN8wNmDTYvCt3mz5lvh/pwGJX0BYFt5nkd10Xqb00trrWTs+PbVU7Y0GseQP2CEl9UBvbqgUes4p0AId0vMkWZZ0OjUAjjKaOzGQCcI0ucG8R7v9LcX93D2ySEp9zwVYt4CiE/g== Received: from PSAPR06MB4952.apcprd06.prod.outlook.com (2603:1096:301:a3::11) by TYZPR06MB7169.apcprd06.prod.outlook.com (2603:1096:405:b7::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.45; Wed, 3 Apr 2024 07:41:44 +0000 Received: from PSAPR06MB4952.apcprd06.prod.outlook.com ([fe80::45cb:f62c:d9bc:b12b]) by PSAPR06MB4952.apcprd06.prod.outlook.com ([fe80::45cb:f62c:d9bc:b12b%7]) with mapi id 15.20.7409.042; Wed, 3 Apr 2024 07:41:44 +0000 From: Guanbing Huang To: gregkh@linuxfoundation.org, andriy.shevchenko@intel.com, rafael.j.wysocki@intel.com Cc: linux-acpi@vger.kernel.org, tony@atomide.com, john.ogness@linutronix.de, yangyicong@hisilicon.com, jirislaby@kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, lvjianmin@loongson.cn, albanhuang@tencent.com, tombinfan@tencent.com Subject: [PATCH v4 2/3] serial: 8250_port: Add support of pnp irq to __uart_read_properties() Date: Wed, 3 Apr 2024 15:41:29 +0800 Message-ID: X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240403074130.93811-1-albanhuang@outlook.com> References: <20240403074130.93811-1-albanhuang@outlook.com> X-TMN: [/vrdZxwQ//6HFPpMIpoYVwpdmi+cyBiV] X-ClientProxiedBy: SI1PR02CA0053.apcprd02.prod.outlook.com (2603:1096:4:1f5::8) To PSAPR06MB4952.apcprd06.prod.outlook.com (2603:1096:301:a3::11) X-Microsoft-Original-Message-ID: <20240403074130.93811-3-albanhuang@outlook.com> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PSAPR06MB4952:EE_|TYZPR06MB7169:EE_ X-MS-Office365-Filtering-Correlation-Id: 7f0317fa-8bf5-4bfc-8e5f-08dc53b18203 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XP37VQkSxDNDGSOueyR+DNbvPh4tIyjaQ5Hoe8D9JwzE4CrqBOpz3xX4EvS34V80JBm1xfxvI8yJfUQVkBNlmQRZCt1CjAt61Hvp+DLWjrRB2Ws/Z5dzSq+qT0bgOFuZKN91pW7k1WfJa3OCv4F/5i3Gypj8QpcJrxF/6QdwLOB/VihnwKk7Vt04vB0N1fGuAhDcl+PY94waOY0IhZJ6a1efePzlsVwRizfezwmKB4wDEfpJynWZhmWjNo52JlyXbA67blXBWRbZXuP0owX4/HiY/2AYHfArydxusA+huG6/fNx61dF6Corvx2T+j9ZGunsSmUiStbvFPDXwF0tZzasRsUW+jY5WsoNybwonZPfr0s15nY2rTbz0cKUgAaY+lNNupLRbbfpH02XbwozKq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aQoDuBgfNEMHWG0fwItrqZD7BeiMcdqaMYb58iKYowOORvCDmzoq8ZWdJw47UOU11tbpiym2Xt72L6ZuoM3L/fZ64RY/O4N+4j2rzb8eEdupNAUDvjThK9wyIHfbV5OsuEilkCyudQeig9zT00gNy9q5Q924XLENaSxHmz0yoHIgnRUbMjhqkf3U7P8bpWLhg5w/K1HlLa4+uwYYsiayjJdJDYN3G9Z23OmKhljJL+w4qYxEkpyLx0HTJJLpJVdz/uRkcwLyBI6cOfpIi8xuAWTmZHiLkdgTX4lZ/TTiE4yaS9/EFT3hVTyxs0vG1sr3tncTMCkZo4/Bz0YP8tqOAdSqjIQuvgbUh9yU37bdh/SplVvvyJLxPRYLJfIrBf+aEW6/3tWFo3tfU4GJpBz7PdLFsBHkLZ0G9P3eMV2pH5BPKg= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7f0317fa-8bf5-4bfc-8e5f-08dc53b18203 X-MS-Exchange-CrossTenant-AuthSource: PSAPR06MB4952.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2024 07:41:43.7548 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB7169 From: Guanbing Huang The function __uart_read_properties doesn't cover pnp devices, so add irq processing for pnp devices in the branch. Signed-off-by: Guanbing Huang Reviewed-by: Bing Fan Tested-by: Linheng Du --- drivers/tty/serial/serial_port.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/serial_port.c b/drivers/tty/serial/serial_port.c index 22b9eeb23e68..6ed072d61b88 100644 --- a/drivers/tty/serial/serial_port.c +++ b/drivers/tty/serial/serial_port.c @@ -14,6 +14,7 @@ #include #include #include +#include #include "serial_base.h" @@ -221,7 +222,11 @@ static int __uart_read_properties(struct uart_port *port, bool use_defaults) if (dev_is_platform(dev)) ret = platform_get_irq(to_platform_device(dev), 0); - else + else if (dev_is_pnp(dev)) { + ret = pnp_irq(to_pnp_dev(dev), 0); + if (ret < 0) + ret = -ENXIO; + } else ret = fwnode_irq_get(dev_fwnode(dev), 0); if (ret == -EPROBE_DEFER) return ret; From patchwork Wed Apr 3 07:41:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guanbing Huang X-Patchwork-Id: 785967 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01olkn2106.outbound.protection.outlook.com [40.92.52.106]) (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 D2C476CDD0; Wed, 3 Apr 2024 07:41:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.92.52.106 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712130113; cv=fail; b=QrMQPxJfxHlDob3qyxG5Z2RDPJ3bTeLiVbhs8j0o4V5HcAvNhWgJ6odMg0ovcbGe/68q9aih2z5gBi8XC1aPvt0YZ4qL9bW2xvP1kcgrnWPSJRNaY7lnxRgynid9bb4VsGij3W8EEsDSzDCVtmL6hohaHkSCBdfOKY9jhwSKC9o= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712130113; c=relaxed/simple; bh=881NHA0BtZ4tqqs8t1lsBhG7teepmihRPDHe9zK8s40=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=FKlhKuSl/f32+5KUGwoZrw9oaL+T5/L8MjrNqxXdYB54KSFgpOxYAxDyg8veMIFldGgx4DGJeuNXbq74hDBv/IL9Lj2xApAcDY1ET/An5VagPPs5sO7JyPks56A5P5izj6nzjnZVjOCQcbqj3mGvDS0e+aKb+vYKZoJwqJBW2Sc= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=outlook.com; spf=pass smtp.mailfrom=outlook.com; dkim=pass (2048-bit key) header.d=outlook.com header.i=@outlook.com header.b=QfAK6B14; arc=fail smtp.client-ip=40.92.52.106 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=outlook.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=outlook.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=outlook.com header.i=@outlook.com header.b="QfAK6B14" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MkhnbDOvamyfh/KgcJuQHWuZPw2iX291vBaoPdGndu8EONVYjlxc73U/1SMaqYlXazfEAMdyr/QvLlI7xYb9DfjbY0R80be4XtFFp2o8g2RNc+1VC2Z7UqqklcA6cMTPoN+DrcSUAIRRjnTepIKk4puDGMR4FNAbbZE+AOM9h0//iz+KeJRGyxwye4i56QDCB3oB50YFK+UK8VTTEVUqIP3e+kaA4XOQY4RketvGPLGn1tCq2w3x4/DtFvCeklDdz7EA7a0GC6McPooVG6Yj+PgRJ4szWCBtFLu03nh/iWxgeWJidb3wq+oNfYY/9dR4hLaYZyVaagb/MMgadnKqvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=XFXfiz9azTt7Z3i5D/gU09G7v3vILofamOdAmxTAR/E=; b=njcAnwmLVgs8it16lMnv/o88VjFURiWU6CtS7R550WiHoh3livobiQ4BuVJeKoT8DPp368WCvhxSuGHOee7c9RAjQ5yiH0HqT2b6XtJekCieHJnAKkWzEoR8Jxn+B5wvdFMg1CxoVyd4qMlNqBm+fCx28lOm6I9k9Tb2CJIPy/2zLyXQNUz7MgFu6FzZf313pheIDI3ezhyz42bYRfAvbwztcKXeXEetUPTwp15e9gMq6PXtRzmTE4UHaixbinmDOF2bK20wWBQw/Kb4EsBgUOhPwPSYd5Hjoo9GI4MOmxQyqbWEpnu9IiCWTY4CYwEcyhaieZdXGHh0l7jamR71bA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XFXfiz9azTt7Z3i5D/gU09G7v3vILofamOdAmxTAR/E=; b=QfAK6B14WFdQsOmbQbYfMfJXi7anqeVpVil0IMFZx4PYfEPqk033IwNLy3S9bJVkJBnAIWvJ77JP5ZP0TudLi17Shcnv2fq7WWWwwCe1XnZwxZqyncIseT8OGcQ1n3X2bOKwB7GsIheir+QoaaKYM5GUFzKvoWCgyqXl6LDwNNEl84sueLoR+a8aFqKb9O5ANzxoMS8BLldUME2otbdS370+D+NnD+m1jHFQeolOPhk4jg93mG7L7ZNmpwzQ0xFd9bIKUKQpbXlmhr9C3pPZpcnfDiQngPl08CIAhlXkmTm8qSa8a543gpGokTTC7M5lih/LLZZLrAuyHWn3roCgcA== Received: from PSAPR06MB4952.apcprd06.prod.outlook.com (2603:1096:301:a3::11) by TYZPR06MB7169.apcprd06.prod.outlook.com (2603:1096:405:b7::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.45; Wed, 3 Apr 2024 07:41:45 +0000 Received: from PSAPR06MB4952.apcprd06.prod.outlook.com ([fe80::45cb:f62c:d9bc:b12b]) by PSAPR06MB4952.apcprd06.prod.outlook.com ([fe80::45cb:f62c:d9bc:b12b%7]) with mapi id 15.20.7409.042; Wed, 3 Apr 2024 07:41:45 +0000 From: Guanbing Huang To: gregkh@linuxfoundation.org, andriy.shevchenko@intel.com, rafael.j.wysocki@intel.com Cc: linux-acpi@vger.kernel.org, tony@atomide.com, john.ogness@linutronix.de, yangyicong@hisilicon.com, jirislaby@kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, lvjianmin@loongson.cn, albanhuang@tencent.com, tombinfan@tencent.com Subject: [PATCH v4 3/3] serial: 8250_pnp: Support configurable reg shift property Date: Wed, 3 Apr 2024 15:41:30 +0800 Message-ID: X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240403074130.93811-1-albanhuang@outlook.com> References: <20240403074130.93811-1-albanhuang@outlook.com> X-TMN: [FPqZb0N4COyFaxYzvNsV6coGt0IBgkb5] X-ClientProxiedBy: SI1PR02CA0053.apcprd02.prod.outlook.com (2603:1096:4:1f5::8) To PSAPR06MB4952.apcprd06.prod.outlook.com (2603:1096:301:a3::11) X-Microsoft-Original-Message-ID: <20240403074130.93811-4-albanhuang@outlook.com> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PSAPR06MB4952:EE_|TYZPR06MB7169:EE_ X-MS-Office365-Filtering-Correlation-Id: d3321387-4c5d-4c4f-d2a4-08dc53b18329 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rbgFUzx9J5/F8hyf/2jHdhnqZno0S7BEsCH5HTug81mY84o3DmsKzRdmfe77WaYPtiIGb9Smh3GKXwI+ZeoB5U2ie3DGrxlq3ZJG83/y9OKTnxO6/b1FT+VaEcL2gAGb/bVFCDRNBWl/rPcDOBQqgSGwinHZuuHldHPB+p45pMjKcXfbT+vkjupvunovJwXnPlFryxr5fG9gF2/rNk0sTTwvM+23ibnYhb1TgToCaVWzTjBDHRZDoyNA5rKUCbDSj7QDNMDP5NwAmk5y/XoDkQaUJc6DqNHmCKlQPVsUDtqDSOp8DVhkUW03PbX1tZ/rPHI27gP3mmprPRQWa/QZUeYoiRRu9fsUrVMzn4RJrPUB8sS4l0J5634y3f1jFOsepcuVoF6s848q1AwR/UGFm0MY77ktovIK0YwJCAYh2cK4Of61Dx/JCX//Pn2XixuDv8UxtpEU6xNzGamW7otsWwZPsqz+wMssec3UvjFJPeWtPEerxRLWjshD/rqQVLmv1NpoU7yxyamlHZYAlWYzfrwX1+UkDwKaK1qVBiVyfPTEXtfwHKxtid2QJwstSkMQ X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: XIHDq6aJbCzNLiWR81YwDxQffoNB1HQhcGi3WYbYRCBiVgajhduS5+DZ91xa5jWW9qX1HIuteewb4oB2BIWZGqS6GSIPeEhcFXup0q50NCnWY7wVXISc4hMNuXGmsItTG6x+VY22ym7t9jX9Y3RrqVwZv/Nl8/pJcuSWDK42VCmL4qKv6B+XDKYNmScO74ksu25Vwmbr8hufIeCh4IhSpyDKX5T6pV/5M17RjX6dds46QDdoa50B39j6JtiFs7afPd/rHrFVNXlceAGV7WxTR3XyY0JutS9q2yiaE2Tpj9ym/H/sOZs+jtssiDWTjAMlaIeyovLrNyCOt4A6SQLS519L22f9kq+UhxwgU+KNBBesRbmCUBPRuXi9deD97TwJcTQZUj8NEbESSVSj3cVCcUaaB+7zle4vp5DG8kLxhz5G++/Ar9yjGwQ2bR1cZXUbasHama1l1LCKBnsPk80szI/aE84/2FpHlhqNthQcW17OzoVNapi9ziK7np0YV6aI5/Qk9TLJmIM5SdjmgHklN/8/7WeLks3iQzms4slDTlj/nMg/yJlONI33T0ifB9bUDR+jCAe2O4jxySW4xORPU/gULShFDlh6knYTkkLXlUyL10SN7f7GMTNKW2x5supnvbEpiVs9duenaXsASEUqKQw9vTfyhpaeSjrhNPZpKL7fmKxYFk7VnuWNVrWoIWpjGGOmTfZcIk8bD7mx/Jy4b9pHT//srOmC1tpQ0zzVVrP7SzexQybV+PeRfKHGvscDDlUTLqohNn/YrGPkZGYJBNdxlTV3BC+o2YtRJfttVjaio0Yuny46mznfnEJ6od0X46/qmMdVr5/EHBJRQRkoJQo4qkXEzJ2LonpP+ttcPhH7q1339oYTZ3VgoLCeOg34xolRgjaj5E924xqtZNLV4CoYjIa/h2JsQaBXIvRfbaXz/jLJgumQ62ugsZPqRuwYj73PTtaFTxrx0VW4z2ZU21OLAo3rep84Dp5esS2Iy/KEoGc7VxxbgcDQp38N445xsl8ULkC1LfI9Uos/cSP6+j9QJ2vO/pF9CIrpMY7uemziow82Pabenxi7WsVfMmTLzmvKOuW/RPo6BU6GaIwe5BtaQJX+nqBXaFGXhtBYRPQugKGjCDgoyG23uZm7C1NZyVSX7cl064yJ0okrgYHX9B5rruJpyoVYOgH9uMRnHTh9pHwjYuQz1GtdDQxfC7+YEak39wstH+VeRfRSkUUiHIAZX6etKBB9LibBRfkLHf8= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d3321387-4c5d-4c4f-d2a4-08dc53b18329 X-MS-Exchange-CrossTenant-AuthSource: PSAPR06MB4952.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2024 07:41:45.6137 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB7169 From: Guanbing Huang The 16550a serial port based on the ACPI table requires obtaining the reg-shift attribute. In the ACPI scenario, If the reg-shift property is not configured like in DTS, the 16550a serial driver cannot read or write controller registers properly during initialization. Signed-off-by: Guanbing Huang Reviewed-by: Bing Fan Tested-by: Linheng Du --- v3 -> v4: dependent on two pre patches: "pnp: Add dev_is_pnp() macro" and "serial: 8250_port: Add support of pnp irq to __uart_read_properties()", the iotype is reserved, the mapsize is initialized, fix the UPF_SHARE_IRQ flag, check for IRQ being absent v2 -> v3: switch to use uart_read_port_properties(), change "Signed-off-by" to "Reviewed-by" and "Tested-by" v1 -> v2: change the names after "Signed off by" to the real names drivers/tty/serial/8250/8250_pnp.c | 36 ++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/drivers/tty/serial/8250/8250_pnp.c b/drivers/tty/serial/8250/8250_pnp.c index 1974bbadc975..292cb8e84b37 100644 --- a/drivers/tty/serial/8250/8250_pnp.c +++ b/drivers/tty/serial/8250/8250_pnp.c @@ -435,6 +435,7 @@ serial_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id) { struct uart_8250_port uart, *port; int ret, line, flags = dev_id->driver_data; + unsigned char iotype; if (flags & UNKNOWN_DEV) { ret = serial_pnp_guess_board(dev); @@ -443,25 +444,31 @@ serial_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id) } memset(&uart, 0, sizeof(uart)); - if (pnp_irq_valid(dev, 0)) - uart.port.irq = pnp_irq(dev, 0); if ((flags & CIR_PORT) && pnp_port_valid(dev, 2)) { uart.port.iobase = pnp_port_start(dev, 2); - uart.port.iotype = UPIO_PORT; + iotype = UPIO_PORT; } else if (pnp_port_valid(dev, 0)) { uart.port.iobase = pnp_port_start(dev, 0); - uart.port.iotype = UPIO_PORT; + iotype = UPIO_PORT; } else if (pnp_mem_valid(dev, 0)) { uart.port.mapbase = pnp_mem_start(dev, 0); - uart.port.iotype = UPIO_MEM; + uart.port.mapsize = pnp_mem_end(dev, 0) - pnp_mem_start(dev, 0); + iotype = UPIO_MEM; uart.port.flags = UPF_IOREMAP; } else return -ENODEV; - dev_dbg(&dev->dev, - "Setup PNP port: port %#lx, mem %#llx, irq %u, type %u\n", - uart.port.iobase, (unsigned long long)uart.port.mapbase, - uart.port.irq, uart.port.iotype); + uart.port.uartclk = 1843200; + uart.port.dev = &dev->dev; + + ret = uart_read_port_properties(&uart.port); + /* no interrupt -> fall back to polling */ + if (ret == -ENXIO) + ret = 0; + if (ret) + return ret; + + uart.port.iotype = iotype; if (flags & CIR_PORT) { uart.port.flags |= UPF_FIXED_PORT | UPF_FIXED_TYPE; @@ -471,9 +478,14 @@ serial_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id) uart.port.flags |= UPF_SKIP_TEST | UPF_BOOT_AUTOCONF; if (pnp_irq_flags(dev, 0) & IORESOURCE_IRQ_SHAREABLE) uart.port.flags |= UPF_SHARE_IRQ; - uart.port.uartclk = 1843200; - device_property_read_u32(&dev->dev, "clock-frequency", &uart.port.uartclk); - uart.port.dev = &dev->dev; + else + uart.port.flags &= ~UPF_SHARE_IRQ; + + + dev_dbg(&dev->dev, + "Setup PNP port: port %#lx, mem %#llx, size %#llx, irq %u, type %u\n", + uart.port.iobase, (unsigned long long)uart.port.mapbase, + (unsigned long long)uart.port.mapsize, uart.port.irq, uart.port.iotype); line = serial8250_register_8250_port(&uart); if (line < 0 || (flags & CIR_PORT))