[PATCH] staging: typec: Fix sparse warnings about incorrect types

2017-05-10 Thread Guru Das Srinagesh
Fix the following sparse warnings about incorrect type usage:

fusb302.c:1028:32: warning: incorrect type in argument 1 (different base types)
fusb302.c:1028:32:expected unsigned short [unsigned] [usertype] header
fusb302.c:1028:32:got restricted __le16 const [usertype] header
fusb302.c:1484:32: warning: incorrect type in argument 1 (different base types)
fusb302.c:1484:32:expected unsigned short [unsigned] [usertype] header
fusb302.c:1484:32:got restricted __le16 [usertype] header

Signed-off-by: Guru Das Srinagesh 
---
 drivers/staging/typec/fusb302/fusb302.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/typec/fusb302/fusb302.c 
b/drivers/staging/typec/fusb302/fusb302.c
index 2cee9a9..3bec9d5 100644
--- a/drivers/staging/typec/fusb302/fusb302.c
+++ b/drivers/staging/typec/fusb302/fusb302.c
@@ -1025,7 +1025,7 @@ static int fusb302_pd_send_message(struct fusb302_chip 
*chip,
buf[pos++] = FUSB302_TKN_SYNC1;
buf[pos++] = FUSB302_TKN_SYNC2;
 
-   len = pd_header_cnt(msg->header) * 4;
+   len = pd_header_cnt_le(msg->header) * 4;
/* plug 2 for header */
len += 2;
if (len > 0x1F) {
@@ -1481,7 +1481,7 @@ static int fusb302_pd_read_message(struct fusb302_chip 
*chip,
 (u8 *)>header);
if (ret < 0)
return ret;
-   len = pd_header_cnt(msg->header) * 4;
+   len = pd_header_cnt_le(msg->header) * 4;
/* add 4 to length to include the CRC */
if (len > PD_MAX_PAYLOAD * 4) {
fusb302_log(chip, "PD message too long %d", len);
-- 
2.7.4

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


[PATCH] staging: lustre: ptlrpc: remove unnecessary code

2017-05-10 Thread Gustavo A. R. Silva
offset is an unsigned variable and, greater-than-or-equal-to-zero
comparison of an unsigned variable is always true.

Addresses-Coverity-ID: 1373919
Signed-off-by: Gustavo A. R. Silva 
---
 drivers/staging/lustre/lustre/ptlrpc/layout.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/ptlrpc/layout.c 
b/drivers/staging/lustre/lustre/ptlrpc/layout.c
index 356d735..ff77b52 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/layout.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/layout.c
@@ -1762,7 +1762,7 @@ static u32 __req_capsule_offset(const struct req_capsule 
*pill,
 field->rmf_name, offset, loc);
offset--;
 
-   LASSERT(0 <= offset && offset < REQ_MAX_FIELD_NR);
+   LASSERT(offset < REQ_MAX_FIELD_NR);
return offset;
 }
 
-- 
2.5.0

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


[PATCH] staging: wlan-ng: convert endianness in situ

2017-05-10 Thread Thibaut SAUTEREAU
Fix several sparse warnings about casts to restricted
little-endian.

Signed-off-by: Thibaut SAUTEREAU 
---
 drivers/staging/wlan-ng/prism2fw.c | 24 
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/wlan-ng/prism2fw.c 
b/drivers/staging/wlan-ng/prism2fw.c
index afd877fb4557..1a0c786c7616 100644
--- a/drivers/staging/wlan-ng/prism2fw.c
+++ b/drivers/staging/wlan-ng/prism2fw.c
@@ -617,28 +617,28 @@ static int mkpdrlist(struct pda *pda)
HFA384x_PDR_NICID) {
memcpy(, >rec[pda->nrec]->data.nicid,
   sizeof(nicid));
-   nicid.id = le16_to_cpu(nicid.id);
-   nicid.variant = le16_to_cpu(nicid.variant);
-   nicid.major = le16_to_cpu(nicid.major);
-   nicid.minor = le16_to_cpu(nicid.minor);
+   le16_to_cpus();
+   le16_to_cpus();
+   le16_to_cpus();
+   le16_to_cpus();
}
if (le16_to_cpu(pda->rec[pda->nrec]->code) ==
HFA384x_PDR_MFISUPRANGE) {
memcpy(, >rec[pda->nrec]->data.mfisuprange,
   sizeof(rfid));
-   rfid.id = le16_to_cpu(rfid.id);
-   rfid.variant = le16_to_cpu(rfid.variant);
-   rfid.bottom = le16_to_cpu(rfid.bottom);
-   rfid.top = le16_to_cpu(rfid.top);
+   le16_to_cpus();
+   le16_to_cpus();
+   le16_to_cpus();
+   le16_to_cpus();
}
if (le16_to_cpu(pda->rec[pda->nrec]->code) ==
HFA384x_PDR_CFISUPRANGE) {
memcpy(, >rec[pda->nrec]->data.cfisuprange,
   sizeof(macid));
-   macid.id = le16_to_cpu(macid.id);
-   macid.variant = le16_to_cpu(macid.variant);
-   macid.bottom = le16_to_cpu(macid.bottom);
-   macid.top = le16_to_cpu(macid.top);
+   le16_to_cpus();
+   le16_to_cpus();
+   le16_to_cpus();
+   le16_to_cpus();
}
 
(pda->nrec)++;
-- 
2.12.2

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


Re: [patch 1/1] staging: speakup: flush tty buffers and ensure hardware flow control

2017-05-10 Thread Alan Cox
> + if (!(tmp_termios.c_cflag & CRTSCTS)) {
> + tmp_termios.c_cflag |= CRTSCTS;
> + ret = tty_set_termios(tty, _termios);
> + if (ret)
> + pr_warn("speakup: Failed to set hardware flow 
> control\n");

You should check the tty c_cflag after the call rather than rely on an
error code. Strictly speaking tty_set_termios should error if no tty bits
are changed by the request but it never has on Linux. Instead check the
tty gave you the result you wanted.

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


[PATCH v2 4/7] staging: emxx_udc: Update local variable names

2017-05-10 Thread Alexis Lothoré
Ensure that any any local variable use snake_case (many mixed upper/lower case)

Signed-off-by: Alexis Lothoré 
---
 drivers/staging/emxx_udc/emxx_udc.c | 248 ++--
 1 file changed, 124 insertions(+), 124 deletions(-)

diff --git a/drivers/staging/emxx_udc/emxx_udc.c 
b/drivers/staging/emxx_udc/emxx_udc.c
index 2d68dde..0e23923 100644
--- a/drivers/staging/emxx_udc/emxx_udc.c
+++ b/drivers/staging/emxx_udc/emxx_udc.c
@@ -577,18 +577,18 @@ static int ep0_out_pio(struct nbu2ss_udc *udc, u8 *buf, 
u32 length)
 static int ep0_out_overbytes(struct nbu2ss_udc *udc, u8 *pBuf, u32 length)
 {
u32 i;
-   u32 iReadSize = 0;
-   union usb_reg_access  Temp32;
-   union usb_reg_access  *pBuf32 = (union usb_reg_access *)pBuf;
+   u32 i_read_size = 0;
+   union usb_reg_access  temp_32;
+   union usb_reg_access  *p_buf_32 = (union usb_reg_access *)pBuf;
 
if ((length > 0) && (length < sizeof(u32))) {
-   Temp32.dw = _nbu2ss_readl(>p_regs->EP0_READ);
+   temp_32.dw = _nbu2ss_readl(>p_regs->EP0_READ);
for (i = 0 ; i < length ; i++)
-   pBuf32->byte.DATA[i] = Temp32.byte.DATA[i];
-   iReadSize += length;
+   p_buf_32->byte.DATA[i] = temp_32.byte.DATA[i];
+   i_read_size += length;
}
 
-   return iReadSize;
+   return i_read_size;
 }
 
 /*-*/
@@ -596,43 +596,43 @@ static int ep0_out_overbytes(struct nbu2ss_udc *udc, u8 
*pBuf, u32 length)
 static int EP0_in_PIO(struct nbu2ss_udc *udc, u8 *pBuf, u32 length)
 {
u32 i;
-   u32 iMaxLength   = EP0_PACKETSIZE;
-   u32 iWordLength  = 0;
-   u32 iWriteLength = 0;
-   union usb_reg_access  *pBuf32 = (union usb_reg_access *)pBuf;
+   u32 i_max_length   = EP0_PACKETSIZE;
+   u32 i_word_length  = 0;
+   u32 i_write_length = 0;
+   union usb_reg_access  *p_buf_32 = (union usb_reg_access *)pBuf;
 
/**/
/* Transfer Length */
-   if (iMaxLength < length)
-   iWordLength = iMaxLength / sizeof(u32);
+   if (i_max_length < length)
+   i_word_length = i_max_length / sizeof(u32);
else
-   iWordLength = length / sizeof(u32);
+   i_word_length = length / sizeof(u32);
 
/**/
/* PIO */
-   for (i = 0; i < iWordLength; i++) {
-   _nbu2ss_writel(>p_regs->EP0_WRITE, pBuf32->dw);
-   pBuf32++;
-   iWriteLength += sizeof(u32);
+   for (i = 0; i < i_word_length; i++) {
+   _nbu2ss_writel(>p_regs->EP0_WRITE, p_buf_32->dw);
+   p_buf_32++;
+   i_write_length += sizeof(u32);
}
 
-   return iWriteLength;
+   return i_write_length;
 }
 
 /*-*/
 /* Endpoint 0 IN Transfer (PIO, OverBytes) */
-static int ep0_in_overbytes(struct nbu2ss_udc *udc, u8 *pBuf, u32 iRemainSize)
+static int ep0_in_overbytes(struct nbu2ss_udc *udc, u8 *pBuf, u32 
i_remain_size)
 {
u32 i;
-   union usb_reg_access  Temp32;
-   union usb_reg_access  *pBuf32 = (union usb_reg_access *)pBuf;
+   union usb_reg_access  temp_32;
+   union usb_reg_access  *p_buf_32 = (union usb_reg_access *)pBuf;
 
-   if ((iRemainSize > 0) && (iRemainSize < sizeof(u32))) {
-   for (i = 0 ; i < iRemainSize ; i++)
-   Temp32.byte.DATA[i] = pBuf32->byte.DATA[i];
-   _nbu2ss_ep_in_end(udc, 0, Temp32.dw, iRemainSize);
+   if ((i_remain_size > 0) && (i_remain_size < sizeof(u32))) {
+   for (i = 0 ; i < i_remain_size ; i++)
+   temp_32.byte.DATA[i] = p_buf_32->byte.DATA[i];
+   _nbu2ss_ep_in_end(udc, 0, temp_32.dw, i_remain_size);
 
-   return iRemainSize;
+   return i_remain_size;
}
 
return 0;
@@ -680,9 +680,9 @@ static int _nbu2ss_ep0_in_transfer(
struct nbu2ss_req *req
 )
 {
-   u8  *pBuffer;   /* IN Data Buffer */
+   u8  *p_buffer;  /* IN Data Buffer */
u32 data;
-   u32 iRemainSize = 0;
+   u32 i_remain_size = 0;
int result = 0;
 
/*-*/
@@ -706,25 +706,25 @@ static int _nbu2ss_ep0_in_transfer(
data &= ~(u32)EP0_INAK;
_nbu2ss_writel(>p_regs->EP0_CONTROL, data);
 
-   iRemainSize = req->req.length - req->req.actual;
-   pBuffer = (u8 

[PATCH v2 3/7] staging: emxx_udc: Update function names

2017-05-10 Thread Alexis Lothoré
Ensure that function names does not mix upper/lower case

Signed-off-by: Alexis Lothoré 
---
 drivers/staging/emxx_udc/emxx_udc.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/emxx_udc/emxx_udc.c 
b/drivers/staging/emxx_udc/emxx_udc.c
index 14db5f7..2d68dde 100644
--- a/drivers/staging/emxx_udc/emxx_udc.c
+++ b/drivers/staging/emxx_udc/emxx_udc.c
@@ -574,7 +574,7 @@ static int ep0_out_pio(struct nbu2ss_udc *udc, u8 *buf, u32 
length)
 
 /*-*/
 /* Endpoint 0 OUT Transfer (PIO, OverBytes) */
-static int EP0_out_OverBytes(struct nbu2ss_udc *udc, u8 *pBuf, u32 length)
+static int ep0_out_overbytes(struct nbu2ss_udc *udc, u8 *pBuf, u32 length)
 {
u32 i;
u32 iReadSize = 0;
@@ -621,7 +621,7 @@ static int EP0_in_PIO(struct nbu2ss_udc *udc, u8 *pBuf, u32 
length)
 
 /*-*/
 /* Endpoint 0 IN Transfer (PIO, OverBytes) */
-static int EP0_in_OverBytes(struct nbu2ss_udc *udc, u8 *pBuf, u32 iRemainSize)
+static int ep0_in_overbytes(struct nbu2ss_udc *udc, u8 *pBuf, u32 iRemainSize)
 {
u32 i;
union usb_reg_access  Temp32;
@@ -724,7 +724,7 @@ static int _nbu2ss_ep0_in_transfer(
 
if ((iRemainSize < sizeof(u32)) && (result != EP0_PACKETSIZE)) {
pBuffer += result;
-   result += EP0_in_OverBytes(udc, pBuffer, iRemainSize);
+   result += ep0_in_overbytes(udc, pBuffer, iRemainSize);
req->div_len = result;
}
 
@@ -765,7 +765,7 @@ static int _nbu2ss_ep0_out_transfer(
pBuffer += result;
iRemainSize -= result;
 
-   result = EP0_out_OverBytes(udc, pBuffer
+   result = ep0_out_overbytes(udc, pBuffer
, min(iRemainSize, iRecvLength));
req->req.actual += result;
}
-- 
2.1.4

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


[PATCH v2 6/7] staging: emxx_udc: Break long lines

2017-05-10 Thread Alexis Lothoré
Make sure to break long lines to 80

Signed-off-by: Alexis Lothoré 
---
 drivers/staging/emxx_udc/emxx_udc.c | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/emxx_udc/emxx_udc.c 
b/drivers/staging/emxx_udc/emxx_udc.c
index 84bdfeb..bb010cb 100644
--- a/drivers/staging/emxx_udc/emxx_udc.c
+++ b/drivers/staging/emxx_udc/emxx_udc.c
@@ -621,7 +621,9 @@ static int EP0_in_PIO(struct nbu2ss_udc *udc, u8 *p_buf, 
u32 length)
 
 /*-*/
 /* Endpoint 0 IN Transfer (PIO, OverBytes) */
-static int ep0_in_overbytes(struct nbu2ss_udc *udc, u8 *p_buf, u32 
i_remain_size)
+static int ep0_in_overbytes(struct nbu2ss_udc *udc,
+   u8 *p_buf,
+   u32 i_remain_size)
 {
u32 i;
union usb_reg_access  temp_32;
@@ -913,7 +915,8 @@ static int _nbu2ss_epn_out_pio(
if (data > 0) {
/*-*/
/* Copy of fraction byte */
-   temp_32.dw = _nbu2ss_readl(>EP_REGS[ep->epnum - 
1].EP_READ);
+   temp_32.dw =
+   _nbu2ss_readl(>EP_REGS[ep->epnum - 1].EP_READ);
for (i = 0 ; i < data ; i++)
p_buf_32->byte.DATA[i] = temp_32.byte.DATA[i];
result += data;
@@ -2652,7 +2655,9 @@ static int nbu2ss_ep_queue(
}
 
req = container_of(_req, struct nbu2ss_req, req);
-   if (unlikely(!_req->complete || !_req->buf || 
!list_empty(>queue))) {
+   if (unlikely(!_req->complete ||
+!_req->buf ||
+!list_empty(>queue))) {
if (!_req->complete)
pr_err("udc: %s --- !_req->complete\n", __func__);
 
-- 
2.1.4

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


[PATCH v2 1/7] staging: emxx_udc: Update EPn variables name

2017-05-10 Thread Alexis Lothoré
Update EPn* variables names to EPN* to prevent CamelCase usage

Signed-off-by: Alexis Lothoré 
---
 drivers/staging/emxx_udc/emxx_udc.c | 136 +++
 drivers/staging/emxx_udc/emxx_udc.h | 216 ++--
 2 files changed, 176 insertions(+), 176 deletions(-)

diff --git a/drivers/staging/emxx_udc/emxx_udc.c 
b/drivers/staging/emxx_udc/emxx_udc.c
index 77b242e..82f2c11 100644
--- a/drivers/staging/emxx_udc/emxx_udc.c
+++ b/drivers/staging/emxx_udc/emxx_udc.c
@@ -200,13 +200,13 @@ static u32 _nbu2ss_get_begin_ram_address(struct 
nbu2ss_udc *udc)
for (num = 0; num < NUM_ENDPOINTS - 1; num++) {
p_ep_regs = >p_regs->EP_REGS[num];
data = _nbu2ss_readl(_ep_regs->EP_PCKT_ADRS);
-   buf_type = _nbu2ss_readl(_ep_regs->EP_CONTROL) & EPn_BUF_TYPE;
+   buf_type = _nbu2ss_readl(_ep_regs->EP_CONTROL) & EPN_BUF_TYPE;
if (buf_type == 0) {
/* Single Buffer */
-   use_ram_size += (data & EPn_MPKT) / sizeof(u32);
+   use_ram_size += (data & EPN_MPKT) / sizeof(u32);
} else {
/* Double Buffer */
-   use_ram_size += ((data & EPn_MPKT) / sizeof(u32)) * 2;
+   use_ram_size += ((data & EPN_MPKT) / sizeof(u32)) * 2;
}
 
if ((data >> 16) > last_ram_adr)
@@ -245,15 +245,15 @@ static int _nbu2ss_ep_init(struct nbu2ss_udc *udc, struct 
nbu2ss_ep *ep)
/*   Bulk, Interrupt, ISO */
switch (ep->ep_type) {
case USB_ENDPOINT_XFER_BULK:
-   data = EPn_BULK;
+   data = EPN_BULK;
break;
 
case USB_ENDPOINT_XFER_INT:
-   data = EPn_BUF_SINGLE | EPn_INTERRUPT;
+   data = EPN_BUF_SINGLE | EPN_INTERRUPT;
break;
 
case USB_ENDPOINT_XFER_ISOC:
-   data = EPn_ISO;
+   data = EPN_ISO;
break;
 
default:
@@ -267,24 +267,24 @@ static int _nbu2ss_ep_init(struct nbu2ss_udc *udc, struct 
nbu2ss_ep *ep)
if (ep->direct == USB_DIR_OUT) {
/*-*/
/* OUT */
-   data = EPn_EN | EPn_BCLR | EPn_DIR0;
+   data = EPN_EN | EPN_BCLR | EPN_DIR0;
_nbu2ss_bitset(>p_regs->EP_REGS[num].EP_CONTROL, data);
 
-   data = EPn_ONAK | EPn_OSTL_EN | EPn_OSTL;
+   data = EPN_ONAK | EPN_OSTL_EN | EPN_OSTL;
_nbu2ss_bitclr(>p_regs->EP_REGS[num].EP_CONTROL, data);
 
-   data = EPn_OUT_EN | EPn_OUT_END_EN;
+   data = EPN_OUT_EN | EPN_OUT_END_EN;
_nbu2ss_bitset(>p_regs->EP_REGS[num].EP_INT_ENA, data);
} else {
/*-*/
/* IN */
-   data = EPn_EN | EPn_BCLR | EPn_AUTO;
+   data = EPN_EN | EPN_BCLR | EPN_AUTO;
_nbu2ss_bitset(>p_regs->EP_REGS[num].EP_CONTROL, data);
 
-   data = EPn_ISTL;
+   data = EPN_ISTL;
_nbu2ss_bitclr(>p_regs->EP_REGS[num].EP_CONTROL, data);
 
-   data = EPn_IN_EN | EPn_IN_END_EN;
+   data = EPN_IN_EN | EPN_IN_END_EN;
_nbu2ss_bitset(>p_regs->EP_REGS[num].EP_INT_ENA, data);
}
 
@@ -315,24 +315,24 @@ static int _nbu2ss_epn_exit(struct nbu2ss_udc *udc, 
struct nbu2ss_ep *ep)
if (ep->direct == USB_DIR_OUT) {
/*-*/
/* OUT */
-   data = EPn_ONAK | EPn_BCLR;
+   data = EPN_ONAK | EPN_BCLR;
_nbu2ss_bitset(>p_regs->EP_REGS[num].EP_CONTROL, data);
 
-   data = EPn_EN | EPn_DIR0;
+   data = EPN_EN | EPN_DIR0;
_nbu2ss_bitclr(>p_regs->EP_REGS[num].EP_CONTROL, data);
 
-   data = EPn_OUT_EN | EPn_OUT_END_EN;
+   data = EPN_OUT_EN | EPN_OUT_END_EN;
_nbu2ss_bitclr(>p_regs->EP_REGS[num].EP_INT_ENA, data);
} else {
/*-*/
/* IN */
-   data = EPn_BCLR;
+   data = EPN_BCLR;
_nbu2ss_bitset(>p_regs->EP_REGS[num].EP_CONTROL, data);
 
-   data = EPn_EN | EPn_AUTO;
+   data = EPN_EN | EPN_AUTO;
_nbu2ss_bitclr(>p_regs->EP_REGS[num].EP_CONTROL, data);
 
-   data = EPn_IN_EN | EPn_IN_END_EN;
+   data = EPN_IN_EN | EPN_IN_END_EN;
_nbu2ss_bitclr(>p_regs->EP_REGS[num].EP_INT_ENA, data);
}
 
@@ -360,21 +360,21 @@ static void _nbu2ss_ep_dma_init(struct nbu2ss_udc *udc, 
struct nbu2ss_ep *ep)
 

[PATCH v2 7/7] staging: emxx_udc: Update "reserved" registers name

2017-05-10 Thread Alexis Lothoré
Ensure that "Reserved" members of registers mapping structure do not mix
upper/lower case

Signed-off-by: Alexis Lothoré 
---
 drivers/staging/emxx_udc/emxx_udc.h | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/emxx_udc/emxx_udc.h 
b/drivers/staging/emxx_udc/emxx_udc.h
index 332332d..928d531 100644
--- a/drivers/staging/emxx_udc/emxx_udc.h
+++ b/drivers/staging/emxx_udc/emxx_udc.h
@@ -471,7 +471,7 @@ struct fc_regs {
u32 USB_ADDRESS;/* (0x0008) USB Address */
u32 UTMI_CHARACTER_1;   /* (0x000C) UTMI Setting */
u32 TEST_CONTROL;   /* (0x0010) TEST Control */
-   u32 Reserved_14;/* (0x0014) Reserved */
+   u32 reserved_14;/* (0x0014) Reserved */
u32 SETUP_DATA0;/* (0x0018) Setup Data0 */
u32 SETUP_DATA1;/* (0x001C) Setup Data1 */
u32 USB_INT_STA;/* (0x0020) USB Interrupt Status */
@@ -485,7 +485,7 @@ struct fc_regs {
 
struct ep_regs EP_REGS[REG_EP_NUM]; /* Endpoint Register */
 
-   u8 Reserved220[0x1000 - 0x220]; /* (0x0220:0x0FFF) Reserved */
+   u8 reserved_220[0x1000 - 0x220];/* (0x0220:0x0FFF) Reserved */
 
u32 AHBSCTR;/* (0x1000) AHBSCTR */
u32 AHBMCTR;/* (0x1004) AHBMCTR */
@@ -494,16 +494,16 @@ struct fc_regs {
u32 EPCTR;  /* (0x1010) EPCTR */
u32 USBF_EPTEST;/* (0x1014) USBF_EPTEST */
 
-   u8 Reserved1018[0x20 - 0x18];   /* (0x1018:0x101F) Reserved */
+   u8 reserved_1018[0x20 - 0x18];  /* (0x1018:0x101F) Reserved */
 
u32 USBSSVER;   /* (0x1020) USBSSVER */
u32 USBSSCONF;  /* (0x1024) USBSSCONF */
 
-   u8 Reserved1028[0x110 - 0x28];  /* (0x1028:0x110F) Reserved */
+   u8 reserved_1028[0x110 - 0x28]; /* (0x1028:0x110F) Reserved */
 
struct ep_dcr EP_DCR[REG_EP_NUM];   /* */
 
-   u8 Reserved1200[0x1000 - 0x200];/* Reserved */
+   u8 reserved_1200[0x1000 - 0x200];   /* Reserved */
 } __aligned(32);
 
 #define EP0_PACKETSIZE 64
-- 
2.1.4

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


[PATCH v2 5/7] staging: emxx_udc: Update function parameters name

2017-05-10 Thread Alexis Lothoré
Ensure that function parameters use snake_case (some mixed upper/lower case)

Signed-off-by: Alexis Lothoré 
---
 drivers/staging/emxx_udc/emxx_udc.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/emxx_udc/emxx_udc.c 
b/drivers/staging/emxx_udc/emxx_udc.c
index 0e23923..84bdfeb 100644
--- a/drivers/staging/emxx_udc/emxx_udc.c
+++ b/drivers/staging/emxx_udc/emxx_udc.c
@@ -574,12 +574,12 @@ static int ep0_out_pio(struct nbu2ss_udc *udc, u8 *buf, 
u32 length)
 
 /*-*/
 /* Endpoint 0 OUT Transfer (PIO, OverBytes) */
-static int ep0_out_overbytes(struct nbu2ss_udc *udc, u8 *pBuf, u32 length)
+static int ep0_out_overbytes(struct nbu2ss_udc *udc, u8 *p_buf, u32 length)
 {
u32 i;
u32 i_read_size = 0;
union usb_reg_access  temp_32;
-   union usb_reg_access  *p_buf_32 = (union usb_reg_access *)pBuf;
+   union usb_reg_access  *p_buf_32 = (union usb_reg_access *)p_buf;
 
if ((length > 0) && (length < sizeof(u32))) {
temp_32.dw = _nbu2ss_readl(>p_regs->EP0_READ);
@@ -593,13 +593,13 @@ static int ep0_out_overbytes(struct nbu2ss_udc *udc, u8 
*pBuf, u32 length)
 
 /*-*/
 /* Endpoint 0 IN Transfer (PIO) */
-static int EP0_in_PIO(struct nbu2ss_udc *udc, u8 *pBuf, u32 length)
+static int EP0_in_PIO(struct nbu2ss_udc *udc, u8 *p_buf, u32 length)
 {
u32 i;
u32 i_max_length   = EP0_PACKETSIZE;
u32 i_word_length  = 0;
u32 i_write_length = 0;
-   union usb_reg_access  *p_buf_32 = (union usb_reg_access *)pBuf;
+   union usb_reg_access  *p_buf_32 = (union usb_reg_access *)p_buf;
 
/**/
/* Transfer Length */
@@ -621,11 +621,11 @@ static int EP0_in_PIO(struct nbu2ss_udc *udc, u8 *pBuf, 
u32 length)
 
 /*-*/
 /* Endpoint 0 IN Transfer (PIO, OverBytes) */
-static int ep0_in_overbytes(struct nbu2ss_udc *udc, u8 *pBuf, u32 
i_remain_size)
+static int ep0_in_overbytes(struct nbu2ss_udc *udc, u8 *p_buf, u32 
i_remain_size)
 {
u32 i;
union usb_reg_access  temp_32;
-   union usb_reg_access  *p_buf_32 = (union usb_reg_access *)pBuf;
+   union usb_reg_access  *p_buf_32 = (union usb_reg_access *)p_buf;
 
if ((i_remain_size > 0) && (i_remain_size < sizeof(u32))) {
for (i = 0 ; i < i_remain_size ; i++)
-- 
2.1.4

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


[PATCH v2 2/7] staging: emxx_udc: Balance "else" parenthesis

2017-05-10 Thread Alexis Lothoré
Add missing parenthesis for else statement

Signed-off-by: Alexis Lothoré 
---
 drivers/staging/emxx_udc/emxx_udc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/emxx_udc/emxx_udc.c 
b/drivers/staging/emxx_udc/emxx_udc.c
index 82f2c11..14db5f7 100644
--- a/drivers/staging/emxx_udc/emxx_udc.c
+++ b/drivers/staging/emxx_udc/emxx_udc.c
@@ -526,12 +526,13 @@ static void _nbu2ss_dma_unmap_single(
if (direct == USB_DIR_OUT)
memcpy(req->req.buf, ep->virt_buf,
   req->req.actual & 0xfffc);
-   } else
+   } else {
dma_unmap_single(udc->gadget.dev.parent,
 req->req.dma, req->req.length,
(direct == USB_DIR_IN)
? DMA_TO_DEVICE
: DMA_FROM_DEVICE);
+   }
req->req.dma = DMA_ADDR_INVALID;
req->mapped = 0;
} else {
-- 
2.1.4

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


Re: [PATCH] staging: typec: Fix sparse warnings about incorrect types

2017-05-10 Thread Guru Das S
On 10 May 2017 at 08:23, Guenter Roeck  wrote:

> Please the patch into two parts, one per file; the required changes
> for endianness support in tcpci.c are much more complex.

I will send out a patch for the two simple fixes - the use of
pd_header_cnt_le().

> Excellent catch, but the fix is wrong. We don't want to change the
> endianness here, since the data is sent to the chip. This will require
> a (much) more comprehensive fix - header should probably be le16, the
> second parameter to tcpci_write16() needs to be le16, plus everything
> that comes with it (currently the code is just not endianness clean).
> tcpci_read16() is also incorrect and has the same problem (it is
> really a bad idea to read 16 bit into an unsigned int pointer).
>
> Let me know if you want to try to fix this; otherwise I'll do it.

Sure, I'd like to give this a try. I will take a closer look at the
code and get back to you with questions.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


staging: most: net: use dormant state

2017-05-10 Thread Christian Gromm
From: Andrey Shvetsov 

This replaces the call of wait_for_completion in case of an invalid MAC
address in the function most_nd_open() with the dormant state of the
network device.

As a side effect, opening the network device cannot fail anymore.

Signed-off-by: Andrey Shvetsov 
Signed-off-by: Christian Gromm 
---
 drivers/staging/most/aim-network/networking.c | 31 ++-
 1 file changed, 6 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/most/aim-network/networking.c 
b/drivers/staging/most/aim-network/networking.c
index 004dd7b636cd..ce2942729ecf 100644
--- a/drivers/staging/most/aim-network/networking.c
+++ b/drivers/staging/most/aim-network/networking.c
@@ -69,7 +69,6 @@ struct net_dev_context {
struct net_device *dev;
struct net_dev_channel rx;
struct net_dev_channel tx;
-   struct completion mac_compl;
struct list_head list;
 };
 
@@ -180,7 +179,6 @@ static int most_nd_set_mac_address(struct net_device *dev, 
void *p)
 static int most_nd_open(struct net_device *dev)
 {
struct net_dev_context *nd = dev->ml_priv;
-   long ret;
 
netdev_info(dev, "open net device\n");
 
@@ -199,29 +197,13 @@ static int most_nd_open(struct net_device *dev)
return -EBUSY;
}
 
-   if (!is_valid_ether_addr(dev->dev_addr)) {
-   nd->iface->request_netinfo(nd->iface, nd->tx.ch_id);
-   ret = wait_for_completion_interruptible_timeout(
- >mac_compl, msecs_to_jiffies(5000));
-   if (!ret) {
-   netdev_err(dev, "mac timeout\n");
-   ret = -EBUSY;
-   goto err;
-   }
-
-   if (ret < 0) {
-   netdev_warn(dev, "mac waiting interrupted\n");
-   goto err;
-   }
-   }
-
+   if (is_valid_ether_addr(dev->dev_addr))
+   netif_dormant_off(dev);
+   else
+   netif_dormant_on(dev);
netif_wake_queue(dev);
+   nd->iface->request_netinfo(nd->iface, nd->tx.ch_id);
return 0;
-
-err:
-   most_stop_channel(nd->iface, nd->tx.ch_id, );
-   most_stop_channel(nd->iface, nd->rx.ch_id, );
-   return ret;
 }
 
 static int most_nd_stop(struct net_device *dev)
@@ -337,7 +319,6 @@ static int aim_probe_channel(struct most_interface *iface, 
int channel_idx,
if (!nd)
return -ENOMEM;
 
-   init_completion(>mac_compl);
nd->iface = iface;
 
spin_lock_irqsave(_lock, flags);
@@ -569,7 +550,7 @@ void most_deliver_netinfo(struct most_interface *iface,
netdev_info(dev, "set mac 
%02x-%02x-%02x-%02x-%02x-%02x\n",
m[0], m[1], m[2], m[3], m[4], m[5]);
ether_addr_copy(dev->dev_addr, m);
-   complete(>mac_compl);
+   netif_dormant_off(dev);
} else if (!ether_addr_equal(dev->dev_addr, m)) {
netdev_warn(dev, "reject mac 
%02x-%02x-%02x-%02x-%02x-%02x\n",
m[0], m[1], m[2], m[3], m[4], m[5]);
-- 
2.11.0

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


staging: most: dim2: enable flow control for isoc channels

2017-05-10 Thread Christian Gromm
From: Andrey Shvetsov 

This patch enables the flow control feature for the isochronous channels
of the DIM2 macro.

Signed-off-by: Andrey Shvetsov 
Signed-off-by: Christian Gromm 
---
 drivers/staging/most/hdm-dim2/dim2_hal.c | 2 ++
 drivers/staging/most/hdm-dim2/dim2_reg.h | 1 +
 2 files changed, 3 insertions(+)

diff --git a/drivers/staging/most/hdm-dim2/dim2_hal.c 
b/drivers/staging/most/hdm-dim2/dim2_hal.c
index d604ec09df28..b9f34950b763 100644
--- a/drivers/staging/most/hdm-dim2/dim2_hal.c
+++ b/drivers/staging/most/hdm-dim2/dim2_hal.c
@@ -219,10 +219,12 @@ static inline void dim2_clear_ctr(u32 ctr_addr)
 static void dim2_configure_cat(u8 cat_base, u8 ch_addr, u8 ch_type,
   bool read_not_write, bool sync_mfe)
 {
+   bool isoc_fce = ch_type == CAT_CT_VAL_ISOC;
u16 const cat =
(read_not_write << CAT_RNW_BIT) |
(ch_type << CAT_CT_SHIFT) |
(ch_addr << CAT_CL_SHIFT) |
+   (isoc_fce << CAT_FCE_BIT) |
(sync_mfe << CAT_MFE_BIT) |
(false << CAT_MT_BIT) |
(true << CAT_CE_BIT);
diff --git a/drivers/staging/most/hdm-dim2/dim2_reg.h 
b/drivers/staging/most/hdm-dim2/dim2_reg.h
index 01fe499411ff..f7d9fbcd29f2 100644
--- a/drivers/staging/most/hdm-dim2/dim2_reg.h
+++ b/drivers/staging/most/hdm-dim2/dim2_reg.h
@@ -141,6 +141,7 @@ enum {
ADT1_CTRL_ASYNC_BD_MASK = DIM2_MASK(11),
ADT1_ISOC_SYNC_BD_MASK = DIM2_MASK(13),
 
+   CAT_FCE_BIT = 14,
CAT_MFE_BIT = 14,
 
CAT_MT_BIT = 13,
-- 
2.11.0

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


staging: most: allocate private net_dev_context with the alloc_netdev

2017-05-10 Thread Christian Gromm
From: Andrey Shvetsov 

This moves the allocation of the net_dev to the aim_probe_channel() and
uses the parameter sizeof_priv of the function alloc_netdev to reserve
the space for the struct net_dev_context.

As a side effect, the nd->dev always points to the existing net_dev.

Signed-off-by: Andrey Shvetsov 
Signed-off-by: Christian Gromm 
---
 drivers/staging/most/aim-network/networking.c | 81 +++
 1 file changed, 20 insertions(+), 61 deletions(-)

diff --git a/drivers/staging/most/aim-network/networking.c 
b/drivers/staging/most/aim-network/networking.c
index 36483b977b71..cbd95003ec31 100644
--- a/drivers/staging/most/aim-network/networking.c
+++ b/drivers/staging/most/aim-network/networking.c
@@ -154,14 +154,12 @@ static int skb_to_mep(const struct sk_buff *skb, struct 
mbo *mbo)
 
 static int most_nd_set_mac_address(struct net_device *dev, void *p)
 {
-   struct net_dev_context *nd = dev->ml_priv;
+   struct net_dev_context *nd = netdev_priv(dev);
int err = eth_mac_addr(dev, p);
 
if (err)
return err;
 
-   BUG_ON(nd->dev != dev);
-
nd->is_mamac =
(dev->dev_addr[0] == 0 && dev->dev_addr[1] == 0 &&
 dev->dev_addr[2] == 0 && dev->dev_addr[3] == 0);
@@ -180,12 +178,10 @@ static void on_netinfo(struct most_interface *iface,
 
 static int most_nd_open(struct net_device *dev)
 {
-   struct net_dev_context *nd = dev->ml_priv;
+   struct net_dev_context *nd = netdev_priv(dev);
 
netdev_info(dev, "open net device\n");
 
-   BUG_ON(nd->dev != dev);
-
BUG_ON(!nd->tx.linked || !nd->rx.linked);
 
if (most_start_channel(nd->iface, nd->rx.ch_id, )) {
@@ -212,11 +208,10 @@ static int most_nd_open(struct net_device *dev)
 
 static int most_nd_stop(struct net_device *dev)
 {
-   struct net_dev_context *nd = dev->ml_priv;
+   struct net_dev_context *nd = netdev_priv(dev);
 
netdev_info(dev, "stop net device\n");
 
-   BUG_ON(nd->dev != dev);
netif_stop_queue(dev);
if (nd->iface->request_netinfo)
nd->iface->request_netinfo(nd->iface, nd->tx.ch_id, NULL);
@@ -229,12 +224,10 @@ static int most_nd_stop(struct net_device *dev)
 static netdev_tx_t most_nd_start_xmit(struct sk_buff *skb,
  struct net_device *dev)
 {
-   struct net_dev_context *nd = dev->ml_priv;
+   struct net_dev_context *nd = netdev_priv(dev);
struct mbo *mbo;
int ret;
 
-   BUG_ON(nd->dev != dev);
-
mbo = most_get_mbo(nd->iface, nd->tx.ch_id, );
 
if (!mbo) {
@@ -275,18 +268,6 @@ static void most_nd_setup(struct net_device *dev)
dev->netdev_ops = _nd_ops;
 }
 
-static void most_net_rm_netdev_safe(struct net_dev_context *nd)
-{
-   if (!nd->dev)
-   return;
-
-   pr_info("remove net device %p\n", nd->dev);
-
-   unregister_netdev(nd->dev);
-   free_netdev(nd->dev);
-   nd->dev = NULL;
-}
-
 static struct net_dev_context *get_net_dev_context(
struct most_interface *iface)
 {
@@ -321,11 +302,16 @@ static int aim_probe_channel(struct most_interface 
*iface, int channel_idx,
nd = get_net_dev_context(iface);
 
if (!nd) {
-   nd = kzalloc(sizeof(*nd), GFP_KERNEL);
-   if (!nd)
+   struct net_device *dev;
+
+   dev = alloc_netdev(sizeof(struct net_dev_context), "meth%d",
+  NET_NAME_UNKNOWN, most_nd_setup);
+   if (!dev)
return -ENOMEM;
 
+   nd = netdev_priv(dev);
nd->iface = iface;
+   nd->dev = dev;
 
spin_lock_irqsave(_lock, flags);
list_add(>list, _devices);
@@ -338,31 +324,13 @@ static int aim_probe_channel(struct most_interface 
*iface, int channel_idx,
return -EINVAL;
}
 
-   if (nd->tx.linked || nd->rx.linked) {
-   struct net_device *dev =
-   alloc_netdev(0, "meth%d", NET_NAME_UNKNOWN,
-most_nd_setup);
-
-   if (!dev) {
-   pr_err("no memory for net_device\n");
-   return -ENOMEM;
-   }
-
-   nd->dev = dev;
-   ch->ch_id = channel_idx;
-   ch->linked = true;
-
-   dev->ml_priv = nd;
-   if (register_netdev(dev)) {
-   pr_err("registering net device failed\n");
-   ch->linked = false;
-   free_netdev(dev);
-   return -EINVAL;
-   }
-   }
-
ch->ch_id = channel_idx;
ch->linked = true;
+   if (nd->tx.linked && nd->rx.linked && register_netdev(nd->dev)) {
+   pr_err("register_netdev() failed\n");
+   

staging: most: remove dependency on networking-aim

2017-05-10 Thread Christian Gromm
From: Andrey Shvetsov 

The modules hdm-usb and hdm-dim2 depend on the module aim-network, because
they use the function most_deliver_netinfo that it exports.

To remove this dependency, this patch replaces the call of the function
most_deliver_netinfo with the call of the function that is the parameter
'on_netinfo' of the function request_netinfo.

Signed-off-by: Andrey Shvetsov 
Signed-off-by: Christian Gromm 
---
 drivers/staging/most/aim-network/networking.c | 15 +--
 drivers/staging/most/aim-network/networking.h | 21 -
 drivers/staging/most/hdm-dim2/Kconfig |  1 -
 drivers/staging/most/hdm-dim2/dim2_hdm.c  | 18 ++
 drivers/staging/most/hdm-usb/Kconfig  |  2 +-
 drivers/staging/most/hdm-usb/hdm_usb.c| 15 ---
 drivers/staging/most/mostcore/mostcore.h  |  7 ++-
 7 files changed, 42 insertions(+), 37 deletions(-)
 delete mode 100644 drivers/staging/most/aim-network/networking.h

diff --git a/drivers/staging/most/aim-network/networking.c 
b/drivers/staging/most/aim-network/networking.c
index 03ddbd2459d6..a3009fdfa278 100644
--- a/drivers/staging/most/aim-network/networking.c
+++ b/drivers/staging/most/aim-network/networking.c
@@ -22,7 +22,6 @@
 #include 
 #include 
 #include "mostcore.h"
-#include "networking.h"
 
 #define MEP_HDR_LEN 8
 #define MDP_HDR_LEN 16
@@ -176,6 +175,9 @@ static int most_nd_set_mac_address(struct net_device *dev, 
void *p)
return 0;
 }
 
+static void on_netinfo(struct most_interface *iface,
+  unsigned char link_stat, unsigned char *mac_addr);
+
 static int most_nd_open(struct net_device *dev)
 {
struct net_dev_context *nd = dev->ml_priv;
@@ -204,7 +206,7 @@ static int most_nd_open(struct net_device *dev)
netif_dormant_on(dev);
netif_wake_queue(dev);
if (nd->iface->request_netinfo)
-   nd->iface->request_netinfo(nd->iface, nd->tx.ch_id);
+   nd->iface->request_netinfo(nd->iface, nd->tx.ch_id, on_netinfo);
return 0;
 }
 
@@ -216,6 +218,8 @@ static int most_nd_stop(struct net_device *dev)
 
BUG_ON(nd->dev != dev);
netif_stop_queue(dev);
+   if (nd->iface->request_netinfo)
+   nd->iface->request_netinfo(nd->iface, nd->tx.ch_id, NULL);
most_stop_channel(nd->iface, nd->rx.ch_id, );
most_stop_channel(nd->iface, nd->tx.ch_id, );
 
@@ -527,13 +531,13 @@ static void __exit most_net_exit(void)
 }
 
 /**
- * most_deliver_netinfo - callback for HDM to be informed about HW's MAC
+ * on_netinfo - callback for HDM to be informed about HW's MAC
  * @param iface - most interface instance
  * @param link_stat - link status
  * @param mac_addr - MAC address
  */
-void most_deliver_netinfo(struct most_interface *iface,
- unsigned char link_stat, unsigned char *mac_addr)
+static void on_netinfo(struct most_interface *iface,
+  unsigned char link_stat, unsigned char *mac_addr)
 {
struct net_dev_context *nd;
struct net_device *dev;
@@ -564,7 +568,6 @@ void most_deliver_netinfo(struct most_interface *iface,
}
}
 }
-EXPORT_SYMBOL(most_deliver_netinfo);
 
 module_init(most_net_init);
 module_exit(most_net_exit);
diff --git a/drivers/staging/most/aim-network/networking.h 
b/drivers/staging/most/aim-network/networking.h
deleted file mode 100644
index 6f346d410525..
--- a/drivers/staging/most/aim-network/networking.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Networking AIM - Networking Application Interface Module for MostCore
- *
- * Copyright (C) 2015, Microchip Technology Germany II GmbH & Co. KG
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * This file is licensed under GPLv2.
- */
-#ifndef _NETWORKING_H_
-#define _NETWORKING_H_
-
-#include "mostcore.h"
-
-void most_deliver_netinfo(struct most_interface *iface,
- unsigned char link_stat, unsigned char *mac_addr);
-
-#endif
diff --git a/drivers/staging/most/hdm-dim2/Kconfig 
b/drivers/staging/most/hdm-dim2/Kconfig
index 28a0e1791600..663bfebff674 100644
--- a/drivers/staging/most/hdm-dim2/Kconfig
+++ b/drivers/staging/most/hdm-dim2/Kconfig
@@ -4,7 +4,6 @@
 
 config HDM_DIM2
tristate "DIM2 HDM"
-   depends on AIM_NETWORK
depends on HAS_IOMEM
 
---help---
diff --git a/drivers/staging/most/hdm-dim2/dim2_hdm.c 
b/drivers/staging/most/hdm-dim2/dim2_hdm.c
index 902824e728ea..4607d03c577b 100644
--- a/drivers/staging/most/hdm-dim2/dim2_hdm.c
+++ b/drivers/staging/most/hdm-dim2/dim2_hdm.c
@@ -26,7 +26,6 @@
 #include 
 
 #include 
-#include 
 #include "dim2_hal.h"
 #include "dim2_hdm.h"
 

staging: most: net: remove redundant cleanup code

2017-05-10 Thread Christian Gromm
From: Andrey Shvetsov 

This removes redundant cleanup code that is executed anyway when the
most_deregister_aim() is called.

Signed-off-by: Andrey Shvetsov 
Signed-off-by: Christian Gromm 
---
 drivers/staging/most/aim-network/networking.c | 19 +--
 1 file changed, 1 insertion(+), 18 deletions(-)

diff --git a/drivers/staging/most/aim-network/networking.c 
b/drivers/staging/most/aim-network/networking.c
index 11f03d3cd565..e2935ccd5b09 100644
--- a/drivers/staging/most/aim-network/networking.c
+++ b/drivers/staging/most/aim-network/networking.c
@@ -509,25 +509,8 @@ static int __init most_net_init(void)
 
 static void __exit most_net_exit(void)
 {
-   struct net_dev_context *nd, *tmp;
-   unsigned long flags;
-
-   spin_lock_irqsave(_lock, flags);
-   list_for_each_entry_safe(nd, tmp, _devices, list) {
-   list_del(>list);
-   spin_unlock_irqrestore(_lock, flags);
-   /*
-* do not call most_stop_channel() here, because channels are
-* going to be closed in ndo_stop() after unregister_netdev()
-*/
-   most_net_rm_netdev_safe(nd);
-   kfree(nd);
-   spin_lock_irqsave(_lock, flags);
-   }
-   spin_unlock_irqrestore(_lock, flags);
-
-   most_deregister_aim();
pr_info("most_net_exit()\n");
+   most_deregister_aim();
 }
 
 /**
-- 
2.11.0

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


staging: most: check availability of the callback request_netinfo

2017-05-10 Thread Christian Gromm
From: Andrey Shvetsov 

Since not all HDMs implement the callback request_netinfo, this patch
adds checking of its availability.

Signed-off-by: Andrey Shvetsov 
Signed-off-by: Christian Gromm 
---
 drivers/staging/most/aim-network/networking.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/most/aim-network/networking.c 
b/drivers/staging/most/aim-network/networking.c
index 5822902ecb4a..03ddbd2459d6 100644
--- a/drivers/staging/most/aim-network/networking.c
+++ b/drivers/staging/most/aim-network/networking.c
@@ -203,7 +203,8 @@ static int most_nd_open(struct net_device *dev)
else
netif_dormant_on(dev);
netif_wake_queue(dev);
-   nd->iface->request_netinfo(nd->iface, nd->tx.ch_id);
+   if (nd->iface->request_netinfo)
+   nd->iface->request_netinfo(nd->iface, nd->tx.ch_id);
return 0;
 }
 
-- 
2.11.0

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


staging: most: net: add carrier information

2017-05-10 Thread Christian Gromm
From: Andrey Shvetsov 

This adds the carrier information for the network devices based on the
INIC controllers.

Signed-off-by: Andrey Shvetsov 
Signed-off-by: Christian Gromm 
---
 drivers/staging/most/aim-network/networking.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/drivers/staging/most/aim-network/networking.c 
b/drivers/staging/most/aim-network/networking.c
index ce2942729ecf..5822902ecb4a 100644
--- a/drivers/staging/most/aim-network/networking.c
+++ b/drivers/staging/most/aim-network/networking.c
@@ -197,6 +197,7 @@ static int most_nd_open(struct net_device *dev)
return -EBUSY;
}
 
+   netif_carrier_off(dev);
if (is_valid_ether_addr(dev->dev_addr))
netif_dormant_off(dev);
else
@@ -545,6 +546,11 @@ void most_deliver_netinfo(struct most_interface *iface,
if (!dev)
return;
 
+   if (link_stat)
+   netif_carrier_on(dev);
+   else
+   netif_carrier_off(dev);
+
if (m && is_valid_ether_addr(m)) {
if (!is_valid_ether_addr(dev->dev_addr)) {
netdev_info(dev, "set mac 
%02x-%02x-%02x-%02x-%02x-%02x\n",
-- 
2.11.0

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


staging: most: net: prefer __func__ over the function name

2017-05-10 Thread Christian Gromm
From: Andrey Shvetsov 

This replaces the function names in the print messages with the __func__
macro.

Signed-off-by: Andrey Shvetsov 
Signed-off-by: Christian Gromm 
---
 drivers/staging/most/aim-network/networking.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/most/aim-network/networking.c 
b/drivers/staging/most/aim-network/networking.c
index e2935ccd5b09..36483b977b71 100644
--- a/drivers/staging/most/aim-network/networking.c
+++ b/drivers/staging/most/aim-network/networking.c
@@ -502,14 +502,14 @@ static struct most_aim aim = {
 
 static int __init most_net_init(void)
 {
-   pr_info("most_net_init()\n");
+   pr_info("%s()\n", __func__);
spin_lock_init(_lock);
return most_register_aim();
 }
 
 static void __exit most_net_exit(void)
 {
-   pr_info("most_net_exit()\n");
+   pr_info("%s()\n", __func__);
most_deregister_aim();
 }
 
-- 
2.11.0

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


staging: most: net: remove useless variable channels_opened

2017-05-10 Thread Christian Gromm
From: Andrey Shvetsov 

The function most_nd_stop is only called by successful return from the
function most_nd_open, so the channels_opened is always true in the
function most_nd_stop.

The functions aim_resume_tx_channel and aim_rx_data are only called
after successful most_start_channel in the function most_nd_open, so the
channels_opened is always true in the functions aim_resume_tx_channel
and aim_rx_data.

Signed-off-by: Andrey Shvetsov 
Signed-off-by: Christian Gromm 
---
 drivers/staging/most/aim-network/networking.c | 17 -
 1 file changed, 4 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/most/aim-network/networking.c 
b/drivers/staging/most/aim-network/networking.c
index ce1764cba5f0..004dd7b636cd 100644
--- a/drivers/staging/most/aim-network/networking.c
+++ b/drivers/staging/most/aim-network/networking.c
@@ -65,7 +65,6 @@ struct net_dev_channel {
 
 struct net_dev_context {
struct most_interface *iface;
-   bool channels_opened;
bool is_mamac;
struct net_device *dev;
struct net_dev_channel rx;
@@ -187,9 +186,6 @@ static int most_nd_open(struct net_device *dev)
 
BUG_ON(nd->dev != dev);
 
-   if (nd->channels_opened)
-   return -EFAULT;
-
BUG_ON(!nd->tx.linked || !nd->rx.linked);
 
if (most_start_channel(nd->iface, nd->rx.ch_id, )) {
@@ -219,7 +215,6 @@ static int most_nd_open(struct net_device *dev)
}
}
 
-   nd->channels_opened = true;
netif_wake_queue(dev);
return 0;
 
@@ -237,12 +232,8 @@ static int most_nd_stop(struct net_device *dev)
 
BUG_ON(nd->dev != dev);
netif_stop_queue(dev);
-
-   if (nd->channels_opened) {
-   most_stop_channel(nd->iface, nd->rx.ch_id, );
-   most_stop_channel(nd->iface, nd->tx.ch_id, );
-   nd->channels_opened = false;
-   }
+   most_stop_channel(nd->iface, nd->rx.ch_id, );
+   most_stop_channel(nd->iface, nd->tx.ch_id, );
 
return 0;
 }
@@ -431,7 +422,7 @@ static int aim_resume_tx_channel(struct most_interface 
*iface,
struct net_dev_context *nd;
 
nd = get_net_dev_context(iface);
-   if (!nd || !nd->channels_opened || nd->tx.ch_id != channel_idx)
+   if (!nd || nd->tx.ch_id != channel_idx)
return 0;
 
if (!nd->dev)
@@ -452,7 +443,7 @@ static int aim_rx_data(struct mbo *mbo)
unsigned int skb_len;
 
nd = get_net_dev_context(mbo->ifp);
-   if (!nd || !nd->channels_opened || nd->rx.ch_id != mbo->hdm_channel_id)
+   if (!nd || nd->rx.ch_id != mbo->hdm_channel_id)
return -EIO;
 
dev = nd->dev;
-- 
2.11.0

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


staging: most: dim2: replace function parameter with the expression

2017-05-10 Thread Christian Gromm
From: Andrey Shvetsov 

This replaces the function parameter sync_mfe with the expression
(ch_type == CAT_CT_VAL_SYNC) what is the same.

Signed-off-by: Andrey Shvetsov 
Signed-off-by: Christian Gromm 
---
 drivers/staging/most/hdm-dim2/dim2_hal.c | 15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/most/hdm-dim2/dim2_hal.c 
b/drivers/staging/most/hdm-dim2/dim2_hal.c
index b9f34950b763..91484643d289 100644
--- a/drivers/staging/most/hdm-dim2/dim2_hal.c
+++ b/drivers/staging/most/hdm-dim2/dim2_hal.c
@@ -217,9 +217,10 @@ static inline void dim2_clear_ctr(u32 ctr_addr)
 }
 
 static void dim2_configure_cat(u8 cat_base, u8 ch_addr, u8 ch_type,
-  bool read_not_write, bool sync_mfe)
+  bool read_not_write)
 {
bool isoc_fce = ch_type == CAT_CT_VAL_ISOC;
+   bool sync_mfe = ch_type == CAT_CT_VAL_SYNC;
u16 const cat =
(read_not_write << CAT_RNW_BIT) |
(ch_type << CAT_CT_SHIFT) |
@@ -352,13 +353,13 @@ static void dim2_clear_ctram(void)
 
 static void dim2_configure_channel(
u8 ch_addr, u8 type, u8 is_tx, u16 dbr_address, u16 hw_buffer_size,
-   u16 packet_length, bool sync_mfe)
+   u16 packet_length)
 {
dim2_configure_cdt(ch_addr, dbr_address, hw_buffer_size, packet_length);
-   dim2_configure_cat(MLB_CAT, ch_addr, type, is_tx ? 1 : 0, sync_mfe);
+   dim2_configure_cat(MLB_CAT, ch_addr, type, is_tx ? 1 : 0);
 
dim2_configure_adt(ch_addr);
-   dim2_configure_cat(AHB_CAT, ch_addr, type, is_tx ? 0 : 1, sync_mfe);
+   dim2_configure_cat(AHB_CAT, ch_addr, type, is_tx ? 0 : 1);
 
/* unmask interrupt for used channel, enable mlb_sys_int[0] interrupt */
dimcb_io_write(>ACMR0,
@@ -773,7 +774,7 @@ static u8 init_ctrl_async(struct dim_channel *ch, u8 type, 
u8 is_tx,
channel_init(ch, ch_address / 2);
 
dim2_configure_channel(ch->addr, type, is_tx,
-  ch->dbr_addr, ch->dbr_size, 0, false);
+  ch->dbr_addr, ch->dbr_size, 0);
 
return DIM_NO_ERROR;
 }
@@ -859,7 +860,7 @@ u8 dim_init_isoc(struct dim_channel *ch, u8 is_tx, u16 
ch_address,
isoc_init(ch, ch_address / 2, packet_length);
 
dim2_configure_channel(ch->addr, CAT_CT_VAL_ISOC, is_tx, ch->dbr_addr,
-  ch->dbr_size, packet_length, false);
+  ch->dbr_size, packet_length);
 
return DIM_NO_ERROR;
 }
@@ -887,7 +888,7 @@ u8 dim_init_sync(struct dim_channel *ch, u8 is_tx, u16 
ch_address,
 
dim2_clear_dbr(ch->dbr_addr, ch->dbr_size);
dim2_configure_channel(ch->addr, CAT_CT_VAL_SYNC, is_tx,
-  ch->dbr_addr, ch->dbr_size, 0, true);
+  ch->dbr_addr, ch->dbr_size, 0);
 
return DIM_NO_ERROR;
 }
-- 
2.11.0

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


staging: most: use unsafe version of list traversing

2017-05-10 Thread Christian Gromm
From: Andrey Shvetsov 

The function get_net_dev_context does not remove elements of the list.
Hence, list traversing does not need to be secured.

This patch replaces list_for_each_entry_safe with the
list_for_each_entry.

Signed-off-by: Andrey Shvetsov 
Signed-off-by: Christian Gromm 
---
 drivers/staging/most/aim-network/networking.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/most/aim-network/networking.c 
b/drivers/staging/most/aim-network/networking.c
index a3009fdfa278..11f03d3cd565 100644
--- a/drivers/staging/most/aim-network/networking.c
+++ b/drivers/staging/most/aim-network/networking.c
@@ -290,11 +290,11 @@ static void most_net_rm_netdev_safe(struct 
net_dev_context *nd)
 static struct net_dev_context *get_net_dev_context(
struct most_interface *iface)
 {
-   struct net_dev_context *nd, *tmp;
+   struct net_dev_context *nd;
unsigned long flags;
 
spin_lock_irqsave(_lock, flags);
-   list_for_each_entry_safe(nd, tmp, _devices, list) {
+   list_for_each_entry(nd, _devices, list) {
if (nd->iface == iface) {
spin_unlock_irqrestore(_lock, flags);
return nd;
-- 
2.11.0

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


staging: most: net: fix race between create/destroy device

2017-05-10 Thread Christian Gromm
From: Andrey Shvetsov 

This introduces the kref for the net_dev_context to prevent the
destruction of the network devices that are in use.

Each get_net_dev_context is completed with the put_net_dev_context,
except the function aim_probe_channel that calls one more
get_net_dev_context or kref_get and the function aim_disconnect_channel
that calls one more put_net_dev_context.

Signed-off-by: Andrey Shvetsov 
Signed-off-by: Christian Gromm 
---
 drivers/staging/most/aim-network/networking.c | 92 +--
 1 file changed, 72 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/most/aim-network/networking.c 
b/drivers/staging/most/aim-network/networking.c
index cbd95003ec31..8cf1c81c295a 100644
--- a/drivers/staging/most/aim-network/networking.c
+++ b/drivers/staging/most/aim-network/networking.c
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 #include "mostcore.h"
 
 #define MEP_HDR_LEN 8
@@ -69,6 +70,7 @@ struct net_dev_context {
struct net_dev_channel rx;
struct net_dev_channel tx;
struct list_head list;
+   struct kref kref;
 };
 
 static struct list_head net_devices = LIST_HEAD_INIT(net_devices);
@@ -268,6 +270,26 @@ static void most_nd_setup(struct net_device *dev)
dev->netdev_ops = _nd_ops;
 }
 
+static void release_nd(struct kref *kref)
+{
+   struct net_dev_context *nd;
+
+   nd = container_of(kref, struct net_dev_context, kref);
+   list_del(>list);
+}
+
+static inline void put_net_dev_context(struct net_dev_context *nd)
+{
+   unsigned long flags;
+   int released;
+
+   spin_lock_irqsave(_lock, flags);
+   released = kref_put(>kref, release_nd);
+   spin_unlock_irqrestore(_lock, flags);
+   if (released)
+   free_netdev(nd->dev);
+}
+
 static struct net_dev_context *get_net_dev_context(
struct most_interface *iface)
 {
@@ -277,6 +299,7 @@ static struct net_dev_context *get_net_dev_context(
spin_lock_irqsave(_lock, flags);
list_for_each_entry(nd, _devices, list) {
if (nd->iface == iface) {
+   kref_get(>kref);
spin_unlock_irqrestore(_lock, flags);
return nd;
}
@@ -300,7 +323,6 @@ static int aim_probe_channel(struct most_interface *iface, 
int channel_idx,
return -EINVAL;
 
nd = get_net_dev_context(iface);
-
if (!nd) {
struct net_device *dev;
 
@@ -309,19 +331,34 @@ static int aim_probe_channel(struct most_interface 
*iface, int channel_idx,
if (!dev)
return -ENOMEM;
 
+   /*
+* The network device for the given iface may be added with use
+* of the other channel just after the get_net_dev_context
+* call.  Free our duplicate of net_device in this case.
+*/
+   spin_lock_irqsave(_lock, flags);
+   list_for_each_entry(nd, _devices, list) {
+   if (nd->iface == iface) {
+   kref_get(>kref);
+   spin_unlock_irqrestore(_lock, flags);
+   free_netdev(dev);
+   goto ok;
+   }
+   }
+
nd = netdev_priv(dev);
+   kref_init(>kref);
nd->iface = iface;
nd->dev = dev;
-
-   spin_lock_irqsave(_lock, flags);
list_add(>list, _devices);
spin_unlock_irqrestore(_lock, flags);
}
 
+ok:
ch = ccfg->direction == MOST_CH_TX ? >tx : >rx;
if (ch->linked) {
pr_err("only one channel per instance & direction allowed\n");
-   return -EINVAL;
+   goto err;
}
 
ch->ch_id = channel_idx;
@@ -329,10 +366,14 @@ static int aim_probe_channel(struct most_interface 
*iface, int channel_idx,
if (nd->tx.linked && nd->rx.linked && register_netdev(nd->dev)) {
pr_err("register_netdev() failed\n");
ch->linked = false;
-   return -EINVAL;
+   goto err;
}
 
return 0;
+
+err:
+   put_net_dev_context(nd);
+   return -EINVAL;
 }
 
 static int aim_disconnect_channel(struct most_interface *iface,
@@ -340,7 +381,7 @@ static int aim_disconnect_channel(struct most_interface 
*iface,
 {
struct net_dev_context *nd;
struct net_dev_channel *ch;
-   unsigned long flags;
+   int ret = -EINVAL;
 
nd = get_net_dev_context(iface);
if (!nd)
@@ -351,7 +392,7 @@ static int aim_disconnect_channel(struct most_interface 
*iface,
else if (nd->tx.linked && channel_idx == nd->tx.ch_id)
ch = >tx;
else
-   return -EINVAL;
+   goto put_nd;
 

staging: most: i2c: remove empty callback request_netinfo

2017-05-10 Thread Christian Gromm
From: Andrey Shvetsov 

Since the networking-aim checks the availability of the callback
request_netinfo, this patch removes the empty callback request_netinfo
from the i2c-hdm.

Signed-off-by: Andrey Shvetsov 
Signed-off-by: Christian Gromm 
---
 drivers/staging/most/hdm-i2c/hdm_i2c.c | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/drivers/staging/most/hdm-i2c/hdm_i2c.c 
b/drivers/staging/most/hdm-i2c/hdm_i2c.c
index 1d5b22927bcd..2b4de404e46a 100644
--- a/drivers/staging/most/hdm-i2c/hdm_i2c.c
+++ b/drivers/staging/most/hdm-i2c/hdm_i2c.c
@@ -185,12 +185,6 @@ static int poison_channel(struct most_interface 
*most_iface,
return 0;
 }
 
-static void request_netinfo(struct most_interface *most_iface,
-   int ch_idx)
-{
-   pr_info("request_netinfo()\n");
-}
-
 static void do_rx_work(struct hdm_i2c *dev)
 {
struct mbo *mbo;
@@ -343,7 +337,6 @@ static int i2c_probe(struct i2c_client *client, const 
struct i2c_device_id *id)
dev->most_iface.configure = configure_channel;
dev->most_iface.enqueue = enqueue;
dev->most_iface.poison_channel = poison_channel;
-   dev->most_iface.request_netinfo = request_netinfo;
 
INIT_LIST_HEAD(>rx.list);
mutex_init(>rx.list_mutex);
-- 
2.11.0

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


Re: [PATCH] staging: ccree: remove extraneous spin_unlock_bh() in error handler

2017-05-10 Thread Gilad Ben-Yossef
On Wed, May 10, 2017 at 12:20 PM, Ian Chard  wrote:
> An early error handler in send_request() tries to release a spinlock,
> but the lock isn't acquired until the loop below it is entered.
>
> Signed-off-by: Ian Chard 
> ---
>  drivers/staging/ccree/ssi_request_mgr.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/drivers/staging/ccree/ssi_request_mgr.c 
> b/drivers/staging/ccree/ssi_request_mgr.c
> index 522bd62c102e..8611adf3bb2e 100644
> --- a/drivers/staging/ccree/ssi_request_mgr.c
> +++ b/drivers/staging/ccree/ssi_request_mgr.c
> @@ -376,7 +376,6 @@ int send_request(
> rc = ssi_power_mgr_runtime_get(>plat_dev->dev);
> if (rc != 0) {
> SSI_LOG_ERR("ssi_power_mgr_runtime_get returned %x\n",rc);
> -   spin_unlock_bh(_mgr_h->hw_lock);
> return rc;
> }
>  #endif
> --
> 2.11.0
>

Nice catch.

Acked-by: Gilad Ben-Yossef 

Thanks,
Gilad



-- 
Gilad Ben-Yossef
Chief Coffee Drinker

"If you take a class in large-scale robotics, can you end up in a
situation where the homework eats your dog?"
 -- Jean-Baptiste Queru
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: ccree: remove extraneous spin_unlock_bh() in error handler

2017-05-10 Thread Ian Chard
An early error handler in send_request() tries to release a spinlock,
but the lock isn't acquired until the loop below it is entered.

Signed-off-by: Ian Chard 
---
 drivers/staging/ccree/ssi_request_mgr.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/ccree/ssi_request_mgr.c 
b/drivers/staging/ccree/ssi_request_mgr.c
index 522bd62c102e..8611adf3bb2e 100644
--- a/drivers/staging/ccree/ssi_request_mgr.c
+++ b/drivers/staging/ccree/ssi_request_mgr.c
@@ -376,7 +376,6 @@ int send_request(
rc = ssi_power_mgr_runtime_get(>plat_dev->dev);
if (rc != 0) {
SSI_LOG_ERR("ssi_power_mgr_runtime_get returned %x\n",rc);
-   spin_unlock_bh(_mgr_h->hw_lock);
return rc;
}
 #endif
-- 
2.11.0

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


Re: [PATCH] staging: vc04_services: Fix bulk cache maintenance

2017-05-10 Thread Phil Elwell
On 10/05/2017 10:06, Greg Kroah-Hartman wrote:
> On Wed, May 10, 2017 at 09:42:43AM +0100, Phil Elwell wrote:
>> On 04/05/2017 18:51, Stefan Wahren wrote:
>>>
 Phil Elwell  hat am 4. Mai 2017 um 11:58 geschrieben:


 vchiq_arm supports transfers less than one page and at arbitrary
 alignment, using the dma-mapping API to perform its cache maintenance
 (even though the VPU drives the DMA hardware). Read (DMA_FROM_DEVICE)
 operations use cache invalidation for speed, falling back to
 clean+invalidate on partial cache lines, with writes (DMA_TO_DEVICE)
 using flushes.

 If a read transfer has ends which aren't page-aligned, performing cache
 maintenance as if they were whole pages can lead to memory corruption
 since the partial cache lines at the ends (and any cache lines before or
 after the transfer area) will be invalidated. This bug was masked until
 the disabling of the cache flush in flush_dcache_page().

 Honouring the requested transfer start- and end-points prevents the
 corruption.

 Fixes: cf9caf192988 ("staging: vc04_services: Replace dmac_map_area with 
 dmac_map_sg")
 Signed-off-by: Phil Elwell 
>>>
>>> Reported-by: Stefan Wahren 
>>> Tested-by: Stefan Wahren 
>>>
>>> In order to clarify the context of this issue:
>>>
>>> http://lists.infradead.org/pipermail/linux-rpi-kernel/2017-April/006149.html
>>
>> Thanks, Stefan.
>>
>> Is there no feedback other on this patch? It's been in the rpi-4.11.y 
>> downstream
>> branch for a week now with favourable results - see issue
>> https://github.com/raspberrypi/linux/issues/1977 and pr
>> https://github.com/raspberrypi/linux/pull/1987.
> 
> It's the middle of the merge window, I can't do anything with this
> until after 4.12-rc1 comes out.  Please be patient...

Yes, of course - that's the kind of feedback I was looking for.

Thanks,

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


Re: [PATCH] staging: vc04_services: Fix bulk cache maintenance

2017-05-10 Thread Greg Kroah-Hartman
On Wed, May 10, 2017 at 09:42:43AM +0100, Phil Elwell wrote:
> On 04/05/2017 18:51, Stefan Wahren wrote:
> > 
> >> Phil Elwell  hat am 4. Mai 2017 um 11:58 geschrieben:
> >>
> >>
> >> vchiq_arm supports transfers less than one page and at arbitrary
> >> alignment, using the dma-mapping API to perform its cache maintenance
> >> (even though the VPU drives the DMA hardware). Read (DMA_FROM_DEVICE)
> >> operations use cache invalidation for speed, falling back to
> >> clean+invalidate on partial cache lines, with writes (DMA_TO_DEVICE)
> >> using flushes.
> >>
> >> If a read transfer has ends which aren't page-aligned, performing cache
> >> maintenance as if they were whole pages can lead to memory corruption
> >> since the partial cache lines at the ends (and any cache lines before or
> >> after the transfer area) will be invalidated. This bug was masked until
> >> the disabling of the cache flush in flush_dcache_page().
> >>
> >> Honouring the requested transfer start- and end-points prevents the
> >> corruption.
> >>
> >> Fixes: cf9caf192988 ("staging: vc04_services: Replace dmac_map_area with 
> >> dmac_map_sg")
> >> Signed-off-by: Phil Elwell 
> > 
> > Reported-by: Stefan Wahren 
> > Tested-by: Stefan Wahren 
> > 
> > In order to clarify the context of this issue:
> > 
> > http://lists.infradead.org/pipermail/linux-rpi-kernel/2017-April/006149.html
> 
> Thanks, Stefan.
> 
> Is there no feedback other on this patch? It's been in the rpi-4.11.y 
> downstream
> branch for a week now with favourable results - see issue
> https://github.com/raspberrypi/linux/issues/1977 and pr
> https://github.com/raspberrypi/linux/pull/1987.

It's the middle of the merge window, I can't do anything with this
until after 4.12-rc1 comes out.  Please be patient...

thanks,

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


From Sgt. Ralph Laura

2017-05-10 Thread Rose Guei
Nice to meet you , It's me Sgt. Ralph Laura from the South Eastern State of the 
United State (Kentucky) based in Kabul Afghanistan, I hope all is well with 
you? I am working with the United States Air Force peace keeping troop in 
Afghanistan, on war against terrorism. I have in my possession the sum of $3.9 
million ( three million Nine hundred thousand united states dollar ) Which i 
made here in Afghanistan.

I deposited this money with a Red Cross agent. I want you to stand as my 
beneficiary and receive the fund and keep it safe until am able to meet you. I 
am in an urgent need to move this box out from here because they are planning 
to move some troop out of Afghanistan and i am among, Now i am left with no 
option than to move this box to a safe place, that is why i contacted you and i 
believe in you.

You will assist me to invest in a good profitable venture, I will give you 30% 
of the fund for your assistance after you have receive the box as a way to show 
you my appreciation. Kindly reply back to me if you are willing to work with me 
so that i can send you the information where the money is been deposited, your 
urgent reply is needed. All i need from you is honest and trustworthy.

PLEASE DO NOT BETRAY ME AS I HUMBLY PLEADS WITH YOU

Yours faithfully
Sgt .Ralph Laura
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: vc04_services: Fix bulk cache maintenance

2017-05-10 Thread Phil Elwell
On 04/05/2017 18:51, Stefan Wahren wrote:
> 
>> Phil Elwell  hat am 4. Mai 2017 um 11:58 geschrieben:
>>
>>
>> vchiq_arm supports transfers less than one page and at arbitrary
>> alignment, using the dma-mapping API to perform its cache maintenance
>> (even though the VPU drives the DMA hardware). Read (DMA_FROM_DEVICE)
>> operations use cache invalidation for speed, falling back to
>> clean+invalidate on partial cache lines, with writes (DMA_TO_DEVICE)
>> using flushes.
>>
>> If a read transfer has ends which aren't page-aligned, performing cache
>> maintenance as if they were whole pages can lead to memory corruption
>> since the partial cache lines at the ends (and any cache lines before or
>> after the transfer area) will be invalidated. This bug was masked until
>> the disabling of the cache flush in flush_dcache_page().
>>
>> Honouring the requested transfer start- and end-points prevents the
>> corruption.
>>
>> Fixes: cf9caf192988 ("staging: vc04_services: Replace dmac_map_area with 
>> dmac_map_sg")
>> Signed-off-by: Phil Elwell 
> 
> Reported-by: Stefan Wahren 
> Tested-by: Stefan Wahren 
> 
> In order to clarify the context of this issue:
> 
> http://lists.infradead.org/pipermail/linux-rpi-kernel/2017-April/006149.html

Thanks, Stefan.

Is there no feedback other on this patch? It's been in the rpi-4.11.y downstream
branch for a week now with favourable results - see issue
https://github.com/raspberrypi/linux/issues/1977 and pr
https://github.com/raspberrypi/linux/pull/1987.

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


Re: [PATCH 0/3] staging: ccree: resolve checkpatch issues.

2017-05-10 Thread Gilad Ben-Yossef
On Sun, May 7, 2017 at 1:56 AM, Matthew Giassa  wrote:
> * Matthew Giassa  [2017-05-06 15:46:53 -0700]:
>
>
>> Included is a set of small fixes to resolve all outstanding checkpatch
>> warnings issues for drivers/staging/ccree/cc_hal.h. Two are cosmetic
>> (training whitespace and 80+ character comment), and the other is
>> functional (macro argument previously not wrapped in parentheses).
>>
>
> Forgot to mention, applies cleanly against staging-next
> (3ef2bc099d1cce09e2844467e2ced98e1a44609d).
>
For 2-3:

Acked-by: Gilad Ben-Yossef 

I saw GregKH already carries them in the staging-testing

About 1 - I never saw it and there isn't one in staging-testing either
so I'm assuming
I'm not the only only one that missed it. Can you please resend?

Thanks,
Gilad



-- 
Gilad Ben-Yossef
Chief Coffee Drinker

"If you take a class in large-scale robotics, can you end up in a
situation where the homework eats your dog?"
 -- Jean-Baptiste Queru
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel