Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1145173pxv; Fri, 9 Jul 2021 19:26:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9nbAB7fVmXFGd3caj1ScjrDaQJRduOBcPPUJQzCTbelIe+xkVm8KN8hXGvVAI5xXVyt4W X-Received: by 2002:aa7:d747:: with SMTP id a7mr41864054eds.288.1625884014147; Fri, 09 Jul 2021 19:26:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625884014; cv=none; d=google.com; s=arc-20160816; b=r8fTiqGwwClD6u427LXTflYYSVq+nxAqZhCza+PGaAg3udUp96DAyGakKBzhbQ9UGs CEsREtQ32h9Cb0u0qRww83KQx8h1IpvYXiF7nEJiH83KBlwc7mSTL+441QLStzBaiyRS PKPU/5T7xh6JG2J+W0SJ6YDNhqduWN7yplk8UQiVtyioqHYnjcvzcHpBNT/iDFIf/8Do qZfGLnPYzYmvFdZ4qsmRtsnfXCiiJQsuy6G5C56DGhIHZUP51F+DvfoX78rASGtOOaFg OwPaIUe0m4DXjT6SNzhA9dyCfY6LGoAUd6MG5jaiSLUUJmelS0ESRzkynMhruqJXc2XH nw9A== 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=yIRm+WFsM5kCPwHasJJrp4dX9iz+zZtGsrKCBIr+lFU=; b=ghevUTXoVgdWAPwyBJ5BntZzlo3NpA8OFUwoMBTUojtzEcOev4eexG2xza5n52NQ4+ Mvh3VqXeJaBHpRgAEAVTTgruwxv4cixKPnTaqOP6++yelkX0Hbu/SLOsTrzFKQuzjnVO Ep1yLvuH4kXWOKlFhD4gw8vaKGrmvXG3V3sj3VEYIxXeM96tFPaA9Zbj1rrzfJioo1LU QWa4thE107lDu1LSUAK4wrH0cle+3NSy5vYXqIpbLnzrmfVg0FVL9Xor1ytE3K2csbL5 z1vcu8b47hV8ggA4o/eXuy8WHq43Yh0WkGuN3v5SI03ruRL4CmUd8o5qfC14PWiHDpff Izpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QE1e+2lP; 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 bh21si9137920ejb.428.2021.07.09.19.26.31; Fri, 09 Jul 2021 19:26:54 -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=QE1e+2lP; 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 S233295AbhGJCZn (ORCPT + 99 others); Fri, 9 Jul 2021 22:25:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:42114 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232102AbhGJCZK (ORCPT ); Fri, 9 Jul 2021 22:25:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0AF22613C3; Sat, 10 Jul 2021 02:22:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625883746; bh=O9+YOua0G9KnyA2M8OLH87WPhPFNQl5D35Y7gWGQ2s4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QE1e+2lPiUWDEsZROfb0OrCWZbT5wl1CDxu/KYdesr5/3dc0SLmTzlzvEmgwe5PRZ /9NVZ/WAWP5S4My8D/EmIe4SO+DHf19f0F2+wnOPFrduuCy4ZIZDhdi8EZ7OVQbDdJ h6JlCgvG7AWGcszQaD+yeV4/x8Fhgmz4WhZyIepiToDbXKeQCkUykArN/fpwSxukkm WvIxOceB2muewIBz7K0QdCnWgusbmZ2drt+i6vaLhUX4uAds2FeCfY0FwlDi0B9xk0 goxWKc3WwQEx9cllfWaq+R04gc+OmbmEiUdX0XF49hR0M8+Dmr+Y+EO+uTg94Xa4Cr +9+Fz5zFA3eBg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Luiz Sampaio , Greg Kroah-Hartman , Sasha Levin Subject: [PATCH AUTOSEL 5.12 023/104] w1: ds2438: fixing bug that would always get page0 Date: Fri, 9 Jul 2021 22:20:35 -0400 Message-Id: <20210710022156.3168825-23-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210710022156.3168825-1-sashal@kernel.org> References: <20210710022156.3168825-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 5cfb0ae23e91..5698566b0ee0 100644 --- a/drivers/w1/slaves/w1_ds2438.c +++ b/drivers/w1/slaves/w1_ds2438.c @@ -62,13 +62,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