Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1121226ybl; Wed, 4 Dec 2019 17:28:07 -0800 (PST) X-Google-Smtp-Source: APXvYqy8cfUfT5qiuVJLYO21ZNPsYoYDowzK4C+O7xXhuySiQ2qzlHmkzHs1v7S1K8nS+wnPW/3b X-Received: by 2002:a9d:6395:: with SMTP id w21mr4956165otk.3.1575509287219; Wed, 04 Dec 2019 17:28:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1575509287; cv=pass; d=google.com; s=arc-20160816; b=XPicZpYW/1d0HxPD6FVYjGGKO9rrwf7AGHXLmZWXjZgU8xBtLwvPqkrQmnM76bDngR BQoJ+gr/QIoi3KxYmkjUfwc3nQfdlTsYFjR+ekawNqOJm6/K4tW6BiBfhpSrH4BENDNq I+vsdCt5HxUEpKXWHPZa8klTvhTbptZqj5/RVoJDaIEWB4I+zMdaxFub2d4vHbKv7iok /n6qWgGcvaLeHcZZ+wVeBeJQQ1ULGxNf0Qw0KGbiNP+ZRZLYmoRO+bL/l2skfWwCu9Ii qI3vedRr6Nn48rx5DKjtOvXUPjxACDNeGDNeHkbxT9+nyVrAe2Rq+NZWCxwTLb6UlOlN jjrA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=ZC5wJF7MyeH/DTVQOW7m0Z0ZnMZHJtUHAFEMZ4f32u8=; b=tg4hOAtdIsJo8XpT00Gd0vFj6cwz/89xv2/sQ2A60hgVMCRF9yX1CzsndmDvXiZT0o f1fg1QyUnVkkj4GGLbNSLQ1aj07zvY+X8IqxpFAT/eKwteglgGEhLF3TwoBOZhA7U37k JZFBoNjWCkzaWzQvaJ6HRtLydZN3ZJuKfSZtY1CQD2GCxZwUSUs6UxY7vBv9trQ4NF8C 9fHNNO0oFFTUHw8VxHt3mgHnLlqAP3NOZDbqTdOr7xLFWYi62ZkjxBK1lwPbB/dG2uBg sUke1DkQMbwEcRGww5vV5dQSQ3I542R3XS/gnQyPPaC0eAiA1Rj3+mVGmfOxD774zQNl qTpg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=Kug19nlq; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s206si4201131oib.73.2019.12.04.17.27.54; Wed, 04 Dec 2019 17:28:07 -0800 (PST) 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=@nxp.com header.s=selector2 header.b=Kug19nlq; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728459AbfLEB1Y (ORCPT + 99 others); Wed, 4 Dec 2019 20:27:24 -0500 Received: from mail-eopbgr130049.outbound.protection.outlook.com ([40.107.13.49]:47590 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727146AbfLEB1X (ORCPT ); Wed, 4 Dec 2019 20:27:23 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jdCec1T0EzTpZJIHfrngVSHtlfKL5dpOj6F4Dac0UruiYp30vHJCw+hRAjjpAJVUn1gHYKrqJHHPL4vfgiaeGKsrBpKpXl0u2/pPOD9H+nTeuOX/hmCnM3dDgiCxiORbGEepRN4Agyn+t4D9nsu0QC3e0BPlXtgOKpMhBm1vxtEpMw/UNvJ8N8MN71z1ymuNRF+y7wQmLxxIgseEshODbQ/dcm6H/LdNKP2NSrL5WyqWEhfbZuZfAdMg4sSfiHQiipNJylkctyt9w/7aRE8P2RpBta8RicPnjHh2Z5NjH+jRU1edPufJC5o6s8pmm63r2EnLU5JLtftoMHCWE78geg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZC5wJF7MyeH/DTVQOW7m0Z0ZnMZHJtUHAFEMZ4f32u8=; b=J2sKmkgF18HwYy5b1OU3IRi86b74zdqbB6qyHJEkUFZHLOQPvSNzbQwY+XqntZBLkiu4m3cNiqYLXw2GOeyPyUEbEJWh7wGSE3cpr3eqUa5Epe/6BhFWkkEqgN3voTdVDzyDdiaRCWLxwDTqA7gdEYDLU8ffABB74uqj0Tka9MPK07fmgR4X7n1nDGkNAZEA/hgw0D0lRCylzVWJ7bnOy6BOrj1POVYSnaM6tDXTxyj0P9+eTI7Pa48pX/CYal/J4X0GdoNOS4I+HZYlY98+1bQX5lDKZ3O98SlM1XWJ4qvKvdm2pUma3Zx72C7+LD3HAD4b2Yq8LMzmZ44wG4H5iQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZC5wJF7MyeH/DTVQOW7m0Z0ZnMZHJtUHAFEMZ4f32u8=; b=Kug19nlq+IC6O101JkN0xScRiQ4GN0o+6b9m8ZZdjLbT280LL8ffXx3YRS+Ej3eDqWDuJCMbGw8syQ9Q499o2g1DsJyLgwzoPrvtCOq6j/B4NTY9ywOjPwDf1dCsbcLCB1XrAgIHrALBQKjX7Y0wkLasUFD5SJsl72LLp7CBpuA= Received: from VI1PR0402MB3600.eurprd04.prod.outlook.com (52.134.3.146) by VI1PR0402MB3823.eurprd04.prod.outlook.com (52.134.12.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2516.13; Thu, 5 Dec 2019 01:27:19 +0000 Received: from VI1PR0402MB3600.eurprd04.prod.outlook.com ([fe80::30e0:6638:e97c:e625]) by VI1PR0402MB3600.eurprd04.prod.outlook.com ([fe80::30e0:6638:e97c:e625%7]) with mapi id 15.20.2495.014; Thu, 5 Dec 2019 01:27:19 +0000 From: Andy Duan To: Peng Fan , "srinivas.kandagatla@linaro.org" , "shawnguo@kernel.org" , "s.hauer@pengutronix.de" CC: "kernel@pengutronix.de" , "festevam@gmail.com" , dl-linux-imx , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Aisheng Dong Subject: RE: [PATCH] nvmem: imx: scu: correct the fuse word index Thread-Topic: [PATCH] nvmem: imx: scu: correct the fuse word index Thread-Index: AQHVqmb3nxYwp0MksEa8htHeEretqKeqwU1w Date: Thu, 5 Dec 2019 01:27:19 +0000 Message-ID: References: <1575438591-12409-1-git-send-email-peng.fan@nxp.com> In-Reply-To: <1575438591-12409-1-git-send-email-peng.fan@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=fugang.duan@nxp.com; x-originating-ip: [119.31.174.66] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: b958a537-4dff-4353-8325-08d779224564 x-ms-traffictypediagnostic: VI1PR0402MB3823:|VI1PR0402MB3823: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6430; x-forefront-prvs: 02426D11FE x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(4636009)(39860400002)(396003)(346002)(376002)(136003)(366004)(199004)(189003)(6246003)(9686003)(55016002)(8936002)(81166006)(81156014)(478600001)(99286004)(3846002)(229853002)(6116002)(110136005)(4326008)(14454004)(8676002)(54906003)(7696005)(71190400001)(14444005)(76176011)(71200400001)(316002)(2201001)(6506007)(5660300002)(186003)(25786009)(102836004)(26005)(33656002)(86362001)(2501003)(66446008)(7736002)(6436002)(66556008)(76116006)(66946007)(2906002)(64756008)(66476007)(74316002)(11346002)(52536014)(305945005);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR0402MB3823;H:VI1PR0402MB3600.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 0u9L2VLtPj7YaJaHaPSS3vKwjlkbBt7mWmwT8GZWG1ZoQoa8zddBZId/XHXixHgDd0T/v2/ovkETiqtdwBFVP3cBiQq7AvOSV3ETux8xeyE8w1NSSu2nlm4OJlhDJYO/utfT1SgRvdgwnqKf8bIB1udiE65XGPl1zeKvFNBVkKsEpPAKyiilLovGaFRm4gCI3FChcwREqGVPgkVBZlJkMgfvDEIqKxpCE/hkz2Rr/362aIUg7yK9yGUJT2xRpFkhirgopvhCdlQLkMvmUW7mN02SsVcDtXJC0OI4tl/lvjxeSTyQURE6wZBb7g8LpPIjJZkFu5mkQjHd5hVDqQdsQirXS/S1k0CEljZA8Pyqgy+5gxVz4weYA+ADR+RQs/CeU1ScsA8vAa8HGJeoq+UyH3NNQ9Gacs/vat0dGtLvNuz96HMIy7PmJFeelPsGEhId Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b958a537-4dff-4353-8325-08d779224564 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Dec 2019 01:27:19.3949 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: rrjiCBtYSht+JC5it5xOWssMJVQ4wGNLSeS54LpW2QXuyEyFs79Qh/kKQi50UxVdV7tbZQ+t26vybKJpWuznPQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB3823 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peng Fan Sent: Wednesday, December 4, 2019 1:52 PM > From: Peng Fan >=20 > i.MX8 fuse word row index represented as one 4-bytes word. > Exp: > - MAC0 address layout in fuse: > offset 708: MAC[3] MAC[2] MAC[1] MAC[0] > offset 709: XX xx MAC[5] MAC[4] >=20 > The original code takes row index * 4 as the offset, this not exactly mat= ch > i.MX8 fuse map documentation. >=20 > So update code the reflect the truth. >=20 > Signed-off-by: Peng Fan Reviewed-by: Fugang Duan > --- > drivers/nvmem/imx-ocotp-scu.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) >=20 > diff --git a/drivers/nvmem/imx-ocotp-scu.c b/drivers/nvmem/imx-ocotp-scu.= c > index 455675dd8efe..399e1eb8b4c1 100644 > --- a/drivers/nvmem/imx-ocotp-scu.c > +++ b/drivers/nvmem/imx-ocotp-scu.c > @@ -138,8 +138,8 @@ static int imx_scu_ocotp_read(void *context, > unsigned int offset, > void *p; > int i, ret; >=20 > - index =3D offset >> 2; > - num_bytes =3D round_up((offset % 4) + bytes, 4); > + index =3D offset; > + num_bytes =3D round_up(bytes, 4); > count =3D num_bytes >> 2; >=20 > if (count > (priv->data->nregs - index)) @@ -168,7 +168,7 @@ static int > imx_scu_ocotp_read(void *context, unsigned int offset, > buf++; > } >=20 > - memcpy(val, (u8 *)p + offset % 4, bytes); > + memcpy(val, (u8 *)p, bytes); >=20 > mutex_unlock(&scu_ocotp_mutex); >=20 > @@ -188,10 +188,10 @@ static int imx_scu_ocotp_write(void *context, > unsigned int offset, > int ret; >=20 > /* allow only writing one complete OTP word at a time */ > - if ((bytes !=3D 4) || (offset % 4)) > + if (bytes !=3D 4) > return -EINVAL; >=20 > - index =3D offset >> 2; > + index =3D offset; >=20 > if (in_hole(context, index)) > return -EINVAL; > -- > 2.16.4