Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3627008iog; Mon, 27 Jun 2022 22:12:07 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uR0Y8DuV7NTGKWrZ55iKkkzL5MAi1O6JtB5e7B1eP3ycYy8yBDZTx3g6ulEi+KEg9uat/g X-Received: by 2002:a17:906:4fd3:b0:726:2b29:9fb with SMTP id i19-20020a1709064fd300b007262b2909fbmr15627591ejw.370.1656393127444; Mon, 27 Jun 2022 22:12:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656393127; cv=none; d=google.com; s=arc-20160816; b=0o7b2QWaMH2MxpTBz8k5xqzYHx0dnxNrcjwBpkofAiGxrKmK9p962Lp/ZXvtBOS0zS 9599HFbeB3KQnXWSh9GVg7uosHajubUt8ZiIl8fcLTtbru+TqmvDfL2D5ZW5D31r56mJ Bfcy0f/IHWQD9Zn6ecqR9KFd5+Z7XQsORiS9pog0FGq9WobeQqP+R5bhkTQLu+XJPcBd xJG93m411wPd9qH3tqOydryQ52p2VfDrN7Fc+JRrOlZeckPy+hp9WGHn5XFt/kA6wXN5 o/wmM25pwetTOlKoRt4n46qgiJGX8lgFZzdeUYwD0Tdnc2Y4dY+IQaJothIxB/81Ra1J 9O1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=s/7UWRYpLNUITYD4Wah1llQ/DrnlsZ0gFSv13KA7h6M=; b=GIan1MPePIMikG8E5+ekMt9bMBdXPMQsovv5Qrnu/Ryw3wM21E4xMiydr2Oo2Oa8l6 MSI6wv9bcoESDvpBx0TkfNoSoYW1YBXp1OQkUGv6aLQUjyOPEcpndEr8zZn1VCTN93en 9vhKaKGM779Zr4Z2nQd701ClqrjCzrIian/eoU1LMTgrSklH13ZH23FTyClKt54cY7qZ tcLs8CuifuiiMVI9yseEOKs8sZJuytXjyTM8ZsWQ0OicHebeSAXwrNzqjfdEHZdLfkyd jJb0hiomKq2PymwKohiJJxKdHk4AYiWOLxiTp/KlbD4S5kbOqBF2r/Gvnx38cHK9wCwN 3mZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=W4rXtpZH; 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 z20-20020a170906715400b006f3a0ad9695si11820366ejj.81.2022.06.27.22.11.41; Mon, 27 Jun 2022 22:12:07 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=W4rXtpZH; 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 S244693AbiF1FD0 (ORCPT + 99 others); Tue, 28 Jun 2022 01:03:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244642AbiF1FDX (ORCPT ); Tue, 28 Jun 2022 01:03:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D8122658; Mon, 27 Jun 2022 22:03:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DEAE261780; Tue, 28 Jun 2022 05:03:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 063E4C3411D; Tue, 28 Jun 2022 05:03:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656392602; bh=s/7UWRYpLNUITYD4Wah1llQ/DrnlsZ0gFSv13KA7h6M=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=W4rXtpZHkv38bXRfm/+E02LvOynFeIny21L3ij7CYmF5SWwGyosG5jhvShp4G2GCu evXFmVMlFkEnnG/FDzOGI+rB9pukBEXli4LLapSxuEATLZL9Zl7ywX4atOvGQJHVQk GxYEYCOAASu2+/GYJSD/5Mjhg8DwwyV3sksfc+ADVtKNO4A5SYxSGL/C8ne89noPtT n8tUQJ5PhNupwxjWME/lfXlJ8ctVfnDGWTjhHY1+2uO1+W5JUjQztDUPIny2+bHmAz QnGFymwIg273ShSsvy0BhKWYAr28DBV6e3+HPBz6TDp9K2BIek+IfgIHL14Z6wuAEc afa1RHIwC/2iw== Date: Mon, 27 Jun 2022 22:03:20 -0700 From: Jakub Kicinski To: Michael Walle Cc: Charles Gorand , Krzysztof Kozlowski , =?UTF-8?B?Q2zDqW1lbnQ=?= Perrochaud , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] NFC: nxp-nci: Don't issue a zero length i2c_master_read() Message-ID: <20220627220320.29ca05ec@kernel.org> In-Reply-To: <20220626194243.4059870-2-michael@walle.cc> References: <20220626194243.4059870-1-michael@walle.cc> <20220626194243.4059870-2-michael@walle.cc> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Sun, 26 Jun 2022 21:42:43 +0200 Michael Walle wrote: > There are packets which doesn't have a payload. In that case, the second > i2c_master_read() will have a zero length. But because the NFC > controller doesn't have any data left, it will NACK the I2C read and > -ENXIO will be returned. In case there is no payload, just skip the > second i2c master read. Whoa, are you using this code or just found the problem thru code inspection? NFC is notorious for having no known users.