From patchwork Tue Apr 4 06:16:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 96671 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp47963qgd; Mon, 3 Apr 2017 23:17:13 -0700 (PDT) X-Received: by 10.99.8.67 with SMTP id 64mr17200222pgi.220.1491286633220; Mon, 03 Apr 2017 23:17:13 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m188si16434436pfc.145.2017.04.03.23.17.13; Mon, 03 Apr 2017 23:17:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752458AbdDDGRM (ORCPT + 6 others); Tue, 4 Apr 2017 02:17:12 -0400 Received: from mail-pg0-f54.google.com ([74.125.83.54]:36557 "EHLO mail-pg0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752416AbdDDGRM (ORCPT ); Tue, 4 Apr 2017 02:17:12 -0400 Received: by mail-pg0-f54.google.com with SMTP id g2so140786933pge.3 for ; Mon, 03 Apr 2017 23:17:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lRttNU9zl7m+OOHtrXYozdnODA3bc/VkKLtfQ5BIhq8=; b=O/8ZoCkHa7ADkOOrNetgSEW2WdnPcof55GyKyB8xklXX4HGuZ4iDL9IL+UqibAymxI CuOT6uiKw803I8uTayof+e3H214TpQuL62KKXDNxPEwrSmeOuclQIpMtbSe+OTGgGyz1 5e7QS5F0A+jq2uUnJdORtzXKNuXEt093iEbpE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lRttNU9zl7m+OOHtrXYozdnODA3bc/VkKLtfQ5BIhq8=; b=SKBN2Z8RYV3MMRmHKdAP8zckJnfpt+Ka3XmX5WckYnmxCSDqzGwKWQoOxOcPSW1BlA MFniYV9fAriyBNZM9Rz5LWXTXTZyL+OPolUjiSk1urVgKTh0F6OeIxp2UpgVj5jfn9Vq TSNKQE7MY3HUAcJOYNjsFtBRtOOfWes694AeRuTc1EbfbhnHsUSY/UIhxJAcmTIrTj03 buyUv0GC78csY4Mh5SyVbiH/x2mgYPtYVQNqKBfDybBPjTWKLGgUvv7q/2iAOPn8RTt0 S5xqfvURomP8NMOEHySMiI1A8y0WdtDG+WdRVCeYnHBn4plnDsLb1ub17AwQAx4bmQlc We4w== X-Gm-Message-State: AFeK/H2DsdlFeuOEr7G/Vt/1oSJPFJte0blrJy0KZ1HzMLaPjPBOVAlj7DVGmCNL/InXCWnG X-Received: by 10.99.6.66 with SMTP id 63mr21280224pgg.83.1491286631391; Mon, 03 Apr 2017 23:17:11 -0700 (PDT) Received: from localhost.localdomain ([106.51.240.246]) by smtp.gmail.com with ESMTPSA id f81sm29247068pfe.61.2017.04.03.23.17.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 03 Apr 2017 23:17:10 -0700 (PDT) From: Amit Pundir To: gregkh@linuxfoundation.org Cc: stable@vger.kernel.org, =?utf-8?q?Noralf_Tr=C3=B8nnes?= , Wolfram Sang Subject: [PATCH 09/33] i2c: bcm2835: Can't support I2C_M_IGNORE_NAK Date: Tue, 4 Apr 2017 11:46:57 +0530 Message-Id: <1491286617-31131-6-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1491286617-31131-1-git-send-email-amit.pundir@linaro.org> References: <1491286617-31131-1-git-send-email-amit.pundir@linaro.org> MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Noralf Trønnes The controller can't support this flag, so remove it. Documentation/i2c/i2c-protocol states that all of the message is sent: I2C_M_IGNORE_NAK: Normally message is interrupted immediately if there is [NA] from the client. Setting this flag treats any [NA] as [A], and all of message is sent. >From the BCM2835 ARM Peripherals datasheet: The ERR field is set when the slave fails to acknowledge either its address or a data byte written to it. So when the controller doesn't receive an ack, it sets ERR and raises an interrupt. In other words, the whole message is not sent. Signed-off-by: Noralf Trønnes Reviewed-by: Eric Anholt Signed-off-by: Wolfram Sang (cherry picked from commit 8d2cc5cc6ee5c0fc48a96bb29af55fc700f66fdf) Signed-off-by: Amit Pundir --- drivers/i2c/busses/i2c-bcm2835.c | 4 ---- 1 file changed, 4 deletions(-) -- 2.7.4 diff --git a/drivers/i2c/busses/i2c-bcm2835.c b/drivers/i2c/busses/i2c-bcm2835.c index 54d510a..565ef69 100644 --- a/drivers/i2c/busses/i2c-bcm2835.c +++ b/drivers/i2c/busses/i2c-bcm2835.c @@ -212,10 +212,6 @@ static int bcm2835_i2c_xfer_msg(struct bcm2835_i2c_dev *i2c_dev, if (likely(!i2c_dev->msg_err)) return 0; - if ((i2c_dev->msg_err & BCM2835_I2C_S_ERR) && - (msg->flags & I2C_M_IGNORE_NAK)) - return 0; - dev_dbg(i2c_dev->dev, "i2c transfer failed: %x\n", i2c_dev->msg_err); if (i2c_dev->msg_err & BCM2835_I2C_S_ERR)