Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2422049pxu; Mon, 7 Dec 2020 06:17:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJzIyHcPpS+yiDCNxf0qTAiQVx3DHw0KEjMSjgx7tA5QKw7XCPskuCdDp3Eie9eAQT0vA7y9 X-Received: by 2002:a50:fd88:: with SMTP id o8mr20401890edt.386.1607350677895; Mon, 07 Dec 2020 06:17:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607350677; cv=none; d=google.com; s=arc-20160816; b=KgAZPS1Tbxt8ur2Fa+M7mTj5G4aZPGiU6FfUdzNXbOM9X6VYAvPxv4fiML2djnJh/3 lmOkn/PS3lNvpUfl/lQUqzlp5D7Cf00C44keTqS94Oee6WQCUInvc9Bg5sGDXfVvHeJV O+EP7YrZnerdG8aJftUEknBjPXBZJXW/+iQOtaLzKUVIGRfEkQWbWakXUyUITxBB8oUh I9ZeBm9WuvYawVXxx8Xju+l+cQUjzQh9d2hISvnUppqMxxZKYicw8At1wIUOP6xYcrQv G648tCd4atmWn/odBlrainV+Ua35DsIcdvkW1JBFiTemHUpJBxIGrM1DTYgE9x74Jnad wt6A== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=gG7VgUZtjX4oofV7gBPwji7WUqiGnJQzMVNQgM8p0KI=; b=n4IpTa6E2o9F5KVr5e9BA15YgXaIDNuOym2ajoGqtK9pabg0PS+lxGZu/vpOHxHK6I sOXB14sZOXM0OsRxCt9ikG+r2sm6ZwMzmXePLtSdeJDRa/ORr1yaGy3BtiER+ZB9qtxM yX0511DxOTMQoMwHMIoI/coxG/LCKAocSed428czJrnfdy5y8ih9rlNRxBfU+ZUC6IXW kqIDrmy9WKMMxV4ilYjW567fObXJVg19OLMwKjHfxiotBpSm4sqxdDj20E3PtdXe5WKB toSXH/JeKH0qWUtQd1xYUD4W0KPoEmjFGAvqsd95yS2ezuzwh8h9wqtf+oLJhncgqwfF 5Lig== 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id pw16si6436927ejb.430.2020.12.07.06.17.33; Mon, 07 Dec 2020 06:17:57 -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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726412AbgLGON4 (ORCPT + 99 others); Mon, 7 Dec 2020 09:13:56 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:34379 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725770AbgLGONz (ORCPT ); Mon, 7 Dec 2020 09:13:55 -0500 Received: by mail-wr1-f67.google.com with SMTP id k14so12924787wrn.1; Mon, 07 Dec 2020 06:13:39 -0800 (PST) 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=gG7VgUZtjX4oofV7gBPwji7WUqiGnJQzMVNQgM8p0KI=; b=ezMlb7Ga7t9M6AwPYfev/SUnfIJ/AEYtRJXq83YANQloZMdCxp+MGh2kGCIKh6E0JY mM1ufDMlyE5NipQVqgd2FNbKsA9ZewCZ0iD8g0JavMnE0Lz7hOlcO1ah/GR1Zv4DEg0l i+sHlJmFGgfygdfJyFEJPCvEhkJjg/7NZvfyDFVE0bbVfBsoMF4W7mW6JfVmWl3DrWmb e9CcYiPvT0Ra399/apuhY405v4cRBIx21HYMl7XSvbOtSIJfoMAZyJ8mbWcl0PUtMK8x YFXRh+CuRhC9rWCmNmldyDc6P92Y6vttL+Ej5FMFjiCS5Gs07Q5OOxxGl6FNYmGk08Ec 120w== X-Gm-Message-State: AOAM532/xDX/JEew6rYFJjl07elYif6K/D9IfNNHPS29JBp/AoRNR20i QhrD16uauq2kv9Q6WpXfvUw= X-Received: by 2002:a5d:4349:: with SMTP id u9mr19326981wrr.319.1607350393759; Mon, 07 Dec 2020 06:13:13 -0800 (PST) Received: from kozik-lap (adsl-84-226-167-205.adslplus.ch. [84.226.167.205]) by smtp.googlemail.com with ESMTPSA id z11sm15491704wmc.39.2020.12.07.06.13.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Dec 2020 06:13:12 -0800 (PST) Date: Mon, 7 Dec 2020 15:13:11 +0100 From: Krzysztof Kozlowski To: Bongsu Jeon Cc: linux-nfc@lists.01.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Bongsu Jeon Subject: Re: [PATCH net-next] nfc: s3fwrn5: Change irqflags Message-ID: <20201207141311.GB34599@kozik-lap> References: <20201207113827.2902-1-bongsu.jeon@samsung.com> <20201207115147.GA26206@kozik-lap> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 07, 2020 at 10:39:01PM +0900, Bongsu Jeon wrote: > 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. All this should be explained in commit message, not in the email. > > > 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? Some different chip or some different hardware implementation could have the signal inverted, e.g. edge falling, not rising. This is rather a theoretical scenario but still such change makes the code more generic, configurable with DTS. Therefore trigger mode should be configured via DTS, not enforced by the driver. Best regards, Krzysztof