Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6025326rdb; Thu, 14 Dec 2023 06:32:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IElux3l9MhgecIPe7GFTyNwc8PeSbA+eRHkXvfRplwvq2pRtbuOwTzJX147rbrjeqxZvLMl X-Received: by 2002:a17:903:40c2:b0:1d3:6a73:afbd with SMTP id t2-20020a17090340c200b001d36a73afbdmr323053pld.60.1702564341159; Thu, 14 Dec 2023 06:32:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702564341; cv=none; d=google.com; s=arc-20160816; b=uBWoyd9RYVZsuJZBs4UH8khtQRxh7M1BJu/WZAVvPJkNecFsQHSTWesFQdPFcAAc68 0WrK5c7drO8rwLa6lB+Z5iy5pr0b2UpUBnW4sWC1g8ksJpLTl4nn7GCXBoh+7WtD9Z3N hIVuGDQqD4vr9h5XnY3orXPtz+oRmaHgw7W6wHRkrZ73FbqB4VjMuydCdsqEgA+kmIdP 7byOBgYWWS7KBZgCwoVgoATaniERQJtPjrvaO1wRenP2n3YobcES+Ksd1jGiRI+9036e Q4Xan3iLRoQtRUXunbFWS3GwGAAYTPk82AVtvGg3uNJxlNLkM2W0f7RMQM/o3QwADmLM JMlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=VgJQbimhdbaMz8PSS4TWmPrQmjKzzald78cLvtVZ+/M=; fh=qndxIwPpE8jyiaFeTyjK8TWq/ZvrEgwef27RjTLxVf0=; b=bfTlqOn4lewqT7Hi4qH1kqFcw1DeF8k8sXXjkubLPNh5TFTPnq8YN6lgyjzwW7oynZ RyW9NoUuyF1J7uxMw2ZfPEulmnKvJkdLZFYg+3DI1m3MMej2rdbaUTCOaQuKqMw/S8R1 VyumL9f6PqRhJX2ONzyZ1b+Vlbr1wdUppDHnFAwU6UKiPmv4Eu7PTVapACmsU4m4ibz/ ZqT6TyRnwaRxzGvULnJi8/I2Ah6WrBnfGCBJlj2JDQ1l5it6QnzMz5vOEXbtV9A8+6T3 CIu9wcytCBW46JyW61u2Wk67JRwLPb56OAZ+qWy42JVxkEzYSPzcsv8fZ9C9ONcaxHbh R70A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eh8WBxT6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id b12-20020a170902650c00b001cfe02fa89esi11307273plk.117.2023.12.14.06.32.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 06:32:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eh8WBxT6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id A500B801B828; Thu, 14 Dec 2023 06:31:59 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1573497AbjLNObZ (ORCPT + 99 others); Thu, 14 Dec 2023 09:31:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1573491AbjLNObX (ORCPT ); Thu, 14 Dec 2023 09:31:23 -0500 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51C48115 for ; Thu, 14 Dec 2023 06:31:28 -0800 (PST) Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-a1f0616a15bso937355066b.2 for ; Thu, 14 Dec 2023 06:31:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1702564287; x=1703169087; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=VgJQbimhdbaMz8PSS4TWmPrQmjKzzald78cLvtVZ+/M=; b=eh8WBxT6Q0T3qFh1kwRQZApC3AmWMWC21CjpFyCAEALvcBx8K/cxF9foP0qc+YO6u4 uIiUjO9uYDmJMdEsIF4h2BqDob2rD4zHhEaYosG/aI4byr5DJDqGNg01sGMpUY0HvP9k nlNugi0HzdUMAhmC5bk/adU02sQkmCaj1STs7OlWVGIR5WXdJ1zPgh68dVaVoCtDYLzO Yk3KDINaJrinLhnFOP2vm3vehZyj1EUU2OzAiQIelhyWhn+TRqP1IS/erCI6MnhSfG5U EgYZI0SnIGOZRgRhJaNE9Y1bhypoa0/KHKPG3bs6XLER/kw7aEOFqs+hydSV2tdFgshX QkLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702564287; x=1703169087; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=VgJQbimhdbaMz8PSS4TWmPrQmjKzzald78cLvtVZ+/M=; b=iWHSqF3LC8CIJeQSyqCWPyfK7alQmyi6Ssxk+crzulXKO9/jEiUz/r1LFPi16mLxt0 VavawxRhh0nrIJ3zv2BoY4eUnZSG+7OWN8nhcV9tACCjP1S/5wGmZ9XrtJxQiZvzd80c bvQFtCOSYaLlxh4wFieNmqBnBf65IUsvF+6VbCO6/03H1yZZTpbSGokSIoxXx0jM6AQG QC3rYztiuY2oPQ9AeLzpcWOvIWcUrh2mcm/v9bNwJZwzHbYP5oCTlnw8ll59dG57ggMN /uy6VFULN1+bpbO046CWD3+pf5Yk/qD/kiPvKEaz0vI/9tfvsIcSi5AApCYwsYYjLxbh +rYw== X-Gm-Message-State: AOJu0YxaYfsavxD9dKfA2/nsWzbGH2n7NiNJEGO9QEUouTzLptKhQynM /fxHESWKOldOMIqFcTRovwrGlg== X-Received: by 2002:a17:906:4559:b0:a18:8b15:4d3d with SMTP id s25-20020a170906455900b00a188b154d3dmr5541926ejq.77.1702564286762; Thu, 14 Dec 2023 06:31:26 -0800 (PST) Received: from [192.168.2.107] ([79.115.63.202]) by smtp.gmail.com with ESMTPSA id hw15-20020a170907a0cf00b00a1f761d9ffdsm8791995ejc.177.2023.12.14.06.31.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 14 Dec 2023 06:31:26 -0800 (PST) Message-ID: <584e036a-2ae7-4b88-a517-8f79c6baed4a@linaro.org> Date: Thu, 14 Dec 2023 14:31:23 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 05/13] tty: serial: samsung: add gs101 earlycon support Content-Language: en-US To: Arnd Bergmann , Peter Griffin , Rob Herring , krzysztof.kozlowski+dt@linaro.org, Michael Turquette , Stephen Boyd , Conor Dooley , andi.shyti@kernel.org, Alim Akhtar , Greg Kroah-Hartman , Jiri Slaby , Catalin Marinas , Will Deacon , Sylwester Nawrocki , Tomasz Figa , Chanwoo Choi , Sam Protsenko Cc: =?UTF-8?Q?Andr=C3=A9_Draszik?= , saravanak@google.com, William McVicker , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, linux-serial@vger.kernel.org References: <20231214105243.3707730-1-tudor.ambarus@linaro.org> <20231214105243.3707730-6-tudor.ambarus@linaro.org> <1938fcf1-eb5d-4723-a6c6-d2fe2c6dd1c0@app.fastmail.com> <8808ceeb-35dc-4094-aec4-f43c7acd6174@linaro.org> <6962ac73-2f44-4c9e-8731-152087815454@app.fastmail.com> From: Tudor Ambarus In-Reply-To: <6962ac73-2f44-4c9e-8731-152087815454@app.fastmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 14 Dec 2023 06:31:59 -0800 (PST) On 12/14/23 14:19, Arnd Bergmann wrote: > On Thu, Dec 14, 2023, at 13:52, Tudor Ambarus wrote: >> On 12/14/23 12:01, Arnd Bergmann wrote: >>> On Thu, Dec 14, 2023, at 11:52, Tudor Ambarus wrote: >>>> +static int __init gs101_early_console_setup(struct earlycon_device *device, >>> >> >> It works if in device tree one specifies the reg-io-width property and >> sets it to 4. If the reg-io-width is not specified, the iotype defaults >> to UPIO_MEM causing the SError interrupt on gs101 which makes the system >> unusable. > > In the case of incorrect DT data like a missing reg-io-width property, > I would expect it to still fail once the regular console or tty takes > over from earlycon. > >> Also, if the earlycon comes specified from the kernel params, the >> of_setup_earlycon() is no longer called and the earlycon will be set >> solely based on the kernel params buffer, thus allowing users to crash >> the kernel on wrong earlycon definitions. > > But that in turn is the same as specifying any other incorrect earlycon. I don't think you can crash the kernel if you use other earlycon as you don't make accesses on the 32bit restricted bus. But I agree that if using the correct earlycon name, and mmio instead mmio32, is equivalent to not specifying reg-io-width in dt. > >> If you think the change is fine, I can amend the commit message with the >> description from above. > > I'm still not convinced we need a special case here when everything else > just requires passing the correct data. > Well, I made this patch because I used a wrong bootargs earlycon configuration and I ended up crashing the kernel. I couldn't see what happens as kgdb is not available at that stage. Figuring out what was going on made me spend some time. I hoped I'll be helpful and spare others of the same mistakes and wasted time. I'm ok to drop the patch as well, no pushing here. Please ignore. Thanks for the review! Cheers, ta