Re: [PATCH net] hv_netvsc: Restore needed_headroom request
From: Vitaly Kuznetsov Date: Fri, 5 Feb 2016 17:29:08 +0100 > Commit c0eb454034aa ("hv_netvsc: Don't ask for additional head room in the > skb") got rid of needed_headroom setting for the driver. With the change I > hit the following issue trying to use ptkgen module: > > [ 57.522021] kernel BUG at net/core/skbuff.c:1128! > [ 57.522021] invalid opcode: [#1] SMP DEBUG_PAGEALLOC > ... > [ 58.721068] Call Trace: > [ 58.721068] [] netvsc_start_xmit+0x4c6/0x8e0 [hv_netvsc] > ... > [ 58.721068] [] ? pktgen_finalize_skb+0x25c/0x2a0 > [pktgen] > [ 58.721068] [] ? __netdev_alloc_skb+0xc0/0x100 > [ 58.721068] [] pktgen_thread_worker+0x257/0x1920 > [pktgen] > > Basically, we're calling skb_cow_head(skb, RNDIS_AND_PPI_SIZE) and crash on > if (skb_shared(skb)) > BUG(); > > We probably need to restore needed_headroom setting (but shrunk to > RNDIS_AND_PPI_SIZE as we don't need more) to request the required headroom > space. In theory, it should not give us performance penalty. > > Signed-off-by: Vitaly Kuznetsov Applied, thanks. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] iio: adc: Move mxs-lradc out of staging
On 06/02/16 22:23, Ksenija Stanojevic wrote: > Move mxs-lradc driver from drivers/staging/iio/adc to drivers/iio/adc. > > Signed-off-by: Ksenija Stanojevic That's odd. I was sure I sent a reply to this the other day to say I'd applied it (with IIRC one trivial whitespace change) but I can't find any record of that email locally or in the archives online. My battery ran out so perhaps it didn't quite send before that. Anyhow, applied to the togreg branch of iio.git - pushed out as testing for the autobuilders to play with it. Thanks, Jonathan > --- > drivers/iio/adc/Kconfig | 14 + > drivers/iio/adc/Makefile|1 + > drivers/iio/adc/mxs-lradc.c | 1770 > +++ > drivers/staging/iio/adc/Kconfig | 14 - > drivers/staging/iio/adc/Makefile|1 - > drivers/staging/iio/adc/mxs-lradc.c | 1770 > --- > 6 files changed, 1785 insertions(+), 1785 deletions(-) > create mode 100644 drivers/iio/adc/mxs-lradc.c > delete mode 100644 drivers/staging/iio/adc/mxs-lradc.c > > diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig > index 60673b4..4900b0a 100644 > --- a/drivers/iio/adc/Kconfig > +++ b/drivers/iio/adc/Kconfig > @@ -295,6 +295,20 @@ config MEN_Z188_ADC > This driver can also be built as a module. If so, the module will be > called men_z188_adc. > > +config MXS_LRADC > +tristate "Freescale i.MX23/i.MX28 LRADC" > +depends on (ARCH_MXS || COMPILE_TEST) && HAS_IOMEM > +depends on INPUT > +select STMP_DEVICE > +select IIO_BUFFER > +select IIO_TRIGGERED_BUFFER > +help > + Say yes here to build support for i.MX23/i.MX28 LRADC convertor > + built into these chips. > + > + To compile this driver as a module, choose M here: the > + module will be called mxs-lradc. > + > config NAU7802 > tristate "Nuvoton NAU7802 ADC driver" > depends on I2C > diff --git a/drivers/iio/adc/Makefile b/drivers/iio/adc/Makefile > index fb57e12..3b14f30 100644 > --- a/drivers/iio/adc/Makefile > +++ b/drivers/iio/adc/Makefile > @@ -29,6 +29,7 @@ obj-$(CONFIG_MAX1363) += max1363.o > obj-$(CONFIG_MCP320X) += mcp320x.o > obj-$(CONFIG_MCP3422) += mcp3422.o > obj-$(CONFIG_MEN_Z188_ADC) += men_z188_adc.o > +obj-$(CONFIG_MXS_LRADC) += mxs-lradc.o > obj-$(CONFIG_NAU7802) += nau7802.o > obj-$(CONFIG_PALMAS_GPADC) += palmas_gpadc.o > obj-$(CONFIG_QCOM_SPMI_IADC) += qcom-spmi-iadc.o > diff --git a/drivers/iio/adc/mxs-lradc.c b/drivers/iio/adc/mxs-lradc.c > new file mode 100644 > index 000..bb1f152 > --- /dev/null > +++ b/drivers/iio/adc/mxs-lradc.c > @@ -0,0 +1,1770 @@ > +/* > + * Freescale MXS LRADC driver > + * > + * Copyright (c) 2012 DENX Software Engineering, GmbH. > + * Marek Vasut > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License as published by > + * the Free Software Foundation; either version 2 of the License, or > + * (at your option) any later version. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > +#include > +#include > + > +#define DRIVER_NAME "mxs-lradc" > + > +#define LRADC_MAX_DELAY_CHANS4 > +#define LRADC_MAX_MAPPED_CHANS 8 > +#define LRADC_MAX_TOTAL_CHANS16 > + > +#define LRADC_DELAY_TIMER_HZ 2000 > + > +/* > + * Make this runtime configurable if necessary. Currently, if the buffered > mode > + * is enabled, the LRADC takes LRADC_DELAY_TIMER_LOOP samples of data before > + * triggering IRQ. The sampling happens every (LRADC_DELAY_TIMER_PER / 2000) > + * seconds. The result is that the samples arrive every 500mS. > + */ > +#define LRADC_DELAY_TIMER_PER200 > +#define LRADC_DELAY_TIMER_LOOP 5 > + > +/* > + * Once the pen touches the touchscreen, the touchscreen switches from > + * IRQ-driven mode to polling mode to prevent interrupt storm. The polling > + * is realized by worker thread, which is called every 20 or so milliseconds. > + * This gives the touchscreen enough fluency and does not strain the system > + * too much. > + */ > +#define LRADC_TS_SAMPLE_DELAY_MS 5 > + > +/* > + * The LRADC reads the following amount of samples from each touchscreen > + * channel and the driver then computes average of these. > + */ > +#define LRADC_TS_SAMPLE_AMOUNT 4 > + > +enum mxs_lradc_id { > + IMX23_LRADC, > + IMX28_LRADC, > +}; > +
[PATCH] staging: lustre/lnet: Fix wrong type casting warning generated by sparse
Fixed the following warning reported by sparse about typecasting. A userspace pointer was being typecasted by simply (char *) which causes sparse to give the following warning - warning: cast removes address space of expression Fixed it by adding __user annotation to the typecasting. Signed-off-by: Niranjan Dighe --- drivers/staging/lustre/lnet/selftest/console.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lnet/selftest/console.c b/drivers/staging/lustre/lnet/selftest/console.c index 366211e..64b6a70 100644 --- a/drivers/staging/lustre/lnet/selftest/console.c +++ b/drivers/staging/lustre/lnet/selftest/console.c @@ -1461,9 +1461,9 @@ lstcon_statrpc_readent(int transop, srpc_msg_t *msg, sfwk_stat = (sfw_counters_t __user *)&ent_up->rpe_payload[0]; srpc_stat = (srpc_counters_t __user *) - ((char *)sfwk_stat + sizeof(*sfwk_stat)); + ((char __user *)sfwk_stat + sizeof(*sfwk_stat)); lnet_stat = (lnet_counters_t __user *) - ((char *)srpc_stat + sizeof(*srpc_stat)); + ((char __user *)srpc_stat + sizeof(*srpc_stat)); if (copy_to_user(sfwk_stat, &rep->str_fw, sizeof(*sfwk_stat)) || copy_to_user(srpc_stat, &rep->str_rpc, sizeof(*srpc_stat)) || -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] rtl8188eu: fix signal strength indication
On 02/11/2016 07:38 PM, Andrew Bradford wrote: RTL8188E can only have a maximum of 2 chains so match that in the actual phy_rx_agc_info structure within phy_status_rpt. This will cause the other data received from the PHY, such as signal strength indication of beacons, to properly align and allow extraction and use within the signal strength record-keeping mechanisms. Signed-off-by: Andrew Bradford Good catch. I only have two comments/suggestions. The first is minor - when sending patches for drivers in staging, it is customary to use "staging:" as the beginning of the subject. Accordingly, yours should be "staging: rtl8188eu: fix...". My second point is that with RF_PATH_MAX reduced to 2, there are parts of the code that are flagged with array overrun errors by Smatch. None of these statements will ever be executed, thus there are no run-time errors. I could fix these, but as such a patch would conflict with this one, I suggest you add a second patch. The file with needed changes is drivers/staging/rtl8188eu/hal/phy.c in the code that starts at line 183. The else if tests for TxCount == RF_PATH_C and TxCount == RF_PATH_D should be removed in their entirety. There are other changes that should be made, but as they do not conflict, I will do that myself. Thanks, Larry --- drivers/staging/rtl8188eu/include/Hal8188EPhyCfg.h | 2 +- drivers/staging/rtl8188eu/include/odm_HWConfig.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8188eu/include/Hal8188EPhyCfg.h b/drivers/staging/rtl8188eu/include/Hal8188EPhyCfg.h index e058162..b8833fa 100644 --- a/drivers/staging/rtl8188eu/include/Hal8188EPhyCfg.h +++ b/drivers/staging/rtl8188eu/include/Hal8188EPhyCfg.h @@ -75,7 +75,7 @@ enum rf_radio_path { #define MAX_PG_GROUP 13 -#defineRF_PATH_MAX 3 +#defineRF_PATH_MAX 2 #define MAX_RF_PATH RF_PATH_MAX #define MAX_TX_COUNT4 /* path numbers */ diff --git a/drivers/staging/rtl8188eu/include/odm_HWConfig.h b/drivers/staging/rtl8188eu/include/odm_HWConfig.h index 62a0049..ef792bf 100644 --- a/drivers/staging/rtl8188eu/include/odm_HWConfig.h +++ b/drivers/staging/rtl8188eu/include/odm_HWConfig.h @@ -69,7 +69,7 @@ struct phy_rx_agc_info { }; struct phy_status_rpt { - struct phy_rx_agc_info path_agc[3]; + struct phy_rx_agc_info path_agc[RF_PATH_MAX]; u8 ch_corr[2]; u8 cck_sig_qual_ofdm_pwdb_all; u8 cck_agc_rpt_ofdm_cfosho_a; ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: lustre/lnet: Fix wrong type casting warning generated by sparse
On Sat, Feb 13, 2016 at 11:34:35PM +0530, Niranjan Dighe wrote: > diff --git a/drivers/staging/lustre/lnet/selftest/console.c > b/drivers/staging/lustre/lnet/selftest/console.c > index 366211e..64b6a70 100644 > --- a/drivers/staging/lustre/lnet/selftest/console.c > +++ b/drivers/staging/lustre/lnet/selftest/console.c > @@ -1461,9 +1461,9 @@ lstcon_statrpc_readent(int transop, srpc_msg_t *msg, > > sfwk_stat = (sfw_counters_t __user *)&ent_up->rpe_payload[0]; > srpc_stat = (srpc_counters_t __user *) > - ((char *)sfwk_stat + sizeof(*sfwk_stat)); > + ((char __user *)sfwk_stat + sizeof(*sfwk_stat)); This is uglier than necessary. Do it either like this: srpc_stat = (void __user *)sfwk_stat + sizeof(*sfwk_stat); Or probably it's actually nicer to say: srpc_stat = sfwk_stat + 1; regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: Time for a code audit?
On Fri, Feb 12, 2016 at 02:01:06PM -0500, Ben Romer wrote: > Greg, > > Thank you very much for taking our patches. All of us here appreciate > it a lot. :) > > It looks to me like our driver set is clean as far as > checkpatch.pl is concerned - there's one error, which was said to be > acceptable as it was, and a small number of checks that can't be > made any prettier. > > I was hoping we could get started with the code audit and work on > getting the drivers out of the staging tree. What's the best way to > do that? For some reason I thought the "raw kobject" usage was going to be converted to use 'struct device' so that you can then take advantage of userspace tools to read/write the sysfs attributes properly (i.e. libudev). As long as they are kobjects, userspace is "blind" to them. I know I've brought this up before, but I keep forgetting why the code is this way. If it can only be done with kobjects, then we need some huge comments in the code as to why this is so. Also, mostcore.h has a function that returns a kobject, that seems "odd" to me, shouldn't it be returning a object type of your bus/subsystem instead? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] drivers/staging/android: don't use modular references in sync_debug.c
In commit 8a0044846115e74552b671a7073cffeec14b9316 ("staging/android: create a 'sync' dir for debugfs information"), modular references were introduced to this file. However if we look, we find: drivers/staging/android/Makefile:obj-$(CONFIG_SYNC) += sync.o sync_debug.o drivers/staging/android/Kconfig:config SYNC drivers/staging/android/Kconfig:bool "Synchronization framework" This file isn't currently buildable as a module, and hence the code for module_exit is just dead code. Remove it and the module.h include. Cc: Gustavo Padovan Cc: Maarten Lankhorst Cc: Greg Kroah-Hartman Signed-off-by: Paul Gortmaker --- drivers/staging/android/sync_debug.c | 8 1 file changed, 8 deletions(-) diff --git a/drivers/staging/android/sync_debug.c b/drivers/staging/android/sync_debug.c index fd13f1e885e5..5a7ec58fbc09 100644 --- a/drivers/staging/android/sync_debug.c +++ b/drivers/staging/android/sync_debug.c @@ -15,7 +15,6 @@ */ #include -#include #include #include #include @@ -335,13 +334,6 @@ static __init int sync_debugfs_init(void) } late_initcall(sync_debugfs_init); -static __exit void sync_debugfs_exit(void) -{ - if (dbgfs) - debugfs_remove_recursive(dbgfs); -} -module_exit(sync_debugfs_exit); - #define DUMP_CHUNK 256 static char sync_dump_buf[64 * 1024]; void sync_dump(void) -- 2.6.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: octeon: support fixed-link phys
Support fixed-link PHYs. This allows to remove some of the board-specific link cvmx_helper code in the future. Signed-off-by: Aaro Koskinen --- drivers/staging/octeon/ethernet-mdio.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/staging/octeon/ethernet-mdio.c b/drivers/staging/octeon/ethernet-mdio.c index 55abd83..0ac11b1 100644 --- a/drivers/staging/octeon/ethernet-mdio.c +++ b/drivers/staging/octeon/ethernet-mdio.c @@ -181,6 +181,15 @@ int cvm_oct_phy_setup_device(struct net_device *dev) goto no_phy; phy_node = of_parse_phandle(priv->of_node, "phy-handle", 0); + if (!phy_node && of_phy_is_fixed_link(priv->of_node)) { + int rc; + + rc = of_phy_register_fixed_link(priv->of_node); + if (rc) + return rc; + + phy_node = of_node_get(priv->of_node); + } if (!phy_node) goto no_phy; -- 2.4.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: octeon-usb: support official bindings
Support official DT bindings alongside with the deprecated ones. Signed-off-by: Aaro Koskinen --- drivers/staging/octeon-usb/octeon-hcd.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/staging/octeon-usb/octeon-hcd.c b/drivers/staging/octeon-usb/octeon-hcd.c index 7844e20..eaf6ded 100644 --- a/drivers/staging/octeon-usb/octeon-hcd.c +++ b/drivers/staging/octeon-usb/octeon-hcd.c @@ -3594,9 +3594,12 @@ static int octeon_usb_probe(struct platform_device *pdev) usbn_node = dev->of_node->parent; i = of_property_read_u32(usbn_node, -"refclk-frequency", &clock_rate); +"clock-frequency", &clock_rate); + if (i) + i = of_property_read_u32(usbn_node, +"refclk-frequency", &clock_rate); if (i) { - dev_err(dev, "No USBN \"refclk-frequency\"\n"); + dev_err(dev, "No USBN \"clock-frequency\"\n"); return -ENXIO; } switch (clock_rate) { @@ -3610,14 +3613,17 @@ static int octeon_usb_probe(struct platform_device *pdev) initialize_flags = CVMX_USB_INITIALIZE_FLAGS_CLOCK_48MHZ; break; default: - dev_err(dev, "Illebal USBN \"refclk-frequency\" %u\n", + dev_err(dev, "Illegal USBN \"clock-frequency\" %u\n", clock_rate); return -ENXIO; } i = of_property_read_string(usbn_node, - "refclk-type", &clock_type); + "cavium,refclk-type", &clock_type); + if (i) + i = of_property_read_string(usbn_node, + "refclk-type", &clock_type); if (!i && strcmp("crystal", clock_type) == 0) is_crystal_clock = true; -- 2.4.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: lustre/lnet: Fix wrong type casting warning generated by sparse
On Sun, Feb 14, 2016 at 3:19 AM, Dan Carpenter wrote: > On Sat, Feb 13, 2016 at 11:34:35PM +0530, Niranjan Dighe wrote: >> diff --git a/drivers/staging/lustre/lnet/selftest/console.c >> b/drivers/staging/lustre/lnet/selftest/console.c >> index 366211e..64b6a70 100644 >> --- a/drivers/staging/lustre/lnet/selftest/console.c >> +++ b/drivers/staging/lustre/lnet/selftest/console.c >> @@ -1461,9 +1461,9 @@ lstcon_statrpc_readent(int transop, srpc_msg_t *msg, >> >> sfwk_stat = (sfw_counters_t __user *)&ent_up->rpe_payload[0]; >> srpc_stat = (srpc_counters_t __user *) >> - ((char *)sfwk_stat + sizeof(*sfwk_stat)); >> + ((char __user *)sfwk_stat + >> sizeof(*sfwk_stat)); > > This is uglier than necessary. Do it either like this: > > srpc_stat = (void __user *)sfwk_stat + sizeof(*sfwk_stat); > > Or probably it's actually nicer to say: > > srpc_stat = sfwk_stat + 1; > > regards, > dan carpenter > Yes, thanks Dan, I will send out a new patch. Please discard this one. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: lustre/lnet: Fix wrong typecasting warning generated by sparse
Fix the following warning generated about type casting by sparse warning: cast removes address space of expression The current implementation casts the structure pointers with (char *) without __user annotation and then adds sizeof struct to it, thereby generating the sparse warning. Fixed this by removing the unnecessary char pointer type cast. Signed-off-by: Niranjan Dighe --- drivers/staging/lustre/lnet/selftest/console.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/lustre/lnet/selftest/console.c b/drivers/staging/lustre/lnet/selftest/console.c index 366211e..bc236c9 100644 --- a/drivers/staging/lustre/lnet/selftest/console.c +++ b/drivers/staging/lustre/lnet/selftest/console.c @@ -1460,10 +1460,8 @@ lstcon_statrpc_readent(int transop, srpc_msg_t *msg, return 0; sfwk_stat = (sfw_counters_t __user *)&ent_up->rpe_payload[0]; - srpc_stat = (srpc_counters_t __user *) - ((char *)sfwk_stat + sizeof(*sfwk_stat)); - lnet_stat = (lnet_counters_t __user *) - ((char *)srpc_stat + sizeof(*srpc_stat)); + srpc_stat = (srpc_counters_t __user *)(sfwk_stat + 1); + lnet_stat = (lnet_counters_t __user *)(srpc_stat + 1); if (copy_to_user(sfwk_stat, &rep->str_fw, sizeof(*sfwk_stat)) || copy_to_user(srpc_stat, &rep->str_rpc, sizeof(*srpc_stat)) || -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH V6 0/8] introduce Hyper-V VM Socket(hv_sock)
> From: devel [mailto:driverdev-devel-boun...@linuxdriverproject.org] On Behalf > Of Dexuan Cui > Sent: Tuesday, January 26, 2016 17:40 > ... > Dexuan Cui (8): > Drivers: hv: vmbus: add a helper function to set a channel's pending > send size > Drivers: hv: vmbus: define the new offer type for Hyper-V socket > (hvsock) > Drivers: hv: vmbus: vmbus_sendpacket_ctl: hvsock: avoid unnecessary > signaling > Drivers: hv: vmbus: define a new VMBus message type for hvsock > Drivers: hv: vmbus: add a hvsock flag in struct hv_driver > Drivers: hv: vmbus: add a per-channel rescind callback > Drivers: hv: vmbus: add an API vmbus_hvsock_device_unregister() > hvsock: introduce Hyper-V Socket feature Hi David, Greg has accepted all my VMBus driver side's patches. I'm going to post the net/hv_sock/ patch now. I know I should rebase my patch to the net-next tree, but net-next hasn't contained my VMBus driver side's patches, which are a prerequisite of my net/hv_sock/ patch. It looks I have to wait before you merge net-next with Greg's tree, or with the mainline (after Greg pushes the changes to the mainline)? If so, may I know when the next merge will be happening (so I don't need to check net-next every day :-) ) ? Thanks, -- Dexuan ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel