[PATCH] staging: vchiq_arm: cast with __force as needed

2020-05-18 Thread Mitchell Tasman
In several cases where a pointer marked as __user is
(intentionally) assigned or passed to a non-marked target,
cast to the target pointer type with a __force directive
to quiet warnings from sparse.

Signed-off-by: Mitchell Tasman 
---
 .../vc04_services/interface/vchiq_arm/vchiq_2835_arm.c | 7 ---
 .../staging/vc04_services/interface/vchiq_arm/vchiq_arm.c  | 4 +++-
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c 
b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
index c18c6ca0b6c0..38a13e4618a8 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
@@ -371,14 +371,15 @@ create_pagelist(char __user *buf, size_t count, unsigned 
short type)
pagelistinfo->scatterlist = scatterlist;
pagelistinfo->scatterlist_mapped = 0;
 
-   if (is_vmalloc_addr(buf)) {
+   if (is_vmalloc_addr((void __force *)buf)) {
unsigned long length = count;
unsigned int off = offset;
 
for (actual_pages = 0; actual_pages < num_pages;
 actual_pages++) {
-   struct page *pg = vmalloc_to_page(buf + (actual_pages *
-PAGE_SIZE));
+   struct page *pg =
+   vmalloc_to_page((void __force *)(buf +
+(actual_pages * PAGE_SIZE)));
size_t bytes = PAGE_SIZE - off;
 
if (!pg) {
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 2d3e114f4a66..28ea8c3a4cba 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
@@ -1209,7 +1209,9 @@ vchiq_ioctl(struct file *file, unsigned int cmd, unsigned 
long arg)
 
/* The completion must point to the
** msgbuf. */
-   completion->header = msgbuf;
+   completion->header =
+   (struct vchiq_header __force *)
+   msgbuf;
}
 
if ((completion->reason ==
-- 
2.17.1

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


Re: [PATCH 2/4] staging: vt6656: vnt_beacon_xmit use extra_tx_headroom.

2020-05-18 Thread Malcolm Priestley




On 18/05/2020 13:39, Dan Carpenter wrote:

On Sat, May 16, 2020 at 11:39:34AM +0100, Malcolm Priestley wrote:

Create room for vnt_tx_short_buf_head in sk_buff and vnt_tx_usb_header.

The struct ieee80211_mgmt is not longer in the header and is at
the initial skb->data point.


I feel like the SubmittingPatches guidelines on verb tenses and not
saying "this patch" or "I" has got everyone so worried that it's like
playing Taboo.  Do you mean that the struct moved before or after we
aply *this patch*?
The struct has not moved, before skb->data was copied on to the address 
along with the rest of frame.


So now struct needs to be at skb->data.



Signed-off-by: Malcolm Priestley 


I can't understand the point of this patch at all.  Is it a fix or a
clean up?  If I had to guess from the subjec, I would say it's a
performance improvement but I don't know.
Well there is a performance improvement as there is only one buffer 
instead of two.


Mainly to bring into line with other drivers in the mac80211 tree there
is no need for a secondary buffer in driver.

Regards

Malcolm

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


Re: RTL8723BS driver doesn't work for,me but I can help testing

2020-05-18 Thread Martin Blumenstingl
Hi Tobias,

On Mon, May 18, 2020 at 7:59 AM Tobias Baumann <017623705...@o2online.de> wrote:
>
> hi martin
>
> i activate your patch ; wlan works ;  also with only  edit GPIOX_11 wlan
> works
>
> its now GPIO-402 out high ACTIVE_LOW  ( 3.3V on pin12)
great, thank you for doing the research!

did you find out if GPIOAO_6 is needed at all?
the 3.10 kernel enables it and sets it to HIGH. my understanding is
that you didn't change this one so the output is still LOW.
so I'm wondering if it is needed at all (I wouldn't be surprised if it
was not needed, these 3.10 kernel .dts files seem to be copy
from various vendors and do not necessarily reflect the actual
hardware setup inside the box)

> i also attached the performance infos  Wlan0->Router and RAM->SDHC
that's pretty good, great to see that it works fine for you :-)


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


Re: [PATCH] staging: rtl8192u: Merge almost duplicate code

2020-05-18 Thread Dan Carpenter
On Sun, May 17, 2020 at 09:25:05PM +0100, Pascal Terjan wrote:
> On Sun, 17 May 2020 at 17:58, Pascal Terjan  wrote:
> >
> > This causes a change in behaviour:
> > - stats also get updated when reordering, this seems like it should be
> >   the case but those lines were commented out.
> > - sub_skb NULL check now happens early in both cases, previously it
> >   happened only after dereferencing it 12 times, so it may not actually
> >   be needed.
> >
> 
> Hi,
> I actually noticed the same duplicated code (and same late NULL check)
> in drivers/staging/rtl8192e/rtllib_rx.c
> drivers/staging/rtl8712/rtl8712_recv.c has only one copy of the code
> but with the late NULL check
> drivers/staging/rtl8188eu/core/rtw_recv.c has only one copy of the
> code and doesn't do any NULL check
> 
> Now I wonder how to proceed. The code is not great so it would not
> feel right to make it reusable.
> Should I continue improving it on this driver only first (maybe trying
> to reuse ieee80211_data_to_8023_exthdr from net/wireless/util.c for
> example)?

It looks like the NULL check could be removed, but it's also fine to
keep it so long as it's not after a NULL dereference.

Do whatever you have the energy to do...  It would be nice if people who
fix bugs in these Realtek drivers would check the other drivers as well
but for cleanups basically everyone just works on one driver only.

regards,
dan carpenter

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


[PATCH v3] drivers: most: add USB adapter driver

2020-05-18 Thread Christian Gromm
This patch adds the usb driver source file most_usb.c and
modifies the Makefile and Kconfig accordingly.

Signed-off-by: Christian Gromm 
---
v2:
Reported-by: Greg Kroah-Hartman 
- don't remove usb driver from staging area
- don't touch staging/most/Kconfig
- remove subdirectory for USB driver and put source file into
  drivers/most
v3:
- submitted fixes found during code audit to staging version
  first to be able to resend single patch that adds the driver

 drivers/most/Kconfig|   12 +
 drivers/most/Makefile   |2 +
 drivers/most/most_usb.c | 1158 +++
 3 files changed, 1172 insertions(+)
 create mode 100644 drivers/most/most_usb.c

diff --git a/drivers/most/Kconfig b/drivers/most/Kconfig
index 58d7999..7b65320 100644
--- a/drivers/most/Kconfig
+++ b/drivers/most/Kconfig
@@ -13,3 +13,15 @@ menuconfig MOST
  module will be called most_core.
 
  If in doubt, say N here.
+
+if MOST
+config MOST_USB_HDM
+   tristate "USB"
+   depends on USB && NET
+   help
+ Say Y here if you want to connect via USB to network transceiver.
+ This device driver depends on the networking AIM.
+
+ To compile this driver as a module, choose M here: the
+ module will be called most_usb.
+endif
diff --git a/drivers/most/Makefile b/drivers/most/Makefile
index e810cd3..6a3cb90 100644
--- a/drivers/most/Makefile
+++ b/drivers/most/Makefile
@@ -2,3 +2,5 @@
 obj-$(CONFIG_MOST) += most_core.o
 most_core-y := core.o \
configfs.o
+
+obj-$(CONFIG_MOST_USB_HDM) += most_usb.o
diff --git a/drivers/most/most_usb.c b/drivers/most/most_usb.c
new file mode 100644
index 000..56b75e4
--- /dev/null
+++ b/drivers/most/most_usb.c
@@ -0,0 +1,1158 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * usb.c - Hardware dependent module for USB
+ *
+ * Copyright (C) 2013-2015 Microchip Technology Germany II GmbH & Co. KG
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define USB_MTU512
+#define NO_ISOCHRONOUS_URB 0
+#define AV_PACKETS_PER_XACT2
+#define BUF_CHAIN_SIZE 0x
+#define MAX_NUM_ENDPOINTS  30
+#define MAX_SUFFIX_LEN 10
+#define MAX_STRING_LEN 80
+#define MAX_BUF_SIZE   0x
+
+#define USB_VENDOR_ID_SMSC 0x0424  /* VID: SMSC */
+#define USB_DEV_ID_BRDG0xC001  /* PID: USB Bridge */
+#define USB_DEV_ID_OS81118 0xCF18  /* PID: USB OS81118 */
+#define USB_DEV_ID_OS81119 0xCF19  /* PID: USB OS81119 */
+#define USB_DEV_ID_OS81210 0xCF30  /* PID: USB OS81210 */
+/* DRCI Addresses */
+#define DRCI_REG_NI_STATE  0x0100
+#define DRCI_REG_PACKET_BW 0x0101
+#define DRCI_REG_NODE_ADDR 0x0102
+#define DRCI_REG_NODE_POS  0x0103
+#define DRCI_REG_MEP_FILTER0x0140
+#define DRCI_REG_HASH_TBL0 0x0141
+#define DRCI_REG_HASH_TBL1 0x0142
+#define DRCI_REG_HASH_TBL2 0x0143
+#define DRCI_REG_HASH_TBL3 0x0144
+#define DRCI_REG_HW_ADDR_HI0x0145
+#define DRCI_REG_HW_ADDR_MI0x0146
+#define DRCI_REG_HW_ADDR_LO0x0147
+#define DRCI_REG_BASE  0x1100
+#define DRCI_COMMAND   0x02
+#define DRCI_READ_REQ  0xA0
+#define DRCI_WRITE_REQ 0xA1
+
+/**
+ * struct most_dci_obj - Direct Communication Interface
+ * @kobj:position in sysfs
+ * @usb_device: pointer to the usb device
+ * @reg_addr: register address for arbitrary DCI access
+ */
+struct most_dci_obj {
+   struct device dev;
+   struct usb_device *usb_device;
+   u16 reg_addr;
+};
+
+#define to_dci_obj(p) container_of(p, struct most_dci_obj, dev)
+
+struct most_dev;
+
+struct clear_hold_work {
+   struct work_struct ws;
+   struct most_dev *mdev;
+   unsigned int channel;
+   int pipe;
+};
+
+#define to_clear_hold_work(w) container_of(w, struct clear_hold_work, ws)
+
+/**
+ * struct most_dev - holds all usb interface specific stuff
+ * @usb_device: pointer to usb device
+ * @iface: hardware interface
+ * @cap: channel capabilities
+ * @conf: channel configuration
+ * @dci: direct communication interface of hardware
+ * @ep_address: endpoint address table
+ * @description: device description
+ * @suffix: suffix for channel name
+ * @channel_lock: synchronize channel access
+ * @padding_active: indicates channel uses padding
+ * @is_channel_healthy: health status table of each channel
+ * @busy_urbs: list of anchored items
+ * @io_mutex: synchronize I/O with disconnect
+ * @link_stat_timer: timer for link status reports
+ * @poll_work_obj: work for polling link status
+ */
+struct most_dev {
+   struct device dev;
+   struct usb_device *usb_device;
+   struct most_interface iface;
+   struct most_channel_capability *cap;
+   struct most_channel_config *conf;
+   struct 

Re: [PATCH 2/4] staging: vt6656: vnt_beacon_xmit use extra_tx_headroom.

2020-05-18 Thread Dan Carpenter
On Sat, May 16, 2020 at 11:39:34AM +0100, Malcolm Priestley wrote:
> Create room for vnt_tx_short_buf_head in sk_buff and vnt_tx_usb_header.
> 
> The struct ieee80211_mgmt is not longer in the header and is at
> the initial skb->data point.

I feel like the SubmittingPatches guidelines on verb tenses and not
saying "this patch" or "I" has got everyone so worried that it's like
playing Taboo.  Do you mean that the struct moved before or after we
aply *this patch*?

> 
> Signed-off-by: Malcolm Priestley 

I can't understand the point of this patch at all.  Is it a fix or a
clean up?  If I had to guess from the subjec, I would say it's a
performance improvement but I don't know.

regards,
dan carpenter


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


Re: [RFC PATCH] staging: rtl8192u: indicate_packets() can be static

2020-05-18 Thread Dan Carpenter
On Sun, May 17, 2020 at 01:49:50PM -0700, Joe Perches wrote:
> On Mon, 2020-05-18 at 04:22 +0800, kbuild test robot wrote:
> > Signed-off-by: kbuild test robot 
> > ---
> 
> This doesn't apply on Linus' tree or -next so perhaps the
> robot should put what tree and branch patches like these
> are meant to be applied on after the --- line
> 

It's supposed to apply on top of the email which it is replying to.

regards,
dan carpenter

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


[PATCH v3] staging: wfx: Typo fix

2020-05-18 Thread Mohamed Dawod
Fixing some typo errors in traces.h file

Signed-off-by: Mohamed Dawod 
---

Chagnes in v2:
  - Modifying the mail subject and the commit message
Chagnes in v1:
  - Fixing some typo errors in wfx/traces.h file  

 drivers/staging/wfx/traces.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wfx/traces.h b/drivers/staging/wfx/traces.h
index bb9f7e9..80e131c 100644
--- a/drivers/staging/wfx/traces.h
+++ b/drivers/staging/wfx/traces.h
@@ -32,16 +32,16 @@
  * xxx_name(XXX)   \
  * ...
  *
- *   3. Instanciate that list_names:
+ *   3. Instantiate that list_names:
  *
  *  list_names
  *
- *   4. Redefine xxx_name() as a entry of array for __print_symbolic()
+ *   4. Redefine xxx_name() as an entry of array for __print_symbolic()
  *
  *  #undef xxx_name
  *  #define xxx_name(msg) { msg, #msg },
  *
- *   5. list_name can now nearlu be used with __print_symbolic() but,
+ *   5. list_name can now nearly be used with __print_symbolic() but,
  *  __print_symbolic() dislike last comma of list. So we define a new list
  *  with a dummy element:
  *
-- 
2.7.4

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


Re: RTL8723BS driver doesn't work for,me but I can help testing

2020-05-18 Thread Tobias Baumann

hi martin

i activate your patch ; wlan works ;  also with only  edit GPIOX_11 wlan 
works


its now GPIO-402 out high ACTIVE_LOW  ( 3.3V on pin12)

i also attached the performance infos  Wlan0->Router and RAM->SDHC

Am 18.05.2020 um 00:31 schrieb Martin Blumenstingl:

Hi Tobias,

On Sun, May 17, 2020 at 11:05 PM Tobias Baumann
<017623705...@o2online.de> wrote:

hi martin

sorry for cc -problem it was my fault in thunderbird

thanks for dtb file but this file has problem kernel stop with

[6.122092] mmc0: new high speed SDIO card at address 0001
[   35.804258] VCCK: disabling
[   35.808781] platform pwmleds: deferred probe pending
[   35.812625] platform sound: deferred probe pending

pwmleds was also there in your last dmesg
please ignore the sound part, I haven't tested it on that particular
board in a while



[  215.804295] random: crng init done

(last time deferred probe was gcc problem )

please can you provide me with dts file and i complile at my linux box
or maybe only the change line and i use the dtb from image and edit the
lines like the usb patch

you can get all my patches from here: [0]
as always: some of them are not even in linux-next yet and there's a
reason for that ;-)
I have changed the GPIO_ACTIVE_* polarity for the two GPIOs in the
sdio_pwrseq node if you want to do that by yourself.


Best regards,
Martin


[0] https://github.com/xdarklight/linux/tree/meson-mx-integration-5.8-20200517




--
Diese E-Mail wurde von AVG auf Viren geprüft.
http://www.avg.com

root@vegas812 ~# iperf -c 192.168.2.50 -p 4711

Client connecting to 192.168.2.50, TCP port 4711
TCP window size: 20.7 KByte (default)

[  3] local 192.168.2.20 port 50577 connected with 192.168.2.50 port 4711
[ ID] Interval   Transfer Bandwidth
[  3]  0.0-10.0 sec  54.1 MBytes  45.2 Mbits/sec
root@vegas812 ~# dd if=/dev/zero of=/root/testfile bs=512M count=1 oflag=direct
1+0 records in
1+0 records out
536870912 bytes (537 MB, 512 MiB) copied, 56.6048 s, 9.5 MB/s
root@aml-s812:~# iperf -c 192.168.2.50 -p 4711

Client connecting to 192.168.2.50, TCP port 4711
TCP window size: 43.8 KByte (default)

[  3] local 192.168.2.20 port 34540 connected with 192.168.2.50 port 4711
[ ID] Interval   Transfer Bandwidth
[  3]  0.0-10.2 sec  44.6 MBytes  36.7 Mbits/sec
root@aml-s812:~#
root@aml-s812:~# dd if=/dev/zero of=/root/testfile bs=512M count=1 oflag=direct
1+0 records in
1+0 records out
536870912 bytes (537 MB, 512 MiB) copied, 75,8365 s, 7,1 MB/s
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel