Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp255018ybg; Tue, 28 Jul 2020 05:20:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJysWUrfxY380Qhvq5mjuQvat5vsyw20lGHNS8L9wg4oD0/JkKCwgjmAI9Yphh35eQ8YytnZ X-Received: by 2002:a50:fb06:: with SMTP id d6mr25133104edq.165.1595938837147; Tue, 28 Jul 2020 05:20:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595938837; cv=none; d=google.com; s=arc-20160816; b=FAPeW9kI2fMGB8UexD9ZSA6Z3dhz3c32yr7boylwqh2JN3LaTgFx1BXRE2+AI8KWLM /Tz90ejasbvDwTjOOIvx81cHmkmrcYFB387qvqG9MXLzOICoKgzJenoZkGLP3ES4ylT6 wg8f9L2EoEzL1hXdXZjXN0S/eJvx/P1kXyid7alHWTnC4SksGKlBqXi4+TbDSEaFoYAU 7mDYyp9U9okRUc2n86gK1rNspKFP+sf/nnXooobzSKq4U5zcvqwFCvuaBa863VoXIppS i6I066rQ5EXrt9LVhKr5M/BGcZxBQHu9nzFk+42Is1xGv72QamlKVzRK6+oFkaxl4Op6 WpQA== 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 :references:in-reply-to:organization:message-id:date:subject:cc:to :from; bh=mZCRIqnSKV6B7nnptCBbXaNP3ob8abXMYAlnCSb3AfU=; b=A/US/r8OutYivX8fhTQ2PDnQc74meutGahu8YbshCu4VxbuLi8EbT6714WAmWhPDm/ jJTR+d/RAxGYOvC7mLp9cch6ZoAP3eH69qOtn1JcZpopiIZGC5lXRgySe/iHHuQlUz1K eyM6npLcEZyPen3BYHStUcupqYF5VnUMN/bvpXlFJRZyO0KHuqRE2M5YfvhuMmjU5+AU LdQYibHy1ppDsAGuEiF4FAlJtdEkmhZf3boUpudaE5QIbi9fWPHxu1EWWZjj6IgvaKhz Gp9UDvecpuRUJ/9k50v7R2G7GIMXC7ZDVsJw0pRKw/nJmwsh9jy7WRaz28XlNdhsD6zB +TiQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id se26si2621870ejb.167.2020.07.28.05.20.14; Tue, 28 Jul 2020 05:20:37 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729335AbgG1MNQ (ORCPT + 99 others); Tue, 28 Jul 2020 08:13:16 -0400 Received: from mailout08.rmx.de ([94.199.90.85]:43547 "EHLO mailout08.rmx.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728896AbgG1MNQ (ORCPT ); Tue, 28 Jul 2020 08:13:16 -0400 Received: from kdin01.retarus.com (kdin01.dmz1.retloc [172.19.17.48]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mailout08.rmx.de (Postfix) with ESMTPS id 4BGFtw4DS3zMvj4; Tue, 28 Jul 2020 14:13:12 +0200 (CEST) Received: from mta.arri.de (unknown [217.111.95.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by kdin01.retarus.com (Postfix) with ESMTPS id 4BGFtM6DLyz2xbN; Tue, 28 Jul 2020 14:12:43 +0200 (CEST) Received: from n95hx1g2.localnet (192.168.54.29) by mta.arri.de (192.168.100.104) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 28 Jul 2020 14:03:31 +0200 From: Christian Eggers To: David Laight CC: Arnd Bergmann , Greg Kroah-Hartman , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: Re: [PATCH] eeprom: at25: set minimum read/write access stride to 1 Date: Tue, 28 Jul 2020 14:03:30 +0200 Message-ID: <2379124.UCELOXW4Ax@n95hx1g2> Organization: Arnold & Richter Cine Technik GmbH & Co. Betriebs KG In-Reply-To: <02cb3be60abf4a54affe239009c6e157@AcuMS.aculab.com> References: <20200728092959.24600-1-ceggers@arri.de> <2225645.EMaFvj1lSc@n95hx1g2> <02cb3be60abf4a54affe239009c6e157@AcuMS.aculab.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Originating-IP: [192.168.54.29] X-RMX-ID: 20200728-141253-4BGFtM6DLyz2xbN-0@kdin01 X-RMX-SOURCE: 217.111.95.66 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday, 28 July 2020, 13:20:15 CEST, David Laight wrote: > From: Christian Eggers > > > &spi { > > .... > > fram: fram@0 { > > ... > > mac_address_fec2: mac-address@126 { > > reg = <0x126 6>; > > }; > > ... > > }; > > }; > > > Hmmmm.... the 'stride' only constrains the alignment of 'cells'. > (ie address ranges from the device tree.) My mac-address is not aligned to 4 bytes... > It looks as though you can open the entire NVMEM device and > then do reads from byte offsets. > The 'stride' and 'word_size' are then not checked! When I set back the stride to 4, I get the following errors: [ 6.998788] 000: nvmem spi0.00: cell mac-address unaligned to nvmem stride 4 [ 6.998902] 000: at25: probe of spi0.0 failed with error -22 ... [ 7.146454] 000: fec 20b4000.ethernet: Invalid MAC address: 00:00:00:00:00:00 [ 7.146480] 000: fec 20b4000.ethernet: Using random MAC address: 6e:9d:37:49:6d:15 > Actually it might be that before 01973a01f9ec3 byte aligned > 'cells' were allowed. I use linux-5.4.x (latest), the mentioned patch has been included long time ago. regards Christian