From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 46C3AE71080 for ; Sat, 7 Sep 2024 13:23:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=M0r0BvC0JYwjLynqTsK9rmwWO+bU4XTC1+gIg1Xr9eo=; b=G+UCjtH/w5DHbkxnz+9OIc1v/t NdPfUPW64MTo5HPJ4rQbSfri/O81C/KKJ2wHTi2L/lTAxuMIK/Ch32dmxlvVaoctPQiH+GWuPEC3D ArOhqkQgfP+k7iC94lOzU/RoZ+XicaBhIeqHLhts2qKZZgs8OZt0aoVs2dJeyBggounHsdeA7mrAp 1hiVKSJNP6lpHyvwvNFf7gnmm9fh8OADpRHX2DaywVRyzmybXmWXDbpZtjDpazquT5bfnF3YxXs4c ZdQvz5wERXymn8SsUqy/vT7+XY7XUphHBdeKav73EKjZTRud+GW7rfW0AGek8sWtS+ZHS5IQVheTs zNmAb2ig==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1smvPf-0000000F3yE-3x55; Sat, 07 Sep 2024 13:23:39 +0000 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1smvOf-0000000F3py-1DJp for linux-arm-kernel@lists.infradead.org; Sat, 07 Sep 2024 13:22:38 +0000 Received: by mail-pj1-x1034.google.com with SMTP id 98e67ed59e1d1-2d8a4bad409so2218369a91.0 for ; Sat, 07 Sep 2024 06:22:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725715356; x=1726320156; darn=lists.infradead.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=M0r0BvC0JYwjLynqTsK9rmwWO+bU4XTC1+gIg1Xr9eo=; b=IkS5aAOxaRLN2QKM2bM7qTrmNi7C8Zsy6640zGNOaIUjHZr6LD9G4y4ab91ZQpOncJ /BBCScjJRHifM8BmM0LxRh3QAnlvePps6HM7OFMVmTHe6i4E6pw5g+NCzPVjs3pqSL8f jJHI5uWjs2mSXo1lBU7Bw4AgxZDCaIae0vNHPvl5Q3XVYfFVK78KSK2US3jim0C7JAB2 bHXobilPBi12aG9RDWnkJn4OzWs0UxXe1GwMV0AptpgyWN59F3s67NYr6wcY1+3PWbmQ H2VxpBZnaDvgOVsAm+MIF1ZPhH+uFYpbyJvUMaO0aG/DSvbrnmfN3IetuDNBeUQQIVbb P/kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725715356; x=1726320156; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=M0r0BvC0JYwjLynqTsK9rmwWO+bU4XTC1+gIg1Xr9eo=; b=lHL4m3xY+Qw/PUvK74rdSN3Qf8F14sGT4eNk5qt+b4iphv2k6z+sOjEE9nUR5QJ0gU +ovMA7pciWMzPaCMLjIiONhqmbhuPGb0STJXX+t08agKq0ujRB6YzxVV/6pD+2FtrKmG oI+Z2QblLzFCv28Bzzu9J6oowijN+TLQYNbRpBOPuBEo7vb4qUGTSSbLGKY2bC5SvHVW isDDMWBT8u6dpKt1FtY7yFjdzVfz0amtuxDsWiekL2vbO4+CFExuVgXsJkB+Xsjs9B5W Ens8dBxoIorkqHW/+O1K0cGi261nFScwMJWmFh/tbxBSBze3Rukb10PkpHDYWqkYoYGj R90Q== X-Forwarded-Encrypted: i=1; AJvYcCV2hhzN69phtPsGIyuJu5H1ZOcKLueRCpxBNmqP5coMsq6zHW9cwnS+5ro0sF2shRtPGwqQGLw8NkazWasKcYBT@lists.infradead.org X-Gm-Message-State: AOJu0YyOQrmt4gS/EbpVkXix7uWAfhFBmn5tHS7kh8P/kRiRMiv9edMf JnFh7z0Fr30auCyxZ9AAk0+SVrXtwxfs3SU3Bm+I1CaLeNTYbJWF X-Google-Smtp-Source: AGHT+IHdVHLUbDTTXz6BefBZHbxE7BD7z1FDmqLP55VkGFikFJgclg5egAWIQWqUu90Qh+mLNT47dQ== X-Received: by 2002:a17:90a:c08b:b0:2c9:359c:b0c with SMTP id 98e67ed59e1d1-2dad5181bc6mr5654503a91.28.1725715355933; Sat, 07 Sep 2024 06:22:35 -0700 (PDT) Received: from [192.168.0.122] ([59.188.211.160]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2dadbfe46d4sm3370238a91.1.2024.09.07.06.22.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 07 Sep 2024 06:22:35 -0700 (PDT) Message-ID: <378c9865-270f-4a36-8614-ecff6f0236ce@gmail.com> Date: Sat, 7 Sep 2024 21:22:31 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] tty: serial: samsung: Fix A7-A11 serial earlycon SError To: Krzysztof Kozlowski , Alim Akhtar , Greg Kroah-Hartman , Jiri Slaby , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Cc: asahi@lists.linux.dev References: <20240907111431.2970-1-towinchenmi@gmail.com> <20240907111431.2970-2-towinchenmi@gmail.com> <440be61d-b60e-4179-8481-b9a7a0dabae5@kernel.org> Content-Language: en-MW From: Nick Chan In-Reply-To: <440be61d-b60e-4179-8481-b9a7a0dabae5@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240907_062237_397665_355E382D X-CRM114-Status: GOOD ( 24.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 7/9/2024 20:54, Krzysztof Kozlowski wrote: > On 07/09/2024 13:06, Nick Chan wrote: >> Apple's earlier SoCs, like A7-A11, requires 32-bit writes for the serial >> port. Otherwise, a SError happens when writing to UTXH (+0x20). This only >> manifested in earlycon as reg-io-width in the device tree is consulted >> for normal serial writes. >> >> Change the iotype of the port to UPIO_MEM32, to allow the serial port to >> function on A7-A11 SoCs. This change does not appear to affect Apple M1 and >> above. >> >> Signed-off-by: Nick Chan >> --- >> drivers/tty/serial/samsung_tty.c | 6 ++++-- >> 1 file changed, 4 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c >> index c4f2ac9518aa..27b8a50bd3e7 100644 >> --- a/drivers/tty/serial/samsung_tty.c >> +++ b/drivers/tty/serial/samsung_tty.c >> @@ -2536,7 +2536,7 @@ static const struct s3c24xx_serial_drv_data s5l_serial_drv_data = { >> .name = "Apple S5L UART", >> .type = TYPE_APPLE_S5L, >> .port_type = PORT_8250, >> - .iotype = UPIO_MEM, >> + .iotype = UPIO_MEM32, >> .fifosize = 16, >> .rx_fifomask = S3C2410_UFSTAT_RXMASK, >> .rx_fifoshift = S3C2410_UFSTAT_RXSHIFT, >> @@ -2825,8 +2825,10 @@ static int __init apple_s5l_early_console_setup(struct earlycon_device *device, >> /* Close enough to S3C2410 for earlycon... */ >> device->port.private_data = &s3c2410_early_console_data; >> >> + /* ... however, we need to change the port iotype */ >> + device->port.iotype = UPIO_MEM32; > > If there is going to be resend, then this comment is redundant and can > be dropped - repeats the code and does not provide any explanation why. > > Which would also make the patch smaller and easier to read. See GS101 > earlycon. I agree that the comment is quite useless as-is. However, I think it is worthwhile to mention that A7-A11 expect MMIO32 register accesses here, as someone looking at this code is likely using one of the newer SoCs, which does not have this restriction. > > > > Reviewed-by: Krzysztof Kozlowski > > Best regards, > Krzysztof > Nick Chan