[staging:staging-linus] BUILD SUCCESS faaff9765664009c1c7c65551d32e9ed3b1dda8f

2020-07-22 Thread kernel test robot
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 
 staging-linus
branch HEAD: faaff9765664009c1c7c65551d32e9ed3b1dda8f  staging: wlan-ng: 
properly check endpoint types

elapsed time: 722m

configs tested: 132
configs skipped: 3

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

arm defconfig
arm  allyesconfig
arm  allmodconfig
arm   allnoconfig
arm64allyesconfig
arm64   defconfig
arm64allmodconfig
arm64 allnoconfig
sh  rsk7264_defconfig
c6x defconfig
c6xevmc6474_defconfig
m68k amcore_defconfig
arm  simpad_defconfig
mips   sb1250_swarm_defconfig
arm shannon_defconfig
sparc64   allnoconfig
arm  footbridge_defconfig
s390 alldefconfig
powerpc   ppc64_defconfig
c6x   allnoconfig
s390  debug_defconfig
arm  pxa3xx_defconfig
m68km5407c3_defconfig
sh  sdk7780_defconfig
c6x dsk6455_defconfig
arm   h5000_defconfig
i386 allyesconfig
i386defconfig
i386  debian-10.3
i386  allnoconfig
ia64 allmodconfig
ia64defconfig
ia64  allnoconfig
ia64 allyesconfig
m68k allmodconfig
m68k  allnoconfig
m68k   sun3_defconfig
m68kdefconfig
m68k allyesconfig
nios2   defconfig
nios2allyesconfig
openriscdefconfig
c6x  allyesconfig
openrisc allyesconfig
nds32   defconfig
nds32 allnoconfig
csky allyesconfig
cskydefconfig
alpha   defconfig
alphaallyesconfig
xtensa   allyesconfig
h8300allyesconfig
h8300allmodconfig
xtensa  defconfig
arc defconfig
arc  allyesconfig
sh   allmodconfig
shallnoconfig
microblazeallnoconfig
mips allyesconfig
mips  allnoconfig
mips allmodconfig
pariscallnoconfig
parisc  defconfig
parisc   allyesconfig
parisc   allmodconfig
powerpc  allyesconfig
powerpc  rhel-kconfig
powerpc  allmodconfig
powerpc   allnoconfig
powerpc defconfig
i386 randconfig-a001-20200719
i386 randconfig-a006-20200719
i386 randconfig-a002-20200719
i386 randconfig-a005-20200719
i386 randconfig-a003-20200719
i386 randconfig-a004-20200719
i386 randconfig-a003-20200723
i386 randconfig-a005-20200723
i386 randconfig-a004-20200723
i386 randconfig-a006-20200723
i386 randconfig-a002-20200723
i386 randconfig-a001-20200723
i386 randconfig-a003-20200721
i386 randconfig-a005-20200721
i386 randconfig-a004-20200721
i386 randconfig-a006-20200721
i386 randconfig-a002-20200721
i386 randconfig-a001-20200721
x86_64   randconfig-a014-20200720
x86_64   randconfig-a015-20200720
x86_64   randconfig-a016-20200720
x86_64   randconfig-a012-20200720
x86_64   randconfig-a013-20200720
x86_64   randconfig-a011-20200720
i386 randconfig-a016-20200723
i386 randconfig-a013-20200723
i386 randconfig-a012-20200723
i386 randconfig-a015-20200723
i386 randconfig-a011-20200723
i386 

Re: [PATCH v8 08/12] device core: Introduce DMA range map, supplanting dma_pfn_offset

2020-07-22 Thread Jim Quinlan
On Tue, Jul 21, 2020 at 8:51 AM Christoph Hellwig  wrote:
>
> On Wed, Jul 15, 2020 at 10:35:11AM -0400, Jim Quinlan wrote:
> > The new field 'dma_range_map' in struct device is used to facilitate the
> > use of single or multiple offsets between mapping regions of cpu addrs and
> > dma addrs.  It subsumes the role of "dev->dma_pfn_offset" which was only
> > capable of holding a single uniform offset and had no region bounds
> > checking.
> >
> > The function of_dma_get_range() has been modified so that it takes a single
> > argument -- the device node -- and returns a map, NULL, or an error code.
> > The map is an array that holds the information regarding the DMA regions.
> > Each range entry contains the address offset, the cpu_start address, the
> > dma_start address, and the size of the region.
> >
> > of_dma_configure() is the typical manner to set range offsets but there are
> > a number of ad hoc assignments to "dev->dma_pfn_offset" in the kernel
> > driver code.  These cases now invoke the function
> > dma_attach_offset_range(dev, cpu_addr, dma_addr, size).
>
> So my main higher level issue here is the dma_attach_offset_range
> function.  I think it should keep the old functionality and just
> set a global range from 0 to (phys_addr_t)-1, and bail out if there
> are DMA ranges already:
>
> int dma_set_global_offset(struct device *dev, u64 offset);

Hi Christoph,

I had it this way in [V1...V5] but Robin requested that for V6 I
should change this function to
o add bounds to the call
o if there is a mapping already, check if what is requested is
already covered and return success.

Can you and Robin please discuss this and let me know which way to move forward?

>
>
> otherwise there is all kinds of minor nitpicks that aren't too
> substantial, let me know what you think of something like this
> hacked up version:
Kind of hard to see what you have changed but I will diff both of our
diffs and make the changes.

Thanks,
Jim Quinlan
Broadcom STB

>
>
> diff --git a/arch/arm/include/asm/dma-mapping.h 
> b/arch/arm/include/asm/dma-mapping.h
> index bdd80ddbca3451..2405afeb79573a 100644
> --- a/arch/arm/include/asm/dma-mapping.h
> +++ b/arch/arm/include/asm/dma-mapping.h
> @@ -35,8 +35,11 @@ static inline const struct dma_map_ops 
> *get_arch_dma_ops(struct bus_type *bus)
>  #ifndef __arch_pfn_to_dma
>  static inline dma_addr_t pfn_to_dma(struct device *dev, unsigned long pfn)
>  {
> -   if (dev)
> -   pfn -= dev->dma_pfn_offset;
> +   if (dev) {
> +   phys_addr_t paddr = PFN_PHYS(pfn);
> +
> +   pfn -= (dma_offset_from_phys_addr(dev, paddr) >> PAGE_SHIFT);
> +   }
> return (dma_addr_t)__pfn_to_bus(pfn);
>  }
>
> @@ -45,8 +48,7 @@ static inline unsigned long dma_to_pfn(struct device *dev, 
> dma_addr_t addr)
> unsigned long pfn = __bus_to_pfn(addr);
>
> if (dev)
> -   pfn += dev->dma_pfn_offset;
> -
> +   pfn += (dma_offset_from_dma_addr(dev, addr) >> PAGE_SHIFT);
> return pfn;
>  }
>
> diff --git a/arch/arm/mach-keystone/keystone.c 
> b/arch/arm/mach-keystone/keystone.c
> index 638808c4e12247..7539679205fbf7 100644
> --- a/arch/arm/mach-keystone/keystone.c
> +++ b/arch/arm/mach-keystone/keystone.c
> @@ -8,6 +8,7 @@
>   */
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -24,8 +25,6 @@
>
>  #include "keystone.h"
>
> -static unsigned long keystone_dma_pfn_offset __read_mostly;
> -
>  static int keystone_platform_notifier(struct notifier_block *nb,
>   unsigned long event, void *data)
>  {
> @@ -38,9 +37,12 @@ static int keystone_platform_notifier(struct 
> notifier_block *nb,
> return NOTIFY_BAD;
>
> if (!dev->of_node) {
> -   dev->dma_pfn_offset = keystone_dma_pfn_offset;
> -   dev_err(dev, "set dma_pfn_offset%08lx\n",
> -   dev->dma_pfn_offset);
> +   int ret = dma_set_offset_range(dev, KEYSTONE_HIGH_PHYS_START,
> +   KEYSTONE_LOW_PHYS_START,
> +   KEYSTONE_HIGH_PHYS_SIZE);
> +   dev_err(dev, "set dma_offset%08llx%s\n",
> +   KEYSTONE_HIGH_PHYS_START - KEYSTONE_LOW_PHYS_START,
> +   ret ? " failed" : "");
> }
> return NOTIFY_OK;
>  }
> @@ -51,11 +53,8 @@ static struct notifier_block platform_nb = {
>
>  static void __init keystone_init(void)
>  {
> -   if (PHYS_OFFSET >= KEYSTONE_HIGH_PHYS_START) {
> -   keystone_dma_pfn_offset = PFN_DOWN(KEYSTONE_HIGH_PHYS_START -
> -  KEYSTONE_LOW_PHYS_START);
> +   if (PHYS_OFFSET >= KEYSTONE_HIGH_PHYS_START)
> bus_register_notifier(_bus_type, _nb);
> -   }
> keystone_pm_runtime_init();
>  }
>
> diff --git a/arch/sh/drivers/pci/pcie-sh7786.c 
> 

[PATCH v2] media: cedrus: Add support for VP8 decoding

2020-07-22 Thread Jernej Skrabec
VP8 in Cedrus shares same engine as H264.

Note that it seems necessary to call bitstream parsing functions,
to parse frame header, otherwise decoded image is garbage. This is
contrary to what is driver supposed to do. However, values are not
really used, so this might be acceptable. It's possible that bitstream
parsing functions set some internal VPU state, which is later necessary
for proper decoding. Biggest suspect is "VP8 probs update" trigger.

Signed-off-by: Jernej Skrabec 
---
Changes in v2:
- rebased on top of current linux-media master branch

 drivers/staging/media/sunxi/cedrus/Makefile   |   3 +-
 drivers/staging/media/sunxi/cedrus/cedrus.c   |   8 +
 drivers/staging/media/sunxi/cedrus/cedrus.h   |  15 +
 .../staging/media/sunxi/cedrus/cedrus_dec.c   |   5 +
 .../staging/media/sunxi/cedrus/cedrus_hw.c|   1 +
 .../staging/media/sunxi/cedrus/cedrus_regs.h  |  80 ++
 .../staging/media/sunxi/cedrus/cedrus_video.c |   9 +
 .../staging/media/sunxi/cedrus/cedrus_vp8.c   | 699 ++
 8 files changed, 819 insertions(+), 1 deletion(-)
 create mode 100644 drivers/staging/media/sunxi/cedrus/cedrus_vp8.c

diff --git a/drivers/staging/media/sunxi/cedrus/Makefile 
b/drivers/staging/media/sunxi/cedrus/Makefile
index 1bce49d3e7e2..a647b3690bf8 100644
--- a/drivers/staging/media/sunxi/cedrus/Makefile
+++ b/drivers/staging/media/sunxi/cedrus/Makefile
@@ -2,4 +2,5 @@
 obj-$(CONFIG_VIDEO_SUNXI_CEDRUS) += sunxi-cedrus.o
 
 sunxi-cedrus-y = cedrus.o cedrus_video.o cedrus_hw.o cedrus_dec.o \
-cedrus_mpeg2.o cedrus_h264.o cedrus_h265.o
+cedrus_mpeg2.o cedrus_h264.o cedrus_h265.o \
+cedrus_vp8.o
diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.c 
b/drivers/staging/media/sunxi/cedrus/cedrus.c
index bc27f9430eeb..b2f5f03ad4a3 100644
--- a/drivers/staging/media/sunxi/cedrus/cedrus.c
+++ b/drivers/staging/media/sunxi/cedrus/cedrus.c
@@ -135,6 +135,13 @@ static const struct cedrus_control cedrus_controls[] = {
.codec  = CEDRUS_CODEC_H265,
.required   = false,
},
+   {
+   .cfg = {
+   .id = V4L2_CID_MPEG_VIDEO_VP8_FRAME_HEADER,
+   },
+   .codec  = CEDRUS_CODEC_VP8,
+   .required   = true,
+   },
 };
 
 #define CEDRUS_CONTROLS_COUNT  ARRAY_SIZE(cedrus_controls)
@@ -381,6 +388,7 @@ static int cedrus_probe(struct platform_device *pdev)
dev->dec_ops[CEDRUS_CODEC_MPEG2] = _dec_ops_mpeg2;
dev->dec_ops[CEDRUS_CODEC_H264] = _dec_ops_h264;
dev->dec_ops[CEDRUS_CODEC_H265] = _dec_ops_h265;
+   dev->dec_ops[CEDRUS_CODEC_VP8] = _dec_ops_vp8;
 
mutex_init(>dev_mutex);
 
diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.h 
b/drivers/staging/media/sunxi/cedrus/cedrus.h
index 9676ab8a..9f4605afa0f4 100644
--- a/drivers/staging/media/sunxi/cedrus/cedrus.h
+++ b/drivers/staging/media/sunxi/cedrus/cedrus.h
@@ -35,6 +35,7 @@ enum cedrus_codec {
CEDRUS_CODEC_MPEG2,
CEDRUS_CODEC_H264,
CEDRUS_CODEC_H265,
+   CEDRUS_CODEC_VP8,
CEDRUS_CODEC_LAST,
 };
 
@@ -75,6 +76,10 @@ struct cedrus_h265_run {
const struct v4l2_ctrl_hevc_slice_params*slice_params;
 };
 
+struct cedrus_vp8_run {
+   const struct v4l2_ctrl_vp8_frame_header *slice_params;
+};
+
 struct cedrus_run {
struct vb2_v4l2_buffer  *src;
struct vb2_v4l2_buffer  *dst;
@@ -83,6 +88,7 @@ struct cedrus_run {
struct cedrus_h264_run  h264;
struct cedrus_mpeg2_run mpeg2;
struct cedrus_h265_run  h265;
+   struct cedrus_vp8_run   vp8;
};
 };
 
@@ -134,6 +140,14 @@ struct cedrus_ctx {
void*neighbor_info_buf;
dma_addr_t  neighbor_info_buf_addr;
} h265;
+   struct {
+   unsigned intlast_frame_p_type;
+   unsigned intlast_filter_type;
+   unsigned intlast_sharpness_level;
+
+   u8  *entropy_probs_buf;
+   dma_addr_t  entropy_probs_buf_dma;
+   } vp8;
} codec;
 };
 
