From nobody Tue Feb 10 22:15:51 2026 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 BCB4F189B83; Fri, 24 Jan 2025 16:15:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737735344; cv=none; b=jjRZMcIk5JNnSW/sCCYRez1EfDUd96RpgY4CBgcq8GVZ/dLmz6xQ3blgDrlx1LibpT3LxeKTzL8f1/+WywZoOkxPppekWdanNXnelH/rpBvg74C5C6KeIFg8pgKtxe7bcrayXnNENVa3z0WO+S5LYWFYBM8tiO57O+EQFcMZBtE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737735344; c=relaxed/simple; bh=wasJGmB1EUv6O1UP8Zj6E42g8sSkse/lhLFsfPwH8gA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JhXrJLFNUdVSC1lhk5ILTB/WH4carbX69q7hIl6XjJNrwCxV3JjVHkQYMw6Nb6gifRr1PD+gI7CaCRb4cf9BlIDwBCR/ZrcO8oP/gcDC09oTmpz574Ns6FmDVmAI63aoXAV3eS3N3v6iRbTZrwwCJ2SAEeYaClm25bkW3VHPNE8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=BITJUGo/; arc=none smtp.client-ip=198.175.65.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="BITJUGo/" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1737735343; x=1769271343; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wasJGmB1EUv6O1UP8Zj6E42g8sSkse/lhLFsfPwH8gA=; b=BITJUGo/gUkSemlouzdldgWwI+LsO8MU4lFd2eJ+cl1fFMbLbayIXQ20 cxmHu4vNNDoZsms/JtUR6pmIT1V93fRG2Qd64BeOvyw+6SPlgDoLvY53r OYnbgqMoUbcg+3GCREeKfQXschxM3PZb+6jBHMmB6BVtsSexYHAGYYsw+ KwH7URM44oCC7oemrtTKuJJXKTkteN6TwE87bujhLUf4P25I/jXfGNgkK 5VAiU5b6Mk8UqQvG1lnVKfrvQWnbNnAuQeeIAKg67yxG6OcyoBtrMx0vU tJh4oY5+RJtMEww81MPs+PqCQtwEBIEb4wdYUCzMr9byYs2XMe14Xuefw g==; X-CSE-ConnectionGUID: XKQ1gZTQTSy6G2rTO3iBFQ== X-CSE-MsgGUID: 42l4fYz/REiful0jWSjmcg== X-IronPort-AV: E=McAfee;i="6700,10204,11325"; a="38152887" X-IronPort-AV: E=Sophos;i="6.13,231,1732608000"; d="scan'208";a="38152887" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jan 2025 08:15:41 -0800 X-CSE-ConnectionGUID: Xw8K7ejYQ9KyI/H34B5VAQ== X-CSE-MsgGUID: sfpIvmzaQbKCD95lTIobqQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,231,1732608000"; d="scan'208";a="107612354" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa006.fm.intel.com with ESMTP; 24 Jan 2025 08:15:39 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id A2D93164; Fri, 24 Jan 2025 18:15:37 +0200 (EET) From: Andy Shevchenko To: Greg Kroah-Hartman , Andy Shevchenko , Guanbing Huang , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Cc: Jiri Slaby Subject: [PATCH v1 1/6] serial: port: Assign ->iotype correctly when ->iobase is set Date: Fri, 24 Jan 2025 18:10:46 +0200 Message-ID: <20250124161530.398361-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20250124161530.398361-1-andriy.shevchenko@linux.intel.com> References: <20250124161530.398361-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Currently the ->iotype is always assigned to the UPIO_MEM when the respective property is not found. However, this will not support the cases when user wants to have UPIO_PORT to be set or preserved. Support this scenario by checking ->iobase value and default the ->iotype respectively. Fixes: 1117a6fdc7c1 ("serial: 8250_of: Switch to use uart_read_port_propert= ies()") Fixes: e894b6005dce ("serial: port: Introduce a common helper to read prope= rties") Signed-off-by: Andy Shevchenko --- drivers/tty/serial/serial_port.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/serial_port.c b/drivers/tty/serial/serial_p= ort.c index d35f1d24156c..f28d0633fe6b 100644 --- a/drivers/tty/serial/serial_port.c +++ b/drivers/tty/serial/serial_port.c @@ -173,6 +173,7 @@ EXPORT_SYMBOL(uart_remove_one_port); * The caller is responsible to initialize the following fields of the @po= rt * ->dev (must be valid) * ->flags + * ->iobase * ->mapbase * ->mapsize * ->regshift (if @use_defaults is false) @@ -214,7 +215,7 @@ static int __uart_read_properties(struct uart_port *por= t, bool use_defaults) /* Read the registers I/O access type (default: MMIO 8-bit) */ ret =3D device_property_read_u32(dev, "reg-io-width", &value); if (ret) { - port->iotype =3D UPIO_MEM; + port->iotype =3D port->iobase ? UPIO_PORT : UPIO_MEM; } else { switch (value) { case 1: --=20 2.43.0.rc1.1336.g36b5255a03ac From nobody Tue Feb 10 22:15:51 2026 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 2458418E02D; Fri, 24 Jan 2025 16:15:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737735344; cv=none; b=s8zNuUKB9vMD4sh2Vhf92QnZR7uNqyT2aWs0UVuMpY7cOxuzckju8Hsiflh/Qz+OxocMzoVW3BbebDXUboB+B7lznidYa5lZ0d4lLhn4CHIUen5vfBTfzkwWsxCVhSZ1pBA/mx1KbrCklnWtyWV2VVnKhth3ZW4PzqgQRX+JSsw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737735344; c=relaxed/simple; bh=tOipyK38zy8+DW8odwZ5XKf70Zyy2VhOJybOTIJ89gM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jcreP7kIEsSSdSTkEF0osYAH++RfmDR5SYEXC59KJD3/iah7vHHESmkTsH3eUab/GVn6GwIeWhaQtBT8XmZAIhvmcahQkM+reridmzTOXzDGcAZfbQnkOjbIdDIqoi2EACzA2YqFC9N75jbKu6MjUxlXdtfuz/lX7ijep1I6xR0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=iDmNEkb8; arc=none smtp.client-ip=198.175.65.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="iDmNEkb8" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1737735344; x=1769271344; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=tOipyK38zy8+DW8odwZ5XKf70Zyy2VhOJybOTIJ89gM=; b=iDmNEkb8we9l0EFJF6lcN2KyC2BprE39CYJua4CvlzJEUv8ASiOLhUrE WhoC/+Jd9SPGEOEk8Z5ALh/DNzadIWEYDeIlJwpGM/vl0x21kUyDG4uqw FIgiUeAnpOHyrvvkmLnB4+f5kMmuTnV610xLdVqgfczu1AhZtfDzBHaT0 KZA8mlez4OPL3r8X9XG+wKqF10aHto0Sw05cEBLFj2jGxyJs1+lu3nyD+ lKcL0B4zYYgXEV8ZFtTZXfuxU7ZTbnbOJI80X+R83KYXbo6h4RCo5qPVA liKopDi7qVQBosJklsbGeQM5fZ2655VM0XuCOaf8oOq/+zVKC3s6XwwPK Q==; X-CSE-ConnectionGUID: dcvs2z0PRpGwrV8bkdnl+A== X-CSE-MsgGUID: WENnViO4Rm2UyGHrM7wkPA== X-IronPort-AV: E=McAfee;i="6700,10204,11325"; a="38152892" X-IronPort-AV: E=Sophos;i="6.13,231,1732608000"; d="scan'208";a="38152892" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jan 2025 08:15:41 -0800 X-CSE-ConnectionGUID: G88RWLyvRbOb9sGatkdhVA== X-CSE-MsgGUID: yyytXDjKT1KF33164kZDxQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,231,1732608000"; d="scan'208";a="107612356" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa006.fm.intel.com with ESMTP; 24 Jan 2025 08:15:39 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id B109529D; Fri, 24 Jan 2025 18:15:37 +0200 (EET) From: Andy Shevchenko To: Greg Kroah-Hartman , Andy Shevchenko , Guanbing Huang , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Cc: Jiri Slaby Subject: [PATCH v1 2/6] serial: port: Always update ->iotype in __uart_read_properties() Date: Fri, 24 Jan 2025 18:10:47 +0200 Message-ID: <20250124161530.398361-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20250124161530.398361-1-andriy.shevchenko@linux.intel.com> References: <20250124161530.398361-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The documentation of the __uart_read_properties() states that ->iotype member is always altered after the function call, but the code doesn't do that in the case when use_defaults =3D=3D false and the value of reg-io-width is unsupported. Make sure the code follows the documentation. Note, the current users of the uart_read_and_validate_port_properties() will fail and the change doesn't affect their behaviour, neither users of uart_read_port_properties() will be affected since the alteration happens there even in the current code flow. Fixes: e894b6005dce ("serial: port: Introduce a common helper to read prope= rties") Signed-off-by: Andy Shevchenko --- drivers/tty/serial/serial_port.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/serial_port.c b/drivers/tty/serial/serial_p= ort.c index f28d0633fe6b..85285c56fabf 100644 --- a/drivers/tty/serial/serial_port.c +++ b/drivers/tty/serial/serial_port.c @@ -228,11 +228,11 @@ static int __uart_read_properties(struct uart_port *p= ort, bool use_defaults) port->iotype =3D device_is_big_endian(dev) ? UPIO_MEM32BE : UPIO_MEM32; break; default: + port->iotype =3D UPIO_UNKNOWN; if (!use_defaults) { dev_err(dev, "Unsupported reg-io-width (%u)\n", value); return -EINVAL; } - port->iotype =3D UPIO_UNKNOWN; break; } } --=20 2.43.0.rc1.1336.g36b5255a03ac From nobody Tue Feb 10 22:15:51 2026 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 79CBB196D9D; Fri, 24 Jan 2025 16:15:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737735346; cv=none; b=tDRuAHQ14lHUPDz/YYiGKP8Q2MzvWtMtXgfhjmfxJsZHIIkRGUVLpzxiBhKhi+5BtD8dcQmxr7ijpsJTMRMyCnl++3D1+skOBxKZaTwMnakKSEQgqc2vnmkq298MrIE1gFgmSi6EnY/dIovJftlnQFc6UzBgmmdi1hxALl5UJ+c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737735346; c=relaxed/simple; bh=lfGMuTjEl1E5ktlY5BVqbetwgkValpruAzZQWjEGGW8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dgTI62RHuONMBdV+ld6S29KQJs0Xc8+uitnB+Y9SAldcIiALBvPrIjESQwknwbSooAdsrGLCJACPg92Dn6ezaM4mETURpzyPQoziDu85B0VOtyx5joH+C7CqVESUD7rVsKs/RwPy80w0FdEWJubEmoPb96mL0kOKkFkWCa4pfi0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=QtUeMR4W; arc=none smtp.client-ip=198.175.65.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="QtUeMR4W" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1737735345; x=1769271345; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=lfGMuTjEl1E5ktlY5BVqbetwgkValpruAzZQWjEGGW8=; b=QtUeMR4WWoSEhDxgnYJbKeAnjwLgjaBtfrWgGvhFymDdI5P8dh9gawbJ VwmHD9/eSKDkCqXobV/Q04tzCw56Gw1/BzehUkyOq8D9pC4gAxyoN24Ck dkDeusa5iyao++nMK7SIJB6pj+mM10+oPbVuL8ZTDhVPQAKTcOiAka3uE f7PDagfFkDs3KrnXL6/fpLzqkX+2qNDHAP8QHBmzY2DlSSd9boo3Y/Vv9 i80QKPdOBwk0ZmTIO+k4ggY3Zeix9fqj0UnQu++7h8VKwqwF/IBjiBsAs LZtzg7SEP6trgMTIcPd3zvY6qU8uAUVAX44ZIynBnZEEfmVPYjp7kFRdb A==; X-CSE-ConnectionGUID: ceKDKv+dT/24+msMeZkjOw== X-CSE-MsgGUID: KXjBkkJnRXi2knPH94bLeg== X-IronPort-AV: E=McAfee;i="6700,10204,11325"; a="38152896" X-IronPort-AV: E=Sophos;i="6.13,231,1732608000"; d="scan'208";a="38152896" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jan 2025 08:15:41 -0800 X-CSE-ConnectionGUID: YyawNv1DTWaDfH6ExY/SYg== X-CSE-MsgGUID: YW03/YX+Q3mhZdhaGp10tA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,231,1732608000"; d="scan'208";a="107612357" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa006.fm.intel.com with ESMTP; 24 Jan 2025 08:15:39 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id BBA4F2AC; Fri, 24 Jan 2025 18:15:37 +0200 (EET) From: Andy Shevchenko To: Greg Kroah-Hartman , Andy Shevchenko , Guanbing Huang , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Cc: Jiri Slaby Subject: [PATCH v1 3/6] serial: port: Make ->iotype validation global in __uart_read_properties() Date: Fri, 24 Jan 2025 18:10:48 +0200 Message-ID: <20250124161530.398361-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20250124161530.398361-1-andriy.shevchenko@linux.intel.com> References: <20250124161530.398361-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" In order to make code robust against potential changes in the future move ->iotype validation outside of switch in __uart_read_properties(). If any code will be added in between that might leave the ->iotype value unknown the validation catches this up. Signed-off-by: Andy Shevchenko --- drivers/tty/serial/serial_port.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/serial_port.c b/drivers/tty/serial/serial_p= ort.c index 85285c56fabf..2fc48cd63f6c 100644 --- a/drivers/tty/serial/serial_port.c +++ b/drivers/tty/serial/serial_port.c @@ -229,14 +229,15 @@ static int __uart_read_properties(struct uart_port *p= ort, bool use_defaults) break; default: port->iotype =3D UPIO_UNKNOWN; - if (!use_defaults) { - dev_err(dev, "Unsupported reg-io-width (%u)\n", value); - return -EINVAL; - } break; } } =20 + if (!use_defaults && port->iotype =3D=3D UPIO_UNKNOWN) { + dev_err(dev, "Unsupported reg-io-width (%u)\n", value); + return -EINVAL; + } + /* Read the address mapping base offset (default: no offset) */ ret =3D device_property_read_u32(dev, "reg-offset", &value); if (ret) --=20 2.43.0.rc1.1336.g36b5255a03ac From nobody Tue Feb 10 22:15:51 2026 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 18EE6157472; Fri, 24 Jan 2025 16:15:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737735342; cv=none; b=eyklUROreVZWGaI5o1mxHG8agz/rxeGK0UfHvbzx/0ZwylrBl237r+AvvdrNf3S88yM6tnIUTMB4DWxCMywHVvEZOo+Fq5ioRmyMOZsVo5PPF4f2ZTUPRheup/a2oNMqVExf8z/VgOpxXDxFQCbJ9pgrnZDkO7Hzk+aFfjg3tpU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737735342; c=relaxed/simple; bh=RQHdOWZpVVUAK76uP+B5HKCTA/jWwwg+ROmi9FK2Bag=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hadFZ+v5mORohhUi8dcZxoirVNeV8o0y3QMQfyhfsaK0WYOtAmBzaSejNkClIVVz5TA7+JJs4BUZcUmheQp8ljzHOMRs+sqWCnnP7bDs7Jc4+tG2fKOFjPn30FBjk1qrNKOFq5jdFUHoIW9mCOzBQorDbsjOSo0Iwwrrcd+/FQg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=LcrdrW6l; arc=none smtp.client-ip=198.175.65.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="LcrdrW6l" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1737735342; x=1769271342; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RQHdOWZpVVUAK76uP+B5HKCTA/jWwwg+ROmi9FK2Bag=; b=LcrdrW6lGMF/bXFRSsD4gi7HYc1o/u5i15MaylIxTTT6ijvT/O5IceKy kAEjED5bwkZ+yEl9PUeCrDfKOMp8fdiSRgSVkkzrsM2Q/dA20R4l+C3ng kbwqu6FBUlU5FHrkWlfPikvWdNz6Bkiny8XVDm1D5lQT31fEnALXBjLxg McTWkLHvzI6hdjXER/oJEBwzjwgBid9/fw6K0jCb1X7E6vSXxohugwT2Q hUpOtd+x1VcjjRDFwoMDpSGc6YsMdyXjACpFOWPLOizUfImv5cubTq6VC 7O6O4LQw/roVTABRkDaRxc7jAUriejFnT9sym3qjoalRUgSk+TUmGiG5q w==; X-CSE-ConnectionGUID: D/FiWiy+TFCdhP+SFUWcng== X-CSE-MsgGUID: xO1bOSoKShWQn8YpwaahcA== X-IronPort-AV: E=McAfee;i="6700,10204,11325"; a="38152883" X-IronPort-AV: E=Sophos;i="6.13,231,1732608000"; d="scan'208";a="38152883" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jan 2025 08:15:41 -0800 X-CSE-ConnectionGUID: gvQ3NBD2SxC0q2uC+uxTlA== X-CSE-MsgGUID: CShOXT7dQQWI80wkpy3+cQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,231,1732608000"; d="scan'208";a="107612353" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa006.fm.intel.com with ESMTP; 24 Jan 2025 08:15:39 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id C64AF2D4; Fri, 24 Jan 2025 18:15:37 +0200 (EET) From: Andy Shevchenko To: Greg Kroah-Hartman , Andy Shevchenko , Guanbing Huang , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Cc: Jiri Slaby Subject: [PATCH v1 4/6] serial: 8250_of: Remove unneeded ->iotype assignment Date: Fri, 24 Jan 2025 18:10:49 +0200 Message-ID: <20250124161530.398361-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20250124161530.398361-1-andriy.shevchenko@linux.intel.com> References: <20250124161530.398361-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" If ->iobase is set the default will be UPIO_PORT for ->iotype after the uart_read_and_validate_port_properties() call. Hence no need to assign that explicitly. Signed-off-by: Andy Shevchenko --- drivers/tty/serial/8250/8250_of.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/tty/serial/8250/8250_of.c b/drivers/tty/serial/8250/82= 50_of.c index 64aed7efc569..11c860ea80f6 100644 --- a/drivers/tty/serial/8250/8250_of.c +++ b/drivers/tty/serial/8250/8250_of.c @@ -110,7 +110,6 @@ static int of_platform_serial_setup(struct platform_dev= ice *ofdev, spin_lock_init(&port->lock); =20 if (resource_type(&resource) =3D=3D IORESOURCE_IO) { - port->iotype =3D UPIO_PORT; port->iobase =3D resource.start; } else { port->mapbase =3D resource.start; --=20 2.43.0.rc1.1336.g36b5255a03ac From nobody Tue Feb 10 22:15:51 2026 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (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 3212B18EFCC; Fri, 24 Jan 2025 16:15:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737735344; cv=none; b=nVuJGQ98feHxuuRHi1xYa9l8m+oIC7TwN9ajkF4X+/vkhU0ozJVOSaZskVLBtUBgqqm2Ey38FyfQu3EXqadD2jfdWyxw8vMjwE1DwdEKkca5fhsKKppDxS1aYue7iSv1Wj1HbHWHWPIbYXfmxt+7SvKgZ8+QZy3WrsGNr3l9soo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737735344; c=relaxed/simple; bh=bOqQp5iiDR5OhNeYoMcyqcEXriZiM/TUsJ5hvzAd7R8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=k65tBSkVFT0DRv3eqoE7kUcytoJu2T7DCpKgA+GF1Z4odSqE4UrXK3KDXG5qY1mUXfoDXtGXOlZaFylYG+HMu9ucJ8wj7PKNBfOec+E+bhm5Sf0EB0oDRfudgsc1O1KW3FTIcmlkPKWqg4oNzRYcw3ql6HRqtAp6oHyHBSWaL1g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=HBm1NU/3; arc=none smtp.client-ip=192.198.163.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="HBm1NU/3" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1737735343; x=1769271343; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=bOqQp5iiDR5OhNeYoMcyqcEXriZiM/TUsJ5hvzAd7R8=; b=HBm1NU/3v5qyITGSotCRUzUytXK5OajKpLODdFu0Nfw60TxOb8WuKYSJ EONc0skGw8bhnaf3ZO1Vnq33sUIYBFmr8meOtphWIcMB0OjTY6S3sGVhh Eu/+HE2yVi1hw3BT/jhYNJC0nyOc0/+lnhzfPv/FkNDhEuOqOmUBfsjY1 zaVtekac8E+1jJqt5HCdhLdSgs2t14y50Dy3th172CSo0MFkBdy/gSO+s XvTbj9vYDhQ4i5AI8CTflTf18drCR7UjdIg1Syg2GQ6rnA9sJE1dPRHu3 NGcE/NkgIuHCuF94HbV2VKIQatyzO2k6Ew9fi80pSz+yRCuL0q6vE4t1z g==; X-CSE-ConnectionGUID: 87spPD/ZRNut5DD8oXRi2g== X-CSE-MsgGUID: zcurAo/bRfW9udnPBdYWpg== X-IronPort-AV: E=McAfee;i="6700,10204,11325"; a="48858236" X-IronPort-AV: E=Sophos;i="6.13,231,1732608000"; d="scan'208";a="48858236" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jan 2025 08:15:43 -0800 X-CSE-ConnectionGUID: IO3tEVMJSCa/FEvjSZFwKA== X-CSE-MsgGUID: T5Q2yqycR2qkYqnxNoRmDw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,224,1728975600"; d="scan'208";a="107659135" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa010.jf.intel.com with ESMTP; 24 Jan 2025 08:15:41 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id CC2BE1E9; Fri, 24 Jan 2025 18:15:37 +0200 (EET) From: Andy Shevchenko To: Greg Kroah-Hartman , Andy Shevchenko , Guanbing Huang , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Cc: Jiri Slaby Subject: [PATCH v1 5/6] serial: 8250_platform: Remove unneeded ->iotype assignment Date: Fri, 24 Jan 2025 18:10:50 +0200 Message-ID: <20250124161530.398361-6-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20250124161530.398361-1-andriy.shevchenko@linux.intel.com> References: <20250124161530.398361-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" If ->iobase is set the default will be UPIO_PORT for ->iotype after the uart_read_and_validate_port_properties() call. Hence no need to assign that explicitly. Otherwise it will be UPIO_MEM. Signed-off-by: Andy Shevchenko --- drivers/tty/serial/8250/8250_platform.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/drivers/tty/serial/8250/8250_platform.c b/drivers/tty/serial/8= 250/8250_platform.c index 348b7fa2e94d..d8cbd8d87b0e 100644 --- a/drivers/tty/serial/8250/8250_platform.c +++ b/drivers/tty/serial/8250/8250_platform.c @@ -112,7 +112,6 @@ static int serial8250_probe_acpi(struct platform_device= *pdev) struct device *dev =3D &pdev->dev; struct uart_8250_port uart =3D { }; struct resource *regs; - unsigned char iotype; int ret, line; =20 regs =3D platform_get_mem_or_io(pdev, 0); @@ -122,13 +121,11 @@ static int serial8250_probe_acpi(struct platform_devi= ce *pdev) switch (resource_type(regs)) { case IORESOURCE_IO: uart.port.iobase =3D regs->start; - iotype =3D UPIO_PORT; break; case IORESOURCE_MEM: uart.port.mapbase =3D regs->start; uart.port.mapsize =3D resource_size(regs); uart.port.flags =3D UPF_IOREMAP; - iotype =3D UPIO_MEM; break; default: return -EINVAL; @@ -147,12 +144,6 @@ static int serial8250_probe_acpi(struct platform_devic= e *pdev) if (ret) return ret; =20 - /* - * The previous call may not set iotype correctly when reg-io-width - * property is absent and it doesn't support IO port resource. - */ - uart.port.iotype =3D iotype; - line =3D serial8250_register_8250_port(&uart); if (line < 0) return line; --=20 2.43.0.rc1.1336.g36b5255a03ac From nobody Tue Feb 10 22:15:51 2026 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 EBF281A8F7D; Fri, 24 Jan 2025 16:15:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737735346; cv=none; b=X0wqcoWMBol6rTDowXb0n5MB1KuhXntenLjUfzB+txbvKsELCRlDl/2eE+n4YFUb5aHIpJxT6Ni+LzW7pzLzKkyEMmAtCu0vzpnO/lNIhGa2dyDSmCncUZLaN5/6kW0LcKYHfYERKOOOBktg/EaCl1TAbq1i51s6l+ICIxcI+yw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737735346; c=relaxed/simple; bh=A0FojVXkgR8AphBPnWDLaNoXKasJEidZcTtNFSFW/GY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ofKQ308EWdF4u9wIr7NNQWtb7YAyxSxV4zDdSIhiMQnpLpGhVHV1uMPwSNHI4r+Oi6W8FV+OsM3lrjNoOHj0YluyzlZ/+QUiuC52hbp9ave0OFaCsTLVYz8VYwZ6T1CSrMUYSMQ5gSnWuHt4WaW4HGWBvssCYF5fOIdxxI9XYLs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=WDRz8DYI; arc=none smtp.client-ip=198.175.65.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="WDRz8DYI" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1737735346; x=1769271346; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=A0FojVXkgR8AphBPnWDLaNoXKasJEidZcTtNFSFW/GY=; b=WDRz8DYI22cnNoxL+rJanynKD2SucAHtpubFhn+5SHouxYdDi287Dssh +5QHeUsxqe87SYGY/26LrHHOkbyNd0hoSvi0CIdpsFBZ5r7x7GEQecKli fvRVQ7/pqZmLU4MwE5cArwGWoyvDZKYOHJpqUe9KcTgtOkNoYM0StXmip F5UCJZW4E28TmrOvM3y6ZVwVzhBP/ziqP3dsT9VRhHAQwynfjFZq8xpkP MbrvS8WZn+NUD+gbmoraEL5vLAYxGVoq2ew6ImA+9yoLJixfHCDsvpfEr vJ4B3lP6ZrzhVdgru+ufDWFOtXHavQKtFTyOkdx7UQxqIeTe1DVnPv1Ns A==; X-CSE-ConnectionGUID: lN2vHLIuQUqXV1D4IBhFyQ== X-CSE-MsgGUID: 5ytmkB65QpGvEcjhq1tD9g== X-IronPort-AV: E=McAfee;i="6700,10204,11325"; a="38152901" X-IronPort-AV: E=Sophos;i="6.13,231,1732608000"; d="scan'208";a="38152901" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jan 2025 08:15:44 -0800 X-CSE-ConnectionGUID: QX9lItmmQWSgoTpduHmCwg== X-CSE-MsgGUID: v9Sh7zx0Tf2W4HusQ5GyjQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,231,1732608000"; d="scan'208";a="107612372" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa006.fm.intel.com with ESMTP; 24 Jan 2025 08:15:41 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id DFD6F37E; Fri, 24 Jan 2025 18:15:37 +0200 (EET) From: Andy Shevchenko To: Greg Kroah-Hartman , Andy Shevchenko , Guanbing Huang , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Cc: Jiri Slaby Subject: [PATCH v1 6/6] serial: 8250_pnp: Remove unneeded ->iotype assignment Date: Fri, 24 Jan 2025 18:10:51 +0200 Message-ID: <20250124161530.398361-7-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20250124161530.398361-1-andriy.shevchenko@linux.intel.com> References: <20250124161530.398361-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" If ->iobase is set the default will be UPIO_PORT for ->iotype after the uart_read_and_validate_port_properties() call. Hence no need to assign that explicitly. Otherwise it will be UPIO_MEM. Signed-off-by: Andy Shevchenko --- drivers/tty/serial/8250/8250_pnp.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/drivers/tty/serial/8250/8250_pnp.c b/drivers/tty/serial/8250/8= 250_pnp.c index 7c06ae79d8e2..7a837fdf9df1 100644 --- a/drivers/tty/serial/8250/8250_pnp.c +++ b/drivers/tty/serial/8250/8250_pnp.c @@ -436,7 +436,6 @@ serial_pnp_probe(struct pnp_dev *dev, const struct pnp_= device_id *dev_id) { struct uart_8250_port uart, *port; int ret, flags =3D dev_id->driver_data; - unsigned char iotype; long line; =20 if (flags & UNKNOWN_DEV) { @@ -448,14 +447,11 @@ serial_pnp_probe(struct pnp_dev *dev, const struct pn= p_device_id *dev_id) memset(&uart, 0, sizeof(uart)); if ((flags & CIR_PORT) && pnp_port_valid(dev, 2)) { uart.port.iobase =3D pnp_port_start(dev, 2); - iotype =3D UPIO_PORT; } else if (pnp_port_valid(dev, 0)) { uart.port.iobase =3D pnp_port_start(dev, 0); - iotype =3D UPIO_PORT; } else if (pnp_mem_valid(dev, 0)) { uart.port.mapbase =3D pnp_mem_start(dev, 0); uart.port.mapsize =3D pnp_mem_len(dev, 0); - iotype =3D UPIO_MEM; uart.port.flags =3D UPF_IOREMAP; } else return -ENODEV; @@ -471,12 +467,6 @@ serial_pnp_probe(struct pnp_dev *dev, const struct pnp= _device_id *dev_id) if (ret) return ret; =20 - /* - * The previous call may not set iotype correctly when reg-io-width - * property is absent and it doesn't support IO port resource. - */ - uart.port.iotype =3D iotype; - if (flags & CIR_PORT) { uart.port.flags |=3D UPF_FIXED_PORT | UPF_FIXED_TYPE; uart.port.type =3D PORT_8250_CIR; --=20 2.43.0.rc1.1336.g36b5255a03ac