Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp277523ybi; Wed, 29 May 2019 21:13:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqwk/bc9uKC6Za3UA+6ulmnkzj1Y6xdRI+aQwLpA3wS3fs4JyRal7/WMtsv4swBHyhhyoBAQ X-Received: by 2002:a17:90a:9a87:: with SMTP id e7mr1602814pjp.90.1559189606654; Wed, 29 May 2019 21:13:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559189606; cv=none; d=google.com; s=arc-20160816; b=gnaxFMp9fCfAX0WJK4q49en0Um3JFanlJszdXontUXqJDTNmqItWcCzFUsgeaDaQeK wQm64qbd+p3FbaAgbnFiz3TyXwTDSbyNiaecYPHKv9IGYFd7uAorh8nBeW3td3YYcxsn 9tnBllN13sFfUJniVF3/o30EGJ2sPSu4Iph3a7y6o6DphsbzPeQaDy95FEaNinPNN7PF bCZtXB1P9CuqsJo8qJPxTkLF1hmd3e6bxZQwobUxUHUl0ou9E+MzTc6PHkBW7mv65OD6 ++T/3S21u//Dm4Bx9lbFNrFF3o6Mc72lfPtTvK/v3uTrNRV6lAJeCiBfGXRexZm9FOP9 9aHQ== 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=NMuqa92AXz75Xt5MCKflq23Uog/PEEz9ESedGU+D3Po=; b=zad06f+yxuAI1xqNrYppUU3yB97Ice4j57608rBZ6jeOusKL3bKDXoWVPuhP5/kRH8 vbPEj+LtrmHtlEKEj71LxMhyq6Y57KNtHS11gJxZzF0DmwSh1+mfQUDB8z9O+yUUWmNz oLY6ndXE3HjFFsRwcj+daiCTsH+1tC4DLs6opu1h7rvsgbPeuPho4lqmpXTT2DyJFANR F90fqq3ZuuxvPIMXYwJ5MUNPSA89MSWDV2/upy8RVkj0xtzuTcIWdmjY8hYJSVDwS12C T/s1odpDU/ukFF8CM5D0R1OjzeJnqJxMi4RNBjiIxH+aYTvtTmXaBEojiXGUMT74FFsu AyjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lX7Ja1IK; 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 h11si2036572pgi.167.2019.05.29.21.13.10; Wed, 29 May 2019 21:13:26 -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=lX7Ja1IK; 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 S1730281AbfE3EMD (ORCPT + 99 others); Thu, 30 May 2019 00:12:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:43760 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730784AbfE3DQo (ORCPT ); Wed, 29 May 2019 23:16:44 -0400 Received: from localhost (ip67-88-213-2.z213-88-67.customer.algx.net [67.88.213.2]) (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 C801D24628; Thu, 30 May 2019 03:16:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559186203; bh=W3deDqBV973O01uZLmx5KBYNQkKfVaEZ3DxcfVjdSI0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lX7Ja1IKI+WR+qvtuTeKLWTFwpwsugk3xBxB0O9ZdXg9KuDQhHF4GEyLthGtyF61r fmdSeXmRRUB+36c5K9asHSwDNRhLW4Ug+u5+UP77+rpjIvAvQGK0btClbcwnbGgX+9 zj4nZXxAGJPcVOoyPwydACVEnpSwVChDLKrZl//8= 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.19 089/276] w1: fix the resume command API Date: Wed, 29 May 2019 20:04:07 -0700 Message-Id: <20190530030531.802190504@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190530030523.133519668@linuxfoundation.org> References: <20190530030523.133519668@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 0364d3329c526..3516ce6718d94 100644 --- a/drivers/w1/w1_io.c +++ b/drivers/w1/w1_io.c @@ -432,8 +432,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