Re: [PATCH 05/23] staging: wilc1000: rename goto to avoid leading '_' in label name

2018-08-01 Thread Dan Carpenter
Fantastic. Thanks! regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [RFC PATCH v5] Xilinx AXI-Stream FIFO v4.1 IP core

2018-08-01 Thread Dan Carpenter
The README is empty... It should say what changes are needed to get this out of staging. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH 1/2] staging: erofs: add the missing break in z_erofs_map_blocks_iter

2018-08-01 Thread Dan Carpenter
On Wed, Aug 01, 2018 at 02:38:30PM +0800, Gao Xiang wrote: > diff --git a/drivers/staging/erofs/unzip_vle.c > b/drivers/staging/erofs/unzip_vle.c > index bd2d7a8..6d3ab31 100644 > --- a/drivers/staging/erofs/unzip_vle.c > +++ b/drivers/staging/erofs/unzip_vle.c > @@ -1596,10 +1596,10 @@ int z_erof

Re: [PATCH 1/2] staging: erofs: add the missing break in z_erofs_map_blocks_iter

2018-08-01 Thread Gao Xiang
Hi Dan, On 2018/8/1 17:02, Dan Carpenter wrote: > On Wed, Aug 01, 2018 at 02:38:30PM +0800, Gao Xiang wrote: >> diff --git a/drivers/staging/erofs/unzip_vle.c >> b/drivers/staging/erofs/unzip_vle.c >> index bd2d7a8..6d3ab31 100644 >> --- a/drivers/staging/erofs/unzip_vle.c >> +++ b/drivers/stagin

Re: [PATCH char-misc 1/1] Drivers: hv: vmbus: Make synic_initialized flag per-cpu

2018-08-01 Thread Vitaly Kuznetsov
"Michael Kelley (EOSG)" writes: > From: Vitaly Kuznetsov Sent: Tuesday, July 31, 2018 > 4:20 AM >> >> Alternatively, we can get rid of synic_initialized flag altogether: >> hv_synic_init() never fails in the first place but we can always >> implement something like: >> >> int hv_synic_is_init

[PATCH RESEND 1/2] staging: erofs: add the missing break in z_erofs_map_blocks_iter

2018-08-01 Thread Gao Xiang
This patch adds a missing break after adding the default case. Reviewed-by: Chao Yu Signed-off-by: Gao Xiang --- As pointed out by Dan Carpenter: - fix the wrong place of fallthrough comments drivers/staging/erofs/unzip_vle.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/stag

[PATCH] staging: mt29f_spinand: fix memory leak while programming pages

2018-08-01 Thread Jheng-Jhong Wu
In spinand_program_page(), it uses devm_kzalloc() to allocate memory to wbuf dynamically if internal ECC is on, but it doesn't free memory allocated to wbuf at the end of this function. This leads to a memory leak issue when internal ECC is on. Signed-off-by: Jheng-Jhong Wu --- drivers/staging/m

[PATCH 0/2] staging: wilc1000: fix endianness issues identified by sparse

2018-08-01 Thread Ajay Singh
This patch series has changes to fix the sparse warnings & use correct byte-order conversion. It also includes changes to use correct datatype for 'wid' in cfg struct. Ajay Singh (2): staging: wilc1000: use 'u16' data type for config id parameter staging: wilc1000: fix endianness warnings repo

[PATCH 1/2] staging: wilc1000: use 'u16' data type for config id parameter

2018-08-01 Thread Ajay Singh
Cleanup patch to use the correct data type 'u16' for keeping the WID value in 'wilc_cfg_word' & 'wilc_cfg_str' structure. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/wilc_wlan_cfg.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_w

[PATCH 2/2] staging: wilc1000: fix endianness warnings reported by sparse

2018-08-01 Thread Ajay Singh
This patch fixes the sparse warnings by making use of le32_to_cpus() & cpu_to_le32s() conversion API's. Remove the unnecessary byte-order conversion in wilc_wlan_parse_response_frame() as the data is copied using individual byte operation. Also added the byte-order conversion for 'header' in wilc_

