Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4444332imm; Fri, 18 May 2018 05:20:05 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrDPSqyC9zZVupMLuU4cBdLiks6kpnqccxr9xgM6TyyY9bJzW2QKwrsyrZ/ZWR0yrCnRAUF X-Received: by 2002:a62:428f:: with SMTP id h15-v6mr9251140pfd.156.1526646005635; Fri, 18 May 2018 05:20:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526646005; cv=none; d=google.com; s=arc-20160816; b=uQGHEIS/xmUQw4PT93AfuQlTyZYxnQTA5Z0UsDa3ZGWCPG9tQ/lTwgMAgsT5IeA9W4 exDTQ6NcgfxFvN3jCFhBzUwwpvqYW9WtGRYmlnbhHIvzZdIxorGvOoJ3bpNQk3lD81Jy eJomnWyQqcRtfcPfQvqfzu9su/9kOaQHATSbcJzxO8M7UwIUBzOnLNfqeQkodEe2BVaW t3JGzKDyq2Em60zvv0zmKryZe3oZEBGmG8wiRp3qTCF3zWfDIfQREin/CUVwI6gvZjIw VQGO1ybPq9XlaMlZZgLLiJLae9dTCzzVRk33AUxZO8caUYPaQtoFCOOl4WYg/Y/67pGE fuNw== 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=9Y62VczgjV4ROqLDWimHAARQebnpLlu1jLHPaf2EDNI=; b=q62ZwOokuns6w26MKU+ips9OtqrAW5VrKwv6edvRHGx163puywh1AfDt4eacx/22uv CqRwctkl7TXjxthvJiSVyhSWoamUeRajStKX3lkVKMh93gnoxMAECvNUkYLAUoe8lURY q6XZUc/bsyZkqU4Cp+vpCuru5uvxqtVbB9U7cPkNmJZi5pVCUdiD27nwi5ip8sSw2M+F c0nuQ5oi4NcVFMIR1KXctwTgaWOOfblogfNJanFFVy4vvSVFlE0ZoCCt8lM3Sxu/gv5S OUbT71uaQTE6Ka1Am/MUijhyuMp6dva0IjZQVoYGp596Fgrv9HJFYaz9vbpMCYTYoshf 3p8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GXXKEbtb; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d30-v6si7482299pld.528.2018.05.18.05.19.43; Fri, 18 May 2018 05:20:04 -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=@gmail.com header.s=20161025 header.b=GXXKEbtb; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751534AbeERMT1 (ORCPT + 99 others); Fri, 18 May 2018 08:19:27 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:36627 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751112AbeERMTY (ORCPT ); Fri, 18 May 2018 08:19:24 -0400 Received: by mail-lf0-f68.google.com with SMTP id t129-v6so13660394lff.3; Fri, 18 May 2018 05:19:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=9Y62VczgjV4ROqLDWimHAARQebnpLlu1jLHPaf2EDNI=; b=GXXKEbtbCW0WyFSMx39pK/iI8LACgxMHfJ7mpfe39WsdhQ3wU2NEpfZ3kVNYMSuDu8 Kxs5rDKRfSAhbnvCvalO1I6NkobGA0h/Hxxf+CCvgNDqcojqGUSXKgqfIXC383foC6hm x5HvGHl5QBmHzT23ZumRCADps3WMibeWoFqRsel8sC4Sf1tu3Hxwryy8Y+45Snit8bH9 kvezJn4eZxMERPi7rOWePCket/FL5ZHZAjP9lm1pKKEzurqB8Whv9oTWoxHe8NSJNcrF yypMyeXsYbRM4tg85vPr43HUZTPpiEC4Xr0DQylACTnbRZtyhMJ2MPZaOa5uNv9fQkI1 IcPg== 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=9Y62VczgjV4ROqLDWimHAARQebnpLlu1jLHPaf2EDNI=; b=IJoQRsWHFkZ1SeNT5uhUtnAuihm73gIWmCFxzG55iTe457T2ane5BXubyQ3df2EiFF /lPy56FQa+vdlckVxilOUrgg9CoDEI2bVotlYhKkZa3WVfUQHUCHM+tAuYYhZV/LISVe zWJZzI6Qgy1O6uPhngT4Z6yZR6SoekKwa27mxgYSC+TUJlpML0JZLTeLlHwoBVd+a+H8 Zttn9FFVhfyB8/TzOH16T8Zbznu6h8bfLWZ44OzKEEoemN6eBob91rGjHDEOUmHWoBir cMY7gKhvY+lEbf1eVW/woLSxVVarYGZ0FBq9hVhQ8i1k3J7ra+4PIz7fgniMixXoRikT wY1g== X-Gm-Message-State: ALKqPwdizQPtrBt2s6gFFo/kBdHqcBBD2FEYhx6d4oj0RMIqjthLnfBn KGjFPsGrWFuCeIwK2T4nVgx+BFwjit8bEdLjdd8= X-Received: by 2002:a2e:7a0c:: with SMTP id v12-v6mr5522339ljc.79.1526645962377; Fri, 18 May 2018 05:19:22 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a19:5c55:0:0:0:0:0 with HTTP; Fri, 18 May 2018 05:18:41 -0700 (PDT) In-Reply-To: <20180517.163113.2110198960037727630.davem@davemloft.net> References: <20180517130529.2684-1-andrea.greco.gapmilano@gmail.com> <20180517.163113.2110198960037727630.davem@davemloft.net> From: Andrea Greco Date: Fri, 18 May 2018 14:18:41 +0200 Message-ID: Subject: Re: [PATCH 1/4] arcnet: com20020: Add com20020 io mapped version To: David Miller Cc: "Tobin C. Harding" , Andrea Greco , Michael Grzeschik , linux-kernel@vger.kernel.org, netdev@vger.kernel.org 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 On 05/17/2018 10:31 PM, David Miller wrote: > From: Andrea Greco > Date: Thu, 17 May 2018 15:05:29 +0200 > >> + /* Will be set by userspace during if setup */ >> + dev->dev_addr[0] = 0; > > Hmmm... really? > > Also, every error path from this point forward will leak 'dev'. > In com20020.c found this: /* FIXME: do this some other way! */ if (!dev->dev_addr[0]) dev->dev_addr[0] = arcnet_inb(ioaddr, 8); NODE-ID, must be univoque, for all arcnet network. My previews idea was take random value but, this could create a collision over network. A possible solution is: In case of collision com20020 set a bit in status register. Then peak a new NODE-ID and repeat this while correct NODE-ID is found. Other ideas is pass it via DTS. But suppose have 2 same product in same network, same address same problem. For this reason i prefer left standard driver behavior. Other ideas for solve this ? Other question discussed with Tobin in RFC patch is: At now a devm_ioremap is done by this driver. Other version of this driver, PCI, PCMCIA, ISA do not remap memory. Other implementation, use:inb outb for r/w operation. I do a ugly #ifndef and redefine arcnet_inb in case is defined CONFIG_ARCNET_COM20020_IO. My proposal was: Add relative callback arcnet_inb, arcnet_outb and friends hw struct in arcdevice.h, then every driver set callback with required function. Regards, Andrea