From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.windriver.com (mail.windriver.com [147.11.1.11]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 5CEBCE00592 for ; Tue, 24 Jan 2012 08:25:42 -0800 (PST) Received: from ALA-HCA.corp.ad.wrs.com (ala-hca [147.11.189.40]) by mail.windriver.com (8.14.3/8.14.3) with ESMTP id q0OGPfGS009899 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Tue, 24 Jan 2012 08:25:41 -0800 (PST) Received: from [128.224.146.67] (128.224.146.67) by ALA-HCA.corp.ad.wrs.com (147.11.189.50) with Microsoft SMTP Server id 14.1.255.0; Tue, 24 Jan 2012 08:25:40 -0800 Message-ID: <4F1EDB79.1030407@windriver.com> Date: Tue, 24 Jan 2012 11:25:29 -0500 From: Bruce Ashfield User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111124 Thunderbird/8.0 MIME-Version: 1.0 To: Darren Hart References: <4F188C59.5090109@linux.intel.com> <4F1CDBA6.5080909@windriver.com> <4F1DFAD0.2050001@linux.intel.com> <4F1E4FA3.90602@windriver.com> In-Reply-To: <4F1E4FA3.90602@windriver.com> Cc: Yocto Project Subject: Re: [PATCH][linux-yocto] pch_gbe: Do not abort probe on bad MAC X-BeenThere: yocto@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Discussion of all things Yocto List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2012 16:25:42 -0000 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit On 12-01-24 01:28 AM, Bruce Ashfield wrote: > On 12-01-23 7:26 PM, Darren Hart wrote: >> >> >> On 01/22/2012 08:01 PM, Bruce Ashfield wrote: >>> On 12-01-19 4:34 PM, Darren Hart wrote: >>>> Bruce, please apply to linux-yocto-3.0/yocto/standard/base >>> >>> Queued. >> >> I don't see this in the repository yet, is it still pending? I'm trying >> to write a BSP that is dependent on it.' > > It's queued with the rest of my 3.0 updates. I've been spending > time on 3.2 and haven't pushed these out yet. FYI: You can see this in the 3.0 kernel repo now, I fetched davem's net repo and cherry-picked it in. The SRCREV update will follow once I've merged 3.0.18 (or .17 if .18 takes too long). Cheers, Bruce > > Bruce > >> >> Thanks, >> >> Darren >> >>> >>> Bruce >>> >>>> >>>> Upstream-Status: Accepted (Linux 3.3) >>>> >>>> If the MAC is invalid or not implemented, do not abort the probe. Issue >>>> a warning and prevent bringing the interface up until a MAC is set >>>> manually >>>> (via ifconfig $IFACE hw ether $MAC). >>>> >>>> Tested on two platforms, one with a valid MAC, the other without a >>>> MAC. The real >>>> MAC is used if present, the interface fails to come up until the MAC >>>> is set on >>>> the other. They successfully get an IP over DHCP and pass a simple >>>> ping and >>>> login over ssh test. >>>> >>>> This is meant to allow the Inforce SYS940X development board: >>>> http://www.inforcecomputing.com/SYS940X_ECX.html >>>> (and others suffering from a missing MAC) to work with the mainline >>>> kernel. >>>> Without this patch, the probe will fail and the interface will not >>>> be created, >>>> preventing the user from configuring the MAC manually. >>>> >>>> This does not make any attempt to address a missing or invalid MAC >>>> for the >>>> pch_phub driver. >>>> >>>> Signed-off-by: Darren Hart >>>> CC: Arjan van de Ven >>>> CC: Alan Cox >>>> CC: Tomoya MORINAGA >>>> CC: Jeff Kirsher >>>> CC: "David S. Miller" >>>> CC: Paul Gortmaker >>>> CC: Jon Mason >>>> CC: netdev@vger.kernel.org >>>> CC: Mark Brown >>>> CC: David Laight >>>> CC: Joe Perches >>>> --- >>>> drivers/net/pch_gbe/pch_gbe_main.c | 17 ++++++++++++++--- >>>> 1 files changed, 14 insertions(+), 3 deletions(-) >>>> >>>> diff --git a/drivers/net/pch_gbe/pch_gbe_main.c >>>> b/drivers/net/pch_gbe/pch_gbe_main.c >>>> index eac3c5c..e7412f2 100644 >>>> --- a/drivers/net/pch_gbe/pch_gbe_main.c >>>> +++ b/drivers/net/pch_gbe/pch_gbe_main.c >>>> @@ -1701,6 +1701,12 @@ int pch_gbe_up(struct pch_gbe_adapter *adapter) >>>> struct pch_gbe_rx_ring *rx_ring = adapter->rx_ring; >>>> int err; >>>> >>>> + /* Ensure we have a valid MAC */ >>>> + if (!is_valid_ether_addr(adapter->hw.mac.addr)) { >>>> + pr_err("Error: Invalid MAC address\n"); >>>> + return -EINVAL; >>>> + } >>>> + >>>> /* hardware has been reset, we need to reload some things */ >>>> pch_gbe_set_multi(netdev); >>>> >>>> @@ -2392,9 +2398,14 @@ static int pch_gbe_probe(struct pci_dev *pdev, >>>> >>>> memcpy(netdev->dev_addr, adapter->hw.mac.addr, netdev->addr_len); >>>> if (!is_valid_ether_addr(netdev->dev_addr)) { >>>> - dev_err(&pdev->dev, "Invalid MAC Address\n"); >>>> - ret = -EIO; >>>> - goto err_free_adapter; >>>> + /* >>>> + * If the MAC is invalid (or just missing), display a warning >>>> + * but do not abort setting up the device. pch_gbe_up will >>>> + * prevent the interface from being brought up until a valid MAC >>>> + * is set. >>>> + */ >>>> + dev_err(&pdev->dev, "Invalid MAC address, " >>>> + "interface disabled.\n"); >>>> } >>>> setup_timer(&adapter->watchdog_timer, pch_gbe_watchdog, >>>> (unsigned long)adapter); >>> >>> _______________________________________________ >>> yocto mailing list >>> yocto@yoctoproject.org >>> https://lists.yoctoproject.org/listinfo/yocto >> > > _______________________________________________ > yocto mailing list > yocto@yoctoproject.org > https://lists.yoctoproject.org/listinfo/yocto