Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1075996pxb; Tue, 26 Oct 2021 02:20:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyAkYhzU0qkF/wNUkZi0HhBpu+M2W8451Iu7tee0mCtXCbTYKTf0JcwXfOioeJc3/nSQHE1 X-Received: by 2002:a05:6402:190e:: with SMTP id e14mr34326366edz.20.1635240016272; Tue, 26 Oct 2021 02:20:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635240016; cv=none; d=google.com; s=arc-20160816; b=HLRm2ixAfC5DkDbRlUZ53JfxkJmR1QsLKR6mEpWKziC74crK8pxRbPufNbbhL67voh zdKZyxzNMeg6azGJErk3kmNj7XYQh92p9MmXxGd2TGyaidp/RpFPGohN3BsLP5HSixJz PnDpzMbfAqESoga0yexhwHeigDpm+HmOqjp/JjszLDreN0+Ihi62ZWIYb6s80nv70r63 HWCPPnXrSCowMDU5fgFYVjtguPu8BjpxFaqXARBKppL5kVeTlHXqd+RA9mvFyPZXyFO0 Xv+gQ/QI1HRXU9t8lQYXorhuUccaX8hi2zojJRYYSD1i+sjcNhGbR1xoJyEx1cwsmwQ2 OL7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=00CdhISs3X/kSLDtKRiMuJBgIVchoAmYhZRaQHlw/vk=; b=WKAjRQdz7rkQ9rrtIwfn3on7wbuUkFyY2WJnndlk/zAy5PxFlzKMp5YaZo2R4jK1Zc 0M91Z9fuGCRWMUVLVq9Tq+0xG+04417RGGQAAc3zPTeWQx7OPYCPmhJIT9EdxMhFNSaL VhMZ0pbBNlRMOa7+MgIxkTGdd52r45oB4JokV72fj70IN1btphN1vpzK+5qqG5oYGaX7 K5LejfehQKSaQxajuikMfPHhCCJM3zEndlsSbtky5e9T9nX4TYPgS3UejeOYW1LGDC/B zLkwaDxDoNcfga7HKhl4fLxLsnZvoRpvRijuWJgUdFB6RBBIZfivMHoHtKnK/AKNqKlg tw8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zcyqYjur; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gb21si30873442ejc.395.2021.10.26.02.19.53; Tue, 26 Oct 2021 02:20:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zcyqYjur; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234449AbhJZGMu (ORCPT + 99 others); Tue, 26 Oct 2021 02:12:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:49770 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232875AbhJZGMt (ORCPT ); Tue, 26 Oct 2021 02:12:49 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5FB9560FD7; Tue, 26 Oct 2021 06:10:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1635228626; bh=jlo0wSpQEg3b4uT94kNaKHxLqywsLkSxtk+euI6cbGs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=zcyqYjur+Wxxc9kte4zvlS6ZJNMFVyYmwoGNA2tWWuQPm5Rpral6BUuiR6gYJHb7x OhHAfDCqRUe6AC7xKNdI+ZPUTuQ7tYDP+IRQ1PAf70hWggTtmk/8aeAkeqECxqoymn AonoQuErZfse6VT2SXBMLjSlaWlq0IKHZZ9zVyZ0= Date: Tue, 26 Oct 2021 08:10:21 +0200 From: Greg KH To: Xianting Tian Cc: Jiri Slaby , amit@kernel.org, arnd@arndb.de, osandov@fb.com, shile.zhang@linux.alibaba.com, linuxppc-dev@lists.ozlabs.org, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v11 2/3] tty: hvc: pass DMA capable memory to put_chars() Message-ID: References: <20211015024658.1353987-1-xianting.tian@linux.alibaba.com> <20211015024658.1353987-3-xianting.tian@linux.alibaba.com> <208f7a41-a9fa-630c-cb44-c37c503f3a72@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 26, 2021 at 02:02:21PM +0800, Xianting Tian wrote: > 在 2021/10/26 下午1:10, Jiri Slaby 写道: > > On 15. 10. 21, 4:46, Xianting Tian wrote: > > > @@ -151,9 +142,11 @@ static uint32_t vtermnos[MAX_NR_HVC_CONSOLES] = > > >   static void hvc_console_print(struct console *co, const char *b, > > >                     unsigned count) > > >   { > > > -    char c[N_OUTBUF] __ALIGNED__; > > > +    char *c; > > >       unsigned i = 0, n = 0; > > >       int r, donecr = 0, index = co->index; > > > +    unsigned long flags; > > > +    struct hvc_struct *hp; > > >         /* Console access attempt outside of acceptable console > > > range. */ > > >       if (index >= MAX_NR_HVC_CONSOLES) > > > @@ -163,6 +156,13 @@ static void hvc_console_print(struct console > > > *co, const char *b, > > >       if (vtermnos[index] == -1) > > >           return; > > >   +    hp = cons_hvcs[index]; > > > +    if (!hp) > > > +        return; > > > > You effectively make the console unusable until someone calls > > hvc_alloc() for this device, correct? This doesn't look right. Neither > > you describe this change of behaviour in the commit log. > > I mentioned such info in the commit log: > 'Introduce another array(cons_hvcs[]) for hvc pointers next to the > cons_ops[] and vtermnos[] arrays. With the array, we can easily find > hvc's cons_outbuf and its lock.' > > After you pointed it out, I just found what you said make sense, I checked the code hvc_console_print() can support print before hvc_alloc() is called when someone use hvc_instantiate() for an early console discovery method. > I send a patch to fix the issue? or these serial pathches reverted fisrtly then I resend new version patches? thanks Let me revert these now and you can send an updated version. thanks, greg k-h