Re: [PATCH 06/10] staging: greybus: spilib: use 'spi_delay_to_ns' for getting xfer delay

2021-03-09 Thread Rui Miguel Silva
Hi,
On Tue, Mar 09, 2021 at 09:58:09AM +0530, Viresh Kumar wrote:
> On 08-03-21, 16:54, Alexandru Ardelean wrote:
> > The intent is the removal of the 'delay_usecs' field from the
> > spi_transfer struct, as there is a 'delay' field that does the same
> > thing.
> > 
> > The spi_delay_to_ns() can be used to get the transfer delay. It works by
> > using the 'delay_usecs' field first (if it is non-zero), and finally
> > uses the 'delay' field.
> > 
> > Since the 'delay_usecs' field is going away, this change makes use of the
> > spi_delay_to_ns() function. This also means dividing the return value of
> > the function by 1000, to convert it to microseconds.
> > To prevent any potential faults when converting to microseconds and since
> > the result of spi_delay_to_ns() is int, the delay is being computed in 32
> > bits and then clamped between 0 & U16_MAX.
> > 
> > Signed-off-by: Alexandru Ardelean 
> > ---
> >  drivers/staging/greybus/spilib.c | 5 -
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/staging/greybus/spilib.c 
> > b/drivers/staging/greybus/spilib.c
> > index 672d540d3365..30655153df6a 100644
> > --- a/drivers/staging/greybus/spilib.c
> > +++ b/drivers/staging/greybus/spilib.c
> > @@ -245,6 +245,7 @@ static struct gb_operation 
> > *gb_spi_operation_create(struct gb_spilib *spi,
> > /* Fill in the transfers array */
> > xfer = spi->first_xfer;
> > while (msg->state != GB_SPI_STATE_OP_DONE) {
> > +   int xfer_delay;
> > if (xfer == spi->last_xfer)
> > xfer_len = spi->last_xfer_size;
> > else
> > @@ -259,7 +260,9 @@ static struct gb_operation 
> > *gb_spi_operation_create(struct gb_spilib *spi,
> >  
> > gb_xfer->speed_hz = cpu_to_le32(xfer->speed_hz);
> > gb_xfer->len = cpu_to_le32(xfer_len);
> > -   gb_xfer->delay_usecs = cpu_to_le16(xfer->delay_usecs);
> > +   xfer_delay = spi_delay_to_ns(&xfer->delay, xfer) / 1000;
> > +   xfer_delay = clamp_t(u16, xfer_delay, 0, U16_MAX);
> > +   gb_xfer->delay_usecs = cpu_to_le16(xfer_delay);
> > gb_xfer->cs_change = xfer->cs_change;
> > gb_xfer->bits_per_word = xfer->bits_per_word;
> 
> Acked-by: Viresh Kumar 

Acked-by: Rui Miguel Silva 

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


Re: [PATCH v7 11/11] pwm: Add Raspberry Pi Firmware based PWM bus

2021-03-09 Thread Nicolas Saenz Julienne
On Mon, 2021-01-18 at 13:32 +0100, Nicolas Saenz Julienne wrote:
> Adds support to control the PWM bus available in official Raspberry Pi
> PoE HAT. Only RPi's co-processor has access to it, so commands have to
> be sent through RPi's firmware mailbox interface.
> 
> Signed-off-by: Nicolas Saenz Julienne 
> 
> ---

ping :)

> Changes since v6:
> - Use %pe
> - Round divisions properly
> - Use dev_err_probe()
> - Pass check_patch
> 
> Changes since v3:
>  - Rename compatible string to be more explicit WRT to bus's limitations
> 
> Changes since v2:
>  - Use devm_rpi_firmware_get()
>  - Rename driver
>  - Small cleanups
> 
> Changes since v1:
>  - Use default pwm bindings and get rid of xlate() function
>  - Correct spelling errors
>  - Correct apply() function
>  - Round values
>  - Fix divisions in arm32 mode
>  - Small cleanups
> 
>  drivers/pwm/Kconfig   |   9 ++
>  drivers/pwm/Makefile  |   1 +
>  drivers/pwm/pwm-raspberrypi-poe.c | 220 ++
>  3 files changed, 230 insertions(+)
>  create mode 100644 drivers/pwm/pwm-raspberrypi-poe.c
> 
> diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig
> index 0937e1c047ac..75e2344703b3 100644
> --- a/drivers/pwm/Kconfig
> +++ b/drivers/pwm/Kconfig
> @@ -423,6 +423,15 @@ config PWM_PXA
>     To compile this driver as a module, choose M here: the module
>     will be called pwm-pxa.
>  
> 
> +config PWM_RASPBERRYPI_POE
> + tristate "Raspberry Pi Firwmware PoE Hat PWM support"
> + # Make sure not 'y' when RASPBERRYPI_FIRMWARE is 'm'. This can only
> + # happen when COMPILE_TEST=y, hence the added !RASPBERRYPI_FIRMWARE.
> + depends on RASPBERRYPI_FIRMWARE || (COMPILE_TEST && 
> !RASPBERRYPI_FIRMWARE)
> + help
> +   Enable Raspberry Pi firmware controller PWM bus used to control the
> +   official RPI PoE hat
> +
>  config PWM_RCAR
>   tristate "Renesas R-Car PWM support"
>   depends on ARCH_RENESAS || COMPILE_TEST
> diff --git a/drivers/pwm/Makefile b/drivers/pwm/Makefile
> index 18b89d7fd092..ed28d7bd4c64 100644
> --- a/drivers/pwm/Makefile
> +++ b/drivers/pwm/Makefile
> @@ -38,6 +38,7 @@ obj-$(CONFIG_PWM_MXS)   += pwm-mxs.o
>  obj-$(CONFIG_PWM_OMAP_DMTIMER)   += pwm-omap-dmtimer.o
>  obj-$(CONFIG_PWM_PCA9685)+= pwm-pca9685.o
>  obj-$(CONFIG_PWM_PXA)+= pwm-pxa.o
> +obj-$(CONFIG_PWM_RASPBERRYPI_POE)+= pwm-raspberrypi-poe.o
>  obj-$(CONFIG_PWM_RCAR)   += pwm-rcar.o
>  obj-$(CONFIG_PWM_RENESAS_TPU)+= pwm-renesas-tpu.o
>  obj-$(CONFIG_PWM_ROCKCHIP)   += pwm-rockchip.o
> diff --git a/drivers/pwm/pwm-raspberrypi-poe.c 
> b/drivers/pwm/pwm-raspberrypi-poe.c
> new file mode 100644
> index ..ca845e8fabe6
> --- /dev/null
> +++ b/drivers/pwm/pwm-raspberrypi-poe.c
> @@ -0,0 +1,220 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright 2020 Nicolas Saenz Julienne 
> + * For more information on Raspberry Pi's PoE hat see:
> + * https://www.raspberrypi.org/products/poe-hat/
> + *
> + * Limitations:
> + *  - No disable bit, so a disabled PWM is simulated by duty_cycle 0
> + *  - Only normal polarity
> + *  - Fixed 12.5 kHz period
> + *
> + * The current period is completed when HW is reconfigured.
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +#include 
> +
> +#define RPI_PWM_MAX_DUTY 255
> +#define RPI_PWM_PERIOD_NS8 /* 12.5 kHz */
> +
> +#define RPI_PWM_CUR_DUTY_REG 0x0
> +#define RPI_PWM_DEF_DUTY_REG 0x1
> +
> +struct raspberrypi_pwm {
> + struct rpi_firmware *firmware;
> + struct pwm_chip chip;
> + unsigned int duty_cycle;
> +};
> +
> +struct raspberrypi_pwm_prop {
> + __le32 reg;
> + __le32 val;
> + __le32 ret;
> +} __packed;
> +
> +static inline
> +struct raspberrypi_pwm *raspberrypi_pwm_from_chip(struct pwm_chip *chip)
> +{
> + return container_of(chip, struct raspberrypi_pwm, chip);
> +}
> +
> +static int raspberrypi_pwm_set_property(struct rpi_firmware *firmware,
> + u32 reg, u32 val)
> +{
> + struct raspberrypi_pwm_prop msg = {
> + .reg = cpu_to_le32(reg),
> + .val = cpu_to_le32(val),
> + };
> + int ret;
> +
> + ret = rpi_firmware_property(firmware, RPI_FIRMWARE_SET_POE_HAT_VAL,
> + &msg, sizeof(msg));
> + if (ret)
> + return ret;
> + if (msg.ret)
> + return -EIO;
> +
> + return 0;
> +}
> +
> +static int raspberrypi_pwm_get_property(struct rpi_firmware *firmware,
> + u32 reg, u32 *val)
> +{
> + struct raspberrypi_pwm_prop msg = {
> + .reg = reg
> + };
> + int ret;
> +
> + ret = rpi_firmware_property(firmware, RPI_FIRMWARE_GET_POE_HAT_VAL,
> + &msg, sizeof(msg));
> + if (ret)
> + return ret;
> + if (msg.ret)
> + return -EIO;
> +

[PATCH v3 0/2] Submission of XillyUSB driver

2021-03-09 Thread eli . billauer
From: Eli Billauer 

This is a resubmission of the XillyUSB driver, which is the USB
variant of the existing Xillybus driver.

Because these driver share some API related functions, this submission
consists of two patches:

(1) A patch moving away Xillybus' class related functions to a
separate module file.
(2) A patch adding the new XillyUSB driver, based upon this new
separate module.

As far as I can tell, the shared code between the Xillybus and XillyUSB
drivers covers everything that makes sense to share. I submit XillyUSB as a
staging driver, with the hope for a detailed review on this issue, as well
as a general code audit.

Thanks,
   Eli

Eli Billauer (2):
  char: xillybus: Move class-related functions to new xillybus_class.c
  staging: Add driver for XillyUSB (Xillybus variant for USB)

 MAINTAINERS|1 +
 drivers/char/xillybus/Kconfig  |4 +
 drivers/char/xillybus/Makefile |1 +
 drivers/char/xillybus/xillybus.h   |   10 +-
 drivers/char/xillybus/xillybus_class.c |  263 +++
 drivers/char/xillybus/xillybus_core.c  |  181 +-
 drivers/staging/Kconfig|2 +
 drivers/staging/Makefile   |1 +
 drivers/staging/xillyusb/Kconfig   |   20 +
 drivers/staging/xillyusb/Makefile  |6 +
 drivers/staging/xillyusb/TODO  |   13 +
 drivers/staging/xillyusb/xillyusb.c| 2184 
 include/linux/xillybus_class.h |   30 +
 13 files changed, 2549 insertions(+), 167 deletions(-)
 create mode 100644 drivers/char/xillybus/xillybus_class.c
 create mode 100644 drivers/staging/xillyusb/Kconfig
 create mode 100644 drivers/staging/xillyusb/Makefile
 create mode 100644 drivers/staging/xillyusb/TODO
 create mode 100644 drivers/staging/xillyusb/xillyusb.c
 create mode 100644 include/linux/xillybus_class.h

-- 
2.17.1

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


[PATCH v3 1/2] char: xillybus: Move class-related functions to new xillybus_class.c

2021-03-09 Thread eli . billauer
From: Eli Billauer 

This patch is a preparation for adding another related driver, XillyUSB.
In order to share some code between the existing Xillybus driver and the
one to be added, some functions are moved to xillybus_class.c

The header file, xillybus_class.h, is temporarily placed in include/linux/,
because the new XillyUSB driver is intended as a staging driver for the
time being.

Signed-off-by: Eli Billauer 
---

Notes:
Changelog:

This patch did not exist prior to v3.

 drivers/char/xillybus/Kconfig  |   4 +
 drivers/char/xillybus/Makefile |   1 +
 drivers/char/xillybus/xillybus.h   |  10 +-
 drivers/char/xillybus/xillybus_class.c | 263 +
 drivers/char/xillybus/xillybus_core.c  | 181 +++--
 include/linux/xillybus_class.h |  30 +++
 6 files changed, 322 insertions(+), 167 deletions(-)
 create mode 100644 drivers/char/xillybus/xillybus_class.c
 create mode 100644 include/linux/xillybus_class.h

diff --git a/drivers/char/xillybus/Kconfig b/drivers/char/xillybus/Kconfig
index 130dbdce858f..e7800f025249 100644
--- a/drivers/char/xillybus/Kconfig
+++ b/drivers/char/xillybus/Kconfig
@@ -3,10 +3,14 @@
 # Xillybus devices
 #
 
+config XILLYBUS_CLASS
+   tristate
+
 config XILLYBUS
tristate "Xillybus generic FPGA interface"
depends on PCI || OF
select CRC32
+   select XILLYBUS_CLASS
help
  Xillybus is a generic interface for peripherals designed on
  programmable logic (FPGA). The driver probes the hardware for
diff --git a/drivers/char/xillybus/Makefile b/drivers/char/xillybus/Makefile
index 099e9a3585fc..591615264591 100644
--- a/drivers/char/xillybus/Makefile
+++ b/drivers/char/xillybus/Makefile
@@ -3,6 +3,7 @@
 # Makefile for Xillybus driver
 #
 
+obj-$(CONFIG_XILLYBUS_CLASS)   += xillybus_class.o
 obj-$(CONFIG_XILLYBUS) += xillybus_core.o
 obj-$(CONFIG_XILLYBUS_PCIE)+= xillybus_pcie.o
 obj-$(CONFIG_XILLYBUS_OF)  += xillybus_of.o
diff --git a/drivers/char/xillybus/xillybus.h b/drivers/char/xillybus/xillybus.h
index 8e3ed4d1bb7f..c63ffc56637c 100644
--- a/drivers/char/xillybus/xillybus.h
+++ b/drivers/char/xillybus/xillybus.h
@@ -30,7 +30,8 @@ struct xilly_buffer {
 
 struct xilly_idt_handle {
unsigned char *chandesc;
-   unsigned char *idt;
+   unsigned char *names;
+   int names_len;
int entries;
 };
 
@@ -94,7 +95,6 @@ struct xilly_endpoint {
struct device *dev;
struct xilly_endpoint_hardware *ephw;
 
-   struct list_head ep_list;
int dma_using_dac; /* =1 if 64-bit DMA is used, =0 otherwise. */
__iomem void *registers;
int fatal_error;
@@ -102,12 +102,6 @@ struct xilly_endpoint {
struct mutex register_mutex;
wait_queue_head_t ep_wait;
 
-   /* Channels and message handling */
-   struct cdev cdev;
-
-   int major;
-   int lowest_minor; /* Highest minor = lowest_minor + num_channels - 1 */
-
int num_channels; /* EXCLUDING message buffer */
struct xilly_channel **channels;
int msg_counter;
diff --git a/drivers/char/xillybus/xillybus_class.c 
b/drivers/char/xillybus/xillybus_class.c
new file mode 100644
index ..f3cfb76623c8
--- /dev/null
+++ b/drivers/char/xillybus/xillybus_class.c
@@ -0,0 +1,263 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright 2021 Xillybus Ltd, http://xillybus.com
+ *
+ * Driver for the Xillybus class
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+MODULE_DESCRIPTION("Driver for Xillybus class");
+MODULE_AUTHOR("Eli Billauer, Xillybus Ltd.");
+MODULE_VERSION("1.0");
+MODULE_ALIAS("xillybus_class");
+MODULE_LICENSE("GPL v2");
+
+static DEFINE_MUTEX(unit_mutex);
+static LIST_HEAD(unit_list);
+static struct class *xillybus_class;
+
+#define UNITNAMELEN 16
+
+struct xilly_unit {
+   struct list_head list_entry;
+   void *private_data;
+
+   struct cdev *cdev;
+   char name[UNITNAMELEN];
+   int major;
+   int lowest_minor;
+   int num_nodes;
+};
+
+int xillybus_init_chrdev(struct device *dev,
+const struct file_operations *fops,
+struct module *owner,
+void *private_data,
+unsigned char *idt, unsigned int len,
+int num_nodes,
+const char *prefix, bool enumerate)
+{
+   int rc;
+   dev_t mdev;
+   int i;
+   char devname[48];
+
+   struct device *device;
+   size_t namelen;
+   struct xilly_unit *unit, *u;
+
+   unit = kzalloc(sizeof(*unit), GFP_KERNEL);
+
+   if (!unit)
+   return -ENOMEM;
+
+   mutex_lock(&unit_mutex);
+
+   if (!enumerate)
+   snprintf(unit->name, UNITNAMELEN, "%s", prefix);
+
+   for (i = 0; enumerate; i++) {
+   snprintf(unit->name, UNITNAMELEN, "%s_%02d",
+  

[PATCH v3 2/2] staging: Add driver for XillyUSB (Xillybus variant for USB)

2021-03-09 Thread eli . billauer
From: Eli Billauer 

The XillyUSB driver is the USB variant for the Xillybus FPGA IP core.
Even though it presents a nearly identical API on the FPGA and host,
it's almost a complete rewrite of the driver: The framework for exchanging
data on a USB bus is fundamentally different from doing the same with a
PCIe interface, which leaves very little in common between the existing
driver and the new one for XillyUSB.

Signed-off-by: Eli Billauer 
---

Notes:
Changelog:
v3:
  - Move to staging
  - Rely on xillybus_class for device file operations
  - Fix no return value bug in xillyusb_discovery()
  - Add module parameters for URB buffer size and count

v2:
  - Add comment in Kconfig file, saying XILLYUSB really doesn't depend
on XILLYBUS (following comment by Randy Dunlap)
  - Use SEEK_* predefined constants instead of numbers

 MAINTAINERS |1 +
 drivers/staging/Kconfig |2 +
 drivers/staging/Makefile|1 +
 drivers/staging/xillyusb/Kconfig|   20 +
 drivers/staging/xillyusb/Makefile   |6 +
 drivers/staging/xillyusb/TODO   |   13 +
 drivers/staging/xillyusb/xillyusb.c | 2184 +++
 7 files changed, 2227 insertions(+)
 create mode 100644 drivers/staging/xillyusb/Kconfig
 create mode 100644 drivers/staging/xillyusb/Makefile
 create mode 100644 drivers/staging/xillyusb/TODO
 create mode 100644 drivers/staging/xillyusb/xillyusb.c

diff --git a/MAINTAINERS b/MAINTAINERS
index d92f85ca831d..1bf73b132e31 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -19749,6 +19749,7 @@ M:  Eli Billauer 
 L: linux-ker...@vger.kernel.org
 S: Supported
 F: drivers/char/xillybus/
+F: drivers/staging/xillyusb/
 
 XLP9XX I2C DRIVER
 M: George Cherian 
diff --git a/drivers/staging/Kconfig b/drivers/staging/Kconfig
index b22f73d7bfc4..6fcbc6f90224 100644
--- a/drivers/staging/Kconfig
+++ b/drivers/staging/Kconfig
@@ -114,4 +114,6 @@ source "drivers/staging/wfx/Kconfig"
 
 source "drivers/staging/hikey9xx/Kconfig"
 
+source "drivers/staging/xillyusb/Kconfig"
+
 endif # STAGING
diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile
index 2245059e69c7..42dfd6a4ca28 100644
--- a/drivers/staging/Makefile
+++ b/drivers/staging/Makefile
@@ -47,3 +47,4 @@ obj-$(CONFIG_QLGE)+= qlge/
 obj-$(CONFIG_WIMAX)+= wimax/
 obj-$(CONFIG_WFX)  += wfx/
 obj-y  += hikey9xx/
+obj-$(CONFIG_XILLYUSB) += xillyusb/
diff --git a/drivers/staging/xillyusb/Kconfig b/drivers/staging/xillyusb/Kconfig
new file mode 100644
index ..af7251104b42
--- /dev/null
+++ b/drivers/staging/xillyusb/Kconfig
@@ -0,0 +1,20 @@
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# XillyUSB devices
+#
+
+config XILLYUSB
+   tristate "Xillybus generic FPGA interface for USB"
+   depends on USB
+   select CRC32
+   select XILLYBUS_CLASS
+   help
+ XillyUSB is the Xillybus variant which uses USB for communicating
+ with the FPGA.
+
+ Xillybus is a generic interface for peripherals designed on
+ programmable logic (FPGA). The driver probes the hardware for
+ its capabilities, and creates device files accordingly.
+
+ Set to M if you want Xillybus to use USB for communicating with
+ the FPGA.
diff --git a/drivers/staging/xillyusb/Makefile 
b/drivers/staging/xillyusb/Makefile
new file mode 100644
index ..1b45211992f5
--- /dev/null
+++ b/drivers/staging/xillyusb/Makefile
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# Makefile for XillyUSB driver
+#
+
+obj-$(CONFIG_XILLYUSB) += xillyusb.o
diff --git a/drivers/staging/xillyusb/TODO b/drivers/staging/xillyusb/TODO
new file mode 100644
index ..0cb6a005ada4
--- /dev/null
+++ b/drivers/staging/xillyusb/TODO
@@ -0,0 +1,13 @@
+XillyUSB driver
+===
+
+This driver is the USB counterpart for the driver at drivers/char/xillybus/.
+See Documentation/driver-api/xillybus.rst.
+
+TODO
+
+  - Enhance code reuse with the existing Xillybus driver.
+
+  - General code review.
+
+Patches to: Eli Billauer 
\ No newline at end of file
diff --git a/drivers/staging/xillyusb/xillyusb.c 
b/drivers/staging/xillyusb/xillyusb.c
new file mode 100644
index ..bcf55c1a380d
--- /dev/null
+++ b/drivers/staging/xillyusb/xillyusb.c
@@ -0,0 +1,2184 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright 2020 Xillybus Ltd, http://xillybus.com
+ *
+ * Driver for the XillyUSB FPGA/host framework.
+ *
+ * This driver interfaces with a special IP core in an FPGA, setting up
+ * a pipe between a hardware FIFO in the programmable logic and a device
+ * file in the host. The number of such pipes and their attributes are
+ * set up on the logic. This driver detects these automatically and
+ * creates the device files accordingly.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 

[PATCH] staging: rtl8712: fixed whitespace coding style issue

2021-03-09 Thread Selvakumar Elangovan
Removed additional whitspaces and added space around the binary operator in the 
rtl8712_xmit.h file

Signed-off-by: Selvakumar Elangovan 
---
 drivers/staging/rtl8712/rtl8712_xmit.h | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl8712_xmit.h 
b/drivers/staging/rtl8712/rtl8712_xmit.h
index 0b56bd3ac4d0..5cd651a0de75 100644
--- a/drivers/staging/rtl8712/rtl8712_xmit.h
+++ b/drivers/staging/rtl8712/rtl8712_xmit.h
@@ -36,10 +36,8 @@
 #define MAX_AMSDU_XMITBUF_SZ 8704
 #define MAX_TXAGG_XMITBUF_SZ 16384 /*16k*/
 
-
 #define tx_cmd tx_desc
 
-
 /*
  *defined for TX DESC Operation
  */
@@ -89,10 +87,9 @@ struct tx_desc {
__le32 txdw7;
 };
 
-
 union txdesc {
struct tx_desc txdesc;
-   unsigned int value[TXDESC_SIZE>>2];
+   unsigned int value[TXDESC_SIZE >> 2];
 };
 
 int r8712_xmitframe_complete(struct _adapter *padapter,
-- 
2.17.1

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


[PATCH] staging: rtl8712: fixed whitespace coding style issue

2021-03-09 Thread Selvakumar Elangovan
Removed additional whitspaces and added space around the binary operator in the 
rtl8712_xmit.h file

Signed-off-by: Selvakumar Elangovan 
---
 drivers/staging/rtl8712/rtl8712_xmit.h | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl8712_xmit.h 
b/drivers/staging/rtl8712/rtl8712_xmit.h
index 0b56bd3ac4d0..5cd651a0de75 100644
--- a/drivers/staging/rtl8712/rtl8712_xmit.h
+++ b/drivers/staging/rtl8712/rtl8712_xmit.h
@@ -36,10 +36,8 @@
 #define MAX_AMSDU_XMITBUF_SZ 8704
 #define MAX_TXAGG_XMITBUF_SZ 16384 /*16k*/
 
-
 #define tx_cmd tx_desc
 
-
 /*
  *defined for TX DESC Operation
  */
@@ -89,10 +87,9 @@ struct tx_desc {
__le32 txdw7;
 };
 
-
 union txdesc {
struct tx_desc txdesc;
-   unsigned int value[TXDESC_SIZE>>2];
+   unsigned int value[TXDESC_SIZE >> 2];
 };
 
 int r8712_xmitframe_complete(struct _adapter *padapter,
-- 
2.17.1

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


Re: [PATCH 06/10] staging: greybus: spilib: use 'spi_delay_to_ns' for getting xfer delay

2021-03-09 Thread Greg KH
On Mon, Mar 08, 2021 at 04:54:58PM +0200, Alexandru Ardelean wrote:
> The intent is the removal of the 'delay_usecs' field from the
> spi_transfer struct, as there is a 'delay' field that does the same
> thing.
> 
> The spi_delay_to_ns() can be used to get the transfer delay. It works by
> using the 'delay_usecs' field first (if it is non-zero), and finally
> uses the 'delay' field.
> 
> Since the 'delay_usecs' field is going away, this change makes use of the
> spi_delay_to_ns() function. This also means dividing the return value of
> the function by 1000, to convert it to microseconds.
> To prevent any potential faults when converting to microseconds and since
> the result of spi_delay_to_ns() is int, the delay is being computed in 32
> bits and then clamped between 0 & U16_MAX.
> 
> Signed-off-by: Alexandru Ardelean 
> ---
>  drivers/staging/greybus/spilib.c | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/greybus/spilib.c 
> b/drivers/staging/greybus/spilib.c
> index 672d540d3365..30655153df6a 100644
> --- a/drivers/staging/greybus/spilib.c
> +++ b/drivers/staging/greybus/spilib.c
> @@ -245,6 +245,7 @@ static struct gb_operation 
> *gb_spi_operation_create(struct gb_spilib *spi,
>   /* Fill in the transfers array */
>   xfer = spi->first_xfer;
>   while (msg->state != GB_SPI_STATE_OP_DONE) {
> + int xfer_delay;
>   if (xfer == spi->last_xfer)
>   xfer_len = spi->last_xfer_size;
>   else
> @@ -259,7 +260,9 @@ static struct gb_operation 
> *gb_spi_operation_create(struct gb_spilib *spi,
>  
>   gb_xfer->speed_hz = cpu_to_le32(xfer->speed_hz);
>   gb_xfer->len = cpu_to_le32(xfer_len);
> - gb_xfer->delay_usecs = cpu_to_le16(xfer->delay_usecs);
> + xfer_delay = spi_delay_to_ns(&xfer->delay, xfer) / 1000;
> + xfer_delay = clamp_t(u16, xfer_delay, 0, U16_MAX);
> + gb_xfer->delay_usecs = cpu_to_le16(xfer_delay);
>   gb_xfer->cs_change = xfer->cs_change;
>   gb_xfer->bits_per_word = xfer->bits_per_word;
>  

Acked-by: Greg Kroah-Hartman 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: wfx: remove unused included header files

2021-03-09 Thread Greg KH
On Thu, Mar 04, 2021 at 10:43:45AM +0100, Jérôme Pouiller wrote:
> Hello Greg,
> 
> On Tuesday 2 March 2021 16:01:25 CET Jérôme Pouiller wrote:
> > Hello Muhammad,
> > 
> > Sorry, I am a bit late for the review of this patch. Thank you for your 
> > contribution.
> > 
> > On Thursday 11 February 2021 15:36:37 CET Muhammad Usama Anjum wrote:
> > > 
> > > Many header files have been included, but never used. Those header
> > > files have been removed.
> > > 
> > > Signed-off-by: Muhammad Usama Anjum 
> > > ---
> > >  drivers/staging/wfx/bh.c  | 1 -
> > >  drivers/staging/wfx/bh.h  | 4 
> > >  drivers/staging/wfx/bus.h | 3 ---
> > >  drivers/staging/wfx/bus_sdio.c| 6 --
> > >  drivers/staging/wfx/bus_spi.c | 7 ---
> > >  drivers/staging/wfx/data_rx.c | 5 -
> > >  drivers/staging/wfx/data_tx.c | 5 -
> > >  drivers/staging/wfx/data_tx.h | 3 ---
> > >  drivers/staging/wfx/debug.c   | 6 --
> > >  drivers/staging/wfx/fwio.c| 2 --
> > >  drivers/staging/wfx/hif_api_cmd.h | 4 
> > >  drivers/staging/wfx/hif_api_general.h | 9 -
> > >  drivers/staging/wfx/hif_tx.c  | 4 
> > >  drivers/staging/wfx/hif_tx_mib.c  | 5 -
> > >  drivers/staging/wfx/hwio.c| 3 ---
> > >  drivers/staging/wfx/hwio.h| 2 --
> > >  drivers/staging/wfx/key.c | 2 --
> > >  drivers/staging/wfx/key.h | 2 --
> > >  drivers/staging/wfx/main.c| 7 ---
> > >  drivers/staging/wfx/main.h| 3 ---
> > >  drivers/staging/wfx/queue.c   | 4 
> > >  drivers/staging/wfx/queue.h   | 3 ---
> > >  drivers/staging/wfx/scan.h| 2 --
> > >  drivers/staging/wfx/sta.c | 6 --
> > >  drivers/staging/wfx/sta.h | 2 --
> > >  drivers/staging/wfx/traces.h  | 3 ---
> > >  drivers/staging/wfx/wfx.h | 3 ---
> > >  27 files changed, 106 deletions(-)
> > > 
> > > diff --git a/drivers/staging/wfx/bh.c b/drivers/staging/wfx/bh.c
> > > index ed53d0b45592..cd6bcfdfbe9a 100644
> > > --- a/drivers/staging/wfx/bh.c
> > > +++ b/drivers/staging/wfx/bh.c
> > > @@ -5,7 +5,6 @@
> > >   * Copyright (c) 2017-2020, Silicon Laboratories, Inc.
> > >   * Copyright (c) 2010, ST-Ericsson
> > >   */
> > > -#include 
> > >  #include 
> > 
> > Though bh.c refers to gpiod_set_value_cansleep()
> > 
> > 
> > >  #include "bh.h"
> > > diff --git a/drivers/staging/wfx/bh.h b/drivers/staging/wfx/bh.h
> > > index 78c49329e22a..92ef3298d4ac 100644
> > > --- a/drivers/staging/wfx/bh.h
> > > +++ b/drivers/staging/wfx/bh.h
> > > @@ -8,10 +8,6 @@
> > >  #ifndef WFX_BH_H
> > >  #define WFX_BH_H
> > > 
> > > -#include 
> > > -#include 
> > > -#include 
> > > -
> > >  struct wfx_dev;
> > > 
> > >  struct wfx_hif {
> > 
> > Ditto, bh.h refers to atomic_t, struct work_struct and struct 
> > completion. If you try to compile bh.h alone (with something like
> > gcc -xc .../bh.h) it won't work.
> > 
> > Maybe it works now because we are lucky in the order the headers are 
> > included, but I think it is not sufficient.
> > 
> > [... same problem repeats multiple times in the following ...]
> > 
> 
> Greg, if nobody has any opinion on that, I think that this patch should
> be reverted.

Nothing is breaking, why should it be reverted?

You never build a .h file alone :)

Anyway, sure, I'll revert it, what is the commit id?

thanks,

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


Re: [PATCH] staging: rtl8712: fixed whitespace coding style issue

2021-03-09 Thread Greg KH
On Tue, Mar 09, 2021 at 06:24:45PM +0530, Selvakumar Elangovan wrote:
> Removed additional whitspaces and added space around the binary operator in 
> the rtl8712_xmit.h file

Please wrap your changelog at 72 columns.

And you are doing 2 different things in this patch, please only do one
"logical" thing.

And finally, you sent 2 copies of this patch, I don't know which to
apply, so I'll drop both and wait for a v2.

thanks,

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


Re: [PATCH] staging: gasket: Fix sizeof() in gasket_handle_ioctl()

2021-03-09 Thread Greg Kroah-Hartman
On Fri, Jan 22, 2021 at 06:01:13PM +0300, Dan Carpenter wrote:
> The "gasket_dev->num_page_tables" variable is an int but this is copying
> sizeof(u64).  On 32 bit systems this would end up disclosing a kernel
> pointer to user space, but on 64 bit it copies zeroes from a struct
> hole.
> 
> Fixes: 9a69f5087ccc ("drivers/staging: Gasket driver framework + Apex driver")
> Signed-off-by: Dan Carpenter 
> ---
> This is an API change.  Please review this carefully!  Another potential
> fix would be to make ->num_page_tables a long instead of an int.
> 
>  drivers/staging/gasket/gasket_ioctl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Looks like this driver is dead, with no response from anyone from
Google.

Should I just delete it?  The goal of using normal apis and getting this
out of staging seems to have totally died, so it shouldn't even still be
living in the kernel tree.  Even if having it here actually finds
security issues that the authors missed like this :(

So, any objection to me deleting it?

thanks,

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


Re: [PATCH] staging: wfx: remove unused included header files

2021-03-09 Thread Jérôme Pouiller
On Tuesday 9 March 2021 14:07:43 CET Greg KH wrote:
> On Thu, Mar 04, 2021 at 10:43:45AM +0100, Jérôme Pouiller wrote:
> > Hello Greg,
> >
> > On Tuesday 2 March 2021 16:01:25 CET Jérôme Pouiller wrote:
> > > Hello Muhammad,
> > >
> > > Sorry, I am a bit late for the review of this patch. Thank you for 
your
> > > contribution.
> > >
> > > On Thursday 11 February 2021 15:36:37 CET Muhammad Usama Anjum 
wrote:
> > > >
> > > > Many header files have been included, but never used. Those 
header
> > > > files have been removed.
> > > >
> > > > Signed-off-by: Muhammad Usama Anjum 
> > > > ---
> > > >  drivers/staging/wfx/bh.c  | 1 -
> > > >  drivers/staging/wfx/bh.h  | 4 
> > > >  drivers/staging/wfx/bus.h | 3 ---
> > > >  drivers/staging/wfx/bus_sdio.c| 6 --
> > > >  drivers/staging/wfx/bus_spi.c | 7 ---
> > > >  drivers/staging/wfx/data_rx.c | 5 -
> > > >  drivers/staging/wfx/data_tx.c | 5 -
> > > >  drivers/staging/wfx/data_tx.h | 3 ---
> > > >  drivers/staging/wfx/debug.c   | 6 --
> > > >  drivers/staging/wfx/fwio.c| 2 --
> > > >  drivers/staging/wfx/hif_api_cmd.h | 4 
> > > >  drivers/staging/wfx/hif_api_general.h | 9 -
> > > >  drivers/staging/wfx/hif_tx.c  | 4 
> > > >  drivers/staging/wfx/hif_tx_mib.c  | 5 -
> > > >  drivers/staging/wfx/hwio.c| 3 ---
> > > >  drivers/staging/wfx/hwio.h| 2 --
> > > >  drivers/staging/wfx/key.c | 2 --
> > > >  drivers/staging/wfx/key.h | 2 --
> > > >  drivers/staging/wfx/main.c| 7 ---
> > > >  drivers/staging/wfx/main.h| 3 ---
> > > >  drivers/staging/wfx/queue.c   | 4 
> > > >  drivers/staging/wfx/queue.h   | 3 ---
> > > >  drivers/staging/wfx/scan.h| 2 --
> > > >  drivers/staging/wfx/sta.c | 6 --
> > > >  drivers/staging/wfx/sta.h | 2 --
> > > >  drivers/staging/wfx/traces.h  | 3 ---
> > > >  drivers/staging/wfx/wfx.h | 3 ---
> > > >  27 files changed, 106 deletions(-)
> > > >
> > > > diff --git a/drivers/staging/wfx/bh.c b/drivers/staging/wfx/bh.c
> > > > index ed53d0b45592..cd6bcfdfbe9a 100644
> > > > --- a/drivers/staging/wfx/bh.c
> > > > +++ b/drivers/staging/wfx/bh.c
> > > > @@ -5,7 +5,6 @@
> > > >   * Copyright (c) 2017-2020, Silicon Laboratories, Inc.
> > > >   * Copyright (c) 2010, ST-Ericsson
> > > >   */
> > > > -#include 
> > > >  #include 
> > >
> > > Though bh.c refers to gpiod_set_value_cansleep()
> > >
> > >
> > > >  #include "bh.h"
> > > > diff --git a/drivers/staging/wfx/bh.h b/drivers/staging/wfx/bh.h
> > > > index 78c49329e22a..92ef3298d4ac 100644
> > > > --- a/drivers/staging/wfx/bh.h
> > > > +++ b/drivers/staging/wfx/bh.h
> > > > @@ -8,10 +8,6 @@
> > > >  #ifndef WFX_BH_H
> > > >  #define WFX_BH_H
> > > >
> > > > -#include 
> > > > -#include 
> > > > -#include 
> > > > -
> > > >  struct wfx_dev;
> > > >
> > > >  struct wfx_hif {
> > >
> > > Ditto, bh.h refers to atomic_t, struct work_struct and struct
> > > completion. If you try to compile bh.h alone (with something like
> > > gcc -xc .../bh.h) it won't work.
> > >
> > > Maybe it works now because we are lucky in the order the headers 
are
> > > included, but I think it is not sufficient.
> > >
> > > [... same problem repeats multiple times in the following ...]
> > >
> >
> > Greg, if nobody has any opinion on that, I think that this patch 
should
> > be reverted.
> 
> Nothing is breaking, why should it be reverted?

Because it is less maintainable?
 
> You never build a .h file alone :)

hmmm... notwithstanding, I thing that the code should not depend on the 
order the headers are included. You don't?
 
> Anyway, sure, I'll revert it, what is the commit id?

commit 314fd52f01ea "staging: wfx: remove unused included header files"

Thank you!

-- 
Jérôme Pouiller


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


[PATCH v2] rtl8712: fixed whitespace coding style issue

2021-03-09 Thread Selvakumar Elangovan
Removed additional whitespaces in the rtl8712_xmit.h file.

Signed-off-by: Selvakumar Elangovan 
---
 drivers/staging/rtl8712/rtl8712_xmit.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl8712_xmit.h 
b/drivers/staging/rtl8712/rtl8712_xmit.h
index 0b56bd3ac4d0..e4c0a4bf8388 100644
--- a/drivers/staging/rtl8712/rtl8712_xmit.h
+++ b/drivers/staging/rtl8712/rtl8712_xmit.h
@@ -36,10 +36,8 @@
 #define MAX_AMSDU_XMITBUF_SZ 8704
 #define MAX_TXAGG_XMITBUF_SZ 16384 /*16k*/
 
-
 #define tx_cmd tx_desc
 
-
 /*
  *defined for TX DESC Operation
  */
@@ -89,7 +87,6 @@ struct tx_desc {
__le32 txdw7;
 };
 
-
 union txdesc {
struct tx_desc txdesc;
unsigned int value[TXDESC_SIZE>>2];
-- 
2.17.1

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


[PATCH] staging: rtl8712: fixed no space coding style issue

2021-03-09 Thread Selvakumar Elangovan
Added space around the binary operator for readability in
rtl8712_xmit.h file

Signed-off-by: Selvakumar Elangovan 
---
 drivers/staging/rtl8712/rtl8712_xmit.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8712/rtl8712_xmit.h 
b/drivers/staging/rtl8712/rtl8712_xmit.h
index e4c0a4bf8388..5cd651a0de75 100644
--- a/drivers/staging/rtl8712/rtl8712_xmit.h
+++ b/drivers/staging/rtl8712/rtl8712_xmit.h
@@ -89,7 +89,7 @@ struct tx_desc {
 
 union txdesc {
struct tx_desc txdesc;
-   unsigned int value[TXDESC_SIZE>>2];
+   unsigned int value[TXDESC_SIZE >> 2];
 };
 
 int r8712_xmitframe_complete(struct _adapter *padapter,
-- 
2.17.1

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


Re: [PATCH v2] rtl8712: fixed whitespace coding style issue

2021-03-09 Thread Greg KH
On Tue, Mar 09, 2021 at 07:47:21PM +0530, Selvakumar Elangovan wrote:
> Removed additional whitespaces in the rtl8712_xmit.h file.
> 
> Signed-off-by: Selvakumar Elangovan 
> ---
>  drivers/staging/rtl8712/rtl8712_xmit.h | 3 ---
>  1 file changed, 3 deletions(-)

What changed from v1?  Always put that below the --- line.

v3?

thanks,

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


Re: [PATCH] staging: wfx: remove unused included header files

2021-03-09 Thread Greg KH
On Tue, Mar 09, 2021 at 02:45:56PM +0100, Jérôme Pouiller wrote:
> On Tuesday 9 March 2021 14:07:43 CET Greg KH wrote:
> > On Thu, Mar 04, 2021 at 10:43:45AM +0100, Jérôme Pouiller wrote:
> > > Hello Greg,
> > >
> > > On Tuesday 2 March 2021 16:01:25 CET Jérôme Pouiller wrote:
> > > > Hello Muhammad,
> > > >
> > > > Sorry, I am a bit late for the review of this patch. Thank you for 
> your
> > > > contribution.
> > > >
> > > > On Thursday 11 February 2021 15:36:37 CET Muhammad Usama Anjum 
> wrote:
> > > > >
> > > > > Many header files have been included, but never used. Those 
> header
> > > > > files have been removed.
> > > > >
> > > > > Signed-off-by: Muhammad Usama Anjum 
> > > > > ---
> > > > >  drivers/staging/wfx/bh.c  | 1 -
> > > > >  drivers/staging/wfx/bh.h  | 4 
> > > > >  drivers/staging/wfx/bus.h | 3 ---
> > > > >  drivers/staging/wfx/bus_sdio.c| 6 --
> > > > >  drivers/staging/wfx/bus_spi.c | 7 ---
> > > > >  drivers/staging/wfx/data_rx.c | 5 -
> > > > >  drivers/staging/wfx/data_tx.c | 5 -
> > > > >  drivers/staging/wfx/data_tx.h | 3 ---
> > > > >  drivers/staging/wfx/debug.c   | 6 --
> > > > >  drivers/staging/wfx/fwio.c| 2 --
> > > > >  drivers/staging/wfx/hif_api_cmd.h | 4 
> > > > >  drivers/staging/wfx/hif_api_general.h | 9 -
> > > > >  drivers/staging/wfx/hif_tx.c  | 4 
> > > > >  drivers/staging/wfx/hif_tx_mib.c  | 5 -
> > > > >  drivers/staging/wfx/hwio.c| 3 ---
> > > > >  drivers/staging/wfx/hwio.h| 2 --
> > > > >  drivers/staging/wfx/key.c | 2 --
> > > > >  drivers/staging/wfx/key.h | 2 --
> > > > >  drivers/staging/wfx/main.c| 7 ---
> > > > >  drivers/staging/wfx/main.h| 3 ---
> > > > >  drivers/staging/wfx/queue.c   | 4 
> > > > >  drivers/staging/wfx/queue.h   | 3 ---
> > > > >  drivers/staging/wfx/scan.h| 2 --
> > > > >  drivers/staging/wfx/sta.c | 6 --
> > > > >  drivers/staging/wfx/sta.h | 2 --
> > > > >  drivers/staging/wfx/traces.h  | 3 ---
> > > > >  drivers/staging/wfx/wfx.h | 3 ---
> > > > >  27 files changed, 106 deletions(-)
> > > > >
> > > > > diff --git a/drivers/staging/wfx/bh.c b/drivers/staging/wfx/bh.c
> > > > > index ed53d0b45592..cd6bcfdfbe9a 100644
> > > > > --- a/drivers/staging/wfx/bh.c
> > > > > +++ b/drivers/staging/wfx/bh.c
> > > > > @@ -5,7 +5,6 @@
> > > > >   * Copyright (c) 2017-2020, Silicon Laboratories, Inc.
> > > > >   * Copyright (c) 2010, ST-Ericsson
> > > > >   */
> > > > > -#include 
> > > > >  #include 
> > > >
> > > > Though bh.c refers to gpiod_set_value_cansleep()
> > > >
> > > >
> > > > >  #include "bh.h"
> > > > > diff --git a/drivers/staging/wfx/bh.h b/drivers/staging/wfx/bh.h
> > > > > index 78c49329e22a..92ef3298d4ac 100644
> > > > > --- a/drivers/staging/wfx/bh.h
> > > > > +++ b/drivers/staging/wfx/bh.h
> > > > > @@ -8,10 +8,6 @@
> > > > >  #ifndef WFX_BH_H
> > > > >  #define WFX_BH_H
> > > > >
> > > > > -#include 
> > > > > -#include 
> > > > > -#include 
> > > > > -
> > > > >  struct wfx_dev;
> > > > >
> > > > >  struct wfx_hif {
> > > >
> > > > Ditto, bh.h refers to atomic_t, struct work_struct and struct
> > > > completion. If you try to compile bh.h alone (with something like
> > > > gcc -xc .../bh.h) it won't work.
> > > >
> > > > Maybe it works now because we are lucky in the order the headers 
> are
> > > > included, but I think it is not sufficient.
> > > >
> > > > [... same problem repeats multiple times in the following ...]
> > > >
> > >
> > > Greg, if nobody has any opinion on that, I think that this patch 
> should
> > > be reverted.
> > 
> > Nothing is breaking, why should it be reverted?
> 
> Because it is less maintainable?
>  
> > You never build a .h file alone :)
> 
> hmmm... notwithstanding, I thing that the code should not depend on the 
> order the headers are included. You don't?
>  
> > Anyway, sure, I'll revert it, what is the commit id?
> 
> commit 314fd52f01ea "staging: wfx: remove unused included header files"

Now reverted, thanks.

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


[PATCH v3] staging: rtl8712: fixed whitespace coding style issue

2021-03-09 Thread Selvakumar Elangovan
Removed additional whitespaces in the rtl8712_xmit.h file.

Signed-off-by: Selvakumar Elangovan 
---
Changes in v3:
 - Done one logical changes instead of two different changes in the same
   patch.

 drivers/staging/rtl8712/rtl8712_xmit.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl8712_xmit.h 
b/drivers/staging/rtl8712/rtl8712_xmit.h
index 0b56bd3ac4d0..e4c0a4bf8388 100644
--- a/drivers/staging/rtl8712/rtl8712_xmit.h
+++ b/drivers/staging/rtl8712/rtl8712_xmit.h
@@ -36,10 +36,8 @@
 #define MAX_AMSDU_XMITBUF_SZ 8704
 #define MAX_TXAGG_XMITBUF_SZ 16384 /*16k*/
 
-
 #define tx_cmd tx_desc
 
-
 /*
  *defined for TX DESC Operation
  */
@@ -89,7 +87,6 @@ struct tx_desc {
__le32 txdw7;
 };
 
-
 union txdesc {
struct tx_desc txdesc;
unsigned int value[TXDESC_SIZE>>2];
-- 
2.17.1

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


Re: [PATCH v11 5/6] staging: mt7621-dts: use valid vendor 'mediatek' instead of invalid 'mtk'

2021-03-09 Thread Thomas Bogendoerfer
On Tue, Mar 09, 2021 at 06:22:25AM +0100, Sergio Paracuellos wrote:
> Vendor listed for mediatek in kernel vendor file 'vendor-prefixes.yaml'
> contains 'mediatek' as a valid vendor string. Some nodes in the device
> tree are using an invalid vendor string vfor 'mtk' instead. Fix all of
> them in dts file. Update also ralink mt7621 related code to properly
> match new strings. Even there are used in the device tree there are
> some strings that are not referred anywhere but have been also updated
> with new vendor name. These are 'mtk,mt7621-wdt', 'mtk,mt7621-nand',
> 'mtk,mt7621-mc', and 'mtk,mt7621-cpc'.
> 
> Acked-by: Greg Kroah-Hartman 
> Signed-off-by: Sergio Paracuellos 
> ---
>  arch/mips/ralink/mt7621.c  |  6 +++---

Acked-by: Thomas Bogendoerfer 

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.[ RFC1925, 2.3 ]
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[kbuild] Re: [PATCH v3 1/2] char: xillybus: Move class-related functions to new xillybus_class.c

2021-03-09 Thread Dan Carpenter
url:
https://github.com/0day-ci/linux/commits/eli-billauer-gmail-com/Submission-of-XillyUSB-driver/20210309-193645
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git  
080951f99de1e483a9a48f34c079b634f2912a54
config: x86_64-randconfig-m001-20210309 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot 
Reported-by: Dan Carpenter 

smatch warnings:
drivers/char/xillybus/xillybus_class.c:86 xillybus_init_chrdev() warn: ignoring 
unreachable code.
drivers/char/xillybus/xillybus_class.c:96 xillybus_init_chrdev() warn: missing 
error code 'rc'

vim +86 drivers/char/xillybus/xillybus_class.c

10702b71f93292 Eli Billauer 2021-03-09   42  int xillybus_init_chrdev(struct 
device *dev,
10702b71f93292 Eli Billauer 2021-03-09   43  const struct 
file_operations *fops,
10702b71f93292 Eli Billauer 2021-03-09   44  struct module 
*owner,
10702b71f93292 Eli Billauer 2021-03-09   45  void 
*private_data,
10702b71f93292 Eli Billauer 2021-03-09   46  unsigned char 
*idt, unsigned int len,
10702b71f93292 Eli Billauer 2021-03-09   47  int num_nodes,
10702b71f93292 Eli Billauer 2021-03-09   48  const char 
*prefix, bool enumerate)
10702b71f93292 Eli Billauer 2021-03-09   49  {
10702b71f93292 Eli Billauer 2021-03-09   50 int rc;
10702b71f93292 Eli Billauer 2021-03-09   51 dev_t mdev;
10702b71f93292 Eli Billauer 2021-03-09   52 int i;
10702b71f93292 Eli Billauer 2021-03-09   53 char devname[48];
10702b71f93292 Eli Billauer 2021-03-09   54  
10702b71f93292 Eli Billauer 2021-03-09   55 struct device *device;
10702b71f93292 Eli Billauer 2021-03-09   56 size_t namelen;
10702b71f93292 Eli Billauer 2021-03-09   57 struct xilly_unit *unit, *u;
10702b71f93292 Eli Billauer 2021-03-09   58  
10702b71f93292 Eli Billauer 2021-03-09   59 unit = kzalloc(sizeof(*unit), 
GFP_KERNEL);
10702b71f93292 Eli Billauer 2021-03-09   60  
10702b71f93292 Eli Billauer 2021-03-09   61 if (!unit)
10702b71f93292 Eli Billauer 2021-03-09   62 return -ENOMEM;
10702b71f93292 Eli Billauer 2021-03-09   63  
10702b71f93292 Eli Billauer 2021-03-09   64 mutex_lock(&unit_mutex);
10702b71f93292 Eli Billauer 2021-03-09   65  
10702b71f93292 Eli Billauer 2021-03-09   66 if (!enumerate)
10702b71f93292 Eli Billauer 2021-03-09   67 snprintf(unit->name, 
UNITNAMELEN, "%s", prefix);
10702b71f93292 Eli Billauer 2021-03-09   68  
10702b71f93292 Eli Billauer 2021-03-09   69 for (i = 0; enumerate; i++) {
10702b71f93292 Eli Billauer 2021-03-09   70 snprintf(unit->name, 
UNITNAMELEN, "%s_%02d",
10702b71f93292 Eli Billauer 2021-03-09   71  prefix, i);
10702b71f93292 Eli Billauer 2021-03-09   72  
10702b71f93292 Eli Billauer 2021-03-09   73 enumerate = false;
10702b71f93292 Eli Billauer 2021-03-09   74 list_for_each_entry(u, 
&unit_list, list_entry)
10702b71f93292 Eli Billauer 2021-03-09   75 if 
(!strcmp(unit->name, u->name)) {
10702b71f93292 Eli Billauer 2021-03-09   76 
enumerate = true;
10702b71f93292 Eli Billauer 2021-03-09   77 break;
10702b71f93292 Eli Billauer 2021-03-09   78 }
10702b71f93292 Eli Billauer 2021-03-09   79 }
10702b71f93292 Eli Billauer 2021-03-09   80  
10702b71f93292 Eli Billauer 2021-03-09   81 rc = alloc_chrdev_region(&mdev, 
0, num_nodes, unit->name);
10702b71f93292 Eli Billauer 2021-03-09   82  
10702b71f93292 Eli Billauer 2021-03-09   83 if (rc) {
10702b71f93292 Eli Billauer 2021-03-09   84 dev_warn(dev, "Failed 
to obtain major/minors");
10702b71f93292 Eli Billauer 2021-03-09   85 goto fail_obtain;
^
10702b71f93292 Eli Billauer 2021-03-09  @86 return rc;
^^
Unreachable

10702b71f93292 Eli Billauer 2021-03-09   87 }
10702b71f93292 Eli Billauer 2021-03-09   88  
10702b71f93292 Eli Billauer 2021-03-09   89 unit->major = MAJOR(mdev);
10702b71f93292 Eli Billauer 2021-03-09   90 unit->lowest_minor = 
MINOR(mdev);
10702b71f93292 Eli Billauer 2021-03-09   91 unit->num_nodes = num_nodes;
10702b71f93292 Eli Billauer 2021-03-09   92 unit->private_data = 
private_data;
10702b71f93292 Eli Billauer 2021-03-09   93  
10702b71f93292 Eli Billauer 2021-03-09   94 unit->cdev = cdev_alloc();
10702b71f93292 Eli Billauer 2021-03-09   95 if (!unit->cdev)
10702b71f93292 Eli Billauer 2021-03-09  @96 goto unregister_chrdev;

"rc = -ENOMEM;"

10702b71f93292 Eli Billauer 2021-03-09   97  
10702b71f932

Re: [PATCH] staging: gasket: Fix sizeof() in gasket_handle_ioctl()

2021-03-09 Thread Greg Kroah-Hartman
On Tue, Mar 09, 2021 at 04:57:59PM +, Walter Harms wrote:
> why not mark it as "Deprecated" and remove it with the next version ? Maybe 
> soneone will wakeup ?

We don't really have a "Deprecated" marking, we just delete them :)

thanks,

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


AW: [PATCH] staging: gasket: Fix sizeof() in gasket_handle_ioctl()

2021-03-09 Thread Walter Harms
why not mark it as "Deprecated" and remove it with the next version ? Maybe 
soneone will wakeup ?

re,
 wh

Von: Greg Kroah-Hartman 
Gesendet: Dienstag, 9. März 2021 14:26:55
An: Dan Carpenter
Cc: Rob Springer; de...@driverdev.osuosl.org; kernel-janit...@vger.kernel.org; 
John Joseph; Simon Que; Richard Yeh; Todd Poynor
Betreff: Re: [PATCH] staging: gasket: Fix sizeof() in gasket_handle_ioctl()

On Fri, Jan 22, 2021 at 06:01:13PM +0300, Dan Carpenter wrote:
> The "gasket_dev->num_page_tables" variable is an int but this is copying
> sizeof(u64).  On 32 bit systems this would end up disclosing a kernel
> pointer to user space, but on 64 bit it copies zeroes from a struct
> hole.
>
> Fixes: 9a69f5087ccc ("drivers/staging: Gasket driver framework + Apex driver")
> Signed-off-by: Dan Carpenter 
> ---
> This is an API change.  Please review this carefully!  Another potential
> fix would be to make ->num_page_tables a long instead of an int.
>
>  drivers/staging/gasket/gasket_ioctl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Looks like this driver is dead, with no response from anyone from
Google.

Should I just delete it?  The goal of using normal apis and getting this
out of staging seems to have totally died, so it shouldn't even still be
living in the kernel tree.  Even if having it here actually finds
security issues that the authors missed like this :(

So, any objection to me deleting it?

thanks,

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


[staging:staging-next] BUILD SUCCESS e44ad3f1815837c681988aeeb899dcfab5e033ca

2021-03-09 Thread kernel test robot
 allyesconfig
mips allmodconfig
powerpc  allyesconfig
powerpc  allmodconfig
powerpc   allnoconfig
i386 randconfig-a005-20210309
i386 randconfig-a003-20210309
i386 randconfig-a002-20210309
i386 randconfig-a006-20210309
i386 randconfig-a004-20210309
i386 randconfig-a001-20210309
x86_64   randconfig-a013-20210309
x86_64   randconfig-a016-20210309
x86_64   randconfig-a015-20210309
x86_64   randconfig-a014-20210309
x86_64   randconfig-a011-20210309
x86_64   randconfig-a012-20210309
i386 randconfig-a016-20210309
i386 randconfig-a012-20210309
i386 randconfig-a014-20210309
i386 randconfig-a013-20210309
i386 randconfig-a011-20210309
i386 randconfig-a015-20210309
x86_64   randconfig-a006-20210308
x86_64   randconfig-a001-20210308
x86_64   randconfig-a004-20210308
x86_64   randconfig-a002-20210308
x86_64   randconfig-a005-20210308
x86_64   randconfig-a003-20210308
riscvnommu_k210_defconfig
riscvallyesconfig
riscvnommu_virt_defconfig
riscv allnoconfig
riscv   defconfig
riscv  rv32_defconfig
riscvallmodconfig
x86_64rhel-7.6-kselftests
x86_64  defconfig
x86_64   rhel-8.3
x86_64  rhel-8.3-kbuiltin
x86_64  kexec

clang tested configs:
x86_64   randconfig-a006-20210309
x86_64   randconfig-a001-20210309
x86_64   randconfig-a004-20210309
x86_64   randconfig-a002-20210309
x86_64   randconfig-a005-20210309
x86_64   randconfig-a003-20210309
x86_64   randconfig-a013-20210308
x86_64   randconfig-a016-20210308
x86_64   randconfig-a015-20210308
x86_64   randconfig-a014-20210308
x86_64   randconfig-a011-20210308
x86_64   randconfig-a012-20210308

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[driver-core:debugfs_remove_return_value] BUILD SUCCESS c40789b66abfa790aff5464bcb94f8fff1551fd3

2021-03-09 Thread kernel test robot
defconfig
m68k allyesconfig
nios2   defconfig
arc  allyesconfig
nds32 allnoconfig
nds32   defconfig
nios2allyesconfig
cskydefconfig
alpha   defconfig
xtensa   allyesconfig
h8300allyesconfig
arc defconfig
sh   allmodconfig
parisc  defconfig
s390 allyesconfig
s390 allmodconfig
parisc   allyesconfig
s390defconfig
i386 allyesconfig
sparcallyesconfig
sparc   defconfig
i386   tinyconfig
mips allyesconfig
mips allmodconfig
powerpc  allyesconfig
powerpc  allmodconfig
powerpc   allnoconfig
i386 randconfig-a005-20210309
i386 randconfig-a003-20210309
i386 randconfig-a002-20210309
i386 randconfig-a006-20210309
i386 randconfig-a004-20210309
i386 randconfig-a001-20210309
x86_64   randconfig-a013-20210309
x86_64   randconfig-a016-20210309
x86_64   randconfig-a015-20210309
x86_64   randconfig-a014-20210309
x86_64   randconfig-a011-20210309
x86_64   randconfig-a012-20210309
i386 randconfig-a016-20210309
i386 randconfig-a012-20210309
i386 randconfig-a014-20210309
i386 randconfig-a013-20210309
i386 randconfig-a011-20210309
i386 randconfig-a015-20210309
x86_64   randconfig-a006-20210308
x86_64   randconfig-a001-20210308
x86_64   randconfig-a004-20210308
x86_64   randconfig-a002-20210308
x86_64   randconfig-a005-20210308
x86_64   randconfig-a003-20210308
riscvnommu_k210_defconfig
riscvallyesconfig
riscvnommu_virt_defconfig
riscv allnoconfig
riscv   defconfig
riscv  rv32_defconfig
riscvallmodconfig
x86_64rhel-7.6-kselftests
x86_64  defconfig
x86_64   rhel-8.3
x86_64  rhel-8.3-kbuiltin
x86_64  kexec

clang tested configs:
x86_64   randconfig-a006-20210309
x86_64   randconfig-a001-20210309
x86_64   randconfig-a004-20210309
x86_64   randconfig-a002-20210309
x86_64   randconfig-a005-20210309
x86_64   randconfig-a003-20210309
x86_64   randconfig-a013-20210308
x86_64   randconfig-a016-20210308
x86_64   randconfig-a015-20210308
x86_64   randconfig-a014-20210308
x86_64   randconfig-a011-20210308
x86_64   randconfig-a012-20210308

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] media: staging/intel-ipu3: Fix set_fmt error handling

2021-03-09 Thread Ricardo Ribalda
If there in an error during a set_fmt, do not overwrite the previous
sizes with the invalid config.

Without this patch, v4l2-compliance ends up allocating 4GiB of RAM and
causing the following OOPs

[   38.662975] ipu3-imgu :00:05.0: swiotlb buffer is full (sz: 4096 bytes)
[   38.662980] DMA: Out of SW-IOMMU space for 4096 bytes at device :00:05.0
[   38.663010] general protection fault:  [#1] PREEMPT SMP

Cc: sta...@vger.kernel.org
Fixes: 6d5f26f2e045 ("media: staging/intel-ipu3-v4l: reduce kernel stack usage")
Signed-off-by: Ricardo Ribalda 
---
 drivers/staging/media/ipu3/ipu3-v4l2.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/drivers/staging/media/ipu3/ipu3-v4l2.c 
b/drivers/staging/media/ipu3/ipu3-v4l2.c
index 60aa02eb7d2a..e8944e489c56 100644
--- a/drivers/staging/media/ipu3/ipu3-v4l2.c
+++ b/drivers/staging/media/ipu3/ipu3-v4l2.c
@@ -669,6 +669,7 @@ static int imgu_fmt(struct imgu_device *imgu, unsigned int 
pipe, int node,
struct imgu_css_pipe *css_pipe = &imgu->css.pipes[pipe];
struct imgu_media_pipe *imgu_pipe = &imgu->imgu_pipe[pipe];
struct imgu_v4l2_subdev *imgu_sd = &imgu_pipe->imgu_sd;
+   struct v4l2_pix_format_mplane fmt_backup;
 
dev_dbg(dev, "set fmt node [%u][%u](try = %u)", pipe, node, try);
 
@@ -734,6 +735,7 @@ static int imgu_fmt(struct imgu_device *imgu, unsigned int 
pipe, int node,
ret = -EINVAL;
goto out;
}
+   fmt_backup = *fmts[css_q];
*fmts[css_q] = f->fmt.pix_mp;
 
if (try)
@@ -741,6 +743,9 @@ static int imgu_fmt(struct imgu_device *imgu, unsigned int 
pipe, int node,
else
ret = imgu_css_fmt_set(&imgu->css, fmts, rects, pipe);
 
+   if (try || ret < 0)
+   *fmts[css_q] = fmt_backup;
+
/* ret is the binary number in the firmware blob */
if (ret < 0)
goto out;
-- 
2.30.1.766.gb4fecdf3b7-goog

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


[staging:staging-testing] BUILD SUCCESS 94984f1c5bdd827d01d3f6a6c72f9fdd2d213fee

2021-03-09 Thread kernel test robot
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 
staging-testing
branch HEAD: 94984f1c5bdd827d01d3f6a6c72f9fdd2d213fee  staging: unisys: 
visornic: Fix repeated words in comments

elapsed time: 725m

configs tested: 134
configs skipped: 2

The following configs have been built successfully.
More configs may be tested in the coming days.

gcc tested configs:
arm defconfig
arm64allyesconfig
arm64   defconfig
arm  allyesconfig
arm  allmodconfig
mipsworkpad_defconfig
sh   se7724_defconfig
mips bigsur_defconfig
mips  ath25_defconfig
m68k   sun3_defconfig
arm  pxa3xx_defconfig
m68k alldefconfig
arm  moxart_defconfig
powerpc  storcenter_defconfig
arm ezx_defconfig
mips   lemote2f_defconfig
powerpc tqm8541_defconfig
powerpc pq2fads_defconfig
arm   stm32_defconfig
mips decstation_r4k_defconfig
m68km5307c3_defconfig
powerpc  arches_defconfig
sh   se7343_defconfig
arm  alldefconfig
arm socfpga_defconfig
arm  pcm027_defconfig
powerpc pseries_defconfig
arm s5pv210_defconfig
mipsmaltaup_xpa_defconfig
mipsvocore2_defconfig
armhisi_defconfig
riscv nommu_k210_sdcard_defconfig
xtensa  iss_defconfig
powerpc kmeter1_defconfig
sh   rts7751r2dplus_defconfig
mipsjmr3927_defconfig
arm   netwinder_defconfig
arm   viper_defconfig
sh  rts7751r2d1_defconfig
powerpcge_imp3a_defconfig
arm hackkit_defconfig
mips loongson1b_defconfig
h8300alldefconfig
armxcep_defconfig
arc   tb10x_defconfig
arm  ep93xx_defconfig
powerpc stx_gp3_defconfig
arm  pxa910_defconfig
powerpcicon_defconfig
sh   se7722_defconfig
m68k  amiga_defconfig
powerpcmvme5100_defconfig
alphaallyesconfig
ia64 allmodconfig
ia64defconfig
ia64 allyesconfig
m68k allmodconfig
m68kdefconfig
m68k allyesconfig
nios2   defconfig
arc  allyesconfig
nds32 allnoconfig
nds32   defconfig
nios2allyesconfig
cskydefconfig
alpha   defconfig
xtensa   allyesconfig
h8300allyesconfig
arc defconfig
sh   allmodconfig
parisc  defconfig
s390 allyesconfig
s390 allmodconfig
parisc   allyesconfig
s390defconfig
i386 allyesconfig
sparcallyesconfig
sparc   defconfig
i386   tinyconfig
i386defconfig
mips allyesconfig
mips allmodconfig
powerpc  allyesconfig
powerpc  allmodconfig
powerpc   allnoconfig
i386 randconfig-a005-20210309
i386 randconfig-a003-20210309
i386 randconfig-a002-20210309
i386 randconfig-a006-20210309
i386 randconfig-a004-20210309
i386 randconfig-a001-20210309
x86_64   randconfig-a013-20210309
x86_64   randconfig-a016-20210309
x86_64   randconfig-a015-20210309
x86_64   randconfig-a014-20210309
x86_64   randconfig-a011-20210309
x86_64   randconfig-a012-20210309
x86_64   randconfig-a006-20210308
x86_64   randconfig-a001-20210308
x86_64   randconfig-a004-20210308
x86_64

[staging:staging-linus] BUILD SUCCESS 102ac9067dcecbf6f521667dce2356809ba088e5

2021-03-09 Thread kernel test robot
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 
staging-linus
branch HEAD: 102ac9067dcecbf6f521667dce2356809ba088e5  Revert "staging: wfx: 
remove unused included header files"

elapsed time: 723m

configs tested: 123
configs skipped: 2

The following configs have been built successfully.
More configs may be tested in the coming days.

gcc tested configs:
arm defconfig
arm64allyesconfig
arm64   defconfig
arm  allyesconfig
arm  allmodconfig
sparcallyesconfig
mips db1xxx_defconfig
powerpc tqm8540_defconfig
powerpc  ppc44x_defconfig
powerpc pq2fads_defconfig
powerpc  obs600_defconfig
powerpc   holly_defconfig
powerpc kmeter1_defconfig
riscv  rv32_defconfig
arm mxs_defconfig
sh microdev_defconfig
mips   capcella_defconfig
armmvebu_v7_defconfig
xtensa  cadence_csp_defconfig
arm pxa_defconfig
powerpc tqm8541_defconfig
sh  polaris_defconfig
powerpc  ep88xc_defconfig
mips   rbtx49xx_defconfig
powerpc mpc512x_defconfig
arm hackkit_defconfig
sh   j2_defconfig
mipsomega2p_defconfig
arm   versatile_defconfig
shsh7757lcr_defconfig
sh  defconfig
powerpc mpc832x_rdb_defconfig
arm   cns3420vb_defconfig
m68k   m5275evb_defconfig
h8300   defconfig
mipsbcm63xx_defconfig
powerpc mpc832x_mds_defconfig
arm s3c2410_defconfig
mips  ath79_defconfig
riscv   defconfig
i386 allyesconfig
m68km5307c3_defconfig
powerpc tqm5200_defconfig
powerpc mpc8313_rdb_defconfig
xtensa  iss_defconfig
ia64 allmodconfig
ia64defconfig
ia64 allyesconfig
m68k allmodconfig
m68kdefconfig
m68k allyesconfig
nios2   defconfig
arc  allyesconfig
nds32 allnoconfig
nds32   defconfig
nios2allyesconfig
cskydefconfig
alpha   defconfig
alphaallyesconfig
xtensa   allyesconfig
h8300allyesconfig
arc defconfig
sh   allmodconfig
parisc  defconfig
s390 allyesconfig
s390 allmodconfig
parisc   allyesconfig
s390defconfig
sparc   defconfig
i386   tinyconfig
i386defconfig
mips allyesconfig
mips allmodconfig
powerpc  allyesconfig
powerpc  allmodconfig
powerpc   allnoconfig
i386 randconfig-a005-20210308
i386 randconfig-a003-20210308
i386 randconfig-a002-20210308
i386 randconfig-a006-20210308
i386 randconfig-a004-20210308
i386 randconfig-a001-20210308
i386 randconfig-a005-20210309
i386 randconfig-a003-20210309
i386 randconfig-a002-20210309
i386 randconfig-a006-20210309
i386 randconfig-a004-20210309
i386 randconfig-a001-20210309
x86_64   randconfig-a013-20210309
x86_64   randconfig-a016-20210309
x86_64   randconfig-a015-20210309
x86_64   randconfig-a014-20210309
x86_64   randconfig-a011-20210309
x86_64   randconfig-a012-20210309
x86_64   randconfig-a006-20210308
x86_64   randconfig-a001-20210308
x86_64   randconfig-a004-20210308
x86_64   randconfig-a002-20210308
x86_64   randconfig-a005-20210308
x86_64   randconfig-a003-202

Re: [PATCH 01/10] spi: spi-axi-spi-engine: remove usage of delay_usecs

2021-03-09 Thread Alexandru Ardelean
On Mon, 8 Mar 2021 at 18:42, Lars-Peter Clausen  wrote:
>
> On 3/8/21 3:54 PM, Alexandru Ardelean wrote:
> > The 'delay_usecs' field was handled for backwards compatibility in case
> > there were some users that still configured SPI delay transfers with
> > this field.
> >
> > They should all be removed by now.
> >
> > Signed-off-by: Alexandru Ardelean 
> > ---
> >   drivers/spi/spi-axi-spi-engine.c | 12 
> >   1 file changed, 4 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/spi/spi-axi-spi-engine.c 
> > b/drivers/spi/spi-axi-spi-engine.c
> > index af86e6d6e16b..80c3e38f5c1b 100644
> > --- a/drivers/spi/spi-axi-spi-engine.c
> > +++ b/drivers/spi/spi-axi-spi-engine.c
> > @@ -170,14 +170,10 @@ static void spi_engine_gen_sleep(struct 
> > spi_engine_program *p, bool dry,
> >   unsigned int t;
> >   int delay;
> >
> > - if (xfer->delay_usecs) {
> > - delay = xfer->delay_usecs;
> > - } else {
> > - delay = spi_delay_to_ns(&xfer->delay, xfer);
> > - if (delay < 0)
> > - return;
> > - delay /= 1000;
> > - }
> > + delay = spi_delay_to_ns(&xfer->delay, xfer);
> > + if (delay < 0)
> > + return;
>
> Bit of a nit, but this could be `delay <= 0` and then drop the check for
> `delay == 0` below.

hmm, that's a bit debatable, because the `delay == 0` check comes
after `delay /= 1000` ;
to do what you're suggesting, it would probably need a
DIV_ROUND_UP(delay, 1000) to make sure that even sub-microsecond
delays don't become zero;

if you're acking this suggestion i'll implement it;
i'll wait a few more days to see if there are any other acks or
complaints on the set before sending a V2;

btw: this new spi_delay struct supports delays in microseconds,
nanoseconds and clock cycles;
at some point it may be interesting to use a
`spi_delay_to_clk_cycles()` for this driver and other similar;

>
> > + delay /= 1000;
> >
> >   if (delay == 0)
> >   return;
>
>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 01/10] spi: spi-axi-spi-engine: remove usage of delay_usecs

2021-03-09 Thread Lars-Peter Clausen

On 3/10/21 8:16 AM, Alexandru Ardelean wrote:

On Mon, 8 Mar 2021 at 18:42, Lars-Peter Clausen  wrote:

On 3/8/21 3:54 PM, Alexandru Ardelean wrote:

The 'delay_usecs' field was handled for backwards compatibility in case
there were some users that still configured SPI delay transfers with
this field.

They should all be removed by now.

Signed-off-by: Alexandru Ardelean 
---
   drivers/spi/spi-axi-spi-engine.c | 12 
   1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/spi/spi-axi-spi-engine.c b/drivers/spi/spi-axi-spi-engine.c
index af86e6d6e16b..80c3e38f5c1b 100644
--- a/drivers/spi/spi-axi-spi-engine.c
+++ b/drivers/spi/spi-axi-spi-engine.c
@@ -170,14 +170,10 @@ static void spi_engine_gen_sleep(struct 
spi_engine_program *p, bool dry,
   unsigned int t;
   int delay;

- if (xfer->delay_usecs) {
- delay = xfer->delay_usecs;
- } else {
- delay = spi_delay_to_ns(&xfer->delay, xfer);
- if (delay < 0)
- return;
- delay /= 1000;
- }
+ delay = spi_delay_to_ns(&xfer->delay, xfer);
+ if (delay < 0)
+ return;

Bit of a nit, but this could be `delay <= 0` and then drop the check for
`delay == 0` below.

hmm, that's a bit debatable, because the `delay == 0` check comes
after `delay /= 1000` ;
to do what you're suggesting, it would probably need a
DIV_ROUND_UP(delay, 1000) to make sure that even sub-microsecond
delays don't become zero;


Ah, true. Lets keep the code as it is.

On the other hand you could argue that we should round up to ensure the 
delay is at least as long as requested. But that is something that 
should be changed independently from this series.



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