@@ -180,6 +194,7 @@ struct cedrus_dev {
 extern struct cedrus_dec_ops cedrus_dec_ops_mpeg2;
 extern struct cedrus_dec_ops cedrus_dec_ops_h264;
 extern struct cedrus_dec_ops cedrus_dec_ops_h265;
+extern struct cedrus_dec_ops cedrus_dec_ops_vp8;
 
 static inline void cedrus_write(struct cedrus_dev *dev, u32 reg, u32 val)
 {
diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_dec.c 
b/drivers/staging/media/sunxi/cedrus/cedrus_dec.c
index 58c48e4fdfe9..47c079f14c74 100644
--- a/drivers/staging/media/sunxi/cedrus/cedrus_dec.c
+++ b/drivers/staging/media/sunxi/cedrus/cedrus_dec.c
@@ -68,6 +68,11 @@ void cedrus_device_run(void *priv)
V4L2_CID_MPEG_VIDEO_HEVC_SLICE_PARAMS);
 

Re: [PATCH] staging: octeon: Indent with tabs instead of spaces

2020-07-22 Thread Joe Perches
On Wed, 2020-07-22 at 22:19 +0500, Muhammad Usama Anjum wrote:
> Remove a coding style error. It makes code more readable.
[]
> diff --git a/drivers/staging/octeon/ethernet-defines.h 
> b/drivers/staging/octeon/ethernet-defines.h
[]
> @@ -27,14 +27,14 @@
>  #define REUSE_SKBUFFS_WITHOUT_FREE  1
>  #endif
>  
> -#define USE_ASYNC_IOBDMA(CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE > 0)
> +#define USE_ASYNC_IOBDMA (CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE > 0)
>  
>  /* Maximum number of SKBs to try to free per xmit packet. */
> -#define MAX_OUT_QUEUE_DEPTH 1000
> +#define MAX_OUT_QUEUE_DEPTH  1000
>  
>  #define FAU_TOTAL_TX_TO_CLEAN (CVMX_FAU_REG_END - sizeof(u32))

If you really like alignment to tabstop,
why not align FAU_TOTAL_TX_TO_CLEAN too?


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


[PATCH] staging: octeon: Indent with tabs instead of spaces

2020-07-22 Thread Muhammad Usama Anjum
Remove a coding style error. It makes code more readable.

Signed-off-by: Muhammad Usama Anjum 
---
 drivers/staging/octeon/ethernet-defines.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/octeon/ethernet-defines.h 
b/drivers/staging/octeon/ethernet-defines.h
index ef9e767b0e2e..40f91c78e462 100644
--- a/drivers/staging/octeon/ethernet-defines.h
+++ b/drivers/staging/octeon/ethernet-defines.h
@@ -27,14 +27,14 @@
 #define REUSE_SKBUFFS_WITHOUT_FREE  1
 #endif
 
-#define USE_ASYNC_IOBDMA(CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE > 0)
+#define USE_ASYNC_IOBDMA   (CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE > 0)
 
 /* Maximum number of SKBs to try to free per xmit packet. */
-#define MAX_OUT_QUEUE_DEPTH 1000
+#define MAX_OUT_QUEUE_DEPTH1000
 
 #define FAU_TOTAL_TX_TO_CLEAN (CVMX_FAU_REG_END - sizeof(u32))
 #define FAU_NUM_PACKET_BUFFERS_TO_FREE (FAU_TOTAL_TX_TO_CLEAN - sizeof(u32))
 
-#define TOTAL_NUMBER_OF_PORTS   (CVMX_PIP_NUM_INPUT_PORTS + 1)
+#define TOTAL_NUMBER_OF_PORTS  (CVMX_PIP_NUM_INPUT_PORTS + 1)
 
 #endif /* __ETHERNET_DEFINES_H__ */
-- 
2.17.1

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


[PATCH] staging: wlan-ng: properly check endpoint types

2020-07-22 Thread Rustam Kovhaev
As syzkaller detected, wlan-ng driver does not do sanity check of
endpoints in prism2sta_probe_usb(), add check for xfer direction and type

Reported-and-tested-by: syzbot+c2a1fa67c02faa0de...@syzkaller.appspotmail.com
Link: https://syzkaller.appspot.com/bug?extid=c2a1fa67c02faa0de723
Signed-off-by: Rustam Kovhaev 
---
 drivers/staging/wlan-ng/prism2usb.c | 16 +++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/wlan-ng/prism2usb.c 
b/drivers/staging/wlan-ng/prism2usb.c
index 4689b2170e4f..456603fd26c0 100644
--- a/drivers/staging/wlan-ng/prism2usb.c
+++ b/drivers/staging/wlan-ng/prism2usb.c
@@ -61,11 +61,25 @@ static int prism2sta_probe_usb(struct usb_interface 
*interface,
   const struct usb_device_id *id)
 {
struct usb_device *dev;
-
+   const struct usb_endpoint_descriptor *epd;
+   const struct usb_host_interface *iface_desc = interface->cur_altsetting;
struct wlandevice *wlandev = NULL;
struct hfa384x *hw = NULL;
int result = 0;
 
+   if (iface_desc->desc.bNumEndpoints != 2) {
+   result = -ENODEV;
+   goto failed;
+   }
+
+   result = -EINVAL;
+   epd = _desc->endpoint[1].desc;
+   if (!usb_endpoint_is_bulk_in(epd))
+   goto failed;
+   epd = _desc->endpoint[2].desc;
+   if (!usb_endpoint_is_bulk_out(epd))
+   goto failed;
+
dev = interface_to_usbdev(interface);
wlandev = create_wlan();
if (!wlandev) {
-- 
2.27.0

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


[PATCH v5 9/9] arm64: dts: rockchip: add isp and sensors for Scarlet

2020-07-22 Thread Helen Koike
From: Eddie Cai 

Enable ISP and camera sensor ov2685 and ov5695 for Scarlet Chromebook

Verified with:
make ARCH=arm64 dtbs_check

Signed-off-by: Shunqian Zheng 
Signed-off-by: Eddie Cai 
Signed-off-by: Tomasz Figa 
Signed-off-by: Helen Koike 
---

This patch is based on:
https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/527854

Changes in V3:
- This patch was first submitted stand alone at
https://lore.kernel.org/patchwork/patch/1223736/
I'm including in this patch series without changes
---
 .../boot/dts/rockchip/rk3399-gru-scarlet.dtsi | 74 +++
 1 file changed, 74 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-gru-scarlet.dtsi 
b/arch/arm64/boot/dts/rockchip/rk3399-gru-scarlet.dtsi
index 4373ed732af76..ae08205aa8e24 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-gru-scarlet.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-gru-scarlet.dtsi
@@ -296,6 +296,52 @@ camera:  {
 
/* 24M mclk is shared between world and user cameras */
pinctrl-0 = <_xfer _clkout1>;
+
+   /* Rear-facing camera */
+   wcam: camera@36 {
+   compatible = "ovti,ov5695";
+   reg = <0x36>;
+   pinctrl-names = "default";
+   pinctrl-0 = <_rst>;
+
+   clocks = < SCLK_TESTCLKOUT1>;
+   clock-names = "xvclk";
+
+   avdd-supply = <_cam>;
+   dvdd-supply = <_cam>;
+   dovdd-supply = <_s0>;
+   reset-gpios = < 5 GPIO_ACTIVE_LOW>;
+
+   port {
+   wcam_out: endpoint {
+   remote-endpoint = <_in_wcam>;
+   data-lanes = <1 2>;
+   };
+   };
+   };
+
+   /* Front-facing camera */
+   ucam: camera@3c {
+   compatible = "ovti,ov2685";
+   reg = <0x3c>;
+   pinctrl-names = "default";
+   pinctrl-0 = <_rst>;
+
+   clocks = < SCLK_TESTCLKOUT1>;
+   clock-names = "xvclk";
+
+   avdd-supply = <_cam>;
+   dovdd-supply = <_s0>;
+   dvdd-supply = <_s0>;
+   reset-gpios = < 3 GPIO_ACTIVE_LOW>;
+
+   port {
+   ucam_out: endpoint {
+   remote-endpoint = <_in_ucam>;
+   data-lanes = <1>;
+   };
+   };
+   };
 };
 
 _dp {
@@ -353,10 +399,38 @@ _domains {
gpio1830-supply = <_s0>; /* APIO4_VDD;  4c 4d */
 };
 
+ {
+   status = "okay";
+
+   ports {
+   port@0 {
+   mipi_in_wcam: endpoint@0 {
+   reg = <0>;
+   remote-endpoint = <_out>;
+   data-lanes = <1 2>;
+   };
+
+   mipi_in_ucam: endpoint@1 {
+   reg = <1>;
+   remote-endpoint = <_out>;
+   data-lanes = <1>;
+   };
+   };
+   };
+};
+
+_mmu {
+   status = "okay";
+};
+
  {
sdmode-gpios = < 2 GPIO_ACTIVE_HIGH>;
 };
 
+_dphy_rx0 {
+   status = "okay";
+};
+
 _dsi {
status = "okay";
clock-master;
-- 
2.28.0.rc1

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


[PATCH v5 8/9] arm64: dts: rockchip: add isp0 node for rk3399

2020-07-22 Thread Helen Koike
From: Shunqian Zheng 

RK3399 has two ISPs, but only isp0 was tested.
Add isp0 node in rk3399 dtsi

Verified with:
make ARCH=arm64 dtbs_check 
DT_SCHEMA_FILES=Documentation/devicetree/bindings/media/rockchip-isp1.yaml

Signed-off-by: Shunqian Zheng 
Signed-off-by: Jacob Chen 
Signed-off-by: Helen Koike 

---

V4:
- update clock names

V3:
- clean up clocks

V2:
- re-order power-domains property

V1:
This patch was originally part of this patchset:

https://patchwork.kernel.org/patch/10267431/

The only difference is:
- add phy properties
- add ports
---
 arch/arm64/boot/dts/rockchip/rk3399.dtsi | 25 
 1 file changed, 25 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi 
b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
index dba9641947a3a..ed8ba75dbbce8 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
@@ -1721,6 +1721,31 @@ vopb_mmu: iommu@ff903f00 {
status = "disabled";
};
 
+   isp0: isp0@ff91 {
+   compatible = "rockchip,rk3399-cif-isp";
+   reg = <0x0 0xff91 0x0 0x4000>;
+   interrupts = ;
+   clocks = < SCLK_ISP0>,
+< ACLK_ISP0_WRAPPER>,
+< HCLK_ISP0_WRAPPER>;
+   clock-names = "isp", "aclk", "hclk";
+   iommus = <_mmu>;
+   phys = <_dphy_rx0>;
+   phy-names = "dphy";
+   power-domains = < RK3399_PD_ISP0>;
+
+   ports {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   port@0 {
+   reg = <0>;
+   #address-cells = <1>;
+   #size-cells = <0>;
+   };
+   };
+   };
+
isp0_mmu: iommu@ff914000 {
compatible = "rockchip,iommu";
reg = <0x0 0xff914000 0x0 0x100>, <0x0 0xff915000 0x0 0x100>;
-- 
2.28.0.rc1

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


[PATCH v5 7/9] media: MAINTAINERS: rkisp1: add path to dt-bindings

2020-07-22 Thread Helen Koike
The Rockchip ISP bindings was moved out of staging.
Update MAINTAINERS file with the new path.

Fields sorted according to output of
./scripts/parse-maintainers.pl --input=MAINTAINERS --output=MAINTAINERS
--order

Signed-off-by: Helen Koike 

---

V3:
- Add line:
L: linux-rockc...@lists.infradead.org
- Re-order:
F: drivers/staging/media/rkisp1/

V2:
- This is a new patch in the series
---
 MAINTAINERS | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 5392f00cec46d..bfd947ea5c920 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -14717,7 +14717,9 @@ F:  include/linux/hid-roccat*
 ROCKCHIP ISP V1 DRIVER
 M: Helen Koike 
 L: linux-me...@vger.kernel.org
+L: linux-rockc...@lists.infradead.org
 S: Maintained
+F: Documentation/devicetree/bindings/media/rockchip-isp1.yaml
 F: drivers/staging/media/rkisp1/
 
 ROCKCHIP RASTER 2D GRAPHIC ACCELERATION UNIT DRIVER
-- 
2.28.0.rc1

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


[PATCH v5 6/9] dt-bindings: media: rkisp1: move rockchip-isp1 bindings out of staging

2020-07-22 Thread Helen Koike
Move rkisp1 bindings to Documentation/devicetree/bindings/media

Verified with:
make ARCH=arm64 dt_binding_check 
DT_SCHEMA_FILES=Documentation/devicetree/bindings/media/rockchip-isp1.yaml

Signed-off-by: Helen Koike 
Acked-by: Rob Herring 
---
 .../devicetree/bindings/media/rockchip-isp1.yaml  | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename {drivers/staging/media/rkisp1/Documentation => 
Documentation}/devicetree/bindings/media/rockchip-isp1.yaml (100%)

diff --git 
a/drivers/staging/media/rkisp1/Documentation/devicetree/bindings/media/rockchip-isp1.yaml
 b/Documentation/devicetree/bindings/media/rockchip-isp1.yaml
similarity index 100%
rename from 
drivers/staging/media/rkisp1/Documentation/devicetree/bindings/media/rockchip-isp1.yaml
rename to Documentation/devicetree/bindings/media/rockchip-isp1.yaml
-- 
2.28.0.rc1

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


[PATCH v5 2/9] media: staging: dt-bindings: rkisp1: drop i2c unit address

2020-07-22 Thread Helen Koike
Add missing required items in Rockchip ISP1 dt-bindings example for
a complete i2c node.
Drop unit address to Fix error:
/example-0/parent/i2c@ff16: node has a unit name, but no reg or ranges 
property
Remove unecessary fields for the example.

Signed-off-by: Helen Koike 
---

Changes in v5:
- Patch re-written to drop unity address instead of completing i2c node

Changes in v2:
- new patch in the series

tmp: i2c drop fields
---
 .../Documentation/devicetree/bindings/media/rockchip-isp1.yaml | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git 
a/drivers/staging/media/rkisp1/Documentation/devicetree/bindings/media/rockchip-isp1.yaml
 
b/drivers/staging/media/rkisp1/Documentation/devicetree/bindings/media/rockchip-isp1.yaml
index a77b6ec500c95..4c31cfaee2709 100644
--- 
a/drivers/staging/media/rkisp1/Documentation/devicetree/bindings/media/rockchip-isp1.yaml
+++ 
b/drivers/staging/media/rkisp1/Documentation/devicetree/bindings/media/rockchip-isp1.yaml
@@ -168,8 +168,7 @@ examples:
 };
 };
 
-i2c7: i2c@ff16 {
-clock-frequency = <40>;
+i2c7: i2c {
 #address-cells = <1>;
 #size-cells = <0>;
 
-- 
2.28.0.rc1

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


[PATCH v5 1/9] media: staging: dt-bindings: rkisp1: add missing required nodes

2020-07-22 Thread Helen Koike
Add missing required nodes in json-schema yaml file for
Rockchip ISP1 dt-bindings.

Signed-off-by: Helen Koike 
Acked-by: Rob Herring 
---

Changes in v2:
- New patch in the series
---
 .../devicetree/bindings/media/rockchip-isp1.yaml  | 8 
 1 file changed, 8 insertions(+)

diff --git 
a/drivers/staging/media/rkisp1/Documentation/devicetree/bindings/media/rockchip-isp1.yaml
 
b/drivers/staging/media/rkisp1/Documentation/devicetree/bindings/media/rockchip-isp1.yaml
index af246b71eac6b..a77b6ec500c95 100644
--- 
a/drivers/staging/media/rkisp1/Documentation/devicetree/bindings/media/rockchip-isp1.yaml
+++ 
b/drivers/staging/media/rkisp1/Documentation/devicetree/bindings/media/rockchip-isp1.yaml
@@ -94,11 +94,19 @@ properties:
 
   remote-endpoint: true
 
+required:
+  - reg
+  - "#address-cells"
+  - "#size-cells"
+
 required:
+  - "#address-cells"
+  - "#size-cells"
   - port@0
 
 required:
   - compatible
+  - reg
   - interrupts
   - clocks
   - clock-names
-- 
2.28.0.rc1

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


[PATCH v5 5/9] media: staging: rkisp1: remove unecessary clocks

2020-07-22 Thread Helen Koike
aclk_isp_wrap is a child of aclk_isp, and hclk_isp_wrap is a child of
hclk_isp, thus we can remove parents from the list.

Also, for the isp0, we only need the ISP clock, ACLK and HCLK.
In the future we'll need a pixel clock for RK3288 and RK3399, and a JPEG
clock for RK3288.

So with the goal to cleanup the dt-bindings and remove it from staging,
simplify clock names to isp, aclk and hclk.

Assigned clocks are meant to refer to the full path in the clock tree,
i.e. the leaf in the tree.
For instance, in RK3399, the clock responsible for ACLK (ISP AXI CLOCK)
is aclk_isp0_wrapper.

For reference, this is the isp clock topology on RK3399:

 xin24m
pll_npll
   npll
  clk_isp1
  clk_isp0
pll_cpll
   cpll
  aclk_isp1
 aclk_isp1_noc
 hclk_isp1
aclk_isp1_wrapper
hclk_isp1_noc
  aclk_isp0
 hclk_isp1_wrapper
 aclk_isp0_wrapper
 aclk_isp0_noc
 hclk_isp0
hclk_isp0_wrapper
hclk_isp0_noc
 pclkin_isp1_wrapper

Signed-off-by: Helen Koike 

---
Changes in V5:
- Use if/then schema as suggested by Rob Herring on
https://patchwork.linuxtv.org/project/linux-media/patch/20200702191322.2639681-6-helen.ko...@collabora.com/#119729

Changes in V4:
- update binding according to suggestion by Robin Murphy
on https://patchwork.kernel.org/patch/11475007/

Changes in V3:
- this is a new patch in the series
---
 .../bindings/media/rockchip-isp1.yaml | 50 ---
 drivers/staging/media/rkisp1/rkisp1-dev.c |  8 ++-
 2 files changed, 36 insertions(+), 22 deletions(-)

diff --git 
a/drivers/staging/media/rkisp1/Documentation/devicetree/bindings/media/rockchip-isp1.yaml
 
b/drivers/staging/media/rkisp1/Documentation/devicetree/bindings/media/rockchip-isp1.yaml
index 62a6b9c959498..23c677d15037a 100644
--- 
a/drivers/staging/media/rkisp1/Documentation/devicetree/bindings/media/rockchip-isp1.yaml
+++ 
b/drivers/staging/media/rkisp1/Documentation/devicetree/bindings/media/rockchip-isp1.yaml
@@ -24,20 +24,10 @@ properties:
 maxItems: 1
 
   clocks:
-items:
-  - description: ISP clock
-  - description: ISP AXI clock clock
-  - description: ISP AXI clock  wrapper clock
-  - description: ISP AHB clock clock
-  - description: ISP AHB wrapper clock
+minItems: 3
 
   clock-names:
-items:
-  - const: clk_isp
-  - const: aclk_isp
-  - const: aclk_isp_wrap
-  - const: hclk_isp
-  - const: hclk_isp_wrap
+minItems: 3
 
   iommus:
 maxItems: 1
@@ -116,6 +106,34 @@ required:
   - power-domains
   - ports
 
+if:
+  properties:
+compatible:
+  contains:
+const: rockchip,rk3399-cif-isp
+then:
+  properties:
+clocks:
+  maxItems: 4
+  minItems: 3
+  items:
+# isp0 and isp1
+- description: ISP clock
+- description: ISP AXI clock
+- description: ISP AHB clock
+# only for isp1
+- description: ISP Pixel clock
+clock-names:
+  maxItems: 4
+  minItems: 3
+  items:
+# isp0 and isp1
+- const: isp
+- const: aclk
+- const: hclk
+# only for isp1
+- const: pclk_isp
+
 additionalProperties: false
 
 examples:
@@ -134,11 +152,9 @@ examples:
 reg = <0x0 0xff91 0x0 0x4000>;
 interrupts = ;
 clocks = < SCLK_ISP0>,
- < ACLK_ISP0>, < ACLK_ISP0_WRAPPER>,
- < HCLK_ISP0>, < HCLK_ISP0_WRAPPER>;
-clock-names = "clk_isp",
-  "aclk_isp", "aclk_isp_wrap",
-  "hclk_isp", "hclk_isp_wrap";
+ < ACLK_ISP0_WRAPPER>,
+ < HCLK_ISP0_WRAPPER>;
+clock-names = "isp", "aclk", "hclk";
 iommus = <_mmu>;
 phys = <>;
 phy-names = "dphy";
diff --git a/drivers/staging/media/rkisp1/rkisp1-dev.c 
b/drivers/staging/media/rkisp1/rkisp1-dev.c
index a0eb8f08708b9..1ebf10a6f188c 100644
--- a/drivers/staging/media/rkisp1/rkisp1-dev.c
+++ b/drivers/staging/media/rkisp1/rkisp1-dev.c
@@ -406,11 +406,9 @@ static irqreturn_t rkisp1_isr(int irq, void *ctx)
 }
 
 static const char * const rk3399_isp_clks[] = {
-   "clk_isp",
-   "aclk_isp",
-   "hclk_isp",
-   "aclk_isp_wrap",
-   "hclk_isp_wrap",
+   "isp",
+   "aclk",
+   "hclk",
 };
 
 static const struct rkisp1_match_data rk3399_isp_clk_data = {
-- 
2.28.0.rc1

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


[PATCH v5 4/9] media: staging: dt-bindings: rkisp1: drop parent unit address

2020-07-22 Thread Helen Koike
Fix the following error found with make ARCH=arm64 dt_binding_check:

Documentation/devicetree/bindings/media/rockchip-isp1.example.dts:24.27-101.11:
Warning (unit_address_vs_reg): /example-0/parent@0: node has a unit name, but 
no reg or ranges property

Reported-by: Johan Jonker 
Signed-off-by: Helen Koike 
---
V5:
- Patch re-written to drop the unit address instead of adding reg

V3:
- this is a new patch in the series
---
 .../Documentation/devicetree/bindings/media/rockchip-isp1.yaml  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/drivers/staging/media/rkisp1/Documentation/devicetree/bindings/media/rockchip-isp1.yaml
 
b/drivers/staging/media/rkisp1/Documentation/devicetree/bindings/media/rockchip-isp1.yaml
index 79ebacab83cf3..62a6b9c959498 100644
--- 
a/drivers/staging/media/rkisp1/Documentation/devicetree/bindings/media/rockchip-isp1.yaml
+++ 
b/drivers/staging/media/rkisp1/Documentation/devicetree/bindings/media/rockchip-isp1.yaml
@@ -125,7 +125,7 @@ examples:
 #include 
 #include 
 
-parent0: parent@0 {
+parent0: parent {
 #address-cells = <2>;
 #size-cells = <2>;
 
-- 
2.28.0.rc1

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


[PATCH v5 3/9] media: staging: dt-bindings: rkisp1: re-order properties

2020-07-22 Thread Helen Koike
Organize properties order in dt-bindings to move it out of staging.

On top: compatible, reg and interrupts.
Then alphabetical order, then properties starting with '#'.

Signed-off-by: Helen Koike 
Acked-by: Rob Herring 
---
V5:
- s/binbings/bindings

V2:
- this is a new patch in the series
---
 .../bindings/media/rockchip-isp1.yaml | 32 +--
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git 
a/drivers/staging/media/rkisp1/Documentation/devicetree/bindings/media/rockchip-isp1.yaml
 
b/drivers/staging/media/rkisp1/Documentation/devicetree/bindings/media/rockchip-isp1.yaml
index 4c31cfaee2709..79ebacab83cf3 100644
--- 
a/drivers/staging/media/rkisp1/Documentation/devicetree/bindings/media/rockchip-isp1.yaml
+++ 
b/drivers/staging/media/rkisp1/Documentation/devicetree/bindings/media/rockchip-isp1.yaml
@@ -23,19 +23,6 @@ properties:
   interrupts:
 maxItems: 1
 
-  iommus:
-maxItems: 1
-
-  power-domains:
-maxItems: 1
-
-  phys:
-maxItems: 1
-description: phandle for the PHY port
-
-  phy-names:
-const: dphy
-
   clocks:
 items:
   - description: ISP clock
@@ -52,6 +39,19 @@ properties:
   - const: hclk_isp
   - const: hclk_isp_wrap
 
+  iommus:
+maxItems: 1
+
+  phys:
+maxItems: 1
+description: phandle for the PHY port
+
+  phy-names:
+const: dphy
+
+  power-domains:
+maxItems: 1
+
   # See ./video-interfaces.txt for details
   ports:
 type: object
@@ -110,10 +110,10 @@ required:
   - interrupts
   - clocks
   - clock-names
-  - power-domains
   - iommus
   - phys
   - phy-names
+  - power-domains
   - ports
 
 additionalProperties: false
@@ -139,19 +139,19 @@ examples:
 clock-names = "clk_isp",
   "aclk_isp", "aclk_isp_wrap",
   "hclk_isp", "hclk_isp_wrap";
-power-domains = < RK3399_PD_ISP0>;
 iommus = <_mmu>;
 phys = <>;
 phy-names = "dphy";
+power-domains = < RK3399_PD_ISP0>;
 
 ports {
 #address-cells = <1>;
 #size-cells = <0>;
 
 port@0 {
+reg = <0>;
 #address-cells = <1>;
 #size-cells = <0>;
-reg = <0>;
 
 mipi_in_wcam: endpoint@0 {
 reg = <0>;
-- 
2.28.0.rc1

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


[PATCH v5 0/9] move Rockchip ISP bindings out of staging / add ISP DT nodes for RK3399

2020-07-22 Thread Helen Koike
Move the bindings out of drivers/staging and place them in
Documentation/devicetree/bindings instead.

Also, add DT nodes for RK3399 and verify with make ARCH=arm64 dtbs_check
and make ARCH=arm64 dt_binding_check.

Tested by verifying images streamed from Scarlet Chromebook

Changes in v5:
- Drop unit addresses in dt-bindings example for simplification and fix
errors as suggested by Rob Herring in previous version
- Fix typos
- Re-write clock organization with if/then schema

Changes in v4:
- simplify clocks with "isp", "aclk" and "hclk" as suggested by
Robin Murphy on https://patchwork.kernel.org/patch/11475007/

Changes in v3:
- dropped accepted patches
- cleanup clocks
- fix "no reg" error in dt-bindings parent@0 example
- add linux-rockchip list in MAINTAINERS and reorder items
- add Scarlet sensors dt nodes to the series

Changes in v2:
Add patches modifying bindings, as sugested by Johan Jonker in v1,
before moving them out of staging.

Eddie Cai (1):
  arm64: dts: rockchip: add isp and sensors for Scarlet

Helen Koike (7):
  media: staging: dt-bindings: rkisp1: add missing required nodes
  media: staging: dt-bindings: rkisp1: drop i2c unit address
  media: staging: dt-bindings: rkisp1: re-order properties
  media: staging: dt-bindings: rkisp1: drop parent unit address
  media: staging: rkisp1: remove unecessary clocks
  dt-bindings: media: rkisp1: move rockchip-isp1 bindings out of staging
  media: MAINTAINERS: rkisp1: add path to dt-bindings

Shunqian Zheng (1):
  arm64: dts: rockchip: add isp0 node for rk3399

 .../bindings/media/rockchip-isp1.yaml | 81 ---
 MAINTAINERS   |  2 +
 .../boot/dts/rockchip/rk3399-gru-scarlet.dtsi | 74 +
 arch/arm64/boot/dts/rockchip/rk3399.dtsi  | 25 ++
 drivers/staging/media/rkisp1/rkisp1-dev.c |  8 +-
 5 files changed, 156 insertions(+), 34 deletions(-)
 rename {drivers/staging/media/rkisp1/Documentation => 
Documentation}/devicetree/bindings/media/rockchip-isp1.yaml (80%)

-- 
2.28.0.rc1

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


[PATCH] staging: octeon: Add the license identifier

2020-07-22 Thread Muhammad Usama Anjum
This patch fixes the checkpatch.pl warning:
WARNING: Missing or malformed SPDX-License-Identifier tag

Add a the SPDX-License-Identifier tag on line 1

Signed-off-by: Muhammad Usama Anjum 
---
 drivers/staging/octeon/octeon-stubs.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/octeon/octeon-stubs.h 
b/drivers/staging/octeon/octeon-stubs.h
index d06743504f2b..889b7c80666d 100644
--- a/drivers/staging/octeon/octeon-stubs.h
+++ b/drivers/staging/octeon/octeon-stubs.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
 #define CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE   512
 
 #ifndef XKPHYS_TO_PHYS
-- 
2.17.1

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


[PATCH] staging: rtl8188eu: Fix an indent coding style issue

2020-07-22 Thread Mrinal Pandey
Only a single tab space is required after the if statement.
Fix this issue by running scripts/checkpatch.pl on the file.

Signed-off-by: Mrinal Pandey 
---
 drivers/staging/rtl8188eu/core/rtw_recv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c 
b/drivers/staging/rtl8188eu/core/rtw_recv.c
index 656fe70ae4fb..0a4c1b2686b5 100644
--- a/drivers/staging/rtl8188eu/core/rtw_recv.c
+++ b/drivers/staging/rtl8188eu/core/rtw_recv.c
@@ -671,8 +671,8 @@ static int sta2sta_data_frame(struct adapter *adapter,
if (mcast) {
/*  For AP mode, if DA == MCAST, then BSSID should be 
also MCAST */
if (!is_multicast_ether_addr(pattrib->bssid)) {
-   ret = _FAIL;
-   goto exit;
+   ret = _FAIL;
+   goto exit;
}
} else { /*  not mc-frame */
/*  For AP mode, if DA is non-MCAST, then it must be 
BSSID, and bssid == BSSID */
-- 
2.25.1



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


[PATCH v3 2/2] media: atomisp: Fix coding style issue - correct multiline comments

2020-07-22 Thread Rahul Gottipati
This fixes some coding style issues of multiline comments to
correct a few checkpatch.pl warnings.

Signed-off-by: Rahul Gottipati 
---

Changes in v3:
Made changes to keep first line blank in multiline comments.
Changes in v2:
Distributed changes across 2 patches instead of the previous 1.

 .../staging/media/atomisp/pci/atomisp_ioctl.c | 26 ---
 1 file changed, 17 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c 
b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
index 4fc4bdd85ce0..3d609753e0af 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
@@ -1275,13 +1275,15 @@ static int atomisp_qbuf(struct file *file, void *fh, 
struct v4l2_buffer *buf)
}
}
 
-   /* Workaround: Due to the design of HALv3,
+   /*
+* Workaround: Due to the design of HALv3,
 * sometimes in ZSL or SDV mode HAL needs to
 * capture multiple images within one streaming cycle.
 * But the capture number cannot be determined by HAL.
 * So HAL only sets the capture number to be 1 and queue multiple
 * buffers. Atomisp driver needs to check this case and re-trigger
-* CSS to do capture when new buffer is queued. */
+* CSS to do capture when new buffer is queued.
+*/
if (asd->continuous_mode->val &&
atomisp_subdev_source_pad(vdev)
== ATOMISP_SUBDEV_PAD_SOURCE_CAPTURE &&
@@ -1806,7 +1808,7 @@ static int atomisp_streamon(struct file *file, void *fh,
/*
 * set freq to max when streaming count > 1 which indicate
 * dual camera would run
-   */
+*/
if (atomisp_streaming_count(isp) > 1) {
if (atomisp_freq_scaling(isp,
 ATOMISP_DFS_MODE_MAX, false) < 
0)
@@ -2437,8 +2439,10 @@ static int atomisp_g_ext_ctrls(struct file *file, void 
*fh,
struct v4l2_control ctrl;
int i, ret = 0;
 
-   /* input_lock is not need for the Camera related IOCTLs
-* The input_lock downgrade the FPS of 3A*/
+   /*
+* input_lock is not need for the Camera related IOCTLs
+* The input_lock downgrade the FPS of 3A
+*/
ret = atomisp_camera_g_ext_ctrls(file, fh, c);
if (ret != -EINVAL)
return ret;
@@ -2520,8 +2524,10 @@ static int atomisp_camera_s_ext_ctrls(struct file *file, 
void *fh,
ret =
v4l2_s_ctrl(NULL, isp->flash->ctrl_handler,
);
-   /* When flash mode is changed we need to reset
-* flash state */
+   /*
+* When flash mode is changed we need to reset
+* flash state
+*/
if (ctrl.id == V4L2_CID_FLASH_MODE) {
asd->params.flash_state =
ATOMISP_FLASH_IDLE;
@@ -2559,8 +2565,10 @@ static int atomisp_s_ext_ctrls(struct file *file, void 
*fh,
struct v4l2_control ctrl;
int i, ret = 0;
 
-   /* input_lock is not need for the Camera related IOCTLs
-* The input_lock downgrade the FPS of 3A*/
+   /*
+* input_lock is not need for the Camera related IOCTLs
+* The input_lock downgrade the FPS of 3A
+*/
ret = atomisp_camera_s_ext_ctrls(file, fh, c);
if (ret != -EINVAL)
return ret;
-- 
2.25.1

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


[PATCH v3 1/2] media: atomisp: Fix coding style issue - remove beginning whitespaces

2020-07-22 Thread Rahul Gottipati
This removes whitespaces at the beginning of a few lines to fix
some checkpatch.pl warnings.

Signed-off-by: Rahul Gottipati 
---

Changes in v3:
Changed style of function headers in response to review comments
Changes in v2:
Distributed changes across 2 patches instead of the previous 1

 drivers/staging/media/atomisp/pci/atomisp_ioctl.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c 
b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
index 9404a678fa6f..4fc4bdd85ce0 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
@@ -511,8 +511,8 @@ const struct atomisp_format_bridge atomisp_output_fmts[] = {
 #endif
 };
 
-const struct atomisp_format_bridge *atomisp_get_format_bridge(
-unsigned int pixelformat)
+const struct atomisp_format_bridge *
+atomisp_get_format_bridge(unsigned int pixelformat)
 {
unsigned int i;
 
@@ -524,8 +524,8 @@ const struct atomisp_format_bridge 
*atomisp_get_format_bridge(
return NULL;
 }
 
-const struct atomisp_format_bridge *atomisp_get_format_bridge_from_mbus(
-u32 mbus_code)
+const struct atomisp_format_bridge *
+atomisp_get_format_bridge_from_mbus(u32 mbus_code)
 {
unsigned int i;
 
@@ -606,8 +606,8 @@ static int atomisp_enum_input(struct file *file, void *fh,
return 0;
 }
 
-static unsigned int atomisp_subdev_streaming_count(
-struct atomisp_sub_device *asd)
+static unsigned int
+atomisp_subdev_streaming_count(struct atomisp_sub_device *asd)
 {
return asd->video_out_preview.capq.streaming
   + asd->video_out_capture.capq.streaming
-- 
2.25.1

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


[PATCH v3 0/2] General coding style clean-up

2020-07-22 Thread Rahul Gottipati
This patchset fixes several checkpatch.pl warnings in atomisp_ioctl.c
that have been distributed across 2 patches logically.

Rahul Gottipati (2):
  media: atomisp: Fix coding style issue - remove beginning whitespaces
  media: atomisp: Fix coding style issue - correct multiline comments

 .../staging/media/atomisp/pci/atomisp_ioctl.c | 38 +++
 1 file changed, 23 insertions(+), 15 deletions(-)

-- 
2.25.1

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


Re: [PATCH v2 1/2] media: atomisp: Fix coding style issue - remove beginning whitespaces

2020-07-22 Thread Mauro Carvalho Chehab
Em Wed, 22 Jul 2020 16:58:31 +0530
Rahul Gottipati  escreveu:

> This removes whitespaces at the beginning of a few lines to fix
> some checkpatch.pl warnings.
> 
> Signed-off-by: Rahul Gottipati 
> ---
> Changes in v2:
>   Distributed changes across 2 patches instead of the previous 1
> 
>  drivers/staging/media/atomisp/pci/atomisp_ioctl.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c 
> b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
> index 9404a678fa6f..9cdcbe774229 100644
> --- a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
> +++ b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
> @@ -512,7 +512,7 @@ const struct atomisp_format_bridge atomisp_output_fmts[] 
> = {
>  };
>  
>  const struct atomisp_format_bridge *atomisp_get_format_bridge(
> -unsigned int pixelformat)
> + unsigned int pixelformat)

This is still a coding style violation, as:

1) the continuation line won't be aligned after the open parenthesis;
2) the line will end with an open parenthesis.

 A fix would be:

const struct atomisp_format_bridge *
atomisp_get_format_bridge(unsigned int pixelformat)

The same applies to similar patterns.

Yet, patches to atomisp have a high chance of having conflicts,
and being rejected, as we're doing lots of non-aesthetic changes 
on this driver.


>  {
>   unsigned int i;
>  
> @@ -525,7 +525,7 @@ const struct atomisp_format_bridge 
> *atomisp_get_format_bridge(
>  }
>  
>  const struct atomisp_format_bridge *atomisp_get_format_bridge_from_mbus(
> -u32 mbus_code)
> + u32 mbus_code)
>  {
>   unsigned int i;
>  
> @@ -607,7 +607,7 @@ static int atomisp_enum_input(struct file *file, void *fh,
>  }
>  
>  static unsigned int atomisp_subdev_streaming_count(
> -struct atomisp_sub_device *asd)
> + struct atomisp_sub_device *asd)
>  {
>   return asd->video_out_preview.capq.streaming
>  + asd->video_out_capture.capq.streaming



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


Re: [PATCH v2 2/2] media: atomisp: Fix coding style issue - correct multiline comments

2020-07-22 Thread Mauro Carvalho Chehab
Em Wed, 22 Jul 2020 17:00:52 +0530
Rahul Gottipati  escreveu:

> This fixes some coding style issues of multiline comments to
> correct a few checkpatch.pl warnings.
> 
> Signed-off-by: Rahul Gottipati 
> ---
> Changes in v2:
>   Distributed changes across 2 patches instead of the previous 1.
>  drivers/staging/media/atomisp/pci/atomisp_ioctl.c | 14 +-
>  1 file changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c 
> b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
> index 9cdcbe774229..5bf3a86f98f8 100644
> --- a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
> +++ b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
> @@ -1281,7 +1281,8 @@ static int atomisp_qbuf(struct file *file, void *fh, 
> struct v4l2_buffer *buf)
>* But the capture number cannot be determined by HAL.
>* So HAL only sets the capture number to be 1 and queue multiple
>* buffers. Atomisp driver needs to check this case and re-trigger
> -  * CSS to do capture when new buffer is queued. */
> +  * CSS to do capture when new buffer is queued.
> +  */
>   if (asd->continuous_mode->val &&
>   atomisp_subdev_source_pad(vdev)
>   == ATOMISP_SUBDEV_PAD_SOURCE_CAPTURE &&
> @@ -1806,7 +1807,7 @@ static int atomisp_streamon(struct file *file, void *fh,
>   /*
>* set freq to max when streaming count > 1 which indicate
>* dual camera would run
> - */
> +  */
>   if (atomisp_streaming_count(isp) > 1) {
>   if (atomisp_freq_scaling(isp,
>ATOMISP_DFS_MODE_MAX, false) < 
> 0)
> @@ -2438,7 +2439,8 @@ static int atomisp_g_ext_ctrls(struct file *file, void 
> *fh,
>   int i, ret = 0;
>  
>   /* input_lock is not need for the Camera related IOCTLs
> -  * The input_lock downgrade the FPS of 3A*/
> +  * The input_lock downgrade the FPS of 3A
> +  */


On media (and on several subsystems), we keep the first line in blank,
on multi-line comments:

/* 
 * input_lock is not need for the Camera related IOCTLs
 * The input_lock downgrade the FPS of 3A
 */

>   ret = atomisp_camera_g_ext_ctrls(file, fh, c);
>   if (ret != -EINVAL)
>   return ret;
> @@ -2521,7 +2523,8 @@ static int atomisp_camera_s_ext_ctrls(struct file 
> *file, void *fh,
>   v4l2_s_ctrl(NULL, isp->flash->ctrl_handler,
>   );
>   /* When flash mode is changed we need to reset
> -  * flash state */
> +  * flash state
> +  */
>   if (ctrl.id == V4L2_CID_FLASH_MODE) {
>   asd->params.flash_state =
>   ATOMISP_FLASH_IDLE;
> @@ -2560,7 +2563,8 @@ static int atomisp_s_ext_ctrls(struct file *file, void 
> *fh,
>   int i, ret = 0;
>  
>   /* input_lock is not need for the Camera related IOCTLs
> -  * The input_lock downgrade the FPS of 3A*/
> +  * The input_lock downgrade the FPS of 3A
> +  */
>   ret = atomisp_camera_s_ext_ctrls(file, fh, c);
>   if (ret != -EINVAL)
>   return ret;



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


Re: [PATCH][next][V2] media: allegro: fix potential null dereference on header

2020-07-22 Thread Michael Tretter
On Wed, 22 Jul 2020 14:09:03 +0100, Colin King wrote:
> From: Colin Ian King 
> 
> The pointer header is an alias to msg and msg is being null checked.
> However, if msg is null then header is also null and this can lead to
> a null pointer dereference on the assignment type = header->type. Fix
> this just using header->type after the null check and removing the need
> for type as it is only used once.
> 
> Addresses-Coverity: ("Dereference before null check")
> Fixes: 3de16839669f ("media: allegro: add explicit mail encoding and 
> decoding")
> Signed-off-by: Colin Ian King 

Reviewed-by: Michael Tretter 

> ---
> 
> V2: remove need for variable type, as suggested by Michael Tretter
> 
> ---
>  drivers/staging/media/allegro-dvt/allegro-mail.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/media/allegro-dvt/allegro-mail.c 
> b/drivers/staging/media/allegro-dvt/allegro-mail.c
> index 4ac65de12463..9286d2162377 100644
> --- a/drivers/staging/media/allegro-dvt/allegro-mail.c
> +++ b/drivers/staging/media/allegro-dvt/allegro-mail.c
> @@ -462,13 +462,12 @@ allegro_dec_encode_frame(struct 
> mcu_msg_encode_frame_response *msg, u32 *src)
>  ssize_t allegro_encode_mail(u32 *dst, void *msg)
>  {
>   const struct mcu_msg_header *header = msg;
> - enum mcu_msg_type type = header->type;
>   ssize_t size;
>  
>   if (!msg || !dst)
>   return -EINVAL;
>  
> - switch (type) {
> + switch (header->type) {
>   case MCU_MSG_TYPE_INIT:
>   size = allegro_enc_init([1], msg);
>   break;
> -- 
> 2.27.0
> 
> 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: vchiq: Fix refcounting bug in buffer_from_host()

2020-07-22 Thread Dan Carpenter
If we fail to queue the buffer then it can never be dequeued.  This can
lead to a forever loop in stop_streaming() when we wait for everything
to finish.

Fixes: 70ec64ccdaac ("staging: bcm2835-camera: Ensure all buffers are returned 
on disable")
Signed-off-by: Dan Carpenter 
---
>From static analysis.  Not tested.  Please review carefully etc.

 drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c 
b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
index dc767730db43..65dd2a55b3da 100644
--- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
+++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
@@ -441,6 +441,8 @@ buffer_from_host(struct vchiq_mmal_instance *instance,
ret = vchiq_queue_kernel_message(instance->service_handle, ,
 sizeof(struct mmal_msg_header) +
 sizeof(m.u.buffer_from_host));
+   if (ret)
+   atomic_dec(>buffers_with_vpu);
 
vchiq_release_service(instance->service_handle);
 
-- 
2.27.0

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


[PATCH][next][V2] media: allegro: fix potential null dereference on header

2020-07-22 Thread Colin King
From: Colin Ian King 

The pointer header is an alias to msg and msg is being null checked.
However, if msg is null then header is also null and this can lead to
a null pointer dereference on the assignment type = header->type. Fix
this just using header->type after the null check and removing the need
for type as it is only used once.

Addresses-Coverity: ("Dereference before null check")
Fixes: 3de16839669f ("media: allegro: add explicit mail encoding and decoding")
Signed-off-by: Colin Ian King 
---

V2: remove need for variable type, as suggested by Michael Tretter

---
 drivers/staging/media/allegro-dvt/allegro-mail.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/media/allegro-dvt/allegro-mail.c 
b/drivers/staging/media/allegro-dvt/allegro-mail.c
index 4ac65de12463..9286d2162377 100644
--- a/drivers/staging/media/allegro-dvt/allegro-mail.c
+++ b/drivers/staging/media/allegro-dvt/allegro-mail.c
@@ -462,13 +462,12 @@ allegro_dec_encode_frame(struct 
mcu_msg_encode_frame_response *msg, u32 *src)
 ssize_t allegro_encode_mail(u32 *dst, void *msg)
 {
const struct mcu_msg_header *header = msg;
-   enum mcu_msg_type type = header->type;
ssize_t size;
 
if (!msg || !dst)
return -EINVAL;
 
-   switch (type) {
+   switch (header->type) {
case MCU_MSG_TYPE_INIT:
size = allegro_enc_init([1], msg);
break;
-- 
2.27.0

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


Re: [PATCH] media: allegro: fix an error pointer vs NULL check

2020-07-22 Thread Michael Tretter
On Wed, 22 Jul 2020 15:38:48 +0300, Dan Carpenter wrote:
> The allegro_mbox_init() function returns error pointers, it never
> returns NULL.
> 
> Fixes: 94dc76560261 ("media: allegro: rework mbox handling")
> Signed-off-by: Dan Carpenter 

Reviewed-by: Michael Tretter 

> ---
>  drivers/staging/media/allegro-dvt/allegro-core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/media/allegro-dvt/allegro-core.c 
> b/drivers/staging/media/allegro-dvt/allegro-core.c
> index 61beae1fca36..9f718f43282b 100644
> --- a/drivers/staging/media/allegro-dvt/allegro-core.c
> +++ b/drivers/staging/media/allegro-dvt/allegro-core.c
> @@ -2952,7 +2952,7 @@ static int allegro_mcu_hw_init(struct allegro_dev *dev,
> info->mailbox_size);
>   dev->mbox_status = allegro_mbox_init(dev, info->mailbox_status,
>info->mailbox_size);
> - if (!dev->mbox_command || !dev->mbox_status) {
> + if (IS_ERR(dev->mbox_command) || IS_ERR(dev->mbox_status)) {
>   v4l2_err(>v4l2_dev,
>"failed to initialize mailboxes\n");
>   return -EIO;
> -- 
> 2.27.0
> 
> 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH][next] media: allegro: fix potential null dereference on header

2020-07-22 Thread Michael Tretter
On Mon, 20 Jul 2020 17:38:04 +0100, Colin King wrote:
> From: Colin Ian King 
> 
> The pointer header is an alias to msg and msg is being null checked.
> However, if msg is null then header is also null and this can lead to
> a null pointer dereference on the assignment type = header->type. Fix
> this by only dereferencing header after the null check on msg.
> 
> Addresses-Coverity: ("Dereference before null check")
> Fixes: 3de16839669f ("media: allegro: add explicit mail encoding and 
> decoding")
> Signed-off-by: Colin Ian King 
> ---
>  drivers/staging/media/allegro-dvt/allegro-mail.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/media/allegro-dvt/allegro-mail.c 
> b/drivers/staging/media/allegro-dvt/allegro-mail.c
> index 4ac65de12463..4496e2a4da5c 100644
> --- a/drivers/staging/media/allegro-dvt/allegro-mail.c
> +++ b/drivers/staging/media/allegro-dvt/allegro-mail.c
> @@ -462,12 +462,14 @@ allegro_dec_encode_frame(struct 
> mcu_msg_encode_frame_response *msg, u32 *src)
>  ssize_t allegro_encode_mail(u32 *dst, void *msg)
>  {
>   const struct mcu_msg_header *header = msg;
> - enum mcu_msg_type type = header->type;
> + enum mcu_msg_type type;
>   ssize_t size;
>  
>   if (!msg || !dst)
>   return -EINVAL;
>  
> + type = header->type;

type is only used in the switch statement right below the assignment. Thus,
you could remove the local variable and directly use header->type in the
switch.

Michael

> +
>   switch (type) {
>   case MCU_MSG_TYPE_INIT:
>   size = allegro_enc_init([1], msg);
> -- 
> 2.27.0
> 
> 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] media: allegro: fix an error pointer vs NULL check

2020-07-22 Thread Dan Carpenter
The allegro_mbox_init() function returns error pointers, it never
returns NULL.

Fixes: 94dc76560261 ("media: allegro: rework mbox handling")
Signed-off-by: Dan Carpenter 
---
 drivers/staging/media/allegro-dvt/allegro-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/allegro-dvt/allegro-core.c 
b/drivers/staging/media/allegro-dvt/allegro-core.c
index 61beae1fca36..9f718f43282b 100644
--- a/drivers/staging/media/allegro-dvt/allegro-core.c
+++ b/drivers/staging/media/allegro-dvt/allegro-core.c
@@ -2952,7 +2952,7 @@ static int allegro_mcu_hw_init(struct allegro_dev *dev,
  info->mailbox_size);
dev->mbox_status = allegro_mbox_init(dev, info->mailbox_status,
 info->mailbox_size);
-   if (!dev->mbox_command || !dev->mbox_status) {
+   if (IS_ERR(dev->mbox_command) || IS_ERR(dev->mbox_status)) {
v4l2_err(>v4l2_dev,
 "failed to initialize mailboxes\n");
return -EIO;
-- 
2.27.0

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


[PATCH v2 2/2] media: atomisp: Fix coding style issue - correct multiline comments

2020-07-22 Thread Rahul Gottipati
This fixes some coding style issues of multiline comments to
correct a few checkpatch.pl warnings.

Signed-off-by: Rahul Gottipati 
---
Changes in v2:
Distributed changes across 2 patches instead of the previous 1.
 drivers/staging/media/atomisp/pci/atomisp_ioctl.c | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c 
b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
index 9cdcbe774229..5bf3a86f98f8 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
@@ -1281,7 +1281,8 @@ static int atomisp_qbuf(struct file *file, void *fh, 
struct v4l2_buffer *buf)
 * But the capture number cannot be determined by HAL.
 * So HAL only sets the capture number to be 1 and queue multiple
 * buffers. Atomisp driver needs to check this case and re-trigger
-* CSS to do capture when new buffer is queued. */
+* CSS to do capture when new buffer is queued.
+*/
if (asd->continuous_mode->val &&
atomisp_subdev_source_pad(vdev)
== ATOMISP_SUBDEV_PAD_SOURCE_CAPTURE &&
@@ -1806,7 +1807,7 @@ static int atomisp_streamon(struct file *file, void *fh,
/*
 * set freq to max when streaming count > 1 which indicate
 * dual camera would run
-   */
+*/
if (atomisp_streaming_count(isp) > 1) {
if (atomisp_freq_scaling(isp,
 ATOMISP_DFS_MODE_MAX, false) < 
0)
@@ -2438,7 +2439,8 @@ static int atomisp_g_ext_ctrls(struct file *file, void 
*fh,
int i, ret = 0;
 
/* input_lock is not need for the Camera related IOCTLs
-* The input_lock downgrade the FPS of 3A*/
+* The input_lock downgrade the FPS of 3A
+*/
ret = atomisp_camera_g_ext_ctrls(file, fh, c);
if (ret != -EINVAL)
return ret;
@@ -2521,7 +2523,8 @@ static int atomisp_camera_s_ext_ctrls(struct file *file, 
void *fh,
v4l2_s_ctrl(NULL, isp->flash->ctrl_handler,
);
/* When flash mode is changed we need to reset
-* flash state */
+* flash state
+*/
if (ctrl.id == V4L2_CID_FLASH_MODE) {
asd->params.flash_state =
ATOMISP_FLASH_IDLE;
@@ -2560,7 +2563,8 @@ static int atomisp_s_ext_ctrls(struct file *file, void 
*fh,
int i, ret = 0;
 
/* input_lock is not need for the Camera related IOCTLs
-* The input_lock downgrade the FPS of 3A*/
+* The input_lock downgrade the FPS of 3A
+*/
ret = atomisp_camera_s_ext_ctrls(file, fh, c);
if (ret != -EINVAL)
return ret;
-- 
2.25.1

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


[PATCH v2 1/2] media: atomisp: Fix coding style issue - remove beginning whitespaces

2020-07-22 Thread Rahul Gottipati
This removes whitespaces at the beginning of a few lines to fix
some checkpatch.pl warnings.

Signed-off-by: Rahul Gottipati 
---
Changes in v2:
Distributed changes across 2 patches instead of the previous 1

 drivers/staging/media/atomisp/pci/atomisp_ioctl.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c 
b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
index 9404a678fa6f..9cdcbe774229 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
@@ -512,7 +512,7 @@ const struct atomisp_format_bridge atomisp_output_fmts[] = {
 };
 
 const struct atomisp_format_bridge *atomisp_get_format_bridge(
-unsigned int pixelformat)
+   unsigned int pixelformat)
 {
unsigned int i;
 
@@ -525,7 +525,7 @@ const struct atomisp_format_bridge 
*atomisp_get_format_bridge(
 }
 
 const struct atomisp_format_bridge *atomisp_get_format_bridge_from_mbus(
-u32 mbus_code)
+   u32 mbus_code)
 {
unsigned int i;
 
@@ -607,7 +607,7 @@ static int atomisp_enum_input(struct file *file, void *fh,
 }
 
 static unsigned int atomisp_subdev_streaming_count(
-struct atomisp_sub_device *asd)
+   struct atomisp_sub_device *asd)
 {
return asd->video_out_preview.capq.streaming
   + asd->video_out_capture.capq.streaming
-- 
2.25.1

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


[PATCH v2 0/2] General coding style clean up

2020-07-22 Thread Rahul Gottipati
This patchset fixes several checkpatch.pl warnings in atomisp_ioctl.c
that have been distributed across 2 patches logically.

Rahul Gottipati (2):
  media: atomisp: Fix coding style issue - remove beginning whitespaces
  media: atomisp: Fix coding style issue - correct multiline comments

 .../staging/media/atomisp/pci/atomisp_ioctl.c | 20 +++
 1 file changed, 12 insertions(+), 8 deletions(-)

-- 
2.25.1

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


Re: [PATCH for v5.9] media: omap: Replace HTTP links with HTTPS ones

2020-07-22 Thread Laurent Pinchart
Hi Alexander,

Thank you for the patch.

On Sun, Jul 19, 2020 at 01:21:33PM +0200, Alexander A. Klimov wrote:
> Rationale:
> Reduces attack surface on kernel devs opening the links for MITM
> as HTTPS traffic is much harder to manipulate.
> 
> Deterministic algorithm:
> For each file:
>   If not .svg:
> For each line:
>   If doesn't contain `\bxmlns\b`:
> For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
> If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
> If both the HTTP and HTTPS versions
> return 200 OK and serve the same content:
>   Replace HTTP with HTTPS.
> 
> Signed-off-by: Alexander A. Klimov 

Reviewed-by: Laurent Pinchart 

I expect Sakari to take this patch in his tree when he will be back from
vacation at the end of the month.

> ---
>  Continuing my work started at 93431e0607e5.
>  See also: git log --oneline '--author=Alexander A. Klimov 
> ' v5.7..master
>  (Actually letting a shell for loop submit all this stuff for me.)
> 
>  If there are any URLs to be removed completely
>  or at least not (just) HTTPSified:
>  Just clearly say so and I'll *undo my change*.
>  See also: https://lkml.org/lkml/2020/6/27/64
> 
>  If there are any valid, but yet not changed URLs:
>  See: https://lkml.org/lkml/2020/6/26/837
> 
>  If you apply the patch, please let me know.
> 
>  Sorry again to all maintainers who complained about subject lines.
>  Now I realized that you want an actually perfect prefixes,
>  not just subsystem ones.
>  I tried my best...
>  And yes, *I could* (at least half-)automate it.
>  Impossible is nothing! :)
> 
> 
>  drivers/media/platform/omap3isp/isp.c | 2 +-
>  drivers/staging/media/omap4iss/iss.c  | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/platform/omap3isp/isp.c 
> b/drivers/media/platform/omap3isp/isp.c
> index b91e472ee764..74fa67082e09 100644
> --- a/drivers/media/platform/omap3isp/isp.c
> +++ b/drivers/media/platform/omap3isp/isp.c
> @@ -142,7 +142,7 @@ static struct isp_reg isp_reg_list[] = {
>   * readback the same register, in this case the revision register.
>   *
>   * See this link for reference:
> - *   http://www.mail-archive.com/linux-omap@vger.kernel.org/msg08149.html
> + *   https://www.mail-archive.com/linux-omap@vger.kernel.org/msg08149.html
>   */
>  void omap3isp_flush(struct isp_device *isp)
>  {
> diff --git a/drivers/staging/media/omap4iss/iss.c 
> b/drivers/staging/media/omap4iss/iss.c
> index 6fb60b58447a..e06ea7ea1e50 100644
> --- a/drivers/staging/media/omap4iss/iss.c
> +++ b/drivers/staging/media/omap4iss/iss.c
> @@ -55,7 +55,7 @@ static void iss_print_status(struct iss_device *iss)
>   * readback the same register, in this case the revision register.
>   *
>   * See this link for reference:
> - *   http://www.mail-archive.com/linux-omap@vger.kernel.org/msg08149.html
> + *   https://www.mail-archive.com/linux-omap@vger.kernel.org/msg08149.html
>   */
>  static void omap4iss_flush(struct iss_device *iss)
>  {

-- 
Regards,

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


[PATCH] staging: greybus: gpio: Use irqchip template

2020-07-22 Thread Linus Walleij
This makes the driver use the irqchip template to assign
properties to the gpio_irq_chip instead of using the
explicit calls to gpiochip_irqchip_add(). The irqchip is
instead added while adding the gpiochip.

Cc: Nishad Kamdar 
Cc: Johan Hovold 
Signed-off-by: Linus Walleij 
---
 drivers/staging/greybus/gpio.c | 19 ++-
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/greybus/gpio.c b/drivers/staging/greybus/gpio.c
index 36d99f9e419e..7e6347fe93f9 100644
--- a/drivers/staging/greybus/gpio.c
+++ b/drivers/staging/greybus/gpio.c
@@ -504,6 +504,7 @@ static int gb_gpio_probe(struct gbphy_device *gbphy_dev,
struct gb_connection *connection;
struct gb_gpio_controller *ggc;
struct gpio_chip *gpio;
+   struct gpio_irq_chip *girq;
struct irq_chip *irqc;
int ret;
 
@@ -561,6 +562,15 @@ static int gb_gpio_probe(struct gbphy_device *gbphy_dev,
gpio->ngpio = ggc->line_max + 1;
gpio->can_sleep = true;
 
+   girq = >irq;
+   girq->chip = irqc;
+   /* The event comes from the outside so no parent handler */
+   girq->parent_handler = NULL;
+   girq->num_parents = 0;
+   girq->parents = NULL;
+   girq->default_type = IRQ_TYPE_NONE;
+   girq->handler = handle_level_irq;
+
ret = gb_connection_enable(connection);
if (ret)
goto exit_line_free;
@@ -571,18 +581,9 @@ static int gb_gpio_probe(struct gbphy_device *gbphy_dev,
goto exit_line_free;
}
 
-   ret = gpiochip_irqchip_add(gpio, irqc, 0, handle_level_irq,
-  IRQ_TYPE_NONE);
-   if (ret) {
-   dev_err(_dev->dev, "failed to add irq chip: %d\n", ret);
-   goto exit_gpiochip_remove;
-   }
-
gbphy_runtime_put_autosuspend(gbphy_dev);
return 0;
 
-exit_gpiochip_remove:
-   gpiochip_remove(gpio);
 exit_line_free:
kfree(ggc->lines);
 exit_connection_disable:
-- 
2.26.2

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


Re: [PATCH] staging: gs_fpgaboot: get bus width input

2020-07-22 Thread Greg KH
On Wed, Jul 22, 2020 at 12:11:22PM +0530, Rahul Gottipati wrote:
> On Wed, Jul 22, 2020 at 08:32:54AM +0200, Greg KH wrote:
> > On Wed, Jul 22, 2020 at 11:57:11AM +0530, Rahul Gottipati wrote:
> > > On Tue, Jul 21, 2020 at 08:05:33PM +0200, Greg KH wrote:
> > > > On Tue, Jul 21, 2020 at 11:32:03PM +0530, Rahul Gottipati wrote:
> > > > > This adds a module parameter to get the program bus width as an
> > > > > input rather than hardcoding it, and checks off a TODO item.
> > > > 
> > > > Ick, no, module parameters are from the 1990's, please make this dynamic
> > > > somehow.
> > > 
> > > Hi, I'm pretty new to this. Do you have any ideas/suggestions on how to
> > > do this dynamically?
> > 
> > It all depends on what the paramater is, what it is needed for, and who
> > would ever need to change it.
> > 
> > So I think it would take a bit of domain-specific knowledge here to
> > determine that, it's not a general "code cleanup" task.
> 
> Thanks for the response. So, just to clarify, this task isn't
> appropriate for beginners who are not intimately involved with this
> project right?

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


Re: [PATCH] staging: gs_fpgaboot: get bus width input

2020-07-22 Thread Rahul Gottipati
On Wed, Jul 22, 2020 at 08:32:54AM +0200, Greg KH wrote:
> On Wed, Jul 22, 2020 at 11:57:11AM +0530, Rahul Gottipati wrote:
> > On Tue, Jul 21, 2020 at 08:05:33PM +0200, Greg KH wrote:
> > > On Tue, Jul 21, 2020 at 11:32:03PM +0530, Rahul Gottipati wrote:
> > > > This adds a module parameter to get the program bus width as an
> > > > input rather than hardcoding it, and checks off a TODO item.
> > > 
> > > Ick, no, module parameters are from the 1990's, please make this dynamic
> > > somehow.
> > 
> > Hi, I'm pretty new to this. Do you have any ideas/suggestions on how to
> > do this dynamically?
> 
> It all depends on what the paramater is, what it is needed for, and who
> would ever need to change it.
> 
> So I think it would take a bit of domain-specific knowledge here to
> determine that, it's not a general "code cleanup" task.

Thanks for the response. So, just to clarify, this task isn't
appropriate for beginners who are not intimately involved with this
project right?
 
> thanks,
> 
> greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: gs_fpgaboot: get bus width input

2020-07-22 Thread Greg KH
On Wed, Jul 22, 2020 at 11:57:11AM +0530, Rahul Gottipati wrote:
> On Tue, Jul 21, 2020 at 08:05:33PM +0200, Greg KH wrote:
> > On Tue, Jul 21, 2020 at 11:32:03PM +0530, Rahul Gottipati wrote:
> > > This adds a module parameter to get the program bus width as an
> > > input rather than hardcoding it, and checks off a TODO item.
> > 
> > Ick, no, module parameters are from the 1990's, please make this dynamic
> > somehow.
> 
> Hi, I'm pretty new to this. Do you have any ideas/suggestions on how to
> do this dynamically?

It all depends on what the paramater is, what it is needed for, and who
would ever need to change it.

So I think it would take a bit of domain-specific knowledge here to
determine that, it's not a general "code cleanup" task.

thanks,

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


Re: [PATCH] staging: gs_fpgaboot: get bus width input

2020-07-22 Thread Rahul Gottipati
On Tue, Jul 21, 2020 at 08:05:33PM +0200, Greg KH wrote:
> On Tue, Jul 21, 2020 at 11:32:03PM +0530, Rahul Gottipati wrote:
> > This adds a module parameter to get the program bus width as an
> > input rather than hardcoding it, and checks off a TODO item.
> 
> Ick, no, module parameters are from the 1990's, please make this dynamic
> somehow.

Hi, I'm pretty new to this. Do you have any ideas/suggestions on how to
do this dynamically?
 
> thanks,
> 
> greg k-h

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