Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1150076pxv; Fri, 9 Jul 2021 19:36:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYKEcPhCuCB5PEwkovjKffpq4IqyqXu3Y/+JUVf0SKUkVsr26Sfk7Am16o5qHPxh2oP9dJ X-Received: by 2002:a05:6402:1809:: with SMTP id g9mr15010edy.42.1625884619347; Fri, 09 Jul 2021 19:36:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625884619; cv=none; d=google.com; s=arc-20160816; b=FNzFckRNamOf0Dzy4sS15WR7XiHTg/FKXjwV+bWWlbEPYaKw5Ds6vjHl8E0hWc4B/k pAWu7VoMmjKMbp7hEsiME7Pe3mHG3oAxr4HaF5Q/NptiNFKLyQctZoJ2lO6szwWhEUpG KgHUb7UxDL1iY/E8PFsGheJFQSzaB6BghwKMbvT+5wxyjOv6QF31NUXVSlcHgIOiVniH W0H5urc8zDVxv2xLigX43Lfpz2Ieo289fy99tnHsffNR8zxS46OBs7mVZYEVcnTcRUnO N4DI+tY1Bl91TJsdb02RTaio8q71BcnAIxKmFdO3bJoeAuWuD9TXH9HNVPOJRv4LJW7d wInw== 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:date:subject:cc:to:from :dkim-signature; bh=HoFkvHlLjpJ1TFq59cZT8KTZV5JAhcUk4NAGn/l7Dt8=; b=oXIjmhnfpVtXP6c/lSsBMNGSr3XUdEGUT43cOnE+bFLYU22+G3JI9TXjgP6pHpC+Yh SM/aYVnPWcHniOmbnQ+5D7UzBI6w9on4FZPQUkf87d78eq2ZuJ5TqhY8MjcaDoLuSPNM cMIT5bB/UuwRiZo7rNKD6P6APDpyuIvZPeurMRJ+C+YLqf++1AudAwH0Y9/d+cCRldkg Dc9TdrOTgN6A+TOTJAH85GHwTTV5P2z/O5crSpOOfjC5R+FiFCWCSR+dUtrdvWpk7VyY isoRiMJvRykG1328R6N9ZlDxXHTW4pbZM0Bu1jnjNGmo1JqrSmYA7TYKb7O0HqRIzNjB pDEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eoZqml69; 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 g18si9384358edw.9.2021.07.09.19.36.36; Fri, 09 Jul 2021 19:36:59 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eoZqml69; 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 S233904AbhGJCi3 (ORCPT + 99 others); Fri, 9 Jul 2021 22:38:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:53348 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235692AbhGJCe7 (ORCPT ); Fri, 9 Jul 2021 22:34:59 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1DE9061409; Sat, 10 Jul 2021 02:32:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625884329; bh=AaxiyUJgb/wWIUCoEmwa22p47FjVGGBCNWT7ikz188s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eoZqml69rP3s0NZtOAPANtuSc9bbzUoyKMspHmwI/8gm3QwASPnPt9QvCi2D4woTY DHCh2wNn2wX5ivro0uKtCSPpzOnkMltc/FZeuT1cKXylQPniFP/0ZfjOcLbsJFlwvA D5u46j9JGPY9vDloE6VfSRJQs1DKtE23CfEDiBoR3zrSThvZoMPUBd5zXFKHRKYLmU jlKdVdMY+ZExZgToVdEyDSaQJqnkdNly3TrhNWnwebw/PensiPeyf/pnaX7Z+8Cenn WdxbboqocGuRV6JdZ6vPQr5+gVL5USSR3Jf9Ysh2uypRak7LGqMz0xHyRLgE9kYCvn 4jDkhbP95oMYA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Luiz Sampaio , Greg Kroah-Hartman , Sasha Levin Subject: [PATCH AUTOSEL 4.19 04/39] w1: ds2438: fixing bug that would always get page0 Date: Fri, 9 Jul 2021 22:31:29 -0400 Message-Id: <20210710023204.3171428-4-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210710023204.3171428-1-sashal@kernel.org> References: <20210710023204.3171428-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Luiz Sampaio [ Upstream commit 1f5e7518f063728aee0679c5086b92d8ea429e11 ] The purpose of the w1_ds2438_get_page function is to get the register values at the page passed as the pageno parameter. However, the page0 was hardcoded, such that the function always returned the page0 contents. Fixed so that the function can retrieve any page. Signed-off-by: Luiz Sampaio Link: https://lore.kernel.org/r/20210519223046.13798-5-sampaio.ime@gmail.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/w1/slaves/w1_ds2438.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/w1/slaves/w1_ds2438.c b/drivers/w1/slaves/w1_ds2438.c index 7c4e33dbee4d..b005dda9c697 100644 --- a/drivers/w1/slaves/w1_ds2438.c +++ b/drivers/w1/slaves/w1_ds2438.c @@ -64,13 +64,13 @@ static int w1_ds2438_get_page(struct w1_slave *sl, int pageno, u8 *buf) if (w1_reset_select_slave(sl)) continue; w1_buf[0] = W1_DS2438_RECALL_MEMORY; - w1_buf[1] = 0x00; + w1_buf[1] = (u8)pageno; w1_write_block(sl->master, w1_buf, 2); if (w1_reset_select_slave(sl)) continue; w1_buf[0] = W1_DS2438_READ_SCRATCH; - w1_buf[1] = 0x00; + w1_buf[1] = (u8)pageno; w1_write_block(sl->master, w1_buf, 2); count = w1_read_block(sl->master, buf, DS2438_PAGE_SIZE + 1); -- 2.30.2