Re: ssb: Fix error routine when fallback SPROM fails

2016-11-16 Thread Kalle Valo
Larry Finger  wrote:
> When there is a CRC error in the SPROM read from the device, the code
> attempts to handle a fallback SPROM. When this also fails, the driver
> returns zero rather than an error code.
> 
> Signed-off-by: Larry Finger 
> Cc: Stable 

Patch applied to wireless-drivers-next.git, thanks.

8052d7245b60 ssb: Fix error routine when fallback SPROM fails

-- 
https://patchwork.kernel.org/patch/9413783/

Documentation about submitting wireless patches and checking status
from patchwork:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

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


Re: [1/8] rtlwifi: rtl8192de: Remove address of Free Software Foundation

2016-11-16 Thread Kalle Valo
Larry Finger  wrote:
> Since this driver was added to the kernel, the checkpatch script was
> modified to request that the address of the FSF not be included.
> 
> Signed-off-by: Larry Finger 

8 patches applied to wireless-drivers-next.git, thanks.

0d3d253b2040 rtlwifi: rtl8192de: Remove address of Free Software Foundation
22beafeaf324 rtlwifi: rtl8192se: Remove address of Free Software Foundation
6456d4d35e9b rtlwifi: rtl8192ce: Remove address of Free Software Foundation
7d63d36b9286 rtlwifi: rtl8192cu: Remove address of Free Software Foundation
20ac950f20a0 rtlwifi: rtl8723ae: Remove address of Free Software Foundation
044a609a1dc9 rtlwifi: rtl8188ee: Remove address of Free Software Foundation
61a288fcdc9d rtlwifi: rtl8192c: Remove address of Free Software Foundation
1b4893264e4f rtlwifi: Remove address of Free Software Foundation

-- 
https://patchwork.kernel.org/patch/9362481/

Documentation about submitting wireless patches and checking status
from patchwork:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

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


[PATCH v3 1/2] staging: slicoss: fix different address space warnings: 32 bits

2016-11-16 Thread Sergio Paracuellos
This patch fix the following sparse warnings in slicoss driver:
warning: incorrect type in assignment (different address spaces)

This changes are for 32 bit architectures.

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/slicoss/slic.h|  9 +
 drivers/staging/slicoss/slicoss.c | 82 ++-
 2 files changed, 56 insertions(+), 35 deletions(-)

diff --git a/drivers/staging/slicoss/slic.h b/drivers/staging/slicoss/slic.h
index 420546d..d637ab1 100644
--- a/drivers/staging/slicoss/slic.h
+++ b/drivers/staging/slicoss/slic.h
@@ -540,6 +540,15 @@ static inline void slic_flush_write(struct adapter 
*adapter)
ioread32(adapter->regs + SLIC_REG_HOSTID);
 }
 