Re: [PATCH RESEND 1/2] staging: erofs: add the missing break in z_erofs_map_blocks_iter

2018-08-01 Thread Dan Carpenter
On Wed, Aug 01, 2018 at 05:36:54PM +0800, Gao Xiang wrote: > This patch adds a missing break after adding the default case. > > Reviewed-by: Chao Yu > Signed-off-by: Gao Xiang > --- > As pointed out by Dan Carpenter: > - fix the wrong place of fallthrough comments Thanks. Looks good. Next ti

Re: [PATCH] staging: mt29f_spinand: fix memory leak while programming pages

2018-08-01 Thread Dan Carpenter
devm_ resources are freed automatically when the device is removed. The name devm_ stands for "device" and "managed". regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/dri

[PATCH v5] staging: rts5208: add error handling into rtsx_probe

2018-08-01 Thread Anton Vasilyev
If rtsx_probe() fails to allocate dev->chip, then release_everything() will crash on uninitialized dev->cmnd_ready complete. Patch adds an error handling into rtsx_probe. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Anton Vasilyev --- v5: fix mistype and remove s

Re: [PATCH] staging:mt29f_spinand: MT29F2G failing as only 16-bit arguments and variables used for addressing.

2018-08-01 Thread Dan Carpenter
On Wed, Aug 01, 2018 at 11:24:19AM +0800, Jheng-Jhong Wu wrote: > For NAND flash chips with more than 1Gbit (e.g. MT29F2G) more than 16 bits > are necessary to address the correct page. The driver sets the address for > more than 16 bits, but it uses 16-bit arguments and variables (these are > page

Re: [PATCH RESEND 1/2] staging: erofs: add the missing break in z_erofs_map_blocks_iter

2018-08-01 Thread Gao Xiang
Hi Dan, On 2018/8/1 19:36, Dan Carpenter wrote: > On Wed, Aug 01, 2018 at 05:36:54PM +0800, Gao Xiang wrote: >> This patch adds a missing break after adding the default case. >> >> Reviewed-by: Chao Yu >> Signed-off-by: Gao Xiang >> --- >> As pointed out by Dan Carpenter: >> - fix the wrong pla

Re: [PATCH v5] staging: rts5208: add error handling into rtsx_probe

2018-08-01 Thread Andy Shevchenko
On Wed, Aug 1, 2018 at 2:55 PM, Anton Vasilyev wrote: > If rtsx_probe() fails to allocate dev->chip, then release_everything() > will crash on uninitialized dev->cmnd_ready complete. > > Patch adds an error handling into rtsx_probe. > Found by Linux Driver Verification project (linuxtesting.org).

Re: [PATCH] staging:mt29f_spinand: MT29F2G failing as only 16-bit arguments and variables used for addressing.

2018-08-01 Thread Miquel Raynal
Hi Dan, Dan Carpenter wrote on Wed, 1 Aug 2018 15:05:51 +0300: > On Wed, Aug 01, 2018 at 11:24:19AM +0800, Jheng-Jhong Wu wrote: > > For NAND flash chips with more than 1Gbit (e.g. MT29F2G) more than 16 bits > > are necessary to address the correct page. The driver sets the address for > > more

Re: [PATCH] staging:mt29f_spinand: MT29F2G failing as only 16-bit arguments and variables used for addressing.

2018-08-01 Thread Dan Carpenter
On Wed, Aug 01, 2018 at 03:55:30PM +0200, Miquel Raynal wrote: > Hi Dan, > > Dan Carpenter wrote on Wed, 1 Aug 2018 > 15:05:51 +0300: > > > On Wed, Aug 01, 2018 at 11:24:19AM +0800, Jheng-Jhong Wu wrote: > > > For NAND flash chips with more than 1Gbit (e.g. MT29F2G) more than 16 bits > > > are n

Re: [PATCH v5] staging: rts5208: add error handling into rtsx_probe

2018-08-01 Thread Anton Vasilyev
I found that staging-next already contains my patch v3, committed by Greg Kroah-Hartman. Do I need to send a new patch with a label renaming based on Dan Carpenter comments? -- Anton Vasilyev Linux Verification Center, ISPRAS web: http://linuxtesting.org e-mail: vasil...@ispras.ru On 01.08.

Re: [PATCH v5] staging: rts5208: add error handling into rtsx_probe

2018-08-01 Thread Dan Carpenter
On Wed, Aug 01, 2018 at 05:08:48PM +0300, Anton Vasilyev wrote: > I found that staging-next already contains my patch v3, committed by Greg > Kroah-Hartman. > > Do I need to send a new patch with a label renaming based on Dan Carpenter > comments? I had to look to see what I had said earlier...

Re: [PATCH v5] staging: rts5208: add error handling into rtsx_probe

2018-08-01 Thread Andy Shevchenko
On Wed, Aug 1, 2018 at 5:08 PM, Anton Vasilyev wrote: > I found that staging-next already contains my patch v3, committed by Greg > Kroah-Hartman. > > Do I need to send a new patch Yes. Based on staging-next. > with a label renaming based on Dan Carpenter > comments? Dan is talking for himself

Re: [RFC PATCH v5] Xilinx AXI-Stream FIFO v4.1 IP core

2018-08-01 Thread Jacob Feder
On Wed, Aug 01, 2018 at 11:52:39AM +0300, Dan Carpenter wrote: > The README is empty... It should say what changes are needed to get > this out of staging. > > regards, > dan carpenter > Right :) It's ready as far as I'm concerned. Best, Jacob ___

