Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1540179pxu; Tue, 24 Nov 2020 02:56:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJxTqPJiqPsyFJ9gyyRqJpcJyRXCMYVsHl6hNLGnTR6Wu58YkdcWSrconHX65SdGYS3ii2lq X-Received: by 2002:a17:906:1386:: with SMTP id f6mr3427715ejc.453.1606215365922; Tue, 24 Nov 2020 02:56:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606215365; cv=none; d=google.com; s=arc-20160816; b=EZutxi6llL6TLnlaNIF/NvhmaGLAf9idnDLC9oYsg+xHZnbHZjfyDNZiQY+/QbNbtD zj40KvvRrq5I0UGbfoNU+UCa+EEWG6Wprey9T6h1Jj2WQGhDzCBShq0tXT3iUon2fv+r L4l1gmtiAtcyiu6rQ4GAog5B/j5qQVguMoqIDrpgby+BpJ5vAPa3o2aq0hFruffNxu1S hw8HWQjGPayqivVKBbl9zNYQVKGJwA3i3WvNkC0ZodqSTEIKQQJKMsXhviHeduVocpWd cw0+JS7HUvz2N/KXdnap649doQ1PrY4wWpoXwmfe5Vs2An7swquRRYj6CaeUnhW/klSp /v3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=QQio1s0DCG/7feDbhPWYAjV7QRB02xC2LTb4uvAbajI=; b=qV39W8NvKMWU21LcJt234Sn3WYRrJdS7HA03MZkGatrsiRMlVkAXha4RC4vQlNLm9/ yvaPNlSZkP3gAVPPSBHjJq5LETQNctQeOo8h7TFjyusDx5AgZ+eBMwPbFrZzXNJHJgS2 RHkHXeGv6osgeGNth+pnIkebavCA5T6SOjdKxz12/1LbyewrV3YMQhasF8q6KTnc29ff vqW+IWS70uzzg77baeU9KftSXJA+IVk9uqE+WbQbZRUBR3SomTK3csZn1n/eLoQNsIZN 8hbJsGW0Nd1z5jDpErlYHmkpXJfY6zGol2UUSHfCYf0w28wsV+X5yn97OkrmF7RrpBjf a1Pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=btOHx204; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k5si8231005eji.617.2020.11.24.02.55.42; Tue, 24 Nov 2020 02:56:05 -0800 (PST) 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=@linaro.org header.s=google header.b=btOHx204; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732223AbgKXKwH (ORCPT + 99 others); Tue, 24 Nov 2020 05:52:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732047AbgKXKwG (ORCPT ); Tue, 24 Nov 2020 05:52:06 -0500 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4981C0613D6 for ; Tue, 24 Nov 2020 02:52:06 -0800 (PST) Received: by mail-wr1-x433.google.com with SMTP id l1so21798906wrb.9 for ; Tue, 24 Nov 2020 02:52:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=QQio1s0DCG/7feDbhPWYAjV7QRB02xC2LTb4uvAbajI=; b=btOHx204IHjtMuAN1QTcOtlbSP2dKgIUkmjptjHW7P0wtM7GPRL/BegU0VdM3FdJtz TLuwUyAXLTOcPci65/SWhhJPcCOF67Us/9AMX0Vzc9VXbkfOP5/egbLAzzWaJcK50NsV m8cS94WsciprnRnibLnKE5X24+mASeWEsg4ropPpTWOBaiKmQIT+SJbBAcvs9cal/8RK NLltqudXPZf01mU9wnzl/biTR9HJjDwaVSSwGEc3UPgqgZtg23ZMiiF/nPpZzdfcKUF3 FawUZL79y3jPNEUSW9xxFRJPapqh7vIc2elsEMO+MnPo3DC3tj+CfS7P8dKlbnP4o2JP DQvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=QQio1s0DCG/7feDbhPWYAjV7QRB02xC2LTb4uvAbajI=; b=n26vs00U9Uq1GSuS8woaRqXaJyO99SPhT5YcFiGLH3ke3GsJgAww37rX0HtzfzdyCJ n2D0Hos25TuuAJUlGVze0IPOXbLJvGGoJz9k4hecL5G0JEupx9IS2gaY6ZYRN+D2W3N4 QVVghX52pqDUr9OwV5iDo+I70RlGTHmJW+vkkHIoJ/nRlWv9gUiwC4k8mdLJ1AiiXgJU 9czAqaEmPJTXHxe9RQ++6lD3WjSm53+zh4cAMe1lav2d2IKfeeyFf02oUCxfQcPSJgZj KGL6WXbGyqKhYE/DGJZ5YWuyEvZsKyPycZVjkvqXXaYTXLgK76EWxyh9EHoAFQiS+WVu hJww== X-Gm-Message-State: AOAM530pbjmNz9xYzxmBNX4O+f8B0BbACOAPnvieXADzJ2/TjPSL93h5 WmgrmgqYb+M3iu9EGi/rI9GJc03K52wnyjKx X-Received: by 2002:adf:e6cf:: with SMTP id y15mr4645433wrm.403.1606215125160; Tue, 24 Nov 2020 02:52:05 -0800 (PST) Received: from [192.168.86.34] (cpc86377-aztw32-2-0-cust226.18-1.cable.virginm.net. [92.233.226.227]) by smtp.googlemail.com with ESMTPSA id u81sm5019026wmb.27.2020.11.24.02.52.04 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Nov 2020 02:52:04 -0800 (PST) Subject: Re: [PATCH] nvmem: imx-ocotp: add support for the unaliged word count To: peng.fan@nxp.com, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <1603352683-23918-1-git-send-email-peng.fan@nxp.com> From: Srinivas Kandagatla Message-ID: <628bb6a8-9d09-46a0-70cd-89a51f0f8108@linaro.org> Date: Tue, 24 Nov 2020 10:52:03 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <1603352683-23918-1-git-send-email-peng.fan@nxp.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22/10/2020 08:44, peng.fan@nxp.com wrote: > From: Peng Fan > > When offset is not 4 bytes aligned, directly shift righty by 2 bits > will cause reading out wrong data. Since imx ocotp only supports > 4 bytes reading once, we need handle offset is not 4 bytes aligned > and enlarge the bytes to 4 bytes aligned. After reading finished, > copy the needed data from buffer to caller and free buffer. > > Signed-off-by: Peng Fan Applied thanks, srini