Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1804906imm; Thu, 19 Jul 2018 08:08:31 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc4Uc42D0ZSlMZedkIEqQTC7tZn4xAkAdC6HhWoCiyc/DF0iiwj7P+IUEEvN/C72drDFIxD X-Received: by 2002:a63:3686:: with SMTP id d128-v6mr10095957pga.18.1532012911695; Thu, 19 Jul 2018 08:08:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532012911; cv=none; d=google.com; s=arc-20160816; b=zcPHWDX2wlStqGTYCs56DYI0PqgwjgnStOn7/RoEmGrYOToXr6UESpaYRN4dGSZX0q Oxmr8k+PNSJciBo5h2ZN84+Wn968QRC+iEybaRjdv35NDVpk85i4dyGKSFRydn4eNgzB lP0JoqcoVAoMVkzEUqR/gc7UFRZo5MRSUQgtWxdyF1u6Fiiqpmaz/CJ6qJlimbMcMFHn UzRPydfvjrK+7QynXtuLeb6n4Lq1yariO7ije0zX0IWaIE08Ml4bvtHU/ZB75mBF3Neg OMqkwWrDmyRdq1L9U6wVFvS0kRPOC3rlDJ9vkMtJWWhisNnXoSPZ/UdcvDwBZVSE+qxY lr0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=xoXy4rAgjtfSqJVCQe2lr+UCSuYMA4N4rRr9iY1+DdE=; b=oVZGbS+BVmsjRtxDswSaPNa13pcfT84KYnL2eGcfd/LuW+5g2UsY0Zfa9o4X6UH/KY 5zKADYPsDStn9YvZE5fWk2ZJOc1NSjoTZEU/9MZsHvvpe+MfdNe4NhGbqsmmI9v3YpjN au1t0dBhD1euBCTax9OF/hP2uxnDmZVvrsixspI0Ad1CmXgTtFB2HftrUIvAMqyHG7qk kNzBEjApMgdQZEu+1Mu2X0aV8BhKxDDHkI6S/SgvhA0aCznpbH/NyAtv2OhAEVfB0sMf JkxfsvxdKB2SeGNLXJ9HOqDWThi3f6ow0nxS275BiAnIa0GfNIQLe01bo5wkxiRwq2Ds NrKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=NPcVZAzd; 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 89-v6si5606403ple.488.2018.07.19.08.08.16; Thu, 19 Jul 2018 08:08:31 -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=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=NPcVZAzd; 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 S1731725AbeGSPvS (ORCPT + 99 others); Thu, 19 Jul 2018 11:51:18 -0400 Received: from mail-it0-f67.google.com ([209.85.214.67]:52618 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730899AbeGSPvR (ORCPT ); Thu, 19 Jul 2018 11:51:17 -0400 Received: by mail-it0-f67.google.com with SMTP id p4-v6so10262999itf.2 for ; Thu, 19 Jul 2018 08:07:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=xoXy4rAgjtfSqJVCQe2lr+UCSuYMA4N4rRr9iY1+DdE=; b=NPcVZAzdsz5HMeNXiMFm07ynAZzaL60zjUaL4bFyMU8htNfjnYtO/Nx/ft50RNCqZa RmkC+/NAfXFXkqD46xwfwuN5TwuRErVKmBPQ8viBXvunxyZwy3fjtIbFXKGAjosOeDxv JCZQpVH3qMG+gNwKzZ59QUpd6X03Jr9CKkY8jkhnioFxCT/tDbGlzOEY2E8aFPwWTRtk b95fTV86wnC5s8wVhmSIc3qRofcDskdKenhD0CdXoJ8Ac+5fQGE5dZMZkoHFisz0D8+o 4uT0DSX1XqZD2nwvmhv0WGbxh9zZ9vb9TvxMij+RL97cXEJ2wCNKOsrCVf88/8Lrebxi HeKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=xoXy4rAgjtfSqJVCQe2lr+UCSuYMA4N4rRr9iY1+DdE=; b=Vp+r0DNwCI2lttDc2TJM0Chww657L9598i6gwq7+yut625zBuraOOrs4DUwejLURGb NABYLromjwYGfd5dvnripODu5V93yabMuloPXU7RvGQIF5FWtZyJnRyau2BSMCHYMCdN 1UHb9uwiw86ijzzFY/JKbUrtlXTwLLwh8n3T+qZXpS2cCjKAFKt1c9T1HOSuvQM8IdOb hAQ4QqxmaWhOdmupBo7G8qblF785p25tLegMrHag2KXprqroxjeUcdwCmBbOm5gdN/Tq YqNQ/v1BkXvKQb3sqcyklrmUg+l/rJ1rnJAS2sx+KssBmrIVnY7e3au+XdSn+E/UZhL1 UytA== X-Gm-Message-State: AOUpUlFoMfkuZ0hP+PoMcghhKQUen5l38pJOEaiz0Zw6mzhpmu5tjxyD OFsBjn9R4NBVl1bZ9+gkp8goVXfgH2SBhMkCwHaiZw== X-Received: by 2002:a24:d80a:: with SMTP id b10-v6mr5874579itg.141.1532012861196; Thu, 19 Jul 2018 08:07:41 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a5e:9402:0:0:0:0:0 with HTTP; Thu, 19 Jul 2018 08:07:40 -0700 (PDT) In-Reply-To: <20180719150138.GC9119@lunn.ch> References: <20180718161035.7005-1-brgl@bgdev.pl> <20180718161035.7005-6-brgl@bgdev.pl> <20180718164737.GE12477@lunn.ch> <20180718170352.GF12477@lunn.ch> <20180719150138.GC9119@lunn.ch> From: Bartosz Golaszewski Date: Thu, 19 Jul 2018 17:07:40 +0200 Message-ID: Subject: Re: [PATCH 5/5] net: add MTD support to eth_platform_get_mac_address() To: Andrew Lunn Cc: Sekhar Nori , Kevin Hilman , Russell King , Grygorii Strashko , "David S . Miller" , Srinivas Kandagatla , Lukas Wunner , Rob Herring , Florian Fainelli , Dan Carpenter , Ivan Khoronzhuk , David Lechner , Greg Kroah-Hartman , Linux ARM , Linux Kernel Mailing List , Linux-OMAP , netdev@vger.kernel.org, Bartosz Golaszewski Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2018-07-19 17:01 GMT+02:00 Andrew Lunn : > On Thu, Jul 19, 2018 at 10:14:29AM +0200, Bartosz Golaszewski wrote: >> 2018-07-18 19:03 GMT+02:00 Andrew Lunn : >> >> >> +#ifdef CONFIG_MTD >> >> >> + /* NOTE: this should go away as soon as MTD gets nvmem support. */ >> >> >> + if (!addr) { >> >> >> + struct mtd_info *mtd; >> >> >> + int rv; >> >> >> + >> >> >> + mtd = get_mtd_device_nm("MAC-Address"); >> >> > >> >> > In order for this to go away, you need to keep backwards >> >> > compatibility. When using nvmem, you look for a cell called >> >> > "mac-address". Here you are looking for "MAC-Address". That is going >> >> > to make backwards compatibility harder. How do you plan to do it? >> >> > >> >> > Andrew >> >> >> >> I'm trying to adjust to already existing users. The only user of >> >> get_mtd_device_nm() who calls it to read the MAC address registers a >> >> partition called "MAC-Address". We can't change it since it's visible >> >> from user space. In the future we'd just have to have a list of >> >> supported string that we'd use to do the nvmem lookup. >> > >> > Why not have the nvmem cell called "MAC-Address"? When you add nvmem >> > support to MTD, i assume you are going to map each MTD partition to an >> > nvmem cell? >> >> Because all existing users of nvmem use "mac-address" as the name of >> this cell already. I guess we will need to live with both in this >> particular function. > > So i'm not convinced this last patch is making things better. I would > prefer if it was dropped for the moment. Wait until MTD via nvmem is > actually implemented and there is a concrete concept of how a MAC > address would be looked up without having lots of ugly code. > > Andrew Unfortunately: this would effectively block me from improving the support for older davinci boards. Having a (subjectively) ugly but generalized way of reading the MAC address from MTD is still better than using the MTD notifier from board files IMO. Bart