+static inline u64 slic_ioread64(void __iomem *mmio)
+{
+   u64 low, high;
+
+   low = ioread32(mmio);
+   high = ioread32(mmio + sizeof(u32));
+   return low | (high << 32);
+}
+
 #define UPDATE_STATS(largestat, newstat, oldstat)\
 {\
if ((newstat) < (oldstat))   \
diff --git a/drivers/staging/slicoss/slicoss.c 
b/drivers/staging/slicoss/slicoss.c
index d2929b9..c0bc1a8 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -923,8 +923,8 @@ static int slic_upr_request(struct adapter *adapter,
 static void slic_link_upr_complete(struct adapter *adapter, u32 isr)
 {
struct slic_shmemory *sm = >shmem;
-   struct slic_shmem_data *sm_data = sm->shmem_data;
-   u32 lst = sm_data->lnkstatus;
+   struct slic_shmem_data __iomem *sm_data = sm->shmem_data;
+   u32 lst = ioread32(_data->lnkstatus);
uint linkup;
unsigned char linkspeed;
unsigned char linkduplex;
@@ -1003,8 +1003,8 @@ static void slic_upr_request_complete(struct adapter 
*adapter, u32 isr)
switch (upr->upr_request) {
case SLIC_UPR_STATS: {
struct slic_shmemory *sm = >shmem;
-   struct slic_shmem_data *sm_data = sm->shmem_data;
-   struct slic_stats *stats = _data->stats;
+   struct slic_shmem_data __iomem *sm_data = sm->shmem_data;
+   struct slic_stats __iomem *stats = _data->stats;
struct slic_stats *old = >inicstats_prev;
struct slicnet_stats *stst = >slic_stats;
 
@@ -1014,50 +1014,62 @@ static void slic_upr_request_complete(struct adapter 
*adapter, u32 isr)
break;
}
 
-   UPDATE_STATS_GB(stst->tcp.xmit_tcp_segs, stats->xmit_tcp_segs,
+   UPDATE_STATS_GB(stst->tcp.xmit_tcp_segs,
+   slic_ioread64(>xmit_tcp_segs),
old->xmit_tcp_segs);
 
-   UPDATE_STATS_GB(stst->tcp.xmit_tcp_bytes, stats->xmit_tcp_bytes,
+   UPDATE_STATS_GB(stst->tcp.xmit_tcp_bytes,
+   slic_ioread64(>xmit_tcp_bytes),
old->xmit_tcp_bytes);
 
-   UPDATE_STATS_GB(stst->tcp.rcv_tcp_segs, stats->rcv_tcp_segs,
+   UPDATE_STATS_GB(stst->tcp.rcv_tcp_segs,
+   slic_ioread64(>rcv_tcp_segs),
old->rcv_tcp_segs);
 
-   UPDATE_STATS_GB(stst->tcp.rcv_tcp_bytes, stats->rcv_tcp_bytes,
+   UPDATE_STATS_GB(stst->tcp.rcv_tcp_bytes,
+   slic_ioread64(>rcv_tcp_bytes),
old->rcv_tcp_bytes);
 
-   UPDATE_STATS_GB(stst->iface.xmt_bytes, stats->xmit_bytes,
+   UPDATE_STATS_GB(stst->iface.xmt_bytes,
+   slic_ioread64(>xmit_bytes),
old->xmit_bytes);
 
-   UPDATE_STATS_GB(stst->iface.xmt_ucast, stats->xmit_unicasts,
+   UPDATE_STATS_GB(stst->iface.xmt_ucast,
+   slic_ioread64(>xmit_unicasts),
old->xmit_unicasts);
 
-   UPDATE_STATS_GB(stst->iface.rcv_bytes, stats->rcv_bytes,
+   UPDATE_STATS_GB(stst->iface.rcv_bytes,
+   slic_ioread64(>rcv_bytes),
old->rcv_bytes);
 
-   UPDATE_STATS_GB(stst->iface.rcv_ucast, stats->rcv_unicasts,
+   UPDATE_STATS_GB(stst->iface.rcv_ucast,
+   slic_ioread64(>rcv_unicasts),
old->rcv_unicasts);
 
-   UPDATE_STATS_GB(stst->iface.xmt_errors, stats->xmit_collisions,
+   UPDATE_STATS_GB(stst->iface.xmt_errors,
+   slic_ioread64(>xmit_collisions),
old->xmit_collisions);
 
UPDATE_STATS_GB(stst->iface.xmt_errors,
-   stats->xmit_excess_collisions,
+   

[PATCH v3 0/2] staging: slicoss: fix different address space warnings

2016-11-16 Thread Sergio Paracuellos
This patchset fix the following sparse warning:
warning: incorrect type in assignment (different address spaces)

Changes in v2:
* Remove IOMEM_GET_FIELDADDR macro
* Add ioread64 and iowrite64 defines

Changes in v3:
* Remove ioread64 and iowrite64 defines
* Split into two patches: one for 32 bits stuff and the other for 64 bits.

Sergio Paracuellos (2):
  staging: slicoss: fix different address space warnings: 32 bits
  staging: slicoss: fix different address space warnings: 64 bits

 drivers/staging/slicoss/slic.h| 18 +
 drivers/staging/slicoss/slicoss.c | 82 ++-
 2 files changed, 65 insertions(+), 35 deletions(-)

-- 
1.9.1

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


[PATCH v3 2/2] staging: slicoss: fix different address space warnings: 64 bits

2016-11-16 Thread Sergio Paracuellos
This patch fix the following sparse warnings in slicoss driver:
warning: incorrect type in assignment (different address spaces)

This changes are for 64 bits.

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/slicoss/slic.h | 9 +
 1 file changed, 9 insertions(+)

diff --git a/drivers/staging/slicoss/slic.h b/drivers/staging/slicoss/slic.h
index d637ab1..63637ba 100644
--- a/drivers/staging/slicoss/slic.h
+++ b/drivers/staging/slicoss/slic.h
@@ -540,6 +540,7 @@ static inline void slic_flush_write(struct adapter *adapter)
ioread32(adapter->regs + SLIC_REG_HOSTID);
 }
 
+#if BITS_PER_LONG == 32
 static inline u64 slic_ioread64(void __iomem *mmio)
 {
u64 low, high;
@@ -548,6 +549,14 @@ static inline u64 slic_ioread64(void __iomem *mmio)
high = ioread32(mmio + sizeof(u32));
return low | (high << 32);
 }
+#elif BITS_PER_LONG == 64
+static inline u64 slic_ioread64(void __iomem *mmio)
+{
+   return readq(mmio);
+}
+#else
+#error BITS_PER_LONG must be 32 or 64
+#endif
 
 #define UPDATE_STATS(largestat, newstat, oldstat)\
 {\
-- 
1.9.1

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


[PATCH v2 4/7] staging: xgifb: XGI_main_26.c Space around operator

2016-11-16 Thread Walt Feasel
Make suggested checkpatch modification for
CHECK: spaces preferred around that '-,&'

Signed-off-by: Walt Feasel 
---
v2 makes changes to correct for email format patch submission

 drivers/staging/xgifb/XGI_main_26.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/xgifb/XGI_main_26.c 
b/drivers/staging/xgifb/XGI_main_26.c
index 9218c74..6e8df20 100644
--- a/drivers/staging/xgifb/XGI_main_26.c
+++ b/drivers/staging/xgifb/XGI_main_26.c
@@ -561,7 +561,7 @@ static u8 XGIfb_search_refresh_rate(struct xgifb_video_info 
*xgifb_info,
!= 1)) {
pr_debug("Adjusting rate from %d down 
to %d\n",
 rate,
-XGIfb_vrate[i-1].refresh);
+XGIfb_vrate[i - 1].refresh);
xgifb_info->rate_idx =
XGIfb_vrate[i - 1].idx;
xgifb_info->refresh_rate =
@@ -1696,7 +1696,7 @@ static int xgifb_probe(struct pci_dev *pdev,
case PCI_DEVICE_ID_XGI_20:
xgifb_reg_or(XGICR, Index_CR_GPIO_Reg3, GPIOG_EN);
CR48 = xgifb_reg_get(XGICR, Index_CR_GPIO_Reg1);
-   if (CR48_READ)
+   if (CR48 & GPIOG_READ)
xgifb_info->chip = XG21;
else
xgifb_info->chip = XG20;
@@ -1782,9 +1782,9 @@ static int xgifb_probe(struct pci_dev *pdev,
xgifb_info->hasVB = HASVB_NONE;
} else if (xgifb_info->chip == XG21) {
CR38 = xgifb_reg_get(XGICR, 0x38);
-   if ((CR38&0xE0) == 0xC0)
+   if ((CR38 & 0xE0) == 0xC0)
xgifb_info->display2 = XGIFB_DISP_LCD;
-   else if ((CR38&0xE0) == 0x60)
+   else if ((CR38 & 0xE0) == 0x60)
xgifb_info->hasVB = HASVB_CHRONTEL;
else
xgifb_info->hasVB = HASVB_NONE;
-- 
2.1.4

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


[PATCH v2 5/7] staging: xgifb: XGI_main_26.c Blank line after {

2016-11-16 Thread Walt Feasel
Make suggested checkpatch modification for
CHECK: Blank lines aren't necessary after an open brace '{'

Signed-off-by: Walt Feasel 
---
v2 makes changes to correct for email format patch submission

 drivers/staging/xgifb/XGI_main_26.c | 12 
 1 file changed, 12 deletions(-)

diff --git a/drivers/staging/xgifb/XGI_main_26.c 
b/drivers/staging/xgifb/XGI_main_26.c
index 6e8df20..b1fe17e 100644
--- a/drivers/staging/xgifb/XGI_main_26.c
+++ b/drivers/staging/xgifb/XGI_main_26.c
@@ -729,7 +729,6 @@ static void XGIfb_post_setmode(struct xgifb_video_info 
*xgifb_info)
 
if (xgifb_info->display2 == XGIFB_DISP_TV &&
xgifb_info->hasVB == HASVB_301) {
-
reg = xgifb_reg_get(XGIPART4, 0x01);
 
if (reg < 0xB0) { /* Set filter for XGI301 */
@@ -762,16 +761,13 @@ static void XGIfb_post_setmode(struct xgifb_video_info 
*xgifb_info)
 0x01);
 
if (xgifb_info->TV_type == TVMODE_NTSC) {
-
xgifb_reg_and(XGIPART2, 0x3a, 0x1f);
 
if (xgifb_info->TV_plug == TVPLUG_SVIDEO) {
-
xgifb_reg_and(XGIPART2, 0x30, 0xdf);
 
} else if (xgifb_info->TV_plug
== TVPLUG_COMPOSITE) {
-
xgifb_reg_or(XGIPART2, 0x30, 0x20);
 
switch (xgifb_info->video_width) {
@@ -821,16 +817,13 @@ static void XGIfb_post_setmode(struct xgifb_video_info 
*xgifb_info)
}
 
} else if (xgifb_info->TV_type == TVMODE_PAL) {
-
xgifb_reg_and(XGIPART2, 0x3A, 0x1F);
 
if (xgifb_info->TV_plug == TVPLUG_SVIDEO) {
-
xgifb_reg_and(XGIPART2, 0x30, 0xDF);
 
} else if (xgifb_info->TV_plug
== TVPLUG_COMPOSITE) {
-
xgifb_reg_or(XGIPART2, 0x30, 0x20);
 
switch (xgifb_info->video_width) {
@@ -991,7 +984,6 @@ static int XGIfb_do_set_var(struct fb_var_screeninfo *var, 
int isactive,
}
 
if (isactive) {
-
XGIfb_pre_setmode(xgifb_info);
if (XGISetModeNew(xgifb_info, hw_info,
  XGIbios_mode[xgifb_info->mode_idx].mode_no)
@@ -1274,7 +1266,6 @@ static int XGIfb_check_var(struct fb_var_screeninfo *var, 
struct fb_info *info)
}
 
if (!found_mode) {
-
pr_err("%dx%dx%d is no valid mode\n",
var->xres, var->yres, var->bits_per_pixel);
search_idx = 0;
@@ -1399,7 +1390,6 @@ static struct fb_ops XGIfb_ops = {
 
 static int XGIfb_get_dram_size(struct xgifb_video_info *xgifb_info)
 {
-
u8 ChannelNum, tmp;
u8 reg = 0;
 
@@ -1595,7 +1585,6 @@ static int __init XGIfb_setup(char *options)
pr_info("Options: %s\n", options);
 
while ((this_opt = strsep(, ",")) != NULL) {
-
if (!*this_opt)
continue;
 
@@ -1977,7 +1966,6 @@ static int xgifb_probe(struct pci_dev *pdev,
_info->var.vsync_len,
_info->var.sync,
_info->var.vmode)) {
-
if ((fb_info->var.vmode & FB_VMODE_MASK) ==
FB_VMODE_INTERLACED) {
fb_info->var.yres <<= 1;
-- 
2.1.4

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


[PATCH v2 7/7] staging: xgifb: XGI_main_26.c Align match parenthesis

2016-11-16 Thread Walt Feasel
Make suggested checkpatch modification for
CHECK: Alignment should match open parenthesis

Signed-off-by: Walt Feasel 
---
v2 makes changes to correct for email format patch submission

 drivers/staging/xgifb/XGI_main_26.c | 100 +---
 1 file changed, 46 insertions(+), 54 deletions(-)

diff --git a/drivers/staging/xgifb/XGI_main_26.c 
b/drivers/staging/xgifb/XGI_main_26.c
index e31d107..777cd6e 100644
--- a/drivers/staging/xgifb/XGI_main_26.c
+++ b/drivers/staging/xgifb/XGI_main_26.c
@@ -56,8 +56,8 @@ static inline void dumpVGAReg(struct xgifb_video_info 
*xgifb_info)
 /* --- Hardware Access Routines -- */
 
 static int XGIfb_mode_rate_to_dclock(struct vb_device_info *XGI_Pr,
-   struct xgi_hw_device_info *HwDeviceExtension,
-   unsigned char modeno)
+struct xgi_hw_device_info 
*HwDeviceExtension,
+unsigned char modeno)
 {
unsigned short ModeNo = modeno;
unsigned short ModeIdIndex = 0, ClockIndex = 0;
@@ -68,7 +68,7 @@ static int XGIfb_mode_rate_to_dclock(struct vb_device_info 
*XGI_Pr,
XGI_SearchModeID(ModeNo, );
 
RefreshRateTableIndex = XGI_GetRatePtrCRT2(HwDeviceExtension, ModeNo,
-   ModeIdIndex, XGI_Pr);
+  ModeIdIndex, XGI_Pr);
 
ClockIndex = XGI330_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK;
 
@@ -76,11 +76,11 @@ static int XGIfb_mode_rate_to_dclock(struct vb_device_info 
*XGI_Pr,
 }
 
 static int XGIfb_mode_rate_to_ddata(struct vb_device_info *XGI_Pr,
-   struct xgi_hw_device_info *HwDeviceExtension,
-   unsigned char modeno,
-   u32 *left_margin, u32 *right_margin, u32 *upper_margin,
-   u32 *lower_margin, u32 *hsync_len, u32 *vsync_len, u32 *sync,
-   u32 *vmode)
+   struct xgi_hw_device_info 
*HwDeviceExtension,
+   unsigned char modeno, u32 *left_margin,
+   u32 *right_margin, u32 *upper_margin,
+   u32 *lower_margin, u32 *hsync_len,
+   u32 *vsync_len, u32 *sync, u32 *vmode)
 {
unsigned short ModeNo = modeno;
unsigned short ModeIdIndex, index = 0;
@@ -95,7 +95,7 @@ static int XGIfb_mode_rate_to_ddata(struct vb_device_info 
*XGI_Pr,
if (!XGI_SearchModeID(ModeNo, ))
return 0;
RefreshRateTableIndex = XGI_GetRatePtrCRT2(HwDeviceExtension, ModeNo,
-   ModeIdIndex, XGI_Pr);
+  ModeIdIndex, XGI_Pr);
index = XGI330_RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC;
 
sr_data = XGI_CRT1Table[index].CR[5];
@@ -682,7 +682,7 @@ static void XGIfb_pre_setmode(struct xgifb_video_info 
*xgifb_info)
xgifb_reg_set(XGICR, IND_XGI_SCRATCH_REG_CR30, cr30);
xgifb_reg_set(XGICR, IND_XGI_SCRATCH_REG_CR31, cr31);
xgifb_reg_set(XGICR, IND_XGI_SCRATCH_REG_CR33,
-   (xgifb_info->rate_idx & 0x0F));
+ (xgifb_info->rate_idx & 0x0F));
 }
 
 static void XGIfb_post_setmode(struct xgifb_video_info *xgifb_info)
@@ -904,7 +904,7 @@ static void XGIfb_post_setmode(struct xgifb_video_info 
*xgifb_info)
 }
 
 static int XGIfb_do_set_var(struct fb_var_screeninfo *var, int isactive,
-   struct fb_info *info)
+   struct fb_info *info)
 {
struct xgifb_video_info *xgifb_info = info->par;
struct xgi_hw_device_info *hw_info = _info->hw_info;
@@ -944,10 +944,8 @@ static int XGIfb_do_set_var(struct fb_var_screeninfo *var, 
int isactive,
}
 
pr_debug("Change mode to %dx%dx%d-%dHz\n",
-  var->xres,
-  var->yres,
-  var->bits_per_pixel,
-  xgifb_info->refresh_rate);
+var->xres, var->yres, var->bits_per_pixel,
+xgifb_info->refresh_rate);
 
old_mode = xgifb_info->mode_idx;
xgifb_info->mode_idx = 0;
@@ -1159,7 +1157,7 @@ static int XGIfb_setcolreg(unsigned int regno, unsigned 
int red,
 /* --- FBDev related routines for all series -- */
 
 static int XGIfb_get_fix(struct fb_fix_screeninfo *fix, int con,
-   struct fb_info *info)
+struct fb_info *info)
 {
struct xgifb_video_info *xgifb_info = info->par;
 
@@ -1253,10 +1251,10 @@ static int XGIfb_check_var(struct fb_var_screeninfo 
*var, struct fb_info *info)
 
search_idx = 0;
while ((XGIbios_mode[search_idx].mode_no != 0) &&
-   (XGIbios_mode[search_idx].xres <= var->xres)) {
+  (XGIbios_mode[search_idx].xres <= var->xres)) {
if ((XGIbios_mode[search_idx].xres == var->xres) &&
-   

[PATCH v2 1/7] staging: xgifb: XGI_main_26.c Comment style modifications

2016-11-16 Thread Walt Feasel
Make comment style modifications.

Signed-off-by: Walt Feasel 
---
v2 makes changes to correct for email format patch submission

 drivers/staging/xgifb/XGI_main_26.c | 14 +-
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/xgifb/XGI_main_26.c 
b/drivers/staging/xgifb/XGI_main_26.c
index 982f90f..95999cd 100644
--- a/drivers/staging/xgifb/XGI_main_26.c
+++ b/drivers/staging/xgifb/XGI_main_26.c
@@ -1064,7 +1064,7 @@ static int XGIfb_do_set_var(struct fb_var_screeninfo 
*var, int isactive,
break;
}
}
-   XGIfb_bpp_to_var(xgifb_info, var); /*update ARGB info*/
+   XGIfb_bpp_to_var(xgifb_info, var); /* update ARGB info */
 
dumpVGAReg(xgifb_info);
return 0;
@@ -1688,7 +1688,7 @@ static int xgifb_probe(struct pci_dev *pdev,
xgifb_reg_set(XGISR, IND_SIS_PASSWORD, SIS_PASSWORD);
reg1 = xgifb_reg_get(XGISR, IND_SIS_PASSWORD);
 
-   if (reg1 != 0xa1) { /*I/O error */
+   if (reg1 != 0xa1) { /* I/O error */
dev_err(>dev, "I/O error\n");
ret = -EIO;
goto error_disable;
@@ -1727,7 +1727,7 @@ static int xgifb_probe(struct pci_dev *pdev,
xgifb_info->video_size = video_size_max;
}
 
-   /* Enable PCI_LINEAR_ADDRESSING and MMIO_ENABLE  */
+   /* Enable PCI_LINEAR_ADDRESSING and MMIO_ENABLE */
xgifb_reg_or(XGISR,
 IND_SIS_PCI_ADDRESS_SET,
 (SIS_PCI_ADDR_ENABLE | SIS_MEM_MAP_IO_ENABLE));
@@ -2028,9 +2028,7 @@ static int xgifb_probe(struct pci_dev *pdev,
return ret;
 }
 
-/*/
-/*PCI DEVICE HANDLING*/
-/*/
+/*  PCI DEVICE HANDLING  */
 
 static void xgifb_remove(struct pci_dev *pdev)
 {
@@ -2054,9 +2052,7 @@ static struct pci_driver xgifb_driver = {
.remove = xgifb_remove
 };
 
-/*/
-/*  MODULE   */
-/*/
+/*  MODULE  */
 
 module_param(mode, charp, );
 MODULE_PARM_DESC(mode,
-- 
2.1.4

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


[PATCH v2 6/7] staging: xgifb: XGI_main_26.c Blank line before }

2016-11-16 Thread Walt Feasel
Make suggested checkpatch modification for
CHECK: Blank lines aren't necessary before a close brace '}'

Signed-off-by: Walt Feasel 
---
v2 makes changes to correct for email format patch submission

 drivers/staging/xgifb/XGI_main_26.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/xgifb/XGI_main_26.c 
b/drivers/staging/xgifb/XGI_main_26.c
index b1fe17e..e31d107 100644
--- a/drivers/staging/xgifb/XGI_main_26.c
+++ b/drivers/staging/xgifb/XGI_main_26.c
@@ -1465,7 +1465,6 @@ static int XGIfb_get_dram_size(struct xgifb_video_info 
*xgifb_info)
   reg,
   xgifb_info->video_size, ChannelNum);
return 0;
-
 }
 
 static void XGIfb_detect_VB(struct xgifb_video_info *xgifb_info)
@@ -1976,7 +1975,6 @@ static int xgifb_probe(struct pci_dev *pdev,
fb_info->var.yres >>= 1;
fb_info->var.yres_virtual >>= 1;
}
-
}
 
fb_info->flags = FBINFO_FLAG_DEFAULT;
-- 
2.1.4

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


[PATCH v2 0/7] staging: xgifb: XGI_main_26.c checkpatch modifications

2016-11-16 Thread Walt Feasel
Make Linux kernel coding style modifications for XGI_main_26.c to include:

CHECK: Alignment should match open parenthesis
CHECK: No space is necessary after a cast
CHECK: Logical continuations should be on the previous line
CHECK: spaces preferred around that '-'
CHECK: Blank lines aren't necessary after an open brace '{'
CHECK: Blank lines aren't necessary before a close brace '}'
Comment style modifications

Walt Feasel (7):

  staging: xgifb: XGI_main_26.c Comment style modifications
  staging: xgifb: XGI_main_26.c No space after cast
  staging: xgifb: XGI_main_26.c Logical continuation
  staging: xgifb: XGI_main_26.c Space around operator
  staging: xgifb: XGI_main_26.c Blank line after {
  staging: xgifb: XGI_main_26.c Blank line before }
  staging: xgifb: XGI_main_26.c Align match parenthesis

 drivers/staging/xgifb/XGI_main_26.c | 184 +++-
 1 file changed, 78 insertions(+), 106 deletions(-)

--
v2 makes changes to correct for email format patch submission 
2.1.4

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


[PATCH v2 2/7] staging: xgifb: XGI_main_26.c No space after cast

2016-11-16 Thread Walt Feasel
Make suggested checkpatch modification for
CHECK: No space is necessary after a cast

Signed-off-by: Walt Feasel 
---
v2 makes changes to correct for email format patch submission

 drivers/staging/xgifb/XGI_main_26.c | 30 +++---
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/xgifb/XGI_main_26.c 
b/drivers/staging/xgifb/XGI_main_26.c
index 95999cd..51b1194 100644
--- a/drivers/staging/xgifb/XGI_main_26.c
+++ b/drivers/staging/xgifb/XGI_main_26.c
@@ -105,7 +105,7 @@ static int XGIfb_mode_rate_to_ddata(struct vb_device_info 
*XGI_Pr,
cr_data = XGI_CRT1Table[index].CR[3];
 
/* Horizontal retrace (=sync) start */
-   HRS = (cr_data & 0xff) | ((unsigned short) (sr_data & 0xC0) << 2);
+   HRS = (cr_data & 0xff) | ((unsigned short)(sr_data & 0xC0) << 2);
F = HRS - HDE - 3;
 
sr_data = XGI_CRT1Table[index].CR[6];
@@ -115,8 +115,8 @@ static int XGIfb_mode_rate_to_ddata(struct vb_device_info 
*XGI_Pr,
cr_data2 = XGI_CRT1Table[index].CR[4];
 
/* Horizontal blank end */
-   HBE = (cr_data & 0x1f) | ((unsigned short) (cr_data2 & 0x80) >> 2)
-   | ((unsigned short) (sr_data & 0x03) << 6);
+   HBE = (cr_data & 0x1f) | ((unsigned short)(cr_data2 & 0x80) >> 2)
+   | ((unsigned short)(sr_data & 0x03) << 6);
 
/* Horizontal retrace (=sync) end */
HRE = (cr_data2 & 0x1f) | ((sr_data & 0x04) << 3);
@@ -142,15 +142,15 @@ static int XGIfb_mode_rate_to_ddata(struct vb_device_info 
*XGI_Pr,
cr_data = XGI_CRT1Table[index].CR[10];
 
/* Vertical retrace (=sync) start */
-   VRS = (cr_data & 0xff) | ((unsigned short) (cr_data2 & 0x04) << 6)
-   | ((unsigned short) (cr_data2 & 0x80) << 2)
-   | ((unsigned short) (sr_data & 0x08) << 7);
+   VRS = (cr_data & 0xff) | ((unsigned short)(cr_data2 & 0x04) << 6)
+   | ((unsigned short)(cr_data2 & 0x80) << 2)
+   | ((unsigned short)(sr_data & 0x08) << 7);
F = VRS + 1 - VDE;
 
cr_data = XGI_CRT1Table[index].CR[13];
 
/* Vertical blank end */
-   VBE = (cr_data & 0xff) | ((unsigned short) (sr_data & 0x10) << 4);
+   VBE = (cr_data & 0xff) | ((unsigned short)(sr_data & 0x10) << 4);
temp = VBE - ((VDE - 1) & 511);
B = (temp > 0) ? temp : (temp + 512);
 
@@ -945,7 +945,7 @@ static int XGIfb_do_set_var(struct fb_var_screeninfo *var, 
int isactive,
if (var->pixclock) {
drate = 10 / var->pixclock;
hrate = (drate * 1000) / htotal;
-   xgifb_info->refresh_rate = (unsigned int) (hrate * 2
+   xgifb_info->refresh_rate = (unsigned int)(hrate * 2
/ vtotal);
} else {
xgifb_info->refresh_rate = 60;
@@ -1150,7 +1150,7 @@ static int XGIfb_setcolreg(unsigned int regno, unsigned 
int red,
}
break;
case 16:
-   ((u32 *) (info->pseudo_palette))[regno] = ((red & 0xf800))
+   ((u32 *)(info->pseudo_palette))[regno] = ((red & 0xf800))
| ((green & 0xfc00) >> 5) | ((blue & 0xf800)
>> 11);
break;
@@ -1158,7 +1158,7 @@ static int XGIfb_setcolreg(unsigned int regno, unsigned 
int red,
red >>= 8;
green >>= 8;
blue >>= 8;
-   ((u32 *) (info->pseudo_palette))[regno] = (red << 16) | (green
+   ((u32 *)(info->pseudo_palette))[regno] = (red << 16) | (green
<< 8) | (blue);
break;
}
@@ -1250,7 +1250,7 @@ static int XGIfb_check_var(struct fb_var_screeninfo *var, 
struct fb_info *info)
drate = 10 / var->pixclock;
hrate = (drate * 1000) / htotal;
xgifb_info->refresh_rate =
-   (unsigned int) (hrate * 2 / vtotal);
+   (unsigned int)(hrate * 2 / vtotal);
pr_debug(
"%s: pixclock = %d ,htotal=%d, vtotal=%d\n"
"%s: drate=%d, hrate=%d, refresh_rate=%d\n",
@@ -1670,7 +1670,7 @@ static int xgifb_probe(struct pci_dev *pdev,
xgifb_info->mmio_size = pci_resource_len(pdev, 1);
xgifb_info->vga_base = pci_resource_start(pdev, 2) + 0x30;
dev_info(>dev, "Relocate IO address: %Lx [%08lx]\n",
-(u64) pci_resource_start(pdev, 2),
+(u64)pci_resource_start(pdev, 2),
 xgifb_info->vga_base);
 
if (pci_enable_device(pdev)) {
@@ -1763,13 +1763,13 @@ static int xgifb_probe(struct pci_dev *pdev,
 
dev_info(>dev,
 "Framebuffer at 0x%Lx, mapped to 0x%p, size %dk\n",
-(u64) xgifb_info->video_base,
+(u64)xgifb_info->video_base,
   

[PATCH v2 3/7] staging: xgifb: XGI_main_26.c Logical continuation

2016-11-16 Thread Walt Feasel
Make suggested checkpatch modification for
CHECK: Logical continuations should be on the previous line

Signed-off-by: Walt Feasel 
---
v2 makes changes to correct for email format patch submission

 drivers/staging/xgifb/XGI_main_26.c | 20 +---
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/xgifb/XGI_main_26.c 
b/drivers/staging/xgifb/XGI_main_26.c
index 51b1194..9218c74 100644
--- a/drivers/staging/xgifb/XGI_main_26.c
+++ b/drivers/staging/xgifb/XGI_main_26.c
@@ -231,11 +231,11 @@ static int XGIfb_GetXG21DefaultLVDSModeIdx(struct 
xgifb_video_info *xgifb_info)
 {
int i = 0;
 
-   while ((XGIbios_mode[i].mode_no != 0)
-  && (XGIbios_mode[i].xres <= xgifb_info->lvds_data.LVDSHDE)) {
-   if ((XGIbios_mode[i].xres == xgifb_info->lvds_data.LVDSHDE)
-   && (XGIbios_mode[i].yres == xgifb_info->lvds_data.LVDSVDE)
-   && (XGIbios_mode[i].bpp == 8)) {
+   while ((XGIbios_mode[i].mode_no != 0) &&
+  (XGIbios_mode[i].xres <= xgifb_info->lvds_data.LVDSHDE)) {
+   if ((XGIbios_mode[i].xres == xgifb_info->lvds_data.LVDSHDE) &&
+   (XGIbios_mode[i].yres == xgifb_info->lvds_data.LVDSVDE) &&
+   (XGIbios_mode[i].bpp == 8)) {
return i;
}
i++;
@@ -384,9 +384,8 @@ static int XGIfb_validate_mode(struct xgifb_video_info 
*xgifb_info, int myindex)
return -1;
break;
case 640:
-   if ((XGIbios_mode[myindex].yres != 400)
-   && (XGIbios_mode[myindex].yres
-   != 480))
+   if ((XGIbios_mode[myindex].yres != 400) &&
+   (XGIbios_mode[myindex].yres != 480))
return -1;
break;
case 800:
@@ -1344,9 +1343,8 @@ static int XGIfb_pan_display(struct fb_var_screeninfo 
*var,
if (var->vmode & FB_VMODE_YWRAP) {
if (var->yoffset >= info->var.yres_virtual || var->xoffset)
return -EINVAL;
-   } else if (var->xoffset + info->var.xres > info->var.xres_virtual
-   || var->yoffset + info->var.yres
-   > info->var.yres_virtual) {
+   } else if (var->xoffset + info->var.xres > info->var.xres_virtual ||
+  var->yoffset + info->var.yres > info->var.yres_virtual) {
return -EINVAL;
}
err = XGIfb_pan_var(var, info);
-- 
2.1.4

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


[PATCH v2 2/3] staging: xgifb: vb_init.c Align on parenthesis

2016-11-16 Thread Walt Feasel
Make suggested checkpatch modification for:
CHECK: Alignment should match open parenthesis.

Signed-off-by: Walt Feasel 

---
v2 makes changes to correct for email format patch submission

 drivers/staging/xgifb/vb_init.c | 24 +---
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/xgifb/vb_init.c b/drivers/staging/xgifb/vb_init.c
index 55978c1..254d5a9 100644
--- a/drivers/staging/xgifb/vb_init.c
+++ b/drivers/staging/xgifb/vb_init.c
@@ -199,7 +199,8 @@ static void XGINew_DDRII_Bootup_XG27(
 }
 
 static void XGINew_DDR2_MRS_XG20(struct xgi_hw_device_info *HwDeviceExtension,
-   unsigned long P3c4, struct vb_device_info *pVBInfo)
+unsigned long P3c4,
+struct vb_device_info *pVBInfo)
 {
unsigned long P3d4 = P3c4 + 0x10;
 
@@ -387,7 +388,7 @@ static void XGINew_DDR2_DefaultRegister(
 }
 
 static void XGI_SetDRAM_Helper(unsigned long P3d4, u8 seed, u8 temp2, u8 reg,
-   u8 shift_factor, u8 mask1, u8 mask2)
+  u8 shift_factor, u8 mask1, u8 mask2)
 {
u8 j;
 
@@ -460,15 +461,15 @@ static void XGINew_SetDRAMDefaultRegister340(
 
for (j = 0; j <= 6; j++) /* CR90 - CR96 */
xgifb_reg_set(P3d4, (0x90 + j),
-   pVBInfo->CR40[14 + j][pVBInfo->ram_type]);
+ pVBInfo->CR40[14 + j][pVBInfo->ram_type]);
 
for (j = 0; j <= 2; j++) /* CRC3 - CRC5 */
xgifb_reg_set(P3d4, (0xC3 + j),
-   pVBInfo->CR40[21 + j][pVBInfo->ram_type]);
+ pVBInfo->CR40[21 + j][pVBInfo->ram_type]);
 
for (j = 0; j < 2; j++) /* CR8A - CR8B */
xgifb_reg_set(P3d4, (0x8A + j),
-   pVBInfo->CR40[1 + j][pVBInfo->ram_type]);
+ pVBInfo->CR40[1 + j][pVBInfo->ram_type]);
 
if (HwDeviceExtension->jChipType == XG42)
xgifb_reg_set(P3d4, 0x8C, 0x87);
@@ -539,7 +540,8 @@ static unsigned short XGINew_SetDRAMSize20Reg(
 }
 
 static int XGINew_ReadWriteRest(unsigned short StopAddr,
-   unsigned short StartAddr, struct vb_device_info *pVBInfo)
+   unsigned short StartAddr,
+   struct vb_device_info *pVBInfo)
 {
int i;
unsigned long Position = 0;
@@ -583,7 +585,7 @@ static unsigned char XGINew_CheckFrequence(struct 
vb_device_info *pVBInfo)
 }
 
 static void XGINew_CheckChannel(struct xgi_hw_device_info *HwDeviceExtension,
-   struct vb_device_info *pVBInfo)
+   struct vb_device_info *pVBInfo)
 {
unsigned char data;
 
@@ -785,7 +787,7 @@ static void XGINew_CheckChannel(struct xgi_hw_device_info 
*HwDeviceExtension,
 }
 
 static int XGINew_DDRSizing340(struct xgi_hw_device_info *HwDeviceExtension,
-   struct vb_device_info *pVBInfo)
+  struct vb_device_info *pVBInfo)
 {
u8 i, size;
unsigned short memsize, start_addr;
@@ -827,8 +829,8 @@ static int XGINew_DDRSizing340(struct xgi_hw_device_info 
*HwDeviceExtension,
 }
 
 static void XGINew_SetDRAMSize_340(struct xgifb_video_info *xgifb_info,
-   struct xgi_hw_device_info *HwDeviceExtension,
-   struct vb_device_info *pVBInfo)
+  struct xgi_hw_device_info *HwDeviceExtension,
+  struct vb_device_info *pVBInfo)
 {
unsigned short data;
 
@@ -1086,7 +1088,7 @@ static unsigned short XGINew_SenseLCD(struct 
xgi_hw_device_info
 }
 
 static void XGINew_GetXG21Sense(struct pci_dev *pdev,
-   struct vb_device_info *pVBInfo)
+   struct vb_device_info *pVBInfo)
 {
struct xgifb_video_info *xgifb_info = pci_get_drvdata(pdev);
unsigned char Temp;
-- 
2.1.4

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


[PATCH v2 1/3] staging: xgifb: vb_init.c Logical continuation

2016-11-16 Thread Walt Feasel
Make suggested checkpatch modification for:
CHECK: Logical continuations should be on the previous line.

Signed-off-by: Walt Feasel 
---
v2 makes changes to correct for email format patch submission

 drivers/staging/xgifb/vb_init.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/xgifb/vb_init.c b/drivers/staging/xgifb/vb_init.c
index 062ece2..55978c1 100644
--- a/drivers/staging/xgifb/vb_init.c
+++ b/drivers/staging/xgifb/vb_init.c
@@ -1039,8 +1039,9 @@ static void XGINew_SetModeScratch(struct vb_device_info 
*pVBInfo)
}
 
tempcl |= SetSimuScanMode;
-   if ((!(temp & ActiveCRT1)) && ((temp & ActiveLCD) || (temp & ActiveTV)
-   || (temp & ActiveCRT2)))
+   if ((!(temp & ActiveCRT1)) && ((temp & ActiveLCD) ||
+  (temp & ActiveTV) ||
+  (temp & ActiveCRT2)))
tempcl ^= (SetSimuScanMode | SwitchCRT2);
if ((temp & ActiveLCD) && (temp & ActiveTV))
tempcl ^= (SetSimuScanMode | SwitchCRT2);
-- 
2.1.4

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


[PATCH v2 3/3] staging: xgifb: vb_init.c Comment style

2016-11-16 Thread Walt Feasel
Make various comment style modifications.

Signed-off-by: Walt Feasel 

---
v2 makes changes to correct for email format patch submission

 drivers/staging/xgifb/vb_init.c | 27 ++-
 1 file changed, 14 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/xgifb/vb_init.c b/drivers/staging/xgifb/vb_init.c
index 254d5a9..14af157 100644
--- a/drivers/staging/xgifb/vb_init.c
+++ b/drivers/staging/xgifb/vb_init.c
@@ -55,8 +55,9 @@ XGINew_GetXG20DRAMType(struct xgi_hw_device_info 
*HwDeviceExtension,
xgifb_reg_or(pVBInfo->P3d4, 0x4A, 0x80); /* Enable GPIOH read */
/* GPIOF 0:DVI 1:DVO */
data = xgifb_reg_get(pVBInfo->P3d4, 0x48);
-   /* HOTPLUG_SUPPORT */
-   /* for current XG20 & XG21, GPIOH is floating, driver will
+   /*
+* HOTPLUG_SUPPORT
+* for current XG20 & XG21, GPIOH is floating, driver will
 * fix DDR temporarily
 */
/* DVI read GPIOH */
@@ -354,8 +355,8 @@ static void XGINew_DDR2_DefaultRegister(
unsigned long Port, struct vb_device_info *pVBInfo)
 {
unsigned long P3d4 = Port, P3c4 = Port - 0x10;
-
-   /* keep following setting sequence, each setting in
+   /*
+* keep following setting sequence, each setting in
 * the same reg insert idle
 */
xgifb_reg_set(P3d4, 0x82, 0x77);
@@ -649,7 +650,7 @@ static void XGINew_CheckChannel(struct xgi_hw_device_info 
*HwDeviceExtension,
pVBInfo->ram_bus = 16; /* 16 bits */
/* (0x31:12x8x2) 22bit + 2 rank */
xgifb_reg_set(pVBInfo->P3c4, 0x13, 0xB1);
-   /* 0x41:16Mx16 bit*/
+   /* 0x41:16Mx16 bit */
xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x41);
usleep_range(15, 1015);
 
@@ -662,7 +663,7 @@ static void XGINew_CheckChannel(struct xgi_hw_device_info 
*HwDeviceExtension,
xgifb_reg_set(pVBInfo->P3c4,
  0x13,
  0x31);
-   /* 0x31:8Mx16 bit*/
+   /* 0x31:8Mx16 bit */
xgifb_reg_set(pVBInfo->P3c4,
  0x14,
  0x31);
@@ -680,7 +681,7 @@ static void XGINew_CheckChannel(struct xgi_hw_device_info 
*HwDeviceExtension,
pVBInfo->ram_bus = 8; /* 8 bits */
/* (0x31:12x8x2) 22bit + 2 rank */
xgifb_reg_set(pVBInfo->P3c4, 0x13, 0xB1);
-   /* 0x30:8Mx8 bit*/
+   /* 0x30:8Mx8 bit */
xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x30);
usleep_range(15, 1015);
 
@@ -699,7 +700,7 @@ static void XGINew_CheckChannel(struct xgi_hw_device_info 
*HwDeviceExtension,
case XG27:
pVBInfo->ram_bus = 16; /* 16 bits */
pVBInfo->ram_channel = 1; /* Single channel */
-   xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x51); /* 32Mx16 bit*/
+   xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x51); /* 32Mx16 bit */
break;
case XG42:
/*
@@ -907,9 +908,9 @@ static bool xgifb_read_vbios(struct pci_dev *pdev)
goto error;
if (j == 0xff)
j = 1;
-   /*
-* Read the LVDS table index scratch register set by the BIOS.
-*/
+
+   /* Read the LVDS table index scratch register set by the BIOS. */
+
entry = xgifb_reg_get(xgifb_info->dev_info.P3d4, 0x36);
if (entry >= j)
entry = 0;
@@ -1098,7 +1099,7 @@ static void XGINew_GetXG21Sense(struct pci_dev *pdev,
/* LVDS on chip */
xgifb_reg_and_or(pVBInfo->P3d4, 0x38, ~0xE0, 0xC0);
} else {
-   /* Enable GPIOA/B read  */
+   /* Enable GPIOA/B read */
xgifb_reg_and_or(pVBInfo->P3d4, 0x4A, ~0x03, 0x03);
Temp = xgifb_reg_get(pVBInfo->P3d4, 0x48) & 0xC0;
if (Temp == 0xC0) { /* DVI & DVO GPIOA/B pull high */
@@ -1122,7 +1123,7 @@ static void XGINew_GetXG27Sense(struct vb_device_info 
*pVBInfo)
unsigned char Temp, bCR4A;
 
bCR4A = xgifb_reg_get(pVBInfo->P3d4, 0x4A);
-   /* Enable GPIOA/B/C read  */
+   /* Enable GPIOA/B/C read */
xgifb_reg_and_or(pVBInfo->P3d4, 0x4A, ~0x07, 0x07);
Temp = xgifb_reg_get(pVBInfo->P3d4, 0x48) & 0x07;
xgifb_reg_set(pVBInfo->P3d4, 0x4A, bCR4A);
-- 
2.1.4


[PATCH v2 0/3] staging: xgifb: vb_init.c checkpatch modifications

2016-11-16 Thread Walt Feasel
Make Linux kernel coding style modifications for vb_init.c to include:

CHECK: Logical continuations should be on the previous line
CHECK: Alignment should match open parenthesis
Various comment style modifications

Walt Feasel (3):

  staging: xgifb: vb_init.c Logical continuation
  staging: xgifb: vb_init.c Align parenthesis
  staging: xgifb: vb_init.c Comment style modifications

 drivers/staging/xgifb/vb_init.c | 56 ++---
 1 file changed, 30 insertions(+), 26 deletions(-)

--
v2 makes changes to correct for email format patch submission 
2.1.4

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


[PATCH 2/2] staging/lustre/ptlrpc: update imp_known_replied_xid on resend-replay

2016-11-16 Thread Oleg Drokin
From: Niu Yawei 

The imp_known_replied_xid should be updated when try to resend
an already replied replay request, because the xid of this replay
request could be less than current imp_known_replied_xid.

Signed-off-by: Niu Yawei 
Reviewed-on: http://review.whamcloud.com/22776
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8645
Reviewed-by: Alex Zhuravlev 
Reviewed-by: Fan Yong 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/ptlrpc/recover.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/ptlrpc/recover.c 
b/drivers/staging/lustre/lustre/ptlrpc/recover.c
index 344aedd..c004490 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/recover.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/recover.c
@@ -161,8 +161,10 @@ int ptlrpc_replay_next(struct obd_import *imp, int 
*inflight)
 * unreplied list.
 */
if (req && imp->imp_resend_replay &&
-   list_empty(>rq_unreplied_list))
+   list_empty(>rq_unreplied_list)) {
ptlrpc_add_unreplied(req);
+   imp->imp_known_replied_xid = ptlrpc_known_replied_xid(imp);
+   }
 
imp->imp_resend_replay = 0;
spin_unlock(>imp_lock);
-- 
2.7.4

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


[PATCH 0/2] Lustre fixes

2016-11-16 Thread Oleg Drokin
With multiple metadata RPCs code in now, these two fixes
become important.

Please consider.

Niu Yawei (2):
  staging/lustre/ptlrpc: track unreplied requests
  staging/lustre/ptlrpc: update imp_known_replied_xid on resend-replay

 .../staging/lustre/lustre/include/lustre_import.h  |   5 +
 drivers/staging/lustre/lustre/include/lustre_net.h |   3 +
 drivers/staging/lustre/lustre/obdclass/genops.c|   2 +
 drivers/staging/lustre/lustre/ptlrpc/client.c  | 112 +++--
 drivers/staging/lustre/lustre/ptlrpc/import.c  |  34 +++
 drivers/staging/lustre/lustre/ptlrpc/niobuf.c  |  29 +-
 .../staging/lustre/lustre/ptlrpc/ptlrpc_internal.h |  24 +
 drivers/staging/lustre/lustre/ptlrpc/recover.c |  14 +++
 8 files changed, 187 insertions(+), 36 deletions(-)

-- 
2.7.4

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


[PATCH 1/2] staging/lustre/ptlrpc: track unreplied requests

2016-11-16 Thread Oleg Drokin
From: Niu Yawei 

The request xid was used to make sure the ost object timestamps
being updated by the out of order setattr/punch/write requests
properly. However, this mechanism is broken by the multiple rcvd
slot feature, where we deferred the xid assignment from request
packing to request sending.

This patch moved back the xid assignment to request packing, and
the manner of finding lowest unreplied xid is changed from scan
sending & delay list to scan a unreplied requests list.

This patch also skipped packing the known replied XID in connect
and disconnect request, so that we can make sure the known replied
XID is increased only on both server & client side.

Signed-off-by: Niu Yawei 
Reviewed-on: http://review.whamcloud.com/16759
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5951
Reviewed-by: Gregoire Pichon 
Reviewed-by: Alex Zhuravlev 
Signed-off-by: Oleg Drokin 
---
 .../staging/lustre/lustre/include/lustre_import.h  |   5 +
 drivers/staging/lustre/lustre/include/lustre_net.h |   3 +
 drivers/staging/lustre/lustre/obdclass/genops.c|   2 +
 drivers/staging/lustre/lustre/ptlrpc/client.c  | 112 +++--
 drivers/staging/lustre/lustre/ptlrpc/import.c  |  34 +++
 drivers/staging/lustre/lustre/ptlrpc/niobuf.c  |  29 +-
 .../staging/lustre/lustre/ptlrpc/ptlrpc_internal.h |  24 +
 drivers/staging/lustre/lustre/ptlrpc/recover.c |  12 +++
 8 files changed, 185 insertions(+), 36 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_import.h 
b/drivers/staging/lustre/lustre/include/lustre_import.h
index 5461ba3..4499c69 100644
--- a/drivers/staging/lustre/lustre/include/lustre_import.h
+++ b/drivers/staging/lustre/lustre/include/lustre_import.h
@@ -185,6 +185,11 @@ struct obd_import {
struct list_head   *imp_replay_cursor;
/** @} */
 
+   /** List of not replied requests */
+   struct list_headimp_unreplied_list;
+   /** Known maximal replied XID */
+   __u64   imp_known_replied_xid;
+
/** obd device for this import */
struct obd_device   *imp_obd;
 
diff --git a/drivers/staging/lustre/lustre/include/lustre_net.h 
b/drivers/staging/lustre/lustre/include/lustre_net.h
index d2cbec3..2be135d 100644
--- a/drivers/staging/lustre/lustre/include/lustre_net.h
+++ b/drivers/staging/lustre/lustre/include/lustre_net.h
@@ -596,6 +596,8 @@ struct ptlrpc_cli_req {
union ptlrpc_async_args  cr_async_args;
/** Opaq data for replay and commit callbacks. */
void*cr_cb_data;
+   /** Link to the imp->imp_unreplied_list */
+   struct list_head cr_unreplied_list;
/**
 * Commit callback, called when request is committed and about to be
 * freed.
@@ -635,6 +637,7 @@ struct ptlrpc_cli_req {
 #define rq_interpret_reply rq_cli.cr_reply_interp
 #define rq_async_args  rq_cli.cr_async_args
 #define rq_cb_data rq_cli.cr_cb_data
+#define rq_unreplied_list  rq_cli.cr_unreplied_list
 #define rq_commit_cb   rq_cli.cr_commit_cb
 #define rq_replay_cb   rq_cli.cr_replay_cb
 
diff --git a/drivers/staging/lustre/lustre/obdclass/genops.c 
b/drivers/staging/lustre/lustre/obdclass/genops.c
index 438d619..fa0d38d 100644
--- a/drivers/staging/lustre/lustre/obdclass/genops.c
+++ b/drivers/staging/lustre/lustre/obdclass/genops.c
@@ -907,6 +907,8 @@ struct obd_import *class_new_import(struct obd_device *obd)
INIT_LIST_HEAD(>imp_sending_list);
INIT_LIST_HEAD(>imp_delayed_list);
INIT_LIST_HEAD(>imp_committed_list);
+   INIT_LIST_HEAD(>imp_unreplied_list);
+   imp->imp_known_replied_xid = 0;
imp->imp_replay_cursor = >imp_committed_list;
spin_lock_init(>imp_lock);
imp->imp_last_success_conn = 0;
diff --git a/drivers/staging/lustre/lustre/ptlrpc/client.c 
b/drivers/staging/lustre/lustre/ptlrpc/client.c
index d2f4cd5..ac959ef 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/client.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/client.c
@@ -652,6 +652,42 @@ static void __ptlrpc_free_req_to_pool(struct 
ptlrpc_request *request)
spin_unlock(>prp_lock);
 }
 
+void ptlrpc_add_unreplied(struct ptlrpc_request *req)
+{
+   struct obd_import   *imp = req->rq_import;
+   struct list_head*tmp;
+   struct ptlrpc_request   *iter;
+
+   assert_spin_locked(>imp_lock);
+   LASSERT(list_empty(>rq_unreplied_list));
+
+   /* unreplied list is sorted by xid in ascending order */
+   list_for_each_prev(tmp, >imp_unreplied_list) {
+   iter = list_entry(tmp, struct ptlrpc_request,
+ rq_unreplied_list);
+
+   LASSERT(req->rq_xid != iter->rq_xid);
+   if (req->rq_xid < iter->rq_xid)
+

RE: [PATCH 0/3] PCI: hv: clean-up and 2 fixes to the hot-remove case

2016-11-16 Thread KY Srinivasan


> -Original Message-
> From: Bjorn Helgaas [mailto:helg...@kernel.org]
> Sent: Wednesday, November 16, 2016 2:49 PM
> To: Dexuan Cui 
> Cc: Bjorn Helgaas ; linux-...@vger.kernel.org;
> de...@linuxdriverproject.org; gre...@linuxfoundation.org; KY Srinivasan
> ; Haiyang Zhang ; Stephen
> Hemminger ; Jake Oshins
> ; Hadden Hoppert ;
> Vitaly Kuznetsov ; jasow...@redhat.com;
> a...@canonical.com; o...@aepfle.de; linux-ker...@vger.kernel.org
> Subject: Re: [PATCH 0/3] PCI: hv: clean-up and 2 fixes to the hot-remove case
> 
> On Thu, Nov 10, 2016 at 07:16:22AM +, Dexuan Cui wrote:
> > PATCH 1 is just a clean-up. There should be no functional change.
> >
> > PATCH 2 and 3 are for device hot-remove case.
> > Currently the driver will stop working or even cause panic, if we do
> > hot add/remove quickly a few times. With the 2 patches, everything works
> > reliably in my tests now.
> >
> > There can be still a potential issue with hot-remove when we unload
> > the driver at the same time. That would require more work of proper
> > synchronization among the 3 paths: the .probe/.remove, the channel
> callback,
> > and the offloaded hv_pci_devices_present()/hv_eject_device_work().
> >
> > But for now, PATCH 2 and 3 do improve the situation a lot.
> >
> > Dexuan Cui (3):
> >   PCI: hv: use the correct buffer size in new_pcichild_device()
> >   PCI: hv: fix hv_pci_remove() for hot-remove
> >   PCI: hv: delete the device earlier from hbus->children for hot-remove
> >
> >  drivers/pci/host/pci-hyperv.c | 67 ++---
> --
> >  1 file changed, 40 insertions(+), 27 deletions(-)
> 
> I applied all three of these to pci/host-hv for v4.10, thanks!
> 
> Jake, I converted your "looks good to me" to Reviewed-by tags.
> 
> K. Y., I added your acks on 2 & 3.  If you acked 1, I missed it.

Thanks Bjorn; I thought I had acked all three, but that is ok.

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


Re: [PATCH 0/3] PCI: hv: clean-up and 2 fixes to the hot-remove case

2016-11-16 Thread Bjorn Helgaas
On Thu, Nov 10, 2016 at 07:16:22AM +, Dexuan Cui wrote:
> PATCH 1 is just a clean-up. There should be no functional change.
> 
> PATCH 2 and 3 are for device hot-remove case. 
> Currently the driver will stop working or even cause panic, if we do
> hot add/remove quickly a few times. With the 2 patches, everything works
> reliably in my tests now.
> 
> There can be still a potential issue with hot-remove when we unload 
> the driver at the same time. That would require more work of proper
> synchronization among the 3 paths: the .probe/.remove, the channel callback,
> and the offloaded hv_pci_devices_present()/hv_eject_device_work().
> 
> But for now, PATCH 2 and 3 do improve the situation a lot.
> 
> Dexuan Cui (3):
>   PCI: hv: use the correct buffer size in new_pcichild_device()
>   PCI: hv: fix hv_pci_remove() for hot-remove
>   PCI: hv: delete the device earlier from hbus->children for hot-remove
> 
>  drivers/pci/host/pci-hyperv.c | 67 
> ++-
>  1 file changed, 40 insertions(+), 27 deletions(-)

I applied all three of these to pci/host-hv for v4.10, thanks!

Jake, I converted your "looks good to me" to Reviewed-by tags.

K. Y., I added your acks on 2 & 3.  If you acked 1, I missed it.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/2] staging: vc04_services: remove duplicate mutex_lock_interruptible

2016-11-16 Thread Eric Anholt
Arnd Bergmann  writes:

> The driver tries to redefine mutex_lock_interruptible as an open-coded
> mutex_lock_killable, but that definition clashes with the normal
> mutex_lock_interruptible definition when CONFIG_DEBUG_LOCK_ALLOC
> is set:

These two are:

Acked-by: Eric Anholt 


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


[PATCH v2 8/9] bus: fsl-mc: dpio: add the DPAA2 DPIO object driver

2016-11-16 Thread Stuart Yoder
From: Roy Pledge 

The DPIO driver registers with the fsl-mc bus to handle bus-related
events for DPIO objects.  Key responsibility is mapping I/O
regions, setting up interrupt handlers, and calling the DPIO
service initialization during probe.

Signed-off-by: Roy Pledge 
Signed-off-by: Haiying Wang 
Signed-off-by: Stuart Yoder 
Cc: Laurentiu Tudor 
Cc: Ioana Radulescu 
---
-v2
   -handle error case where number of DPIOs > NR_CPUs

 drivers/bus/fsl-mc/dpio/Makefile  |   2 +-
 drivers/bus/fsl-mc/dpio/dpio-driver.c | 295 ++
 2 files changed, 296 insertions(+), 1 deletion(-)
 create mode 100644 drivers/bus/fsl-mc/dpio/dpio-driver.c

diff --git a/drivers/bus/fsl-mc/dpio/Makefile b/drivers/bus/fsl-mc/dpio/Makefile
index 0778da7..837d330 100644
--- a/drivers/bus/fsl-mc/dpio/Makefile
+++ b/drivers/bus/fsl-mc/dpio/Makefile
@@ -6,4 +6,4 @@ subdir-ccflags-y := -Werror
 
 obj-$(CONFIG_FSL_MC_DPIO) += fsl-mc-dpio.o
 
-fsl-mc-dpio-objs := dpio.o qbman-portal.o dpio-service.o
+fsl-mc-dpio-objs := dpio.o qbman-portal.o dpio-service.o dpio-driver.o
diff --git a/drivers/bus/fsl-mc/dpio/dpio-driver.c 
b/drivers/bus/fsl-mc/dpio/dpio-driver.c
new file mode 100644
index 000..76261d2
--- /dev/null
+++ b/drivers/bus/fsl-mc/dpio/dpio-driver.c
@@ -0,0 +1,295 @@
+/*
+ * Copyright 2014-2016 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ *  notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ * * Neither the name of Freescale Semiconductor nor the
+ *  names of its contributors may be used to endorse or promote products
+ *  derived from this software without specific prior written permission.
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 
THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include "qbman-portal.h"
+#include "dpio.h"
+#include "dpio-cmd.h"
+
+MODULE_LICENSE("Dual BSD/GPL");
+MODULE_AUTHOR("Freescale Semiconductor, Inc");
+MODULE_DESCRIPTION("DPIO Driver");
+
+struct dpio_priv {
+   struct dpaa2_io *io;
+};
+
+static irqreturn_t dpio_irq_handler(int irq_num, void *arg)
+{
+   struct device *dev = (struct device *)arg;
+   struct dpio_priv *priv = dev_get_drvdata(dev);
+
+   return dpaa2_io_irq(priv->io);
+}
+
+static void unregister_dpio_irq_handlers(struct fsl_mc_device *dpio_dev)
+{
+   struct fsl_mc_device_irq *irq;
+
+   irq = dpio_dev->irqs[0];
+
+   /* clear the affinity hint */
+   irq_set_affinity_hint(irq->msi_desc->irq, NULL);
+}
+
+static int register_dpio_irq_handlers(struct fsl_mc_device *dpio_dev, int cpu)
+{
+   struct dpio_priv *priv;
+   int error;
+   struct fsl_mc_device_irq *irq;
+   cpumask_t mask;
+
+   priv = dev_get_drvdata(_dev->dev);
+
+   irq = dpio_dev->irqs[0];
+   error = devm_request_irq(_dev->dev,
+irq->msi_desc->irq,
+dpio_irq_handler,
+0,
+dev_name(_dev->dev),
+_dev->dev);
+   if (error < 0) {
+   dev_err(_dev->dev,
+   "devm_request_irq() failed: %d\n",
+   error);
+   return error;
+   }
+
+   /* set the affinity hint */
+   cpumask_clear();
+   cpumask_set_cpu(cpu, );
+   if (irq_set_affinity_hint(irq->msi_desc->irq, ))
+ 

[PATCH v2 2/9] bus: fsl-mc: dpio: add DPIO driver overview document

2016-11-16 Thread Stuart Yoder
add document describing the dpio driver and it's role, components
and major interfaces

Signed-off-by: Stuart Yoder 
Cc: Laurentiu Tudor 
Cc: Roy Pledge 
Cc: Ioana Radulescu 
---
-v2
  -no changes

 Documentation/dpaa2/dpio-driver.txt | 135 
 1 file changed, 135 insertions(+)
 create mode 100644 Documentation/dpaa2/dpio-driver.txt

diff --git a/Documentation/dpaa2/dpio-driver.txt 
b/Documentation/dpaa2/dpio-driver.txt
new file mode 100644
index 000..5c192b3
--- /dev/null
+++ b/Documentation/dpaa2/dpio-driver.txt
@@ -0,0 +1,135 @@
+Copyright (C) 2016 Freescale Semiconductor Inc.
+
+Introduction
+
+
+A DPAA2 DPIO (Data Path I/O) is a hardware object that provides
+interfaces to enqueue and dequeue frames to/from network interfaces
+and other accelerators.  A DPIO also provides hardware buffer
+pool management for network interfaces.
+
+This document provides an overview the Linux DPIO driver, its
+subcomponents, and its APIs.
+
+See Documentation/dpaa2/overview.txt for a general overview of DPAA2
+and the general DPAA2 driver architecture in Linux.
+
+Driver Overview
+---
+
+The DPIO driver is bound to DPIO objects discovered on the fsl-mc bus and
+provides services that:
+  A) allow other drivers, such as the Ethernet driver, to enqueue and dequeue
+ frames for their respective objects
+  B) allow drivers to register callbacks for data availability notifications
+ when data becomes available on a queue or channel
+  C) allow drivers to manage hardware buffer pools
+
+The Linux DPIO driver consists of 3 primary components--
+   DPIO object driver-- fsl-mc driver that manages the DPIO object
+   DPIO service-- provides APIs to other Linux drivers for services
+   QBman portal interface-- sends portal commands, gets responses
+
+  fsl-mc  other
+   bus   drivers
+|   |
++---++   +--+-+
+|DPIO obj|   |DPIO service|
+| driver |---|  (DPIO)|
+++   +--+-+
+|
+ +--+-+
+ |QBman   |
+ | portal i/f |
+ ++
+|
+ hardware
+
+The diagram below shows how the DPIO driver components fit with the other
+DPAA2 Linux driver components:
+   ++
+   | OS Network |
+   |   Stack|
+ ++++
+ | Allocator  |. . . . . . .   |  Ethernet  |
+ |(DPMCP,DPBP)||   (DPNI)   |
+ +-.--++---+---++
+  .  . ^   |
+ ..|   | dequeue>
++-+ .  |   |
+| DPRC driver |  .++ ++
+|   (DPRC)|   . . |DPIO obj| |DPIO service|
++--+--+   | driver |-|  (DPIO)|
+   |  ++ +--+-+
+   | +--|-+
+   | |   QBman|
+  ++--+  | portal i/f |
+  |   MC-bus driver   |  ++
+  |   | |
+  | /soc/fsl-mc   | |
+  +---+ |
+|
+ =|=|
++-+--DPIO---|---+
+|   |   |
+|QBman Portal   |
++---+
+
+ 
+
+
+DPIO Object Driver (dpio-driver.c)
+--
+
+   The dpio-driver component registers with the fsl-mc bus to handle objects of
+   type "dpio".  The implementation of probe() handles basic initialization
+   of the DPIO including mapping of the DPIO regions (the QBman SW portal)
+   and initializing interrupts and registering irq handlers.  The dpio-driver
+   registers the probed DPIO with dpio-service.
+
+DPIO service  (dpio-service.c, dpaa2-io.h)
+--
+
+   The dpio service component provides queuing, notification, and buffers
+   management services to DPAA2 drivers, such as the Ethernet 

[PATCH v2 1/9] staging: fsl-mc: move bus driver out of staging

2016-11-16 Thread Stuart Yoder
Move the source files out of staging into their final locations:
  -include files in drivers/staging/fsl-mc/include go to include/linux/fsl
  -irq-gic-v3-its-fsl-mc-msi.c goes to drivers/irqchip
  -source in drivers/staging/fsl-mc/bus goes to drivers/bus/fsl-mc
  -README.txt, providing and overview of DPAA goes to
   Documentation/dpaa2/overview.txt
  -update MAINTAINERS with new location

Delete other remaining staging files-- Makefile, Kconfig, TODO

Signed-off-by: Stuart Yoder 
Cc: Laurentiu Tudor 
---
-v2
  -updated MAINTAINERS file with proper location

 .../README.txt => Documentation/dpaa2/overview.txt |  0
 MAINTAINERS|  2 +-
 drivers/bus/Kconfig|  3 +++
 drivers/bus/Makefile   |  3 +++
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/Kconfig |  0
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/Makefile|  1 -
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpbp-cmd.h  |  0
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpbp.c  |  6 +++---
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpcon-cmd.h |  0
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpmcp-cmd.h |  0
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpmcp.c |  5 +++--
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpmcp.h |  0
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpmng-cmd.h |  0
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpmng.c |  6 +++---
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dprc-cmd.h  |  0
 .../{staging/fsl-mc/bus => bus/fsl-mc}/dprc-driver.c   |  4 ++--
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dprc.c  |  6 +++---
 .../fsl-mc/bus => bus/fsl-mc}/fsl-mc-allocator.c   |  4 ++--
 .../{staging/fsl-mc/bus => bus/fsl-mc}/fsl-mc-bus.c|  6 +++---
 .../{staging/fsl-mc/bus => bus/fsl-mc}/fsl-mc-msi.c|  2 +-
 .../fsl-mc/bus => bus/fsl-mc}/fsl-mc-private.h |  4 ++--
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/mc-io.c |  4 ++--
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/mc-sys.c|  6 +++---
 drivers/irqchip/Makefile   |  1 +
 .../fsl-mc/bus => irqchip}/irq-gic-v3-its-fsl-mc-msi.c |  2 +-
 drivers/staging/Kconfig|  2 --
 drivers/staging/Makefile   |  1 -
 drivers/staging/fsl-mc/Kconfig |  1 -
 drivers/staging/fsl-mc/Makefile|  2 --
 drivers/staging/fsl-mc/TODO| 18 --
 .../fsl-mc/include => include/linux/fsl}/dpbp.h|  0
 .../fsl-mc/include => include/linux/fsl}/dpmng.h   |  0
 .../fsl-mc/include => include/linux/fsl}/dprc.h|  0
 .../fsl-mc/include => include/linux/fsl}/mc-bus.h  |  2 +-
 .../fsl-mc/include => include/linux/fsl}/mc-cmd.h  |  0
 .../fsl-mc/include => include/linux/fsl}/mc-sys.h  |  0
 .../staging/fsl-mc/include => include/linux/fsl}/mc.h  |  2 +-
 37 files changed, 38 insertions(+), 55 deletions(-)
 rename drivers/staging/fsl-mc/README.txt => Documentation/dpaa2/overview.txt 
(100%)
 rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/Kconfig (100%)
 rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/Makefile (91%)
 rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpbp-cmd.h (100%)
 rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpbp.c (99%)
 rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpcon-cmd.h (100%)
 rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpmcp-cmd.h (100%)
 rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpmcp.c (99%)
 rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpmcp.h (100%)
 rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpmng-cmd.h (100%)
 rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpmng.c (96%)
 rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dprc-cmd.h (100%)
 rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dprc-driver.c (99%)
 rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dprc.c (99%)
 rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/fsl-mc-allocator.c (99%)
 rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/fsl-mc-bus.c (99%)
 rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/fsl-mc-msi.c (99%)
 rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/fsl-mc-private.h (96%)
 rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/mc-io.c (99%)
 rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/mc-sys.c (99%)
 rename drivers/{staging/fsl-mc/bus => irqchip}/irq-gic-v3-its-fsl-mc-msi.c 
(99%)
 delete mode 100644 drivers/staging/fsl-mc/Kconfig
 delete mode 100644 drivers/staging/fsl-mc/Makefile
 delete mode 100644 drivers/staging/fsl-mc/TODO
 rename {drivers/staging/fsl-mc/include => include/linux/fsl}/dpbp.h (100%)
 rename {drivers/staging/fsl-mc/include => include/linux/fsl}/dpmng.h (100%)
 rename {drivers/staging/fsl-mc/include => include/linux/fsl}/dprc.h (100%)
 rename {drivers/staging/fsl-mc/include => include/linux/fsl}/mc-bus.h (99%)
 rename 

[PATCH v2 7/9] bus: fsl-mc: dpio: add the DPAA2 DPIO service interface

2016-11-16 Thread Stuart Yoder
From: Roy Pledge 

The DPIO service interface handles initialization of DPIO objects
and exports APIs to be used by other DPAA2 object drivers to perform
queuing and buffer management related operations.  The service allows
registration of callbacks when frames or notifications are received.

Signed-off-by: Roy Pledge 
Signed-off-by: Haiying Wang 
Signed-off-by: Stuart Yoder 
Cc: Laurentiu Tudor 
Cc: Ioana Radulescu 
---
-v2
   -use service_select_by_cpu() for re-arming DPIO interrupts
   -replace use of NR_CPUS with num_possible_cpus()

 drivers/bus/fsl-mc/dpio/Makefile   |   2 +-
 drivers/bus/fsl-mc/dpio/dpio-service.c | 614 +
 include/linux/fsl/dpaa2-io.h   | 138 
 3 files changed, 753 insertions(+), 1 deletion(-)
 create mode 100644 drivers/bus/fsl-mc/dpio/dpio-service.c
 create mode 100644 include/linux/fsl/dpaa2-io.h

diff --git a/drivers/bus/fsl-mc/dpio/Makefile b/drivers/bus/fsl-mc/dpio/Makefile
index 6588498..0778da7 100644
--- a/drivers/bus/fsl-mc/dpio/Makefile
+++ b/drivers/bus/fsl-mc/dpio/Makefile
@@ -6,4 +6,4 @@ subdir-ccflags-y := -Werror
 
 obj-$(CONFIG_FSL_MC_DPIO) += fsl-mc-dpio.o
 
-fsl-mc-dpio-objs := dpio.o qbman-portal.o
+fsl-mc-dpio-objs := dpio.o qbman-portal.o dpio-service.o
diff --git a/drivers/bus/fsl-mc/dpio/dpio-service.c 
b/drivers/bus/fsl-mc/dpio/dpio-service.c
new file mode 100644
index 000..953bd7a
--- /dev/null
+++ b/drivers/bus/fsl-mc/dpio/dpio-service.c
@@ -0,0 +1,614 @@
+/*
+ * Copyright 2014-2016 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ *  notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ * * Neither the name of Freescale Semiconductor nor the
+ *  names of its contributors may be used to endorse or promote products
+ *  derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 
THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "dpio.h"
+#include "qbman-portal.h"
+
+struct dpaa2_io {
+   atomic_t refs;
+   struct dpaa2_io_desc dpio_desc;
+   struct qbman_swp_desc swp_desc;
+   struct qbman_swp *swp;
+   struct list_head node;
+   spinlock_t lock_mgmt_cmd;
+   spinlock_t lock_notifications;
+   struct list_head notifications;
+};
+
+struct dpaa2_io_store {
+   unsigned int max;
+   dma_addr_t paddr;
+   struct dpaa2_dq *vaddr;
+   void *alloced_addr;/* unaligned value from kmalloc() */
+   unsigned int idx;  /* position of the next-to-be-returned entry */
+   struct qbman_swp *swp; /* portal used to issue VDQCR */
+   struct device *dev;/* device used for DMA mapping */
+};
+
+/* keep a per cpu array of DPIOs for fast access */
+static struct dpaa2_io *dpio_by_cpu[NR_CPUS];
+static struct list_head dpio_list = LIST_HEAD_INIT(dpio_list);
+static DEFINE_SPINLOCK(dpio_list_lock);
+
+static inline struct dpaa2_io *service_select_by_cpu(struct dpaa2_io *d,
+int cpu)
+{
+   if (d)
+   return d;
+
+   if (unlikely(cpu >= num_possible_cpus()))
+   return NULL;
+
+   /*
+* If cpu == -1, choose the current cpu, with no guarantees about
+* potentially being migrated away.
+*/
+   if (unlikely(cpu < 0))
+   cpu = smp_processor_id();
+
+   /* If 

[PATCH v2 9/9] bus: fsl-mc: dpio: add maintainer for DPIO

2016-11-16 Thread Stuart Yoder
From: Roy Pledge 

add Roy Pledge as maintainer of DPIO

Signed-off-by: Roy Pledge 
Signed-off-by: Stuart Yoder 
Cc: Laurentiu Tudor 
Cc: Ioana Radulescu 
---
-v2
   -corrected location of maintainer entry

 MAINTAINERS | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 63b45f4..312c582 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3980,6 +3980,12 @@ S:   Maintained
 F: drivers/char/dtlk.c
 F: include/linux/dtlk.h
 
+DPAA2 DATAPATH I/O (DPIO) DRIVER
+M: Roy Pledge 
+L: linux-ker...@vger.kernel.org
+S: Maintained
+F: drivers/bus/fsl-mc/dpio
+
 DPT_I2O SCSI RAID DRIVER
 M: Adaptec OEM Raid Solutions 
 L: linux-s...@vger.kernel.org
-- 
1.9.0

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


[PATCH v2 5/9] bus: fsl-mc: dpio: add global dpaa2 definitions

2016-11-16 Thread Stuart Yoder
From: Roy Pledge 

Create header for global dpaa2 definitions.  Add definitions
for dequeue results.

Signed-off-by: Roy Pledge 
Signed-off-by: Stuart Yoder 
Cc: Laurentiu Tudor 
Cc: Ioana Radulescu 
---
-v2
   -no changes

 include/linux/fsl/dpaa2-global.h | 203 +++
 1 file changed, 203 insertions(+)
 create mode 100644 include/linux/fsl/dpaa2-global.h

diff --git a/include/linux/fsl/dpaa2-global.h b/include/linux/fsl/dpaa2-global.h
new file mode 100644
index 000..3ee3f29
--- /dev/null
+++ b/include/linux/fsl/dpaa2-global.h
@@ -0,0 +1,203 @@
+/*
+ * Copyright 2014-2016 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * * Neither the name of Freescale Semiconductor nor the
+ *   names of its contributors may be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 
THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef __FSL_DPAA2_GLOBAL_H
+#define __FSL_DPAA2_GLOBAL_H
+
+#include 
+#include 
+#include 
+
+struct dpaa2_dq {
+   union {
+   struct common {
+   u8 verb;
+   u8 reserved[63];
+   } common;
+   struct dq {
+   u8 verb;
+   u8 stat;
+   __le16 seqnum;
+   __le16 oprid;
+   u8 reserved;
+   u8 tok;
+   __le32 fqid;
+   u32 reserved2;
+   __le32 fq_byte_cnt;
+   __le32 fq_frm_cnt;
+   __le64 fqd_ctx;
+   u8 fd[32];
+   } dq;
+   struct scn {
+   u8 verb;
+   u8 stat;
+   u8 state;
+   u8 reserved;
+   __le32 rid_tok;
+   __le64 ctx;
+   } scn;
+   };
+};
+
+
+/* Parsing frame dequeue results */
+/* FQ empty */
+#define DPAA2_DQ_STAT_FQEMPTY   0x80
+/* FQ held active */
+#define DPAA2_DQ_STAT_HELDACTIVE0x40
+/* FQ force eligible */
+#define DPAA2_DQ_STAT_FORCEELIGIBLE 0x20
+/* valid frame */
+#define DPAA2_DQ_STAT_VALIDFRAME0x10
+/* FQ ODP enable */
+#define DPAA2_DQ_STAT_ODPVALID  0x04
+/* volatile dequeue */
+#define DPAA2_DQ_STAT_VOLATILE  0x02
+/* volatile dequeue command is expired */
+#define DPAA2_DQ_STAT_EXPIRED   0x01
+
+#define DQ_FQID_MASK 0x00FF
+#define DQ_FRAME_COUNT_MASK 0x00FF
+
+/**
+ * dpaa2_dq_flags() - Get the stat field of dequeue response
+ * @dq: the dequeue result.
+ */
+static inline u32 dpaa2_dq_flags(const struct dpaa2_dq *dq)
+{
+   return dq->dq.stat;
+}
+
+/**
+ * dpaa2_dq_is_pull() - Check whether the dq response is from a pull
+ *  command.
+ * @dq: the dequeue result
+ *
+ * Return 1 for volatile(pull) dequeue, 0 for static dequeue.
+ */
+static inline int dpaa2_dq_is_pull(const struct dpaa2_dq *dq)
+{
+   return (int)(dpaa2_dq_flags(dq) & DPAA2_DQ_STAT_VOLATILE);
+}
+
+/**
+ * dpaa2_dq_is_pull_complete() - Check whether the pull command is completed.
+ * @dq: the dequeue result
+ *
+ * Return boolean.
+ */
+static inline int dpaa2_dq_is_pull_complete(
+   const struct dpaa2_dq *dq)
+{
+   return 

[PATCH v2 3/9] bus: fsl-mc: dpio: add APIs for DPIO objects

2016-11-16 Thread Stuart Yoder
From: Ioana Radulescu 

Add the command build/parse APIs for operating on DPIO objects through
the DPAA2 Management Complex.

Signed-off-by: Ioana Radulescu 
Signed-off-by: Roy Pledge 
Signed-off-by: Stuart Yoder 
Cc: Laurentiu Tudor 
---
-v2
  -removed unused structs and defines as suggested by Ioana Radulescu

 drivers/bus/fsl-mc/Kconfig |  10 ++
 drivers/bus/fsl-mc/Makefile|   3 +
 drivers/bus/fsl-mc/dpio/Makefile   |   9 ++
 drivers/bus/fsl-mc/dpio/dpio-cmd.h |  75 
 drivers/bus/fsl-mc/dpio/dpio.c | 229 +
 drivers/bus/fsl-mc/dpio/dpio.h | 108 +
 6 files changed, 434 insertions(+)
 create mode 100644 drivers/bus/fsl-mc/dpio/Makefile
 create mode 100644 drivers/bus/fsl-mc/dpio/dpio-cmd.h
 create mode 100644 drivers/bus/fsl-mc/dpio/dpio.c
 create mode 100644 drivers/bus/fsl-mc/dpio/dpio.h

diff --git a/drivers/bus/fsl-mc/Kconfig b/drivers/bus/fsl-mc/Kconfig
index 5c009ab..a10aaf0 100644
--- a/drivers/bus/fsl-mc/Kconfig
+++ b/drivers/bus/fsl-mc/Kconfig
@@ -15,3 +15,13 @@ config FSL_MC_BUS
  architecture.  The fsl-mc bus driver handles discovery of
  DPAA2 objects (which are represented as Linux devices) and
  binding objects to drivers.
+
+config FSL_MC_DPIO
+tristate "QorIQ DPAA2 DPIO driver"
+depends on FSL_MC_BUS
+help
+ Driver for the DPAA2 DPIO object.  A DPIO provides queue and
+ buffer management facilities for software to interact with
+ other DPAA2 objects. This driver does not expose the DPIO
+ objects individually, but groups them under a service layer
+ API.
diff --git a/drivers/bus/fsl-mc/Makefile b/drivers/bus/fsl-mc/Makefile
index d56afee..d18df72 100644
--- a/drivers/bus/fsl-mc/Makefile
+++ b/drivers/bus/fsl-mc/Makefile
@@ -17,3 +17,6 @@ mc-bus-driver-objs := fsl-mc-bus.o \
  fsl-mc-msi.o \
  dpmcp.o \
  dpbp.o
+
+# MC DPIO driver
+obj-$(CONFIG_FSL_MC_DPIO) += dpio/
diff --git a/drivers/bus/fsl-mc/dpio/Makefile b/drivers/bus/fsl-mc/dpio/Makefile
new file mode 100644
index 000..128befc
--- /dev/null
+++ b/drivers/bus/fsl-mc/dpio/Makefile
@@ -0,0 +1,9 @@
+#
+# QorIQ DPAA2 DPIO driver
+#
+
+subdir-ccflags-y := -Werror
+
+obj-$(CONFIG_FSL_MC_DPIO) += fsl-mc-dpio.o
+
+fsl-mc-dpio-objs := dpio.o
diff --git a/drivers/bus/fsl-mc/dpio/dpio-cmd.h 
b/drivers/bus/fsl-mc/dpio/dpio-cmd.h
new file mode 100644
index 000..3464ed9
--- /dev/null
+++ b/drivers/bus/fsl-mc/dpio/dpio-cmd.h
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2013-2016 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of the above-listed copyright holders nor the
+ * names of any contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef _FSL_DPIO_CMD_H
+#define _FSL_DPIO_CMD_H
+
+/* DPIO Version */
+#define DPIO_VER_MAJOR 4
+#define DPIO_VER_MINOR 2
+
+/* Command Versioning */
+
+#define DPIO_CMD_ID_OFFSET 4
+#define DPIO_CMD_BASE_VERSION  1
+
+#define DPIO_CMD(id)   ((id << DPIO_CMD_ID_OFFSET) | DPIO_CMD_BASE_VERSION)
+
+/* Command IDs */
+#define DPIO_CMDID_CLOSE   DPIO_CMD(0x800)
+#define 

[PATCH v2 0/9] staging: fsl-mc: move bus driver out of staging, add dpio

2016-11-16 Thread Stuart Yoder
This patch series: A) addresses the final item in the staging
TODO list for the fsl-mc bus driver-- adding a functional driver
on top of the bus driver, and B) requests that the fsl-mc bus driver
be moved out of staging.

The proposed destination for the bus driver is drivers/bus.
Proposed location for global header files for fsl-mc and dpaa2
is include/linux/fsl.

The functional driver added is for the DPIO object which provides
queuing services for other DPAA2 drivers.  An overview of the
DPIO object and driver components are in patch 2.  Patches 3-7 are
internal components of the DPIO driver-- bit twiddling of hardware
registers, DPAA2 data structures, and the queuing APIs exposed
to other drivers.

Patch 8 adds the fsl-mc driver for the DPIO object.  It provides
the probe/remove functions, demonstrating a working example of
how fsl-mc drivers initialize, interact with the management
complex hardware, map their mappable MMIO regions, initialize
interrupts, register an ISR, etc.  All other DPAA2 drivers will
follow a similar initialization pattern.

The dpio driver is added under drivers/bus/fsl-mc/dpio.  This
driver provides queueing related services and there is no other
obvious place it would go.  Like the bus driver, it is part of
the DPAA2 infrastucture and putting it under the fsl-mc bus
driver seems like a logical place.

version 2 changes (mostly feedback from Ioana Radulescu)
   -removed unused structs and defines in dpio command definitions
   -added setter/getter for the FD ctrl field
   -corrected comment for SG format_offset field description
   -added support for short length field in FD
   -fix bug in buffer release command, by setting bpid field
   -handle error (NULL) return value from qbman_swp_mc_complete()
   -fix bug in sending management commands where the verb was
properly initialized
   -use service_select_by_cpu() for re-arming DPIO interrupts
   -replace use of NR_CPUS with num_possible_cpus()
   -handle error case where number of DPIOs exceeds number of possible
CPUs
   -error message cleanup
   -updated MAINTAINERS file with proper location for both fsl-mc bus
driver and dpio driver

Ioana Radulescu (1):
  bus: fsl-mc: dpio: add APIs for DPIO objects

Roy Pledge (6):
  bus: fsl-mc: dpio: add frame descriptor and scatter/gather APIs
  bus: fsl-mc: dpio: add global dpaa2 definitions
  bus: fsl-mc: dpio: add QBMan portal APIs for DPAA2
  bus: fsl-mc: dpio: add the DPAA2 DPIO service interface
  bus: fsl-mc: dpio: add the DPAA2 DPIO object driver
  bus: fsl-mc: dpio: add maintainer for DPIO

Stuart Yoder (2):
  staging: fsl-mc: move bus driver out of staging
  bus: fsl-mc: dpio: add DPIO driver overview document

 Documentation/dpaa2/dpio-driver.txt|  135 +++
 .../README.txt => Documentation/dpaa2/overview.txt |0
 MAINTAINERS|8 +-
 drivers/bus/Kconfig|3 +
 drivers/bus/Makefile   |3 +
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/Kconfig |   10 +
 .../{staging/fsl-mc/bus => bus/fsl-mc}/Makefile|4 +-
 .../{staging/fsl-mc/bus => bus/fsl-mc}/dpbp-cmd.h  |0
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpbp.c  |6 +-
 .../{staging/fsl-mc/bus => bus/fsl-mc}/dpcon-cmd.h |0
 drivers/bus/fsl-mc/dpio/Makefile   |9 +
 drivers/bus/fsl-mc/dpio/dpio-cmd.h |   75 ++
 drivers/bus/fsl-mc/dpio/dpio-driver.c  |  295 ++
 drivers/bus/fsl-mc/dpio/dpio-service.c |  614 
 drivers/bus/fsl-mc/dpio/dpio.c |  229 +
 drivers/bus/fsl-mc/dpio/dpio.h |  108 +++
 drivers/bus/fsl-mc/dpio/qbman-portal.c | 1025 
 drivers/bus/fsl-mc/dpio/qbman-portal.h |  464 +
 .../{staging/fsl-mc/bus => bus/fsl-mc}/dpmcp-cmd.h |0
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpmcp.c |5 +-
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpmcp.h |0
 .../{staging/fsl-mc/bus => bus/fsl-mc}/dpmng-cmd.h |0
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpmng.c |6 +-
 .../{staging/fsl-mc/bus => bus/fsl-mc}/dprc-cmd.h  |0
 .../fsl-mc/bus => bus/fsl-mc}/dprc-driver.c|4 +-
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dprc.c  |6 +-
 .../fsl-mc/bus => bus/fsl-mc}/fsl-mc-allocator.c   |4 +-
 .../fsl-mc/bus => bus/fsl-mc}/fsl-mc-bus.c |6 +-
 .../fsl-mc/bus => bus/fsl-mc}/fsl-mc-msi.c |2 +-
 .../fsl-mc/bus => bus/fsl-mc}/fsl-mc-private.h |4 +-
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/mc-io.c |4 +-
 .../{staging/fsl-mc/bus => bus/fsl-mc}/mc-sys.c|6 +-
 drivers/irqchip/Makefile   |1 +
 .../bus => irqchip}/irq-gic-v3-its-fsl-mc-msi.c|2 +-
 drivers/staging/Kconfig|2 -
 drivers/staging/Makefile   |1 -
 drivers/staging/fsl-mc/Kconfig 

[PATCH v2 4/9] bus: fsl-mc: dpio: add frame descriptor and scatter/gather APIs

2016-11-16 Thread Stuart Yoder
From: Roy Pledge 

Add global definitions for DPAA2 frame descriptors and scatter
gather entries.

Signed-off-by: Roy Pledge 
Signed-off-by: Stuart Yoder 
Cc: Laurentiu Tudor 
Cc: Ioana Radulescu 
---
-v2
   -added setter/getter for the FD ctrl field
   -corrected comment for SG format_offset field description
   -added support for short length field in FD

 include/linux/fsl/dpaa2-fd.h | 448 +++
 1 file changed, 448 insertions(+)
 create mode 100644 include/linux/fsl/dpaa2-fd.h

diff --git a/include/linux/fsl/dpaa2-fd.h b/include/linux/fsl/dpaa2-fd.h
new file mode 100644
index 000..182c8f4
--- /dev/null
+++ b/include/linux/fsl/dpaa2-fd.h
@@ -0,0 +1,448 @@
+/*
+ * Copyright 2014-2016 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * * Neither the name of Freescale Semiconductor nor the
+ *   names of its contributors may be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 
THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef __FSL_DPAA2_FD_H
+#define __FSL_DPAA2_FD_H
+
+#include 
+
+/**
+ * DOC: DPAA2 FD - Frame Descriptor APIs for DPAA2
+ *
+ * Frame Descriptors (FDs) are used to describe frame data in the DPAA2.
+ * Frames can be enqueued and dequeued to Frame Queues (FQs) which are consumed
+ * by the various DPAA accelerators (WRIOP, SEC, PME, DCE)
+ *
+ * There are three types of frames: single, scatter gather, and frame lists.
+ *
+ * The set of APIs in this file must be used to create, manipulate and
+ * query Frame Descriptors.
+ */
+
+/**
+ * struct dpaa2_fd - Struct describing FDs
+ * @words: for easier/faster copying the whole FD structure
+ * @addr:  address in the FD
+ * @len:   length in the FD
+ * @bpid:  buffer pool ID
+ * @format_offset: format, offset, and short-length fields
+ * @frc:   frame context
+ * @ctrl:  control bits...including dd, sc, va, err, etc
+ * @flc:   flow context address
+ *
+ * This structure represents the basic Frame Descriptor used in the system.
+ */
+struct dpaa2_fd {
+   union {
+   u32 words[8];
+   struct dpaa2_fd_simple {
+   __le64 addr;
+   __le32 len;
+   __le16 bpid;
+   __le16 format_offset;
+   __le32 frc;
+   __le32 ctrl;
+   __le64 flc;
+   } simple;
+   };
+};
+
+#define FD_SHORT_LEN_FLAG_MASK 0x1
+#define FD_SHORT_LEN_FLAG_SHIFT 14
+#define FD_SHORT_LEN_MASK 0x1
+#define FD_OFFSET_MASK 0x0FFF
+#define FD_FORMAT_MASK 0x3
+#define FD_FORMAT_SHIFT 12
+#define SG_SHORT_LEN_FLAG_MASK 0x1
+#define SG_SHORT_LEN_FLAG_SHIFT 14
+#define SG_SHORT_LEN_MASK 0x1
+#define SG_OFFSET_MASK 0x0FFF
+#define SG_FORMAT_MASK 0x3
+#define SG_FORMAT_SHIFT 12
+#define SG_BPID_MASK 0x3FFF
+#define SG_FINAL_FLAG_MASK 0x1
+#define SG_FINAL_FLAG_SHIFT 15
+
+enum dpaa2_fd_format {
+   dpaa2_fd_single = 0,
+   dpaa2_fd_list,
+   dpaa2_fd_sg
+};
+
+/**
+ * dpaa2_fd_get_addr() - get the addr field of frame descriptor
+ * @fd: the given frame descriptor
+ *
+ * Return the address in the frame descriptor.
+ */
+static inline dma_addr_t dpaa2_fd_get_addr(const struct dpaa2_fd *fd)
+{
+
+   return (dma_addr_t)fd->simple.addr;
+}
+

Re: [bug report] staging: add bcm2708 vchiq driver

2016-11-16 Thread Eric Anholt
Michael Zoran  writes:

> On Tue, 2016-11-15 at 22:04 -0500, Vince Weaver wrote:
>> On Tue, 15 Nov 2016, Michael Zoran wrote:
>> 
>> > I'm still interested to know more about the MMU statement.  I would
>> > think at least some of the RPI models have one because swapping
>> > appears
>> > to be at least somewhat functional on the later models.
>> 
>> All Raspberry Pi models have an MMU.  I'm not sure why anyone thinks 
>> otherwise.
>> 
>> Though just to be pedantic, you don't need an MMU to "swap".  In
>> general 
>> you do to "page".
>> 
>> Vince
>
> From the BCM2835 doc floating around the web the RPI should have 2
> MMUs.  One on the VC side and one on the ARM side.  Since we are being
> pedantic here, I'll ask the question this way.
>
> Do all RPIs has an enabled MMU on the ARM side and do all RPIs support
> paging?

Yes.  The MMU between ARM's virtual and ARM's physical memory addresses
is always present and is totally normal.  The second MMU maps between
ARM's physical and bus, and is too coarse to be of much use so it's
almost a 1:1 mapping.

When people talk about RPi lacking an MMU, they're talking about between
devices (such as the 3D engine, video decode/encode, VPU, etc.) and
memory.


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


[staging:staging-testing 514/575] ERROR: "bad_dma_ops" [drivers/staging/vc04_services/vchiq.ko] undefined!

2016-11-16 Thread kbuild test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 
staging-testing
head:   6fde3789a2efba826d89414f8d8dcda27da9ce45
commit: abbdc56b17d662ae710bc0c30cf0d0e9da805fd4 [514/575] staging: 
vc04_services: add CONFIG_COMPILE_TEST ability
config: m32r-allmodconfig (attached as .config)
compiler: m32r-linux-gcc (GCC) 6.2.0
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout abbdc56b17d662ae710bc0c30cf0d0e9da805fd4
# save the attached .config to linux build tree
make.cross ARCH=m32r 

All errors (new ones prefixed by >>):

   ERROR: "bad_dma_ops" [sound/core/snd-pcm.ko] undefined!
   ERROR: "dma_common_mmap" [sound/core/snd-pcm.ko] undefined!
>> ERROR: "bad_dma_ops" [drivers/staging/vc04_services/vchiq.ko] undefined!
>> ERROR: "dmam_alloc_coherent" [drivers/staging/vc04_services/vchiq.ko] 
>> undefined!
   ERROR: "bad_dma_ops" [drivers/iio/adc/ti_am335x_adc.ko] undefined!

---
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


[PATCH 2/2] staging: vc04_services: clarify firmware dependency

2016-11-16 Thread Arnd Bergmann
The raspberrypi-firmware driver may be built as a loadable module,
which causes a link-time failure if the vc04_services driver is
built-in during compile-testing:

drivers/staging/vc04_services/vchiq.o: In function `vchiq_probe':
vchiq_connected.c:(.text.vchiq_probe+0x2c): undefined reference to 
`rpi_firmware_get'
drivers/staging/vc04_services/vchiq.o: In function `vchiq_platform_init':
vchiq_connected.c:(.text.vchiq_platform_init+0x1f0): undefined reference to 
`rpi_firmware_property'

This extends the dependency list to ensure the firmware is either
reachable, or completely disabled in case of compile-testing.

Signed-off-by: Arnd Bergmann 
---
 drivers/staging/vc04_services/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/vc04_services/Kconfig 
b/drivers/staging/vc04_services/Kconfig
index 660dcedc2820..061ffd261086 100644
--- a/drivers/staging/vc04_services/Kconfig
+++ b/drivers/staging/vc04_services/Kconfig
@@ -1,6 +1,6 @@
 config BCM2835_VCHIQ
tristate "Videocore VCHIQ"
-   depends on RASPBERRYPI_FIRMWARE || COMPILE_TEST
+   depends on RASPBERRYPI_FIRMWARE || (COMPILE_TEST && 
!RASPBERRYPI_FIRMWARE)
default y
help
Kernel to VideoCore communication interface for the
-- 
2.9.0

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


[PATCH 1/2] staging: vc04_services: remove duplicate mutex_lock_interruptible

2016-11-16 Thread Arnd Bergmann
The driver tries to redefine mutex_lock_interruptible as an open-coded
mutex_lock_killable, but that definition clashes with the normal
mutex_lock_interruptible definition when CONFIG_DEBUG_LOCK_ALLOC
is set:

staging/vc04_services/interface/vchiq_arm/vchiq_killable.h:67:0: error: 
"mutex_lock_interruptible" redefined [-Werror]
 #define mutex_lock_interruptible mutex_lock_interruptible_killable
include/linux/mutex.h:161:0: note: this is the location of the previous 
definition

This simply removes the private implementation and uses the
normal mutex_lock_killable directly.

We could do the same for the down_interruptible_killable here, but
it's better to just remove the semaphores entirely from the driver,
which also takes care of that.

Signed-off-by: Arnd Bergmann 
---
 .../vc04_services/interface/vchiq_arm/vchiq_arm.c|  2 +-
 .../interface/vchiq_arm/vchiq_connected.c|  4 ++--
 .../vc04_services/interface/vchiq_arm/vchiq_core.c   | 20 ++--
 .../interface/vchiq_arm/vchiq_kern_lib.c |  4 ++--
 .../interface/vchiq_arm/vchiq_killable.h | 14 --
 5 files changed, 15 insertions(+), 29 deletions(-)

diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c 
b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
index d0435a05ea35..0d987898b4f8 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
@@ -554,7 +554,7 @@ vchiq_ioctl(struct file *file, unsigned int cmd, unsigned 
long arg)
ret = -EINVAL;
break;
}
-   rc = mutex_lock_interruptible(>state->mutex);
+   rc = mutex_lock_killable(>state->mutex);
if (rc != 0) {
vchiq_log_error(vchiq_arm_log_level,
"vchiq: connect: could not lock mutex for "
diff --git 
a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c 
b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
index 5efc62ffb2f5..7ea29665bd0c 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
@@ -72,7 +72,7 @@ void vchiq_add_connected_callback(VCHIQ_CONNECTED_CALLBACK_T 
callback)
 {
connected_init();
 
-   if (mutex_lock_interruptible(_connected_mutex) != 0)
+   if (mutex_lock_killable(_connected_mutex) != 0)
return;
 
if (g_connected)
@@ -107,7 +107,7 @@ void vchiq_call_connected_callbacks(void)
 
connected_init();
 
-   if (mutex_lock_interruptible(_connected_mutex) != 0)
+   if (mutex_lock_killable(_connected_mutex) != 0)
return;
 
for (i = 0; i <  g_num_deferred_callbacks; i++)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c 
b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
index 7440db2ce40b..028e90bc1cdc 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
@@ -794,7 +794,7 @@ queue_message(VCHIQ_STATE_T *state, VCHIQ_SERVICE_T 
*service,
WARN_ON(!(stride <= VCHIQ_SLOT_SIZE));
 
if (!(flags & QMFLAGS_NO_MUTEX_LOCK) &&
-   (mutex_lock_interruptible(>slot_mutex) != 0))
+   (mutex_lock_killable(>slot_mutex) != 0))
return VCHIQ_RETRY;
 
if (type == VCHIQ_MSG_DATA) {
@@ -863,7 +863,7 @@ queue_message(VCHIQ_STATE_T *state, VCHIQ_SERVICE_T 
*service,
return VCHIQ_RETRY;
if (service->closing)
return VCHIQ_ERROR;
-   if (mutex_lock_interruptible(>slot_mutex) != 0)
+   if (mutex_lock_killable(>slot_mutex) != 0)
return VCHIQ_RETRY;
if (service->srvstate != VCHIQ_SRVSTATE_OPEN) {
/* The service has been closed */
@@ -1033,7 +1033,7 @@ queue_message_sync(VCHIQ_STATE_T *state, VCHIQ_SERVICE_T 
*service,
local = state->local;
 
if ((VCHIQ_MSG_TYPE(msgid) != VCHIQ_MSG_RESUME) &&
-   (mutex_lock_interruptible(>sync_mutex) != 0))
+   (mutex_lock_killable(>sync_mutex) != 0))
return VCHIQ_RETRY;
 
remote_event_wait(state, >sync_release);
@@ -1365,7 +1365,7 @@ resolve_bulks(VCHIQ_SERVICE_T *service, 
VCHIQ_BULK_QUEUE_T *queue)
WARN_ON(!((int)(queue->local_insert - queue->process) > 0));
WARN_ON(!((int)(queue->remote_insert - queue->process) > 0));
 
-   rc = mutex_lock_interruptible(>bulk_transfer_mutex);
+   rc = mutex_lock_killable(>bulk_transfer_mutex);
if (rc != 0)
break;
 
@@ -1839,7 

[PATCH] staging: wilc1000: simplify vif[i]->ndev accesses

2016-11-16 Thread Arnd Bergmann
With gcc-7, I got a new warning for this driver:

wilc1000/linux_wlan.c: In function 'wilc_netdev_cleanup':
wilc1000/linux_wlan.c:1224:15: error: 'vif[1]' may be used uninitialized in 
this function [-Werror=maybe-uninitialized]
wilc1000/linux_wlan.c:1224:15: error: 'vif[0]' may be used uninitialized in 
this function [-Werror=maybe-uninitialized]

A closer look at the function reveals that it's more complex than
it needs to be, given that based on how the device is created
we always get

netdev_priv(vif->ndev) == vif

Based on this assumption, I found a few other places in the same file
that can be simplified. That code appears to be a relic from times
when the assumption above was not valid.

Signed-off-by: Arnd Bergmann 
---
 drivers/staging/wilc1000/linux_wlan.c | 34 +-
 1 file changed, 9 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index 82c602ba3289..3775706578b2 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -260,23 +260,12 @@ static struct net_device *get_if_handler(struct wilc 
*wilc, u8 *mac_header)
 
 int wilc_wlan_set_bssid(struct net_device *wilc_netdev, u8 *bssid, u8 mode)
 {
-   int i = 0;
-   int ret = -1;
-   struct wilc_vif *vif;
-   struct wilc *wilc;
-
-   vif = netdev_priv(wilc_netdev);
-   wilc = vif->wilc;
+   struct wilc_vif *vif = netdev_priv(wilc_netdev);
 
-   for (i = 0; i < wilc->vif_num; i++)
-   if (wilc->vif[i]->ndev == wilc_netdev) {
-   memcpy(wilc->vif[i]->bssid, bssid, 6);
-   wilc->vif[i]->mode = mode;
-   ret = 0;
-   break;
-   }
+   memcpy(vif->bssid, bssid, 6);
+   vif->mode = mode;
 
-   return ret;
+   return 0;
 }
 
 int wilc_wlan_get_num_conn_ifcs(struct wilc *wilc)
@@ -1203,16 +1192,11 @@ void WILC_WFI_mgmt_rx(struct wilc *wilc, u8 *buff, u32 
size)
 
 void wilc_netdev_cleanup(struct wilc *wilc)
 {
-   int i = 0;
-   struct wilc_vif *vif[NUM_CONCURRENT_IFC];
+   int i;
 
-   if (wilc && (wilc->vif[0]->ndev || wilc->vif[1]->ndev)) {
+   if (wilc && (wilc->vif[0]->ndev || wilc->vif[1]->ndev))
unregister_inetaddr_notifier(_dev_notifier);
 
-   for (i = 0; i < NUM_CONCURRENT_IFC; i++)
-   vif[i] = netdev_priv(wilc->vif[i]->ndev);
-   }
-
if (wilc && wilc->firmware) {
release_firmware(wilc->firmware);
wilc->firmware = NULL;
@@ -1221,7 +1205,7 @@ void wilc_netdev_cleanup(struct wilc *wilc)
if (wilc && (wilc->vif[0]->ndev || wilc->vif[1]->ndev)) {
for (i = 0; i < NUM_CONCURRENT_IFC; i++)
if (wilc->vif[i]->ndev)
-   if (vif[i]->mac_opened)
+   if (wilc->vif[i]->mac_opened)
wilc_mac_close(wilc->vif[i]->ndev);
 
for (i = 0; i < NUM_CONCURRENT_IFC; i++) {
@@ -1269,9 +1253,9 @@ int wilc_netdev_init(struct wilc **wilc, struct device 
*dev, int io_type,
 
vif->idx = wl->vif_num;
vif->wilc = *wilc;
+   vif->ndev = ndev;
wl->vif[i] = vif;
-   wl->vif[wl->vif_num]->ndev = ndev;
-   wl->vif_num++;
+   wl->vif_num = i;
ndev->netdev_ops = _netdev_ops;
 
{
-- 
2.9.0

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


Re: [bug report] staging: add bcm2708 vchiq driver

2016-11-16 Thread Phil Elwell
On 16/11/2016 10:21, Dan Carpenter wrote:
> On Tue, Nov 15, 2016 at 10:04:05PM -0500, Vince Weaver wrote:
>> On Tue, 15 Nov 2016, Michael Zoran wrote:
>>
>>> I'm still interested to know more about the MMU statement.  I would
>>> think at least some of the RPI models have one because swapping appears
>>> to be at least somewhat functional on the later models.
>> All Raspberry Pi models have an MMU.  I'm not sure why anyone thinks
>> otherwise.
> No idea.  Someone told me that when I complained about a different
> security bug on RPI.
The ARM cores have MMUs between them and the SoC bus, but the VC4 VPU
and its peripherals do not, leading to the need for contiguous
allocations. Some VPU peripherals can only address 256MB of RAM, which
further constrains allocations.

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


Re: [PATCH] staging: slicoss: fix different address space warnings

2016-11-16 Thread Dan Carpenter
This can't be right...  ->shmem_data is set in slic_init_adapter() and
it's not iomem.

regards,
dan carpenter

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


Re: [bug report] staging: add bcm2708 vchiq driver

2016-11-16 Thread Dan Carpenter
On Tue, Nov 15, 2016 at 10:04:05PM -0500, Vince Weaver wrote:
> On Tue, 15 Nov 2016, Michael Zoran wrote:
> 
> > I'm still interested to know more about the MMU statement.  I would
> > think at least some of the RPI models have one because swapping appears
> > to be at least somewhat functional on the later models.
> 
> All Raspberry Pi models have an MMU.  I'm not sure why anyone thinks
> otherwise.

No idea.  Someone told me that when I complained about a different
security bug on RPI.

regards,
dan carpenter

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


Re: [PATCH v2] staging: slicoss: fix different address space warnings

2016-11-16 Thread Sergio Paracuellos
On Wed, Nov 16, 2016 at 8:05 AM, Greg KH  wrote:
> On Wed, Nov 16, 2016 at 05:07:37AM +0100, Sergio Paracuellos wrote:
>> This patch fix the following sparse warnings in slicoss driver:
>> warning: incorrect type in assignment (different address spaces)
>>
>> Changes in v2:
>> * Remove IOMEM_GET_FIELDADDR macro
>> * Add ioread64 and iowrite64 defines
>>
>> Signed-off-by: Sergio Paracuellos 
>> ---
>>  drivers/staging/slicoss/slicoss.c | 111 
>> ++
>>  1 file changed, 76 insertions(+), 35 deletions(-)
>>
>> diff --git a/drivers/staging/slicoss/slicoss.c 
>> b/drivers/staging/slicoss/slicoss.c
>> index d2929b9..d68a463 100644
>> --- a/drivers/staging/slicoss/slicoss.c
>> +++ b/drivers/staging/slicoss/slicoss.c
>> @@ -128,6 +128,35 @@
>>
>>  MODULE_DEVICE_TABLE(pci, slic_pci_tbl);
>>
>> +#ifndef ioread64
>> +#ifdef readq
>> +#define ioread64 readq
>> +#else
>> +#define ioread64 _ioread64
>> +static inline u64 _ioread64(void __iomem *mmio)
>> +{
>> + u64 low, high;
>> +
>> + low = ioread32(mmio);
>> + high = ioread32(mmio + sizeof(u32));
>> + return low | (high << 32);
>> +}
>> +#endif
>> +#endif
>
> eek, no!  Don't write common kernel functions in a driver just because
> some configuration option was incorrect.  That implies that you really
> can't do that type of read/write for that platform, so maybe you
> shouldn't be doing it!
>
> Split this up into one patch that does the 32bit stuff, then worry
> about the 64bit stuff in a separate patch please.
>
> thanks,
>
> greg k-h

thank you for your clarification, Greg.

I'll send a v3 patchset with the two patches.

Cheers,

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