Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2418187ybi; Sun, 9 Jun 2019 11:15:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqwpPI9eSjf0hDFpehP/JMYCSWTTdzWR/bNFyyQqD3HNY8S9DAvhaLQgZYfel9uBCr0ntIcL X-Received: by 2002:a17:902:830b:: with SMTP id bd11mr15194847plb.202.1560104125632; Sun, 09 Jun 2019 11:15:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560104125; cv=none; d=google.com; s=arc-20160816; b=VeniuaWrMXs9+bFTm5a6m72hz950A9+XYJgF5AoaBgqmZ0nGtvBHgyyCv4yJYbRMII GmAfpoB1ABvoP90oOZ1anwcfHde4OtBh1KjHJwIiYLMDAUT4LyPImHnIicuQdSsEn62j 4NN9JQVgx6XbHuyMv8uXRHvrQ+HOSGIbGZZs+q6LwciOsguz+FDPiNAe5ErHE8BlyyZ1 jhTqZmduOj2TmUYgrq8t8WUEoqpIRLS+gYzPfeHz9oiN4hRLsRk9ylbcu2kl9JRzAevX RPoSdoTbghXOI4a12mgGVeFXooXVc04UcxgLMG+M3/tfylgLZ5PCSllYZcr7CT1QQ3u2 D8Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=T90URuyppik+obOiXXVeJqDO6qvDMgCDhr6ypDI/VOQ=; b=gnj1g/wpjpELFEA70StdeIhQBZCW0rYpcFsWpugCr9OtcYpvudgVlbUCscfsAPJqpq a9+Tx/MixvgWBOS+PMcSEVJ0J/ZTlmHhAirVYqETZwTEfQHnSd2/2IryIndhhC0GSMx4 uhTq0klc5wwCveCfMvQCbsl0SgD0VLrWZW43yi5Pqe8nJNjvalBSYjkCsDhhPh6ax3K8 MeL37VE/W2b4zhE4J+CQIdDNDLOu8OQbS2pOnzUerrIIzVP0ohkE4AvYnTB2kgf4xZ9d oCDF/ocOMH297Rbjdo7B8xT6ZtIL9MKm8+tdo85nZZTti8/Wu1h105cmUwWVp2Pd6yVu FhbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BWZluH0V; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o16si6412662pgb.48.2019.06.09.11.15.09; Sun, 09 Jun 2019 11:15:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=@kernel.org header.s=default header.b=BWZluH0V; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387793AbfFIRAK (ORCPT + 99 others); Sun, 9 Jun 2019 13:00:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:36356 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733060AbfFIRAG (ORCPT ); Sun, 9 Jun 2019 13:00:06 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 62015208C0; Sun, 9 Jun 2019 17:00:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560099605; bh=/S59m0CzpcjCSiQrTxnr1llmebHj+C0q8Wm5C6GKvZk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BWZluH0VDlRiUC8bZqC68dK1GXMH0U1zjg1bB03+TLrQetGXYauMm+xuO9REi2iT7 bsKyalAdpgfKmZaDAxnE1tfeFzNMcIbpL/T7psiJFDM//gx2YDx2xV8UjhgQXDtm2f 2vqAT4TywR8TDWG1MXPFi5fWTdtTF8NlC6KXsNTM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mariusz Bialonczyk , Jean-Francois Dagenais , Sasha Levin Subject: [PATCH 4.4 101/241] w1: fix the resume command API Date: Sun, 9 Jun 2019 18:40:43 +0200 Message-Id: <20190609164150.710401945@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190609164147.729157653@linuxfoundation.org> References: <20190609164147.729157653@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 62909da8aca048ecf9fbd7e484e5100608f40a63 ] >From the DS2408 datasheet [1]: "Resume Command function checks the status of the RC flag and, if it is set, directly transfers control to the control functions, similar to a Skip ROM command. The only way to set the RC flag is through successfully executing the Match ROM, Search ROM, Conditional Search ROM, or Overdrive-Match ROM command" The function currently works perfectly fine in a multidrop bus, but when we have only a single slave connected, then only a Skip ROM is used and Match ROM is not called at all. This is leading to problems e.g. with single one DS2408 connected, as the Resume Command is not working properly and the device is responding with failing results after the Resume Command. This commit is fixing this by using a Skip ROM instead in those cases. The bandwidth / performance advantage is exactly the same. Refs: [1] https://datasheets.maximintegrated.com/en/ds/DS2408.pdf Signed-off-by: Mariusz Bialonczyk Reviewed-by: Jean-Francois Dagenais Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/w1/w1_io.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/w1/w1_io.c b/drivers/w1/w1_io.c index 282092421cc9e..1a9d9ec8db4df 100644 --- a/drivers/w1/w1_io.c +++ b/drivers/w1/w1_io.c @@ -437,8 +437,7 @@ int w1_reset_resume_command(struct w1_master *dev) if (w1_reset_bus(dev)) return -1; - /* This will make only the last matched slave perform a skip ROM. */ - w1_write_8(dev, W1_RESUME_CMD); + w1_write_8(dev, dev->slave_count > 1 ? W1_RESUME_CMD : W1_SKIP_ROM); return 0; } EXPORT_SYMBOL_GPL(w1_reset_resume_command); -- 2.20.1