Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp178170ybl; Mon, 12 Aug 2019 14:05:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqwiG+Q6wH7PtIMf38HD6N4s+oIKkKIMiqRe/Vc/HkbJSIPEZ8aemuEaU/+HJgNhTMqX7mfB X-Received: by 2002:a17:902:a607:: with SMTP id u7mr34886924plq.43.1565643952467; Mon, 12 Aug 2019 14:05:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565643952; cv=none; d=google.com; s=arc-20160816; b=EoJBNjGiqLAWrOruK3E3pbA2p+XpghvPYVUFtKs6+RRcM6BugvAgaEVSsQDbRCfMLU 2A0MVDg5oQLcL0LfWBF9Fje52+kGHbCzq+xohX+JRS1RgujYvXOGoqGhc/XhOq3gr5tR 2/To5/COh37sPDmq5Xfic+iRs49wRiPKxSRgP5l4Jfjsiu92iXLszechgAb/WafkJTFh hu7EYdIAreoFkrZU5B57LYpTiMxvMqggfFwTR3ahFOaKAmlLUExMnQy7WPxpXQzlQZ4i 9HzzAah0eFqqoyo66xeSvZgJYXsafvpw5ecGqD9GLQyW993Zq7hk2rq2JR1sBfXhl5sQ SNTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:dkim-signature; bh=GpW5qLhZyrECHDegQNaRLHT0CfKc1qacLHW2hCzZ6z0=; b=eVj70IkoGxTVKch0VRcQ/bfI250hzmCN9N2/rDvDpxPHjAkd+wYhZuqhVGqjWfmwNe IVuPm4ifhkhvOvHmjCbVxr9S843Q9H1gS5OzR5Fsl+fBzhbZuh3taME+y+/qSKavdmLe cryLX/CeQGD3PLnKxH6nu8mvcYgJNRnlLqcQrZ19t3Cfo3TihDvg5HLVz+GHuSql9LgA 33XWARq082FisBEI7t9pjol1MG8DcEGjhs900x99pemURU0W7AILAvHvRquPbNvI4YJv m0VKK1poo0lyqKhQ0SX5yvwXTpzuW7DmD13Ad6TXw1seYgrw7sQQRcc5CiYsuFhyLJir pxzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@devtank-co-uk.20150623.gappssmtp.com header.s=20150623 header.b=wAwgpYB8; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j12si32034188pgp.261.2019.08.12.14.05.36; Mon, 12 Aug 2019 14:05:52 -0700 (PDT) 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=@devtank-co-uk.20150623.gappssmtp.com header.s=20150623 header.b=wAwgpYB8; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727291AbfHLVDg (ORCPT + 99 others); Mon, 12 Aug 2019 17:03:36 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:51953 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727072AbfHLVDg (ORCPT ); Mon, 12 Aug 2019 17:03:36 -0400 Received: by mail-wm1-f66.google.com with SMTP id 207so857621wma.1 for ; Mon, 12 Aug 2019 14:03:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=devtank-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=GpW5qLhZyrECHDegQNaRLHT0CfKc1qacLHW2hCzZ6z0=; b=wAwgpYB8w4BwSUbHdghD8ZImzZ2FTixXUOwdkOyc5UkRbhHwFXv5wOp0aRuAsm8HQL Jqgu6hb/QdI3DbANUVBCxoJpxDnBtCfiknDeKjSUPYV+V015LZy+VbM5sRBMVX9FP7L1 T5pYGDHZ3BJPEKDxIJWr9ixFAx/E7AsZMHIA/8a1PmLw2MFL+g88EALquzE/RdbHlvKh AaEAkZ1Fnk3Llh3AWa2BXAFfGxcGXB+k56JKIteyztsehnO+BBqBCFXzX1+O+vWyrq8v vQIFVtbqB2msnSz/DlSZWCbmYojaUogg1VS4xZNeeX2vJMxQ633XZIx681ncsw+q7VNi wfng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=GpW5qLhZyrECHDegQNaRLHT0CfKc1qacLHW2hCzZ6z0=; b=lyY15UxfUeVbBSWpvWegzN28gCvdFjp95p99ar4A/5vAgIdNoem86Dyz6ePlkySZ7q pDzubWlO7uyuMD7RWX6YdPyFIFePktRFIimlwXuq3A7hkfOJwOe+NemSm1f1pPEOTUdu eAc84bmmc/tzIonXrGb2xhLiZS9JgtL7Htm//YIgUe3qBrPs14MMHcCBj6xryKs+3Q6W 3Ckx5owChHxZPOa8r7zb5v1jjT0cpKjKQ7a9fXwRrQX/zNxBpA1kmWzt5UxFWEXApBV8 gf5L+09eKFA24feaiFZ6ks1HSOd3j5kgc+5yBKJfGubHqWXK6XQSRosevML5WXEI+d0g t6TQ== X-Gm-Message-State: APjAAAVmCjv9LU0dbKT1LusyRH2bgU+Xj3JvEt0VGba/J5mfJldURjnV d7wUXDluPro+83Gpge0kwh+FInbqAo4= X-Received: by 2002:a7b:c310:: with SMTP id k16mr961676wmj.133.1565643813877; Mon, 12 Aug 2019 14:03:33 -0700 (PDT) Received: from [192.168.222.141] (82-71-5-123.dsl.in-addr.zen.co.uk. [82.71.5.123]) by smtp.gmail.com with ESMTPSA id h97sm32667090wrh.74.2019.08.12.14.03.32 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Mon, 12 Aug 2019 14:03:33 -0700 (PDT) Subject: Re: [PATCH] Add optional chip erase functionality to AT25 EEPROM driver. To: David Laight , Rob Herring , Mark Rutland , Arnd Bergmann , Greg Kroah-Hartman , Srinivas Kandagatla , YueHaibing , Bartosz Golaszewski , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" References: <20190809125358.24440-1-joe.burmeister@devtank.co.uk> <9f1c7d45020d482390737be22c885a9b@AcuMS.aculab.com> From: Joe Burmeister Message-ID: Date: Mon, 12 Aug 2019 22:03:32 +0100 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: <9f1c7d45020d482390737be22c885a9b@AcuMS.aculab.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/08/2019 16:51, David Laight wrote: > From: Joe Burmeister >> Sent: 09 August 2019 13:54 >> >> Many, though not all, AT25s have an instruction for chip erase. >> If there is one in the datasheet, it can be added to device tree. >> Erase can then be done in userspace via the sysfs API with a new >> "erase" device attribute. This matches the eeprom_93xx46 driver's >> "erase". > Is it actually worth doing though? > > I'm guessing that device erase can easily take over a minute. That must depend on the AT25. The one we're using (AT25F512A), as it's setup, it's fast enough. The datasheet states "The CHIP ERASE cycle time typically is 2 seconds.". I've not timed it's because as I said, seamed fast enough. If you can't erase it, then it's basically write once, or you expose it with spi_dev to Flashrom to erase it. > When I looked at 'device erase' on an EEPROM it took just as long > as erasing the sectors one at a time - but without the warm cosy > feeling that progress was being made. I didn't look at sector erase as I'm only interested in erasing it all and there was a command for it. I figured if someone wanted sector by sector they would implement it. > Not only that you can't really interrupt the erase, so either > the application has to sleep uninterruptibly for the duration > or you have to have some kind of 'device busy' response while > it is done asynchronously. That's true, but as I said, it's fast enough it's not an issue for us. > David > > - > Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK > Registration No: 1397386 (Wales) Regards, Joe