[PATCH 2/4] staging: fsl-dpaa2/eth: Remove dead code

2018-08-01 Thread Ioana Radulescu
File net.h contains unused defines, so remove them. Signed-off-by: Ioana Radulescu --- drivers/staging/fsl-dpaa2/ethernet/net.h | 85 1 file changed, 85 deletions(-) diff --git a/drivers/staging/fsl-dpaa2/ethernet/net.h b/drivers/staging/fsl-dpaa2/ethernet/net.

[PATCH 4/4] staging: fsl-dpaa2/eth: Merge header files

2018-08-01 Thread Ioana Radulescu
File net.h contains definitions that are exclusively used by the key generator/classification API. Merge its contents with dpkg.h in order to reduce the number of private headers. Signed-off-by: Ioana Radulescu --- drivers/staging/fsl-dpaa2/ethernet/dpkg.h | 350 - dr

[PATCH 3/4] staging: fsl-dpaa2/eth: Use BIT() macro

2018-08-01 Thread Ioana Radulescu
File net.h has several bitmask defines that could be implemented more clearly using the BIT() macro. Signed-off-by: Ioana Radulescu --- drivers/staging/fsl-dpaa2/ethernet/net.h | 448 +++ 1 file changed, 219 insertions(+), 229 deletions(-) diff --git a/drivers/stagin

[PATCH 1/4] staging: fsl-dpaa2/eth: Cleanup comments

2018-08-01 Thread Ioana Radulescu
Comments in file net.h are too fancy for their own good, so convert them to the regular format. Signed-off-by: Ioana Radulescu --- drivers/staging/fsl-dpaa2/ethernet/net.h | 76 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/drivers/staging/fsl-d

[PATCH 0/4] staging: fsl-dpaa2/eth: Private header cleanup

2018-08-01 Thread Ioana Radulescu
Private header file net.h receives a cleanup and the remaining code is then merged into dpkg.h This patchset depends on: staging: fsl-dpaa2/eth: add SPDX license identifiers (https://lore.kernel.org/patchwork/patch/969402/) Ioana Radulescu (4): staging: fsl-dpaa2/eth: Cleanup comments staging

[PATCH v8 01/15] staging: mt7621-pci: use generic kernel pci subsystem read and write

2018-08-01 Thread Sergio Paracuellos
map_bus callback is called before every .read/.write operation. Implement it and change custom read write operations for the pci subsystem generics. Make the probe function to don't use legacy stuff and request bus resources directly. Get pci register base and ranges from device tree. The driver is

[PATCH v8 02/15] staging: mt7621-pci: remove dead code derived to not use custom reads and writes

2018-08-01 Thread Sergio Paracuellos
Driver is using now pci subsystem generics reads and writes and requesting bus resources without using legacy code functions. Because of this there is a lot of dead code that can be removed. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 128 -

[PATCH v8 03/15] staging: mt7621-pci: add pcie_write and pcie_read helpers

2018-08-01 Thread Sergio Paracuellos
Introdice this functions to make easier to write/read to/from an offset relative to base address Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/stagin

[PATCH v8 06/15] staging: mt7621-pci: simplify write_config function

2018-08-01 Thread Sergio Paracuellos
write_config function is always called with bus and func being 0. Avoid those params and just use 0 inside the function. Review parameter types changing for more proper ones. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 20 +--- 1 file changed,

[PATCH v8 04/15] staging: mt7621-pci: use pcie_[read|write] in [write|read]_config

2018-08-01 Thread Sergio Paracuellos
Instead of custom macros use pcie_read and pcie_write functions. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 67 - 1 file changed, 32 insertions(+), 35 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/driver

[PATCH v8 05/15] staging: mt7621-pci: simplify read_config function

2018-08-01 Thread Sergio Paracuellos
read_config function is always called with bus and func being 0. Avoid those params and just use 0 inside the function. Return readed value instead pass a reference parameter. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 32 +++- 1 f

[PATCH v8 00/15] staging: mt7621-pci: avoid custom pci config read and writes

2018-08-01 Thread Sergio Paracuellos
This patch series include an attempt to avoid the use of custom read and writes in driver code and use PCI subsystem common ones. In order to do this 'map_bus' callback is implemented and also data structures for driver are included. The regs base address ranges and data is being readed from devic

[PATCH v8 15/15] staging: mt7621-dts: add pcie controller port registers

2018-08-01 Thread Sergio Paracuellos
The pcie node of the device tree only contains registers for the host-bridge and pcie port 0. Add the pcie port 1 and pcie port 2 also. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-dts/mt7621.dtsi | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/s

[PATCH v8 10/15] staging: mt7621-pci: use pcie_[read|write] in RALINK_PCI_PCICFG_ADDR and RALINK_PCI_PCIMSK_ADDR

2018-08-01 Thread Sergio Paracuellos
RALINK_PCI_PCICFG_ADDR and RALINK_PCI_PCIMSK_ADDR are defined to be directly referenced for read and write. Use pcie_read and pcie_write instead changing its definition to a simple relative offset to pcie base address. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c

[PATCH v8 12/15] staging: mt7621-pci: use BIT macro in preprocessor definitions

2018-08-01 Thread Sergio Paracuellos
Some preprocessor definitions are using a custom implementation of BIT macro. Just use linux kernel BIT macro instead. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/

[PATCH v8 13/15] staging: mt7621-pci: rename RALINK_PCI_CONFIG_DATA_VIRTUAL_REG definition

2018-08-01 Thread Sergio Paracuellos
RALINK_PCI_CONFIG_DATA_VIRTUAL_REG is a very long name. Make it a bit shorter renaming it to RALINK_PCI_CONFIG_DATA. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/mt7621-pc

[PATCH v8 14/15] staging: mt7621-pci: remove remaining pci_legacy dependant code

2018-08-01 Thread Sergio Paracuellos
pcibios_* remaining code is not neccessary at all. We can use map_irq set to of_irq_parse_and_map_pci driver 'probe' function. Remove this code. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 33 + 1 file changed, 1 insertion(+), 3

[PATCH v8 11/15] staging: mt7621-pci: remove RALINK_PCI_BASE from remaining definitions

2018-08-01 Thread Sergio Paracuellos
RALINK_PCI_BASE has no sense and this driver has base address readed and mapped from device tree. Remove remaining uses of it and change code to use pcie_read and pcie_write functions in places where this was being used. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621

[PATCH v8 07/15] staging: mt7621-pci: remove unused macros

2018-08-01 Thread Sergio Paracuellos
There some macros that are not being used. Remove them. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 24 +--- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci

[PATCH v8 08/15] staging: mt7621-pci: avoid register duplication per controller using pcie_[read|write]

2018-08-01 Thread Sergio Paracuellos
Use pcie_[read|write] fucntions to read and write controller registers. Define those only by offset and pass controller offset + register offset relative to base address to functions. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 70 -

[PATCH v8 09/15] staging: mt7621-pci: review includes putting them in alphabethic order

2018-08-01 Thread Sergio Paracuellos
There are some includes that are being used that are not really needed to correct driver compilation. Remove them and reorder the rest alphabetically. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 22 -- 1 file changed, 8 insertions(+), 14 de

Re: [PATCH v7 00/15] staging: mt7621-pci: avoid custom pci config read and writes

2018-08-01 Thread Sergio Paracuellos
On Wed, Aug 1, 2018 at 6:37 AM, Sergio Paracuellos wrote: > On Wed, Aug 01, 2018 at 07:56:38AM +1000, NeilBrown wrote: >> On Tue, Jul 31 2018, Sergio Paracuellos wrote: >> >> > This patch series include an attempt to avoid the use of custom >> > read and writes in driver code and use PCI subsystem

Re: [PATCH] staging: gasket: sysfs: fix potential null dereference

2018-08-01 Thread Greg KH
On Tue, Jul 31, 2018 at 06:23:20PM +0300, Ivan Bornyakov wrote: > Add handling of possible allocation failure. > > Reported by smatch: > > drivers/staging/gasket/gasket_sysfs.c:105 put_mapping() error: potential > null dereference 'files_to_remove'. (kcalloc returns null) > > Signed-off-by: I

[PATCH v2] staging: gasket: sysfs: fix potential null dereference

2018-08-01 Thread Ivan Bornyakov
Add handling of possible allocation failure. Reported by smatch: drivers/staging/gasket/gasket_sysfs.c:105 put_mapping() error: potential null dereference 'files_to_remove'. (kcalloc returns null) Signed-off-by: Ivan Bornyakov --- drivers/staging/gasket/gasket_sysfs.c | 5 + 1 file chan

[PATCH] staging: rtl8188eu: use is_multicast_ether_addr

2018-08-01 Thread Michael Straube
Use is_multicast_ether_addr instead of custom IS_MCAST. The variable for the result of IS_MCAST was only used in the if conditional. So remove the extra variable and move the call to is_multicast_ether_addr into the conditional. Signed-off-by: Michael Straube --- drivers/staging/rtl8188eu/core/r

[PATCH v3 06/14] gpu: ipu-v3: Add planar support to interlaced scan

2018-08-01 Thread Steve Longerbeam
To support interlaced scan with planar formats, cpmem SLUV must be programmed with the correct chroma line stride. For full and partial planar 4:2:2 (YUV422P, NV16), chroma line stride must be doubled. For full and partial planar 4:2:0 (YUV420, YVU420, NV12), chroma line stride must _not_ be double

[PATCH v3 09/14] media: imx: interweave and odd-chroma-row skip are incompatible

2018-08-01 Thread Steve Longerbeam
If IDMAC interweaving is enabled in a write channel, the channel must write the odd chroma rows for 4:2:0 formats. Skipping writing the odd chroma rows produces corrupted captured 4:2:0 images when interweave is enabled. Reported-by: Krzysztof HaƂasa Signed-off-by: Steve Longerbeam --- drivers/

[PATCH v3 07/14] media: imx: Fix field negotiation

2018-08-01 Thread Steve Longerbeam
IDMAC interlaced scan, a.k.a. interweave, should be enabled in the IDMAC output channels only if the IDMAC output pad field type is 'seq-bt' or 'seq-tb', and field type at the capture interface is 'interlaced*'. V4L2_FIELD_HAS_BOTH() macro should not be used on the input to determine enabling inte

[PATCH v3 12/14] media: imx-csi: Move crop/compose reset after filling default mbus fields

2018-08-01 Thread Steve Longerbeam
If caller passes un-initialized field type V4L2_FIELD_ANY to CSI sink pad, the reset CSI crop window would not be correct, because the crop window depends on a valid input field type. To fix move the reset of crop and compose windows to after the call to imx_media_fill_default_mbus_fields(). Signe

[PATCH v3 03/14] gpu: ipu-csi: Swap fields according to input/output field types

2018-08-01 Thread Steve Longerbeam
The function ipu_csi_init_interface() was inverting the F-bit for NTSC case, in the CCIR_CODE_1/2 registers. The result being that for NTSC bottom-top field order, the CSI would swap fields and capture in top-bottom order. Instead, base field swap on the field order of the input to the CSI, and th

[PATCH v3 11/14] media: imx: vdic: rely on VDIC for correct field order

2018-08-01 Thread Steve Longerbeam
prepare_vdi_in_buffers() was setting up the dma pointers as if the VDIC is always programmed to receive the fields in bottom-top order, i.e. as if ipu_vdi_set_field_order() only programs BT order in the VDIC. But that's not true, ipu_vdi_set_field_order() is working correctly. So fix prepare_vdi_i

[PATCH v3 08/14] media: imx-csi: Double crop height for alternate fields at sink

2018-08-01 Thread Steve Longerbeam
If the incoming sink field type is alternate, the reset crop height and crop height bounds must be set to twice the incoming height, because in alternate field mode, upstream will report only the lines for a single field, and the CSI captures the whole frame. Signed-off-by: Steve Longerbeam ---

[PATCH v3 13/14] media: imx: Allow interweave with top/bottom lines swapped

2018-08-01 Thread Steve Longerbeam
Allow sequential->interlaced interweaving but with top/bottom lines swapped to the output buffer. This can be accomplished by adding one line length to IDMAC output channel address, with a negative line length for the interlace offset. This is to allow the seq-bt -> interlaced-bt transformation,

[PATCH v3 10/14] media: imx-csi: Allow skipping odd chroma rows for YVU420

2018-08-01 Thread Steve Longerbeam
Skip writing U/V components to odd rows for YVU420 in addition to YUV420 and NV12. Signed-off-by: Steve Longerbeam Reviewed-by: Philipp Zabel --- drivers/staging/media/imx/imx-media-csi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/st

Re: [PATCH v8 00/15] staging: mt7621-pci: avoid custom pci config read and writes

2018-08-01 Thread NeilBrown
On Wed, Aug 01 2018, Sergio Paracuellos wrote: > This patch series include an attempt to avoid the use of custom > read and writes in driver code and use PCI subsystem common ones. > > In order to do this 'map_bus' callback is implemented and also > data structures for driver are included. The reg

[PATCH char-misc 1/1] Drivers: hv: vmbus: Cleanup synic memory free path

2018-08-01 Thread mhkelley58
From: Michael Kelley clk_evt memory is not being freed when the synic is shutdown or when there is an allocation error. Add the appropriate kfree() call, along with a comment to clarify how the memory gets freed after an allocation error. Make the free path consistent by removing checks for NUL

[PATCH 0/3] Drivers: hv: vmbus: Miscellaneous fixes

2018-08-01 Thread kys
From: "K. Y. Srinivasan" Miscellaneous fixes. Dexuan Cui (1): Drivers: hv: vmbus: Reset the channel callback in vmbus_onoffer_rescind() Michael Kelley (2): Drivers: hv: vmbus: Remove use of slow_virt_to_phys() Drivers: hv: vmbus: Cleanup synic memory free path drivers/hv/channel.c

[PATCH 3/3] Drivers: hv: vmbus: Cleanup synic memory free path

2018-08-01 Thread kys
From: Michael Kelley clk_evt memory is not being freed when the synic is shutdown or when there is an allocation error. Add the appropriate kfree() call, along with a comment to clarify how the memory gets freed after an allocation error. Make the free path consistent by removing checks for NUL

[PATCH 2/3] Drivers: hv: vmbus: Remove use of slow_virt_to_phys()

2018-08-01 Thread kys
From: Michael Kelley slow_virt_to_phys() is only implemented for arch/x86. Remove its use in arch independent Hyper-V drivers, and replace with test for vmalloc() address followed by appropriate v-to-p function. This follows the typical pattern of other drivers and avoids the need to implement sl

[PATCH 1/3] Drivers: hv: vmbus: Reset the channel callback in vmbus_onoffer_rescind()

2018-08-01 Thread kys
From: Dexuan Cui Before setting channel->rescind in vmbus_rescind_cleanup(), we should make sure the channel callback won't run any more, otherwise a high-level driver like pci_hyperv, which may be infinitely waiting for the host VSP's response and notices the channel has been rescinded, can't sa

Re: [PATCH] staging: mt29f_spinand: fix memory leak while programming pages

2018-08-01 Thread Jheng-Jhong Wu
Dear Dan, I know what you wrote, but before the spinand device is removed and freed memory automatically, programming pages may do many many times. Assume we erase and rewrite a large part of the flash, then spinand_program_page() might exhaust memory if memory is not large enough. In fact, OOM in

Re: [PATCH v8 00/15] staging: mt7621-pci: avoid custom pci config read and writes

2018-08-01 Thread Sergio Paracuellos
On Thu, Aug 02, 2018 at 08:09:48AM +1000, NeilBrown wrote: > On Wed, Aug 01 2018, Sergio Paracuellos wrote: > > > This patch series include an attempt to avoid the use of custom > > read and writes in driver code and use PCI subsystem common ones. > > > > In order to do this 'map_bus' callback is

Re: [PATCH] staging: mt29f_spinand: fix memory leak while programming pages

2018-08-01 Thread Dan Carpenter
On Thu, Aug 02, 2018 at 11:42:30AM +0800, Jheng-Jhong Wu wrote: > Dear Dan, > > I know what you wrote, but before the spinand device is removed and > freed memory automatically, programming pages may do many many times. > Assume we erase and rewrite a large part of the flash, then > spinand_progra

[PATCH v9 00/15] staging: mt7621-pci: avoid custom pci config read and writes

2018-08-01 Thread Sergio Paracuellos
This patch series include an attempt to avoid the use of custom read and writes in driver code and use PCI subsystem common ones. In order to do this 'map_bus' callback is implemented and also data structures for driver are included. The regs base address ranges and data is being readed from devic

[PATCH v9 07/15] staging: mt7621-pci: remove unused macros

2018-08-01 Thread Sergio Paracuellos
There some macros that are not being used. Remove them. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 24 +--- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci

[PATCH v9 06/15] staging: mt7621-pci: simplify write_config function

2018-08-01 Thread Sergio Paracuellos
write_config function is always called with bus and func being 0. Avoid those params and just use 0 inside the function. Review parameter types changing for more proper ones. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 20 +--- 1 file changed,

[PATCH v9 03/15] staging: mt7621-pci: add pcie_write and pcie_read helpers

2018-08-01 Thread Sergio Paracuellos
Introdice this functions to make easier to write/read to/from an offset relative to base address Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/stagin

[PATCH v9 10/15] staging: mt7621-pci: use pcie_[read|write] in RALINK_PCI_PCICFG_ADDR and RALINK_PCI_PCIMSK_ADDR

2018-08-01 Thread Sergio Paracuellos
RALINK_PCI_PCICFG_ADDR and RALINK_PCI_PCIMSK_ADDR are defined to be directly referenced for read and write. Use pcie_read and pcie_write instead changing its definition to a simple relative offset to pcie base address. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c

[PATCH v9 02/15] staging: mt7621-pci: remove dead code derived to not use custom reads and writes

2018-08-01 Thread Sergio Paracuellos
Driver is using now pci subsystem generics reads and writes and requesting bus resources without using legacy code functions. Because of this there is a lot of dead code that can be removed. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 128 -

[PATCH v9 04/15] staging: mt7621-pci: use pcie_[read|write] in [write|read]_config

2018-08-01 Thread Sergio Paracuellos
Instead of custom macros use pcie_read and pcie_write functions. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 67 - 1 file changed, 32 insertions(+), 35 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/driver

[PATCH v9 09/15] staging: mt7621-pci: review includes putting them in alphabethic order

2018-08-01 Thread Sergio Paracuellos
There are some includes that are being used that are not really needed to correct driver compilation. Remove them and reorder the rest alphabetically. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 22 -- 1 file changed, 8 insertions(+), 14 de

[PATCH v9 01/15] staging: mt7621-pci: use generic kernel pci subsystem read and write

2018-08-01 Thread Sergio Paracuellos
map_bus callback is called before every .read/.write operation. Implement it and change custom read write operations for the pci subsystem generics. Make the probe function to don't use legacy stuff and request bus resources directly. Get pci register base and ranges from device tree. The driver is

[PATCH v9 11/15] staging: mt7621-pci: remove RALINK_PCI_BASE from remaining definitions

2018-08-01 Thread Sergio Paracuellos
RALINK_PCI_BASE has no sense and this driver has base address readed and mapped from device tree. Remove remaining uses of it and change code to use pcie_read and pcie_write functions in places where this was being used. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621

[PATCH v9 13/15] staging: mt7621-pci: rename RALINK_PCI_CONFIG_DATA_VIRTUAL_REG definition

2018-08-01 Thread Sergio Paracuellos
RALINK_PCI_CONFIG_DATA_VIRTUAL_REG is a very long name. Make it a bit shorter renaming it to RALINK_PCI_CONFIG_DATA. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/mt7621-pc

[PATCH v9 12/15] staging: mt7621-pci: use BIT macro in preprocessor definitions

2018-08-01 Thread Sergio Paracuellos
Some preprocessor definitions are using a custom implementation of BIT macro. Just use linux kernel BIT macro instead. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/

[PATCH v9 05/15] staging: mt7621-pci: simplify read_config function

2018-08-01 Thread Sergio Paracuellos
read_config function is always called with bus and func being 0. Avoid those params and just use 0 inside the function. Return readed value instead pass a reference parameter. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 32 +++- 1 f

[PATCH v9 08/15] staging: mt7621-pci: avoid register duplication per controller using pcie_[read|write]

2018-08-01 Thread Sergio Paracuellos
Use pcie_[read|write] fucntions to read and write controller registers. Define those only by offset and pass controller offset + register offset relative to base address to functions. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 70 -

[PATCH v9 15/15] staging: mt7621-dts: add pcie controller port registers

2018-08-01 Thread Sergio Paracuellos
The pcie node of the device tree only contains registers for the host-bridge and pcie port 0. Add the pcie port 1 and pcie port 2 also. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-dts/mt7621.dtsi | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/s

[PATCH v9 14/15] staging: mt7621-pci: remove remaining pci_legacy dependant code

2018-08-01 Thread Sergio Paracuellos
pcibios_* remaining code is not neccessary at all. We can use map_irq set to of_irq_parse_and_map_pci driver 'probe' function. Remove this code. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 33 + 1 file changed, 1 insertion(+), 3

Re: [PATCH char-misc 1/1] Drivers: hv: vmbus: Cleanup synic memory free path

2018-08-01 Thread Dan Carpenter
On Wed, Aug 01, 2018 at 03:45:13PM -0700, mhkelle...@gmail.com wrote: > From: Michael Kelley > > clk_evt memory is not being freed when the synic is shutdown > or when there is an allocation error. Add the appropriate > kfree() call, along with a comment to clarify how the memory > gets freed af