Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2397150pxu; Mon, 7 Dec 2020 05:42:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJwbt7Lxs50zQoZhW/N3RVz04Ykd9IXi916IfO9wy97Nvx9bS7hwpcMYs72ES7+YkoDUwmVk X-Received: by 2002:a17:906:ae41:: with SMTP id lf1mr19332432ejb.369.1607348570934; Mon, 07 Dec 2020 05:42:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607348570; cv=none; d=google.com; s=arc-20160816; b=Rp49WHIFLBCu0A/2OUXmNra01TLijGLUSDREz4utjfWsze1B8X8hEBlZ+oFua2bFap um9CN7RYdgKXLl2RYPS7oS30wsdyczYCmXu2MRGLeLgPyD5HEB4KxGUcuIbElCyU/Plq LAIjot1cMhIhnwOkFHPbNrp335WtYHIYYbt8MPFk72DdXzON42Ui4UKhCFIk0jFme4ss boeR/5l3f5mX3wzIFtlwLUd4IVoXIcIiYeALRkXPTt7MYAznVuPb51J4x5FIUI5UDuV/ 8hJx24mxOm1baN3SvMUrGge5FLkIG3a2OYJtSXM3iQ9GueKLbnMiHVM9G4w4vDFGQalb POaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=haYuw1U4BccfG85AJy6UKy/JEpo0rY/0T3AlACW5eW4=; b=PxM6JxOQp/089aYkk/PNPbLDQfzfRA9nZsPOJBf6/O/zGI0l7vUZSqafkF61H8hKiQ RzpihLcWsCy1UwIawz7HxeAD/a3UtSc0k/YRE0DfQZqDmKm7h923Cp7Vs/ZwyWIFDZTP TlnPBWVO2xdeReB1tCcXIA+syQ0jYHDg8vHjKnKnABpRYL6xQw92WwF3Oyg6mrYTBeJZ 2zZUCEEBLursT/cV4uyzFnq2kG0DCrW6lh3U7bQgLv9qr5u+IsWn0a1zDjnyqfRGV7uS JHn4TeXu5uSl53rfQzlPxf7hHXTLywrRLZjdXYvKGxh9bHOMTBNxlJVrt2GFqDxb2AfN +dQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lceDpgpB; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q12si8415353edb.395.2020.12.07.05.42.26; Mon, 07 Dec 2020 05:42:50 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=lceDpgpB; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726498AbgLGNjz (ORCPT + 99 others); Mon, 7 Dec 2020 08:39:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726320AbgLGNjy (ORCPT ); Mon, 7 Dec 2020 08:39:54 -0500 Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13A1BC0613D0; Mon, 7 Dec 2020 05:39:14 -0800 (PST) Received: by mail-lf1-x142.google.com with SMTP id s30so18105175lfc.4; Mon, 07 Dec 2020 05:39:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=haYuw1U4BccfG85AJy6UKy/JEpo0rY/0T3AlACW5eW4=; b=lceDpgpB9ECdPjkXDCjqSD76y2sf7IL7RnMhU+Ifuy7i3KpyVwh2imPRzT0C+BgeYg /iiQm7H6G7jPx9csy3+70wnE1XutohYO7T4sQ08F1D8U0DB7yhYSDTTNKhE0ucw3OafR 2Kl0Kr1g7qI6+yNQEIuz/TprMqtZ0S/HhLi9Ezv61z+GSOn2Q2V3IUZR+Hq+1NxZ+qjI VY8JlFUYxk3S0Hmg14AN6rxEleYI2P+KJILLG6iAWF9GYi6bySFK3jNPYu1lTQjc4+0R uFtcwq+GmqHAo4D7Pnk0YS6NqvVFuz+MYbuNbGEaRWc1EkObGXQXAbE0fctyr+/jQoaR iD2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=haYuw1U4BccfG85AJy6UKy/JEpo0rY/0T3AlACW5eW4=; b=AFeUW+4WaF0s4RL1BezdUcJjZPNVqrnJa67vFX0g5eRnugoh0JNtLd0sa0UpRqpRQM WKI8IWFpUCY7sypyc6rdzjvkF9xn9ckFz0sd5H9r4ZqPXaIqHUIQABjCkVtdSIot0BAp tUarrCTsU5K+d7mvRzD2OpjON/jNc2e2LMC4TRQwFKiGd+lOBmbVkUMaupzXsi2yJ5WZ 4yMOaJWo7VtGxJGSy1qwuZsHjNUPo1k0gkpdGOWRIQAgw8OtlMNgvbPKSy1brYV8upDa 1TMBrqLCf+lPFceWxYvVDPtzESYz4WE/Aaxx9T4PYe7MoIQmycvZVFD8vi0TTMpRK4nW ULAg== X-Gm-Message-State: AOAM533t8hf2lXJuC8ExnJIzoZPLRnUsMR0pQrCrQfj7upiw6iScpEKu ohRjeecSEt2us970BsqDiMm8klbCKhRDl35fXZiohfLXdQM= X-Received: by 2002:a19:384d:: with SMTP id d13mr5444839lfj.548.1607348352610; Mon, 07 Dec 2020 05:39:12 -0800 (PST) MIME-Version: 1.0 References: <20201207113827.2902-1-bongsu.jeon@samsung.com> <20201207115147.GA26206@kozik-lap> In-Reply-To: <20201207115147.GA26206@kozik-lap> From: Bongsu Jeon Date: Mon, 7 Dec 2020 22:39:01 +0900 Message-ID: Subject: Re: [PATCH net-next] nfc: s3fwrn5: Change irqflags To: Krzysztof Kozlowski Cc: linux-nfc@lists.01.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Bongsu Jeon Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 7, 2020 at 8:51 PM Krzysztof Kozlowski wrote: > > On Mon, Dec 07, 2020 at 08:38:27PM +0900, Bongsu Jeon wrote: > > From: Bongsu Jeon > > > > change irqflags from IRQF_TRIGGER_HIGH to IRQF_TRIGGER_RISING for stable > > Samsung's nfc interrupt handling. > > 1. Describe in commit title/subject the change. Just a word "change irqflags" is > not enough. > Ok. I'll update it. > 2. Describe in commit message what you are trying to fix. Before was not > stable? The "for stable interrupt handling" is a little bit vauge. > Usually, Samsung's NFC Firmware sends an i2c frame as below. 1. NFC Firmware sets the gpio(interrupt pin) high when there is an i2c frame to send. 2. If the CPU's I2C master has received the i2c frame, NFC F/W sets the gpio low. NFC driver's i2c interrupt handler would be called in the abnormal case as the NFC F/W task of number 2 is delayed because of other high priority tasks. In that case, NFC driver will try to receive the i2c frame but there isn't any i2c frame to send in NFC. It would cause an I2C communication problem. This case would hardly happen. But, I changed the interrupt as a defense code. If Driver uses the TRIGGER_RISING not LEVEL trigger, there would be no problem even if the NFC F/W task is delayed. > 3. This is contradictory to the bindings and current DTS. I think the > driver should not force the specific trigger type because I could > imagine some configuration that the actual interrupt to the CPU is > routed differently. > > Instead, how about removing the trigger flags here and fixing the DTS > and bindings example? > As I mentioned before, I changed this code because of Samsung NFC's I2C Communication way. So, I think that it is okay for the nfc driver to force the specific trigger type( EDGE_RISING). What do you think about it? > Best regards, > Krzysztof > > > > > Signed-off-by: Bongsu Jeon > > --- > > drivers/nfc/s3fwrn5/i2c.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/nfc/s3fwrn5/i2c.c b/drivers/nfc/s3fwrn5/i2c.c > > index e1bdde105f24..016f6b6df849 100644 > > --- a/drivers/nfc/s3fwrn5/i2c.c > > +++ b/drivers/nfc/s3fwrn5/i2c.c > > @@ -213,7 +213,7 @@ static int s3fwrn5_i2c_probe(struct i2c_client *client, > > return ret; > > > > ret = devm_request_threaded_irq(&client->dev, phy->i2c_dev->irq, NULL, > > - s3fwrn5_i2c_irq_thread_fn, IRQF_TRIGGER_HIGH | IRQF_ONESHOT, > > + s3fwrn5_i2c_irq_thread_fn, IRQF_TRIGGER_RISING | IRQF_ONESHOT, > > S3FWRN5_I2C_DRIVER_NAME, phy); > > if (ret) > > s3fwrn5_remove(phy->common.ndev); > > -- > > 2.17.1 > >