Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3046043imw; Mon, 18 Jul 2022 00:33:41 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v40Y0poGU3orbkpE/jAtE49XW/0ecAo0UJVoKPn2DdQaAIz+nfsEwZ0uVZUXKQOYLD5DsI X-Received: by 2002:a17:907:7632:b0:72b:4d5d:ecce with SMTP id jy18-20020a170907763200b0072b4d5deccemr25570996ejc.11.1658129621565; Mon, 18 Jul 2022 00:33:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658129621; cv=none; d=google.com; s=arc-20160816; b=hmq++vw+YugcBk/4H8i5q1xxKdb4RAK8lmGyIWE4JRkWSwzjh2mvBbVXpavjgAKUlY UZQYS3I5CTLmMa72Q7pD4RUreD18g3muB2LM45UK8pd0mLOeZgZYDfxv97zmMKzJPutw LC7vl72JdJpWXL0QmYS+irMT+M++4QSL+qkjU19yuTHLZwxyDohO2+Eiw72IUW9z16hB mx3PQEHmsJm82Eg963x4KpiPRB/6+6rTSi83/xpNxEkaCjyRIliYu+87rU5dGrrcfTPb 6xkTL+rmwLvBaJXnKp1MG/pd1n67fiMD1w2RlmfArQI24jU9T2FRVl6bfLqo7hm+HbZt +1Iw== 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; bh=mBaCn+yOtwwme9flF0xPrDTgDsQW7uNWw9wOEtCnhK4=; b=oL2LKb9G0Zk92b4i17gUoD5qPUqK2cy7zQO/3H7Do3/Tq2lcgnGy8Z+YUUC9PCHoSQ 8mNdiid23JYyWCoTKcdHy46B0UrcsbiFWxKkh1Ylyf1Z/Df1h2d/VWecRhxAwYvwkow9 JnXlclt0WNpc6PvR1jiEyzQn+eiQi1QN9SS8ggSTF1vQL+TuHGkWixekJeGvVyW8WK7O cOUuaSpSSTVd9rxZbpGmrK5Eh/f4xYw8Qo6ynnPI9vQ1S3/CLcKiHXcp8fn7YRz+ZKC6 QUQ8TPc/Y13NMKEZMWfNNWHJwn06FQ8UKB2D1W4D4jmgO6Df/pNM85kEt4DQgU88qkuw GQWg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b10-20020a056402350a00b0043ac617804esi18043129edd.31.2022.07.18.00.33.16; Mon, 18 Jul 2022 00:33:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233690AbiGRHCQ (ORCPT + 99 others); Mon, 18 Jul 2022 03:02:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233184AbiGRHCN (ORCPT ); Mon, 18 Jul 2022 03:02:13 -0400 Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 138A41706D; Mon, 18 Jul 2022 00:02:13 -0700 (PDT) Received: by mail-wr1-f46.google.com with SMTP id b26so15663505wrc.2; Mon, 18 Jul 2022 00:02:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=mBaCn+yOtwwme9flF0xPrDTgDsQW7uNWw9wOEtCnhK4=; b=TxPYWCpnbe999RTMQbJmHOshS9DrDRFDdYeJwCnZX0xutYYGnR3102WyksgRMV/Dz6 bd53Ng6jWR5tpNH3TA0FFEcQnLfu22APattrzKiFTn10yOTB7A2C8WzrMTXpJe4HwKaN uYqpj0sdf80RGGbytvF70vKEeiW58AwisZU8Fj7d1ggdm1Xf2ES+Ko+guMgJjNYeUZ2h hcyPmZi9VrNSKuZOfYAV5j28RPRa4BcWAsLmxlQ5Z0rwet7GMZr6t1lHf3n8HWjuR70e u/LX48XrHxs2QR4h11+h+UBTnK+aMxTrZXBwjy4mnlKGt5wSbq/AJNHb8Ey2y53w7Zz+ iABg== X-Gm-Message-State: AJIora962fYRr8KRW8oPuAfI/ZkpxfITjinGS63OVkMM7ZS+EBWG9Raf qtcFWuObhqQ/ftTQmHTKhelvzhYhJk8= X-Received: by 2002:adf:f245:0:b0:21d:a39a:bed5 with SMTP id b5-20020adff245000000b0021da39abed5mr20980909wrp.508.1658127731543; Mon, 18 Jul 2022 00:02:11 -0700 (PDT) Received: from ?IPV6:2a0b:e7c0:0:107::49? ([2a0b:e7c0:0:107::49]) by smtp.gmail.com with ESMTPSA id r10-20020a056000014a00b0021d68a504cbsm10078557wrx.94.2022.07.18.00.02.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Jul 2022 00:02:10 -0700 (PDT) Message-ID: Date: Mon, 18 Jul 2022 09:02:09 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH 2/2] tty: serial: fsl_lpuart: writing a 1 and then a 0 to trigger a break character Content-Language: en-US To: Michael Walle , Sherry Sun Cc: gregkh@linuxfoundation.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, dl-linux-imx References: <20220715025944.11076-1-sherry.sun@nxp.com> <20220715025944.11076-3-sherry.sun@nxp.com> <509669b26b5899088e9b77ed94d103ee@walle.cc> <61c525fc87d6586c024cd6e42fcf876d@walle.cc> From: Jiri Slaby In-Reply-To: <61c525fc87d6586c024cd6e42fcf876d@walle.cc> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15. 07. 22, 13:52, Michael Walle wrote: >> Seems we have the different understanding of the break_ctl(port,ctl) >> callback. The original break_ctl(tty,-1) in lpuart will not send the >> break signal until we call break_ctl(tty,0). > > That is not correct. The TX linue goes low as soon as the SBK bit > is set. See below. In that case… >> Per my understanding of >> "If ctl is nonzero, the break signal should be transmitted", call >> break_ctl(tty,-1) is enough the send one break signal, now my patch >> makes the behavior align with my understanding. > > As I said, Greg should clarify here. > > In any case, I've checked the hardware (LS1028A) and as soon as you > set the SBK bit, the TX line goes low (TTL levels) as expected. It > will go to high again as soon as you clear the bit again. > > So to me it seems there is nothing wrong here. Also have a look > at man ioctl_tty: > >        TIOCSBRK >               Turn break on, that is, start sending zero bits. > >        TIOCCBRK >               Turn break off, that is, stop sending zero bits. > > So to send one break "character", you need to do ioctl(TIOCSBRK) > followed by an ioctl(TIOCCBRK). … you're right. regards, -- js