Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752465AbbEIVba (ORCPT ); Sat, 9 May 2015 17:31:30 -0400 Received: from shards.monkeyblade.net ([149.20.54.216]:45652 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750892AbbEIVb1 (ORCPT ); Sat, 9 May 2015 17:31:27 -0400 Date: Sat, 09 May 2015 17:31:25 -0400 (EDT) Message-Id: <20150509.173125.960563138389004338.davem@davemloft.net> To: linux@arm.linux.org.uk Cc: tremyfr@gmail.com, B38611@freescale.com, Frank.Li@freescale.com, LW@KARO-electronics.de, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: fec: add support of ethtool get_regs From: David Miller In-Reply-To: <20150509211746.GY2067@n2100.arm.linux.org.uk> References: <1431204728-16754-1-git-send-email-tremyfr@gmail.com> <20150509211746.GY2067@n2100.arm.linux.org.uk> X-Mailer: Mew version 6.6 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Sat, 09 May 2015 14:31:27 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 780 Lines: 20 From: Russell King - ARM Linux Date: Sat, 9 May 2015 22:17:46 +0100 > On Sat, May 09, 2015 at 10:52:08PM +0200, Philippe Reynes wrote: >> +static void fec_enet_get_regs(struct net_device *ndev, >> + struct ethtool_regs *regs, void *regbuf) >> +{ >> + struct fec_enet_private *fep = netdev_priv(ndev); >> + >> + memcpy_fromio(regbuf, fep->hwp, regs->len); > > Using memcpy_fromio() to copy device registers is not a good idea - > it can use a variable access size which can cause bus faults. Agreed. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/