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 X-Spam-Level: X-Spam-Status: No, score=-5.7 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21BA2C433E0 for ; Thu, 7 Jan 2021 18:17:28 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C1E0E233FD for ; Thu, 7 Jan 2021 18:17:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C1E0E233FD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Z2mZQNhKzWWNOiX9LEvHsNmFa5TiuLIGMzJkLIb7gBQ=; b=pxx/Qd/H+9GngIfBtco1QTjM3 umm+gtHlw/zi0bu944OOdJX8lJ9A873UZt0GfDJcATIapx5GZFeO1maptFzu6VRfpWeWKvmgeMIzS b7u4ZEB6EAOlp3033cTKD94xmKh4VR9WRkWg2UqAGRL7gsQlQRMroqbXd36mMtwxd3K+ipso10xBN b5bN8N5vgB4d3qXVhHIfFDTY0KVZ1/DI0nqJc4SgrtICL2RE+LDBLDxsCWNVhDOm8DK8OCk+MyWel OBAV2E2LVsBE0Xk4m+fkfCIzvqyzeYtLzP7Xd5Hn265PEyk2Mi9bw4Bd5IPnGSzgNmUIUoUS+chZL y/X5Y/rqg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kxZpU-0002JV-A1; Thu, 07 Jan 2021 18:16:12 +0000 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kxZpS-0002Ip-37; Thu, 07 Jan 2021 18:16:11 +0000 Received: by mail-ej1-x62e.google.com with SMTP id b9so11088385ejy.0; Thu, 07 Jan 2021 10:16:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Xw3+iv4jWbYW97YeUypwG7nXusRKeVRrFbIKS0p0C4Q=; b=J6lRL3JoxLzgWSk2bres0wN6NMur16znBTo5G/6SfORLVzqj4LISPZgYwxFf1b93J0 5wU+iGKtasRmjtko9hRKqeQAjX5OcSSu2lgRmplNGM8r1qHQRAyN3WHf2D8LcEuAde5w /Yr7BzY69ZanYET+IXg0x2hQ16nqb8sbCDpUhMQIml4ikAQ7JmqX+z/v8S8+E3Q/E7MB +eDaijn9TOILv+OeM3q0Xo22swHJswkEWsL2M2dOmw2LR9ir8b+m/jDs9DDmTEOJBjTG Q8n9qwVsQEl+ou8Jn/GZUHpfxv1l9Z4+fyO5LSUyAMbTTweUXWvjuH0A+dOb7Re1RgcB /WIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Xw3+iv4jWbYW97YeUypwG7nXusRKeVRrFbIKS0p0C4Q=; b=quqOKn9oRErLzIEy3mixlAvgTjeZyvpDomDdqQ7rDEhORzKNQ2smmDVrww9LqGIxOp KnOqdQAIj11G4/ZU9Y2loo67XQwtWMl9HWmZueAc8tHp8OZv0npyqxaRvE7S+Rf99tDe 2tvCRNA+u2vg1QpHotMvxeIYkiuZPrpYUWbS6zXyLjpNQwEq7cgfcoKYqn5Sy3bGGgOu moakgg20DsyXleHhPgRSVbh0i6lwccGLUNdMrKvMsPkOvOSypLpiGlKdqEDfiAbZPBrc qAPSGhNj5ZwcIrqLJXfbKAUx6t8VyeqWC6rgPQiMjyzTsd52gXfmADGodCVoa5IOJFxf S4FQ== X-Gm-Message-State: AOAM533M+p162yH2lnGrirTPo9yv3N52/1/2yLJUPs3AxtkEnmKCgFfU EyzRy9mbWbtne9Q7jmJoKLw= X-Google-Smtp-Source: ABdhPJwK9ItKYY98MYFMnpwlqVeRDt7Zu9FaY6RcOPw0FA8Rl8SNjtzI2LmVs9WPpi6Ps4eSkyCo4Q== X-Received: by 2002:a17:906:3999:: with SMTP id h25mr47734eje.146.1610043367343; Thu, 07 Jan 2021 10:16:07 -0800 (PST) Received: from BV030612LT ([188.24.159.61]) by smtp.gmail.com with ESMTPSA id z12sm2739571ejr.17.2021.01.07.10.16.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Jan 2021 10:16:06 -0800 (PST) Date: Thu, 7 Jan 2021 20:16:04 +0200 From: Cristian Ciocaltea To: Greg Kroah-Hartman Subject: Re: [PATCH v2 1/1] tty: serial: owl: Add support for kernel debugger Message-ID: <20210107181604.GA427955@BV030612LT> References: <036c09732183a30eaab230884114f65ca42ca3b9.1609865007.git.cristian.ciocaltea@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210107_131610_145765_F1031940 X-CRM114-Status: GOOD ( 16.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-actions@lists.infradead.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Manivannan Sadhasivam , Jiri Slaby , Andreas =?iso-8859-1?Q?F=E4rber?= , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Greg, Thank you for the review! On Thu, Jan 07, 2021 at 04:20:55PM +0100, Greg Kroah-Hartman wrote: > On Tue, Jan 05, 2021 at 07:02:02PM +0200, Cristian Ciocaltea wrote: > > Implement 'poll_put_char' and 'poll_get_char' callbacks in struct > > 'owl_uart_ops' that enables OWL UART to be used for kernel debugging > > over serial line. > > > > Signed-off-by: Cristian Ciocaltea [...] > > + > > +static void owl_uart_poll_put_char(struct uart_port *port, unsigned char ch) > > +{ > > + while (owl_uart_read(port, OWL_UART_STAT) & OWL_UART_STAT_TFFU) > > + cpu_relax(); > > Unbounded loops? What could possibly go wrong? > > :( > > Please don't do that in the kernel, put a max bound on this. I didn't realize the issue since I had encountered this pattern in many other serial drivers, as well: altera_uart, arc_uart, atmel_serial, etc. > And are you _SURE_ that cpu_relax() is what you want to call here? I'm thinking of replacing the loop with 'readl_poll_timeout_atomic()', if that would be a better approach. Kind regards, Cristi > thanks, > > greg k-h _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel