[driver-core:debugfs_cleanup 51/55] drivers/platform/x86/intel_pmc_core.c:796:1: warning: no return statement in function returning non-void
tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git debugfs_cleanup head: 33e8fa816cc944702c27209feb7a88fc0b4b5c7a commit: 8c404cfe3e58120800e912665bd6b9d50bd29329 [51/55] drivers/platform: break up config: i386-randconfig-m1-05091710 (attached as .config) compiler: gcc-7 (Debian 7.3.0-1) 7.3.0 reproduce: git checkout 8c404cfe3e58120800e912665bd6b9d50bd29329 # save the attached .config to linux build tree make ARCH=i386 If you fix the issue, kindly add following tag Reported-by: kbuild test robot All warnings (new ones prefixed by >>): drivers/platform/x86/intel_pmc_core.c: In function 'pmc_core_dbgfs_register': >> drivers/platform/x86/intel_pmc_core.c:796:1: warning: no return statement in >> function returning non-void [-Wreturn-type] } ^ vim +796 drivers/platform/x86/intel_pmc_core.c b740d2e9 Rajneesh Bhardwaj 2016-05-26 753 8c404cfe Greg Kroah-Hartman 2019-02-07 754 static void pmc_core_dbgfs_register(struct pmc_dev *pmcdev) b740d2e9 Rajneesh Bhardwaj 2016-05-26 755 { 750e0f57 Rajneesh Bhardwaj 2018-01-19 756 struct dentry *dir; b740d2e9 Rajneesh Bhardwaj 2016-05-26 757 b740d2e9 Rajneesh Bhardwaj 2016-05-26 758 dir = debugfs_create_dir("pmc_core", NULL); b740d2e9 Rajneesh Bhardwaj 2016-05-26 759 pmcdev->dbgfs_dir = dir; 9c2ee199 Rajneesh Bhardwaj 2016-10-07 760 750e0f57 Rajneesh Bhardwaj 2018-01-19 761 debugfs_create_file("slp_s0_residency_usec", 0444, dir, pmcdev, 750e0f57 Rajneesh Bhardwaj 2018-01-19 762 &pmc_core_dev_state); 750e0f57 Rajneesh Bhardwaj 2018-01-19 763 750e0f57 Rajneesh Bhardwaj 2018-01-19 764 debugfs_create_file("pch_ip_power_gating_status", 0444, dir, pmcdev, 3b1f9955 Yangtao Li 2018-12-05 765 &pmc_core_ppfear_fops); 750e0f57 Rajneesh Bhardwaj 2018-01-19 766 750e0f57 Rajneesh Bhardwaj 2018-01-19 767 debugfs_create_file("ltr_ignore", 0644, dir, pmcdev, 9c2ee199 Rajneesh Bhardwaj 2016-10-07 768 &pmc_core_ltr_ignore_ops); 9c2ee199 Rajneesh Bhardwaj 2016-10-07 769 cd89e92b Rajneesh Bhardwaj 2019-02-01 770 debugfs_create_file("ltr_show", 0444, dir, pmcdev, &pmc_core_ltr_fops); 2eb15055 Rajneesh Bhardwaj 2018-11-09 771 8aba056a Rajneesh Bhardwaj 2019-02-14 772 debugfs_create_file("package_cstate_show", 0444, dir, pmcdev, 8aba056a Rajneesh Bhardwaj 2019-02-14 773 &pmc_core_pkgc_fops); 8aba056a Rajneesh Bhardwaj 2019-02-14 774 750e0f57 Rajneesh Bhardwaj 2018-01-19 775 if (pmcdev->map->pll_sts) 750e0f57 Rajneesh Bhardwaj 2018-01-19 776 debugfs_create_file("pll_status", 0444, dir, pmcdev, 3b1f9955 Yangtao Li 2018-12-05 777 &pmc_core_pll_fops); 750e0f57 Rajneesh Bhardwaj 2018-01-19 778 750e0f57 Rajneesh Bhardwaj 2018-01-19 779 if (pmcdev->map->mphy_sts) 750e0f57 Rajneesh Bhardwaj 2018-01-19 780 debugfs_create_file("mphy_core_lanes_power_gating_status", 750e0f57 Rajneesh Bhardwaj 2018-01-19 781 0444, dir, pmcdev, 3b1f9955 Yangtao Li 2018-12-05 782 &pmc_core_mphy_pg_fops); 0bdfaf42 Rajneesh Bhardwaj 2016-10-07 783 4cf2afd6 Box, David E 2018-06-08 784 if (pmcdev->map->slps0_dbg_maps) { 4cf2afd6 Box, David E 2018-06-08 785 debugfs_create_file("slp_s0_debug_status", 0444, 4cf2afd6 Box, David E 2018-06-08 786 dir, pmcdev, 4cf2afd6 Box, David E 2018-06-08 787 &pmc_core_slps0_dbg_fops); 4cf2afd6 Box, David E 2018-06-08 788 4cf2afd6 Box, David E 2018-06-08 789 debugfs_create_bool("slp_s0_dbg_latch", 0644, 4cf2afd6 Box, David E 2018-06-08 790 dir, &slps0_dbg_latch); 4cf2afd6 Box, David E 2018-06-08 791 } b740d2e9 Rajneesh Bhardwaj 2016-05-26 792 } 0bdfaf42 Rajneesh Bhardwaj 2016-10-07 793 #else 0bdfaf42 Rajneesh Bhardwaj 2016-10-07 794 static inline int pmc_core_dbgfs_register(struct pmc_dev *pmcdev) 0bdfaf42 Rajneesh Bhardwaj 2016-10-07 795 { b740d2e9 Rajneesh Bhardwaj 2016-05-26 @796 } b740d2e9 Rajneesh Bhardwaj 2016-05-26 797 :: The code at line 796 was first introduced by commit :: b740d2e9233cb33626d3b62210bcfc6a34baa839 platform/x86: Add PMC Driver for Intel Core SoC :: TO: Rajneesh Bhardwaj :: CC: Darren Hart --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 09/16] mmc: sdhci-xenon: use new match_string() helper/macro
On Wed, 2019-05-08 at 16:26 +0300, Alexandru Ardelean wrote: > On Wed, 2019-05-08 at 15:20 +0300, Dan Carpenter wrote: > > > > > > On Wed, May 08, 2019 at 02:28:35PM +0300, Alexandru Ardelean wrote: > > > -static const char * const phy_types[] = { > > > - "emmc 5.0 phy", > > > - "emmc 5.1 phy" > > > -}; > > > - > > > enum xenon_phy_type_enum { > > > EMMC_5_0_PHY, > > > EMMC_5_1_PHY, > > > NR_PHY_TYPES > > > > There is no need for NR_PHY_TYPES now so you could remove that as well. > > > > I thought the same. > The only reason to keep NR_PHY_TYPES, is for potential future patches, > where it would be just 1 addition > > enum xenon_phy_type_enum { > EMMC_5_0_PHY, > EMMC_5_1_PHY, > + EMMC_5_2_PHY, > NR_PHY_TYPES > } > > Depending on style/preference of how to do enums (allow comma on last > enum > or not allow comma on last enum value), adding new enum values woudl be 2 > additions + 1 deletion lines. > > enum xenon_phy_type_enum { > EMMC_5_0_PHY, > - EMMC_5_1_PHY > + EMM > C_5_1_PHY, > + EMMC_5_2_PHY > } > > Either way (leave NR_PHY_TYPES or remove NR_PHY_TYPES) is fine from my > side. > Preference on this ? If no objection [nobody insists] I would keep. I don't feel strongly about it [dropping NR_PHY_TYPES or not]. Thanks Alex > Thanks > Alex > > > regards, > > dan carpenter > > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 03/16] lib,treewide: add new match_string() helper/macro
On Wed, 2019-05-08 at 16:22 +0300, Alexandru Ardelean wrote: > On Wed, 2019-05-08 at 15:18 +0200, Greg KH wrote: > > > > > > On Wed, May 08, 2019 at 04:11:28PM +0300, Andy Shevchenko wrote: > > > On Wed, May 08, 2019 at 02:28:29PM +0300, Alexandru Ardelean wrote: > > > > This change re-introduces `match_string()` as a macro that uses > > > > ARRAY_SIZE() to compute the size of the array. > > > > The macro is added in all the places that do > > > > `match_string(_a, ARRAY_SIZE(_a), s)`, since the change is pretty > > > > straightforward. > > > > > > Can you split include/linux/ change from the rest? > > > > That would break the build, why do you want it split out? This makes > > sense all as a single patch to me. > > > > Not really. > It would be just be the new match_string() helper/macro in a new commit. > And the conversions of the simple users of match_string() (the ones using > ARRAY_SIZE()) in another commit. > I should have asked in my previous reply. Leave this as-is or re-formulate in 2 patches ? No strong preference from my side. Thanks Alex > Thanks > Alex > > > thanks, > > > > greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: wlan-ng: collect return status without variable
On Fri, May 10, 2019 at 08:09:00AM +0530, Hariprasad Kelam wrote: > diff --git a/drivers/staging/wlan-ng/cfg80211.c > b/drivers/staging/wlan-ng/cfg80211.c > index 8a862f7..5dad5ac 100644 > --- a/drivers/staging/wlan-ng/cfg80211.c > +++ b/drivers/staging/wlan-ng/cfg80211.c > @@ -231,17 +231,12 @@ static int prism2_set_default_key(struct wiphy *wiphy, > struct net_device *dev, > { > struct wlandevice *wlandev = dev->ml_priv; > > - int err = 0; > - int result = 0; > - > - result = prism2_domibset_uint32(wlandev, > - DIDMIB_DOT11SMT_PRIVACYTABLE_WEPDEFAULTKEYID, > - key_index); > - > - if (result) > - err = -EFAULT; > - > - return err; > + if (prism2_domibset_uint32(wlandev, > +DIDMIB_DOT11SMT_PRIVACYTABLE_WEPDEFAULTKEYID, > +key_index)) > + return -EFAULT; > + else > + return 0; We should just preserve the error codes from prism2_domibset_uint32(). return prism2_domibset_uint32(dev->ml_priv, DIDMIB_DOT11SMT_PRIVACYTABLE_WEPDEFAULTKEYID, key_index); regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 09/16] mmc: sdhci-xenon: use new match_string() helper/macro
On Fri, 2019-05-10 at 14:01 +0300, Dan Carpenter wrote: > [External] > > > On Fri, May 10, 2019 at 09:13:26AM +, Ardelean, Alexandru wrote: > > On Wed, 2019-05-08 at 16:26 +0300, Alexandru Ardelean wrote: > > > On Wed, 2019-05-08 at 15:20 +0300, Dan Carpenter wrote: > > > > > > > > > > > > On Wed, May 08, 2019 at 02:28:35PM +0300, Alexandru Ardelean wrote: > > > > > -static const char * const phy_types[] = { > > > > > - "emmc 5.0 phy", > > > > > - "emmc 5.1 phy" > > > > > -}; > > > > > - > > > > > enum xenon_phy_type_enum { > > > > > EMMC_5_0_PHY, > > > > > EMMC_5_1_PHY, > > > > > NR_PHY_TYPES > > > > > > > > There is no need for NR_PHY_TYPES now so you could remove that as > > > > well. > > > > > > > > > > I thought the same. > > > The only reason to keep NR_PHY_TYPES, is for potential future > > > patches, > > > where it would be just 1 addition > > > > > > enum xenon_phy_type_enum { > > > EMMC_5_0_PHY, > > > EMMC_5_1_PHY, > > > + EMMC_5_2_PHY, > > > NR_PHY_TYPES > > > } > > > > > > Depending on style/preference of how to do enums (allow comma on last > > > enum > > > or not allow comma on last enum value), adding new enum values woudl > > > be 2 > > > additions + 1 deletion lines. > > > > > > enum xenon_phy_type_enum { > > > EMMC_5_0_PHY, > > > - EMMC_5_1_PHY > > > + EMM > > > C_5_1_PHY, > > > + EMMC_5_2_PHY > > > } > > > > > > Either way (leave NR_PHY_TYPES or remove NR_PHY_TYPES) is fine from > > > my > > > side. > > > > > > > Preference on this ? > > If no objection [nobody insists] I would keep. > > > > I don't feel strongly about it [dropping NR_PHY_TYPES or not]. > > If you end up resending the series could you remove it, but if not then > it's not worth it. ack thanks Alex > > regards, > dan carpenter > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 09/16] mmc: sdhci-xenon: use new match_string() helper/macro
On Fri, May 10, 2019 at 09:13:26AM +, Ardelean, Alexandru wrote: > On Wed, 2019-05-08 at 16:26 +0300, Alexandru Ardelean wrote: > > On Wed, 2019-05-08 at 15:20 +0300, Dan Carpenter wrote: > > > > > > > > > On Wed, May 08, 2019 at 02:28:35PM +0300, Alexandru Ardelean wrote: > > > > -static const char * const phy_types[] = { > > > > - "emmc 5.0 phy", > > > > - "emmc 5.1 phy" > > > > -}; > > > > - > > > > enum xenon_phy_type_enum { > > > > EMMC_5_0_PHY, > > > > EMMC_5_1_PHY, > > > > NR_PHY_TYPES > > > > > > There is no need for NR_PHY_TYPES now so you could remove that as well. > > > > > > > I thought the same. > > The only reason to keep NR_PHY_TYPES, is for potential future patches, > > where it would be just 1 addition > > > > enum xenon_phy_type_enum { > > EMMC_5_0_PHY, > > EMMC_5_1_PHY, > > + EMMC_5_2_PHY, > > NR_PHY_TYPES > > } > > > > Depending on style/preference of how to do enums (allow comma on last > > enum > > or not allow comma on last enum value), adding new enum values woudl be 2 > > additions + 1 deletion lines. > > > > enum xenon_phy_type_enum { > > EMMC_5_0_PHY, > > - EMMC_5_1_PHY > > + EMM > > C_5_1_PHY, > > + EMMC_5_2_PHY > > } > > > > Either way (leave NR_PHY_TYPES or remove NR_PHY_TYPES) is fine from my > > side. > > > > Preference on this ? > If no objection [nobody insists] I would keep. > > I don't feel strongly about it [dropping NR_PHY_TYPES or not]. If you end up resending the series could you remove it, but if not then it's not worth it. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: kpc2000: Fix build error without CONFIG_UIO
Fix gcc build error while CONFIG_UIO is not set ERROR: "uio_unregister_device" [drivers/staging/kpc2000/kpc2000/kpc2000.ko] undefined! ERROR: "__uio_register_device" [drivers/staging/kpc2000/kpc2000/kpc2000.ko] undefined! Add UIO Kconfig dependency to fix this. Reported-by: Hulk Robot Fixes: 7dc7967fc39a ("staging: kpc2000: add initial set of Daktronics drivers") Signed-off-by: YueHaibing --- drivers/staging/kpc2000/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/kpc2000/Kconfig b/drivers/staging/kpc2000/Kconfig index fb59229..febe4f8 100644 --- a/drivers/staging/kpc2000/Kconfig +++ b/drivers/staging/kpc2000/Kconfig @@ -3,6 +3,7 @@ config KPC2000 bool "Daktronics KPC Device support" depends on PCI + depends on UIO help Select this if you wish to use the Daktronics KPC PCI devices -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 03/16] lib,treewide: add new match_string() helper/macro
On Fri, May 10, 2019 at 09:15:27AM +, Ardelean, Alexandru wrote: > On Wed, 2019-05-08 at 16:22 +0300, Alexandru Ardelean wrote: > > On Wed, 2019-05-08 at 15:18 +0200, Greg KH wrote: > > > On Wed, May 08, 2019 at 04:11:28PM +0300, Andy Shevchenko wrote: > > > > On Wed, May 08, 2019 at 02:28:29PM +0300, Alexandru Ardelean wrote: > > > > Can you split include/linux/ change from the rest? > > > > > > That would break the build, why do you want it split out? This makes > > > sense all as a single patch to me. > > > > > > > Not really. > > It would be just be the new match_string() helper/macro in a new commit. > > And the conversions of the simple users of match_string() (the ones using > > ARRAY_SIZE()) in another commit. > > > > I should have asked in my previous reply. > Leave this as-is or re-formulate in 2 patches ? Depends on on what you would like to spend your time: collecting Acks for all pieces in treewide patch or send new API first followed up by per driver / module update in next cycle. I also have no strong preference. And I think it's good to add Heikki Krogerus to Cc list for both patch series, since he is the author of sysfs variant and may have something to comment on the rest. -- With Best Regards, Andy Shevchenko ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3 2/2] phy: ralink: Add PHY driver for MT7621 PCIe PHY
Hi all, On Thu, Apr 25, 2019 at 5:41 PM Sergio Paracuellos wrote: > > This patch adds a driver for the PCIe PHY of MT7621 SoC. > > Signed-off-by: Sergio Paracuellos > --- > drivers/phy/ralink/Kconfig | 8 + > drivers/phy/ralink/Makefile | 1 + > drivers/phy/ralink/phy-mt7621-pci.c | 423 > 3 files changed, 432 insertions(+) > create mode 100644 drivers/phy/ralink/phy-mt7621-pci.c Any comments on this? Thanks in advance for your time. Best regards, Sergio Paracuellos > > diff --git a/drivers/phy/ralink/Kconfig b/drivers/phy/ralink/Kconfig > index 14fd219535ef..429187ff02e2 100644 > --- a/drivers/phy/ralink/Kconfig > +++ b/drivers/phy/ralink/Kconfig > @@ -1,6 +1,14 @@ > # > # PHY drivers for Ralink platforms. > # > +config PHY_MT7621_PCI > + tristate "MediaTek MT7621 PCI PHY Driver" > + depends on (RALINK || COMPILE_TEST) && OF > + select GENERIC_PHY > + select REGMAP_MMIO > + help > + Say 'Y' here to add support for MediaTek MT7621 PCI PHY driver, > + > config PHY_RALINK_USB > tristate "Ralink USB PHY driver" > depends on RALINK || COMPILE_TEST > diff --git a/drivers/phy/ralink/Makefile b/drivers/phy/ralink/Makefile > index 5c9e326e8757..2052d5649863 100644 > --- a/drivers/phy/ralink/Makefile > +++ b/drivers/phy/ralink/Makefile > @@ -1 +1,2 @@ > +obj-$(CONFIG_PHY_MT7621_PCI) += phy-mt7621-pci.o > obj-$(CONFIG_PHY_RALINK_USB) += phy-ralink-usb.o > diff --git a/drivers/phy/ralink/phy-mt7621-pci.c > b/drivers/phy/ralink/phy-mt7621-pci.c > new file mode 100644 > index ..2576f179e30a > --- /dev/null > +++ b/drivers/phy/ralink/phy-mt7621-pci.c > @@ -0,0 +1,423 @@ > +// SPDX-License-Identifier: GPL-2.0+ > +/* > + * Mediatek MT7621 PCI PHY Driver > + * Author: Sergio Paracuellos > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#define RALINK_CLKCFG1 0x30 > + > +#define PCIE_PORT_CLK_EN(x)BIT(24 + (x)) > + > +#define RG_PE1_PIPE_REG0x02c > +#define RG_PE1_PIPE_RSTBIT(12) > +#define RG_PE1_PIPE_CMD_FRCBIT(4) > + > +#define RG_P0_TO_P1_WIDTH 0x100 > +#define RG_PE1_H_LCDDS_REG 0x49c > +#define RG_PE1_H_LCDDS_PCW GENMASK(30, 0) > +#define RG_PE1_H_LCDDS_PCW_VAL(x) ((0x7fff & (x)) << 0) > + > +#define RG_PE1_FRC_H_XTAL_REG 0x400 > +#define RG_PE1_FRC_H_XTAL_TYPE BIT(8) > +#define RG_PE1_H_XTAL_TYPE GENMASK(10, 9) > +#define RG_PE1_H_XTAL_TYPE_VAL(x) ((0x3 & (x)) << 9) > + > +#define RG_PE1_FRC_PHY_REG 0x000 > +#define RG_PE1_FRC_PHY_EN BIT(4) > +#define RG_PE1_PHY_EN BIT(5) > + > +#define RG_PE1_H_PLL_REG 0x490 > +#define RG_PE1_H_PLL_BCGENMASK(23, 22) > +#define RG_PE1_H_PLL_BC_VAL(x) ((0x3 & (x)) << 22) > +#define RG_PE1_H_PLL_BPGENMASK(21, 18) > +#define RG_PE1_H_PLL_BP_VAL(x) ((0xf & (x)) << 18) > +#define RG_PE1_H_PLL_IRGENMASK(15, 12) > +#define RG_PE1_H_PLL_IR_VAL(x) ((0xf & (x)) << 12) > +#define RG_PE1_H_PLL_ICGENMASK(11, 8) > +#define RG_PE1_H_PLL_IC_VAL(x) ((0xf & (x)) << 8) > +#define RG_PE1_H_PLL_PREDIVGENMASK(7, 6) > +#define RG_PE1_H_PLL_PREDIV_VAL(x) ((0x3 & (x)) << 6) > +#define RG_PE1_PLL_DIVEN GENMASK(3, 1) > +#define RG_PE1_PLL_DIVEN_VAL(x)((0x7 & (x)) << 1) > + > +#define RG_PE1_H_PLL_FBKSEL_REG0x4bc > +#define RG_PE1_H_PLL_FBKSELGENMASK(5, 4) > +#define RG_PE1_H_PLL_FBKSEL_VAL(x) ((0x3 & (x)) << 4) > + > +#defineRG_PE1_H_LCDDS_SSC_PRD_REG 0x4a4 > +#define RG_PE1_H_LCDDS_SSC_PRD GENMASK(15, 0) > +#define RG_PE1_H_LCDDS_SSC_PRD_VAL(x) ((0x & (x)) << 0) > + > +#define RG_PE1_H_LCDDS_SSC_DELTA_REG 0x4a8 > +#define RG_PE1_H_LCDDS_SSC_DELTA GENMASK(11, 0) > +#define RG_PE1_H_LCDDS_SSC_DELTA_VAL(x)((0xfff & (x)) << 0) > +#define RG_PE1_H_LCDDS_SSC_DELTA1 GENMASK(27, 16) > +#define RG_PE1_H_LCDDS_SSC_DELTA1_VAL(x) ((0xff & (x)) << 16) > + > +#define RG_PE1_LCDDS_CLK_PH_INV_REG0x4a0 > +#define RG_PE1_LCDDS_CLK_PH_INVBIT(5) > + > +#define RG_PE1_H_PLL_BR_REG0x4ac > +#define RG_PE1_H_PLL_BRGENMASK(18, 16) > +#define RG_PE1_H_PLL_BR_VAL(x) ((0x7 & (x)) << 16) > + > +#defineR
Re: [RFC] simple_lmk: Introduce Simple Low Memory Killer for Android
On 05/09, Sultan Alsawaf wrote: > > On Thu, May 09, 2019 at 05:56:46PM +0200, Oleg Nesterov wrote: > > Impossible ;) I bet lockdep should report the deadlock as soon as > > find_victims() > > calls find_lock_task_mm() when you already have a locked victim. > > I hope you're not a betting man ;) I am starting to think I am ;) If you have task1 != task2 this code task_lock(task1); task_lock(task2); should trigger print_deadlock_bug(), task1->alloc_lock and task2->alloc_lock are the "same" lock from lockdep pov, held_lock's will have the same hlock_class(). > CONFIG_PROVE_LOCKING=y OK, > And a printk added in vtsk_is_duplicate() to print when a duplicate is > detected, in this case find_lock_task_mm() won't be called, and this is what saves us from the actual deadlock. > and my phone's memory cut in half to make simple_lmk do something, this is > what > I observed: > taimen:/ # dmesg | grep lockdep > [0.00] \x09RCU lockdep checking is enabled. this reports that CONFIG_PROVE_RCU is enabled ;) > taimen:/ # dmesg | grep simple_lmk > [ 23.211091] simple_lmk: Killing android.carrier with adj 906 to free 37420 > kiB > [ 23.211160] simple_lmk: Killing oadcastreceiver with adj 906 to free 36784 > kiB yes, looks like simple_lmk has at least 2 locked victims. And I have no idea why you do not see anything else in dmesg. May be debug_locks_off() was already called. But see above, "grep lockdep" won't work. Perhaps you can do "grep -e WARNING -e BUG -e locking". Oleg. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: wlan-ng: collect return status without variable
On Fri, May 10, 2019 at 01:57:54PM +0300, Dan Carpenter wrote: > On Fri, May 10, 2019 at 08:09:00AM +0530, Hariprasad Kelam wrote: > > diff --git a/drivers/staging/wlan-ng/cfg80211.c > > b/drivers/staging/wlan-ng/cfg80211.c > > index 8a862f7..5dad5ac 100644 > > --- a/drivers/staging/wlan-ng/cfg80211.c > > +++ b/drivers/staging/wlan-ng/cfg80211.c > > @@ -231,17 +231,12 @@ static int prism2_set_default_key(struct wiphy > > *wiphy, struct net_device *dev, > > { > > struct wlandevice *wlandev = dev->ml_priv; > > > > - int err = 0; > > - int result = 0; > > - > > - result = prism2_domibset_uint32(wlandev, > > - DIDMIB_DOT11SMT_PRIVACYTABLE_WEPDEFAULTKEYID, > > - key_index); > > - > > - if (result) > > - err = -EFAULT; > > - > > - return err; > > + if (prism2_domibset_uint32(wlandev, > > + DIDMIB_DOT11SMT_PRIVACYTABLE_WEPDEFAULTKEYID, > > + key_index)) > > + return -EFAULT; > > + else > > + return 0; > > We should just preserve the error codes from prism2_domibset_uint32(). > > return prism2_domibset_uint32(dev->ml_priv, > DIDMIB_DOT11SMT_PRIVACYTABLE_WEPDEFAULTKEYID, > key_index); > prism2_domibset_uint32 function can return -ENODEV,-EPERM,-EBUSY if fail case. If we observe the pattern of calling this function,we can find "return -EFAULT on failure and 0 on success". Due to this we can not collect return status directly. > regards, > dan carpenter > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: wlan-ng: collect return status without variable
On Fri, May 10, 2019 at 10:53:08PM +0530, Hariprasad Kelam wrote: > On Fri, May 10, 2019 at 01:57:54PM +0300, Dan Carpenter wrote: > > On Fri, May 10, 2019 at 08:09:00AM +0530, Hariprasad Kelam wrote: > > > diff --git a/drivers/staging/wlan-ng/cfg80211.c > > > b/drivers/staging/wlan-ng/cfg80211.c > > > index 8a862f7..5dad5ac 100644 > > > --- a/drivers/staging/wlan-ng/cfg80211.c > > > +++ b/drivers/staging/wlan-ng/cfg80211.c > > > @@ -231,17 +231,12 @@ static int prism2_set_default_key(struct wiphy > > > *wiphy, struct net_device *dev, > > > { > > > struct wlandevice *wlandev = dev->ml_priv; > > > > > > - int err = 0; > > > - int result = 0; > > > - > > > - result = prism2_domibset_uint32(wlandev, > > > - DIDMIB_DOT11SMT_PRIVACYTABLE_WEPDEFAULTKEYID, > > > - key_index); > > > - > > > - if (result) > > > - err = -EFAULT; > > > - > > > - return err; > > > + if (prism2_domibset_uint32(wlandev, > > > +DIDMIB_DOT11SMT_PRIVACYTABLE_WEPDEFAULTKEYID, > > > +key_index)) > > > + return -EFAULT; > > > + else > > > + return 0; > > > > We should just preserve the error codes from prism2_domibset_uint32(). > > > > return prism2_domibset_uint32(dev->ml_priv, > > DIDMIB_DOT11SMT_PRIVACYTABLE_WEPDEFAULTKEYID, > > key_index); > > >prism2_domibset_uint32 function can return -ENODEV,-EPERM,-EBUSY if >fail case. > >If we observe the pattern of calling this function,we can find > >"return -EFAULT on failure and 0 on success". > >Due to this we can not collect return status directly. Yes, I know this code is full of nonsense. It shouldn't just always return -EFAULT, it should preserve the correct error code. This is only called from rdev_set_default_key() if you want to check the caller. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: kpc2000: kpc_dma: resolve checkpath errors and warnings
This patch resolves coding style errors and warnings reported by chechpatch ERROR: "(foo*)" should be "(foo *)" ERROR: trailing whitespace ERROR: space required before the open brace '{' ERROR: "foo * bar" should be "foo *bar" ERROR: space prohibited after that '!' (ctx:BxW) ERROR: space prohibited after that open parenthesis '(' ERROR: switch and case should be at the same indent ERROR: trailing statements should be on next line ERROR: Macros with complex values should be enclosed in parentheses ERROR: "foo __init bar" should be "foo __init bar" ERROR: "foo __exit bar" should be "foo __exit bar" WARNING: Missing a blank line after declarations WARNING: Prefer using '"%s...", __func__' to using function's name, in a string WARNING: braces {} are not necessary for any arm of this statement WARNING: unnecessary cast may hide bugs WARNING: braces {} are not necessary for single statement WARNING: struct file_operations should normally be const WARNING: labels should not be indented Signed-off-by: Vandana BN --- drivers/staging/kpc2000/kpc_dma/dma.c | 137 +-- drivers/staging/kpc2000/kpc_dma/fileops.c | 220 +- .../staging/kpc2000/kpc_dma/kpc_dma_driver.c | 121 +- .../staging/kpc2000/kpc_dma/kpc_dma_driver.h | 32 +-- 4 files changed, 265 insertions(+), 245 deletions(-) diff --git a/drivers/staging/kpc2000/kpc_dma/dma.c b/drivers/staging/kpc2000/kpc_dma/dma.c index 6959bac11388..e7967f3089c2 100644 --- a/drivers/staging/kpc2000/kpc_dma/dma.c +++ b/drivers/staging/kpc2000/kpc_dma/dma.c @@ -14,11 +14,11 @@ static irqreturn_t ndd_irq_handler(int irq, void *dev_id) { - struct kpc_dma_device *ldev = (struct kpc_dma_device*)dev_id; - + struct kpc_dma_device *ldev = (struct kpc_dma_device *)dev_id; + if ((GetEngineControl(ldev) & ENG_CTL_IRQ_ACTIVE) || (ldev->desc_completed->MyDMAAddr != GetEngineCompletePtr(ldev))) schedule_work(&ldev->irq_work); - + return IRQ_HANDLED; } @@ -28,42 +28,42 @@ void ndd_irq_worker(struct work_struct *ws) struct kpc_dma_descriptor *cur; struct kpc_dma_device *eng = container_of(ws, struct kpc_dma_device, irq_work); lock_engine(eng); - + if (GetEngineCompletePtr(eng) == 0) goto out; - + if (eng->desc_completed->MyDMAAddr == GetEngineCompletePtr(eng)) goto out; - + cur = eng->desc_completed; do { cur = cur->Next; dev_dbg(&eng->pldev->dev, "Handling completed descriptor %p (acd = %p)\n", cur, cur->acd); BUG_ON(cur == eng->desc_next); // Ordering failure. - - if (cur->DescControlFlags & DMA_DESC_CTL_SOP){ + + if (cur->DescControlFlags & DMA_DESC_CTL_SOP) { eng->accumulated_bytes = 0; eng->accumulated_flags = 0; } - + eng->accumulated_bytes += cur->DescByteCount; if (cur->DescStatusFlags & DMA_DESC_STS_ERROR) eng->accumulated_flags |= ACD_FLAG_ENG_ACCUM_ERROR; - + if (cur->DescStatusFlags & DMA_DESC_STS_SHORT) eng->accumulated_flags |= ACD_FLAG_ENG_ACCUM_SHORT; - - if (cur->DescControlFlags & DMA_DESC_CTL_EOP){ + + if (cur->DescControlFlags & DMA_DESC_CTL_EOP) { if (cur->acd) transfer_complete_cb(cur->acd, eng->accumulated_bytes, eng->accumulated_flags | ACD_FLAG_DONE); } - + eng->desc_completed = cur; } while (cur->MyDMAAddr != GetEngineCompletePtr(eng)); - + out: SetClearEngineControl(eng, ENG_CTL_IRQ_ACTIVE, 0); - + unlock_engine(eng); } @@ -73,171 +73,172 @@ void start_dma_engine(struct kpc_dma_device *eng) { eng->desc_next = eng->desc_pool_first; eng->desc_completed = eng->desc_pool_last; - + // Setup the engine pointer registers SetEngineNextPtr(eng, eng->desc_pool_first); SetEngineSWPtr(eng, eng->desc_pool_first); ClearEngineCompletePtr(eng); - + WriteEngineControl(eng, ENG_CTL_DMA_ENABLE | ENG_CTL_IRQ_ENABLE); } int setup_dma_engine(struct kpc_dma_device *eng, u32 desc_cnt) { u32 caps; - struct kpc_dma_descriptor * cur; - struct kpc_dma_descriptor * next; + struct kpc_dma_descriptor *cur; + struct kpc_dma_descriptor *next; dma_addr_t next_handle; dma_addr_t head_handle; unsigned int i; int rv; + dev_dbg(&eng->pldev->dev, "Setting up DMA engine [%p]\n", eng); - + caps = GetEngineCapabilities(eng); - - if (WARN(!(caps & ENG_CAP_PRESENT), "setup_dma_engine() called for DMA Engine at %p which isn't present in hardw
Re: [Linux-kernel-mentees] [PATCH] Staging: kpc2000: kpc_dma: resolve checkpath errors and warnings
On Fri, May 10, 2019 at 9:39 PM Vandana BN wrote: > > This patch resolves coding style errors and warnings reported by chechpatch > I did not look at the patch in detail, but you might want to also consider to replace the CamlCase (function) names by names in lower-case with underscores. That is the common style in the kernel. Lukas ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 2/9] media: staging/imx: Switch to sync registration for IPU subdevs
Because the IPU sub-devices VDIC and IC are not present in the device-tree, platform devices were created for them instead. This allowed these sub-devices to be added to the media device's async notifier and registered asynchronously along with the other sub-devices that do have a device-tree presence (CSI and devices external to the IPU and SoC). But that approach isn't really necessary. The IPU sub-devices don't actually require a backing device (sd->dev is allowed to be NULL). And that approach can't get around the fact that the IPU sub-devices are not part of a device hierarchy, which makes it awkward to retrieve the parent IPU of these devices. By registering them synchronously, they can be registered from the CSI async bound notifier, so the init function for them can be given the CSI subdev, who's dev->parent is the IPU. That is a somewhat cleaner way to retrieve the parent IPU. So convert to synchronous registration for the VDIC and IC task sub-devices, at the time a CSI sub-device is bound. There is no longer a backing device for them (sd->dev is NULL), but that's ok. Also set the VDIC/IC sub-device owner as the IPU, so that a reference can be taken on the IPU module. Since the VDIC and IC task drivers are no longer platform drivers, they are now statically linked to imx-media module. Signed-off-by: Steve Longerbeam --- Changes in v3: - statically link VDIC and IC task objects to imx-media module in Makefile. --- drivers/staging/media/imx/Makefile| 6 +- drivers/staging/media/imx/imx-ic-common.c | 70 ++-- drivers/staging/media/imx/imx-ic-prp.c| 34 +- drivers/staging/media/imx/imx-ic-prpencvf.c | 70 ++-- drivers/staging/media/imx/imx-ic.h| 7 +- drivers/staging/media/imx/imx-media-capture.c | 7 +- drivers/staging/media/imx/imx-media-csi.c | 2 +- drivers/staging/media/imx/imx-media-dev.c | 121 +- .../staging/media/imx/imx-media-internal-sd.c | 356 -- drivers/staging/media/imx/imx-media-of.c | 38 +- drivers/staging/media/imx/imx-media-vdic.c| 85 ++--- drivers/staging/media/imx/imx-media.h | 67 ++-- drivers/staging/media/imx/imx7-media-csi.c| 3 +- 13 files changed, 327 insertions(+), 539 deletions(-) diff --git a/drivers/staging/media/imx/Makefile b/drivers/staging/media/imx/Makefile index d2d909a36239..86f0c81b6a3b 100644 --- a/drivers/staging/media/imx/Makefile +++ b/drivers/staging/media/imx/Makefile @@ -1,14 +1,12 @@ # SPDX-License-Identifier: GPL-2.0 -imx-media-objs := imx-media-dev.o imx-media-internal-sd.o imx-media-of.o +imx-media-objs := imx-media-dev.o imx-media-internal-sd.o imx-media-of.o \ + imx-ic-common.o imx-ic-prp.o imx-ic-prpencvf.o imx-media-vdic.o imx-media-objs += imx-media-dev-common.o imx-media-common-objs := imx-media-utils.o imx-media-fim.o -imx-media-ic-objs := imx-ic-common.o imx-ic-prp.o imx-ic-prpencvf.o obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-media.o obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-media-common.o obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-media-capture.o -obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-media-vdic.o -obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-media-ic.o obj-$(CONFIG_VIDEO_IMX_CSI) += imx-media-csi.o obj-$(CONFIG_VIDEO_IMX_CSI) += imx6-mipi-csi2.o diff --git a/drivers/staging/media/imx/imx-ic-common.c b/drivers/staging/media/imx/imx-ic-common.c index 1addb0893c57..ad0c291db03c 100644 --- a/drivers/staging/media/imx/imx-ic-common.c +++ b/drivers/staging/media/imx/imx-ic-common.c @@ -8,8 +8,6 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ -#include -#include #include #include #include "imx-media.h" @@ -24,23 +22,25 @@ static struct imx_ic_ops *ic_ops[IC_NUM_OPS] = { [IC_TASK_VIEWFINDER] = &imx_ic_prpencvf_ops, }; -static int imx_ic_probe(struct platform_device *pdev) +struct v4l2_subdev *imx_media_ic_register(struct imx_media_dev *imxmd, + struct device *ipu_dev, + struct ipu_soc *ipu, + u32 grp_id) { - struct imx_media_ipu_internal_sd_pdata *pdata; + struct v4l2_device *v4l2_dev = &imxmd->v4l2_dev; struct imx_ic_priv *priv; int ret; - priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); + priv = devm_kzalloc(ipu_dev, sizeof(*priv), GFP_KERNEL); if (!priv) - return -ENOMEM; + return ERR_PTR(-ENOMEM); - platform_set_drvdata(pdev, &priv->sd); - priv->dev = &pdev->dev; + priv->ipu_dev = ipu_dev; + priv->ipu = ipu; + priv->md = imxmd; - /* get our ipu_id, grp_id and IC task id */ - pdata = priv->dev->platform_data; - priv->ipu_id = pdata->ipu_id; - switch (pdata->grp_id) { + /* get our IC task id */ + switch (grp_id) { case IMX_MEDIA_GRP_ID_IPU_IC_PRP: priv
[PATCH v5 4/9] media: staging/imx: Move add_video_device into capture_device_register
Move imx_media_add_video_device() into imx_media_capture_device_register(). Also the former has no error conditions to convert to void. Signed-off-by: Steve Longerbeam --- drivers/staging/media/imx/imx-ic-prpencvf.c | 5 - drivers/staging/media/imx/imx-media-capture.c | 3 +++ drivers/staging/media/imx/imx-media-csi.c | 7 +-- drivers/staging/media/imx/imx-media-utils.c | 9 - drivers/staging/media/imx/imx-media.h | 4 ++-- drivers/staging/media/imx/imx7-media-csi.c| 12 +--- 6 files changed, 11 insertions(+), 29 deletions(-) diff --git a/drivers/staging/media/imx/imx-ic-prpencvf.c b/drivers/staging/media/imx/imx-ic-prpencvf.c index ddcd87a17c71..8242d88dfb82 100644 --- a/drivers/staging/media/imx/imx-ic-prpencvf.c +++ b/drivers/staging/media/imx/imx-ic-prpencvf.c @@ -1241,7 +1241,6 @@ static int prp_s_frame_interval(struct v4l2_subdev *sd, static int prp_registered(struct v4l2_subdev *sd) { struct prp_priv *priv = sd_to_priv(sd); - struct imx_ic_priv *ic_priv = priv->ic_priv; int i, ret; u32 code; @@ -1271,10 +1270,6 @@ static int prp_registered(struct v4l2_subdev *sd) if (ret) return ret; - ret = imx_media_add_video_device(ic_priv->md, priv->vdev); - if (ret) - goto unreg; - ret = prp_init_controls(priv); if (ret) goto unreg; diff --git a/drivers/staging/media/imx/imx-media-capture.c b/drivers/staging/media/imx/imx-media-capture.c index 211ec4df2066..335084a6b0cd 100644 --- a/drivers/staging/media/imx/imx-media-capture.c +++ b/drivers/staging/media/imx/imx-media-capture.c @@ -780,6 +780,9 @@ int imx_media_capture_device_register(struct imx_media_video_dev *vdev) vfd->ctrl_handler = &priv->ctrl_hdlr; + /* add vdev to the video device list */ + imx_media_add_video_device(priv->md, vdev); + return 0; unreg: video_unregister_device(vfd); diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c index ea3d13103c91..c70fa6b509ae 100644 --- a/drivers/staging/media/imx/imx-media-csi.c +++ b/drivers/staging/media/imx/imx-media-csi.c @@ -1820,13 +1820,8 @@ static int csi_registered(struct v4l2_subdev *sd) if (ret) goto free_fim; - ret = imx_media_add_video_device(priv->md, priv->vdev); - if (ret) - goto unreg; - return 0; -unreg: - imx_media_capture_device_unregister(priv->vdev); + free_fim: if (priv->fim) imx_media_fim_free(priv->fim); diff --git a/drivers/staging/media/imx/imx-media-utils.c b/drivers/staging/media/imx/imx-media-utils.c index c52aa59acd05..8a6e57652402 100644 --- a/drivers/staging/media/imx/imx-media-utils.c +++ b/drivers/staging/media/imx/imx-media-utils.c @@ -767,18 +767,17 @@ imx_media_find_subdev_by_devname(struct imx_media_dev *imxmd, EXPORT_SYMBOL_GPL(imx_media_find_subdev_by_devname); /* - * Adds a video device to the master video device list. This is called by - * an async subdev that owns a video device when it is registered. + * Adds a video device to the master video device list. This is called + * when a video device is registered. */ -int imx_media_add_video_device(struct imx_media_dev *imxmd, - struct imx_media_video_dev *vdev) +void imx_media_add_video_device(struct imx_media_dev *imxmd, + struct imx_media_video_dev *vdev) { mutex_lock(&imxmd->mutex); list_add_tail(&vdev->list, &imxmd->vdev_list); mutex_unlock(&imxmd->mutex); - return 0; } EXPORT_SYMBOL_GPL(imx_media_add_video_device); diff --git a/drivers/staging/media/imx/imx-media.h b/drivers/staging/media/imx/imx-media.h index ba2d75bcc4c9..71e20f53ed7b 100644 --- a/drivers/staging/media/imx/imx-media.h +++ b/drivers/staging/media/imx/imx-media.h @@ -189,8 +189,8 @@ imx_media_find_subdev_by_fwnode(struct imx_media_dev *imxmd, struct v4l2_subdev * imx_media_find_subdev_by_devname(struct imx_media_dev *imxmd, const char *devname); -int imx_media_add_video_device(struct imx_media_dev *imxmd, - struct imx_media_video_dev *vdev); +void imx_media_add_video_device(struct imx_media_dev *imxmd, + struct imx_media_video_dev *vdev); int imx_media_find_mipi_csi2_channel(struct imx_media_dev *imxmd, struct media_entity *start_entity); struct media_pad * diff --git a/drivers/staging/media/imx/imx7-media-csi.c b/drivers/staging/media/imx/imx7-media-csi.c index 96d01d8af874..f2037aba6e0e 100644 --- a/drivers/staging/media/imx/imx7-media-csi.c +++ b/drivers/staging/media/imx/imx7-media-csi.c @@ -1126,17 +1126,7 @@ static int imx7_csi_registered(struct v4l2_subdev *sd) if (ret < 0) return ret; - ret = imx_media_capture_device_register(c
[PATCH v5 1/9] Revert "media: staging/imx: add media device to capture register"
The imx6-specific subdevs that register a capture device will no longer hold a reference to the media device, so this commit must be reverted. This reverts commit 16204b8a1c1af77725533b77936e6c73953486ae. Signed-off-by: Steve Longerbeam --- drivers/staging/media/imx/imx-ic-prpencvf.c | 2 +- drivers/staging/media/imx/imx-media-capture.c | 6 +++--- drivers/staging/media/imx/imx-media-csi.c | 2 +- drivers/staging/media/imx/imx-media.h | 3 +-- drivers/staging/media/imx/imx7-media-csi.c| 2 +- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/staging/media/imx/imx-ic-prpencvf.c b/drivers/staging/media/imx/imx-ic-prpencvf.c index 3ca1422f6154..5c8e6ad8c025 100644 --- a/drivers/staging/media/imx/imx-ic-prpencvf.c +++ b/drivers/staging/media/imx/imx-ic-prpencvf.c @@ -1270,7 +1270,7 @@ static int prp_registered(struct v4l2_subdev *sd) if (ret) return ret; - ret = imx_media_capture_device_register(priv->md, priv->vdev); + ret = imx_media_capture_device_register(priv->vdev); if (ret) return ret; diff --git a/drivers/staging/media/imx/imx-media-capture.c b/drivers/staging/media/imx/imx-media-capture.c index 7688238a3396..9703c85b19c4 100644 --- a/drivers/staging/media/imx/imx-media-capture.c +++ b/drivers/staging/media/imx/imx-media-capture.c @@ -706,8 +706,7 @@ void imx_media_capture_device_error(struct imx_media_video_dev *vdev) } EXPORT_SYMBOL_GPL(imx_media_capture_device_error); -int imx_media_capture_device_register(struct imx_media_dev *md, - struct imx_media_video_dev *vdev) +int imx_media_capture_device_register(struct imx_media_video_dev *vdev) { struct capture_priv *priv = to_capture_priv(vdev); struct v4l2_subdev *sd = priv->src_sd; @@ -716,7 +715,8 @@ int imx_media_capture_device_register(struct imx_media_dev *md, struct v4l2_subdev_format fmt_src; int ret; - priv->md = md; + /* get media device */ + priv->md = dev_get_drvdata(sd->v4l2_dev->dev); vfd->v4l2_dev = sd->v4l2_dev; diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c index c33d714ed953..41965d8b56c4 100644 --- a/drivers/staging/media/imx/imx-media-csi.c +++ b/drivers/staging/media/imx/imx-media-csi.c @@ -1816,7 +1816,7 @@ static int csi_registered(struct v4l2_subdev *sd) if (ret) goto free_fim; - ret = imx_media_capture_device_register(priv->md, priv->vdev); + ret = imx_media_capture_device_register(priv->vdev); if (ret) goto free_fim; diff --git a/drivers/staging/media/imx/imx-media.h b/drivers/staging/media/imx/imx-media.h index fc5d969ded79..dd603a6b3a70 100644 --- a/drivers/staging/media/imx/imx-media.h +++ b/drivers/staging/media/imx/imx-media.h @@ -272,8 +272,7 @@ int imx_media_of_add_csi(struct imx_media_dev *imxmd, struct imx_media_video_dev * imx_media_capture_device_init(struct v4l2_subdev *src_sd, int pad); void imx_media_capture_device_remove(struct imx_media_video_dev *vdev); -int imx_media_capture_device_register(struct imx_media_dev *md, - struct imx_media_video_dev *vdev); +int imx_media_capture_device_register(struct imx_media_video_dev *vdev); void imx_media_capture_device_unregister(struct imx_media_video_dev *vdev); struct imx_media_buffer * imx_media_capture_device_next_buf(struct imx_media_video_dev *vdev); diff --git a/drivers/staging/media/imx/imx7-media-csi.c b/drivers/staging/media/imx/imx7-media-csi.c index a708a0340eb1..18eb5d3ecf10 100644 --- a/drivers/staging/media/imx/imx7-media-csi.c +++ b/drivers/staging/media/imx/imx7-media-csi.c @@ -1126,7 +1126,7 @@ static int imx7_csi_registered(struct v4l2_subdev *sd) if (ret < 0) return ret; - ret = imx_media_capture_device_register(csi->imxmd, csi->vdev); + ret = imx_media_capture_device_register(csi->vdev); if (ret < 0) return ret; -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 9/9] media: staging/imx: Don't set driver data for v4l2_dev
The media device is already available via multiple methods, there is no need to set driver data for v4l2_dev to the media device. In imx_media_link_notify(), get media device from link->graph_obj.mdev. In imx_media_capture_device_register(), get media device from v4l2_dev->mdev. Signed-off-by: Steve Longerbeam --- drivers/staging/media/imx/imx-media-capture.c| 5 +++-- drivers/staging/media/imx/imx-media-dev-common.c | 7 ++- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/staging/media/imx/imx-media-capture.c b/drivers/staging/media/imx/imx-media-capture.c index 8a908c3e5e60..ea7f2decfc16 100644 --- a/drivers/staging/media/imx/imx-media-capture.c +++ b/drivers/staging/media/imx/imx-media-capture.c @@ -735,15 +735,16 @@ int imx_media_capture_device_register(struct imx_media_video_dev *vdev) { struct capture_priv *priv = to_capture_priv(vdev); struct v4l2_subdev *sd = priv->src_sd; + struct v4l2_device *v4l2_dev = sd->v4l2_dev; struct video_device *vfd = vdev->vfd; struct vb2_queue *vq = &priv->q; struct v4l2_subdev_format fmt_src; int ret; /* get media device */ - priv->md = dev_get_drvdata(sd->v4l2_dev->dev); + priv->md = container_of(v4l2_dev->mdev, struct imx_media_dev, md); - vfd->v4l2_dev = sd->v4l2_dev; + vfd->v4l2_dev = v4l2_dev; ret = video_register_device(vfd, VFL_TYPE_GRABBER, -1); if (ret) { diff --git a/drivers/staging/media/imx/imx-media-dev-common.c b/drivers/staging/media/imx/imx-media-dev-common.c index 89dc4ec8dadb..66b505f7e8df 100644 --- a/drivers/staging/media/imx/imx-media-dev-common.c +++ b/drivers/staging/media/imx/imx-media-dev-common.c @@ -260,10 +260,11 @@ static int imx_media_inherit_controls(struct imx_media_dev *imxmd, static int imx_media_link_notify(struct media_link *link, u32 flags, unsigned int notification) { + struct imx_media_dev *imxmd = container_of(link->graph_obj.mdev, + struct imx_media_dev, md); struct media_entity *source = link->source->entity; struct imx_media_pad_vdev *pad_vdev; struct list_head *pad_vdev_list; - struct imx_media_dev *imxmd; struct video_device *vfd; struct v4l2_subdev *sd; int pad_idx, ret; @@ -279,8 +280,6 @@ static int imx_media_link_notify(struct media_link *link, u32 flags, sd = media_entity_to_v4l2_subdev(source); pad_idx = link->source->index; - imxmd = dev_get_drvdata(sd->v4l2_dev->dev); - pad_vdev_list = to_pad_vdev_list(sd, pad_idx); if (!pad_vdev_list) { /* nothing to do if source sd has no pad vdev list */ @@ -384,8 +383,6 @@ struct imx_media_dev *imx_media_dev_init(struct device *dev, goto cleanup; } - dev_set_drvdata(imxmd->v4l2_dev.dev, imxmd); - INIT_LIST_HEAD(&imxmd->vdev_list); v4l2_async_notifier_init(&imxmd->notifier); -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 8/9] media: staging/imx: Improve pipeline searching
Export find_pipeline_pad(), renaming to imx_media_pipeline_pad(), and extend its functionality to allow searching for video devices in the enabled pipeline in addition to sub-devices. As part of this: - Rename imx_media_find_mipi_csi2_channel() to imx_media_pipeline_csi2_channel(). - Remove imx_media_find_upstream_pad(), it is redundant now. - Rename imx_media_find_upstream_subdev() to imx_media_pipeline_subdev() with an additional boolean argument for searching upstream or downstream. - Add imx_media_pipeline_video_device() which is analogous to imx_media_pipeline_subdev() but searches for video devices. - Remove imxmd pointer arg from all of the functions above, it was never used in those functions. With that change the i.MX5/6 CSI, VDIC, and IC sub-devices no longer require the media_device. Signed-off-by: Steve Longerbeam --- drivers/staging/media/imx/imx-ic-common.c | 4 +- drivers/staging/media/imx/imx-ic-prp.c| 4 +- drivers/staging/media/imx/imx-ic.h| 1 - drivers/staging/media/imx/imx-media-csi.c | 13 +- drivers/staging/media/imx/imx-media-fim.c | 4 - .../staging/media/imx/imx-media-internal-sd.c | 5 +- drivers/staging/media/imx/imx-media-utils.c | 128 ++ drivers/staging/media/imx/imx-media-vdic.c| 5 +- drivers/staging/media/imx/imx-media.h | 20 +-- drivers/staging/media/imx/imx7-media-csi.c| 2 +- 10 files changed, 93 insertions(+), 93 deletions(-) diff --git a/drivers/staging/media/imx/imx-ic-common.c b/drivers/staging/media/imx/imx-ic-common.c index ad0c291db03c..37734984beb4 100644 --- a/drivers/staging/media/imx/imx-ic-common.c +++ b/drivers/staging/media/imx/imx-ic-common.c @@ -22,12 +22,11 @@ static struct imx_ic_ops *ic_ops[IC_NUM_OPS] = { [IC_TASK_VIEWFINDER] = &imx_ic_prpencvf_ops, }; -struct v4l2_subdev *imx_media_ic_register(struct imx_media_dev *imxmd, +struct v4l2_subdev *imx_media_ic_register(struct v4l2_device *v4l2_dev, struct device *ipu_dev, struct ipu_soc *ipu, u32 grp_id) { - struct v4l2_device *v4l2_dev = &imxmd->v4l2_dev; struct imx_ic_priv *priv; int ret; @@ -37,7 +36,6 @@ struct v4l2_subdev *imx_media_ic_register(struct imx_media_dev *imxmd, priv->ipu_dev = ipu_dev; priv->ipu = ipu; - priv->md = imxmd; /* get our IC task id */ switch (grp_id) { diff --git a/drivers/staging/media/imx/imx-ic-prp.c b/drivers/staging/media/imx/imx-ic-prp.c index 663db200e594..1432776a33f9 100644 --- a/drivers/staging/media/imx/imx-ic-prp.c +++ b/drivers/staging/media/imx/imx-ic-prp.c @@ -302,8 +302,8 @@ static int prp_link_validate(struct v4l2_subdev *sd, if (ret) return ret; - csi = imx_media_find_upstream_subdev(ic_priv->md, &ic_priv->sd.entity, -IMX_MEDIA_GRP_ID_IPU_CSI); + csi = imx_media_pipeline_subdev(&ic_priv->sd.entity, + IMX_MEDIA_GRP_ID_IPU_CSI, true); if (IS_ERR(csi)) csi = NULL; diff --git a/drivers/staging/media/imx/imx-ic.h b/drivers/staging/media/imx/imx-ic.h index 1dcbb37aeada..ff2f66f11982 100644 --- a/drivers/staging/media/imx/imx-ic.h +++ b/drivers/staging/media/imx/imx-ic.h @@ -16,7 +16,6 @@ struct imx_ic_priv { struct device *ipu_dev; struct ipu_soc *ipu; - struct imx_media_dev *md; struct v4l2_subdev sd; inttask_id; void *task_priv; diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c index 68c2b1a3066a..555904759078 100644 --- a/drivers/staging/media/imx/imx-media-csi.c +++ b/drivers/staging/media/imx/imx-media-csi.c @@ -60,7 +60,6 @@ struct csi_skip_desc { struct csi_priv { struct device *dev; struct ipu_soc *ipu; - struct imx_media_dev *md; struct v4l2_subdev sd; struct media_pad pad[CSI_NUM_PADS]; /* the video device at IDMAC output pad */ @@ -182,8 +181,8 @@ static int csi_get_upstream_endpoint(struct csi_priv *priv, * CSI-2 receiver if it is in the path, otherwise stay * with video mux. */ - sd = imx_media_find_upstream_subdev(priv->md, src, - IMX_MEDIA_GRP_ID_CSI2); + sd = imx_media_pipeline_subdev(src, IMX_MEDIA_GRP_ID_CSI2, + true); if (!IS_ERR(sd)) src = &sd->entity; } @@ -197,7 +196,7 @@ static int csi_get_upstream_endpoint(struct csi_priv *priv, src = &priv->sd.entity; /* get source pad of entity directly upstream from src */ - pad = imx_media_find_upstream_pad(priv->md, src, 0); + pad = imx_media_pipel
[PATCH v5 6/9] media: staging/imx: Remove capture_device_set_format
Don't propagate the source pad format to the connected capture device. It's now the responsibility of userspace to call VIDIOC_S_FMT on the capture device to ensure the capture format and compose rectangle are compatible with the connected source. To check this, validate the capture format with the source before streaming starts. Signed-off-by: Steve Longerbeam --- Changes in v4: - add **cc arg to __capture_try_fmt_vid_cap() to validate colorspace, instead of calling ipu_pixelformat_to_colorspace(). - add error message if capture format validation failed. --- drivers/staging/media/imx/imx-ic-prpencvf.c | 16 + drivers/staging/media/imx/imx-media-capture.c | 71 +-- drivers/staging/media/imx/imx-media-csi.c | 16 + drivers/staging/media/imx/imx-media.h | 2 - drivers/staging/media/imx/imx7-media-csi.c| 17 + 5 files changed, 55 insertions(+), 67 deletions(-) diff --git a/drivers/staging/media/imx/imx-ic-prpencvf.c b/drivers/staging/media/imx/imx-ic-prpencvf.c index afaa3a8b15e9..63334fd61492 100644 --- a/drivers/staging/media/imx/imx-ic-prpencvf.c +++ b/drivers/staging/media/imx/imx-ic-prpencvf.c @@ -906,9 +906,7 @@ static int prp_set_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_format *sdformat) { struct prp_priv *priv = sd_to_priv(sd); - struct imx_media_video_dev *vdev = priv->vdev; const struct imx_media_pixfmt *cc; - struct v4l2_pix_format vdev_fmt; struct v4l2_mbus_framefmt *fmt; int ret = 0; @@ -945,19 +943,9 @@ static int prp_set_fmt(struct v4l2_subdev *sd, priv->cc[PRPENCVF_SRC_PAD] = outcc; } - if (sdformat->which == V4L2_SUBDEV_FORMAT_TRY) - goto out; - - priv->cc[sdformat->pad] = cc; + if (sdformat->which == V4L2_SUBDEV_FORMAT_ACTIVE) + priv->cc[sdformat->pad] = cc; - /* propagate output pad format to capture device */ - imx_media_mbus_fmt_to_pix_fmt(&vdev_fmt, - &priv->format_mbus[PRPENCVF_SRC_PAD], - priv->cc[PRPENCVF_SRC_PAD]); - mutex_unlock(&priv->lock); - imx_media_capture_device_set_format(vdev, &vdev_fmt); - - return 0; out: mutex_unlock(&priv->lock); return ret; diff --git a/drivers/staging/media/imx/imx-media-capture.c b/drivers/staging/media/imx/imx-media-capture.c index 555f6204660b..8a908c3e5e60 100644 --- a/drivers/staging/media/imx/imx-media-capture.c +++ b/drivers/staging/media/imx/imx-media-capture.c @@ -205,7 +205,9 @@ static int capture_g_fmt_vid_cap(struct file *file, void *fh, static int __capture_try_fmt_vid_cap(struct capture_priv *priv, struct v4l2_subdev_format *fmt_src, -struct v4l2_format *f) +struct v4l2_format *f, +const struct imx_media_pixfmt **retcc, +struct v4l2_rect *compose) { const struct imx_media_pixfmt *cc, *cc_src; @@ -247,6 +249,16 @@ static int __capture_try_fmt_vid_cap(struct capture_priv *priv, imx_media_mbus_fmt_to_pix_fmt(&f->fmt.pix, &fmt_src->format, cc); + if (retcc) + *retcc = cc; + + if (compose) { + compose->left = 0; + compose->top = 0; + compose->width = fmt_src->format.width; + compose->height = fmt_src->format.height; + } + return 0; } @@ -263,7 +275,7 @@ static int capture_try_fmt_vid_cap(struct file *file, void *fh, if (ret) return ret; - return __capture_try_fmt_vid_cap(priv, &fmt_src, f); + return __capture_try_fmt_vid_cap(priv, &fmt_src, f, NULL, NULL); } static int capture_s_fmt_vid_cap(struct file *file, void *fh, @@ -284,17 +296,12 @@ static int capture_s_fmt_vid_cap(struct file *file, void *fh, if (ret) return ret; - ret = __capture_try_fmt_vid_cap(priv, &fmt_src, f); + ret = __capture_try_fmt_vid_cap(priv, &fmt_src, f, &priv->vdev.cc, + &priv->vdev.compose); if (ret) return ret; priv->vdev.fmt.fmt.pix = f->fmt.pix; - priv->vdev.cc = imx_media_find_format(f->fmt.pix.pixelformat, - CS_SEL_ANY, true); - priv->vdev.compose.left = 0; - priv->vdev.compose.top = 0; - priv->vdev.compose.width = fmt_src.format.width; - priv->vdev.compose.height = fmt_src.format.height; return 0; } @@ -524,6 +531,33 @@ static void capture_buf_queue(struct vb2_buffer *vb) spin_unlock_irqrestore(&priv->q_lock, flags); } +static int capture_validate_fmt(struct capture_priv *priv) +{ + struct v4l2_subdev_format fmt_src; + const struct imx_media_pixfmt *cc; + struct v4l2_rect
[PATCH v5 7/9] media: staging/imx: Re-organize modules
Re-organize modules, and which objects are linked into those modules, so that: - imx6-media (renamed from imx-media) is the media driver module for imx5/6 only, and has no symbol exports. - imx6-media-csi (renamed from imx-media-csi) is the subdev driver module for imx5/6 CSI. It is now linked direcly with imx-media-fim, since only the imx5/6 CSI makes use of the frame interval monitor. - imx-media-common now only contains common code between imx5/6 and imx7 media drivers. It contains imx-media-utils, imx-media-of, imx-media-dev-common, and imx-media-capture. In order to acheive that, some functions common to imx5/6 and imx7 have been moved out of imx-media-dev.c and into imx-media-dev-common.c. Signed-off-by: Steve Longerbeam --- drivers/staging/media/imx/Makefile| 14 +- .../staging/media/imx/imx-media-dev-common.c | 345 +- drivers/staging/media/imx/imx-media-dev.c | 340 + drivers/staging/media/imx/imx-media-fim.c | 5 - drivers/staging/media/imx/imx-media-of.c | 3 + drivers/staging/media/imx/imx-media.h | 16 +- drivers/staging/media/imx/imx7-media-csi.c| 4 +- 7 files changed, 369 insertions(+), 358 deletions(-) diff --git a/drivers/staging/media/imx/Makefile b/drivers/staging/media/imx/Makefile index 86f0c81b6a3b..aa6c4b4ad37e 100644 --- a/drivers/staging/media/imx/Makefile +++ b/drivers/staging/media/imx/Makefile @@ -1,14 +1,16 @@ # SPDX-License-Identifier: GPL-2.0 -imx-media-objs := imx-media-dev.o imx-media-internal-sd.o imx-media-of.o \ +imx6-media-objs := imx-media-dev.o imx-media-internal-sd.o \ imx-ic-common.o imx-ic-prp.o imx-ic-prpencvf.o imx-media-vdic.o -imx-media-objs += imx-media-dev-common.o -imx-media-common-objs := imx-media-utils.o imx-media-fim.o -obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-media.o +imx-media-common-objs := imx-media-capture.o imx-media-dev-common.o \ + imx-media-of.o imx-media-utils.o + +imx6-media-csi-objs := imx-media-csi.o imx-media-fim.o + +obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx6-media.o obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-media-common.o -obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-media-capture.o -obj-$(CONFIG_VIDEO_IMX_CSI) += imx-media-csi.o +obj-$(CONFIG_VIDEO_IMX_CSI) += imx6-media-csi.o obj-$(CONFIG_VIDEO_IMX_CSI) += imx6-mipi-csi2.o obj-$(CONFIG_VIDEO_IMX7_CSI) += imx7-media-csi.o diff --git a/drivers/staging/media/imx/imx-media-dev-common.c b/drivers/staging/media/imx/imx-media-dev-common.c index 6cd93419b81d..89dc4ec8dadb 100644 --- a/drivers/staging/media/imx/imx-media-dev-common.c +++ b/drivers/staging/media/imx/imx-media-dev-common.c @@ -8,9 +8,342 @@ #include #include +#include +#include +#include +#include #include "imx-media.h" -static const struct v4l2_async_notifier_operations imx_media_subdev_ops = { +static inline struct imx_media_dev *notifier2dev(struct v4l2_async_notifier *n) +{ + return container_of(n, struct imx_media_dev, notifier); +} + +/* async subdev bound notifier */ +static int imx_media_subdev_bound(struct v4l2_async_notifier *notifier, + struct v4l2_subdev *sd, + struct v4l2_async_subdev *asd) +{ + v4l2_info(sd->v4l2_dev, "subdev %s bound\n", sd->name); + + return 0; +} + +/* + * Create the media links for all subdevs that registered. + * Called after all async subdevs have bound. + */ +static int imx_media_create_links(struct v4l2_async_notifier *notifier) +{ + struct imx_media_dev *imxmd = notifier2dev(notifier); + struct v4l2_subdev *sd; + + list_for_each_entry(sd, &imxmd->v4l2_dev.subdevs, list) { + switch (sd->grp_id) { + case IMX_MEDIA_GRP_ID_IPU_VDIC: + case IMX_MEDIA_GRP_ID_IPU_IC_PRP: + case IMX_MEDIA_GRP_ID_IPU_IC_PRPENC: + case IMX_MEDIA_GRP_ID_IPU_IC_PRPVF: + /* +* links have already been created for the +* sync-registered subdevs. +*/ + break; + case IMX_MEDIA_GRP_ID_IPU_CSI0: + case IMX_MEDIA_GRP_ID_IPU_CSI1: + case IMX_MEDIA_GRP_ID_CSI: + imx_media_create_csi_of_links(imxmd, sd); + break; + default: + /* +* if this subdev has fwnode links, create media +* links for them. +*/ + imx_media_create_of_links(imxmd, sd); + break; + } + } + + return 0; +} + +/* + * adds given video device to given imx-media source pad vdev list. + * Continues upstream from the pad entity's sink pads. + */ +static int imx_media_add_vdev_to_pad(struct imx_media_dev *imxmd, +struct imx_media_video_dev *vdev, +
[PATCH v5 5/9] Revert "media: imx: Set capture compose rectangle in capture_device_set_format"
Rvert this commit, as imx_media_capture_device_set_format() will be removed. The arguments to mx_media_mbus_fmt_to_pix_fmt() and imx_media_capture_device_set_format() in imx7_csi_set_fmt() are also reverted. This reverts commit 5964cbd8692252615370b77eb96764dd70c2f837. Signed-off-by: Steve Longerbeam --- Chnges in v3: - revert to previous args in imx7_csi_set_fmt(). --- drivers/staging/media/imx/imx-ic-prpencvf.c | 5 ++-- drivers/staging/media/imx/imx-media-capture.c | 24 +-- drivers/staging/media/imx/imx-media-csi.c | 5 ++-- drivers/staging/media/imx/imx-media-utils.c | 20 drivers/staging/media/imx/imx-media.h | 6 ++--- drivers/staging/media/imx/imx7-media-csi.c| 5 ++-- 6 files changed, 25 insertions(+), 40 deletions(-) diff --git a/drivers/staging/media/imx/imx-ic-prpencvf.c b/drivers/staging/media/imx/imx-ic-prpencvf.c index 8242d88dfb82..afaa3a8b15e9 100644 --- a/drivers/staging/media/imx/imx-ic-prpencvf.c +++ b/drivers/staging/media/imx/imx-ic-prpencvf.c @@ -910,7 +910,6 @@ static int prp_set_fmt(struct v4l2_subdev *sd, const struct imx_media_pixfmt *cc; struct v4l2_pix_format vdev_fmt; struct v4l2_mbus_framefmt *fmt; - struct v4l2_rect vdev_compose; int ret = 0; if (sdformat->pad >= PRPENCVF_NUM_PADS) @@ -952,11 +951,11 @@ static int prp_set_fmt(struct v4l2_subdev *sd, priv->cc[sdformat->pad] = cc; /* propagate output pad format to capture device */ - imx_media_mbus_fmt_to_pix_fmt(&vdev_fmt, &vdev_compose, + imx_media_mbus_fmt_to_pix_fmt(&vdev_fmt, &priv->format_mbus[PRPENCVF_SRC_PAD], priv->cc[PRPENCVF_SRC_PAD]); mutex_unlock(&priv->lock); - imx_media_capture_device_set_format(vdev, &vdev_fmt, &vdev_compose); + imx_media_capture_device_set_format(vdev, &vdev_fmt); return 0; out: diff --git a/drivers/staging/media/imx/imx-media-capture.c b/drivers/staging/media/imx/imx-media-capture.c index 335084a6b0cd..555f6204660b 100644 --- a/drivers/staging/media/imx/imx-media-capture.c +++ b/drivers/staging/media/imx/imx-media-capture.c @@ -205,8 +205,7 @@ static int capture_g_fmt_vid_cap(struct file *file, void *fh, static int __capture_try_fmt_vid_cap(struct capture_priv *priv, struct v4l2_subdev_format *fmt_src, -struct v4l2_format *f, -struct v4l2_rect *compose) +struct v4l2_format *f) { const struct imx_media_pixfmt *cc, *cc_src; @@ -246,8 +245,7 @@ static int __capture_try_fmt_vid_cap(struct capture_priv *priv, } } - imx_media_mbus_fmt_to_pix_fmt(&f->fmt.pix, compose, - &fmt_src->format, cc); + imx_media_mbus_fmt_to_pix_fmt(&f->fmt.pix, &fmt_src->format, cc); return 0; } @@ -265,7 +263,7 @@ static int capture_try_fmt_vid_cap(struct file *file, void *fh, if (ret) return ret; - return __capture_try_fmt_vid_cap(priv, &fmt_src, f, NULL); + return __capture_try_fmt_vid_cap(priv, &fmt_src, f); } static int capture_s_fmt_vid_cap(struct file *file, void *fh, @@ -273,7 +271,6 @@ static int capture_s_fmt_vid_cap(struct file *file, void *fh, { struct capture_priv *priv = video_drvdata(file); struct v4l2_subdev_format fmt_src; - struct v4l2_rect compose; int ret; if (vb2_is_busy(&priv->q)) { @@ -287,14 +284,17 @@ static int capture_s_fmt_vid_cap(struct file *file, void *fh, if (ret) return ret; - ret = __capture_try_fmt_vid_cap(priv, &fmt_src, f, &compose); + ret = __capture_try_fmt_vid_cap(priv, &fmt_src, f); if (ret) return ret; priv->vdev.fmt.fmt.pix = f->fmt.pix; priv->vdev.cc = imx_media_find_format(f->fmt.pix.pixelformat, CS_SEL_ANY, true); - priv->vdev.compose = compose; + priv->vdev.compose.left = 0; + priv->vdev.compose.top = 0; + priv->vdev.compose.width = fmt_src.format.width; + priv->vdev.compose.height = fmt_src.format.height; return 0; } @@ -655,8 +655,7 @@ static struct video_device capture_videodev = { }; void imx_media_capture_device_set_format(struct imx_media_video_dev *vdev, -const struct v4l2_pix_format *pix, -const struct v4l2_rect *compose) +struct v4l2_pix_format *pix) { struct capture_priv *priv = to_capture_priv(vdev); @@ -664,7 +663,6 @@ void imx_media_capture_device_set_format(struct imx_media_video_dev *vdev, priv->vdev.fmt.fmt.pix = *pix; priv->vdev.cc = imx_media_find_format(pix->pixelformat, CS_SE
[PATCH v5 3/9] media: staging/imx: Pass device to alloc/free_dma_buf
Allocate and free a DMA coherent buffer in imx_media_alloc/free_dma_buf() from the given device. This allows DMA alloc and free using a device that is backed by real hardware, which for the imx5/6/7 CSI is the CSI unit, and for the internal IPU sub-devices, is the parent IPU. Signed-off-by: Steve Longerbeam --- drivers/staging/media/imx/imx-ic-prpencvf.c | 18 +- drivers/staging/media/imx/imx-media-csi.c | 6 +++--- drivers/staging/media/imx/imx-media-utils.c | 13 ++--- drivers/staging/media/imx/imx-media.h | 4 ++-- drivers/staging/media/imx/imx7-media-csi.c | 4 ++-- 5 files changed, 22 insertions(+), 23 deletions(-) diff --git a/drivers/staging/media/imx/imx-ic-prpencvf.c b/drivers/staging/media/imx/imx-ic-prpencvf.c index 069cce512280..ddcd87a17c71 100644 --- a/drivers/staging/media/imx/imx-ic-prpencvf.c +++ b/drivers/staging/media/imx/imx-ic-prpencvf.c @@ -464,13 +464,13 @@ static int prp_setup_rotation(struct prp_priv *priv) incc = priv->cc[PRPENCVF_SINK_PAD]; outcc = vdev->cc; - ret = imx_media_alloc_dma_buf(ic_priv->md, &priv->rot_buf[0], + ret = imx_media_alloc_dma_buf(ic_priv->ipu_dev, &priv->rot_buf[0], outfmt->sizeimage); if (ret) { v4l2_err(&ic_priv->sd, "failed to alloc rot_buf[0], %d\n", ret); return ret; } - ret = imx_media_alloc_dma_buf(ic_priv->md, &priv->rot_buf[1], + ret = imx_media_alloc_dma_buf(ic_priv->ipu_dev, &priv->rot_buf[1], outfmt->sizeimage); if (ret) { v4l2_err(&ic_priv->sd, "failed to alloc rot_buf[1], %d\n", ret); @@ -543,9 +543,9 @@ static int prp_setup_rotation(struct prp_priv *priv) unsetup_vb2: prp_unsetup_vb2_buf(priv, VB2_BUF_STATE_QUEUED); free_rot1: - imx_media_free_dma_buf(ic_priv->md, &priv->rot_buf[1]); + imx_media_free_dma_buf(ic_priv->ipu_dev, &priv->rot_buf[1]); free_rot0: - imx_media_free_dma_buf(ic_priv->md, &priv->rot_buf[0]); + imx_media_free_dma_buf(ic_priv->ipu_dev, &priv->rot_buf[0]); return ret; } @@ -563,8 +563,8 @@ static void prp_unsetup_rotation(struct prp_priv *priv) ipu_ic_disable(priv->ic); - imx_media_free_dma_buf(ic_priv->md, &priv->rot_buf[0]); - imx_media_free_dma_buf(ic_priv->md, &priv->rot_buf[1]); + imx_media_free_dma_buf(ic_priv->ipu_dev, &priv->rot_buf[0]); + imx_media_free_dma_buf(ic_priv->ipu_dev, &priv->rot_buf[1]); } static int prp_setup_norotation(struct prp_priv *priv) @@ -656,7 +656,7 @@ static int prp_start(struct prp_priv *priv) outfmt = &vdev->fmt.fmt.pix; - ret = imx_media_alloc_dma_buf(ic_priv->md, &priv->underrun_buf, + ret = imx_media_alloc_dma_buf(ic_priv->ipu_dev, &priv->underrun_buf, outfmt->sizeimage); if (ret) goto out_put_ipu; @@ -726,7 +726,7 @@ static int prp_start(struct prp_priv *priv) out_unsetup: prp_unsetup(priv, VB2_BUF_STATE_QUEUED); out_free_underrun: - imx_media_free_dma_buf(ic_priv->md, &priv->underrun_buf); + imx_media_free_dma_buf(ic_priv->ipu_dev, &priv->underrun_buf); out_put_ipu: prp_put_ipu_resources(priv); return ret; @@ -763,7 +763,7 @@ static void prp_stop(struct prp_priv *priv) prp_unsetup(priv, VB2_BUF_STATE_ERROR); - imx_media_free_dma_buf(ic_priv->md, &priv->underrun_buf); + imx_media_free_dma_buf(ic_priv->ipu_dev, &priv->underrun_buf); /* cancel the EOF timeout timer */ del_timer_sync(&priv->eof_timeout_timer); diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c index 93b107eab5f5..ea3d13103c91 100644 --- a/drivers/staging/media/imx/imx-media-csi.c +++ b/drivers/staging/media/imx/imx-media-csi.c @@ -612,7 +612,7 @@ static int csi_idmac_start(struct csi_priv *priv) outfmt = &vdev->fmt.fmt.pix; - ret = imx_media_alloc_dma_buf(priv->md, &priv->underrun_buf, + ret = imx_media_alloc_dma_buf(priv->dev, &priv->underrun_buf, outfmt->sizeimage); if (ret) goto out_put_ipu; @@ -666,7 +666,7 @@ static int csi_idmac_start(struct csi_priv *priv) out_unsetup: csi_idmac_unsetup(priv, VB2_BUF_STATE_QUEUED); out_free_dma_buf: - imx_media_free_dma_buf(priv->md, &priv->underrun_buf); + imx_media_free_dma_buf(priv->dev, &priv->underrun_buf); out_put_ipu: csi_idmac_put_ipu_resources(priv); return ret; @@ -698,7 +698,7 @@ static void csi_idmac_stop(struct csi_priv *priv) csi_idmac_unsetup(priv, VB2_BUF_STATE_ERROR); - imx_media_free_dma_buf(priv->md, &priv->underrun_buf); + imx_media_free_dma_buf(priv->dev, &priv->underrun_buf); /* cancel the EOF timeout timer */ del_timer_sync(&priv->eof_timeout_timer); diff --git a/drivers/st
Re: [PATCH] Staging: kpc2000: kpc_dma: resolve checkpath errors and warnings
On Sat, May 11, 2019 at 01:08:33AM +0530, Vandana BN wrote: > This patch resolves coding style errors and warnings reported by chechpatch > > ERROR: "(foo*)" should be "(foo *)" > ERROR: trailing whitespace > ERROR: space required before the open brace '{' > ERROR: "foo * bar" should be "foo *bar" > ERROR: space prohibited after that '!' (ctx:BxW) > ERROR: space prohibited after that open parenthesis '(' > ERROR: switch and case should be at the same indent > ERROR: trailing statements should be on next line > ERROR: Macros with complex values should be enclosed in parentheses > ERROR: "foo __init bar" should be "foo __init bar" > ERROR: "foo __exit bar" should be "foo __exit bar" > WARNING: Missing a blank line after declarations > WARNING: Prefer using '"%s...", __func__' to using function's name, in a > string > WARNING: braces {} are not necessary for any arm of this statement > WARNING: unnecessary cast may hide bugs > WARNING: braces {} are not necessary for single statement > WARNING: struct file_operations should normally be const > WARNING: labels should not be indented > Signed-off-by: Vandana BN > --- > drivers/staging/kpc2000/kpc_dma/dma.c | 137 +-- > drivers/staging/kpc2000/kpc_dma/fileops.c | 220 +- > .../staging/kpc2000/kpc_dma/kpc_dma_driver.c | 121 +- > .../staging/kpc2000/kpc_dma/kpc_dma_driver.h | 32 +-- > 4 files changed, 265 insertions(+), 245 deletions(-) > Hi, This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree. You are receiving this message because of the following common error(s) as indicated below: - Your patch did many different things all at once, making it difficult to review. All Linux kernel patches need to only do one thing at a time. If you need to do multiple things (such as clean up all coding style issues in a file/driver), do it in a sequence of patches, each one doing only one thing. This will make it easier to review the patches to ensure that they are correct, and to help alleviate any merge issues that larger patches can cause. If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers. thanks, greg k-h's patch email bot ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel