Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp989997pxb; Tue, 26 Oct 2021 00:18:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOKbhVOJhZDn7lNUMgwMj1LsY61SQYNHN8oNv/iuKaUErqR4gNSS5Az+Z2v1sLhXSGMYW1 X-Received: by 2002:a17:90b:3a84:: with SMTP id om4mr333380pjb.5.1635232697722; Tue, 26 Oct 2021 00:18:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635232697; cv=none; d=google.com; s=arc-20160816; b=XWHcPb3cEa9yf2Gmed9XPxDuSqLS/3JoxEy8BdL/z+/skUWBYQz3ZSJXBGGyd/GTjH 2CfqTnJxSgQqy2AGI2F5GGHHBm27nigAht30DX/La4tzCiyrjb6YSmwv41kzCJzbl7Nx MJcwrvixWzMTGW9jHcKkDHB5N1qfDUAzJkNkrNtn4lbHrdDHhZCioduFwybTB2NW1r7X EnnP3cqVKfAPsc9GzU6caOc/SEpa/3b6tavUEN00ALmkCyyN5FKxS8KkGdGUPP+/efo3 FoWJg928w94Qpue9KRtO4Ckj1O2ld5n5JLBGzau5vKoNpqGOUY0D/FZu9PnfgnwS+Tqt mqdg== 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 :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=ixA39umGGNxpNt/I+gLk54IGhS0LX601cNWzIMvHRP4=; b=FWYGnl6MWaW0OsTs53YUJdYLmH/Ffpn9fPHaW+hhhT749CHAjTQsWr+QeNXmofgf/w YvxXe+MF9FRah8B6t9jGgerspG0ge86uo6DCgBeTS9570TkYW81kmWJdFTcDBKygsbT/ gLEn7rno3H8+4iG3jyz4zAe3M9dQn35l7cpQATeXaJJYoLHH6c1CBbyBmf4xdNJhK/As FyBU0FkscEYteoiEhfHPQz2XjniJX66my9Odi6Inh3K+mOpLRWaGPduGFyVE/hDwiYDw jHryT1iriUJkVQ/SKR1j5IZHfEXAQWKi5tj+r1xEHnVdEXB1I1SFDRRzIw3kIwYFkjsa QZJA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d4si4122244pfj.269.2021.10.26.00.18.05; Tue, 26 Oct 2021 00:18:17 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233196AbhJZGOS (ORCPT + 99 others); Tue, 26 Oct 2021 02:14:18 -0400 Received: from out30-56.freemail.mail.aliyun.com ([115.124.30.56]:49808 "EHLO out30-56.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232553AbhJZGOR (ORCPT ); Tue, 26 Oct 2021 02:14:17 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R561e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04400;MF=xianting.tian@linux.alibaba.com;NM=1;PH=DS;RN=9;SR=0;TI=SMTPD_---0UtkSRIK_1635228711; Received: from B-LB6YLVDL-0141.local(mailfrom:xianting.tian@linux.alibaba.com fp:SMTPD_---0UtkSRIK_1635228711) by smtp.aliyun-inc.com(127.0.0.1); Tue, 26 Oct 2021 14:11:52 +0800 Subject: Re: [PATCH v11 2/3] tty: hvc: pass DMA capable memory to put_chars() To: Greg KH 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 References: <20211015024658.1353987-1-xianting.tian@linux.alibaba.com> <20211015024658.1353987-3-xianting.tian@linux.alibaba.com> <208f7a41-a9fa-630c-cb44-c37c503f3a72@kernel.org> From: Xianting Tian Message-ID: <8f78c1b8-c736-748d-d08b-3d6121eb5af8@linux.alibaba.com> Date: Tue, 26 Oct 2021 14:11:51 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2021/10/26 下午2:10, Greg KH 写道: > 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. OK, thanks. > > thanks, > > greg k-h