[PATCH] Drivers: vt6655 - style fix

2017-06-06 Thread Derek Robson
Fixed "function definition" issues
Found using checkpatch

Signed-off-by: Derek Robson 
---
 drivers/staging/vt6655/card.h| 30 ++---
 drivers/staging/vt6655/channel.h |  4 +--
 drivers/staging/vt6655/mac.h | 58 
 drivers/staging/vt6655/power.h   | 16 +++
 drivers/staging/vt6655/rf.h  | 16 +--
 5 files changed, 57 insertions(+), 67 deletions(-)

diff --git a/drivers/staging/vt6655/card.h b/drivers/staging/vt6655/card.h
index 03369ffaa4d6..1a04dbb57d42 100644
--- a/drivers/staging/vt6655/card.h
+++ b/drivers/staging/vt6655/card.h
@@ -64,25 +64,25 @@ typedef enum _CARD_STATUS_TYPE {
 struct vnt_private;
 
 void CARDvSetRSPINF(struct vnt_private *priv, u8 bb_type);
-void CARDvUpdateBasicTopRate(struct vnt_private *);
-bool CARDbIsOFDMinBasicRate(struct vnt_private *);
-void CARDvSetLoopbackMode(struct vnt_private *, unsigned short wLoopbackMode);
-bool CARDbSoftwareReset(struct vnt_private *);
-void CARDvSetFirstNextTBTT(struct vnt_private *,
+void CARDvUpdateBasicTopRate(struct vnt_private *priv);
+bool CARDbIsOFDMinBasicRate(struct vnt_private *priv);
+void CARDvSetLoopbackMode(struct vnt_private *priv, unsigned short 
wLoopbackMode);
+bool CARDbSoftwareReset(struct vnt_private *priv);
+void CARDvSetFirstNextTBTT(struct vnt_private *priv,
   unsigned short wBeaconInterval);
-void CARDvUpdateNextTBTT(struct vnt_private *, u64 qwTSF,
+void CARDvUpdateNextTBTT(struct vnt_private *priv, u64 qwTSF,
 unsigned short wBeaconInterval);
-bool CARDbGetCurrentTSF(struct vnt_private *, u64 *pqwCurrTSF);
+bool CARDbGetCurrentTSF(struct vnt_private *priv, u64 *pqwCurrTSF);
 u64 CARDqGetNextTBTT(u64 qwTSF, unsigned short wBeaconInterval);
 u64 CARDqGetTSFOffset(unsigned char byRxRate, u64 qwTSF1, u64 qwTSF2);
-unsigned char CARDbyGetPktType(struct vnt_private *);
-void CARDvSafeResetTx(struct vnt_private *);
-void CARDvSafeResetRx(struct vnt_private *);
-bool CARDbRadioPowerOff(struct vnt_private *);
-bool CARDbRadioPowerOn(struct vnt_private *);
-bool CARDbSetPhyParameter(struct vnt_private *, u8);
-bool CARDbUpdateTSF(struct vnt_private *, unsigned char byRxRate,
+unsigned char CARDbyGetPktType(struct vnt_private *priv);
+void CARDvSafeResetTx(struct vnt_private *priv);
+void CARDvSafeResetRx(struct vnt_private *priv);
+bool CARDbRadioPowerOff(struct vnt_private *priv);
+bool CARDbRadioPowerOn(struct vnt_private *priv);
+bool CARDbSetPhyParameter(struct vnt_private *priv, u8 bb_type);
+bool CARDbUpdateTSF(struct vnt_private *priv, unsigned char byRxRate,
u64 qwBSSTimestamp);
-bool CARDbSetBeaconPeriod(struct vnt_private *, unsigned short 
wBeaconInterval);
+bool CARDbSetBeaconPeriod(struct vnt_private *priv, unsigned short 
wBeaconInterval);
 
 #endif /* __CARD_H__ */
diff --git a/drivers/staging/vt6655/channel.h b/drivers/staging/vt6655/channel.h
index 2621dfabff06..8fe70760e548 100644
--- a/drivers/staging/vt6655/channel.h
+++ b/drivers/staging/vt6655/channel.h
@@ -21,8 +21,8 @@
 
 #include "card.h"
 
-void vnt_init_bands(struct vnt_private *);
+void vnt_init_bands(struct vnt_private *priv);
 
-bool set_channel(struct vnt_private *, struct ieee80211_channel *);
+bool set_channel(struct vnt_private *priv, struct ieee80211_channel *ch);
 
 #endif /* _CHANNEL_H_ */
diff --git a/drivers/staging/vt6655/mac.h b/drivers/staging/vt6655/mac.h
index 33b758cb79d4..db401e32ae23 100644
--- a/drivers/staging/vt6655/mac.h
+++ b/drivers/staging/vt6655/mac.h
@@ -885,57 +885,57 @@ do {  
\
 #define MACvSetRFLE_LatchBase(iobase) \
MACvWordRegBitsOn(iobase, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_RFLEOPT)
 
-bool MACbIsRegBitsOn(struct vnt_private *, unsigned char byRegOfs,
+bool MACbIsRegBitsOn(struct vnt_private *priv, unsigned char byRegOfs,
 unsigned char byTestBits);
-bool MACbIsRegBitsOff(struct vnt_private *, unsigned char byRegOfs,
+bool MACbIsRegBitsOff(struct vnt_private *priv, unsigned char byRegOfs,
  unsigned char byTestBits);
 
-bool MACbIsIntDisable(struct vnt_private *);
+bool MACbIsIntDisable(struct vnt_private *priv);
 
-void MACvSetShortRetryLimit(struct vnt_private *, unsigned char byRetryLimit);
+void MACvSetShortRetryLimit(struct vnt_private *priv, unsigned char 
byRetryLimit);
 
-void MACvSetLongRetryLimit(struct vnt_private *, unsigned char byRetryLimit);
-void MACvGetLongRetryLimit(struct vnt_private *,
+void MACvSetLongRetryLimit(struct vnt_private *priv, unsigned char 
byRetryLimit);
+void MACvGetLongRetryLimit(struct vnt_private *priv,
   unsigned char *pbyRetryLimit);
 
-void MACvSetLoopbackMode(struct vnt_private *, unsigned char byLoopbackMode);
+void MACvSetLoopbackMode(struct vnt_private *priv, unsigned char 
byLoopbackMode);
 
-void MACvSaveContext(struct vnt_private *, unsigned char *pbyCxtBuf);
-void MA

Re: [PATCH 3/3] drivers: virt: Add visorbus to the drivers/virt directory

2017-06-06 Thread kbuild test robot
Hi David,

[auto build test ERROR on staging/staging-testing]
[also build test ERROR on v4.12-rc4 next-20170606]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/David-Kershner/move-visorbus-out-of-staging-to-drivers-virt-visorbus/20170606-070850
config: m68k-allyesconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 4.9.0
reproduce:
wget 
https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=m68k 

All errors (new ones prefixed by >>):

   drivers/virt/visorbus/visorchipset.c: In function 'save_crash_message':
>> drivers/virt/visorbus/visorchipset.c:479:36: error: dereferencing pointer to 
>> incomplete type
  dev_err(&chipset_dev->acpi_device->dev,
   ^
   drivers/virt/visorbus/visorchipset.c:485:36: error: dereferencing pointer to 
incomplete type
  dev_err(&chipset_dev->acpi_device->dev,
   ^
   drivers/virt/visorbus/visorchipset.c:495:36: error: dereferencing pointer to 
incomplete type
  dev_err(&chipset_dev->acpi_device->dev,
   ^
   drivers/virt/visorbus/visorchipset.c:508:37: error: dereferencing pointer to 
incomplete type
   dev_err(&chipset_dev->acpi_device->dev,
^
   drivers/virt/visorbus/visorchipset.c:519:37: error: dereferencing pointer to 
incomplete type
   dev_err(&chipset_dev->acpi_device->dev,
^
   drivers/virt/visorbus/visorchipset.c:525:36: error: dereferencing pointer to 
incomplete type
  dev_err(&chipset_dev->acpi_device->dev,
   ^
   drivers/virt/visorbus/visorchipset.c: In function 'visorbus_create':
   drivers/virt/visorbus/visorchipset.c:582:36: error: dereferencing pointer to 
incomplete type
  dev_err(&chipset_dev->acpi_device->dev,
   ^
   drivers/virt/visorbus/visorchipset.c: In function 'visorbus_configure':
   drivers/virt/visorbus/visorchipset.c:734:35: error: dereferencing pointer to 
incomplete type
 dev_err(&chipset_dev->acpi_device->dev,
  ^
   drivers/virt/visorbus/visorchipset.c: In function 'visorbus_device_create':
   drivers/virt/visorbus/visorchipset.c:755:36: error: dereferencing pointer to 
incomplete type
  dev_err(&chipset_dev->acpi_device->dev,
   ^
   drivers/virt/visorbus/visorchipset.c:762:36: error: dereferencing pointer to 
incomplete type
  dev_err(&chipset_dev->acpi_device->dev,
   ^
   drivers/virt/visorbus/visorchipset.c:770:36: error: dereferencing pointer to 
incomplete type
  dev_err(&chipset_dev->acpi_device->dev,
   ^
   drivers/virt/visorbus/visorchipset.c:796:36: error: dereferencing pointer to 
incomplete type
  dev_err(&chipset_dev->acpi_device->dev,
   ^
   drivers/virt/visorbus/visorchipset.c: In function 
'visorbus_device_changestate':
   drivers/virt/visorbus/visorchipset.c:896:35: error: dereferencing pointer to 
incomplete type
 dev_err(&chipset_dev->acpi_device->dev, "failed: %d\n", err);
  ^
   drivers/virt/visorbus/visorchipset.c: In function 
'parahotplug_request_kickoff':
   drivers/virt/visorbus/visorchipset.c:1188:53: error: dereferencing pointer 
to incomplete type
 return kobject_uevent_env(&chipset_dev->acpi_device->dev.kobj,
^
   drivers/virt/visorbus/visorchipset.c: In function 'chipset_ready_uevent':
   drivers/virt/visorbus/visorchipset.c:1255:48: error: dereferencing pointer 
to incomplete type
 res = kobject_uevent(&chipset_dev->acpi_device->dev.kobj,
   ^
   drivers/virt/visorbus/visorchipset.c: In function 'chipset_selftest_uevent':
   drivers/virt/visorbus/visorchipset.c:1279:52: error: dereferencing pointer 
to incomplete type
 res = kobject_uevent_env(&chipset_dev->acpi_device->dev.kobj,
   ^
   drivers/virt/visorbus/visorchipset.c: In function 'chipset_notready_uevent':
   drivers/virt/visorbus/visorchipset.c:1300:48: error: dereferencing pointer 
to incomplete type
 res = kobject_uevent(&chipset_dev->acpi_device->dev.kobj,
   

[driver-core:bus_type_removal 11/16] arch/powerpc/platforms/pseries/vio.c:1002:23: error: 'cmo_allocs_failed_show' undeclared here (not in a function)

2017-06-06 Thread kbuild test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git 
bus_type_removal
head:   4fe33425a6308e00d6bbe641e66abd3e78f45c3a
commit: ded32ca684d535165ce291bf5cfb9d2f2eae1550 [11/16] powerpc: vio_cmo: use 
dev_groups and not dev_attrs for bus_type
config: powerpc-defconfig (attached as .config)
compiler: powerpc64-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
wget 
https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout ded32ca684d535165ce291bf5cfb9d2f2eae1550
# save the attached .config to linux build tree
make.cross ARCH=powerpc 

All errors (new ones prefixed by >>):

   In file included from include/linux/kobject.h:21:0,
from include/linux/device.h:17,
from include/linux/node.h:17,
from include/linux/cpu.h:16,
from arch/powerpc/platforms/pseries/vio.c:17:
>> arch/powerpc/platforms/pseries/vio.c:1002:23: error: 
>> 'cmo_allocs_failed_show' undeclared here (not in a function)
static DEVICE_ATTR_RW(cmo_allocs_failed);
  ^
   include/linux/sysfs.h:103:10: note: in definition of macro '__ATTR'
 .show = _show,  \
 ^
   include/linux/device.h:586:45: note: in expansion of macro '__ATTR_RW'
 struct device_attribute dev_attr_##_name = __ATTR_RW(_name)
^
   arch/powerpc/platforms/pseries/vio.c:1002:8: note: in expansion of macro 
'DEVICE_ATTR_RW'
static DEVICE_ATTR_RW(cmo_allocs_failed);
   ^~
>> arch/powerpc/platforms/pseries/vio.c:1019:16: error: conflicting types for 
>> 'cmo_entitled_show'
static ssize_t cmo_##name##_show(struct bus_type *bt, char *buf)\
   ^
   arch/powerpc/platforms/pseries/vio.c:1033:1: note: in expansion of macro 
'viobus_cmo_rd_attr'
viobus_cmo_rd_attr(entitled);
^~
   arch/powerpc/platforms/pseries/vio.c:951:16: note: previous definition of 
'cmo_entitled_show' was here
static ssize_t cmo_##name##_show(struct device *dev,\
   ^
   arch/powerpc/platforms/pseries/vio.c:989:1: note: in expansion of macro 
'viodev_cmo_rd_attr'
viodev_cmo_rd_attr(entitled);
^~
>> arch/powerpc/platforms/pseries/vio.c:1019:16: error: conflicting types for 
>> 'cmo_desired_show'
static ssize_t cmo_##name##_show(struct bus_type *bt, char *buf)\
   ^
   arch/powerpc/platforms/pseries/vio.c:1036:1: note: in expansion of macro 
'viobus_cmo_rd_attr'
viobus_cmo_rd_attr(desired);
^~
   arch/powerpc/platforms/pseries/vio.c:951:16: note: previous definition of 
'cmo_desired_show' was here
static ssize_t cmo_##name##_show(struct device *dev,\
   ^
   arch/powerpc/platforms/pseries/vio.c:988:1: note: in expansion of macro 
'viodev_cmo_rd_attr'
viodev_cmo_rd_attr(desired);
^~
   In file included from include/linux/node.h:17:0,
from include/linux/cpu.h:16,
from arch/powerpc/platforms/pseries/vio.c:17:
   include/linux/device.h:588:26: error: redefinition of 'dev_attr_name'
 struct device_attribute dev_attr_##_name = __ATTR_RO(_name)
 ^
   arch/powerpc/platforms/pseries/vio.c:1547:8: note: in expansion of macro 
'DEVICE_ATTR_RO'
static DEVICE_ATTR_RO(name);
   ^~
   include/linux/device.h:588:26: note: previous definition of 'dev_attr_name' 
was here
 struct device_attribute dev_attr_##_name = __ATTR_RO(_name)
 ^
   arch/powerpc/platforms/pseries/vio.c:996:8: note: in expansion of macro 
'DEVICE_ATTR_RO'
static DEVICE_ATTR_RO(name);
   ^~
   include/linux/device.h:588:26: error: redefinition of 'dev_attr_devspec'
 struct device_attribute dev_attr_##_name = __ATTR_RO(_name)
 ^
   arch/powerpc/platforms/pseries/vio.c:1556:8: note: in expansion of macro 
'DEVICE_ATTR_RO'
static DEVICE_ATTR_RO(devspec);
   ^~
   include/linux/device.h:588:26: note: previous definition of 
'dev_attr_devspec' was here
 struct device_attribute dev_attr_##_name = __ATTR_RO(_name)
 ^
   arch/powerpc/platforms/pseries/vio.c:997:8: note: in expansion of macro 
'DEVICE_ATTR_RO'
static DEVICE_ATTR_RO(devspec);
   ^~
   include/linux/device.h:588:26: error: redefinition of 'dev_attr_modalias'
 struct device_attribute dev_attr_##_name = __ATTR_RO(_name)
 ^
   arch/powerpc/platforms/pseries/vio.c:1578:8: note: in expansion of macro 
'DEVICE_ATTR_RO'
static DEVICE_ATTR_RO(modalias);
   ^~
   include/linux/device.h:588:26: note: previous definition of 
'dev_at

[driver-core:bus_type_removal 10/16] arch/powerpc/platforms/pseries/vio.c:1579:26: error: conflicting types for 'vio_dev_attrs'

2017-06-06 Thread kbuild test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git 
bus_type_removal
head:   4fe33425a6308e00d6bbe641e66abd3e78f45c3a
commit: 3b481f66e778743703a6cfea4c4bcdb4bbd138ad [10/16] powerpc: vio: use 
dev_groups and not dev_attrs for bus_type
config: powerpc-defconfig (attached as .config)
compiler: powerpc64-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
wget 
https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 3b481f66e778743703a6cfea4c4bcdb4bbd138ad
# save the attached .config to linux build tree
make.cross ARCH=powerpc 

All errors (new ones prefixed by >>):

>> arch/powerpc/platforms/pseries/vio.c:1579:26: error: conflicting types for 
>> 'vio_dev_attrs'
static struct attribute *vio_dev_attrs[] = {
 ^
   arch/powerpc/platforms/pseries/vio.c:1573:32: note: previous definition of 
'vio_dev_attrs' was here
static struct device_attribute vio_dev_attrs[] = {
   ^
>> arch/powerpc/platforms/pseries/vio.c:1573:32: error: 'vio_dev_attrs' defined 
>> but not used [-Werror=unused-variable]
   cc1: all warnings being treated as errors

vim +/vio_dev_attrs +1579 arch/powerpc/platforms/pseries/vio.c

  1567  }
  1568  
  1569  return sprintf(buf, "vio:T%sS%s\n", vio_dev->type, cp);
  1570  }
  1571  static DEVICE_ATTR_RO(modalias);
  1572  
> 1573  static struct device_attribute vio_dev_attrs[] = {
  1574  __ATTR_RO(name),
  1575  __ATTR_RO(devspec),
  1576  __ATTR_RO(modalias),
  1577  __ATTR_NULL
  1578  };
> 1579  static struct attribute *vio_dev_attrs[] = {
  1580  &dev_attr_name.attr,
  1581  &dev_attr_devspec.attr,
  1582  &dev_attr_modalias.attr,

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[driver-core:bus_type_removal 8/16] arch/powerpc/platforms/ps3/system-bus.c:480:18: error: 'ps3_system_bus_attrs' undeclared here (not in a function)

2017-06-06 Thread kbuild test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git 
bus_type_removal
head:   4fe33425a6308e00d6bbe641e66abd3e78f45c3a
commit: 5e6ce1375ec9909a33dd94942e8c85eaa52edf58 [8/16] powerpc: ps3: use 
dev_groups and not dev_attrs for bus_type
config: powerpc-defconfig (attached as .config)
compiler: powerpc64-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
wget 
https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 5e6ce1375ec9909a33dd94942e8c85eaa52edf58
# save the attached .config to linux build tree
make.cross ARCH=powerpc 

All errors (new ones prefixed by >>):

   In file included from include/linux/kobject.h:21:0,
from include/linux/device.h:17,
from include/linux/dma-mapping.h:6,
from arch/powerpc/platforms/ps3/system-bus.c:24:
>> arch/powerpc/platforms/ps3/system-bus.c:480:18: error: 
>> 'ps3_system_bus_attrs' undeclared here (not in a function)
ATTRIBUTE_GROUPS(ps3_system_bus);
 ^
   include/linux/sysfs.h:148:11: note: in definition of macro 'ATTRIBUTE_GROUPS'
 .attrs = _name##_attrs, \
  ^
>> arch/powerpc/platforms/ps3/system-bus.c:489:16: error: 
>> 'ps3_system_bus_dev_groups' undeclared here (not in a function)
 .dev_groups = ps3_system_bus_dev_groups,
   ^
   In file included from include/linux/kobject.h:21:0,
from include/linux/device.h:17,
from include/linux/dma-mapping.h:6,
from arch/powerpc/platforms/ps3/system-bus.c:24:
>> arch/powerpc/platforms/ps3/system-bus.c:480:18: error: 
>> 'ps3_system_bus_groups' defined but not used [-Werror=unused-variable]
ATTRIBUTE_GROUPS(ps3_system_bus);
 ^
   include/linux/sysfs.h:141:38: note: in definition of macro 
'__ATTRIBUTE_GROUPS'
static const struct attribute_group *_name##_groups[] = { \
 ^
   arch/powerpc/platforms/ps3/system-bus.c:480:1: note: in expansion of macro 
'ATTRIBUTE_GROUPS'
ATTRIBUTE_GROUPS(ps3_system_bus);
^~~~
>> arch/powerpc/platforms/ps3/system-bus.c:476:26: error: 
>> 'ps3_system_bus_dev_attrs' defined but not used [-Werror=unused-variable]
static struct attribute *ps3_system_bus_dev_attrs[] = {
 ^~~~
   cc1: all warnings being treated as errors

vim +/ps3_system_bus_attrs +480 arch/powerpc/platforms/ps3/system-bus.c

   470 dev->match_sub_id);
   471  
   472  return (len >= PAGE_SIZE) ? (PAGE_SIZE - 1) : len;
   473  }
   474  static DEVICE_ATTR_RO(modalias);
   475  
 > 476  static struct attribute *ps3_system_bus_dev_attrs[] = {
   477  &dev_attr_modalias.attr,
   478  NULL,
   479  };
 > 480  ATTRIBUTE_GROUPS(ps3_system_bus);
   481  
   482  struct bus_type ps3_system_bus_type = {
   483  .name = "ps3_system_bus",
   484  .match = ps3_system_bus_match,
   485  .uevent = ps3_system_bus_uevent,
   486  .probe = ps3_system_bus_probe,
   487  .remove = ps3_system_bus_remove,
   488  .shutdown = ps3_system_bus_shutdown,
 > 489  .dev_groups = ps3_system_bus_dev_groups,
   490  };
   491  
   492  static int __init ps3_system_bus_init(void)

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 0/3] move visorbus out of staging to drivers/virt/visorbus

2017-06-06 Thread Greg KH
On Tue, Jun 06, 2017 at 06:20:17PM +, Kershner, David A wrote:
> 
> 
> > -Original Message-
> > From: Greg KH [mailto:gre...@linuxfoundation.org]
> > Sent: Tuesday, June 6, 2017 11:06 AM
> > To: Kershner, David A 
> > Cc: cor...@lwn.net; t...@linutronix.de; mi...@kernel.org; akpm@linux-
> > foundation.org; jes.soren...@gmail.com; linux-ker...@vger.kernel.org;
> > linux-...@vger.kernel.org; driverdev-devel@linuxdriverproject.org; *S-Par-
> > Maintainer 
> > Subject: Re: [PATCH 0/3] move visorbus out of staging to
> > drivers/virt/visorbus
> > 
> > On Tue, Jun 06, 2017 at 04:54:30PM +0200, Greg KH wrote:
> > > On Tue, Jun 06, 2017 at 04:53:22PM +0200, Greg KH wrote:
> > > > On Tue, Jun 06, 2017 at 04:49:09PM +0200, Greg KH wrote:
> > > > > On Mon, Jun 05, 2017 at 04:07:29PM -0400, David Kershner wrote:
> > > > > > This patchset moves drivers/staging/unisys/include to
> > > > > > include/linux/visorbus, and moves drivers/staging/unisys/visorbus to
> > > > > > drivers/virt/visorbus.
> > > > >
> > > > > Um, are you thinking it is ready to be moved?  Have you asked for
> > > > > another review?
> > > > >
> 
> Thank you for taking a quick look at our patch series. Part of the motivation
> behind this submission was, in fact, to initiate another code review. What is
> the formal procedure for initiating a code review?

Send an email that says, "Hey Greg, we think the code is ready to be
moved out of staging, can you review it to see if we have missed
anything?"

Of course, do it _AFTER_ you have fixed up the checkpatch.pl issues.
That's not even done yet...

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 0/3] move visorbus out of staging to drivers/virt/visorbus

2017-06-06 Thread Joe Perches
On Tue, 2017-06-06 at 16:53 +0200, Greg KH wrote:
> On Tue, Jun 06, 2017 at 04:49:09PM +0200, Greg KH wrote:
> > I noticed that in drivers/staging/unisys/visorbus/visorbus_main.c, you
> > have 2 tabs for your 'struct attribute' variables, which is really odd.
[]
> Also, many of the attribute callbacks in that file seem to all have
> their leading '{' in the wrong place.  Odd that checkpatch.pl doesn't
> catch that...

checkpatch doesn't really check much about inconsistent
indentation.  I believe the only new statement indentation
check is after an if.

For instance, checkpatch doesn't emit a warning on this code:

struct foo {
int bar;
};

struct foo *alloc_foo(void)
{
struct foo *baz = malloc(sizeof(struct foo));
if (baz)
baz->bar = 1;
return baz;
}

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH 0/3] move visorbus out of staging to drivers/virt/visorbus

2017-06-06 Thread Kershner, David A


> -Original Message-
> From: Greg KH [mailto:gre...@linuxfoundation.org]
> Sent: Tuesday, June 6, 2017 11:06 AM
> To: Kershner, David A 
> Cc: cor...@lwn.net; t...@linutronix.de; mi...@kernel.org; akpm@linux-
> foundation.org; jes.soren...@gmail.com; linux-ker...@vger.kernel.org;
> linux-...@vger.kernel.org; driverdev-devel@linuxdriverproject.org; *S-Par-
> Maintainer 
> Subject: Re: [PATCH 0/3] move visorbus out of staging to
> drivers/virt/visorbus
> 
> On Tue, Jun 06, 2017 at 04:54:30PM +0200, Greg KH wrote:
> > On Tue, Jun 06, 2017 at 04:53:22PM +0200, Greg KH wrote:
> > > On Tue, Jun 06, 2017 at 04:49:09PM +0200, Greg KH wrote:
> > > > On Mon, Jun 05, 2017 at 04:07:29PM -0400, David Kershner wrote:
> > > > > This patchset moves drivers/staging/unisys/include to
> > > > > include/linux/visorbus, and moves drivers/staging/unisys/visorbus to
> > > > > drivers/virt/visorbus.
> > > >
> > > > Um, are you thinking it is ready to be moved?  Have you asked for
> > > > another review?
> > > >

Thank you for taking a quick look at our patch series. Part of the motivation
behind this submission was, in fact, to initiate another code review. What is
the formal procedure for initiating a code review?

> > > > In a totally random chance, I was doing some driver core work today
> and
> > > > I noticed that in drivers/staging/unisys/visorbus/visorbus_main.c, you
> > > > have 2 tabs for your 'struct attribute' variables, which is really odd.
> > > >

Sorry I missed that; I guess my eyes glazed over by the time I got to that file,
and I was expecting checkpatch to catch that. Now I know better, and I will be
looking for more things. Thanks for catching.

> > > > Also, you should be using the ATTRIBUTE_GROUPS() macro for them
> instead
> > > > of having to "open code" the struct attribute_group lists.
> > > >
> > > > So either you all have horrible luck in that I just happened to find the
> > > > only remaining problem, or that you should proabably ask for a good
> code
> > > > audit, I haven't looked at the code before today since the last round of
> > > > "fun" I found in just one other random file :)
> > >
> > > Also, many of the attribute callbacks in that file seem to all have
> > > their leading '{' in the wrong place.  Odd that checkpatch.pl doesn't
> > > catch that...
> > >
> > > partition_handle_show() is one such example that is obviously wrong.
> > >
> > > There's also one checkpatch.pl warning for it, which should probably be
> > > resolved as well.
> >
> > drivers/staging/unisys/visorbus/visorbus_main.c:1035: WARNING: Prefer
> using '"%s...", __func__' to using 'create_bus_instance', this function's 
> name,
> in a string
> >
> > to be specific, something you should have caught, right?
> >
> > Are you sure this is ready to be moved out of staging?  :(
> 
> Eek, I can't look away...
> 
> You do this a bunch:
>   if (dev->visorchannel) {
>   visorchannel_destroy(dev->visorchannel);
> 
> yet the first thing that visorchannel_destroy() does is check for null.
> So, no need to test this twice, right, only do so in the function, that
> will make your code flow a lot "smoother" where ever you are calling
> this.
> 
> Ok, I'll stop now, gotta go find some dinner...
> 

We will do some more internal reviews, and send out fixes for things
we find. I hope you enjoyed your dinner.

> greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] atomisp: ensure that status values > 7 are reported as errors

2017-06-06 Thread walter harms


Am 06.06.2017 18:30, schrieb Colin King:
> From: Colin Ian King 
> 
> The current code checks if a status value is greater than 7 and
> sets the status string as "ERROR" and then over writes the
> string based on the bottom 3 bits of the value. Instead, fix this by
> only checking on the bottom 3 bits of the value if the value is less
> than 8.
> 
> Detected by CoverityScan, CID#1416607 ("Unused value")
> 
> Signed-off-by: Colin Ian King 
> ---
>  .../css2400/runtime/debug/src/ia_css_debug.c   | 141 
> +++--
>  1 file changed, 72 insertions(+), 69 deletions(-)
> 
> diff --git 
> a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/debug/src/ia_css_debug.c
>  
> b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/debug/src/ia_css_debug.c
> index bcc0d464084f..80d6fe29f30d 100644
> --- 
> a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/debug/src/ia_css_debug.c
> +++ 
> b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/debug/src/ia_css_debug.c
> @@ -765,28 +765,29 @@ static void 
> debug_print_if_state(input_formatter_state_t *state, const char *id)
>  
>   val = state->fsm_sync_status;
>  
> - if (val > 7)
> + if (val > 7) {
>   fsm_sync_status_str = "ERROR";
> -
> - switch (val & 0x7) {
> - case 0:
> - fsm_sync_status_str = "idle";
> - break;
> - case 1:
> - fsm_sync_status_str = "request frame";
> - break;
> - case 2:
> - fsm_sync_status_str = "request lines";
> - break;
> - case 3:
> - fsm_sync_status_str = "request vectors";
> - break;
> - case 4:
> - fsm_sync_status_str = "send acknowledge";
> - break;
> - default:
> - fsm_sync_status_str = "unknown";
> - break;
> + } else {
> + switch (val & 0x7) {
> + case 0:
> + fsm_sync_status_str = "idle";
> + break;
> + case 1:
> + fsm_sync_status_str = "request frame";
> + break;
> + case 2:
> + fsm_sync_status_str = "request lines";
> + break;
> + case 3:
> + fsm_sync_status_str = "request vectors";
> + break;
> + case 4:
> + fsm_sync_status_str = "send acknowledge";
> + break;
> + default:
> + fsm_sync_status_str = "unknown";
> + break;
> + }
>   }
>  
>   ia_css_debug_dtrace(2, "\t\t%-32s: (0x%X: %s)\n",
> @@ -799,34 +800,35 @@ static void 
> debug_print_if_state(input_formatter_state_t *state, const char *id)
>  
>   val = state->fsm_crop_status;
>  
> - if (val > 7)
> + if (val > 7) {
>   fsm_crop_status_str = "ERROR";
> -
> - switch (val & 0x7) {
> - case 0:
> - fsm_crop_status_str = "idle";
> - break;
> - case 1:
> - fsm_crop_status_str = "wait line";
> - break;
> - case 2:
> - fsm_crop_status_str = "crop line";
> - break;
> - case 3:
> - fsm_crop_status_str = "crop pixel";
> - break;
> - case 4:
> - fsm_crop_status_str = "pass pixel";
> - break;
> - case 5:
> - fsm_crop_status_str = "pass line";
> - break;
> - case 6:
> - fsm_crop_status_str = "lost line";
> - break;
> - default:
> - fsm_crop_status_str = "unknown";
> - break;
> + } else {
> + switch (val & 0x7) {
> + case 0:
> + fsm_crop_status_str = "idle";
> + break;
> + case 1:
> + fsm_crop_status_str = "wait line";
> + break;
> + case 2:
> + fsm_crop_status_str = "crop line";
> + break;
> + case 3:
> + fsm_crop_status_str = "crop pixel";
> + break;
> + case 4:
> + fsm_crop_status_str = "pass pixel";
> + break;
> + case 5:
> + fsm_crop_status_str = "pass line";
> + break;
> + case 6:
> + fsm_crop_status_str = "lost line";
> + break;
> + default:
> + fsm_crop_status_str = "unknown";
> + break;
> + }


why not:
case 7:
fsm_crop_status_str = "unknown";
break;

default:
fsm_crop_status_str = "ERROR";
break;


looks more straigth to me..
same below.

less execptions, less errors

re,
 wh

>   }
>   ia_css_debug_dtrace(2, "\t\t%-32s: (

[PATCH] atomisp: ensure that status values > 7 are reported as errors

2017-06-06 Thread Colin King
From: Colin Ian King 

The current code checks if a status value is greater than 7 and
sets the status string as "ERROR" and then over writes the
string based on the bottom 3 bits of the value. Instead, fix this by
only checking on the bottom 3 bits of the value if the value is less
than 8.

Detected by CoverityScan, CID#1416607 ("Unused value")

Signed-off-by: Colin Ian King 
---
 .../css2400/runtime/debug/src/ia_css_debug.c   | 141 +++--
 1 file changed, 72 insertions(+), 69 deletions(-)

diff --git 
a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/debug/src/ia_css_debug.c
 
b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/debug/src/ia_css_debug.c
index bcc0d464084f..80d6fe29f30d 100644
--- 
a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/debug/src/ia_css_debug.c
+++ 
b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/debug/src/ia_css_debug.c
@@ -765,28 +765,29 @@ static void debug_print_if_state(input_formatter_state_t 
*state, const char *id)
 
val = state->fsm_sync_status;
 
-   if (val > 7)
+   if (val > 7) {
fsm_sync_status_str = "ERROR";
-
-   switch (val & 0x7) {
-   case 0:
-   fsm_sync_status_str = "idle";
-   break;
-   case 1:
-   fsm_sync_status_str = "request frame";
-   break;
-   case 2:
-   fsm_sync_status_str = "request lines";
-   break;
-   case 3:
-   fsm_sync_status_str = "request vectors";
-   break;
-   case 4:
-   fsm_sync_status_str = "send acknowledge";
-   break;
-   default:
-   fsm_sync_status_str = "unknown";
-   break;
+   } else {
+   switch (val & 0x7) {
+   case 0:
+   fsm_sync_status_str = "idle";
+   break;
+   case 1:
+   fsm_sync_status_str = "request frame";
+   break;
+   case 2:
+   fsm_sync_status_str = "request lines";
+   break;
+   case 3:
+   fsm_sync_status_str = "request vectors";
+   break;
+   case 4:
+   fsm_sync_status_str = "send acknowledge";
+   break;
+   default:
+   fsm_sync_status_str = "unknown";
+   break;
+   }
}
 
ia_css_debug_dtrace(2, "\t\t%-32s: (0x%X: %s)\n",
@@ -799,34 +800,35 @@ static void debug_print_if_state(input_formatter_state_t 
*state, const char *id)
 
val = state->fsm_crop_status;
 
-   if (val > 7)
+   if (val > 7) {
fsm_crop_status_str = "ERROR";
-
-   switch (val & 0x7) {
-   case 0:
-   fsm_crop_status_str = "idle";
-   break;
-   case 1:
-   fsm_crop_status_str = "wait line";
-   break;
-   case 2:
-   fsm_crop_status_str = "crop line";
-   break;
-   case 3:
-   fsm_crop_status_str = "crop pixel";
-   break;
-   case 4:
-   fsm_crop_status_str = "pass pixel";
-   break;
-   case 5:
-   fsm_crop_status_str = "pass line";
-   break;
-   case 6:
-   fsm_crop_status_str = "lost line";
-   break;
-   default:
-   fsm_crop_status_str = "unknown";
-   break;
+   } else {
+   switch (val & 0x7) {
+   case 0:
+   fsm_crop_status_str = "idle";
+   break;
+   case 1:
+   fsm_crop_status_str = "wait line";
+   break;
+   case 2:
+   fsm_crop_status_str = "crop line";
+   break;
+   case 3:
+   fsm_crop_status_str = "crop pixel";
+   break;
+   case 4:
+   fsm_crop_status_str = "pass pixel";
+   break;
+   case 5:
+   fsm_crop_status_str = "pass line";
+   break;
+   case 6:
+   fsm_crop_status_str = "lost line";
+   break;
+   default:
+   fsm_crop_status_str = "unknown";
+   break;
+   }
}
ia_css_debug_dtrace(2, "\t\t%-32s: (0x%X: %s)\n",
"FSM Crop Status", val, fsm_crop_status_str);
@@ -852,28 +854,29 @@ static void debug_print_if_state(input_formatter_state_t 
*state, const char *id)
 
val = state->fsm_padding_status;
 
-   if (val > 7)
+   if (val > 7) {
fsm_padding_status_str = "ERROR";
-
-   switch (val & 0x7) {
-   case 0:
-  

Re: [PATCH 0/3] move visorbus out of staging to drivers/virt/visorbus

2017-06-06 Thread Joe Perches
On Tue, 2017-06-06 at 17:39 +0200, Greg KH wrote:
> On Tue, Jun 06, 2017 at 08:33:49AM -0700, Joe Perches wrote:
> > On Tue, 2017-06-06 at 16:53 +0200, Greg KH wrote:
> > > On Tue, Jun 06, 2017 at 04:49:09PM +0200, Greg KH wrote:
> > > > I noticed that in drivers/staging/unisys/visorbus/visorbus_main.c, you
> > > > have 2 tabs for your 'struct attribute' variables, which is really odd.
> > 
> > []
> > > Also, many of the attribute callbacks in that file seem to all have
> > > their leading '{' in the wrong place.  Odd that checkpatch.pl doesn't
> > > catch that...
[]
> the following code in that file should be caught, right:
> 
> static ssize_t partition_handle_show(struct device *dev,
>  struct device_attribute *attr,
>  char *buf) {
> struct visor_device *vdev = to_visor_device(dev);
> u64 handle = visorchannel_get_clientpartition(vdev->visorchannel);
> 
> return sprintf(buf, "0x%llx\n", handle);
> }
> static DEVICE_ATTR_RO(partition_handle);

Not really.

> The initial { is in the wrong place...

True.

Please understand that checkpatch looks at patches one line
at a time.  It's not very smart about function definitions
or context.

checkpatch's function definition code is pretty limited.
It can miss a lot of style misuses.

Single line function definitions brace tests work well.
Multiple line function definitions do not.

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 0/3] move visorbus out of staging to drivers/virt/visorbus

2017-06-06 Thread Greg KH
On Tue, Jun 06, 2017 at 08:52:27AM -0700, Joe Perches wrote:
> On Tue, 2017-06-06 at 17:39 +0200, Greg KH wrote:
> > On Tue, Jun 06, 2017 at 08:33:49AM -0700, Joe Perches wrote:
> > > On Tue, 2017-06-06 at 16:53 +0200, Greg KH wrote:
> > > > On Tue, Jun 06, 2017 at 04:49:09PM +0200, Greg KH wrote:
> > > > > I noticed that in drivers/staging/unisys/visorbus/visorbus_main.c, you
> > > > > have 2 tabs for your 'struct attribute' variables, which is really 
> > > > > odd.
> > > 
> > > []
> > > > Also, many of the attribute callbacks in that file seem to all have
> > > > their leading '{' in the wrong place.  Odd that checkpatch.pl doesn't
> > > > catch that...
> []
> > the following code in that file should be caught, right:
> > 
> > static ssize_t partition_handle_show(struct device *dev,
> >  struct device_attribute *attr,
> >  char *buf) {
> > struct visor_device *vdev = to_visor_device(dev);
> > u64 handle = visorchannel_get_clientpartition(vdev->visorchannel);
> > 
> > return sprintf(buf, "0x%llx\n", handle);
> > }
> > static DEVICE_ATTR_RO(partition_handle);
> 
> Not really.
> 
> > The initial { is in the wrong place...
> 
> True.
> 
> Please understand that checkpatch looks at patches one line
> at a time.  It's not very smart about function definitions
> or context.
> 
> checkpatch's function definition code is pretty limited.
> It can miss a lot of style misuses.
> 
> Single line function definitions brace tests work well.
> Multiple line function definitions do not.

Ok, that makes sense why this is missed.  No big deal, a simple visual
inspection shows stuff like this up really easily, which obviously no
one did yet on this file :)

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 0/3] move visorbus out of staging to drivers/virt/visorbus

2017-06-06 Thread Greg KH
On Tue, Jun 06, 2017 at 08:33:49AM -0700, Joe Perches wrote:
> On Tue, 2017-06-06 at 16:53 +0200, Greg KH wrote:
> > On Tue, Jun 06, 2017 at 04:49:09PM +0200, Greg KH wrote:
> > > I noticed that in drivers/staging/unisys/visorbus/visorbus_main.c, you
> > > have 2 tabs for your 'struct attribute' variables, which is really odd.
> []
> > Also, many of the attribute callbacks in that file seem to all have
> > their leading '{' in the wrong place.  Odd that checkpatch.pl doesn't
> > catch that...
> 
> checkpatch doesn't really check much about inconsistent
> indentation.  I believe the only new statement indentation
> check is after an if.
> 
> For instance, checkpatch doesn't emit a warning on this code:
> 
> struct foo {
>   int bar;
> };
> 
> struct foo *alloc_foo(void)
> {
>   struct foo *baz = malloc(sizeof(struct foo));
>   if (baz)
>   baz->bar = 1;
>   return baz;
> }

Ok, but the following code in that file should be caught, right:

static ssize_t partition_handle_show(struct device *dev,
 struct device_attribute *attr,
 char *buf) {
struct visor_device *vdev = to_visor_device(dev);
u64 handle = visorchannel_get_clientpartition(vdev->visorchannel);

return sprintf(buf, "0x%llx\n", handle);
}
static DEVICE_ATTR_RO(partition_handle);


The initial { is in the wrong place...

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 16/18] staging: fsl-dpaa2/eth: Errors checking update

2017-06-06 Thread Joe Perches
On Tue, 2017-06-06 at 10:00 -0500, Ioana Radulescu wrote:
> On the egress path, frame errors are reported using both a FD control
> field and the frame annotation status. The current code only handles
> FAS errors. Update to look at both fields when accounting Tx errors.

[]

> Note: Checkpatch complains about a macro(DPAA2_FAS_RX_ERR_MASK) being
> too complex. It's just a bitmask with all possible Rx FAS error bits
> and I'm not sure how the extra parantheses recommended by checkpatch
> would help, so leaving it as is.

Ignoring the checkpatch message is the right thing to do.

It's just a false positive caused by the incomplete context
around the macro definition.

> @@ -177,7 +190,7 @@ struct dpaa2_fas {
>  /* L4 csum error */
>  #define DPAA2_FAS_L4CE   0x0001
>  /* Possible errors on the ingress path */
> -#define DPAA2_ETH_RX_ERR_MASK(DPAA2_FAS_KSE  | \
> +#define DPAA2_FAS_RX_ERR_MASK(DPAA2_FAS_KSE  | \
>DPAA2_FAS_EOFHE| \
>DPAA2_FAS_MNLE | \
>DPAA2_FAS_TIDE | \
> @@ -191,7 +204,7 @@ struct dpaa2_fas {

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 11/18] staging: fsl-dpaa2/eth: Update ethtool stats names

2017-06-06 Thread Ioana Radulescu
Add a label to the ethtool statistics counters, to differentiate
between hardware counters and driver specific ones.

Signed-off-by: Ioana Radulescu 
---
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c | 54 +++---
 1 file changed, 27 insertions(+), 27 deletions(-)

diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c 
b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c
index 6a331c74e542..5312edc26f01 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c
@@ -35,40 +35,40 @@
 
 /* To be kept in sync with DPNI statistics */
 static char dpaa2_ethtool_stats[][ETH_GSTRING_LEN] = {
-   "rx frames",
-   "rx bytes",
-   "rx mcast frames",
-   "rx mcast bytes",
-   "rx bcast frames",
-   "rx bcast bytes",
-   "tx frames",
-   "tx bytes",
-   "tx mcast frames",
-   "tx mcast bytes",
-   "tx bcast frames",
-   "tx bcast bytes",
-   "rx filtered frames",
-   "rx discarded frames",
-   "rx nobuffer discards",
-   "tx discarded frames",
-   "tx confirmed frames",
+   "[hw] rx frames",
+   "[hw] rx bytes",
+   "[hw] rx mcast frames",
+   "[hw] rx mcast bytes",
+   "[hw] rx bcast frames",
+   "[hw] rx bcast bytes",
+   "[hw] tx frames",
+   "[hw] tx bytes",
+   "[hw] tx mcast frames",
+   "[hw] tx mcast bytes",
+   "[hw] tx bcast frames",
+   "[hw] tx bcast bytes",
+   "[hw] rx filtered frames",
+   "[hw] rx discarded frames",
+   "[hw] rx nobuffer discards",
+   "[hw] tx discarded frames",
+   "[hw] tx confirmed frames",
 };
 
 #define DPAA2_ETH_NUM_STATSARRAY_SIZE(dpaa2_ethtool_stats)
 
 static char dpaa2_ethtool_extras[][ETH_GSTRING_LEN] = {
/* per-cpu stats */
-   "tx conf frames",
-   "tx conf bytes",
-   "tx sg frames",
-   "tx sg bytes",
-   "rx sg frames",
-   "rx sg bytes",
-   "enqueue portal busy",
+   "[drv] tx conf frames",
+   "[drv] tx conf bytes",
+   "[drv] tx sg frames",
+   "[drv] tx sg bytes",
+   "[drv] rx sg frames",
+   "[drv] rx sg bytes",
+   "[drv] enqueue portal busy",
/* Channel stats */
-   "dequeue portal busy",
-   "channel pull errors",
-   "cdan",
+   "[drv] dequeue portal busy",
+   "[drv] channel pull errors",
+   "[drv] cdan",
 };
 
 #define DPAA2_ETH_NUM_EXTRA_STATS  ARRAY_SIZE(dpaa2_ethtool_extras)
-- 
2.11.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 0/3] move visorbus out of staging to drivers/virt/visorbus

2017-06-06 Thread Greg KH
On Tue, Jun 06, 2017 at 04:54:30PM +0200, Greg KH wrote:
> On Tue, Jun 06, 2017 at 04:53:22PM +0200, Greg KH wrote:
> > On Tue, Jun 06, 2017 at 04:49:09PM +0200, Greg KH wrote:
> > > On Mon, Jun 05, 2017 at 04:07:29PM -0400, David Kershner wrote:
> > > > This patchset moves drivers/staging/unisys/include to
> > > > include/linux/visorbus, and moves drivers/staging/unisys/visorbus to
> > > > drivers/virt/visorbus.
> > > 
> > > Um, are you thinking it is ready to be moved?  Have you asked for
> > > another review?
> > > 
> > > In a totally random chance, I was doing some driver core work today and
> > > I noticed that in drivers/staging/unisys/visorbus/visorbus_main.c, you
> > > have 2 tabs for your 'struct attribute' variables, which is really odd.
> > > 
> > > Also, you should be using the ATTRIBUTE_GROUPS() macro for them instead
> > > of having to "open code" the struct attribute_group lists.
> > > 
> > > So either you all have horrible luck in that I just happened to find the
> > > only remaining problem, or that you should proabably ask for a good code
> > > audit, I haven't looked at the code before today since the last round of
> > > "fun" I found in just one other random file :)
> > 
> > Also, many of the attribute callbacks in that file seem to all have
> > their leading '{' in the wrong place.  Odd that checkpatch.pl doesn't
> > catch that...
> > 
> > partition_handle_show() is one such example that is obviously wrong.
> > 
> > There's also one checkpatch.pl warning for it, which should probably be
> > resolved as well.
> 
> drivers/staging/unisys/visorbus/visorbus_main.c:1035: WARNING: Prefer using 
> '"%s...", __func__' to using 'create_bus_instance', this function's name, in 
> a string
> 
> to be specific, something you should have caught, right?
> 
> Are you sure this is ready to be moved out of staging?  :(

Eek, I can't look away...

You do this a bunch:
if (dev->visorchannel) {
visorchannel_destroy(dev->visorchannel);

yet the first thing that visorchannel_destroy() does is check for null.
So, no need to test this twice, right, only do so in the function, that
will make your code flow a lot "smoother" where ever you are calling
this.

Ok, I'll stop now, gotta go find some dinner...

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 15/18] staging: fsl-dpaa2/eth: Reorder priv fields

2017-06-06 Thread Ioana Radulescu
Reorder fields in the device's private structure such that
the ones most used on the hotpath are at the beginning of
the structure.

This brings a small performance improvement due to better
cache usage.

Signed-off-by: Ioana Radulescu 
---
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h | 26 +++---
 1 file changed, 11 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h 
b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h
index 886a0681fee1..c760e9b77e22 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h
@@ -290,34 +290,30 @@ struct dpaa2_eth_hash_fields {
 /* Driver private data */
 struct dpaa2_eth_priv {
struct net_device *net_dev;
+   /* Standard statistics */
+   struct rtnl_link_stats64 __percpu *percpu_stats;
+   /* Extra stats, in addition to the ones known by the kernel */
+   struct dpaa2_eth_drv_stats __percpu *percpu_extras;
+   struct iommu_domain *iommu_domain;
+   u16 tx_data_offset;
+   u16 bpid;
+   u16 tx_qdid;
 
u8 num_fqs;
-   struct dpaa2_eth_fq fq[DPAA2_ETH_MAX_QUEUES];
-
u8 num_channels;
+   struct dpaa2_eth_fq fq[DPAA2_ETH_MAX_QUEUES];
struct dpaa2_eth_channel *channel[DPAA2_ETH_MAX_DPCONS];
 
+   struct fsl_mc_io *mc_io;
+   u16 mc_token;
struct dpni_attr dpni_attrs;
-   u16 tx_data_offset;
-
struct fsl_mc_device *dpbp_dev;
-   u16 bpid;
-   struct iommu_domain *iommu_domain;
 
-   u16 tx_qdid;
-   struct fsl_mc_io *mc_io;
/* Cores which have an affine DPIO/DPCON.
 * This is the cpu set on which Rx and Tx conf frames are processed
 */
struct cpumask dpio_cpumask;
 
-   /* Standard statistics */
-   struct rtnl_link_stats64 __percpu *percpu_stats;
-   /* Extra stats, in addition to the ones known by the kernel */
-   struct dpaa2_eth_drv_stats __percpu *percpu_extras;
-
-   u16 mc_token;
-
struct dpni_link_state link_state;
bool do_link_poll;
struct task_struct *poll_thread;
-- 
2.11.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 03/18] staging: fsl-dpaa2/eth: Fix return type of ndo_start_xmit

2017-06-06 Thread Ioana Radulescu
ndo_start_xmit() returns a value of type netdev_tx_t. Update
our ndo function to use the correct type.

Signed-off-by: Ioana Radulescu 
---
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c 
b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
index f0ef3a7c0f73..a9e245df2488 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
@@ -551,7 +551,7 @@ static void free_tx_fd(const struct dpaa2_eth_priv *priv,
dev_kfree_skb(skb);
 }
 
-static int dpaa2_eth_tx(struct sk_buff *skb, struct net_device *net_dev)
+static netdev_tx_t dpaa2_eth_tx(struct sk_buff *skb, struct net_device 
*net_dev)
 {
struct dpaa2_eth_priv *priv = netdev_priv(net_dev);
struct dpaa2_fd fd;
-- 
2.11.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 17/18] staging: fsl-dpaa2/eth: Refactor MAC address setup

2017-06-06 Thread Ioana Radulescu
The driver logic for allocating a MAC address to a net device
is complicated enough to deserve a function of its own. While
here, cleanup a bit the code comments.

Signed-off-by: Ioana Radulescu 
---
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | 46 --
 1 file changed, 29 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c 
b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
index 7dca8c2e5ff9..3f7f61b9c462 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
@@ -2162,15 +2162,12 @@ static void free_rings(struct dpaa2_eth_priv *priv)
dpaa2_io_store_destroy(priv->channel[i]->store);
 }
 
-static int netdev_init(struct net_device *net_dev)
+static int set_mac_addr(struct dpaa2_eth_priv *priv)
 {
-   int err;
+   struct net_device *net_dev = priv->net_dev;
struct device *dev = net_dev->dev.parent;
-   struct dpaa2_eth_priv *priv = netdev_priv(net_dev);
u8 mac_addr[ETH_ALEN], dpni_mac_addr[ETH_ALEN];
-   u8 bcast_addr[ETH_ALEN];
-
-   net_dev->netdev_ops = &dpaa2_eth_ops;
+   int err;
 
/* Get firmware address, if any */
err = dpni_get_port_mac_addr(priv->mc_io, 0, priv->mc_token, mac_addr);
@@ -2183,7 +2180,7 @@ static int netdev_init(struct net_device *net_dev)
err = dpni_get_primary_mac_addr(priv->mc_io, 0, priv->mc_token,
dpni_mac_addr);
if (err) {
-   dev_err(dev, "dpni_get_primary_mac_addr() failed (%d)\n", err);
+   dev_err(dev, "dpni_get_primary_mac_addr() failed\n");
return err;
}
 
@@ -2201,18 +2198,19 @@ static int netdev_init(struct net_device *net_dev)
}
memcpy(net_dev->dev_addr, mac_addr, net_dev->addr_len);
} else if (is_zero_ether_addr(dpni_mac_addr)) {
-   /* Fills in net_dev->dev_addr, as required by
-* register_netdevice()
+   /* No MAC address configured, fill in net_dev->dev_addr
+* with a random one
 */
eth_hw_addr_random(net_dev);
-   /* Make the user aware, without cluttering the boot log */
-   dev_dbg_once(dev, " device(s) have all-zero hwaddr, replaced 
with random\n");
+   dev_dbg_once(dev, "device(s) have all-zero hwaddr, replaced 
with random\n");
+
err = dpni_set_primary_mac_addr(priv->mc_io, 0, priv->mc_token,
net_dev->dev_addr);
if (err) {
-   dev_err(dev, "dpni_set_primary_mac_addr(): %d\n", err);
+   dev_err(dev, "dpni_set_primary_mac_addr() failed\n");
return err;
}
+
/* Override NET_ADDR_RANDOM set by eth_hw_addr_random(); for all
 * practical purposes, this will be our "permanent" mac address,
 * at least until the next reboot. This move will also permit
@@ -2226,14 +2224,28 @@ static int netdev_init(struct net_device *net_dev)
memcpy(net_dev->dev_addr, dpni_mac_addr, net_dev->addr_len);
}
 
-   /* Explicitly add the broadcast address to the MAC filtering table;
-* the MC won't do that for us.
-*/
+   return 0;
+}
+
+static int netdev_init(struct net_device *net_dev)
+{
+   struct device *dev = net_dev->dev.parent;
+   struct dpaa2_eth_priv *priv = netdev_priv(net_dev);
+   u8 bcast_addr[ETH_ALEN];
+   int err;
+
+   net_dev->netdev_ops = &dpaa2_eth_ops;
+
+   err = set_mac_addr(priv);
+   if (err)
+   return err;
+
+   /* Explicitly add the broadcast address to the MAC filtering table */
eth_broadcast_addr(bcast_addr);
err = dpni_add_mac_addr(priv->mc_io, 0, priv->mc_token, bcast_addr);
if (err) {
-   dev_warn(dev, "dpni_add_mac_addr() failed (%d)\n", err);
-   /* Won't return an error; at least, we'd have egress traffic */
+   dev_err(dev, "dpni_add_mac_addr() failed\n");
+   return err;
}
 
/* Reserve enough space to align buffer as per hardware requirement;
-- 
2.11.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 05/18] staging: fsl-dpaa2/eth: Add error message newlines

2017-06-06 Thread Ioana Radulescu
A few error/warning messages lacked a newline at the end
of the text. Add it for improved consistency and cosmetics.

Signed-off-by: Ioana Radulescu 
---
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | 14 +++---
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c |  6 +++---
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c 
b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
index f63054e071b3..c4252f47d57d 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
@@ -975,7 +975,7 @@ static int link_state_update(struct dpaa2_eth_priv *priv)
netif_carrier_off(priv->net_dev);
}
 
-   netdev_info(priv->net_dev, "Link Event: state %s",
+   netdev_info(priv->net_dev, "Link Event: state %s\n",
state.up ? "up" : "down");
 
return 0;
@@ -1806,7 +1806,7 @@ static int setup_dpni(struct fsl_mc_device *ls_dev)
}
 
if ((priv->tx_data_offset % 64) != 0)
-   dev_warn(dev, "Tx data offset (%d) not a multiple of 64B",
+   dev_warn(dev, "Tx data offset (%d) not a multiple of 64B\n",
 priv->tx_data_offset);
 
/* Accommodate software annotation space (SWA) */
@@ -2002,7 +2002,7 @@ static int dpaa2_eth_set_hash(struct net_device *net_dev, 
u64 flags)
 
err = dpni_prepare_key_cfg(&cls_cfg, dma_mem);
if (err) {
-   dev_err(dev, "dpni_prepare_key_cfg error %d", err);
+   dev_err(dev, "dpni_prepare_key_cfg error %d\n", err);
goto err_prep_key;
}
 
@@ -2261,7 +2261,7 @@ static irqreturn_t dpni_irq0_handler_thread(int irq_num, 
void *arg)
err = dpni_get_irq_status(dpni_dev->mc_io, 0, dpni_dev->mc_handle,
  DPNI_IRQ_INDEX, &status);
if (unlikely(err)) {
-   netdev_err(net_dev, "Can't get irq status (err %d)", err);
+   netdev_err(net_dev, "Can't get irq status (err %d)\n", err);
clear = 0x;
goto out;
}
@@ -2295,21 +2295,21 @@ static int setup_irqs(struct fsl_mc_device *ls_dev)
IRQF_NO_SUSPEND | IRQF_ONESHOT,
dev_name(&ls_dev->dev), &ls_dev->dev);
if (err < 0) {
-   dev_err(&ls_dev->dev, "devm_request_threaded_irq(): %d", err);
+   dev_err(&ls_dev->dev, "devm_request_threaded_irq(): %d\n", err);
goto free_mc_irq;
}
 
err = dpni_set_irq_mask(ls_dev->mc_io, 0, ls_dev->mc_handle,
DPNI_IRQ_INDEX, DPNI_IRQ_EVENT_LINK_CHANGED);
if (err < 0) {
-   dev_err(&ls_dev->dev, "dpni_set_irq_mask(): %d", err);
+   dev_err(&ls_dev->dev, "dpni_set_irq_mask(): %d\n", err);
goto free_irq;
}
 
err = dpni_set_irq_enable(ls_dev->mc_io, 0, ls_dev->mc_handle,
  DPNI_IRQ_INDEX, 1);
if (err < 0) {
-   dev_err(&ls_dev->dev, "dpni_set_irq_enable(): %d", err);
+   dev_err(&ls_dev->dev, "dpni_set_irq_enable(): %d\n", err);
goto free_irq;
}
 
diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c 
b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c
index 89888b6115bf..6a331c74e542 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c
@@ -94,7 +94,7 @@ dpaa2_eth_get_link_ksettings(struct net_device *net_dev,
 
err = dpni_get_link_state(priv->mc_io, 0, priv->mc_token, &state);
if (err) {
-   netdev_err(net_dev, "ERROR %d getting link state", err);
+   netdev_err(net_dev, "ERROR %d getting link state\n", err);
goto out;
}
 
@@ -147,7 +147,7 @@ dpaa2_eth_set_link_ksettings(struct net_device *net_dev,
/* ethtool will be loud enough if we return an error; no point
 * in putting our own error message on the console by default
 */
-   netdev_dbg(net_dev, "ERROR %d setting link cfg", err);
+   netdev_dbg(net_dev, "ERROR %d setting link cfg\n", err);
 
return err;
 }
@@ -206,7 +206,7 @@ static void dpaa2_eth_get_ethtool_stats(struct net_device 
*net_dev,
err = dpni_get_statistics(priv->mc_io, 0, priv->mc_token,
  j, &dpni_stats);
if (err != 0)
-   netdev_warn(net_dev, "dpni_get_stats(%d) failed", j);
+   netdev_warn(net_dev, "dpni_get_stats(%d) failed\n", j);
switch (j) {
case 0:
num_cnt = sizeof(dpni_stats.page_0) / sizeof(u64);
-- 
2.11.0

___
devel mailing list
de...@linuxdriverproject.org

[PATCH 09/18] staging: fsl-dpaa2/eth: Reset dpbp

2017-06-06 Thread Ioana Radulescu
Reset the buffer pool object before using it, like we do
for the other DPAA2 objects.

Signed-off-by: Ioana Radulescu 
---
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c 
b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
index d3ec384c7364..fd56fbd20087 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
@@ -1687,6 +1687,12 @@ static int setup_dpbp(struct dpaa2_eth_priv *priv)
goto err_open;
}
 
+   err = dpbp_reset(priv->mc_io, 0, dpbp_dev->mc_handle);
+   if (err) {
+   dev_err(dev, "dpbp_reset() failed\n");
+   goto err_reset;
+   }
+
err = dpbp_enable(priv->mc_io, 0, dpbp_dev->mc_handle);
if (err) {
dev_err(dev, "dpbp_enable() failed\n");
@@ -1705,6 +1711,7 @@ static int setup_dpbp(struct dpaa2_eth_priv *priv)
 err_get_attr:
dpbp_disable(priv->mc_io, 0, dpbp_dev->mc_handle);
 err_enable:
+err_reset:
dpbp_close(priv->mc_io, 0, dpbp_dev->mc_handle);
 err_open:
fsl_mc_object_free(dpbp_dev);
-- 
2.11.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 01/18] staging: fsl-dpaa2/eth: Add "static" keyword where needed

2017-06-06 Thread Ioana Radulescu
Make a couple of locally used functions and structures static.
Issue found through static analysis tool.

Signed-off-by: Ioana Radulescu 
---
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | 6 +++---
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h | 2 --
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c | 4 ++--
 3 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c 
b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
index 49c435bad706..8ff8951f31b9 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
@@ -1162,8 +1162,8 @@ static int dpaa2_eth_set_addr(struct net_device *net_dev, 
void *addr)
 /** Fill in counters maintained by the GPP driver. These may be different from
  * the hardware counters obtained by ethtool.
  */
-void dpaa2_eth_get_stats(struct net_device *net_dev,
-struct rtnl_link_stats64 *stats)
+static void dpaa2_eth_get_stats(struct net_device *net_dev,
+   struct rtnl_link_stats64 *stats)
 {
struct dpaa2_eth_priv *priv = netdev_priv(net_dev);
struct rtnl_link_stats64 *percpu_stats;
@@ -1958,7 +1958,7 @@ static const struct dpaa2_eth_hash_fields hash_fields[] = 
{
 /* Set RX hash options
  * flags is a combination of RXH_ bits
  */
-int dpaa2_eth_set_hash(struct net_device *net_dev, u64 flags)
+static int dpaa2_eth_set_hash(struct net_device *net_dev, u64 flags)
 {
struct device *dev = net_dev->dev.parent;
struct dpaa2_eth_priv *priv = netdev_priv(net_dev);
diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h 
b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h
index 55b47623008c..539da71470d9 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h
@@ -339,8 +339,6 @@ struct dpaa2_eth_priv {
 extern const struct ethtool_ops dpaa2_ethtool_ops;
 extern const char dpaa2_eth_drv_version[];
 
-int dpaa2_eth_set_hash(struct net_device *net_dev, u64 flags);
-
 static int dpaa2_eth_queue_count(struct dpaa2_eth_priv *priv)
 {
return priv->dpni_attrs.num_queues;
diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c 
b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c
index dd0cffa908ef..89888b6115bf 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c
@@ -34,7 +34,7 @@
 #include "dpaa2-eth.h"
 
 /* To be kept in sync with DPNI statistics */
-char dpaa2_ethtool_stats[][ETH_GSTRING_LEN] = {
+static char dpaa2_ethtool_stats[][ETH_GSTRING_LEN] = {
"rx frames",
"rx bytes",
"rx mcast frames",
@@ -56,7 +56,7 @@ char dpaa2_ethtool_stats[][ETH_GSTRING_LEN] = {
 
 #define DPAA2_ETH_NUM_STATSARRAY_SIZE(dpaa2_ethtool_stats)
 
-char dpaa2_ethtool_extras[][ETH_GSTRING_LEN] = {
+static char dpaa2_ethtool_extras[][ETH_GSTRING_LEN] = {
/* per-cpu stats */
"tx conf frames",
"tx conf bytes",
-- 
2.11.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 12/18] staging: fsl-dpaa2/eth: Add accessor for FAS field

2017-06-06 Thread Ioana Radulescu
Introduce a helper macro for accessing the frame annotation
status field in a frame buffer.

Signed-off-by: Ioana Radulescu 
---
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | 31 --
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h |  6 +
 2 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c 
b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
index 025b5f6559a4..d81c56f4d859 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
@@ -227,6 +227,7 @@ static void dpaa2_eth_rx(struct dpaa2_eth_priv *priv,
struct dpaa2_eth_drv_stats *percpu_extras;
struct device *dev = priv->net_dev->dev.parent;
struct dpaa2_fas *fas;
+   void *buf_data;
u32 status = 0;
 
/* Tracing point */
@@ -235,8 +236,10 @@ static void dpaa2_eth_rx(struct dpaa2_eth_priv *priv,
vaddr = dpaa2_iova_to_virt(priv->iommu_domain, addr);
dma_unmap_single(dev, addr, DPAA2_ETH_RX_BUF_SIZE, DMA_FROM_DEVICE);
 
-   prefetch(vaddr + priv->buf_layout.private_data_size);
-   prefetch(vaddr + dpaa2_fd_get_offset(fd));
+   fas = dpaa2_get_fas(vaddr);
+   prefetch(fas);
+   buf_data = vaddr + dpaa2_fd_get_offset(fd);
+   prefetch(buf_data);
 
percpu_stats = this_cpu_ptr(priv->percpu_stats);
percpu_extras = this_cpu_ptr(priv->percpu_extras);
@@ -244,9 +247,7 @@ static void dpaa2_eth_rx(struct dpaa2_eth_priv *priv,
if (fd_format == dpaa2_fd_single) {
skb = build_linear_skb(priv, ch, fd, vaddr);
} else if (fd_format == dpaa2_fd_sg) {
-   struct dpaa2_sg_entry *sgt =
-   vaddr + dpaa2_fd_get_offset(fd);
-   skb = build_frag_skb(priv, ch, sgt);
+   skb = build_frag_skb(priv, ch, buf_data);
skb_free_frag(vaddr);
percpu_extras->rx_sg_frames++;
percpu_extras->rx_sg_bytes += dpaa2_fd_get_len(fd);
@@ -262,8 +263,6 @@ static void dpaa2_eth_rx(struct dpaa2_eth_priv *priv,
 
/* Check if we need to validate the L4 csum */
if (likely(dpaa2_fd_get_frc(fd) & DPAA2_FD_FRC_FASV)) {
-   fas = (struct dpaa2_fas *)
-   (vaddr + priv->buf_layout.private_data_size);
status = le32_to_cpu(fas->status);
validate_rx_csum(priv, status, skb);
}
@@ -327,7 +326,6 @@ static int build_sg_fd(struct dpaa2_eth_priv *priv,
 {
struct device *dev = priv->net_dev->dev.parent;
void *sgt_buf = NULL;
-   void *hwa;
dma_addr_t addr;
int nr_frags = skb_shinfo(skb)->nr_frags;
struct dpaa2_sg_entry *sgt;
@@ -337,6 +335,7 @@ static int build_sg_fd(struct dpaa2_eth_priv *priv,
int num_sg;
int num_dma_bufs;
struct dpaa2_eth_swa *swa;
+   struct dpaa2_fas *fas;
 
/* Create and map scatterlist.
 * We don't advertise NETIF_F_FRAGLIST, so skb_to_sgvec() will not have
@@ -373,8 +372,8 @@ static int build_sg_fd(struct dpaa2_eth_priv *priv,
 * on TX confirmation. We are clearing FAS (Frame Annotation Status)
 * field from the hardware annotation area
 */
-   hwa = sgt_buf + priv->buf_layout.private_data_size;
-   memset(hwa + DPAA2_FAS_OFFSET, 0, DPAA2_FAS_SIZE);
+   fas = dpaa2_get_fas(sgt_buf);
+   memset(fas, 0, DPAA2_FAS_SIZE);
 
sgt = (struct dpaa2_sg_entry *)(sgt_buf + priv->tx_data_offset);
 
@@ -433,7 +432,7 @@ static int build_single_fd(struct dpaa2_eth_priv *priv,
 {
struct device *dev = priv->net_dev->dev.parent;
u8 *buffer_start;
-   void *hwa;
+   struct dpaa2_fas *fas;
struct sk_buff **skbh;
dma_addr_t addr;
 
@@ -446,8 +445,8 @@ static int build_single_fd(struct dpaa2_eth_priv *priv,
 * on TX confirmation. We are clearing FAS (Frame Annotation Status)
 * field from the hardware annotation area
 */
-   hwa = buffer_start + priv->buf_layout.private_data_size;
-   memset(hwa + DPAA2_FAS_OFFSET, 0, DPAA2_FAS_SIZE);
+   fas = dpaa2_get_fas(buffer_start);
+   memset(fas, 0, DPAA2_FAS_SIZE);
 
/* Store a backpointer to the skb at the beginning of the buffer
 * (in the private data area) such that we can release it
@@ -498,6 +497,7 @@ static void free_tx_fd(const struct dpaa2_eth_priv *priv,
 
fd_addr = dpaa2_fd_get_addr(fd);
skbh = dpaa2_iova_to_virt(priv->iommu_domain, fd_addr);
+   fas = dpaa2_get_fas(skbh);
 
if (fd_format == dpaa2_fd_single) {
skb = *skbh;
@@ -534,11 +534,8 @@ static void free_tx_fd(const struct dpaa2_eth_priv *priv,
 * buffer but before we free it. The caller function is responsible
 * for checking the status value.
 */
-   if (status && (dpaa2_fd_get_frc(fd) & DPAA2_FD_FRC_FASV)) {
-   fas = (struct

[PATCH 18/18] staging: fsl-dpaa2/eth: Update number of netdev queues

2017-06-06 Thread Ioana Radulescu
Currently, the netdevice is allocated with a default number of Rx/Tx
queues equal to CONFIG_NR_CPUS, meaning the maximum number of cores
supported by the current kernel. The actual number of queues is
reflected by the DPNI object attribute, so update the netdevice
configuration based on that.

Signed-off-by: Bogdan Purcareata 
Signed-off-by: Ioana Radulescu 
---
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c 
b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
index 3f7f61b9c462..224f3937f313 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
@@ -2232,6 +2232,7 @@ static int netdev_init(struct net_device *net_dev)
struct device *dev = net_dev->dev.parent;
struct dpaa2_eth_priv *priv = netdev_priv(net_dev);
u8 bcast_addr[ETH_ALEN];
+   u8 num_queues;
int err;
 
net_dev->netdev_ops = &dpaa2_eth_ops;
@@ -2257,6 +2258,19 @@ static int netdev_init(struct net_device *net_dev)
net_dev->min_mtu = 68;
net_dev->max_mtu = DPAA2_ETH_MAX_MTU;
 
+   /* Set actual number of queues in the net device */
+   num_queues = dpaa2_eth_queue_count(priv);
+   err = netif_set_real_num_tx_queues(net_dev, num_queues);
+   if (err) {
+   dev_err(dev, "netif_set_real_num_tx_queues() failed\n");
+   return err;
+   }
+   err = netif_set_real_num_rx_queues(net_dev, num_queues);
+   if (err) {
+   dev_err(dev, "netif_set_real_num_rx_queues() failed\n");
+   return err;
+   }
+
/* Our .ndo_init will be called herein */
err = register_netdev(net_dev);
if (err < 0) {
-- 
2.11.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 02/18] staging: fsl-dpaa2/eth: Initialize variable before use

2017-06-06 Thread Ioana Radulescu
In dpni_get_irq_status(), status is both in and out parameter,
so initialize before use.
Issue found through static analysis tool.

Signed-off-by: Ioana Radulescu 
---
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c 
b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
index 8ff8951f31b9..f0ef3a7c0f73 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
@@ -2252,7 +2252,7 @@ static irqreturn_t dpni_irq0_handler(int irq_num, void 
*arg)
 
 static irqreturn_t dpni_irq0_handler_thread(int irq_num, void *arg)
 {
-   u32 status, clear = 0;
+   u32 status = 0, clear = 0;
struct device *dev = (struct device *)arg;
struct fsl_mc_device *dpni_dev = to_fsl_mc_device(dev);
struct net_device *net_dev = dev_get_drvdata(dev);
-- 
2.11.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 06/18] staging: fsl-dpaa2/eth: Minor cleanup in dpaa2_eth_set_hash

2017-06-06 Thread Ioana Radulescu
We already have a variable for the DMA mapping device,
so use that directly.

Signed-off-by: Ioana Radulescu 
---
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c 
b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
index c4252f47d57d..bf6f300affa7 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
@@ -2009,10 +2009,10 @@ static int dpaa2_eth_set_hash(struct net_device 
*net_dev, u64 flags)
memset(&dist_cfg, 0, sizeof(dist_cfg));
 
/* Prepare for setting the rx dist */
-   dist_cfg.key_cfg_iova = dma_map_single(net_dev->dev.parent, dma_mem,
+   dist_cfg.key_cfg_iova = dma_map_single(dev, dma_mem,
   DPAA2_CLASSIFIER_DMA_SIZE,
   DMA_TO_DEVICE);
-   if (dma_mapping_error(net_dev->dev.parent, dist_cfg.key_cfg_iova)) {
+   if (dma_mapping_error(dev, dist_cfg.key_cfg_iova)) {
dev_err(dev, "DMA mapping failed\n");
err = -ENOMEM;
goto err_dma_map;
@@ -2022,7 +2022,7 @@ static int dpaa2_eth_set_hash(struct net_device *net_dev, 
u64 flags)
dist_cfg.dist_mode = DPNI_DIST_MODE_HASH;
 
err = dpni_set_rx_tc_dist(priv->mc_io, 0, priv->mc_token, 0, &dist_cfg);
-   dma_unmap_single(net_dev->dev.parent, dist_cfg.key_cfg_iova,
+   dma_unmap_single(dev, dist_cfg.key_cfg_iova,
 DPAA2_CLASSIFIER_DMA_SIZE, DMA_TO_DEVICE);
if (err)
dev_err(dev, "dpni_set_rx_tc_dist() error %d\n", err);
-- 
2.11.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 14/18] staging: fsl-dpaa2/eth: Only store bpid in priv struct

2017-06-06 Thread Ioana Radulescu
We only need to know the buffer pool id, so save exactly
that in the device's private structure, instead of the
entire DPBP attributes struct.

Signed-off-by: Ioana Radulescu 
---
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | 12 +++-
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h |  2 +-
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c 
b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
index ee71e158b0a9..26f209c78ff9 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
@@ -798,7 +798,7 @@ static void drain_bufs(struct dpaa2_eth_priv *priv, int 
count)
int ret, i;
 
do {
-   ret = dpaa2_io_service_acquire(NULL, priv->dpbp_attrs.bpid,
+   ret = dpaa2_io_service_acquire(NULL, priv->bpid,
   buf_array, count);
if (ret < 0) {
netdev_err(priv->net_dev, "dpaa2_io_service_acquire() 
failed\n");
@@ -895,7 +895,7 @@ static int dpaa2_eth_poll(struct napi_struct *napi, int 
budget)
break;
 
/* Refill pool if appropriate */
-   refill_pool(priv, ch, priv->dpbp_attrs.bpid);
+   refill_pool(priv, ch, priv->bpid);
 
store_cleaned = consume_frames(ch);
cleaned += store_cleaned;
@@ -980,14 +980,14 @@ static int dpaa2_eth_open(struct net_device *net_dev)
struct dpaa2_eth_priv *priv = netdev_priv(net_dev);
int err;
 
-   err = seed_pool(priv, priv->dpbp_attrs.bpid);
+   err = seed_pool(priv, priv->bpid);
if (err) {
/* Not much to do; the buffer pool, though not filled up,
 * may still contain some buffers which would enable us
 * to limp on.
 */
netdev_err(net_dev, "Buffer seeding failed for DPBP %d 
(bpid=%d)\n",
-  priv->dpbp_dev->obj_desc.id, priv->dpbp_attrs.bpid);
+  priv->dpbp_dev->obj_desc.id, priv->bpid);
}
 
/* We'll only start the txqs when the link is actually ready; make sure
@@ -1671,6 +1671,7 @@ static int setup_dpbp(struct dpaa2_eth_priv *priv)
int err;
struct fsl_mc_device *dpbp_dev;
struct device *dev = priv->net_dev->dev.parent;
+   struct dpbp_attr dpbp_attrs;
 
err = fsl_mc_object_allocate(to_fsl_mc_device(dev), FSL_MC_POOL_DPBP,
 &dpbp_dev);
@@ -1701,11 +1702,12 @@ static int setup_dpbp(struct dpaa2_eth_priv *priv)
}
 
err = dpbp_get_attributes(priv->mc_io, 0, dpbp_dev->mc_handle,
- &priv->dpbp_attrs);
+ &dpbp_attrs);
if (err) {
dev_err(dev, "dpbp_get_attributes() failed\n");
goto err_get_attr;
}
+   priv->bpid = dpbp_attrs.bpid;
 
return 0;
 
diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h 
b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h
index 6697b508cf23..886a0681fee1 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h
@@ -301,7 +301,7 @@ struct dpaa2_eth_priv {
u16 tx_data_offset;
 
struct fsl_mc_device *dpbp_dev;
-   struct dpbp_attr dpbp_attrs;
+   u16 bpid;
struct iommu_domain *iommu_domain;
 
u16 tx_qdid;
-- 
2.11.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 16/18] staging: fsl-dpaa2/eth: Errors checking update

2017-06-06 Thread Ioana Radulescu
On the egress path, frame errors are reported using both a FD control
field and the frame annotation status. The current code only handles
FAS errors. Update to look at both fields when accounting Tx errors.

Signed-off-by: Bogdan Purcareata 
Signed-off-by: Ioana Radulescu 
---
Note: Checkpatch complains about a macro(DPAA2_FAS_RX_ERR_MASK) being
too complex. It's just a bitmask with all possible Rx FAS error bits
and I'm not sure how the extra parantheses recommended by checkpatch
would help, so leaving it as is.

 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | 36 --
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h | 17 ++--
 2 files changed, 43 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c 
b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
index 26f209c78ff9..7dca8c2e5ff9 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
@@ -534,7 +534,7 @@ static void free_tx_fd(const struct dpaa2_eth_priv *priv,
 * buffer but before we free it. The caller function is responsible
 * for checking the status value.
 */
-   if (status && (dpaa2_fd_get_frc(fd) & DPAA2_FD_FRC_FASV))
+   if (status)
*status = le32_to_cpu(fas->status);
 
/* Free SGT buffer kmalloc'ed on tx */
@@ -638,6 +638,8 @@ static void dpaa2_eth_tx_conf(struct dpaa2_eth_priv *priv,
struct rtnl_link_stats64 *percpu_stats;
struct dpaa2_eth_drv_stats *percpu_extras;
u32 status = 0;
+   u32 fd_errors;
+   bool has_fas_errors = false;
 
/* Tracing point */
trace_dpaa2_tx_conf_fd(priv->net_dev, fd);
@@ -646,13 +648,31 @@ static void dpaa2_eth_tx_conf(struct dpaa2_eth_priv *priv,
percpu_extras->tx_conf_frames++;
percpu_extras->tx_conf_bytes += dpaa2_fd_get_len(fd);
 
-   free_tx_fd(priv, fd, &status);
-
-   if (unlikely(status & DPAA2_ETH_TXCONF_ERR_MASK)) {
-   percpu_stats = this_cpu_ptr(priv->percpu_stats);
-   /* Tx-conf logically pertains to the egress path. */
-   percpu_stats->tx_errors++;
+   /* Check frame errors in the FD field */
+   fd_errors = dpaa2_fd_get_ctrl(fd) & DPAA2_FD_TX_ERR_MASK;
+   if (unlikely(fd_errors)) {
+   /* We only check error bits in the FAS field if corresponding
+* FAERR bit is set in FD and the FAS field is marked as valid
+*/
+   has_fas_errors = (fd_errors & DPAA2_FD_CTRL_FAERR) &&
+!!(dpaa2_fd_get_frc(fd) & DPAA2_FD_FRC_FASV);
+   if (net_ratelimit())
+   netdev_dbg(priv->net_dev, "TX frame FD error: %x08\n",
+  fd_errors);
}
+
+   free_tx_fd(priv, fd, has_fas_errors ? &status : NULL);
+
+   if (likely(!fd_errors))
+   return;
+
+   percpu_stats = this_cpu_ptr(priv->percpu_stats);
+   /* Tx-conf logically pertains to the egress path. */
+   percpu_stats->tx_errors++;
+
+   if (has_fas_errors && net_ratelimit())
+   netdev_dbg(priv->net_dev, "TX frame FAS error: %x08\n",
+  status & DPAA2_FAS_TX_ERR_MASK);
 }
 
 static int set_rx_csum(struct dpaa2_eth_priv *priv, bool enable)
@@ -2069,7 +2089,7 @@ static int bind_dpni(struct dpaa2_eth_priv *priv)
netdev_err(net_dev, "Failed to configure hashing\n");
 
/* Configure handling of error frames */
-   err_cfg.errors = DPAA2_ETH_RX_ERR_MASK;
+   err_cfg.errors = DPAA2_FAS_RX_ERR_MASK;
err_cfg.set_frame_annotation = 1;
err_cfg.error_action = DPNI_ERROR_ACTION_DISCARD;
err = dpni_set_errors_behavior(priv->mc_io, 0, priv->mc_token,
diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h 
b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h
index c760e9b77e22..b492c8723bb6 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h
@@ -120,6 +120,19 @@ struct dpaa2_eth_swa {
 #define DPAA2_FD_FRC_FASWOV0x0800
 #define DPAA2_FD_FRC_FAICFDV   0x0400
 
+/* Error bits in FD CTRL */
+#define DPAA2_FD_CTRL_UFD  0x0004
+#define DPAA2_FD_CTRL_SBE  0x0008
+#define DPAA2_FD_CTRL_FSE  0x0010
+#define DPAA2_FD_CTRL_FAERR0x0020
+
+#define DPAA2_FD_RX_ERR_MASK   (DPAA2_FD_CTRL_SBE  | \
+DPAA2_FD_CTRL_FAERR)
+#define DPAA2_FD_TX_ERR_MASK   (DPAA2_FD_CTRL_UFD  | \
+DPAA2_FD_CTRL_SBE  | \
+DPAA2_FD_CTRL_FSE  | \
+DPAA2_FD_CTRL_FAERR)
+
 /* Annotation bits in FD CTRL */
 #define DPAA2_FD_CTRL_ASAL 0x0002  /* ASAL = 128 */
 #define DPAA2_FD_CTRL_PTA  0x0080

[PATCH 10/18] staging: fsl-dpaa2/eth: Defer probing if no DPIOs found

2017-06-06 Thread Ioana Radulescu
If the Ethernet driver doesn't find any DPIO devices during probe,
it may be either because there's none available or because they
haven't been probed yet. Request deferred probing in case it's
the latter.

Signed-off-by: Bharat Bhushan 
Signed-off-by: Ioana Radulescu 
---
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c 
b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
index fd56fbd20087..025b5f6559a4 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
@@ -1510,6 +1510,7 @@ static int setup_dpio(struct dpaa2_eth_priv *priv)
if (!channel) {
dev_info(dev,
 "No affine channel for cpu %d and above\n", i);
+   err = -ENODEV;
goto err_alloc_ch;
}
 
@@ -1524,10 +1525,13 @@ static int setup_dpio(struct dpaa2_eth_priv *priv)
/* Register the new context */
err = dpaa2_io_service_register(NULL, nctx);
if (err) {
-   dev_info(dev, "No affine DPIO for cpu %d\n", i);
+   dev_dbg(dev, "No affine DPIO for cpu %d\n", i);
/* If no affine DPIO for this core, there's probably
-* none available for next cores either.
+* none available for next cores either. Signal we want
+* to retry later, in case the DPIO devices weren't
+* probed yet.
 */
+   err = -EPROBE_DEFER;
goto err_service_reg;
}
 
@@ -1565,7 +1569,7 @@ static int setup_dpio(struct dpaa2_eth_priv *priv)
 err_alloc_ch:
if (cpumask_empty(&priv->dpio_cpumask)) {
dev_err(dev, "No cpu with an affine DPIO/DPCON\n");
-   return -ENODEV;
+   return err;
}
 
dev_info(dev, "Cores %*pbl available for processing ingress traffic\n",
-- 
2.11.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 04/18] staging: fsl-dpaa2/eth: Remove incorrect error path

2017-06-06 Thread Ioana Radulescu
Not having Rx hashing distribution enabled for an
interface is a valid configuration and shouldn't be
treated as an error.

Signed-off-by: Ioana Radulescu 
---
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c 
b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
index a9e245df2488..f63054e071b3 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
@@ -1969,8 +1969,8 @@ static int dpaa2_eth_set_hash(struct net_device *net_dev, 
u64 flags)
int err = 0;
 
if (!dpaa2_eth_hash_enabled(priv)) {
-   dev_err(dev, "Hashing support is not enabled\n");
-   return -EOPNOTSUPP;
+   dev_dbg(dev, "Hashing support is not enabled\n");
+   return 0;
}
 
memset(&cls_cfg, 0, sizeof(cls_cfg));
-- 
2.11.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 13/18] staging: fsl-dpaa2/eth: Remove unused fields from priv struct

2017-06-06 Thread Ioana Radulescu
Remove the dpni_id and buffer_layout fields from device's
private structure. They're only used at probe so we don't
need to store them for further use.

Signed-off-by: Ioana Radulescu 
---
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | 33 +-
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h |  5 
 2 files changed, 16 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c 
b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
index d81c56f4d859..ee71e158b0a9 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
@@ -1734,15 +1734,14 @@ static int setup_dpni(struct fsl_mc_device *ls_dev)
struct device *dev = &ls_dev->dev;
struct dpaa2_eth_priv *priv;
struct net_device *net_dev;
+   struct dpni_buffer_layout buf_layout = {0};
int err;
 
net_dev = dev_get_drvdata(dev);
priv = netdev_priv(net_dev);
 
-   priv->dpni_id = ls_dev->obj_desc.id;
-
/* get a handle for the DPNI object */
-   err = dpni_open(priv->mc_io, 0, priv->dpni_id, &priv->mc_token);
+   err = dpni_open(priv->mc_io, 0, ls_dev->obj_desc.id, &priv->mc_token);
if (err) {
dev_err(dev, "dpni_open() failed\n");
goto err_open;
@@ -1766,35 +1765,35 @@ static int setup_dpni(struct fsl_mc_device *ls_dev)
 
/* Configure buffer layouts */
/* rx buffer */
-   priv->buf_layout.pass_parser_result = true;
-   priv->buf_layout.pass_frame_status = true;
-   priv->buf_layout.private_data_size = DPAA2_ETH_SWA_SIZE;
-   priv->buf_layout.data_align = DPAA2_ETH_RX_BUF_ALIGN;
-   priv->buf_layout.options = DPNI_BUF_LAYOUT_OPT_PARSER_RESULT |
-  DPNI_BUF_LAYOUT_OPT_FRAME_STATUS |
-  DPNI_BUF_LAYOUT_OPT_PRIVATE_DATA_SIZE |
-  DPNI_BUF_LAYOUT_OPT_DATA_ALIGN;
+   buf_layout.pass_parser_result = true;
+   buf_layout.pass_frame_status = true;
+   buf_layout.private_data_size = DPAA2_ETH_SWA_SIZE;
+   buf_layout.data_align = DPAA2_ETH_RX_BUF_ALIGN;
+   buf_layout.options = DPNI_BUF_LAYOUT_OPT_PARSER_RESULT |
+DPNI_BUF_LAYOUT_OPT_FRAME_STATUS |
+DPNI_BUF_LAYOUT_OPT_PRIVATE_DATA_SIZE |
+DPNI_BUF_LAYOUT_OPT_DATA_ALIGN;
err = dpni_set_buffer_layout(priv->mc_io, 0, priv->mc_token,
-DPNI_QUEUE_RX, &priv->buf_layout);
+DPNI_QUEUE_RX, &buf_layout);
if (err) {
dev_err(dev, "dpni_set_buffer_layout(RX) failed\n");
goto err_buf_layout;
}
 
/* tx buffer */
-   priv->buf_layout.options = DPNI_BUF_LAYOUT_OPT_FRAME_STATUS |
-  DPNI_BUF_LAYOUT_OPT_PRIVATE_DATA_SIZE;
+   buf_layout.options = DPNI_BUF_LAYOUT_OPT_FRAME_STATUS |
+DPNI_BUF_LAYOUT_OPT_PRIVATE_DATA_SIZE;
err = dpni_set_buffer_layout(priv->mc_io, 0, priv->mc_token,
-DPNI_QUEUE_TX, &priv->buf_layout);
+DPNI_QUEUE_TX, &buf_layout);
if (err) {
dev_err(dev, "dpni_set_buffer_layout(TX) failed\n");
goto err_buf_layout;
}
 
/* tx-confirm buffer */
-   priv->buf_layout.options = DPNI_BUF_LAYOUT_OPT_FRAME_STATUS;
+   buf_layout.options = DPNI_BUF_LAYOUT_OPT_FRAME_STATUS;
err = dpni_set_buffer_layout(priv->mc_io, 0, priv->mc_token,
-DPNI_QUEUE_TX_CONFIRM, &priv->buf_layout);
+DPNI_QUEUE_TX_CONFIRM, &buf_layout);
if (err) {
dev_err(dev, "dpni_set_buffer_layout(TX_CONF) failed\n");
goto err_buf_layout;
diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h 
b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h
index 6462e2cbe4be..6697b508cf23 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h
@@ -297,12 +297,7 @@ struct dpaa2_eth_priv {
u8 num_channels;
struct dpaa2_eth_channel *channel[DPAA2_ETH_MAX_DPCONS];
 
-   int dpni_id;
struct dpni_attr dpni_attrs;
-   /* Insofar as the MC is concerned, we're using one layout on all 3 types
-* of buffers (Rx, Tx, Tx-Conf).
-*/
-   struct dpni_buffer_layout buf_layout;
u16 tx_data_offset;
 
struct fsl_mc_device *dpbp_dev;
-- 
2.11.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 07/18] staging: fsl-dpaa2/eth: Don't use GFP_DMA

2017-06-06 Thread Ioana Radulescu
Don't use GFP_DMA when allocating memory for the hash key,
as we don't actually need to allocate from the lowest zone.

Signed-off-by: Ioana Radulescu 
---
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c 
b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
index bf6f300affa7..57628cd3ecf2 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
@@ -1996,7 +1996,7 @@ static int dpaa2_eth_set_hash(struct net_device *net_dev, 
u64 flags)
priv->rx_hash_fields |= hash_fields[i].rxnfc_field;
}
 
-   dma_mem = kzalloc(DPAA2_CLASSIFIER_DMA_SIZE, GFP_DMA | GFP_KERNEL);
+   dma_mem = kzalloc(DPAA2_CLASSIFIER_DMA_SIZE, GFP_KERNEL);
if (!dma_mem)
return -ENOMEM;
 
-- 
2.11.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 00/18] staging: fsl-dpaa2/eth: Code cleanup and minor fixes

2017-06-06 Thread Ioana Radulescu
This patch series contains fixes for a few minor bugs and
code cleanup and cosmetics. No significant functional changes.

Ioana Radulescu (18):
  staging: fsl-dpaa2/eth: Add "static" keyword where needed
  staging: fsl-dpaa2/eth: Initialize variable before use
  staging: fsl-dpaa2/eth: Fix return type of ndo_start_xmit
  staging: fsl-dpaa2/eth: Remove incorrect error path
  staging: fsl-dpaa2/eth: Add error message newlines
  staging: fsl-dpaa2/eth: Minor cleanup in dpaa2_eth_set_hash
  staging: fsl-dpaa2/eth: Don't use GFP_DMA
  staging: fsl-dpaa2/eth: Always call napi_gro_receive()
  staging: fsl-dpaa2/eth: Reset dpbp
  staging: fsl-dpaa2/eth: Defer probing if no DPIOs found
  staging: fsl-dpaa2/eth: Update ethtool stats names
  staging: fsl-dpaa2/eth: Add accessor for FAS field
  staging: fsl-dpaa2/eth: Remove unused fields from priv struct
  staging: fsl-dpaa2/eth: Only store bpid in priv struct
  staging: fsl-dpaa2/eth: Reorder priv fields
  staging: fsl-dpaa2/eth: Errors checking update
  staging: fsl-dpaa2/eth: Refactor MAC address setup
  staging: fsl-dpaa2/eth: Update number of netdev queues

 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | 228 +
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h |  56 ++---
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c |  64 +++---
 3 files changed, 204 insertions(+), 144 deletions(-)

-- 
2.11.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 08/18] staging: fsl-dpaa2/eth: Always call napi_gro_receive()

2017-06-06 Thread Ioana Radulescu
The function itself checks whether GRO support is enabled
and acts accordingly, so we don't need to verify it in the
driver as well.

Signed-off-by: Ioana Radulescu 
---
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c 
b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
index 57628cd3ecf2..d3ec384c7364 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
@@ -273,10 +273,7 @@ static void dpaa2_eth_rx(struct dpaa2_eth_priv *priv,
percpu_stats->rx_packets++;
percpu_stats->rx_bytes += dpaa2_fd_get_len(fd);
 
-   if (priv->net_dev->features & NETIF_F_GRO)
-   napi_gro_receive(napi, skb);
-   else
-   netif_receive_skb(skb);
+   napi_gro_receive(napi, skb);
 
return;
 
-- 
2.11.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 0/3] move visorbus out of staging to drivers/virt/visorbus

2017-06-06 Thread Greg KH
On Tue, Jun 06, 2017 at 04:53:22PM +0200, Greg KH wrote:
> On Tue, Jun 06, 2017 at 04:49:09PM +0200, Greg KH wrote:
> > On Mon, Jun 05, 2017 at 04:07:29PM -0400, David Kershner wrote:
> > > This patchset moves drivers/staging/unisys/include to
> > > include/linux/visorbus, and moves drivers/staging/unisys/visorbus to
> > > drivers/virt/visorbus.
> > 
> > Um, are you thinking it is ready to be moved?  Have you asked for
> > another review?
> > 
> > In a totally random chance, I was doing some driver core work today and
> > I noticed that in drivers/staging/unisys/visorbus/visorbus_main.c, you
> > have 2 tabs for your 'struct attribute' variables, which is really odd.
> > 
> > Also, you should be using the ATTRIBUTE_GROUPS() macro for them instead
> > of having to "open code" the struct attribute_group lists.
> > 
> > So either you all have horrible luck in that I just happened to find the
> > only remaining problem, or that you should proabably ask for a good code
> > audit, I haven't looked at the code before today since the last round of
> > "fun" I found in just one other random file :)
> 
> Also, many of the attribute callbacks in that file seem to all have
> their leading '{' in the wrong place.  Odd that checkpatch.pl doesn't
> catch that...
> 
> partition_handle_show() is one such example that is obviously wrong.
> 
> There's also one checkpatch.pl warning for it, which should probably be
> resolved as well.

drivers/staging/unisys/visorbus/visorbus_main.c:1035: WARNING: Prefer using 
'"%s...", __func__' to using 'create_bus_instance', this function's name, in a 
string

to be specific, something you should have caught, right?

Are you sure this is ready to be moved out of staging?  :(

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 0/3] move visorbus out of staging to drivers/virt/visorbus

2017-06-06 Thread Greg KH
On Tue, Jun 06, 2017 at 04:49:09PM +0200, Greg KH wrote:
> On Mon, Jun 05, 2017 at 04:07:29PM -0400, David Kershner wrote:
> > This patchset moves drivers/staging/unisys/include to
> > include/linux/visorbus, and moves drivers/staging/unisys/visorbus to
> > drivers/virt/visorbus.
> 
> Um, are you thinking it is ready to be moved?  Have you asked for
> another review?
> 
> In a totally random chance, I was doing some driver core work today and
> I noticed that in drivers/staging/unisys/visorbus/visorbus_main.c, you
> have 2 tabs for your 'struct attribute' variables, which is really odd.
> 
> Also, you should be using the ATTRIBUTE_GROUPS() macro for them instead
> of having to "open code" the struct attribute_group lists.
> 
> So either you all have horrible luck in that I just happened to find the
> only remaining problem, or that you should proabably ask for a good code
> audit, I haven't looked at the code before today since the last round of
> "fun" I found in just one other random file :)

Also, many of the attribute callbacks in that file seem to all have
their leading '{' in the wrong place.  Odd that checkpatch.pl doesn't
catch that...

partition_handle_show() is one such example that is obviously wrong.

There's also one checkpatch.pl warning for it, which should probably be
resolved as well.

I strongly suggest you go through everything again on your own...

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 0/3] move visorbus out of staging to drivers/virt/visorbus

2017-06-06 Thread Greg KH
On Mon, Jun 05, 2017 at 04:07:29PM -0400, David Kershner wrote:
> This patchset moves drivers/staging/unisys/include to
> include/linux/visorbus, and moves drivers/staging/unisys/visorbus to
> drivers/virt/visorbus.

Um, are you thinking it is ready to be moved?  Have you asked for
another review?

In a totally random chance, I was doing some driver core work today and
I noticed that in drivers/staging/unisys/visorbus/visorbus_main.c, you
have 2 tabs for your 'struct attribute' variables, which is really odd.

Also, you should be using the ATTRIBUTE_GROUPS() macro for them instead
of having to "open code" the struct attribute_group lists.

So either you all have horrible luck in that I just happened to find the
only remaining problem, or that you should proabably ask for a good code
audit, I haven't looked at the code before today since the last round of
"fun" I found in just one other random file :)

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH v4 10/10] staging: fsl-mc: move bus driver out of staging

2017-06-06 Thread Laurentiu Tudor


> -Original Message-
> From: Greg KH [mailto:gre...@linuxfoundation.org]
> Sent: Tuesday, June 06, 2017 5:20 PM
> To: Laurentiu Tudor 
> 
> On Tue, Jun 06, 2017 at 02:03:44PM +, Laurentiu Tudor wrote:
> > Hi Greg,
> >
> > > -Original Message-
> > > From: Greg KH [mailto:gre...@linuxfoundation.org]
> > > Sent: Saturday, June 03, 2017 11:40 AM
> > >
> > > On Wed, May 31, 2017 at 01:58:52PM +0300, laurentiu.tu...@nxp.com
> wrote:
> > > > From: Stuart Yoder 
> > >
> > > Your subject says 'v4' yet the other patches here in the series do
> > > not, they say nothing, or 'v2', and the 0/10 patch says 'v6'!
> >
> > I'm tracking the patch versions individually and use the cover letter
> > version (v6 currently) to reflect the version of the patch series as a
> > whole. There are a bunch of patches that are either newly introduced in this
> series or didn't had multiple versions so I didn't tagged them with a version 
> tag.
> > The patch [10/10] didn't changed since v4 so I left the version
> > unchanged. The only change was in patch [07/10] for which I added a commit
> message so I bumped the version to v2.
> 
> And that's totally crazy.  What do you expect me, or anyone else, to know what
> to do with that.  Heck, I can't even sort them by proper order in which to 
> apply
> them in, if I wanted to.  You are keeping me from actually using your work :(
> 
> > > Please fix up and do this correctly.  The _whole_ patch series is
> > > versioned, otherwise how can I sort them to apply them in the correct 
> > > order?
> >
> > Want me to tag all the patches with the same version (that is, v7 for
> > the next respin)?
> 
> Yes, like everyone else does please :)
> 

Ok, finally got it. :-) Will do so in the next spin.

---
Thanks & Best Regards, Laurentiu
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v4 10/10] staging: fsl-mc: move bus driver out of staging

2017-06-06 Thread Greg KH
On Tue, Jun 06, 2017 at 02:03:44PM +, Laurentiu Tudor wrote:
> Hi Greg, 
> 
> > -Original Message-
> > From: Greg KH [mailto:gre...@linuxfoundation.org]
> > Sent: Saturday, June 03, 2017 11:40 AM
> > 
> > On Wed, May 31, 2017 at 01:58:52PM +0300, laurentiu.tu...@nxp.com wrote:
> > > From: Stuart Yoder 
> > 
> > Your subject says 'v4' yet the other patches here in the series do not, 
> > they say
> > nothing, or 'v2', and the 0/10 patch says 'v6'!
> 
> I'm tracking the patch versions individually and use the cover letter version 
> (v6 currently)
> to reflect the version of the patch series as a whole. There are a bunch of 
> patches that are either newly
> introduced in this series or didn't had multiple versions so I didn't tagged 
> them with a version tag.
> The patch [10/10] didn't changed since v4 so I left the version unchanged. 
> The only change was in patch [07/10]
> for which I added a commit message so I bumped the version to v2.

And that's totally crazy.  What do you expect me, or anyone else, to
know what to do with that.  Heck, I can't even sort them by proper order
in which to apply them in, if I wanted to.  You are keeping me from
actually using your work :(

> > Please fix up and do this correctly.  The _whole_ patch series is versioned,
> > otherwise how can I sort them to apply them in the correct order?
> 
> Want me to tag all the patches with the same version (that is, v7 for
> the next respin)?

Yes, like everyone else does please :)

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[driver-core:class_groups_removal 3/7] drivers/mtd/ubi/build.c:116:2: warning: initialization from incompatible pointer type

2017-06-06 Thread kbuild test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git 
class_groups_removal
head:   0e917470c6fbd8ad8eb957c663aecc25b859c7fb
commit: 8c103093703b767ff463d04c78569e4abf9fbbc8 [3/7] mtd: use class_groups 
instead of class_attrs
config: xtensa-allmodconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 4.9.0
reproduce:
wget 
https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 8c103093703b767ff463d04c78569e4abf9fbbc8
# save the attached .config to linux build tree
make.cross ARCH=xtensa 

All warnings (new ones prefixed by >>):

>> drivers/mtd/ubi/build.c:116:2: warning: initialization from incompatible 
>> pointer type
 &class_attr_version.attr,
 ^
   drivers/mtd/ubi/build.c:116:2: warning: (near initialization for 
'ubi_class_attrs[0]')
   In file included from include/linux/kobject.h:21:0,
from include/linux/module.h:17,
from drivers/mtd/ubi/build.c:33:
>> include/linux/sysfs.h:147:21: warning: initialization from incompatible 
>> pointer type
static const struct attribute_group _name##_group = {  \
^
>> drivers/mtd/ubi/build.c:119:1: note: in expansion of macro 'ATTRIBUTE_GROUPS'
ATTRIBUTE_GROUPS(ubi_class);
^
   include/linux/sysfs.h:147:21: warning: (near initialization for 
'ubi_class_group.attrs')
static const struct attribute_group _name##_group = {  \
^
>> drivers/mtd/ubi/build.c:119:1: note: in expansion of macro 'ATTRIBUTE_GROUPS'
ATTRIBUTE_GROUPS(ubi_class);
^
--
   drivers/mtd//ubi/build.c:116:2: warning: initialization from incompatible 
pointer type
 &class_attr_version.attr,
 ^
   drivers/mtd//ubi/build.c:116:2: warning: (near initialization for 
'ubi_class_attrs[0]')
   In file included from include/linux/kobject.h:21:0,
from include/linux/module.h:17,
from drivers/mtd//ubi/build.c:33:
>> include/linux/sysfs.h:147:21: warning: initialization from incompatible 
>> pointer type
static const struct attribute_group _name##_group = {  \
^
   drivers/mtd//ubi/build.c:119:1: note: in expansion of macro 
'ATTRIBUTE_GROUPS'
ATTRIBUTE_GROUPS(ubi_class);
^
   include/linux/sysfs.h:147:21: warning: (near initialization for 
'ubi_class_group.attrs')
static const struct attribute_group _name##_group = {  \
^
   drivers/mtd//ubi/build.c:119:1: note: in expansion of macro 
'ATTRIBUTE_GROUPS'
ATTRIBUTE_GROUPS(ubi_class);
^

vim +116 drivers/mtd/ubi/build.c

   110  {
   111  return sprintf(buf, "%d\n", UBI_VERSION);
   112  }
   113  static CLASS_ATTR_RO(version);
   114  
   115  static struct attributes *ubi_class_attrs[] = {
 > 116  &class_attr_version.attr,
   117  NULL,
   118  };
 > 119  ATTRIBUTE_GROUPS(ubi_class);
   120  
   121  /* Root UBI "class" object (corresponds to '//class/ubi/') */
   122  struct class ubi_class = {

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH v4 10/10] staging: fsl-mc: move bus driver out of staging

2017-06-06 Thread Laurentiu Tudor
Hi Greg, 

> -Original Message-
> From: Greg KH [mailto:gre...@linuxfoundation.org]
> Sent: Saturday, June 03, 2017 11:40 AM
> 
> On Wed, May 31, 2017 at 01:58:52PM +0300, laurentiu.tu...@nxp.com wrote:
> > From: Stuart Yoder 
> 
> Your subject says 'v4' yet the other patches here in the series do not, they 
> say
> nothing, or 'v2', and the 0/10 patch says 'v6'!

I'm tracking the patch versions individually and use the cover letter version 
(v6 currently)
to reflect the version of the patch series as a whole. There are a bunch of 
patches that are either newly
introduced in this series or didn't had multiple versions so I didn't tagged 
them with a version tag.
The patch [10/10] didn't changed since v4 so I left the version unchanged. The 
only change was in patch [07/10]
for which I added a commit message so I bumped the version to v2.
 
> Please fix up and do this correctly.  The _whole_ patch series is versioned,
> otherwise how can I sort them to apply them in the correct order?

Want me to tag all the patches with the same version (that is, v7 for the next 
respin)?

---
Thanks & Best Regards, Laurentiu
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[driver-core:class_groups_removal 3/7] drivers/mtd/ubi/build.c:116:2: error: initialization from incompatible pointer type

2017-06-06 Thread kbuild test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git 
class_groups_removal
head:   0e917470c6fbd8ad8eb957c663aecc25b859c7fb
commit: 8c103093703b767ff463d04c78569e4abf9fbbc8 [3/7] mtd: use class_groups 
instead of class_attrs
config: x86_64-randconfig-x019-201723 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
git checkout 8c103093703b767ff463d04c78569e4abf9fbbc8
# save the attached .config to linux build tree
make ARCH=x86_64 

All errors (new ones prefixed by >>):

>> drivers/mtd/ubi/build.c:116:2: error: initialization from incompatible 
>> pointer type [-Werror=incompatible-pointer-types]
 &class_attr_version.attr,
 ^
   drivers/mtd/ubi/build.c:116:2: note: (near initialization for 
'ubi_class_attrs[0]')
   In file included from include/linux/kobject.h:21:0,
from include/linux/module.h:17,
from drivers/mtd/ubi/build.c:33:
   drivers/mtd/ubi/build.c:119:18: error: initialization from incompatible 
pointer type [-Werror=incompatible-pointer-types]
ATTRIBUTE_GROUPS(ubi_class);
 ^
   include/linux/sysfs.h:148:11: note: in definition of macro 'ATTRIBUTE_GROUPS'
 .attrs = _name##_attrs, \
  ^
   drivers/mtd/ubi/build.c:119:18: note: (near initialization for 
'ubi_class_group.attrs')
ATTRIBUTE_GROUPS(ubi_class);
 ^
   include/linux/sysfs.h:148:11: note: in definition of macro 'ATTRIBUTE_GROUPS'
 .attrs = _name##_attrs, \
  ^
   cc1: some warnings being treated as errors

vim +116 drivers/mtd/ubi/build.c

   110  {
   111  return sprintf(buf, "%d\n", UBI_VERSION);
   112  }
   113  static CLASS_ATTR_RO(version);
   114  
   115  static struct attributes *ubi_class_attrs[] = {
 > 116  &class_attr_version.attr,
   117  NULL,
   118  };
   119  ATTRIBUTE_GROUPS(ubi_class);

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/4] Staging: ccree: cc_crypto_ctx.h: Added * on subsequent lines of a comment block.

2017-06-06 Thread srishti sharma
On Sun, Jun 4, 2017 at 1:49 PM, Greg KH  wrote:
> On Sun, Jun 04, 2017 at 05:02:08AM +0530, srishti sharma wrote:
>> Added * on subsequent lines of a comment block.
>>
>> Signed-off-by: srishti sharma 
>> ---
>>  drivers/staging/ccree/cc_crypto_ctx.h | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> This whole series also does not apply.  Note, this driver is under
> active development, you are probably running into the problem that lots
> of people are working on it at the same time.
>
> sorry,
>
> greg k-h



Okay , Thanks a lot !

Regards,
Srishti
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[driver-core:bus_type_removal 15/15] drivers/tty/serdev/core.c:265:2: warning: initialization from incompatible pointer type

2017-06-06 Thread kbuild test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git 
bus_type_removal
head:   98bcb3d030381f6f32f8952eeac289a63a13f07d
commit: 98bcb3d030381f6f32f8952eeac289a63a13f07d [15/15] driver-core: remove 
struct bus_type.dev_attrs
config: x86_64-randconfig-i0-201723 (attached as .config)
compiler: gcc-4.9 (Debian 4.9.4-2) 4.9.4
reproduce:
git checkout 98bcb3d030381f6f32f8952eeac289a63a13f07d
# save the attached .config to linux build tree
make ARCH=x86_64 

All warnings (new ones prefixed by >>):

   drivers/tty/serdev/core.c:265:2: error: unknown field 'dev_attrs' specified 
in initializer
 .dev_attrs = serdev_device_attrs,
 ^
>> drivers/tty/serdev/core.c:265:2: warning: initialization from incompatible 
>> pointer type
   drivers/tty/serdev/core.c:265:2: warning: (near initialization for 
'serdev_bus_type.probe')

vim +265 drivers/tty/serdev/core.c

cd6484e1 Rob Herring 2017-02-02  249 struct 
device_attribute *attr, char *buf)
cd6484e1 Rob Herring 2017-02-02  250  {
0634c295 Rob Herring 2017-03-22  251return of_device_modalias(dev, buf, 
PAGE_SIZE);
cd6484e1 Rob Herring 2017-02-02  252  }
cd6484e1 Rob Herring 2017-02-02  253  
cd6484e1 Rob Herring 2017-02-02  254  static struct device_attribute 
serdev_device_attrs[] = {
cd6484e1 Rob Herring 2017-02-02  255__ATTR_RO(modalias),
cd6484e1 Rob Herring 2017-02-02  256__ATTR_NULL
cd6484e1 Rob Herring 2017-02-02  257  };
cd6484e1 Rob Herring 2017-02-02  258  
cd6484e1 Rob Herring 2017-02-02  259  static struct bus_type serdev_bus_type = {
cd6484e1 Rob Herring 2017-02-02  260.name   = "serial",
cd6484e1 Rob Herring 2017-02-02  261.match  = serdev_device_match,
cd6484e1 Rob Herring 2017-02-02  262.probe  = serdev_drv_probe,
cd6484e1 Rob Herring 2017-02-02  263.remove = serdev_drv_remove,
cd6484e1 Rob Herring 2017-02-02  264.uevent = serdev_uevent,
cd6484e1 Rob Herring 2017-02-02 @265.dev_attrs  = serdev_device_attrs,
cd6484e1 Rob Herring 2017-02-02  266  };
cd6484e1 Rob Herring 2017-02-02  267  
cd6484e1 Rob Herring 2017-02-02  268  /**
cd6484e1 Rob Herring 2017-02-02  269   * serdev_controller_alloc() - Allocate a 
new serdev device
cd6484e1 Rob Herring 2017-02-02  270   * @ctrl: associated controller
cd6484e1 Rob Herring 2017-02-02  271   *
cd6484e1 Rob Herring 2017-02-02  272   * Caller is responsible for either 
calling serdev_device_add() to add the
cd6484e1 Rob Herring 2017-02-02  273   * newly allocated controller, or calling 
serdev_device_put() to discard it.

:: The code at line 265 was first introduced by commit
:: cd6484e1830be260abfba80a9c7d8f65531126d6 serdev: Introduce new bus for 
serial attached devices

:: TO: Rob Herring 
:: CC: Greg Kroah-Hartman 

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[driver-core:bus_type_removal 15/15] drivers/tty/serdev/core.c:265:2: error: unknown field 'dev_attrs' specified in initializer

2017-06-06 Thread kbuild test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git 
bus_type_removal
head:   98bcb3d030381f6f32f8952eeac289a63a13f07d
commit: 98bcb3d030381f6f32f8952eeac289a63a13f07d [15/15] driver-core: remove 
struct bus_type.dev_attrs
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 6.2.0
reproduce:
wget 
https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 98bcb3d030381f6f32f8952eeac289a63a13f07d
# save the attached .config to linux build tree
make.cross ARCH=ia64 

All errors (new ones prefixed by >>):

>> drivers/tty/serdev/core.c:265:2: error: unknown field 'dev_attrs' specified 
>> in initializer
 .dev_attrs = serdev_device_attrs,
 ^
>> drivers/tty/serdev/core.c:265:15: error: initialization from incompatible 
>> pointer type [-Werror=incompatible-pointer-types]
 .dev_attrs = serdev_device_attrs,
  ^~~
   drivers/tty/serdev/core.c:265:15: note: (near initialization for 
'serdev_bus_type.probe')
   cc1: some warnings being treated as errors

vim +/dev_attrs +265 drivers/tty/serdev/core.c

cd6484e1 Rob Herring 2017-02-02  259  static struct bus_type serdev_bus_type = {
cd6484e1 Rob Herring 2017-02-02  260.name   = "serial",
cd6484e1 Rob Herring 2017-02-02  261.match  = serdev_device_match,
cd6484e1 Rob Herring 2017-02-02  262.probe  = serdev_drv_probe,
cd6484e1 Rob Herring 2017-02-02  263.remove = serdev_drv_remove,
cd6484e1 Rob Herring 2017-02-02  264.uevent = serdev_uevent,
cd6484e1 Rob Herring 2017-02-02 @265.dev_attrs  = serdev_device_attrs,
cd6484e1 Rob Herring 2017-02-02  266  };
cd6484e1 Rob Herring 2017-02-02  267  
cd6484e1 Rob Herring 2017-02-02  268  /**

:: The code at line 265 was first introduced by commit
:: cd6484e1830be260abfba80a9c7d8f65531126d6 serdev: Introduce new bus for 
serial attached devices

:: TO: Rob Herring 
:: CC: Greg Kroah-Hartman 

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH 01/10] staging: fsl-mc: enclose macro params in parens

2017-06-06 Thread Laurentiu Tudor
Hi Greg,

> -Original Message-
> From: Greg KH [mailto:gre...@linuxfoundation.org]
> Sent: Saturday, June 03, 2017 11:41 AM
> 
> On Wed, May 31, 2017 at 01:58:43PM +0300, laurentiu.tu...@nxp.com wrote:
> > From: Laurentiu Tudor 
> >
> > Several macros didn't had macro params enclosed in parens. Fix them to
> > avoid precedence issues.
> >
> > Found with checkpatch.pl who was issuing this
> > message:
> >   "Macro argument 'id' may be better as '(id)'
> >to avoid precedence issues"
> 
> Why are you line-wrapping at such a small number?  Please use 72 columns like
> git asks you to...

I'll rewrap the commit message in the next spin.

---
Thanks & Best Regards, Laurentiu
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[BUGFIX PATCH] staging: ccree: fix buffer copy

2017-06-06 Thread Gilad Ben-Yossef
Fix a bug where the copying of scatterlist buffers incorrectly
ignored bytes to skip in a scatterlist and ended 1 byte short.

This fixes testmgr hmac and hash test failures currently obscured
by hash import/export not being supported.

Fixes: abefd6741d ("staging: ccree: introduce CryptoCell HW driver").

Signed-off-by: Gilad Ben-Yossef 
---

Please roll this patch into 4.12-rc5 if possible.

 drivers/staging/ccree/ssi_buffer_mgr.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/ccree/ssi_buffer_mgr.c 
b/drivers/staging/ccree/ssi_buffer_mgr.c
index 038e2ff..6471d3d 100644
--- a/drivers/staging/ccree/ssi_buffer_mgr.c
+++ b/drivers/staging/ccree/ssi_buffer_mgr.c
@@ -216,7 +216,8 @@ void ssi_buffer_mgr_copy_scatterlist_portion(
uint32_t nents, lbytes;
 
nents = ssi_buffer_mgr_get_sgl_nents(sg, end, &lbytes, NULL);
-   sg_copy_buffer(sg, nents, (void *)dest, (end - to_skip), 0, (direct == 
SSI_SG_TO_BUF));
+   sg_copy_buffer(sg, nents, (void *)dest, (end - to_skip + 1), to_skip,
+  (direct == SSI_SG_TO_BUF));
 }
 
 static inline int ssi_buffer_mgr_render_buff_to_mlli(
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 2/3] Documentation: Move visorbus documentation from staging to Documentation/

2017-06-06 Thread Jani Nikula
On Mon, 05 Jun 2017, David Kershner  wrote:
> This patch simply does a git mv of the
> drivers/staging/unisys/Documentation directory to Documentation.

Up to Jon, of course, but I wouldn't add any new files directly under
Documentation, and especially not something as specific as this.

BR,
Jani.


-- 
Jani Nikula, Intel Open Source Technology Center
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel