Re: [patch 5/5] PTP: add kvm PTP driver
On 20/01/2017 19:08, Radim Krcmar wrote: > 2017-01-20 13:00-0200, Marcelo Tosatti: >> On Fri, Jan 20, 2017 at 03:12:56PM +0100, Radim Krcmar wrote: >>> 2017-01-20 10:20-0200, Marcelo Tosatti: + do { + /* + * We are measuring the delay between + * kvm_hypercall and rdtsc using TSC, + * and converting that delta to + * tsc_to_system_mul and tsc_shift + * So any changes to tsc_to_system_mul + * and tsc_shift in this region + * invalidate the measurement. + */ + version = pvclock_read_begin(src); + + ret = kvm_hypercall2(KVM_HC_CLOCK_PAIRING, + clock_off_gpa, + KVM_CLOCK_PAIRING_WALLCLOCK); + if (ret != 0) { + pr_err("clock offset hypercall ret %lu\n", ret); + spin_unlock(&kvm_ptp_lock); + preempt_enable_notrace(); + return -EOPNOTSUPP; + } + + tspec.tv_sec = clock_off.sec; + tspec.tv_nsec = clock_off.nsec; + ret = __pvclock_read_cycles(src, clock_off.tsc); + flags = src->flags; + } while (pvclock_read_retry(src, version)); + + preempt_enable_notrace(); + + system_counter->cycles = ret; + system_counter->cs = get_kvmclock_cs(); >>> >>> Can't we use clocksource_tsc and just pass the tsc without kvmclock in >>> the middle? >> >> No, it has to be the kvmclock value. > > What happens if the guest switches from kvmclock to tsc? get_device_system_crosststamp handles it, that's why there is a clocksource field in system_counter. Paolo > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >
Re: [PATCH 4/4] xfrm_user: Add new 32/64-agnostic netlink messages
Hi Kevin, [auto build test ERROR on ipsec-next/master] [also build test ERROR on v4.10-rc4 next-20170120] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Kevin-Cernekee/Make-xfrm-usable-by-32-bit-programs/20170121-150712 base: https://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next.git master config: ia64-allmodconfig (attached as .config) compiler: ia64-linux-gcc (GCC) 6.2.0 reproduce: wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree make.cross ARCH=ia64 All errors (new ones prefixed by >>): >> net/xfrm/xfrm_user_legacy.c:845:5: error: redefinition of >> 'xfrm_exp_state_notify_legacy' int xfrm_exp_state_notify_legacy(const struct xfrm_state *x, ^~~~ In file included from net/xfrm/xfrm_user_legacy.c:30:0: net/xfrm/xfrm_user.h:131:19: note: previous definition of 'xfrm_exp_state_notify_legacy' was here static inline int xfrm_exp_state_notify_legacy(const struct xfrm_state *x, ^~~~ >> net/xfrm/xfrm_user_legacy.c:863:5: error: redefinition of >> 'xfrm_notify_sa_legacy' int xfrm_notify_sa_legacy(const struct xfrm_state *x, const struct km_event *c) ^ In file included from net/xfrm/xfrm_user_legacy.c:30:0: net/xfrm/xfrm_user.h:137:19: note: previous definition of 'xfrm_notify_sa_legacy' was here static inline int xfrm_notify_sa_legacy(const struct xfrm_state *x, ^ >> net/xfrm/xfrm_user_legacy.c:983:5: error: redefinition of >> 'xfrm_send_acquire_legacy' int xfrm_send_acquire_legacy(struct xfrm_state *x, ^~~~ In file included from net/xfrm/xfrm_user_legacy.c:30:0: net/xfrm/xfrm_user.h:143:19: note: previous definition of 'xfrm_send_acquire_legacy' was here static inline int xfrm_send_acquire_legacy(struct xfrm_state *x, ^~~~ >> net/xfrm/xfrm_user_legacy.c:1043:5: error: redefinition of >> 'xfrm_exp_policy_notify_legacy' int xfrm_exp_policy_notify_legacy(const struct xfrm_policy *xp, ^ In file included from net/xfrm/xfrm_user_legacy.c:30:0: net/xfrm/xfrm_user.h:150:19: note: previous definition of 'xfrm_exp_policy_notify_legacy' was here static inline int xfrm_exp_policy_notify_legacy(const struct xfrm_policy *xp, ^ >> net/xfrm/xfrm_user_legacy.c:1060:5: error: redefinition of >> 'xfrm_notify_policy_legacy' int xfrm_notify_policy_legacy(const struct xfrm_policy *xp, ^ In file included from net/xfrm/xfrm_user_legacy.c:30:0: net/xfrm/xfrm_user.h:157:19: note: previous definition of 'xfrm_notify_policy_legacy' was here static inline int xfrm_notify_policy_legacy(const struct xfrm_policy *xp, ^ vim +/xfrm_exp_state_notify_legacy +845 net/xfrm/xfrm_user_legacy.c 839 return err; 840 841 nlmsg_end(skb, nlh); 842 return 0; 843 } 844 > 845 int xfrm_exp_state_notify_legacy(const struct xfrm_state *x, 846 const struct km_event *c) 847 { 848 struct net *net = xs_net(x); 849 struct sk_buff *skb; 850 851 skb = nlmsg_new(xfrm_expire_msgsize(), GFP_ATOMIC); 852 if (skb == NULL) 853 return -ENOMEM; 854 855 if (build_expire(skb, x, c) < 0) { 856 kfree_skb(skb); 857 return -EMSGSIZE; 858 } 859 860 return xfrm_nlmsg_multicast(net, skb, 0, XFRMNLGRP_EXPIRE); 861 } 862 > 863 int xfrm_notify_sa_legacy(const struct xfrm_state *x, const struct > km_event *c) 864 { 865 struct net *net = xs_net(x); 866 struct xfrm_usersa_info_legacy *p; 867 struct xfrm_usersa_id *id; 868 struct nlmsghdr *nlh; 869 struct sk_buff *skb; 870 int len = xfrm_sa_len(x); 871 int headlen, err; 872 u32 event = 0; 873 874 headlen = sizeof(*p); 875 if (c->event == XFRM_MSG_DELSA) { 876 len += nla_total_size(headlen); 877 headlen = sizeof(*id); 878 len += nla_total_size(sizeof(struct xfrm_mark)); 879 } 880 len += NLMSG_ALIGN(headlen); 881 882 skb =
Re: [PATCH] mm: extend zero pages to same element pages for zram
Hello, On (01/13/17 16:29), zhouxianr...@huawei.com wrote: [..] > --- a/Documentation/ABI/testing/sysfs-block-zram > +++ b/Documentation/ABI/testing/sysfs-block-zram > @@ -86,21 +86,21 @@ Description: > ones are sent by filesystem mounted with discard option, > whenever some data blocks are getting discarded. > > -What:/sys/block/zram/zero_pages > +What:/sys/block/zram/same_pages [..] > -zero_pagesROthe number of zero filled pages written to this disk > +same_pagesROthe number of same element filled pages written to > this disk [..] > - zero_pages > + same_pages > num_migrated > +} we removed deprecated sysfs attrs. zero_pages does not exist anymore. > static size_t zram_get_obj_size(struct zram_meta *meta, u32 index) > { > return meta->table[index].value & (BIT(ZRAM_FLAG_SHIFT) - 1); > @@ -158,31 +169,76 @@ static inline void update_used_max(struct zram *zram, > } while (old_max != cur_max); > } > > -static bool page_zero_filled(void *ptr) > +static inline void zram_fill_page(char *ptr, unsigned long value) > +{ > + int i; > + unsigned long *page = (unsigned long *)ptr; > + > + if (likely(value == 0)) { > + clear_page(ptr); > + } else { > + for (i = PAGE_SIZE / sizeof(unsigned long) - 1; i >= 0; i--) > + page[i] = value; > + } any particular reason not to use memset() here? memset() can be faster that that, right? [..] > /* Flags for zram pages (table[page_no].value) */ > enum zram_pageflags { > - /* Page consists entirely of zeros */ > - ZRAM_ZERO = ZRAM_FLAG_SHIFT, > + /* Page consists entirely of same elements */ > + ZRAM_SAME = ZRAM_FLAG_SHIFT, > ZRAM_ACCESS,/* page is now accessed */ [..] > @@ -83,7 +86,7 @@ struct zram_stats { > atomic64_t failed_writes; /* can happen when memory is too low */ > atomic64_t invalid_io; /* non-page-aligned I/O requests */ > atomic64_t notify_free; /* no. of swap slot free notifications */ > - atomic64_t zero_pages; /* no. of zero filled pages */ > + atomic64_t same_pages; /* no. of same element filled pages */ not like this rename is particularity important, but ok. works for me. -ss
Re: [PATCH] iio: proximity: sx9500: claim direct mode during raw proximity reads
On Fri, Jan 20, 2017 at 11:11 PM, Alison Schofield wrote: > Driver was checking for direct mode but not locking it. Use the > claim/release helper functions to guarantee the device stays in > direct mode during raw reads of proximity data. > > Signed-off-by: Alison Schofield Reviewed-by: Vlad Dogaru > --- > drivers/iio/proximity/sx9500.c | 10 +++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/drivers/iio/proximity/sx9500.c b/drivers/iio/proximity/sx9500.c > index 1f06282..9ea147f 100644 > --- a/drivers/iio/proximity/sx9500.c > +++ b/drivers/iio/proximity/sx9500.c > @@ -387,14 +387,18 @@ static int sx9500_read_raw(struct iio_dev *indio_dev, >int *val, int *val2, long mask) > { > struct sx9500_data *data = iio_priv(indio_dev); > + int ret; > > switch (chan->type) { > case IIO_PROXIMITY: > switch (mask) { > case IIO_CHAN_INFO_RAW: > - if (iio_buffer_enabled(indio_dev)) > - return -EBUSY; > - return sx9500_read_proximity(data, chan, val); > + ret = iio_device_claim_direct_mode(indio_dev); > + if (ret) > + return ret; > + ret = sx9500_read_proximity(data, chan, val); > + iio_device_release_direct_mode(indio_dev); > + return ret; > case IIO_CHAN_INFO_SAMP_FREQ: > return sx9500_read_samp_freq(data, val, val2); > default: > -- > 2.1.4 >
[PATCH v4 0/3] mmc: mediatek: Use data tune for CMD line tune
yong mao (3): mmc: dt-bindings: update Mediatek MMC bindings ARM64: dts: mediatek: configure some fixed mmc parameters mmc: mediatek: Use data tune for CMD line tune Documentation/devicetree/bindings/mmc/mtk-sd.txt | 12 ++ arch/arm64/boot/dts/mediatek/mt8173-evb.dts | 3 + drivers/mmc/host/mtk-sd.c| 168 --- 3 files changed, 167 insertions(+), 16 deletions(-) -- 1.8.1.1.dirty
[PATCH v4 2/3] ARM64: dts: mediatek: configure some fixed mmc parameters
From: yong mao configure some fixed mmc parameters Signed-off-by: Yong Mao Signed-off-by: Chaotian Jing --- arch/arm64/boot/dts/mediatek/mt8173-evb.dts |3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8173-evb.dts b/arch/arm64/boot/dts/mediatek/mt8173-evb.dts index 0ecaad4..1c3634f 100644 --- a/arch/arm64/boot/dts/mediatek/mt8173-evb.dts +++ b/arch/arm64/boot/dts/mediatek/mt8173-evb.dts @@ -134,6 +134,9 @@ bus-width = <8>; max-frequency = <5000>; cap-mmc-highspeed; + mediatek,hs200-cmd-int-delay=<26>; + mediatek,hs400-cmd-int-delay=<14>; + mediatek,hs400-cmd-resp-sel-rising; vmmc-supply = <&mt6397_vemc_3v3_reg>; vqmmc-supply = <&mt6397_vio18_reg>; non-removable; -- 1.7.9.5
[PATCH v4 1/3] mmc: dt-bindings: update Mediatek MMC bindings
From: yong mao Add description for mediatek,hs200-cmd-int-delay Add description for mediatek,hs400-cmd-int-delay Add description for mediatek,hs400-cmd-resp-sel-rising Signed-off-by: Yong Mao --- Documentation/devicetree/bindings/mmc/mtk-sd.txt | 12 1 file changed, 12 insertions(+) diff --git a/Documentation/devicetree/bindings/mmc/mtk-sd.txt b/Documentation/devicetree/bindings/mmc/mtk-sd.txt index 0120c7f..4182ea3 100644 --- a/Documentation/devicetree/bindings/mmc/mtk-sd.txt +++ b/Documentation/devicetree/bindings/mmc/mtk-sd.txt @@ -21,6 +21,15 @@ Optional properties: - assigned-clocks: PLL of the source clock - assigned-clock-parents: parent of source clock, used for HS400 mode to get 400Mhz source clock - hs400-ds-delay: HS400 DS delay setting +- mediatek,hs200-cmd-int-delay: HS200 command internal delay setting. + This field has total 32 stages. + The value is an integer from 0 to 31. +- mediatek,hs400-cmd-int-delay: HS400 command internal delay setting + This field has total 32 stages. + The value is an integer from 0 to 31. +- mediatek,hs400-cmd-resp-sel-rising: HS400 command response sample selection + If present,HS400 command responses are sampled on rising edges. + If not present,HS400 command responses are sampled on falling edges. Examples: mmc0: mmc@1123 { @@ -38,4 +47,7 @@ mmc0: mmc@1123 { assigned-clocks = <&topckgen CLK_TOP_MSDC50_0_SEL>; assigned-clock-parents = <&topckgen CLK_TOP_MSDCPLL_D2>; hs400-ds-delay = <0x14015>; + mediatek,hs200-cmd-int-delay = <26>; + mediatek,hs400-cmd-int-delay = <14>; + mediatek,hs400-cmd-resp-sel-rising; }; -- 1.7.9.5
[PATCH v4 3/3] mmc: mediatek: Use data tune for CMD line tune
From: yong mao If we don't select a set of better parameters for our emmc host, It may easily occur CMD response CRC error. And also it may cause cannot boot up issue. Fot getting a set of better parameters, our emmc host supports data tune mechanism.Therefore, our emmc driver also should change to use data tune for CMD line. Because our emmc host use the different clock source to sample the CMD signal between HS200 and HS400 mode, the parameters are also different between these two modes. Separate cmd internal delay for HS200/HS400 mode. This change can fix "System can not boot up" issue. Signed-off-by: Yong Mao Signed-off-by: Chaotian Jing --- drivers/mmc/host/mtk-sd.c | 168 - 1 file changed, 152 insertions(+), 16 deletions(-) diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c index 80ba034..07f3236 100644 --- a/drivers/mmc/host/mtk-sd.c +++ b/drivers/mmc/host/mtk-sd.c @@ -75,6 +75,7 @@ #define MSDC_PATCH_BIT1 0xb4 #define MSDC_PAD_TUNE0xec #define PAD_DS_TUNE 0x188 +#define PAD_CMD_TUNE 0x18c #define EMMC50_CFG0 0x208 /*--*/ @@ -210,13 +211,18 @@ #define MSDC_PATCH_BIT_SPCPUSH(0x1 << 29) /* RW */ #define MSDC_PATCH_BIT_DECRCTMO (0x1 << 30) /* RW */ +#define MSDC_PAD_TUNE_DATWRDLY (0x1f << 0) /* RW */ #define MSDC_PAD_TUNE_DATRRDLY (0x1f << 8) /* RW */ #define MSDC_PAD_TUNE_CMDRDLY(0x1f << 16) /* RW */ +#define MSDC_PAD_TUNE_CMDRRDLY (0x1f << 22) /* RW */ +#define MSDC_PAD_TUNE_CLKTDLY(0x1f << 27) /* RW */ #define PAD_DS_TUNE_DLY1 (0x1f << 2) /* RW */ #define PAD_DS_TUNE_DLY2 (0x1f << 7) /* RW */ #define PAD_DS_TUNE_DLY3 (0x1f << 12) /* RW */ +#define PAD_CMD_TUNE_RX_DLY3 (0x1f << 1) /* RW */ + #define EMMC50_CFG_PADCMD_LATCHCK (0x1 << 0) /* RW */ #define EMMC50_CFG_CRCSTS_EDGE(0x1 << 3) /* RW */ #define EMMC50_CFG_CFCSTS_SEL (0x1 << 4) /* RW */ @@ -284,12 +290,14 @@ struct msdc_save_para { u32 patch_bit0; u32 patch_bit1; u32 pad_ds_tune; + u32 pad_cmd_tune; u32 emmc50_cfg0; }; struct msdc_tune_para { u32 iocon; u32 pad_tune; + u32 pad_cmd_tune; }; struct msdc_delay_phase { @@ -331,6 +339,10 @@ struct msdc_host { unsigned char timing; bool vqmmc_enabled; u32 hs400_ds_delay; + u32 hs200_cmd_int_delay; /* cmd internal delay for HS200/SDR104 */ + u32 hs400_cmd_int_delay; /* cmd internal delay for HS400 */ + bool hs400_cmd_resp_sel_rising; +/* cmd response sample selection for HS400 */ bool hs400_mode;/* current eMMC will run at hs400 mode */ struct msdc_save_para save_para; /* used when gate HCLK */ struct msdc_tune_para def_tune_para; /* default tune setting */ @@ -600,8 +612,14 @@ static void msdc_set_mclk(struct msdc_host *host, unsigned char timing, u32 hz) } else { writel(host->saved_tune_para.iocon, host->base + MSDC_IOCON); writel(host->saved_tune_para.pad_tune, host->base + MSDC_PAD_TUNE); + writel(host->saved_tune_para.pad_cmd_tune, + host->base + PAD_CMD_TUNE); } + if (timing == MMC_TIMING_MMC_HS400) + sdr_set_field(host->base + PAD_CMD_TUNE, + MSDC_PAD_TUNE_CMDRRDLY, + host->hs400_cmd_int_delay); dev_dbg(host->dev, "sclk: %d, timing: %d\n", host->sclk, timing); } @@ -1302,7 +1320,7 @@ static struct msdc_delay_phase get_best_delay(struct msdc_host *host, u32 delay) len_final = len; } start += len ? len : 1; - if (len >= 8 && start_final < 4) + if (len >= 12 && start_final < 4) break; } @@ -1325,36 +1343,67 @@ static int msdc_tune_response(struct mmc_host *mmc, u32 opcode) struct msdc_host *host = mmc_priv(mmc); u32 rise_delay = 0, fall_delay = 0; struct msdc_delay_phase final_rise_delay, final_fall_delay = { 0,}; + struct msdc_delay_phase internal_delay_phase; u8 final_delay, final_maxlen; + u32 internal_delay = 0; int cmd_err; - int i; + int i, j; + + if (mmc->ios.timing == MMC_TIMING_MMC_HS200 || + mmc->ios.timing == MMC_TIMING_UHS_SDR104) + sdr_set_field(host->base + MSDC_PAD_TUNE, + MSDC_PAD_TUNE_CMDRRDLY, + host->hs200_cmd_int_delay); sdr_clr_bits(host->base + MSDC_IOCON, MSDC_IOCON_RSPL); for (i = 0 ; i < PAD_DELAY_MAX; i++) { sdr_set_field(host->base + MSDC_PAD_TUNE, MSDC_PAD_TUNE_CMDRDLY, i); - mmc_send_tuning(mmc, opcode, &cmd_err); -
Re: [PATCH 4.9 000/120] 4.9.5-stable review
On Fri, Jan 20, 2017 at 03:26:15PM -0800, Kevin Hilman wrote: > kernelci.org bot writes: > > > stable-rc boot: 217 boots: 4 failed, 202 passed with 9 offline, 2 conflicts > > (v4.9.4-121-ga55293ab8542) > > > > Full Boot Summary: > > https://kernelci.org/boot/all/job/stable-rc/kernel/v4.9.4-121-ga55293ab8542/ > > Full Build Summary: > > https://kernelci.org/build/stable-rc/kernel/v4.9.4-121-ga55293ab8542/ > > > > Tree: stable-rc > > Branch: local/linux-4.9.y > > Git Describe: v4.9.4-121-ga55293ab8542 > > Git Commit: a55293ab8542c08a979e3152d18c298410fdf7e4 > > Git URL: > > http://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git > > Tested: 49 unique boards, 15 SoC families, 27 builds out of 206 > > > > Boot Regressions Detected: > > > > arm: > > > > multi_v7_defconfig: > > vexpress-v2p-ca15_a7: > > lab-broonie: new failure (last pass: v4.9.4-116-gfa44cad19956) > > > > multi_v7_defconfig+CONFIG_LKDTM=y: > > vexpress-v2p-ca15-tc1: > > lab-broonie: new failure (last pass: v4.9.4-116-gfa44cad19956) > > > > multi_v7_defconfig+CONFIG_SMP=n: > > exynos5250-snow: > > lab-collabora: failing since 8 days (last pass: > > v4.9.1-117-g8e301c7d4760 - first fail: v4.9.2-207-gf377428ed2cf) > > > > Boot Failures Detected: > > > > arm64: > > > > defconfig+CONFIG_RANDOMIZE_BASE=y > > armada-7040-db: 1 failed lab > > > > arm: > > > > multi_v7_defconfig+CONFIG_PROVE_LOCKING=y > > at91-sama5d4_xplained: 1 failed lab > > > > multi_v7_defconfig+CONFIG_SMP=n > > exynos5250-snow: 1 failed lab > > > > x86: > > > > defconfig+CONFIG_KASAN=y > > qemu-i386: 1 failed lab > > Interpretation: all is well. > > No new issues. Wonderful, thanks for letting me know. greg k-h
[PATCH v3 0/2] spi: pca2xx: Prepare for and enable MSI support
This enhances the pca2xx driver's interrupt handler with support for edge-triggered interrupts and makes use of that for PCI-hosted variants, like the Intel Quark SoC. Changes in v3: - removed already applied patch "Factor out handle_bad_msg" - avoid inner looping by making the hardware retrigger on "forgotten" IRQ sources - added acked/reviewed tags Changes in v2: - factored out handle_bad_msg (Andy) - reordered code in patch 3, avoiding unneeded pci_free_irq_vectors (Andy) Jan Jan Kiszka (2): spi: pxa2xx: Prepare for edge-triggered interrupts spi: pca2xx-pci: Allow MSI drivers/spi/spi-pxa2xx-pci.c | 8 +++- drivers/spi/spi-pxa2xx.c | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) -- 2.1.4
[PATCH v3 2/2] spi: pca2xx-pci: Allow MSI
Now that the core is ready for edge-triggered interrupts, we can safely allow the PCI versions that provide this to enable the feature and, thus, have less shared interrupts. Signed-off-by: Jan Kiszka Reviewed-by: Andy Shevchenko Reviewed-by: Jarkko Nikula --- drivers/spi/spi-pxa2xx-pci.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-pxa2xx-pci.c b/drivers/spi/spi-pxa2xx-pci.c index 868452d..869f188 100644 --- a/drivers/spi/spi-pxa2xx-pci.c +++ b/drivers/spi/spi-pxa2xx-pci.c @@ -227,10 +227,16 @@ static int pxa2xx_spi_pci_probe(struct pci_dev *dev, ssp = &spi_pdata.ssp; ssp->phys_base = pci_resource_start(dev, 0); ssp->mmio_base = pcim_iomap_table(dev)[0]; - ssp->irq = dev->irq; ssp->port_id = (c->port_id >= 0) ? c->port_id : dev->devfn; ssp->type = c->type; + pci_set_master(dev); + + ret = pci_alloc_irq_vectors(dev, 1, 1, PCI_IRQ_ALL_TYPES); + if (ret < 0) + return ret; + ssp->irq = pci_irq_vector(dev, 0); + snprintf(buf, sizeof(buf), "pxa2xx-spi.%d", ssp->port_id); ssp->clk = clk_register_fixed_rate(&dev->dev, buf , NULL, 0, c->max_clk_rate); -- 2.1.4
[PATCH v3 1/2] spi: pxa2xx: Prepare for edge-triggered interrupts
When using the a device with edge-triggered interrupts, such as MSIs, the interrupt handler has to ensure that there is a point in time during its execution where all interrupts sources are silent so that a new event can trigger a new interrupt again. This is achieved here by disabling all interrupt sources for a moment before processing them according to the status register. If a new interrupt should have arrived after we read the status, it will now re-trigger the interrupt, even in edge mode. Signed-off-by: Jan Kiszka Acked-by: Robert Jarzmik --- drivers/spi/spi-pxa2xx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index bd843df..47b65d7 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -785,6 +785,9 @@ static irqreturn_t ssp_int(int irq, void *dev_id) if (!(status & mask)) return IRQ_NONE; + pxa2xx_spi_write(drv_data, SSCR1, sccr1_reg & ~drv_data->int_cr1); + pxa2xx_spi_write(drv_data, SSCR1, sccr1_reg); + if (!drv_data->master->cur_msg) { handle_bad_msg(drv_data); /* Never fail */ -- 2.1.4
Re: [PATCH] USB: Add quirk for WORLDE easykey.25 MIDI keyboard
On Fri, Jan 20, 2017 at 07:46:34PM +0100, Lukáš Lalinský wrote: > Add a quirk for WORLDE easykey.25 MIDI keyboard (idVendor=0218, > idProduct=0401). The device reports that it has config string > descriptor at index 3, but when the system selects the configuration > and tries to get the description, it returns a -EPROTO error, > the communication restarts and this keeps repeating over and over again. > Not requesting the string descriptor makes the device work correctly. Always use scripts/get_maintainer.pl to determine who to send patches to, and what mailing list. You forgot linux-usb@vger, which I've now added... > > Relevant info from Wireshark: > > [...] > > CONFIGURATION DESCRIPTOR > bLength: 9 > bDescriptorType: 0x02 (CONFIGURATION) > wTotalLength: 101 > bNumInterfaces: 2 > bConfigurationValue: 1 > iConfiguration: 3 > Configuration bmAttributes: 0xc0 SELF-POWERED NO REMOTE-WAKEUP > 1... = Must be 1: Must be 1 for USB 1.1 and higher > .1.. = Self-Powered: This device is SELF-POWERED > ..0. = Remote Wakeup: This device does NOT support remote wakeup > bMaxPower: 50 (100mA) > > [...] > > 45 0.369104 host 2.38.0USB > 64 GET DESCRIPTOR Request STRING > > [...] > > URB setup > bmRequestType: 0x80 > 1... = Direction: Device-to-host > .00. = Type: Standard (0x00) > ...0 = Recipient: Device (0x00) > bRequest: GET DESCRIPTOR (6) > Descriptor Index: 0x03 > bDescriptorType: 0x03 > Language Id: English (United States) (0x0409) > wLength: 255 > > 46 0.369255 2.38.0host USB > 64 GET DESCRIPTOR Response STRING[Malformed Packet] > > [...] > > Frame 46: 64 bytes on wire (512 bits), 64 bytes captured (512 bits) on > interface 0 > USB URB > [Source: 2.38.0] > [Destination: host] > URB id: 0x88021f62d480 > URB type: URB_COMPLETE ('C') > URB transfer type: URB_CONTROL (0x02) > Endpoint: 0x80, Direction: IN > Device: 38 > URB bus id: 2 > Device setup request: not relevant ('-') > Data: present (0) > URB sec: 1484896277 > URB usec: 455031 > URB status: Protocol error (-EPROTO) (-71) > URB length [bytes]: 0 > Data length [bytes]: 0 > [Request in: 45] > [Time from request: 0.000151000 seconds] > Unused Setup Header > Interval: 0 > Start frame: 0 > Copy of Transfer Flags: 0x0200 > Number of ISO descriptors: 0 > [Malformed Packet: USB] > [Expert Info (Error/Malformed): Malformed Packet (Exception occurred)] > [Malformed Packet (Exception occurred)] > [Severity level: Error] > [Group: Malformed] > > Signed-off-by: Lukáš Lalinský > --- > drivers/usb/core/quirks.c | 4 > 1 file changed, 4 insertions(+) > > diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c > index d2e50a2..24f9f98 100644 > --- a/drivers/usb/core/quirks.c > +++ b/drivers/usb/core/quirks.c > @@ -37,6 +37,10 @@ static const struct usb_device_id usb_quirk_list[] = { > /* CBM - Flash disk */ > { USB_DEVICE(0x0204, 0x6025), .driver_info = USB_QUIRK_RESET_RESUME }, > > + /* WORLDE easy key (easykey.25) MIDI controller */ > + { USB_DEVICE(0x0218, 0x0401), .driver_info = > + USB_QUIRK_CONFIG_INTF_STRINGS }, That's odd, how does other operating systems handle this device? thanks, greg k-h
Re: [RFC ADD HYPERVISOR CALL SUPPORT 1/2] soc: qcom: Add hypervisor stage two translation request support.
On 01/09, Avaneesh Kumar Dwivedi wrote: > This patch add hypervisor support for mss bring up on msm8996. > MSS rproc driver make hypervisor request to add certain region > in IPA table owned by hepervisor and assign access permission Please drop the use of IPA here. There's an IPA acronym for the IP accelerator and that is confused with Intermediate Physical Address. Instead, say something like "in the stage 2 page tables of the SMMU". Also hypervisor is misspelled here. > to modem. These regions are used to load MBA, MDT, FW into DDR. > > Signed-off-by: Avaneesh Kumar Dwivedi > --- > drivers/firmware/qcom_scm-64.c | 16 +++ > drivers/firmware/qcom_scm.c| 13 +++ > drivers/firmware/qcom_scm.h| 10 ++ > drivers/remoteproc/qcom_q6v5_pil.c | 96 +++- Please split the remoteproc code off from this patch. > drivers/soc/qcom/Kconfig | 8 ++ > drivers/soc/qcom/Makefile | 1 + > drivers/soc/qcom/secure_buffer.c | 229 > + > include/linux/qcom_scm.h | 1 + > include/soc/qcom/secure_buffer.h | 51 + > 9 files changed, 419 insertions(+), 6 deletions(-) > create mode 100644 drivers/soc/qcom/secure_buffer.c > create mode 100644 include/soc/qcom/secure_buffer.h > > diff --git a/drivers/firmware/qcom_scm-64.c b/drivers/firmware/qcom_scm-64.c > index 4a0f5ea..63b814c 100644 > --- a/drivers/firmware/qcom_scm-64.c > +++ b/drivers/firmware/qcom_scm-64.c > @@ -358,3 +358,19 @@ int __qcom_scm_pas_mss_reset(struct device *dev, bool > reset) > > return ret ? : res.a1; > } > + > +int __qcom_scm_assign_mem(struct device *dev, void *data) > +{ > + int ret; > + struct qcom_scm_desc *desc = (struct qcom_scm_desc *)data; Useless cast from void. > + struct arm_smccc_res res; > + > + desc->arginfo = QCOM_SCM_ARGS(7, SCM_RO, SCM_VAL, SCM_RO, > + SCM_VAL, SCM_RO, SCM_VAL, SCM_VAL); > + > + ret = qcom_scm_call(dev, QCOM_SCM_SVC_MP, > + QCOM_MEM_PROT_ASSIGN_ID, > + desc, &res); > + > + return ret ? : res.a1; > +} > diff --git a/drivers/firmware/qcom_scm.c b/drivers/firmware/qcom_scm.c > index 893f953ea..52394ac 100644 > --- a/drivers/firmware/qcom_scm.c > +++ b/drivers/firmware/qcom_scm.c > @@ -292,6 +292,19 @@ int qcom_scm_pas_shutdown(u32 peripheral) > } > EXPORT_SYMBOL(qcom_scm_pas_shutdown); > > +/** > + * qcom_scm_assign_mem() - Some words on what the function does? > + * @desc:descriptor to send to hypervisor > + * > + * Return 0 on success. > + */ > +int qcom_scm_assign_mem(void *desc) > +{ > + Nitpick: Drop the extra newline > + return __qcom_scm_assign_mem(__scm->dev, desc); > +} > +EXPORT_SYMBOL(qcom_scm_assign_mem); > + > static int qcom_scm_pas_reset_assert(struct reset_controller_dev *rcdev, >unsigned long idx) > { > diff --git a/drivers/firmware/qcom_scm.h b/drivers/firmware/qcom_scm.h > index 3584b00..f248dc9 100644 > --- a/drivers/firmware/qcom_scm.h > +++ b/drivers/firmware/qcom_scm.h > @@ -47,6 +47,8 @@ extern int __qcom_scm_hdcp_req(struct device *dev, > #define QCOM_SCM_PAS_SHUTDOWN_CMD0x6 > #define QCOM_SCM_PAS_IS_SUPPORTED_CMD0x7 > #define QCOM_SCM_PAS_MSS_RESET 0xa > +#define QCOM_SCM_SVC_MP 0xc > +#define QCOM_MEM_PROT_ASSIGN_ID 0x16 > extern bool __qcom_scm_pas_supported(struct device *dev, u32 peripheral); > extern int __qcom_scm_pas_init_image(struct device *dev, u32 peripheral, > dma_addr_t metadata_phys); > @@ -55,6 +57,7 @@ extern int __qcom_scm_pas_mem_setup(struct device *dev, > u32 peripheral, > extern int __qcom_scm_pas_auth_and_reset(struct device *dev, u32 > peripheral); > extern int __qcom_scm_pas_shutdown(struct device *dev, u32 peripheral); > extern int __qcom_scm_pas_mss_reset(struct device *dev, bool reset); > +extern int __qcom_scm_assign_mem(struct device *dev, void *desc); > > /* common error codes */ > #define QCOM_SCM_V2_EBUSY-12 > @@ -83,4 +86,11 @@ static inline int qcom_scm_remap_error(int err) > return -EINVAL; > } > > +enum scm_arg_types { > + SCM_VAL, > + SCM_RO, > + SCM_RW, > + SCM_BUFVAL, > +}; We already have this enum? It's just prepended with QCOM_ instead. > + > #endif > diff --git a/drivers/remoteproc/qcom_q6v5_pil.c > b/drivers/remoteproc/qcom_q6v5_pil.c > index e5edefa..cbf833c 100644 > --- a/drivers/remoteproc/qcom_q6v5_pil.c > +++ b/drivers/remoteproc/qcom_q6v5_pil.c > @@ -31,6 +31,7 @@ > #include > #include > #include > +#include > > #include "remoteproc_internal.h" > #include "qcom_mdt_loader.h" > @@ -105,12 +106,19 @@ struct qcom_mss_reg_res { > int uA; > }; > > +struct src_dest_vmid { > + int *srcVM; > + int *destVM; > + int *destVMperm; Why not have an array of these structures instead of a structure w
Re: Regression on Dell XPS13 (was: [char-misc for 4.10-rc4 V2] mei: bus: enable OS version only for SPT and newer)
On Fri, Jan 20, 2017 at 11:11:45PM +, mario.limoncie...@dell.com wrote: > Greg, > > > -Original Message- > > From: Darren Hart [mailto:dvh...@infradead.org] > > Sent: Tuesday, January 17, 2017 5:34 PM > > To: Limonciello, Mario > > Cc: gre...@linuxfoundation.org; rafael.j.wyso...@intel.com; > > pmen...@molgen.mpg.de; li...@leemhuis.info; tomas.wink...@intel.com; > > j...@gondor.com; alexander.usys...@intel.com; linux-kernel@vger.kernel.org; > > yu.c.c...@intel.com; tomi.p.sarv...@intel.com; dan...@quora.org; > > len.br...@intel.com; linux...@vger.kernel.org > > Subject: Re: Regression on Dell XPS13 (was: [char-misc for 4.10-rc4 V2] mei: > > bus: enable OS version only for SPT and newer) > > > > On Tue, Jan 17, 2017 at 06:38:43PM +, mario.limoncie...@dell.com > > wrote: > > > > -Original Message- > > > > From: Greg KH [mailto:gre...@linuxfoundation.org] > > > > Sent: Tuesday, January 17, 2017 12:24 PM > > > > To: Limonciello, Mario > > > > Cc: pmen...@molgen.mpg.de; rafael.j.wyso...@intel.com; > > > > li...@leemhuis.info; tomas.wink...@intel.com; j...@gondor.com; > > > > alexander.usys...@intel.com; linux-kernel@vger.kernel.org; > > > > yu.c.c...@intel.com; tomi.p.sarv...@intel.com; dan...@quora.org; > > > > len.br...@intel.com; linux...@vger.kernel.org > > > > Subject: Re: Regression on Dell XPS13 (was: [char-misc for 4.10-rc4 V2] > > > > mei: > > > > bus: enable OS version only for SPT and newer) > > > > > > > > On Tue, Jan 17, 2017 at 04:57:49PM +, mario.limoncie...@dell.com > > > > wrote: > > > > > So in the <6s scenario, the intel-hid driver is responsible to > > > > > receive the ACPI event and process accordingly. The maintainer > > > > > has a patch ready for the intel-hid portion of this work, but it's > > > > > currently being reviewed by Intel to ensure it can be legally > > > > > submitted > > into the kernel. > > > > > > > > Who at Intel do I need to go kick to make this mythical legal review > > > > happen faster so we can see the code? > > > > > > > > Len and Rafael, what is going on here? > > > > > > > > > > Len and Darren are both in the loop on the discussion around this patch. > > > I don't know if they'll have any (public) comments they can add on the > > > matter yet however. > > > > Thanks Mario. Yes, there isn't much to say here in public other than to > > confirm > > we are keenly aware of the problem and have been actively working on fixing > > it, both for this instance, and the deeper systematic failure that resulted > > in this > > situation. No amount of kicking will expedite the process at this point, but > > should we feel the need, we'll reach out. > > > > The approval has come through and the patch has been submitted. > http://www.spinics.net/lists/platform-driver-x86/msg10286.html Looks like it needs some work :) And why isn't it tagged to go to the 4.10-stable kernel if it really does fix some systems? > Note: this is only half of the fix, the second half needs the ACPI subsystem > to > not be frozen to be able to receive this event. Where is that change? I'm still worried about 4.10-final, is that going to be broken for these types of systems? thanks, greg k-h
Re: [PATCH] staging: lustre: headers: potential UAPI headers
On Fri, Jan 20, 2017 at 11:33:11PM +, James Simmons wrote: > > > > > On Mon, Dec 19, 2016 at 12:06:47PM -0500, James Simmons wrote: > > > > > Not for landing. This is the purposed UAPI headers > > > > > with the removal of unlikely and debugging macros. > > > > > This is just for feedback to see if this is acceptable > > > > > for the upstream client. > > > > > > > > > > Signed-off-by: James Simmons > > > > > --- > > > > > .../lustre/lustre/include/lustre/lustre_fid.h | 353 > > > > > + > > > > > .../lustre/lustre/include/lustre/lustre_ostid.h| 233 > > > > > ++ > > > > > > > > Can you make a lustre "uapi" directory so we can see which files you > > > > really want to be UAPI and which you don't as time goes on? > > > > > > Where do you want them placed? In uapi/linux/lustre or uapi/lustre. Does > > > it matter to you? The below was to forth coming UAPI headers which from > > > your response you seem okay with in general. > > > > How many .h files are there going to be? It's just a single filesystem, > > shouldn't you just need a single file? If so, how about > > drivers/staging/lustre/include/uapi/lustre.h > > ? > > > > If you really need multiple .h files, put them all in the same uapi/ > > directory with a lustre_ prefix, you don't need a whole subdir just for > > yourself, right? > > We have 12 UAPI headers and yes they all begin with lustre_*. Okay I will > create a driver/staging/lustre/include/uapi/linux directory and start > moving headers there. 12 seems like a lot just for a single, tiny, filesystem :) But moving them all to a single directory will see where we can later merge them together, sounds like a good plan. thanks, greg k-h
[GIT PULL] USB driver fixes for 4.10-rc5
The following changes since commit 49def1853334396f948dcb4cedb9347abb318df5: Linux 4.10-rc4 (2017-01-15 16:21:59 -0800) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git/ tags/usb-4.10-rc5 for you to fetch changes up to 488dc164914ff5ce5e913abd32048d28fc0d06b8: xhci: remove WARN_ON if dma mask is not set for platform devices (2017-01-20 14:55:20 +0100) USB fixes for 4.10-rc5 Here are a few small USB fixes for 4.10-rc5. Most of these are gadget/dwc2 fixes for reported issues, all of these have been in linux-next for a while. The last one is a single xhci WARN_ON removal to handle an issue that the dwc3 driver is hitting in the 4.10-rc tree. The warning is harmless and needs to be removed, and a "real" fix that is more complex will show up in 4.11-rc1 for this device. That last patch hasn't been in linux-next yet due to the weekend timing, but it's a "simple" WARN_ON() removal so what could go wrong? :) Signed-off-by: Greg Kroah-Hartman Alexandre Belloni (1): usb: gadget: udc: atmel: remove memory leak Amelie Delaunay (1): usb: dwc2: gadget: Fix GUSBCFG.USBTRDTIM value Christophe JAILLET (1): usb: gadget: composite: Fix function used to free memory Greg Kroah-Hartman (1): Merge tag 'fixes-for-v4.10-rc5' of git://git.kernel.org/.../balbi/usb into usb-linus John Stultz (1): usb: dwc2: Avoid suspending if we're in gadget mode Leo Yan (1): usb: dwc2: use u32 for DT binding parameters Mathias Nyman (1): xhci: remove WARN_ON if dma mask is not set for platform devices Nicholas Mc Guire (1): usb: dwc2: host: fix Wmaybe-uninitialized warning Shuah Khan (1): usb: dwc3: exynos fix axius clock error path to do cleanup Vardan Mikayelyan (1): usb: dwc2: gadget: Fix DMA memory freeing Vincent Pelletier (1): usb: gadget: f_fs: Fix iterations on endpoints. drivers/usb/dwc2/core.h | 4 ++-- drivers/usb/dwc2/gadget.c | 18 +- drivers/usb/dwc2/hcd.c | 7 +-- drivers/usb/dwc2/params.c | 10 +- drivers/usb/dwc3/dwc3-exynos.c | 4 +++- drivers/usb/gadget/composite.c | 2 +- drivers/usb/gadget/function/f_fs.c | 12 ++-- drivers/usb/gadget/udc/atmel_usba_udc.c | 3 ++- drivers/usb/gadget/udc/atmel_usba_udc.h | 1 + drivers/usb/host/xhci-plat.c| 2 +- 10 files changed, 31 insertions(+), 32 deletions(-)
[PATCH] media: platform: constify vb2_ops structures
Declare vb2_ops structures as const as they are only stored in the ops field of a vb2_queue structure. This field is of type const, so vb2_ops structures having same properties can be made const too. Done using Coccinelle: @r1 disable optional_qualifier@ identifier i; position p; @@ static struct vb2_ops i@p={...}; @ok1@ identifier r1.i; position p; struct sta2x11_vip vip; struct vb2_queue q; @@ ( vip.vb_vidq.ops=&i@p | q.ops=&i@p ) @bad@ position p!={r1.p,ok1.p}; identifier r1.i; @@ i@p @depends on !bad disable optional_qualifier@ identifier r1.i; @@ +const struct vb2_ops i; Cross compiled the media/platform/blackfin/bfin_capture.o file for blackfin architecture. File size before: text data bss dec hex filename 6776 176 069521b28 platform/blackfin/bfin_capture.o File size after: textdata bss dec hex filename 6816 136 069521b28 platform/blackfin/bfin_capture.o File size before: textdata bss dec hex filename 12852 456 272 13580350c platform/davinci/vpif_capture.o File size after: textdata bss dec hex filename 12932 360 272 1356434fc platform/davinci/vpif_capture.o File size before: textdata bss dec hex filename 12285 360 276 129213279 platform/davinci/vpif_display.o File size after: textdata bss dec hex filename 12365 296 276 129373289 platform/davinci/vpif_display.o File size details before and after applying the patch remains the same for drivers/media/platform/pxa_camera.o Signed-off-by: Bhumika Goyal --- drivers/media/platform/davinci/vpif_capture.c | 2 +- drivers/media/platform/davinci/vpif_display.c | 2 +- drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c | 2 +- drivers/media/platform/pxa_camera.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c index f791f5c..54c54d9 100644 --- a/drivers/media/platform/davinci/vpif_capture.c +++ b/drivers/media/platform/davinci/vpif_capture.c @@ -309,7 +309,7 @@ static void vpif_stop_streaming(struct vb2_queue *vq) spin_unlock_irqrestore(&common->irqlock, flags); } -static struct vb2_ops video_qops = { +static const struct vb2_ops video_qops = { .queue_setup= vpif_buffer_queue_setup, .buf_prepare= vpif_buffer_prepare, .start_streaming= vpif_start_streaming, diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c index e5f1844..9604afd 100644 --- a/drivers/media/platform/davinci/vpif_display.c +++ b/drivers/media/platform/davinci/vpif_display.c @@ -289,7 +289,7 @@ static void vpif_stop_streaming(struct vb2_queue *vq) spin_unlock_irqrestore(&common->irqlock, flags); } -static struct vb2_ops video_qops = { +static const struct vb2_ops video_qops = { .queue_setup= vpif_buffer_queue_setup, .wait_prepare = vb2_ops_wait_prepare, .wait_finish= vb2_ops_wait_finish, diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c b/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c index 13afe48..3038d62 100644 --- a/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c +++ b/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c @@ -621,7 +621,7 @@ static void mtk_mdp_m2m_buf_queue(struct vb2_buffer *vb) v4l2_m2m_buf_queue(ctx->m2m_ctx, to_vb2_v4l2_buffer(vb)); } -static struct vb2_ops mtk_mdp_m2m_qops = { +static const struct vb2_ops mtk_mdp_m2m_qops = { .queue_setup = mtk_mdp_m2m_queue_setup, .buf_prepare = mtk_mdp_m2m_buf_prepare, .buf_queue = mtk_mdp_m2m_buf_queue, diff --git a/drivers/media/platform/pxa_camera.c b/drivers/media/platform/pxa_camera.c index 929006f..17167d1 100644 --- a/drivers/media/platform/pxa_camera.c +++ b/drivers/media/platform/pxa_camera.c @@ -1530,7 +1530,7 @@ static void pxac_vb2_stop_streaming(struct vb2_queue *vq) pxa_camera_wakeup(pcdev, buf, VB2_BUF_STATE_ERROR); } -static struct vb2_ops pxac_vb2_ops = { +static const struct vb2_ops pxac_vb2_ops = { .queue_setup= pxac_vb2_queue_setup, .buf_init = pxac_vb2_init, .buf_prepare= pxac_vb2_prepare, -- 1.9.1
[PATCH] media: pci: constify vb2_ops structure
Declare vb2_ops structure as const as it is only stored in the ops field of a vb2_queue structure. This field is of type const, so vb2_ops structures having same properties can be made const too. Done using Coccinelle: @r1 disable optional_qualifier@ identifier i; position p; @@ static struct vb2_ops i@p={...}; @ok1@ identifier r1.i; position p; struct sta2x11_vip vip; struct vb2_queue q; @@ ( vip.vb_vidq.ops=&i@p | q.ops=&i@p ) @bad@ position p!={r1.p,ok1.p}; identifier r1.i; @@ i@p @depends on !bad disable optional_qualifier@ identifier r1.i; @@ +const struct vb2_ops i; File size before: textdata bss dec hex filename 8448 440 022b8 media/pci/sta2x11/sta2x11_vip.o File size after: textdata bss dec hex filename 8552 352 0890422c8 media/pci/sta2x11/sta2x11_vip.o Signed-off-by: Bhumika Goyal --- drivers/media/pci/sta2x11/sta2x11_vip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/sta2x11/sta2x11_vip.c b/drivers/media/pci/sta2x11/sta2x11_vip.c index aeb2b4e..6343d24 100644 --- a/drivers/media/pci/sta2x11/sta2x11_vip.c +++ b/drivers/media/pci/sta2x11/sta2x11_vip.c @@ -377,7 +377,7 @@ static void stop_streaming(struct vb2_queue *vq) spin_unlock(&vip->lock); } -static struct vb2_ops vip_video_qops = { +static const struct vb2_ops vip_video_qops = { .queue_setup= queue_setup, .buf_init = buffer_init, .buf_prepare= buffer_prepare, -- 1.9.1
Re: [PATCH] iio: magnetometer: mag3110: claim direct mode during raw writes
> Driver was checking for direct mode but not locking it. Use > claim/release helper functions to guarantee the device stays > in direct mode during raw writes. looks good, Acked-by: Peter Meerwald-Stadler > Signed-off-by: Alison Schofield > --- > drivers/iio/magnetometer/mag3110.c | 30 -- > 1 file changed, 20 insertions(+), 10 deletions(-) > > diff --git a/drivers/iio/magnetometer/mag3110.c > b/drivers/iio/magnetometer/mag3110.c > index f2b3bd7..b4f643f 100644 > --- a/drivers/iio/magnetometer/mag3110.c > +++ b/drivers/iio/magnetometer/mag3110.c > @@ -222,29 +222,39 @@ static int mag3110_write_raw(struct iio_dev *indio_dev, >int val, int val2, long mask) > { > struct mag3110_data *data = iio_priv(indio_dev); > - int rate; > + int rate, ret; > > - if (iio_buffer_enabled(indio_dev)) > - return -EBUSY; > + ret = iio_device_claim_direct_mode(indio_dev); > + if (ret) > + return ret; > > switch (mask) { > case IIO_CHAN_INFO_SAMP_FREQ: > rate = mag3110_get_samp_freq_index(data, val, val2); > - if (rate < 0) > - return -EINVAL; > + if (rate < 0) { > + ret = -EINVAL; > + break; > + } > > data->ctrl_reg1 &= ~MAG3110_CTRL_DR_MASK; > data->ctrl_reg1 |= rate << MAG3110_CTRL_DR_SHIFT; > - return i2c_smbus_write_byte_data(data->client, > + ret = i2c_smbus_write_byte_data(data->client, > MAG3110_CTRL_REG1, data->ctrl_reg1); > + break; > case IIO_CHAN_INFO_CALIBBIAS: > - if (val < -1 || val > 1) > - return -EINVAL; > - return i2c_smbus_write_word_swapped(data->client, > + if (val < -1 || val > 1) { > + ret = -EINVAL; > + break; > + } > + ret = i2c_smbus_write_word_swapped(data->client, > MAG3110_OFF_X + 2 * chan->scan_index, val << 1); > + break; > default: > - return -EINVAL; > + ret = -EINVAL; > + break; > } > + iio_device_release_direct_mode(indio_dev); > + return ret; > } > > static irqreturn_t mag3110_trigger_handler(int irq, void *p) > -- Peter Meerwald-Stadler +43-664-218 (mobile)
[PATCH] media: dvb-frontends: constify vb2_ops structure
Declare vb2_ops structure as const as it is only stored in the ops field of a vb2_queue structure. This field is of type const, so vb2_ops structures having same properties can be made const too. Done using Coccinelle: @r1 disable optional_qualifier@ identifier i; position p; @@ static struct vb2_ops i@p={...}; @ok1@ identifier r1.i; position p; struct sta2x11_vip vip; struct vb2_queue q; @@ ( vip.vb_vidq.ops=&i@p | q.ops=&i@p ) @bad@ position p!={r1.p,ok1.p}; identifier r1.i; @@ i@p @depends on !bad disable optional_qualifier@ identifier r1.i; @@ +const struct vb2_ops i; File size details of media/dvb-frontends/rtl2832_sdr.o file remains the same before and after applying the patch. Signed-off-by: Bhumika Goyal --- drivers/media/dvb-frontends/rtl2832_sdr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/dvb-frontends/rtl2832_sdr.c b/drivers/media/dvb-frontends/rtl2832_sdr.c index e038e88..c6e78d8 100644 --- a/drivers/media/dvb-frontends/rtl2832_sdr.c +++ b/drivers/media/dvb-frontends/rtl2832_sdr.c @@ -956,7 +956,7 @@ static void rtl2832_sdr_stop_streaming(struct vb2_queue *vq) mutex_unlock(&dev->v4l2_lock); } -static struct vb2_ops rtl2832_sdr_vb2_ops = { +static const struct vb2_ops rtl2832_sdr_vb2_ops = { .queue_setup= rtl2832_sdr_queue_setup, .buf_prepare= rtl2832_sdr_buf_prepare, .buf_queue = rtl2832_sdr_buf_queue, -- 1.9.1
RE: [char-misc-next] mei: simplify error handling via devres function.
> > On Fri, Jan 20, 2017 at 7:22 PM, Tomas Winkler > wrote: > > Use devm_ and pcim_ functions to make error handling simpler and code > > smaller and tidier. > > > > Based on original patch by > > mei: me: use managed functions pcim_* and devm_* Andy Shevchenko > > > > https://lkml.org/lkml/2016/2/1/339 > > Perhaps you may leave SoB. > But let me review the code. No problem, though we also had some internal code before, you were just first to send it out ;) > > > Cc: Andy Shevchenko > > Signed-off-by: Tomas Winkler > > Signed-off-by: Alexander Usyskin > > > - * Return: The mei_device_device pointer on success, NULL on failure. > > + * Return: The mei_device pointer on success, NULL on failure. > > This is not related. > > > -struct mei_device *mei_me_dev_init(struct pci_dev *pdev, > > - const struct mei_cfg *cfg) > > +struct mei_device *devm_mei_me_init(struct pci_dev *pdev, > > + const struct mei_cfg *cfg) > > It's not exactly in devm_ namespace. (They have no corresponding > devm_*_fini, etc.) Better to leave same name in spite of calling devm_* > inside. Okay, got it. > > > -struct mei_device *mei_txe_dev_init(struct pci_dev *pdev) > > +struct mei_device *devm_mei_txe_init(struct pci_dev *pdev) > > Ditto. > > > end: > > > + pci_set_drvdata(pdev, NULL); > > Not needed. Please explain, we rely on pci_get_drvdata() returning NULL when unregistered. > > > static void mei_me_remove(struct pci_dev *pdev) { > > struct mei_device *dev; > > - struct mei_me_hw *hw; > > > > dev = pci_get_drvdata(pdev); > > if (!dev) > > @@ -276,33 +260,19 @@ static void mei_me_remove(struct pci_dev *pdev) > > if (mei_pg_is_enabled(dev)) > > pm_runtime_get_noresume(&pdev->dev); > > > + pci_set_drvdata(pdev, NULL); > > Ditto. > > > - free_irq(pdev->irq, dev); > > + devm_free_irq(&pdev->dev, pdev->irq, dev); > > pci_disable_msi(pdev); > > All three not needed I believe we need it on suspend as we are going over irq request again in resume. Please provide more info you if you still insist. > > > return 0; > > > @@ -75,22 +64,22 @@ static int mei_txe_probe(struct pci_dev *pdev, > > const struct pci_device_id *ent) { > > struct mei_device *dev; > > struct mei_txe_hw *hw; > > > + const int mask = BIT(SEC_BAR) | BIT(BRIDGE_BAR); > > First line? Please be more verbose. > > > + memcpy(hw->mem_addr, pcim_iomap_table(pdev), > > + sizeof(hw->mem_addr)); > > Why? > It is kept by PCI core, you don't need a copy. There is no simple accessor for that, it's easier to copy the two dwords then going over the function calls. > > end: > > > + pci_set_drvdata(pdev, NULL); > > Redundant. > > > static void mei_txe_remove(struct pci_dev *pdev) { > > > + pci_set_drvdata(pdev, NULL); > > Ditto. > > > @@ -256,7 +210,7 @@ static int mei_txe_pci_suspend(struct device > > *device) > > > - free_irq(pdev->irq, dev); > > + devm_free_irq(&pdev->dev, pdev->irq, dev); > > pci_disable_msi(pdev); > > All are redundant. Thanks Tomas
[PATCH] printk: use console_trylock() in console_cpu_notify()
There is no need to always call blocking console_lock() in console_cpu_notify(), it's quite possible that console_sem can be locked by other CPU on the system, either already printing or soon to begin printing the messages. console_lock() in this case can simply block CPU hotplug for unknown period of time (console_unlock() is time unbound). Not that hotplug is very fast, but still, with other CPUs being online and doing printk() console_cpu_notify() can stuck. Use console_trylock() instead and opt-out if console_sem is already acquired from another CPU, since that CPU will do the printing for us. Signed-off-by: Sergey Senozhatsky --- kernel/printk/printk.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 7180088cbb23..772eb16436ce 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -2028,15 +2028,16 @@ void resume_console(void) * @cpu: unused * * If printk() is called from a CPU that is not online yet, the messages - * will be spooled but will not show up on the console. This function is - * called when a new CPU comes online (or fails to come up), and ensures - * that any such output gets printed. + * will be printed on the console only if there are CON_ANYTIME consoles. + * This function is called when a new CPU comes online (or fails to come + * up) or goes offline. */ static int console_cpu_notify(unsigned int cpu) { if (!cpuhp_tasks_frozen) { - console_lock(); - console_unlock(); + /* If trylock fails, someone else is doing the printing */ + if (console_trylock()) + console_unlock(); } return 0; } -- 2.11.0
Re: [PATCH v7 0/5] Add platform clock for BayTrail platforms
On Sat, Jan 21, 2017 at 2:00 AM, Stephen Boyd wrote: > On 01/18, Andy Shevchenko wrote: >> On Tue, 2017-01-17 at 15:57 -0600, Pierre-Louis Bossart wrote: >> > These patches specifically enable the audio MCLK required by Baytrail >> > CR devices. It is the remaining part of a bigger set of patches >> > (already merged in Mark Brown's tree) that enable sound for Baytrail >> > CR >> > devices (especially Asus T100TAF) [1]. They include the clock driver >> > and clock enabling in the pmc_atom code (along with moving of the >> > non-architectural pmc_atom driver code into drivers/platform/x86 as >> > suggested by Thomas Gleixner [2]). This move includes a new header in >> > include/linux/platform_data/x86/. While there is an agreement that the >> > definitions for PMC clocks are not really platform data this location >> > is seen as a good-enough compromise with an agreement between Darren >> > Hart and Andy Shevchenko [3] >> > >> > [1] http://mailman.alsa-project.org/pipermail/alsa-devel/2016-August/1 >> > 11704.html >> > [2] http://mailman.alsa-project.org/pipermail/alsa-devel/2016-October/ >> > 113936.html >> > [3] http://mailman.alsa-project.org/pipermail/alsa-devel/2016-December >> > /115892.html >> > >> >> Stephen, I see no issues with the patches. If you want to push them >> through your tree, take a tag from PDx86 subsystem point of view: > > Does PDx86 == platform device x86? Yes. > I can provide a stable branch > in clk tree for platform tree, or platform x86 maintainer can ack > the platform/x86 patches and I can take the whole batch through > clk tree. That's what I did. Do you need Darren's one? >> >> Acked-by: Andy Shevchenko -- With Best Regards, Andy Shevchenko
[PATCH] mmc: core: Pass node pointer to mmc_of_parse
Extend mmc_of_parse to get the device node pointer as an additional argument instead of using the device node of the mmc device. While this has no effect for the current users it allows mmc_of_parse to be used by mmc controllers with multiple slots per device. These controllers can then pass the child node of the slot. Signed-off-by: Jan Glauber --- drivers/mmc/core/host.c| 8 +++- drivers/mmc/host/davinci_mmc.c | 2 +- drivers/mmc/host/dw_mmc.c | 2 +- drivers/mmc/host/meson-gx-mmc.c| 2 +- drivers/mmc/host/mmci.c| 2 +- drivers/mmc/host/moxart-mmc.c | 2 +- drivers/mmc/host/mtk-sd.c | 2 +- drivers/mmc/host/mvsdio.c | 2 +- drivers/mmc/host/mxcmmc.c | 2 +- drivers/mmc/host/mxs-mmc.c | 2 +- drivers/mmc/host/omap_hsmmc.c | 2 +- drivers/mmc/host/sdhci-bcm-kona.c | 2 +- drivers/mmc/host/sdhci-brcmstb.c | 2 +- drivers/mmc/host/sdhci-cadence.c | 2 +- drivers/mmc/host/sdhci-dove.c | 2 +- drivers/mmc/host/sdhci-esdhc-imx.c | 2 +- drivers/mmc/host/sdhci-iproc.c | 2 +- drivers/mmc/host/sdhci-msm.c | 2 +- drivers/mmc/host/sdhci-of-arasan.c | 2 +- drivers/mmc/host/sdhci-of-at91.c | 2 +- drivers/mmc/host/sdhci-of-esdhc.c | 2 +- drivers/mmc/host/sdhci-pic32.c | 2 +- drivers/mmc/host/sdhci-pxav3.c | 2 +- drivers/mmc/host/sdhci-s3c.c | 2 +- drivers/mmc/host/sdhci-st.c| 2 +- drivers/mmc/host/sdhci-tegra.c | 2 +- drivers/mmc/host/sdhci_f_sdh30.c | 2 +- drivers/mmc/host/sh_mmcif.c| 2 +- drivers/mmc/host/sunxi-mmc.c | 2 +- drivers/mmc/host/tmio_mmc_pio.c| 2 +- drivers/mmc/host/usdhi6rol0.c | 2 +- include/linux/mmc/host.h | 2 +- 32 files changed, 34 insertions(+), 36 deletions(-) diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c index 98f25ff..444faac 100644 --- a/drivers/mmc/core/host.c +++ b/drivers/mmc/core/host.c @@ -171,25 +171,23 @@ static void mmc_retune_timer(unsigned long data) /** * mmc_of_parse() - parse host's device-tree node * @host: host whose node should be parsed. + * @np: node that should be parsed. * * To keep the rest of the MMC subsystem unaware of whether DT has been * used to to instantiate and configure this host instance or not, we * parse the properties and set respective generic mmc-host flags and * parameters. */ -int mmc_of_parse(struct mmc_host *host) +int mmc_of_parse(struct mmc_host *host, struct device_node *np) { - struct device_node *np; u32 bus_width; int ret; bool cd_cap_invert, cd_gpio_invert = false; bool ro_cap_invert, ro_gpio_invert = false; - if (!host->parent || !host->parent->of_node) + if (!np) return 0; - np = host->parent->of_node; - /* "bus-width" is translated to MMC_CAP_*_BIT_DATA flags */ if (of_property_read_u32(np, "bus-width", &bus_width) < 0) { dev_dbg(host->parent, diff --git a/drivers/mmc/host/davinci_mmc.c b/drivers/mmc/host/davinci_mmc.c index 36b5af8..1ce9375 100644 --- a/drivers/mmc/host/davinci_mmc.c +++ b/drivers/mmc/host/davinci_mmc.c @@ -1257,7 +1257,7 @@ static int __init davinci_mmcsd_probe(struct platform_device *pdev) match = of_match_device(davinci_mmc_dt_ids, &pdev->dev); if (match) { pdev->id_entry = match->data; - ret = mmc_of_parse(mmc); + ret = mmc_of_parse(mmc, pdev->dev.of_node); if (ret) { dev_err(&pdev->dev, "could not parse of data: %d\n", ret); diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index b44306b..0f1 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -2673,7 +2673,7 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id) if (host->pdata->caps2) mmc->caps2 = host->pdata->caps2; - ret = mmc_of_parse(mmc); + ret = mmc_of_parse(mmc, host->dev->of_node); if (ret) goto err_host_allocated; diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c index 0973935..2cfb959 100644 --- a/drivers/mmc/host/meson-gx-mmc.c +++ b/drivers/mmc/host/meson-gx-mmc.c @@ -740,7 +740,7 @@ static int meson_mmc_probe(struct platform_device *pdev) if (ret == -EPROBE_DEFER) goto free_host; - ret = mmc_of_parse(mmc); + ret = mmc_of_parse(mmc, pdev->dev.of_node); if (ret) { dev_warn(&pdev->dev, "error parsing DT: %d\n", ret); goto free_host; diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 01a8047..36bb957 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -1505,7 +1505,7 @@ static struct mmc_host_ops mmci_ops = { static int mmci_of_parse(struct device_node *np, struct mmc_host *mmc) { struct mmci_host *host = mmc_priv(mmc
[PATCH 2/4] PCI: Xilinx NWL: Modifying irq chip for legacy interrupts
- Few wifi end points which only support legacy interrupts, performs hardware reset functionalities after disabling interrupts by invoking disable_irq and then re-enable using enable_irq, they enable hardware interrupts first and then virtual irq line later. - The legacy irq line goes low only after DEASSERT_INTx is received.As the legacy irq line is high immediately after hardware interrupts are enabled but virq of EP is still in disabled state and EP handler is never executed resulting no DEASSERT_INTx.If dummy irq chip is used, interrutps are not masked and system is hanging with CPU stall. - Adding irq chip functions instead of dummy irq chip for legacy interrupts. Signed-off-by: Bharat Kumar Gogada --- drivers/pci/host/pcie-xilinx-nwl.c | 36 +++- 1 files changed, 35 insertions(+), 1 deletions(-) diff --git a/drivers/pci/host/pcie-xilinx-nwl.c b/drivers/pci/host/pcie-xilinx-nwl.c index c8b5a33..e1809f9 100644 --- a/drivers/pci/host/pcie-xilinx-nwl.c +++ b/drivers/pci/host/pcie-xilinx-nwl.c @@ -396,10 +396,44 @@ static void nwl_pcie_msi_handler_low(struct irq_desc *desc) chained_irq_exit(chip, desc); } +static void nwl_mask_leg_irq(struct irq_data *data) +{ + struct irq_desc *desc = irq_to_desc(data->irq); + struct nwl_pcie *pcie; + unsigned int mask = 0; + + pcie = irq_desc_get_chip_data(desc); + mask = 1 << (data->hwirq - 1); + nwl_bridge_writel(pcie, ((u32)MSGF_LEG_SR_MASKALL & (~mask)), + MSGF_LEG_MASK); + +} + +static void nwl_unmask_leg_irq(struct irq_data *data) +{ + struct irq_desc *desc = irq_to_desc(data->irq); + struct nwl_pcie *pcie; + unsigned int mask = 0; + + pcie = irq_desc_get_chip_data(desc); + mask = 1 << (data->hwirq - 1); + nwl_bridge_writel(pcie, ((u32)MSGF_LEG_SR_MASKALL | mask), + MSGF_LEG_MASK); + +} + +static struct irq_chip nwl_leg_irq_chip = { + .name = "nwl_pcie:legacy", + .irq_enable = nwl_unmask_leg_irq, + .irq_disable = nwl_mask_leg_irq, + .irq_mask = nwl_mask_leg_irq, + .irq_unmask = nwl_unmask_leg_irq, +}; + static int nwl_legacy_map(struct irq_domain *domain, unsigned int irq, irq_hw_number_t hwirq) { - irq_set_chip_and_handler(irq, &dummy_irq_chip, handle_simple_irq); + irq_set_chip_and_handler(irq, &nwl_leg_irq_chip, handle_simple_irq); irq_set_chip_data(irq, domain->host_data); return 0; -- 1.7.1
[PATCH 3/4] PCI: Xilinx NWL: Modifying flow handler for legacy interrupts
Legacy interrupts are level sensitive, so using handle_level_irq is more approprate as it is masks interrupts until End point handles interrupts and unmasks interrutps after End point handler is executed. Signed-off-by: Bharat Kumar Gogada --- drivers/pci/host/pcie-xilinx-nwl.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/pci/host/pcie-xilinx-nwl.c b/drivers/pci/host/pcie-xilinx-nwl.c index e1809f9..50f9c0d 100644 --- a/drivers/pci/host/pcie-xilinx-nwl.c +++ b/drivers/pci/host/pcie-xilinx-nwl.c @@ -433,7 +433,7 @@ static void nwl_unmask_leg_irq(struct irq_data *data) static int nwl_legacy_map(struct irq_domain *domain, unsigned int irq, irq_hw_number_t hwirq) { - irq_set_chip_and_handler(irq, &nwl_leg_irq_chip, handle_simple_irq); + irq_set_chip_and_handler(irq, &nwl_leg_irq_chip, handle_level_irq); irq_set_chip_data(irq, domain->host_data); return 0; -- 1.7.1
[PATCH 4/4] PCI: Xilinx NWL: Fix, proc interrupts for legacy virtual irq shown as edge
- Legacy interrupts are level triggered, virtual irq line of End Point shows as edge. - Setting irq flags of virtual irq line of EP to level triggered at the time of mapping. Signed-off-by: Bharat Kumar Gogada --- drivers/pci/host/pcie-xilinx-nwl.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/pci/host/pcie-xilinx-nwl.c b/drivers/pci/host/pcie-xilinx-nwl.c index 50f9c0d..b7aa6f8 100644 --- a/drivers/pci/host/pcie-xilinx-nwl.c +++ b/drivers/pci/host/pcie-xilinx-nwl.c @@ -435,6 +435,7 @@ static int nwl_legacy_map(struct irq_domain *domain, unsigned int irq, { irq_set_chip_and_handler(irq, &nwl_leg_irq_chip, handle_level_irq); irq_set_chip_data(irq, domain->host_data); + irq_set_status_flags(irq, IRQ_LEVEL); return 0; } -- 1.7.1
[GIT PULL] Please pull powerpc/linux.git powerpc-4.10-2 tag
Hi Linus, Please pull the belated first batch of powerpc fixes for 4.10: The following changes since commit 49def1853334396f948dcb4cedb9347abb318df5: Linux 4.10-rc4 (2017-01-15 16:21:59 -0800) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git tags/powerpc-4.10-2 for you to fetch changes up to 178f358208ceb8b38e5cff3f815e0db4a6a70a07: powerpc: Ignore reserved field in DCSR and PVR reads and writes (2017-01-20 15:21:35 +1100) powerpc fixes for 4.10 #2 Two fixes for fallout from the hugetlb changes we merged this cycle. Ten other fixes, four only affect Power9, and the rest are a bit of a mixture though nothing terrible. Thanks to: Aneesh Kumar K.V, Anton Blanchard, Benjamin Herrenschmidt, Dave Martin, Gavin Shan, Madhavan Srinivasan, Nicholas Piggin, Reza Arbab. Aneesh Kumar K.V (2): powerpc/mm/hugetlb: Don't panic when we don't find the default huge page size powerpc/mm: Fix little-endian 4K hugetlb Anton Blanchard (1): powerpc: Ignore reserved field in DCSR and PVR reads and writes Benjamin Herrenschmidt (1): powerpc/icp-opal: Fix missing KVM case and harden replay Dave Martin (2): powerpc/ptrace: Preserve previous fprs/vsrs on short regset write powerpc/ptrace: Preserve previous TM fprs/vsrs on short regset write Gavin Shan (1): powerpc/eeh: Enable IO path on permanent error Madhavan Srinivasan (3): powerpc/perf: Fix PM_BRU_CMPL event code for power9 selftest/powerpc: Wrong PMC initialized in pmc56_overflow test powerpc/perf: Use MSR to report privilege level on P9 DD1 Nicholas Piggin (1): powerpc: Fix pgtable pmd cache init Reza Arbab (1): powerpc/mm: Fix memory hotplug BUG() on radix arch/powerpc/include/asm/book3s/64/hash-4k.h | 5 ++-- arch/powerpc/include/asm/book3s/64/hash.h | 4 +++ arch/powerpc/include/asm/hugetlb.h | 14 +- arch/powerpc/include/asm/nohash/pgtable.h | 5 ++-- arch/powerpc/include/asm/page.h| 3 --- arch/powerpc/include/asm/perf_event_server.h | 1 + arch/powerpc/include/asm/pgtable-be-types.h| 8 ++ arch/powerpc/include/asm/pgtable-types.h | 7 + arch/powerpc/include/asm/ppc-opcode.h | 10 +++ arch/powerpc/kernel/eeh.c | 10 ++- arch/powerpc/kernel/ptrace.c | 14 ++ arch/powerpc/mm/hash_utils_64.c| 4 +-- arch/powerpc/mm/hugetlbpage-hash64.c | 5 +++- arch/powerpc/mm/hugetlbpage.c | 31 +- arch/powerpc/mm/init-common.c | 13 - arch/powerpc/mm/pgtable-book3s64.c | 18 + arch/powerpc/perf/core-book3s.c| 2 ++ arch/powerpc/perf/power9-events-list.h | 2 +- arch/powerpc/perf/power9-pmu.c | 2 +- arch/powerpc/sysdev/xics/icp-opal.c| 31 +- .../powerpc/pmu/ebb/pmc56_overflow_test.c | 2 +- 21 files changed, 132 insertions(+), 59 deletions(-) signature.asc Description: PGP signature
[PATCH 1/4] PCI: Xilinx NWL: Fix, do not check for legacy status in while loop
- The legacy status register value for particular INTx becomes low only after DEASSERT_INTx is received. - Few End Points take time for sending DEASSERT_INTx, checking legacy status register in while loop causes invoking of EP handler continuosly until DEASSERT_INTx is received. Signed-off-by: Bharat Kumar Gogada --- drivers/pci/host/pcie-xilinx-nwl.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/pci/host/pcie-xilinx-nwl.c b/drivers/pci/host/pcie-xilinx-nwl.c index 43eaa4a..c8b5a33 100644 --- a/drivers/pci/host/pcie-xilinx-nwl.c +++ b/drivers/pci/host/pcie-xilinx-nwl.c @@ -342,9 +342,10 @@ static void nwl_pcie_leg_handler(struct irq_desc *desc) chained_irq_enter(chip, desc); pcie = irq_desc_get_handler_data(desc); + status = nwl_bridge_readl(pcie, MSGF_LEG_STATUS) & + MSGF_LEG_SR_MASKALL; - while ((status = nwl_bridge_readl(pcie, MSGF_LEG_STATUS) & - MSGF_LEG_SR_MASKALL) != 0) { + if (status != 0) { for_each_set_bit(bit, &status, INTX_NUM) { virq = irq_find_mapping(pcie->legacy_irq_domain, bit + 1); -- 1.7.1
Re: Regression on Dell XPS13 (was: [char-misc for 4.10-rc4 V2] mei: bus: enable OS version only for SPT and newer)
On Sat, Jan 21, 2017 at 10:11 AM, Greg KH wrote: > On Fri, Jan 20, 2017 at 11:11:45PM +, mario.limoncie...@dell.com wrote: >> Greg, >> >> > -Original Message- >> > From: Darren Hart [mailto:dvh...@infradead.org] >> > Sent: Tuesday, January 17, 2017 5:34 PM >> > To: Limonciello, Mario >> > Cc: gre...@linuxfoundation.org; rafael.j.wyso...@intel.com; >> > pmen...@molgen.mpg.de; li...@leemhuis.info; tomas.wink...@intel.com; >> > j...@gondor.com; alexander.usys...@intel.com; linux-kernel@vger.kernel.org; >> > yu.c.c...@intel.com; tomi.p.sarv...@intel.com; dan...@quora.org; >> > len.br...@intel.com; linux...@vger.kernel.org >> > Subject: Re: Regression on Dell XPS13 (was: [char-misc for 4.10-rc4 V2] >> > mei: >> > bus: enable OS version only for SPT and newer) >> > >> > On Tue, Jan 17, 2017 at 06:38:43PM +, mario.limoncie...@dell.com >> > wrote: >> > > > -Original Message- >> > > > From: Greg KH [mailto:gre...@linuxfoundation.org] >> > > > Sent: Tuesday, January 17, 2017 12:24 PM >> > > > To: Limonciello, Mario >> > > > Cc: pmen...@molgen.mpg.de; rafael.j.wyso...@intel.com; >> > > > li...@leemhuis.info; tomas.wink...@intel.com; j...@gondor.com; >> > > > alexander.usys...@intel.com; linux-kernel@vger.kernel.org; >> > > > yu.c.c...@intel.com; tomi.p.sarv...@intel.com; dan...@quora.org; >> > > > len.br...@intel.com; linux...@vger.kernel.org >> > > > Subject: Re: Regression on Dell XPS13 (was: [char-misc for 4.10-rc4 >> > > > V2] mei: >> > > > bus: enable OS version only for SPT and newer) >> > > > >> > > > On Tue, Jan 17, 2017 at 04:57:49PM +, mario.limoncie...@dell.com >> > > > wrote: >> > > > > So in the <6s scenario, the intel-hid driver is responsible to >> > > > > receive the ACPI event and process accordingly. The maintainer >> > > > > has a patch ready for the intel-hid portion of this work, but it's >> > > > > currently being reviewed by Intel to ensure it can be legally >> > > > > submitted >> > into the kernel. >> > > > >> > > > Who at Intel do I need to go kick to make this mythical legal review >> > > > happen faster so we can see the code? >> > > > >> > > > Len and Rafael, what is going on here? >> > > > >> > > >> > > Len and Darren are both in the loop on the discussion around this patch. >> > > I don't know if they'll have any (public) comments they can add on the >> > > matter yet however. >> > >> > Thanks Mario. Yes, there isn't much to say here in public other than to >> > confirm >> > we are keenly aware of the problem and have been actively working on fixing >> > it, both for this instance, and the deeper systematic failure that >> > resulted in this >> > situation. No amount of kicking will expedite the process at this point, >> > but >> > should we feel the need, we'll reach out. >> > >> >> The approval has come through and the patch has been submitted. >> http://www.spinics.net/lists/platform-driver-x86/msg10286.html > > Looks like it needs some work :) > > And why isn't it tagged to go to the 4.10-stable kernel if it really > does fix some systems? > >> Note: this is only half of the fix, the second half needs the ACPI subsystem >> to >> not be frozen to be able to receive this event. > > Where is that change? > > I'm still worried about 4.10-final, is that going to be broken for these > types of systems? Nope. I'm going to revert commit 08b98d329165 (PM / sleep / ACPI: Use the ACPI_FADT_LOW_POWER_S0 flag) which introduced the problem in the first place (yes, the bisection result it misleading). In fact, the revert is in my linux-next branch already, but I'm sort of out in the woods now and the actual pull request will be sent next week. BTW, this is a usual process. We had tried to change the default behaviour for certain class of systems and it didn't work, so we need to take a step back, fix the problems that were exposed and try again later. It has been confused quite a bit, though, which is kind of worrisome. Thanks, Rafael
[PATCH] net: broadcom: bnx2x: use new api ethtool_{get|set}_link_ksettings
The ethtool api {get|set}_settings is deprecated. We move this driver to new api {get|set}_link_ksettings. As I don't have the hardware, I'd be very pleased if someone may test this patch. Signed-off-by: Philippe Reynes --- .../net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c| 156 +++- 1 files changed, 86 insertions(+), 70 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c index 5f19427..9d02a14 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c @@ -253,128 +253,144 @@ static int bnx2x_get_vf_settings(struct net_device *dev, return 0; } -static int bnx2x_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) +static int bnx2x_get_link_ksettings(struct net_device *dev, + struct ethtool_link_ksettings *cmd) { struct bnx2x *bp = netdev_priv(dev); int cfg_idx = bnx2x_get_link_cfg_idx(bp); u32 media_type; + u32 supported, advertising, lp_advertising; + + ethtool_convert_link_mode_to_legacy_u32(&lp_advertising, + cmd->link_modes.lp_advertising); /* Dual Media boards present all available port types */ - cmd->supported = bp->port.supported[cfg_idx] | + supported = bp->port.supported[cfg_idx] | (bp->port.supported[cfg_idx ^ 1] & (SUPPORTED_TP | SUPPORTED_FIBRE)); - cmd->advertising = bp->port.advertising[cfg_idx]; + advertising = bp->port.advertising[cfg_idx]; media_type = bp->link_params.phy[bnx2x_get_cur_phy_idx(bp)].media_type; if (media_type == ETH_PHY_SFP_1G_FIBER) { - cmd->supported &= ~(SUPPORTED_1baseT_Full); - cmd->advertising &= ~(ADVERTISED_1baseT_Full); + supported &= ~(SUPPORTED_1baseT_Full); + advertising &= ~(ADVERTISED_1baseT_Full); } if ((bp->state == BNX2X_STATE_OPEN) && bp->link_vars.link_up && !(bp->flags & MF_FUNC_DIS)) { - cmd->duplex = bp->link_vars.duplex; + cmd->base.duplex = bp->link_vars.duplex; if (IS_MF(bp) && !BP_NOMCP(bp)) - ethtool_cmd_speed_set(cmd, bnx2x_get_mf_speed(bp)); + cmd->base.speed = bnx2x_get_mf_speed(bp); else - ethtool_cmd_speed_set(cmd, bp->link_vars.line_speed); + cmd->base.speed = bp->link_vars.line_speed; } else { - cmd->duplex = DUPLEX_UNKNOWN; - ethtool_cmd_speed_set(cmd, SPEED_UNKNOWN); + cmd->base.duplex = DUPLEX_UNKNOWN; + cmd->base.speed = SPEED_UNKNOWN; } - cmd->port = bnx2x_get_port_type(bp); + cmd->base.port = bnx2x_get_port_type(bp); - cmd->phy_address = bp->mdio.prtad; - cmd->transceiver = XCVR_INTERNAL; + cmd->base.phy_address = bp->mdio.prtad; if (bp->link_params.req_line_speed[cfg_idx] == SPEED_AUTO_NEG) - cmd->autoneg = AUTONEG_ENABLE; + cmd->base.autoneg = AUTONEG_ENABLE; else - cmd->autoneg = AUTONEG_DISABLE; + cmd->base.autoneg = AUTONEG_DISABLE; /* Publish LP advertised speeds and FC */ if (bp->link_vars.link_status & LINK_STATUS_AUTO_NEGOTIATE_COMPLETE) { u32 status = bp->link_vars.link_status; - cmd->lp_advertising |= ADVERTISED_Autoneg; + lp_advertising |= ADVERTISED_Autoneg; if (status & LINK_STATUS_LINK_PARTNER_SYMMETRIC_PAUSE) - cmd->lp_advertising |= ADVERTISED_Pause; + lp_advertising |= ADVERTISED_Pause; if (status & LINK_STATUS_LINK_PARTNER_ASYMMETRIC_PAUSE) - cmd->lp_advertising |= ADVERTISED_Asym_Pause; + lp_advertising |= ADVERTISED_Asym_Pause; if (status & LINK_STATUS_LINK_PARTNER_10THD_CAPABLE) - cmd->lp_advertising |= ADVERTISED_10baseT_Half; + lp_advertising |= ADVERTISED_10baseT_Half; if (status & LINK_STATUS_LINK_PARTNER_10TFD_CAPABLE) - cmd->lp_advertising |= ADVERTISED_10baseT_Full; + lp_advertising |= ADVERTISED_10baseT_Full; if (status & LINK_STATUS_LINK_PARTNER_100TXHD_CAPABLE) - cmd->lp_advertising |= ADVERTISED_100baseT_Half; + lp_advertising |= ADVERTISED_100baseT_Half; if (status & LINK_STATUS_LINK_PARTNER_100TXFD_CAPABLE) - cmd->lp_advertising |= ADVERTISED_100baseT_Full; + lp_advertising |= ADVERTISED_100baseT_Full; if (status & LINK_STATUS_LINK_PARTNER_1000THD_CAPABLE) -
Re: Loan Forms Available- Contact Us Today-
Dear Sir / Madam, Do you need a loan? Contact us today for same day approval; Blacklisted welcome. See contact details below send a mail we will contact you immediately. Send us a mail to E-mailedward.henry.garn...@gmail.com Regards Chris Vella Alexander Director Brown- Capital Funding Office: 011 025 9060
Re: [PATCH] iio: magnetometer: mag3110: claim direct mode during raw writes
On 21/01/17 09:43, Peter Meerwald-Stadler wrote: > >> Driver was checking for direct mode but not locking it. Use >> claim/release helper functions to guarantee the device stays >> in direct mode during raw writes. > > looks good, > Acked-by: Peter Meerwald-Stadler Applied to the togreg branch of iio.git - initially pushed out as testing etc.. Jonathan > >> Signed-off-by: Alison Schofield >> --- >> drivers/iio/magnetometer/mag3110.c | 30 -- >> 1 file changed, 20 insertions(+), 10 deletions(-) >> >> diff --git a/drivers/iio/magnetometer/mag3110.c >> b/drivers/iio/magnetometer/mag3110.c >> index f2b3bd7..b4f643f 100644 >> --- a/drivers/iio/magnetometer/mag3110.c >> +++ b/drivers/iio/magnetometer/mag3110.c >> @@ -222,29 +222,39 @@ static int mag3110_write_raw(struct iio_dev *indio_dev, >> int val, int val2, long mask) >> { >> struct mag3110_data *data = iio_priv(indio_dev); >> -int rate; >> +int rate, ret; >> >> -if (iio_buffer_enabled(indio_dev)) >> -return -EBUSY; >> +ret = iio_device_claim_direct_mode(indio_dev); >> +if (ret) >> +return ret; >> >> switch (mask) { >> case IIO_CHAN_INFO_SAMP_FREQ: >> rate = mag3110_get_samp_freq_index(data, val, val2); >> -if (rate < 0) >> -return -EINVAL; >> +if (rate < 0) { >> +ret = -EINVAL; >> +break; >> +} >> >> data->ctrl_reg1 &= ~MAG3110_CTRL_DR_MASK; >> data->ctrl_reg1 |= rate << MAG3110_CTRL_DR_SHIFT; >> -return i2c_smbus_write_byte_data(data->client, >> +ret = i2c_smbus_write_byte_data(data->client, >> MAG3110_CTRL_REG1, data->ctrl_reg1); >> +break; >> case IIO_CHAN_INFO_CALIBBIAS: >> -if (val < -1 || val > 1) >> -return -EINVAL; >> -return i2c_smbus_write_word_swapped(data->client, >> +if (val < -1 || val > 1) { >> +ret = -EINVAL; >> +break; >> +} >> +ret = i2c_smbus_write_word_swapped(data->client, >> MAG3110_OFF_X + 2 * chan->scan_index, val << 1); >> +break; >> default: >> -return -EINVAL; >> +ret = -EINVAL; >> +break; >> } >> +iio_device_release_direct_mode(indio_dev); >> +return ret; >> } >> >> static irqreturn_t mag3110_trigger_handler(int irq, void *p) >> >
Re: [PATCH] iio: proximity: sx9500: claim direct mode during raw proximity reads
On 21/01/17 08:49, Vlad Dogaru wrote: > On Fri, Jan 20, 2017 at 11:11 PM, Alison Schofield > wrote: >> Driver was checking for direct mode but not locking it. Use the >> claim/release helper functions to guarantee the device stays in >> direct mode during raw reads of proximity data. >> >> Signed-off-by: Alison Schofield > > Reviewed-by: Vlad Dogaru Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it. Thanks, Jonathan > >> --- >> drivers/iio/proximity/sx9500.c | 10 +++--- >> 1 file changed, 7 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/iio/proximity/sx9500.c b/drivers/iio/proximity/sx9500.c >> index 1f06282..9ea147f 100644 >> --- a/drivers/iio/proximity/sx9500.c >> +++ b/drivers/iio/proximity/sx9500.c >> @@ -387,14 +387,18 @@ static int sx9500_read_raw(struct iio_dev *indio_dev, >>int *val, int *val2, long mask) >> { >> struct sx9500_data *data = iio_priv(indio_dev); >> + int ret; >> >> switch (chan->type) { >> case IIO_PROXIMITY: >> switch (mask) { >> case IIO_CHAN_INFO_RAW: >> - if (iio_buffer_enabled(indio_dev)) >> - return -EBUSY; >> - return sx9500_read_proximity(data, chan, val); >> + ret = iio_device_claim_direct_mode(indio_dev); >> + if (ret) >> + return ret; >> + ret = sx9500_read_proximity(data, chan, val); >> + iio_device_release_direct_mode(indio_dev); >> + return ret; >> case IIO_CHAN_INFO_SAMP_FREQ: >> return sx9500_read_samp_freq(data, val, val2); >> default: >> -- >> 2.1.4 >> > -- > To unsubscribe from this list: send the line "unsubscribe linux-iio" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >
Re: [PATCH v2 0/4] fix premature OOM regression in 4.7+ due to cpuset races
On Friday, January 20, 2017 6:39 PM Vlastimil Babka wrote: > > Changes since v1: > - add/remove comments per Michal Hocko and Hillf Danton > - move no_zone: label in patch 3 so we don't miss part of ac initialization > > This is v2 of my attempt to fix the recent report based on LTP cpuset stress > test [1]. The intention is to go to stable 4.9 LTSS with this, as triggering > repeated OOMs is not nice. That's why the patches try to be not too intrusive. > > Unfortunately why investigating I found that modifying the testcase to use > per-VMA policies instead of per-task policies will bring the OOM's back, but > that seems to be much older and harder to fix problem. I have posted a RFC [2] > but I believe that fixing the recent regressions has a higher priority. > > Longer-term we might try to think how to fix the cpuset mess in a better and > less error prone way. I was for example very surprised to learn, that cpuset > updates change not only task->mems_allowed, but also nodemask of mempolicies. > Until now I expected the parameter to alloc_pages_nodemask() to be stable. > I wonder why do we then treat cpusets specially in get_page_from_freelist() > and distinguish HARDWALL etc, when there's unconditional intersection between > mempolicy and cpuset. I would expect the nodemask adjustment for saving > overhead in g_p_f(), but that clearly doesn't happen in the current form. > So we have both crazy complexity and overhead, AFAICS. > > [1] > https://lkml.kernel.org/r/CAFpQJXUq-JuEP=QPidy4p_=fn0rkh5z-kfb4qbvsf6jms87...@mail.gmail.com > [2] https://lkml.kernel.org/r/7c459f26-13a6-a817-e508-b65b903a8...@suse.cz > > Vlastimil Babka (4): > mm, page_alloc: fix check for NULL preferred_zone > mm, page_alloc: fix fast-path race with cpuset update or removal > mm, page_alloc: move cpuset seqcount checking to slowpath > mm, page_alloc: fix premature OOM when racing with cpuset mems update > > include/linux/mmzone.h | 6 - > mm/page_alloc.c| 68 > ++ > 2 files changed, 52 insertions(+), 22 deletions(-) > Acked-by: Hillf Danton
Re: [PATCH] iio: pressure: ms5611: claim direct mode during oversampling changes
On 20/01/17 20:22, Alison Schofield wrote: > Driver was checking for direct mode before changing oversampling > ratios, but was not locking it. Use the claim/release helper > functions to guarantee the device stays in direct mode while the > oversampling ratios are being updated. Continue to use the drivers > private state lock to protect against conflicting direct mode access > of the state data. > > Signed-off-by: Alison Schofield I think this one is straight forward enough that I'm happy to take it without confirmation from Thomaz. Anyone feel free to shout if I am missing something. Thanks, Jonathan > --- > drivers/iio/pressure/ms5611_core.c | 12 +++- > 1 file changed, 7 insertions(+), 5 deletions(-) > > diff --git a/drivers/iio/pressure/ms5611_core.c > b/drivers/iio/pressure/ms5611_core.c > index 6bd53e7..2a77a2f 100644 > --- a/drivers/iio/pressure/ms5611_core.c > +++ b/drivers/iio/pressure/ms5611_core.c > @@ -308,6 +308,7 @@ static int ms5611_write_raw(struct iio_dev *indio_dev, > { > struct ms5611_state *st = iio_priv(indio_dev); > const struct ms5611_osr *osr = NULL; > + int ret; > > if (mask != IIO_CHAN_INFO_OVERSAMPLING_RATIO) > return -EINVAL; > @@ -321,12 +322,11 @@ static int ms5611_write_raw(struct iio_dev *indio_dev, > if (!osr) > return -EINVAL; > > - mutex_lock(&st->lock); > + ret = iio_device_claim_direct_mode(indio_dev); > + if (ret) > + return ret; > > - if (iio_buffer_enabled(indio_dev)) { > - mutex_unlock(&st->lock); > - return -EBUSY; > - } > + mutex_lock(&st->lock); > > if (chan->type == IIO_TEMP) > st->temp_osr = osr; > @@ -334,6 +334,8 @@ static int ms5611_write_raw(struct iio_dev *indio_dev, > st->pressure_osr = osr; > > mutex_unlock(&st->lock); > + iio_device_release_direct_mode(indio_dev); > + > return 0; > } > >
Re: [PATCH] iio: accel: st_accel: add !SENSORS_LIS3LV02D depedency
On 20/01/17 16:25, Arnd Bergmann wrote: > warning: (IIO_ST_ACCEL_3AXIS) selects IIO_ST_ACCEL_SPI_3AXIS which has unmet > direct dependencies (IIO && !SENSORS_LIS3_SPI && IIO_ST_ACCEL_3AXIS && > IIO_ST_SENSORS_SPI) > > Fixes: 762227721fe6 ("iio: accel: st_accel: handle deprecated bindings") > Signed-off-by: Arnd Bergmann At least at first glance, this is a different approach to fixing the issue from the one Linus took. I think that one has already been picked up by Greg (or will be shortly). Linus, please confirm this is the same issue. thanks, Jonathan > --- > drivers/iio/accel/Kconfig | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/iio/accel/Kconfig b/drivers/iio/accel/Kconfig > index ea295fe0f561..590ba8835fdc 100644 > --- a/drivers/iio/accel/Kconfig > +++ b/drivers/iio/accel/Kconfig > @@ -120,6 +120,7 @@ config HID_SENSOR_ACCEL_3D > config IIO_ST_ACCEL_3AXIS > tristate "STMicroelectronics accelerometers 3-Axis Driver" > depends on (I2C || SPI_MASTER) && SYSFS > + depends on !SENSORS_LIS3LV02D > select IIO_ST_SENSORS_CORE > select IIO_ST_ACCEL_I2C_3AXIS if (I2C) > select IIO_ST_ACCEL_SPI_3AXIS if (SPI_MASTER) >
Re: [PATCH] iio: light: cm3605: mark PM functions as __maybe_unused
On 20/01/17 16:25, Arnd Bergmann wrote: > When CONFIG_PM_SLEEP is disabled, we get a harmless warning > > drivers/iio/light/cm3605.c:292:12: error: 'cm3605_pm_resume' defined but not > used [-Werror=unused-function] > drivers/iio/light/cm3605.c:281:12: error: 'cm3605_pm_suspend' defined but not > used [-Werror=unused-function] > > Marking the functions as possibly unused avoids the warning without > needing to add an #ifdef. > > Fixes: 8afa505c1230 ("iio: light: add driver for Capella CM3605") > Signed-off-by: Arnd Bergmann Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it. Thanks, Jonathan > --- > drivers/iio/light/cm3605.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/iio/light/cm3605.c b/drivers/iio/light/cm3605.c > index 2d96543db1ef..980624e9ffb5 100644 > --- a/drivers/iio/light/cm3605.c > +++ b/drivers/iio/light/cm3605.c > @@ -278,7 +278,7 @@ static int cm3605_remove(struct platform_device *pdev) > return 0; > } > > -static int cm3605_pm_suspend(struct device *dev) > +static int __maybe_unused cm3605_pm_suspend(struct device *dev) > { > struct iio_dev *indio_dev = dev_get_drvdata(dev); > struct cm3605 *cm3605 = iio_priv(indio_dev); > @@ -289,7 +289,7 @@ static int cm3605_pm_suspend(struct device *dev) > return 0; > } > > -static int cm3605_pm_resume(struct device *dev) > +static int __maybe_unused cm3605_pm_resume(struct device *dev) > { > struct iio_dev *indio_dev = dev_get_drvdata(dev); > struct cm3605 *cm3605 = iio_priv(indio_dev); >
Re: [PATCH 2/7] iio: adc: stm32: Enable use of stm32 timer triggers
On 19/01/17 23:31, kbuild test robot wrote: > Hi Fabrice, > > [auto build test ERROR on next-20170119] > [also build test ERROR on v4.10-rc4] > [cannot apply to iio/togreg robh/for-next v4.9-rc8 v4.9-rc7 v4.9-rc6] > [if your patch is applied to the wrong git tree, please drop us a note to > help improve the system] > > url: > https://github.com/0day-ci/linux/commits/Fabrice-Gasnier/Add-support-for-triggered-buffer-mode-to-STM32-ADC/20170120-062214 > config: i386-allmodconfig (attached as .config) > compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 > reproduce: > # save the attached .config to linux build tree > make ARCH=i386 There is a precursor patch set mentioned in the cover letter. Not sure there is a sensible automated way to deal with that! Jonathan > > All errors (new ones prefixed by >>): > >>> drivers/iio/adc/stm32-adc.c:26:49: fatal error: >>> linux/iio/timer/stm32-timer-trigger.h: No such file or directory > #include > ^ >compilation terminated. > > vim +26 drivers/iio/adc/stm32-adc.c > > 20 */ > 21 > 22#include > 23#include > 24#include > 25#include > > 26#include > 27#include > 28#include > 29#include > > --- > 0-DAY kernel test infrastructureOpen Source Technology Center > https://lists.01.org/pipermail/kbuild-all Intel Corporation >
[for-next][PATCH 0/3] tracing: More updates for 4.11
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git for-next Head SHA1: b9b0c831bed2682c2e3e9f5420fb6985549ef020 Namhyung Kim (3): ftrace: Factor out __ftrace_hash_move() ftrace: Expose ftrace_hash_empty and ftrace_lookup_ip ftrace: Convert graph filter to use hash tables kernel/trace/ftrace.c | 244 +++--- kernel/trace/trace.h | 80 ++--- 2 files changed, 198 insertions(+), 126 deletions(-)
[for-next][PATCH 1/3] ftrace: Factor out __ftrace_hash_move()
From: Namhyung Kim The __ftrace_hash_move() is to allocates properly-sized hash and move entries in the src ftrace_hash. It will be used to set function graph filters which has nothing to do with the dyn_ftrace records. Link: http://lkml.kernel.org/r/20170120024447.26097-1-namhy...@kernel.org Signed-off-by: Namhyung Kim Signed-off-by: Steven Rostedt (VMware) --- kernel/trace/ftrace.c | 40 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index eb230f06ba41..37b0e948d924 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -1383,9 +1383,8 @@ ftrace_hash_rec_enable_modify(struct ftrace_ops *ops, int filter_hash); static int ftrace_hash_ipmodify_update(struct ftrace_ops *ops, struct ftrace_hash *new_hash); -static int -ftrace_hash_move(struct ftrace_ops *ops, int enable, -struct ftrace_hash **dst, struct ftrace_hash *src) +static struct ftrace_hash * +__ftrace_hash_move(struct ftrace_hash *src) { struct ftrace_func_entry *entry; struct hlist_node *tn; @@ -1393,21 +1392,13 @@ ftrace_hash_move(struct ftrace_ops *ops, int enable, struct ftrace_hash *new_hash; int size = src->count; int bits = 0; - int ret; int i; - /* Reject setting notrace hash on IPMODIFY ftrace_ops */ - if (ops->flags & FTRACE_OPS_FL_IPMODIFY && !enable) - return -EINVAL; - /* -* If the new source is empty, just free dst and assign it -* the empty_hash. +* If the new source is empty, just return the empty_hash. */ - if (!src->count) { - new_hash = EMPTY_HASH; - goto update; - } + if (!src->count) + return EMPTY_HASH; /* * Make the hash size about 1/2 the # found @@ -1421,7 +1412,7 @@ ftrace_hash_move(struct ftrace_ops *ops, int enable, new_hash = alloc_ftrace_hash(bits); if (!new_hash) - return -ENOMEM; + return NULL; size = 1 << src->size_bits; for (i = 0; i < size; i++) { @@ -1432,7 +1423,24 @@ ftrace_hash_move(struct ftrace_ops *ops, int enable, } } -update: + return new_hash; +} + +static int +ftrace_hash_move(struct ftrace_ops *ops, int enable, +struct ftrace_hash **dst, struct ftrace_hash *src) +{ + struct ftrace_hash *new_hash; + int ret; + + /* Reject setting notrace hash on IPMODIFY ftrace_ops */ + if (ops->flags & FTRACE_OPS_FL_IPMODIFY && !enable) + return -EINVAL; + + new_hash = __ftrace_hash_move(src); + if (!new_hash) + return -ENOMEM; + /* Make sure this can be applied if it is IPMODIFY ftrace_ops */ if (enable) { /* IPMODIFY should be updated only when filter_hash updating */ -- 2.10.2
[for-next][PATCH 2/3] ftrace: Expose ftrace_hash_empty and ftrace_lookup_ip
From: Namhyung Kim It will be used when checking graph filter hashes later. Link: http://lkml.kernel.org/r/20170120024447.26097-2-namhy...@kernel.org Signed-off-by: Namhyung Kim [ Moved ftrace_hash dec and functions outside of FUNCTION_GRAPH define ] Signed-off-by: Steven Rostedt (VMware) --- kernel/trace/ftrace.c | 14 +- kernel/trace/trace.h | 16 +++- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 37b0e948d924..0470e373b9b4 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -1110,13 +1110,6 @@ struct ftrace_func_entry { unsigned long ip; }; -struct ftrace_hash { - unsigned long size_bits; - struct hlist_head *buckets; - unsigned long count; - struct rcu_head rcu; -}; - /* * We make these constant because no one should touch them, * but they are used as the default "empty hash", to avoid allocating @@ -1192,12 +1185,7 @@ struct ftrace_page { static struct ftrace_page *ftrace_pages_start; static struct ftrace_page *ftrace_pages; -static bool __always_inline ftrace_hash_empty(struct ftrace_hash *hash) -{ - return !hash || !hash->count; -} - -static struct ftrace_func_entry * +struct ftrace_func_entry * ftrace_lookup_ip(struct ftrace_hash *hash, unsigned long ip) { unsigned long key; diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index 1ea51ab53edf..9001460291bb 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h @@ -753,6 +753,21 @@ enum print_line_t print_trace_line(struct trace_iterator *iter); extern char trace_find_mark(unsigned long long duration); +struct ftrace_hash { + unsigned long size_bits; + struct hlist_head *buckets; + unsigned long count; + struct rcu_head rcu; +}; + +struct ftrace_func_entry * +ftrace_lookup_ip(struct ftrace_hash *hash, unsigned long ip); + +static bool __always_inline ftrace_hash_empty(struct ftrace_hash *hash) +{ + return !hash || !hash->count; +} + /* Standard output formatting function used for function return traces */ #ifdef CONFIG_FUNCTION_GRAPH_TRACER @@ -787,7 +802,6 @@ extern void __trace_graph_return(struct trace_array *tr, struct ftrace_graph_ret *trace, unsigned long flags, int pc); - #ifdef CONFIG_DYNAMIC_FTRACE /* TODO: make this variable */ #define FTRACE_GRAPH_MAX_FUNCS 32 -- 2.10.2
[for-next][PATCH 3/3] ftrace: Convert graph filter to use hash tables
From: Namhyung Kim Use ftrace_hash instead of a static array of a fixed size. This is useful when a graph filter pattern matches to a large number of functions. Now hash lookup is done with preemption disabled to protect from the hash being changed/freed. Link: http://lkml.kernel.org/r/20170120024447.26097-3-namhy...@kernel.org Signed-off-by: Namhyung Kim Signed-off-by: Steven Rostedt (VMware) --- kernel/trace/ftrace.c | 190 +- kernel/trace/trace.h | 64 - 2 files changed, 158 insertions(+), 96 deletions(-) diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 0470e373b9b4..2d554a02241d 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -4378,7 +4378,7 @@ __setup("ftrace_filter=", set_ftrace_filter); #ifdef CONFIG_FUNCTION_GRAPH_TRACER static char ftrace_graph_buf[FTRACE_FILTER_SIZE] __initdata; static char ftrace_graph_notrace_buf[FTRACE_FILTER_SIZE] __initdata; -static int ftrace_set_func(unsigned long *array, int *idx, int size, char *buffer); +static int ftrace_graph_set_hash(struct ftrace_hash *hash, char *buffer); static unsigned long save_global_trampoline; static unsigned long save_global_flags; @@ -4401,18 +4401,17 @@ static void __init set_ftrace_early_graph(char *buf, int enable) { int ret; char *func; - unsigned long *table = ftrace_graph_funcs; - int *count = &ftrace_graph_count; + struct ftrace_hash *hash; - if (!enable) { - table = ftrace_graph_notrace_funcs; - count = &ftrace_graph_notrace_count; - } + if (enable) + hash = ftrace_graph_hash; + else + hash = ftrace_graph_notrace_hash; while (buf) { func = strsep(&buf, ","); /* we allow only one expression at a time */ - ret = ftrace_set_func(table, count, FTRACE_GRAPH_MAX_FUNCS, func); + ret = ftrace_graph_set_hash(hash, func); if (ret) printk(KERN_DEBUG "ftrace: function %s not " "traceable\n", func); @@ -4536,15 +4535,20 @@ static const struct file_operations ftrace_notrace_fops = { static DEFINE_MUTEX(graph_lock); -int ftrace_graph_count; -int ftrace_graph_notrace_count; -unsigned long ftrace_graph_funcs[FTRACE_GRAPH_MAX_FUNCS] __read_mostly; -unsigned long ftrace_graph_notrace_funcs[FTRACE_GRAPH_MAX_FUNCS] __read_mostly; +struct ftrace_hash *ftrace_graph_hash = EMPTY_HASH; +struct ftrace_hash *ftrace_graph_notrace_hash = EMPTY_HASH; + +enum graph_filter_type { + GRAPH_FILTER_NOTRACE= 0, + GRAPH_FILTER_FUNCTION, +}; struct ftrace_graph_data { - unsigned long *table; - size_t size; - int *count; + struct ftrace_hash *hash; + struct ftrace_func_entry *entry; + int idx; /* for hash table iteration */ + enum graph_filter_type type; + struct ftrace_hash *new_hash; const struct seq_operations *seq_ops; }; @@ -4552,10 +4556,31 @@ static void * __g_next(struct seq_file *m, loff_t *pos) { struct ftrace_graph_data *fgd = m->private; + struct ftrace_func_entry *entry = fgd->entry; + struct hlist_head *head; + int i, idx = fgd->idx; - if (*pos >= *fgd->count) + if (*pos >= fgd->hash->count) return NULL; - return &fgd->table[*pos]; + + if (entry) { + hlist_for_each_entry_continue(entry, hlist) { + fgd->entry = entry; + return entry; + } + + idx++; + } + + for (i = idx; i < 1 << fgd->hash->size_bits; i++) { + head = &fgd->hash->buckets[i]; + hlist_for_each_entry(entry, head, hlist) { + fgd->entry = entry; + fgd->idx = i; + return entry; + } + } + return NULL; } static void * @@ -4572,9 +4597,11 @@ static void *g_start(struct seq_file *m, loff_t *pos) mutex_lock(&graph_lock); /* Nothing, tell g_show to print all functions are enabled */ - if (!*fgd->count && !*pos) + if (ftrace_hash_empty(fgd->hash) && !*pos) return (void *)1; + fgd->idx = 0; + fgd->entry = NULL; return __g_next(m, pos); } @@ -4585,22 +4612,22 @@ static void g_stop(struct seq_file *m, void *p) static int g_show(struct seq_file *m, void *v) { - unsigned long *ptr = v; + struct ftrace_func_entry *entry = v; - if (!ptr) + if (!entry) return 0; - if (ptr == (unsigned long *)1) { + if (entry == (void *)1) { struct ftrace_graph_data *fgd = m->private; - if (fgd->table == ftrace_graph_funcs) + if (fgd->type == GRAPH_FILTER_FUNCTION) seq_puts(m, "
Re: [PATCH] iio: bmi160: use variable names for sizeof() operator
On 16/01/17 05:01, Alison Schofield wrote: > Replace the types with the actual variable names when using the > sizeof() operator. This is kernel preferred style as it protects > against future changes to variable type. > > Signed-off-by: Alison Schofield Sensible change from an obviously correct stand point. Future changes to the type are a non starter here given this is a feature of the hardware! I've dropped that bit of the commit message and added something about readability. Jonathan > --- > drivers/iio/imu/bmi160/bmi160_core.c | 8 > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/iio/imu/bmi160/bmi160_core.c > b/drivers/iio/imu/bmi160/bmi160_core.c > index 5355507..1e7c88b 100644 > --- a/drivers/iio/imu/bmi160/bmi160_core.c > +++ b/drivers/iio/imu/bmi160/bmi160_core.c > @@ -338,9 +338,9 @@ static int bmi160_get_data(struct bmi160_data *data, int > chan_type, > __le16 sample; > enum bmi160_sensor_type t = bmi160_to_sensor(chan_type); > > - reg = bmi160_regs[t].data + (axis - IIO_MOD_X) * sizeof(__le16); > + reg = bmi160_regs[t].data + (axis - IIO_MOD_X) * sizeof(sample); > > - ret = regmap_bulk_read(data->regmap, reg, &sample, sizeof(__le16)); > + ret = regmap_bulk_read(data->regmap, reg, &sample, sizeof(sample)); > if (ret < 0) > return ret; > > @@ -405,8 +405,8 @@ static irqreturn_t bmi160_trigger_handler(int irq, void > *p) > > for_each_set_bit(i, indio_dev->active_scan_mask, >indio_dev->masklength) { > - ret = regmap_bulk_read(data->regmap, base + i * sizeof(__le16), > -&sample, sizeof(__le16)); > + ret = regmap_bulk_read(data->regmap, base + i * sizeof(sample), > +&sample, sizeof(sample)); > if (ret < 0) > goto done; > buf[j++] = sample; >
Re: [PATCH v9 0/8] drivers: touchscreen: tsc2007 and ads7846/tsc2046 improvements (use common touchscreen bindings, pre-calibration, spi fix and provide iio raw values)
On 16/01/17 06:34, H. Nikolaus Schaller wrote: > ping Always good to say who you are pinging ;) Saves the rest of us wondering if we have missing something we should have reviewed. Guessing it's Dmitry in this case! Jonathan > >> Am 28.12.2016 um 15:53 schrieb H. Nikolaus Schaller : >> >> Changes V9: >> * added explicit CONFIG for TSC2007_IIO and simplified Makefile (suggested >> by Dmitry Torokhov ) >> * make the tsc2007 iio patch the last one in this sequence >> >> 2016-11-22 15:02:42: Changes V8: >> * fix compilation for CONFIG_IIO=m (reported by Jonathan Cameron >> ) >> * add some more Reviewed-by: and Acked-by: >> * mutiple improvements suggested by Dmitry Torokhov >> : >> ** drop patch "send pendown and penup only once" (input core does take care >> of it now) >> ** remove not necessary EXPORT_SYMBOL >> ** remove explicit file names from comment header >> ** move tsc2007_iio_configure() to the end of the probe process and simplify >> the error path again >> ** remove unnecessary input_unregister_device() >> ** improvement for compilation with CONFIG_IIO=m and CONFIG_TSC2007=y >> >> 2016-11-11 20:02:11: Changes V7: >> * rearranged the include files (asked for by Jonathan Cameron >> ) >> * forward reference struct iio_dev * instead of condition in tsc2007.h >> (asked for by Jonathan Cameron ) >> * add some Acked-by: >> >> 2016-10-27 10:44:29: Changes V6: >> * iio patch (no changes elsewhere) >> - tsc2007_iio: fix a missing return 0 for non-iio case (found by kbuid >> test robot) >> - tsc2007_core: group error return paths so that >> tsc2007_iio_unconfigure is called at only one place >> - tsc2007_iio: fix copyright (this file is 100% original work) >> >> 2016-10-25 21:26:46: Changes V5: >> * ads7846: remove an empty line (suggested by Andrew F. Davis ) >> * ads7846: remove MODULE_ALIAS for SPI (suggested by Andrew F. Davis >> ) >> * tsc2007: fix a bug from swapping patch 3/n and patch 4/n (found by kbuild >> test robot) >> * refactored tsc2007 into tsc2007_core and tsc2007_iio (asked for by >> Jonathan Cameron ) >> >> 2016-10-17 16:00:02: Changes V4: >> * fix a merge/squash issue resulting in a non-bisectable patch set >> (suggested by kbuid test robot) >> * remove some unnecessary #include (suggested by Jonathan Cameron >> ) >> * make the iio extension depend on CONFIG_IIO rather than selecting it >> (suggested by Jonathan Cameron ) >> * swapped patch 3/n and patch 4/n to remove internal dependency >> >> 2016-09-23 14:41:23: Changes V3: >> * fix an issue with swapping >> * remove hard clipping to min/max rectangle - some systems expect to handle >> negative coordinates >> * make use of commit ed7c9870c9bc ("Input: of_touchscreen - add support for >> inverted / swapped axes") >> >> 2015-11-13 21:36:07: Changes V2: >> * add a patch to make drivers still recognise the old "ti,swap-xy" property >> (suggested by Rob Herring) >> >> 2015-11-06 16:14:53: V1: This patch series improves the drivers for the >> tsc2007 and >> ads7846/tsc2046 touchscreen controllers which are e.g. used by the GTA04 >> OpenPandora and Pyra devices. >> >> New common bindings have been defined by >> commit b98abe52fa8e ("Input: add common DT binding for touchscreens"): >> >> Documentation/devicetree/bindings/input/touchscreen/touchscreen.txt >> >> which also defines a helper function to parse the DT. These new parameters >> allow to specify the fuzz factors (jitter suppression), inversion of x or y >> axis and >> swapping of x and y to achieve inversion and rotation so that the touch >> coordinate axes match the natural orientation of the display panel. >> >> Another improvement is to better use the min/max ADC values and >> scale to the screen size as defined by the DT. This allows to coarsely >> calibrate the touch to match the LCD to which it is glued on so that the >> touch can quite precisely be operated before any user-space fine-calibration >> can be (and needs to be) started. >> >> For the adc7846 we fix an issue with the spi module table. >> >> Finally we add an iio interface for the AUX and temperature ADC channels of >> the tsc2007 and also provide the touch screen raw values. This allows to read >> an optional ambient light sensor installed on the gta04 board and improves >> calibration and hardware monitoring. >> >> >> H. Nikolaus Schaller (8): >> drivers:input:tsc2007: add new common binding names, pre-calibration, >>flipping and rotation >> drivers:input:tsc2007: check for presence and power down tsc2007 >>during probe >> DT:omap3+tsc2007: use new common touchscreen bindings >> drivers:input:ads7846(+tsc2046): add new common binding names, >>pre-calibration and flipping >> dt-bindings: input: move ads7846 bindings to touchscreen subdirectory >> drivers:input:ads7846(+tsc2046): fix spi module table >> DT:omap3+ads7846: use new common touchscreen bindings >> drivers:input:tsc2007: add iio interface to read external ADC input >>and temperature >> >> .../
Re: [PATCH] iio: health: afe4403: retrieve a valid iio_dev in suspend/resume
On 16/01/17 16:38, Andrew F. Davis wrote: > On 01/14/2017 09:51 PM, Alison Schofield wrote: >> The suspend/resume functions were using dev_to_iio_dev() to get >> the iio_dev. That only works on IIO dev's. Replace it with spi >> functions to get the correct iio_dev. >> >> Signed-off-by: Alison Schofield > > Was this found with an automated tool? If not, it might be nice to have > a Coccinelle style check for this. Anyway for this and the afe4404 > version patch: > > Acked-by: Andrew F. Davis Applied to the fixes-togreg branch of iio.git. Thanks, Jonathan > >> --- >> drivers/iio/health/afe4403.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/iio/health/afe4403.c b/drivers/iio/health/afe4403.c >> index 9a08146..6bb23a4 100644 >> --- a/drivers/iio/health/afe4403.c >> +++ b/drivers/iio/health/afe4403.c >> @@ -422,7 +422,7 @@ MODULE_DEVICE_TABLE(of, afe4403_of_match); >> >> static int __maybe_unused afe4403_suspend(struct device *dev) >> { >> -struct iio_dev *indio_dev = dev_to_iio_dev(dev); >> +struct iio_dev *indio_dev = spi_get_drvdata(to_spi_device(dev)); >> struct afe4403_data *afe = iio_priv(indio_dev); >> int ret; >> >> @@ -443,7 +443,7 @@ static int __maybe_unused afe4403_suspend(struct device >> *dev) >> >> static int __maybe_unused afe4403_resume(struct device *dev) >> { >> -struct iio_dev *indio_dev = dev_to_iio_dev(dev); >> +struct iio_dev *indio_dev = spi_get_drvdata(to_spi_device(dev)); >> struct afe4403_data *afe = iio_priv(indio_dev); >> int ret; >> >> > -- > To unsubscribe from this list: send the line "unsubscribe linux-iio" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >
Re: [PATCH] iio: health: afe4404: retrieve a valid iio_dev in suspend/resume
On 15/01/17 03:52, Alison Schofield wrote: > The suspend/resume functions were using dev_to_iio_dev() to get > the iio_dev. That only works on IIO dev's. Replace it with i2c > functions to get the correct iio_dev. > > Signed-off-by: Alison Schofield Applied with Andrew's Ack. > --- > drivers/iio/health/afe4404.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/iio/health/afe4404.c b/drivers/iio/health/afe4404.c > index 4526640..964f523 100644 > --- a/drivers/iio/health/afe4404.c > +++ b/drivers/iio/health/afe4404.c > @@ -428,7 +428,7 @@ MODULE_DEVICE_TABLE(of, afe4404_of_match); > > static int __maybe_unused afe4404_suspend(struct device *dev) > { > - struct iio_dev *indio_dev = dev_to_iio_dev(dev); > + struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev)); > struct afe4404_data *afe = iio_priv(indio_dev); > int ret; > > @@ -449,7 +449,7 @@ static int __maybe_unused afe4404_suspend(struct device > *dev) > > static int __maybe_unused afe4404_resume(struct device *dev) > { > - struct iio_dev *indio_dev = dev_to_iio_dev(dev); > + struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev)); > struct afe4404_data *afe = iio_priv(indio_dev); > int ret; > >
Re: [PATCH v9 0/8] drivers: touchscreen: tsc2007 and ads7846/tsc2046 improvements (use common touchscreen bindings, pre-calibration, spi fix and provide iio raw values)
> Am 21.01.2017 um 14:08 schrieb Jonathan Cameron : > > On 16/01/17 06:34, H. Nikolaus Schaller wrote: >> ping > Always good to say who you are pinging ;) default = Maintainer Only he/she can finally accept a patch series so I assume he has to take action if there are no more things to debate. > Saves the rest of us wondering > if we have missing something we should have reviewed. > > Guessing it's Dmitry in this case! Yes, you are right. Since there have not been any more comments for a while, I formally ask to add this to some tree so that it appears in linux-next for further tests. BR and thanks, Nikolaus > > Jonathan >> >>> Am 28.12.2016 um 15:53 schrieb H. Nikolaus Schaller : >>> >>> Changes V9: >>> * added explicit CONFIG for TSC2007_IIO and simplified Makefile (suggested >>> by Dmitry Torokhov ) >>> * make the tsc2007 iio patch the last one in this sequence >>> >>> 2016-11-22 15:02:42: Changes V8: >>> * fix compilation for CONFIG_IIO=m (reported by Jonathan Cameron >>> ) >>> * add some more Reviewed-by: and Acked-by: >>> * mutiple improvements suggested by Dmitry Torokhov >>> : >>> ** drop patch "send pendown and penup only once" (input core does take care >>> of it now) >>> ** remove not necessary EXPORT_SYMBOL >>> ** remove explicit file names from comment header >>> ** move tsc2007_iio_configure() to the end of the probe process and >>> simplify the error path again >>> ** remove unnecessary input_unregister_device() >>> ** improvement for compilation with CONFIG_IIO=m and CONFIG_TSC2007=y >>> >>> 2016-11-11 20:02:11: Changes V7: >>> * rearranged the include files (asked for by Jonathan Cameron >>> ) >>> * forward reference struct iio_dev * instead of condition in tsc2007.h >>> (asked for by Jonathan Cameron ) >>> * add some Acked-by: >>> >>> 2016-10-27 10:44:29: Changes V6: >>> * iio patch (no changes elsewhere) >>> - tsc2007_iio: fix a missing return 0 for non-iio case (found by kbuid >>> test robot) >>> - tsc2007_core: group error return paths so that >>> tsc2007_iio_unconfigure is called at only one place >>> - tsc2007_iio: fix copyright (this file is 100% original work) >>> >>> 2016-10-25 21:26:46: Changes V5: >>> * ads7846: remove an empty line (suggested by Andrew F. Davis ) >>> * ads7846: remove MODULE_ALIAS for SPI (suggested by Andrew F. Davis >>> ) >>> * tsc2007: fix a bug from swapping patch 3/n and patch 4/n (found by kbuild >>> test robot) >>> * refactored tsc2007 into tsc2007_core and tsc2007_iio (asked for by >>> Jonathan Cameron ) >>> >>> 2016-10-17 16:00:02: Changes V4: >>> * fix a merge/squash issue resulting in a non-bisectable patch set >>> (suggested by kbuid test robot) >>> * remove some unnecessary #include (suggested by Jonathan Cameron >>> ) >>> * make the iio extension depend on CONFIG_IIO rather than selecting it >>> (suggested by Jonathan Cameron ) >>> * swapped patch 3/n and patch 4/n to remove internal dependency >>> >>> 2016-09-23 14:41:23: Changes V3: >>> * fix an issue with swapping >>> * remove hard clipping to min/max rectangle - some systems expect to handle >>> negative coordinates >>> * make use of commit ed7c9870c9bc ("Input: of_touchscreen - add support for >>> inverted / swapped axes") >>> >>> 2015-11-13 21:36:07: Changes V2: >>> * add a patch to make drivers still recognise the old "ti,swap-xy" property >>> (suggested by Rob Herring) >>> >>> 2015-11-06 16:14:53: V1: This patch series improves the drivers for the >>> tsc2007 and >>> ads7846/tsc2046 touchscreen controllers which are e.g. used by the GTA04 >>> OpenPandora and Pyra devices. >>> >>> New common bindings have been defined by >>> commit b98abe52fa8e ("Input: add common DT binding for touchscreens"): >>> >>> Documentation/devicetree/bindings/input/touchscreen/touchscreen.txt >>> >>> which also defines a helper function to parse the DT. These new parameters >>> allow to specify the fuzz factors (jitter suppression), inversion of x or y >>> axis and >>> swapping of x and y to achieve inversion and rotation so that the touch >>> coordinate axes match the natural orientation of the display panel. >>> >>> Another improvement is to better use the min/max ADC values and >>> scale to the screen size as defined by the DT. This allows to coarsely >>> calibrate the touch to match the LCD to which it is glued on so that the >>> touch can quite precisely be operated before any user-space fine-calibration >>> can be (and needs to be) started. >>> >>> For the adc7846 we fix an issue with the spi module table. >>> >>> Finally we add an iio interface for the AUX and temperature ADC channels of >>> the tsc2007 and also provide the touch screen raw values. This allows to >>> read >>> an optional ambient light sensor installed on the gta04 board and improves >>> calibration and hardware monitoring. >>> >>> >>> H. Nikolaus Schaller (8): >>> drivers:input:tsc2007: add new common binding names, pre-calibration, >>> flipping and rotation >>> drivers:in
[PATCH v2] net: broadcom: bnx2x: use new api ethtool_{get|set}_link_ksettings
The ethtool api {get|set}_settings is deprecated. We move this driver to new api {get|set}_link_ksettings. As I don't have the hardware, I'd be very pleased if someone may test this patch. Signed-off-by: Philippe Reynes --- Changelog: v2: - also move to new api for bnx2x_vf .../net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c| 199 +++- 1 files changed, 109 insertions(+), 90 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c index 5f19427..4342374 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c @@ -216,165 +216,184 @@ static int bnx2x_get_port_type(struct bnx2x *bp) return port_type; } -static int bnx2x_get_vf_settings(struct net_device *dev, -struct ethtool_cmd *cmd) +static int bnx2x_get_vf_link_ksettings(struct net_device *dev, + struct ethtool_link_ksettings *cmd) { struct bnx2x *bp = netdev_priv(dev); + u32 supported, advertising; + + ethtool_convert_link_mode_to_legacy_u32(&supported, + cmd->link_modes.supported); + ethtool_convert_link_mode_to_legacy_u32(&advertising, + cmd->link_modes.advertising); if (bp->state == BNX2X_STATE_OPEN) { if (test_bit(BNX2X_LINK_REPORT_FD, &bp->vf_link_vars.link_report_flags)) - cmd->duplex = DUPLEX_FULL; + cmd->base.duplex = DUPLEX_FULL; else - cmd->duplex = DUPLEX_HALF; + cmd->base.duplex = DUPLEX_HALF; - ethtool_cmd_speed_set(cmd, bp->vf_link_vars.line_speed); + cmd->base.speed = bp->vf_link_vars.line_speed; } else { - cmd->duplex = DUPLEX_UNKNOWN; - ethtool_cmd_speed_set(cmd, SPEED_UNKNOWN); + cmd->base.duplex = DUPLEX_UNKNOWN; + cmd->base.speed = SPEED_UNKNOWN; } - cmd->port = PORT_OTHER; - cmd->phy_address= 0; - cmd->transceiver= XCVR_INTERNAL; - cmd->autoneg= AUTONEG_DISABLE; - cmd->maxtxpkt = 0; - cmd->maxrxpkt = 0; + cmd->base.port = PORT_OTHER; + cmd->base.phy_address = 0; + cmd->base.autoneg = AUTONEG_DISABLE; DP(BNX2X_MSG_ETHTOOL, "ethtool_cmd: cmd %d\n" " supported 0x%x advertising 0x%x speed %u\n" - " duplex %d port %d phy_address %d transceiver %d\n" - " autoneg %d maxtxpkt %d maxrxpkt %d\n", - cmd->cmd, cmd->supported, cmd->advertising, - ethtool_cmd_speed(cmd), - cmd->duplex, cmd->port, cmd->phy_address, cmd->transceiver, - cmd->autoneg, cmd->maxtxpkt, cmd->maxrxpkt); + " duplex %d port %d phy_address %d\n" + " autoneg %d\n", + cmd->base.cmd, supported, advertising, + cmd->base.speed, + cmd->base.duplex, cmd->base.port, cmd->base.phy_address, + cmd->base.autoneg); return 0; } -static int bnx2x_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) +static int bnx2x_get_link_ksettings(struct net_device *dev, + struct ethtool_link_ksettings *cmd) { struct bnx2x *bp = netdev_priv(dev); int cfg_idx = bnx2x_get_link_cfg_idx(bp); u32 media_type; + u32 supported, advertising, lp_advertising; + + ethtool_convert_link_mode_to_legacy_u32(&lp_advertising, + cmd->link_modes.lp_advertising); /* Dual Media boards present all available port types */ - cmd->supported = bp->port.supported[cfg_idx] | + supported = bp->port.supported[cfg_idx] | (bp->port.supported[cfg_idx ^ 1] & (SUPPORTED_TP | SUPPORTED_FIBRE)); - cmd->advertising = bp->port.advertising[cfg_idx]; + advertising = bp->port.advertising[cfg_idx]; media_type = bp->link_params.phy[bnx2x_get_cur_phy_idx(bp)].media_type; if (media_type == ETH_PHY_SFP_1G_FIBER) { - cmd->supported &= ~(SUPPORTED_1baseT_Full); - cmd->advertising &= ~(ADVERTISED_1baseT_Full); + supported &= ~(SUPPORTED_1baseT_Full); + advertising &= ~(ADVERTISED_1baseT_Full); } if ((bp->state == BNX2X_STATE_OPEN) && bp->link_vars.link_up && !(bp->flags & MF_FUNC_DIS)) { - cmd->duplex = bp->link_vars.duplex; + cmd->base.duplex = bp->link_vars.duplex; if (IS_MF(bp) && !BP_NOMCP(bp)) - ethtool_cmd_speed_set(cmd, bnx2x_get_mf_speed(bp)); + cmd->base
Re: [PATCH v7 2/5] clk: x86: Add Atom PMC platform clocks
On Fri, 2017-01-20 at 15:58 -0800, Stephen Boyd wrote: > On 01/17, Pierre-Louis Bossart wrote: > > > > +static void plt_clk_reg_update(struct clk_plt *clk, u32 mask, u32 > > val) > > +{ > > + u32 tmp; > > + unsigned long flags; > > + > > + spin_lock_irqsave(&clk->lock, flags); > > + > > + tmp = clk_readl(clk->reg); > > Do you need to use clk_readl? I'd prefer we deleted that > function/macro because it's just confusing. Good to know. > Please don't use it > unless you need it for some reason. It was my suggestion, I didn't know that the mentioned API is kinda deprecated. -- Andy Shevchenko Intel Finland Oy
Re: [PATCH 1/2] random: use chacha20 for get_random_int/long
Hi Ted, On Sat, Jan 21, 2017 at 7:24 AM, Theodore Ts'o wrote: > Oh, I see. > > So that's not how I would do things, but it's fine. Great, alright. In what tree should I look for these two commits? Or should I send it to the drivers/char maintainer (now CCd)? Jason
Re: [PATCH] iio: health: max30100: use msleep() for long uncritical delays
On 17/01/17 02:00, Matt Ranostay wrote: > On Mon, Jan 16, 2017 at 7:35 AM, Nicholas Mc Guire wrote: >> ulseep_range() uses hrtimers and provides no advantage over msleep() >> for larger delays. Fix up the 35ms delays here to use msleep() and >> reduce the load on the hrtimer subsystem. > > Ok makes sense. Also long as it guaranteed to be at least 35 milliseconds. > > Reviewed-by: Matt Ranostay Fair enough. Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it. Thanks, Jonathan > >> >> Fixes: commit 4d33615df58b ("iio: light: add MAX30100 oximeter driver >> support") >> Link: http://lkml.org/lkml/2017/1/11/377 >> Signed-off-by: Nicholas Mc Guire >> --- >> Problem located with coccinelle script >> >> Patch was compile tested with: x86_64_defconfig + CONFIG_IIO=m + >> CONFIG_MAX30100=m >> >> Patch is aginast 4.10-rc3 (localversion-next is next-20170116) >> >> drivers/iio/health/max30100.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/iio/health/max30100.c b/drivers/iio/health/max30100.c >> index 90ab8a2d..9648c69 100644 >> --- a/drivers/iio/health/max30100.c >> +++ b/drivers/iio/health/max30100.c >> @@ -378,7 +378,7 @@ static int max30100_get_temp(struct max30100_data *data, >> int *val) >> if (ret) >> return ret; >> >> - usleep_range(35000, 5); >> + msleep(35); >> >> return max30100_read_temp(data, val); >> } >> -- >> 2.1.4 >> >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-iio" in >> the body of a message to majord...@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/3] iio: light: opt3001: Export OF device ID table as module aliases
On 16/01/17 15:50, Javier Martinez Canillas wrote: > The I2C core always reports a MODALIAS of the form i2c: even if the > device was registered via OF, this means that exporting the OF device ID > table device aliases in the module is not needed. But in order to change > how the core reports modaliases to user-space, it's better to export it. > > Signed-off-by: Javier Martinez Canillas Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it. Thanks, Jonathan > --- > > drivers/iio/light/opt3001.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/iio/light/opt3001.c b/drivers/iio/light/opt3001.c > index 78c9b3a6453a..b91ebc3483ce 100644 > --- a/drivers/iio/light/opt3001.c > +++ b/drivers/iio/light/opt3001.c > @@ -840,6 +840,7 @@ static const struct of_device_id opt3001_of_match[] = { > { .compatible = "ti,opt3001" }, > { } > }; > +MODULE_DEVICE_TABLE(of, opt3001_of_match); > > static struct i2c_driver opt3001_driver = { > .probe = opt3001_probe, >
Re: [PATCH 3/3] iio: adc: max1363: Export OF device ID table as module aliases
On 16/01/17 15:50, Javier Martinez Canillas wrote: > The I2C core always reports a MODALIAS of the form i2c: even if the > device was registered via OF, this means that exporting the OF device ID > table device aliases in the module is not needed. But in order to change > how the core reports modaliases to user-space, it's better to export it. > > Signed-off-by: Javier Martinez Canillas Applied. Thanks, Jonathan > --- > > drivers/iio/adc/max1363.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/iio/adc/max1363.c b/drivers/iio/adc/max1363.c > index 841a13c9b6ea..c6c12feb4a08 100644 > --- a/drivers/iio/adc/max1363.c > +++ b/drivers/iio/adc/max1363.c > @@ -1567,6 +1567,7 @@ static const struct of_device_id max1363_of_match[] = { > MAX1363_COMPATIBLE("maxim,max11647", max11647), > { /* sentinel */ } > }; > +MODULE_DEVICE_TABLE(of, max1363_of_match); > #endif > > static int max1363_probe(struct i2c_client *client, >
Re: [PATCH 2/3] iio: potentiometer: mcp4531: Export OF device ID table as module aliases
On 16/01/17 15:50, Javier Martinez Canillas wrote: > The I2C core always reports a MODALIAS of the form i2c: even if the > device was registered via OF, this means that exporting the OF device ID > table device aliases in the module is not needed. But in order to change > how the core reports modaliases to user-space, it's better to export it. > > Signed-off-by: Javier Martinez Canillas Applied. > --- > > drivers/iio/potentiometer/mcp4531.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/iio/potentiometer/mcp4531.c > b/drivers/iio/potentiometer/mcp4531.c > index 0d1bcf89ae17..314353d7ab59 100644 > --- a/drivers/iio/potentiometer/mcp4531.c > +++ b/drivers/iio/potentiometer/mcp4531.c > @@ -284,6 +284,7 @@ static const struct of_device_id mcp4531_of_match[] = { > MCP4531_COMPATIBLE("microchip,mcp4662-104", MCP466x_104), > { /* sentinel */ } > }; > +MODULE_DEVICE_TABLE(of, mcp4531_of_match); > #endif > > static int mcp4531_probe(struct i2c_client *client, >
Re: [PATCH] iio: adc: palmas_gpadc: retrieve a valid iio_dev in suspend/resume
On 16/01/17 19:27, Alison Schofield wrote: > The suspend/resume functions were using dev_to_iio_dev() to get > the iio_dev. That only works on IIO dev's. Use dev_get_drvdata() > for a platform device to get the correct iio_dev. > > Signed-off-by: Alison Schofield Applied to the fixes-togreg branch of iio.git and marked for stable. Thanks, Jonathan > --- > drivers/iio/adc/palmas_gpadc.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/iio/adc/palmas_gpadc.c b/drivers/iio/adc/palmas_gpadc.c > index 2bbf0c5..7d61b56 100644 > --- a/drivers/iio/adc/palmas_gpadc.c > +++ b/drivers/iio/adc/palmas_gpadc.c > @@ -775,7 +775,7 @@ static int palmas_adc_wakeup_reset(struct palmas_gpadc > *adc) > > static int palmas_gpadc_suspend(struct device *dev) > { > - struct iio_dev *indio_dev = dev_to_iio_dev(dev); > + struct iio_dev *indio_dev = dev_get_drvdata(dev); > struct palmas_gpadc *adc = iio_priv(indio_dev); > int wakeup = adc->wakeup1_enable || adc->wakeup2_enable; > int ret; > @@ -798,7 +798,7 @@ static int palmas_gpadc_suspend(struct device *dev) > > static int palmas_gpadc_resume(struct device *dev) > { > - struct iio_dev *indio_dev = dev_to_iio_dev(dev); > + struct iio_dev *indio_dev = dev_get_drvdata(dev); > struct palmas_gpadc *adc = iio_priv(indio_dev); > int wakeup = adc->wakeup1_enable || adc->wakeup2_enable; > int ret; >
Re: [PATCH v2 01/15] staging: iio: isl29028: made alignment of variables in struct isl29028_chip consistent
On 17/01/17 09:24, Brian Masney wrote: > The alignment of the variables in the struct isl29028_chip is not > consistent. This changes all of the variables to use consistent > alignment to improve the code readability. > > Signed-off-by: Brian Masney Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it. Thanks, Jonathan > --- > drivers/staging/iio/light/isl29028.c | 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/staging/iio/light/isl29028.c > b/drivers/staging/iio/light/isl29028.c > index 1de81f5..4cce663 100644 > --- a/drivers/staging/iio/light/isl29028.c > +++ b/drivers/staging/iio/light/isl29028.c > @@ -67,13 +67,13 @@ enum isl29028_als_ir_mode { > }; > > struct isl29028_chip { > - struct mutexlock; > - struct regmap *regmap; > + struct mutexlock; > + struct regmap *regmap; > > - unsigned intprox_sampling; > - boolenable_prox; > + unsigned intprox_sampling; > + boolenable_prox; > > - int lux_scale; > + int lux_scale; > enum isl29028_als_ir_mode als_ir_mode; > }; > >
Business Proposal
Dear Friend, I would like to discuss a very important issue with you. I am writing to find out if this is your valid email. Please, let me know if this email is valid Kind regards Adrien Saif Attorney to Quatif Group of Companies
Re: [PATCH v2 02/15] staging: iio: isl29028: fix alignment of function arguments
On 17/01/17 09:24, Brian Masney wrote: > Two separate calls to regmap_update_bits() in isl29028_set_als_scale() > and isl29028_set_als_ir_mode() did not have their function arguments > on the next line aligned correctly to the open parenthesis. This patch > corrects the alignment. > > Signed-off-by: Brian Masney Applied. > --- > drivers/staging/iio/light/isl29028.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/iio/light/isl29028.c > b/drivers/staging/iio/light/isl29028.c > index 4cce663..74eb736 100644 > --- a/drivers/staging/iio/light/isl29028.c > +++ b/drivers/staging/iio/light/isl29028.c > @@ -116,7 +116,7 @@ static int isl29028_set_als_scale(struct isl29028_chip > *chip, int lux_scale) > ISL29028_CONF_ALS_RANGE_LOW_LUX; > > return regmap_update_bits(chip->regmap, ISL29028_REG_CONFIGURE, > - ISL29028_CONF_ALS_RANGE_MASK, val); > + ISL29028_CONF_ALS_RANGE_MASK, val); > } > > static int isl29028_set_als_ir_mode(struct isl29028_chip *chip, > @@ -148,7 +148,8 @@ static int isl29028_set_als_ir_mode(struct isl29028_chip > *chip, > > case ISL29028_MODE_NONE: > return regmap_update_bits(chip->regmap, ISL29028_REG_CONFIGURE, > - ISL29028_CONF_ALS_EN_MASK, ISL29028_CONF_ALS_DIS); > + ISL29028_CONF_ALS_EN_MASK, > + ISL29028_CONF_ALS_DIS); > } > > if (ret < 0) >
Re: [PATCH v2 06/15] staging: iio: isl29028: move failure logging into isl29028_set_proxim_sampling()
On 17/01/17 09:24, Brian Masney wrote: > When isl29028_set_proxim_sampling() fails, it was up to both callers to > log the failure message. This patch moves the logging into > isl29028_set_proxim_sampling() to reduce the overall amount of code in > the driver. > > Signed-off-by: Brian Masney I'm not 100% convinced of the logic of this as a stand alone patch, but it does no harm and is possibly slightly nicer! Hence applied. Thanks, Jonathan > --- > drivers/staging/iio/light/isl29028.c | 31 --- > 1 file changed, 16 insertions(+), 15 deletions(-) > > diff --git a/drivers/staging/iio/light/isl29028.c > b/drivers/staging/iio/light/isl29028.c > index 7074e62..bd85ccb 100644 > --- a/drivers/staging/iio/light/isl29028.c > +++ b/drivers/staging/iio/light/isl29028.c > @@ -78,18 +78,29 @@ struct isl29028_chip { > static int isl29028_set_proxim_sampling(struct isl29028_chip *chip, > unsigned int sampling) > { > + struct device *dev = regmap_get_device(chip->regmap); > static unsigned int prox_period[] = {800, 400, 200, 100, 75, 50, 12, 0}; > - int sel; > unsigned int period = DIV_ROUND_UP(1000, sampling); > + int sel, ret; > > for (sel = 0; sel < ARRAY_SIZE(prox_period); ++sel) { > if (period >= prox_period[sel]) > break; > } > > - return regmap_update_bits(chip->regmap, ISL29028_REG_CONFIGURE, > - ISL29028_CONF_PROX_SLP_MASK, > - sel << ISL29028_CONF_PROX_SLP_SH); > + ret = regmap_update_bits(chip->regmap, ISL29028_REG_CONFIGURE, > + ISL29028_CONF_PROX_SLP_MASK, > + sel << ISL29028_CONF_PROX_SLP_SH); > + > + if (ret < 0) { > + dev_err(dev, "%s(): Error %d setting the proximity sampling\n", > + __func__, ret); > + return ret; > + } > + > + chip->prox_sampling = sampling; > + > + return ret; > } > > static int isl29028_enable_proximity(struct isl29028_chip *chip, bool enable) > @@ -291,14 +302,6 @@ static int isl29028_write_raw(struct iio_dev *indio_dev, > } > > ret = isl29028_set_proxim_sampling(chip, val); > - if (ret < 0) { > - dev_err(dev, > - "Setting proximity samp_freq fail, err %d\n", > - ret); > - break; > - } > - > - chip->prox_sampling = val; > break; > case IIO_LIGHT: > if (mask != IIO_CHAN_INFO_SCALE) { > @@ -437,10 +440,8 @@ static int isl29028_chip_init_and_power_on(struct > isl29028_chip *chip) > } > > ret = isl29028_set_proxim_sampling(chip, chip->prox_sampling); > - if (ret < 0) { > - dev_err(dev, "setting the proximity, err = %d\n", ret); > + if (ret < 0) > return ret; > - } > > ret = isl29028_set_als_scale(chip, chip->lux_scale); > if (ret < 0) >
Re: [PATCH v2 03/15] staging: iio: isl29028: combine isl29028_proxim_get() and isl29028_read_proxim()
On 17/01/17 09:24, Brian Masney wrote: > isl29028_proxim_get() checks to see if the promixity needs to be > enabled on the chip and then calls isl29028_read_proxim(). There > are no other callers of isl29028_read_proxim(). The naming between > these two functions can be confusing so this patch combines the > two to avoid the confusion. > > Signed-off-by: Brian Masney Applied. > --- > drivers/staging/iio/light/isl29028.c | 22 -- > 1 file changed, 8 insertions(+), 14 deletions(-) > > diff --git a/drivers/staging/iio/light/isl29028.c > b/drivers/staging/iio/light/isl29028.c > index 74eb736..a13c8db 100644 > --- a/drivers/staging/iio/light/isl29028.c > +++ b/drivers/staging/iio/light/isl29028.c > @@ -201,6 +201,13 @@ static int isl29028_read_proxim(struct isl29028_chip > *chip, int *prox) > unsigned int data; > int ret; > > + if (!chip->enable_prox) { > + ret = isl29028_enable_proximity(chip, true); > + if (ret < 0) > + return ret; > + chip->enable_prox = true; > + } > + > ret = regmap_read(chip->regmap, ISL29028_REG_PROX_DATA, &data); > if (ret < 0) { > dev_err(dev, "Error in reading register %d, error %d\n", > @@ -211,19 +218,6 @@ static int isl29028_read_proxim(struct isl29028_chip > *chip, int *prox) > return 0; > } > > -static int isl29028_proxim_get(struct isl29028_chip *chip, int *prox_data) > -{ > - int ret; > - > - if (!chip->enable_prox) { > - ret = isl29028_enable_proximity(chip, true); > - if (ret < 0) > - return ret; > - chip->enable_prox = true; > - } > - return isl29028_read_proxim(chip, prox_data); > -} > - > static int isl29028_als_get(struct isl29028_chip *chip, int *als_data) > { > struct device *dev = regmap_get_device(chip->regmap); > @@ -349,7 +343,7 @@ static int isl29028_read_raw(struct iio_dev *indio_dev, > ret = isl29028_ir_get(chip, val); > break; > case IIO_PROXIMITY: > - ret = isl29028_proxim_get(chip, val); > + ret = isl29028_read_proxim(chip, val); > break; > default: > break; >
Re: [PATCH v2 05/15] staging: iio: isl29028: remove unused define ISL29028_DEV_ATTR
On 17/01/17 09:24, Brian Masney wrote: > The #define ISL29028_DEV_ATTR was not used so this patch removes the > unnecessary code. > > Signed-off-by: Brian Masney Applied. > --- > drivers/staging/iio/light/isl29028.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/drivers/staging/iio/light/isl29028.c > b/drivers/staging/iio/light/isl29028.c > index d05d761..7074e62 100644 > --- a/drivers/staging/iio/light/isl29028.c > +++ b/drivers/staging/iio/light/isl29028.c > @@ -391,7 +391,6 @@ static > IIO_CONST_ATTR(in_proximity_sampling_frequency_available, > "1 3 5 10 13 20 83 100"); > static IIO_CONST_ATTR(in_illuminance_scale_available, "125 2000"); > > -#define ISL29028_DEV_ATTR(name) (&iio_dev_attr_##name.dev_attr.attr) > #define ISL29028_CONST_ATTR(name) (&iio_const_attr_##name.dev_attr.attr) > static struct attribute *isl29028_attributes[] = { > ISL29028_CONST_ATTR(in_proximity_sampling_frequency_available), >
Re: [PATCH v2 04/15] staging: iio: isl29028: change newlines to improve readability
On 17/01/17 09:24, Brian Masney wrote: > Add and remove newlines to improve code readability in preparation for > moving the driver out of staging. > > Signed-off-by: Brian Masney Applied. > --- > drivers/staging/iio/light/isl29028.c | 33 - > 1 file changed, 24 insertions(+), 9 deletions(-) > > diff --git a/drivers/staging/iio/light/isl29028.c > b/drivers/staging/iio/light/isl29028.c > index a13c8db..d05d761 100644 > --- a/drivers/staging/iio/light/isl29028.c > +++ b/drivers/staging/iio/light/isl29028.c > @@ -69,10 +69,8 @@ enum isl29028_als_ir_mode { > struct isl29028_chip { > struct mutexlock; > struct regmap *regmap; > - > unsigned intprox_sampling; > boolenable_prox; > - > int lux_scale; > enum isl29028_als_ir_mode als_ir_mode; > }; > @@ -88,6 +86,7 @@ static int isl29028_set_proxim_sampling(struct > isl29028_chip *chip, > if (period >= prox_period[sel]) > break; > } > + > return regmap_update_bits(chip->regmap, ISL29028_REG_CONFIGURE, > ISL29028_CONF_PROX_SLP_MASK, > sel << ISL29028_CONF_PROX_SLP_SH); > @@ -107,6 +106,7 @@ static int isl29028_enable_proximity(struct isl29028_chip > *chip, bool enable) > > /* Wait for conversion to be complete for first sample */ > mdelay(DIV_ROUND_UP(1000, chip->prox_sampling)); > + > return 0; > } > > @@ -139,13 +139,11 @@ static int isl29028_set_als_ir_mode(struct > isl29028_chip *chip, >ISL29028_CONF_ALS_RANGE_MASK, >ISL29028_CONF_ALS_RANGE_HIGH_LUX); > break; > - > case ISL29028_MODE_IR: > ret = regmap_update_bits(chip->regmap, ISL29028_REG_CONFIGURE, >ISL29028_CONF_ALS_IR_MODE_MASK, >ISL29028_CONF_ALS_IR_MODE_IR); > break; > - > case ISL29028_MODE_NONE: > return regmap_update_bits(chip->regmap, ISL29028_REG_CONFIGURE, > ISL29028_CONF_ALS_EN_MASK, > @@ -192,6 +190,7 @@ static int isl29028_read_als_ir(struct isl29028_chip > *chip, int *als_ir) > } > > *als_ir = ((msb & 0xF) << 8) | (lsb & 0xFF); > + > return 0; > } > > @@ -205,6 +204,7 @@ static int isl29028_read_proxim(struct isl29028_chip > *chip, int *prox) > ret = isl29028_enable_proximity(chip, true); > if (ret < 0) > return ret; > + > chip->enable_prox = true; > } > > @@ -214,7 +214,9 @@ static int isl29028_read_proxim(struct isl29028_chip > *chip, int *prox) > ISL29028_REG_PROX_DATA, ret); > return ret; > } > + > *prox = data; > + > return 0; > } > > @@ -245,6 +247,7 @@ static int isl29028_als_get(struct isl29028_chip *chip, > int *als_data) > als_ir_data = (als_ir_data * 49) / 100; > > *als_data = als_ir_data; > + > return 0; > } > > @@ -258,6 +261,7 @@ static int isl29028_ir_get(struct isl29028_chip *chip, > int *ir_data) > dev_err(dev, "Error in enabling IR mode err %d\n", ret); > return ret; > } > + > return isl29028_read_als_ir(chip, ir_data); > } > > @@ -279,11 +283,13 @@ static int isl29028_write_raw(struct iio_dev *indio_dev, > mask); > break; > } > + > if (val < 1 || val > 100) { > dev_err(dev, > "Samp_freq %d is not in range[1:100]\n", val); > break; > } > + > ret = isl29028_set_proxim_sampling(chip, val); > if (ret < 0) { > dev_err(dev, > @@ -291,9 +297,9 @@ static int isl29028_write_raw(struct iio_dev *indio_dev, > ret); > break; > } > + > chip->prox_sampling = val; > break; > - > case IIO_LIGHT: > if (mask != IIO_CHAN_INFO_SCALE) { > dev_err(dev, > @@ -301,25 +307,29 @@ static int isl29028_write_raw(struct iio_dev *indio_dev, > mask); > break; > } > + > if ((val != 125) && (val != 2000)) { > dev_err(dev, > "lux scale %d is invalid [125, 2000]\n", val); > break; > } > + > ret = isl29028_set_als_scale(chip, val); > if (ret < 0) { > dev_err(dev, > "Setting lux scale fail with error %d\n", re
Re: [PATCH v2 08/15] staging: iio: isl29028: made error messages consistent
On 17/01/17 09:24, Brian Masney wrote: > The wording and style of the different error messages was not > consistent. This patch makes the wording and style consistent > throughout the driver. > > Signed-off-by: Brian Masney Applied. > --- > drivers/staging/iio/light/isl29028.c | 56 > > 1 file changed, 32 insertions(+), 24 deletions(-) > > diff --git a/drivers/staging/iio/light/isl29028.c > b/drivers/staging/iio/light/isl29028.c > index 8e7b3db..cffecf9 100644 > --- a/drivers/staging/iio/light/isl29028.c > +++ b/drivers/staging/iio/light/isl29028.c > @@ -200,14 +200,16 @@ static int isl29028_read_als_ir(struct isl29028_chip > *chip, int *als_ir) > ret = regmap_read(chip->regmap, ISL29028_REG_ALSIR_L, &lsb); > if (ret < 0) { > dev_err(dev, > - "Error in reading register ALSIR_L err %d\n", ret); > + "%s(): Error %d reading register ALSIR_L\n", > + __func__, ret); > return ret; > } > > ret = regmap_read(chip->regmap, ISL29028_REG_ALSIR_U, &msb); > if (ret < 0) { > dev_err(dev, > - "Error in reading register ALSIR_U err %d\n", ret); > + "%s(): Error %d reading register ALSIR_U\n", > + __func__, ret); > return ret; > } > > @@ -232,8 +234,8 @@ static int isl29028_read_proxim(struct isl29028_chip > *chip, int *prox) > > ret = regmap_read(chip->regmap, ISL29028_REG_PROX_DATA, &data); > if (ret < 0) { > - dev_err(dev, "Error in reading register %d, error %d\n", > - ISL29028_REG_PROX_DATA, ret); > + dev_err(dev, "%s(): Error %d reading register PROX_DATA\n", > + __func__, ret); > return ret; > } > > @@ -250,7 +252,8 @@ static int isl29028_als_get(struct isl29028_chip *chip, > int *als_data) > > ret = isl29028_set_als_ir_mode(chip, ISL29028_MODE_ALS); > if (ret < 0) { > - dev_err(dev, "Error in enabling ALS mode err %d\n", ret); > + dev_err(dev, "%s(): Error %d enabling ALS mode\n", __func__, > + ret); > return ret; > } > > @@ -280,7 +283,8 @@ static int isl29028_ir_get(struct isl29028_chip *chip, > int *ir_data) > > ret = isl29028_set_als_ir_mode(chip, ISL29028_MODE_IR); > if (ret < 0) { > - dev_err(dev, "Error in enabling IR mode err %d\n", ret); > + dev_err(dev, "%s(): Error %d enabling IR mode\n", __func__, > + ret); > return ret; > } > > @@ -301,14 +305,15 @@ static int isl29028_write_raw(struct iio_dev *indio_dev, > case IIO_PROXIMITY: > if (mask != IIO_CHAN_INFO_SAMP_FREQ) { > dev_err(dev, > - "proximity: mask value 0x%08lx not supported\n", > - mask); > + "%s(): proximity: Mask value 0x%08lx is not > supported\n", > + __func__, mask); > break; > } > > if (val < 1 || val > 100) { > dev_err(dev, > - "Samp_freq %d is not in range[1:100]\n", val); > + "%s(): proximity: Sampling frequency %d is not > in the range [1:100]\n", > + __func__, val); > break; > } > > @@ -317,21 +322,23 @@ static int isl29028_write_raw(struct iio_dev *indio_dev, > case IIO_LIGHT: > if (mask != IIO_CHAN_INFO_SCALE) { > dev_err(dev, > - "light: mask value 0x%08lx not supported\n", > - mask); > + "%s(): light: Mask value 0x%08lx is not > supported\n", > + __func__, mask); > break; > } > > if ((val != 125) && (val != 2000)) { > dev_err(dev, > - "lux scale %d is invalid [125, 2000]\n", val); > + "%s(): light: Lux scale %d is not in the set > {125, 2000}\n", > + __func__, val); > break; > } > > ret = isl29028_set_als_scale(chip, val); > break; > default: > - dev_err(dev, "Unsupported channel type\n"); > + dev_err(dev, "%s(): Unsupported channel type %x\n", > + __func__, chan->type); > break; > } > > @@ -385,7 +392,8 @@ static int isl29028_read_raw(struct iio_dev *indio_dev, > ret = IIO_VAL_INT; > break; > default: > - dev_err(dev, "mask value 0x%08lx not supported\n", mask); > + dev_er
Re: [PATCH v2 07/15] staging: iio: isl29028: move failure logging into isl29028_set_als_scale()
On 17/01/17 09:24, Brian Masney wrote: > When isl29028_set_als_scale() fails, it was up to both callers to log > the failure message. This patch moves the logging into > isl29028_set_als_scale() to reduce the overall amount of code in the > driver. > > Signed-off-by: Brian Masney Applied > --- > drivers/staging/iio/light/isl29028.c | 27 ++- > 1 file changed, 14 insertions(+), 13 deletions(-) > > diff --git a/drivers/staging/iio/light/isl29028.c > b/drivers/staging/iio/light/isl29028.c > index bd85ccb..8e7b3db 100644 > --- a/drivers/staging/iio/light/isl29028.c > +++ b/drivers/staging/iio/light/isl29028.c > @@ -123,11 +123,22 @@ static int isl29028_enable_proximity(struct > isl29028_chip *chip, bool enable) > > static int isl29028_set_als_scale(struct isl29028_chip *chip, int lux_scale) > { > + struct device *dev = regmap_get_device(chip->regmap); > int val = (lux_scale == 2000) ? ISL29028_CONF_ALS_RANGE_HIGH_LUX : > ISL29028_CONF_ALS_RANGE_LOW_LUX; > + int ret; > + > + ret = regmap_update_bits(chip->regmap, ISL29028_REG_CONFIGURE, > + ISL29028_CONF_ALS_RANGE_MASK, val); > + if (ret < 0) { > + dev_err(dev, "%s(): Error %d setting the ALS scale\n", __func__, > + ret); > + return ret; > + } > > - return regmap_update_bits(chip->regmap, ISL29028_REG_CONFIGURE, > - ISL29028_CONF_ALS_RANGE_MASK, val); > + chip->lux_scale = lux_scale; > + > + return ret; > } > > static int isl29028_set_als_ir_mode(struct isl29028_chip *chip, > @@ -318,13 +329,6 @@ static int isl29028_write_raw(struct iio_dev *indio_dev, > } > > ret = isl29028_set_als_scale(chip, val); > - if (ret < 0) { > - dev_err(dev, > - "Setting lux scale fail with error %d\n", ret); > - break; > - } > - > - chip->lux_scale = val; > break; > default: > dev_err(dev, "Unsupported channel type\n"); > @@ -443,10 +447,7 @@ static int isl29028_chip_init_and_power_on(struct > isl29028_chip *chip) > if (ret < 0) > return ret; > > - ret = isl29028_set_als_scale(chip, chip->lux_scale); > - if (ret < 0) > - dev_err(dev, "setting als scale failed, err = %d\n", ret); > - return ret; > + return isl29028_set_als_scale(chip, chip->lux_scale); > } > > static bool isl29028_is_volatile_reg(struct device *dev, unsigned int reg) >
Re: [PATCH v2 09/15] staging: iio: isl29028: remove unnecessary error logging in isl29028_chip_init_and_power_on()
On 17/01/17 09:24, Brian Masney wrote: > If the call to isl29028_chip_init_and_power_on() in isl29028_probe() > fails, then isl29028_probe() will log an error message. All of the > error paths in that call path already have error logging in place. This > patch removes the unnecessary logging. > > Signed-off-by: Brian Masney applied. > --- > drivers/staging/iio/light/isl29028.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/staging/iio/light/isl29028.c > b/drivers/staging/iio/light/isl29028.c > index cffecf9..be1fc4a 100644 > --- a/drivers/staging/iio/light/isl29028.c > +++ b/drivers/staging/iio/light/isl29028.c > @@ -528,10 +528,8 @@ static int isl29028_probe(struct i2c_client *client, > } > > ret = isl29028_chip_init_and_power_on(chip); > - if (ret < 0) { > - dev_err(&client->dev, "chip initialization failed: %d\n", ret); > + if (ret < 0) > return ret; > - } > > indio_dev->info = &isl29028_info; > indio_dev->channels = isl29028_channels; >
Re: [PATCH v2 10/15] staging: iio: isl29028: remove out of memory log message
On 17/01/17 09:24, Brian Masney wrote: > If the call to devm_iio_device_alloc() fails, then isl29028_probe() > logs a message saying that memory cannot be allocated. The user's system > most likely has larger issues at this point. This patch removes that > error message since the error code is passed on and the message is not > necessary. > > Signed-off-by: Brian Masney Applied. > --- > drivers/staging/iio/light/isl29028.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/staging/iio/light/isl29028.c > b/drivers/staging/iio/light/isl29028.c > index be1fc4a..e93077b 100644 > --- a/drivers/staging/iio/light/isl29028.c > +++ b/drivers/staging/iio/light/isl29028.c > @@ -488,10 +488,8 @@ static int isl29028_probe(struct i2c_client *client, > int ret; > > indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*chip)); > - if (!indio_dev) { > - dev_err(&client->dev, "iio allocation fails\n"); > + if (!indio_dev) > return -ENOMEM; > - } > > chip = iio_priv(indio_dev); > >
Re: [PATCH v2 11/15] staging: iio: isl29028: remove unnecessary parenthesis
On 17/01/17 09:24, Brian Masney wrote: > isl29028_write_raw() contains unnecessary parenthesis when checking to > see if the passed in lux scale is valid. This patch removes the > unnecessary parenthesis. > > Signed-off-by: Brian Masney hmm. Not sure I really care about this either way. Ah well, applied. Jonathan > --- > drivers/staging/iio/light/isl29028.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/iio/light/isl29028.c > b/drivers/staging/iio/light/isl29028.c > index e93077b..bc9c01d 100644 > --- a/drivers/staging/iio/light/isl29028.c > +++ b/drivers/staging/iio/light/isl29028.c > @@ -327,7 +327,7 @@ static int isl29028_write_raw(struct iio_dev *indio_dev, > break; > } > > - if ((val != 125) && (val != 2000)) { > + if (val != 125 && val != 2000) { > dev_err(dev, > "%s(): light: Lux scale %d is not in the set > {125, 2000}\n", > __func__, val); >
[PATCH] powerpc/sstep: Return directly after a failed address_ok() in emulate_step()
From: Markus Elfring Date: Sat, 21 Jan 2017 15:30:15 +0100 * Return directly after a call of the function "address_ok" failed in a case block. This issue was detected by using the Coccinelle software. * Delete two error code assignments which became unnecessary with this refactoring. Signed-off-by: Markus Elfring --- arch/powerpc/lib/sstep.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c index 9c78a9c102c3..c33519c25b47 100644 --- a/arch/powerpc/lib/sstep.c +++ b/arch/powerpc/lib/sstep.c @@ -1803,9 +1803,8 @@ int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr) return 0; if (op.ea & (size - 1)) break; /* can't handle misaligned */ - err = -EFAULT; if (!address_ok(regs, op.ea, size)) - goto ldst_done; + return 0; err = 0; switch (size) { case 4: @@ -1828,9 +1827,8 @@ int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr) return 0; if (op.ea & (size - 1)) break; /* can't handle misaligned */ - err = -EFAULT; if (!address_ok(regs, op.ea, size)) - goto ldst_done; + return 0; err = 0; switch (size) { case 4: -- 2.11.0
Re: [PATCH v2 12/15] staging: iio: isl29028: remove enable flag from isl29028_enable_proximity()
On 17/01/17 09:24, Brian Masney wrote: > isl29028_enable_proximity() has a boolean argument named enable. This > function is only called once and the enable flag is set to true in that > call. This patch removes the enable parameter from that function. > > Signed-off-by: Brian Masney Applied. > --- > The device gets runtime power management support in the next patch in > this set and autosuspends after two seconds of inactivity. Once the > device suspends, the pin that drives the external LED for proximity > sensing will only go high the next time that the user asks for a > reading from the proximity sensor. > > This patch also sets the stage for additional cleanups prior to the > introduction of runtime power management support. > > drivers/staging/iio/light/isl29028.c | 10 -- > 1 file changed, 4 insertions(+), 6 deletions(-) > > diff --git a/drivers/staging/iio/light/isl29028.c > b/drivers/staging/iio/light/isl29028.c > index bc9c01d..f1b3651 100644 > --- a/drivers/staging/iio/light/isl29028.c > +++ b/drivers/staging/iio/light/isl29028.c > @@ -103,15 +103,13 @@ static int isl29028_set_proxim_sampling(struct > isl29028_chip *chip, > return ret; > } > > -static int isl29028_enable_proximity(struct isl29028_chip *chip, bool enable) > +static int isl29028_enable_proximity(struct isl29028_chip *chip) > { > int ret; > - int val = 0; > > - if (enable) > - val = ISL29028_CONF_PROX_EN; > ret = regmap_update_bits(chip->regmap, ISL29028_REG_CONFIGURE, > - ISL29028_CONF_PROX_EN_MASK, val); > + ISL29028_CONF_PROX_EN_MASK, > + ISL29028_CONF_PROX_EN); > if (ret < 0) > return ret; > > @@ -225,7 +223,7 @@ static int isl29028_read_proxim(struct isl29028_chip > *chip, int *prox) > int ret; > > if (!chip->enable_prox) { > - ret = isl29028_enable_proximity(chip, true); > + ret = isl29028_enable_proximity(chip); > if (ret < 0) > return ret; > >
Re: [PATCH v2 13/15] staging: iio: isl29028: only set proximity sampling rate when proximity is enabled
On 17/01/17 09:25, Brian Masney wrote: > isl29028_chip_init_and_power_on() calls isl29028_set_proxim_sampling() > and this is not needed until the user actually needs to take a proximity > reading. This patch moves the isl29028_set_proxim_sampling() call from > isl29028_chip_init_and_power_on() to isl29028_enable_proximity(). > This sets the stage for faster resume times from the runtime power > management if the user is only querying the ALS/IR sensor. > Logical. Applied. > Signed-off-by: Brian Masney > --- > drivers/staging/iio/light/isl29028.c | 8 > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/staging/iio/light/isl29028.c > b/drivers/staging/iio/light/isl29028.c > index f1b3651..fa58d08 100644 > --- a/drivers/staging/iio/light/isl29028.c > +++ b/drivers/staging/iio/light/isl29028.c > @@ -107,6 +107,10 @@ static int isl29028_enable_proximity(struct > isl29028_chip *chip) > { > int ret; > > + ret = isl29028_set_proxim_sampling(chip, chip->prox_sampling); > + if (ret < 0) > + return ret; > + > ret = regmap_update_bits(chip->regmap, ISL29028_REG_CONFIGURE, >ISL29028_CONF_PROX_EN_MASK, >ISL29028_CONF_PROX_EN); > @@ -449,10 +453,6 @@ static int isl29028_chip_init_and_power_on(struct > isl29028_chip *chip) > return ret; > } > > - ret = isl29028_set_proxim_sampling(chip, chip->prox_sampling); > - if (ret < 0) > - return ret; > - > return isl29028_set_als_scale(chip, chip->lux_scale); > } > >
Re: [PATCH v2 14/15] staging: iio: isl29028: only set ALS scale when ALS/IR sensing is enabled
On 17/01/17 09:25, Brian Masney wrote: > isl29028_chip_init_and_power_on() calls isl29028_set_als_scale() and > this is not needed until the user actually needs to take a reading from > the ALS/IR sensor. This patch moves the isl29028_set_als_scale() call > from isl29028_chip_init_and_power_on() to isl29028_set_als_ir_mode(). > This sets the stage for faster resume times from runtime power > management if the user is only querying the proximity sensor. > > Signed-off-by: Brian Masney Makes sense. > --- > drivers/staging/iio/light/isl29028.c | 8 ++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/iio/light/isl29028.c > b/drivers/staging/iio/light/isl29028.c > index fa58d08..598a5a5 100644 > --- a/drivers/staging/iio/light/isl29028.c > +++ b/drivers/staging/iio/light/isl29028.c > @@ -146,11 +146,15 @@ static int isl29028_set_als_scale(struct isl29028_chip > *chip, int lux_scale) > static int isl29028_set_als_ir_mode(struct isl29028_chip *chip, > enum isl29028_als_ir_mode mode) > { > - int ret = 0; > + int ret; > > if (chip->als_ir_mode == mode) > return 0; > > + ret = isl29028_set_als_scale(chip, chip->lux_scale); > + if (ret < 0) > + return ret; > + > switch (mode) { > case ISL29028_MODE_ALS: > ret = regmap_update_bits(chip->regmap, ISL29028_REG_CONFIGURE, > @@ -453,7 +457,7 @@ static int isl29028_chip_init_and_power_on(struct > isl29028_chip *chip) > return ret; > } > > - return isl29028_set_als_scale(chip, chip->lux_scale); > + return ret; > } > > static bool isl29028_is_volatile_reg(struct device *dev, unsigned int reg) >
Re: [PATCH v2 15/15] staging: iio: isl29028: add runtime power management support
On 17/01/17 09:25, Brian Masney wrote: > This patch adds runtime power management support to the isl29028 driver. > It defaults to powering off the device after two seconds of inactivity. > > isl29028_chip_init_and_power_on() currently only zeros the CONFIGURE > register on the chip, which will cause the chip to turn off. This patch > also renames that function to isl29028_clear_configure_reg() since it is > now used in several places. > > Signed-off-by: Brian Masney Whilst I'm not against it by an means, runtime PM is hardly a requirement for moving out of staging! Good stuff though so I'm not going to turn it down ;) I'm not 100% sure about the one comment I made at the end. It's a very unlikely to occur condition anyway, but if you want to follow up with a patch on that then feel free. Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it. thanks, Jonathan > --- > drivers/staging/iio/light/isl29028.c | 118 > --- > 1 file changed, 110 insertions(+), 8 deletions(-) > > diff --git a/drivers/staging/iio/light/isl29028.c > b/drivers/staging/iio/light/isl29028.c > index 598a5a5..a3264f7 100644 > --- a/drivers/staging/iio/light/isl29028.c > +++ b/drivers/staging/iio/light/isl29028.c > @@ -26,6 +26,7 @@ > #include > #include > #include > +#include > > #define ISL29028_CONV_TIME_MS100 > > @@ -60,6 +61,8 @@ > > #define ISL29028_NUM_REGS(ISL29028_REG_TEST2_MODE + 1) > > +#define ISL29028_POWER_OFF_DELAY_MS 2000 > + > enum isl29028_als_ir_mode { > ISL29028_MODE_NONE = 0, > ISL29028_MODE_ALS, > @@ -297,6 +300,23 @@ static int isl29028_ir_get(struct isl29028_chip *chip, > int *ir_data) > return isl29028_read_als_ir(chip, ir_data); > } > > +static int isl29028_set_pm_runtime_busy(struct isl29028_chip *chip, bool on) > +{ > + struct device *dev = regmap_get_device(chip->regmap); > + int ret; > + > + if (on) { > + ret = pm_runtime_get_sync(dev); > + if (ret < 0) > + pm_runtime_put_noidle(dev); > + } else { > + pm_runtime_mark_last_busy(dev); > + ret = pm_runtime_put_autosuspend(dev); > + } > + > + return ret; > +} > + > /* Channel IO */ > static int isl29028_write_raw(struct iio_dev *indio_dev, > struct iio_chan_spec const *chan, > @@ -304,9 +324,15 @@ static int isl29028_write_raw(struct iio_dev *indio_dev, > { > struct isl29028_chip *chip = iio_priv(indio_dev); > struct device *dev = regmap_get_device(chip->regmap); > - int ret = -EINVAL; > + int ret; > + > + ret = isl29028_set_pm_runtime_busy(chip, true); > + if (ret < 0) > + return ret; > > mutex_lock(&chip->lock); > + > + ret = -EINVAL; > switch (chan->type) { > case IIO_PROXIMITY: > if (mask != IIO_CHAN_INFO_SAMP_FREQ) { > @@ -350,6 +376,13 @@ static int isl29028_write_raw(struct iio_dev *indio_dev, > > mutex_unlock(&chip->lock); > > + if (ret < 0) > + return ret; > + > + ret = isl29028_set_pm_runtime_busy(chip, false); > + if (ret < 0) > + return ret; > + > return ret; > } > > @@ -359,9 +392,15 @@ static int isl29028_read_raw(struct iio_dev *indio_dev, > { > struct isl29028_chip *chip = iio_priv(indio_dev); > struct device *dev = regmap_get_device(chip->regmap); > - int ret = -EINVAL; > + int ret, pm_ret; > + > + ret = isl29028_set_pm_runtime_busy(chip, true); > + if (ret < 0) > + return ret; > > mutex_lock(&chip->lock); > + > + ret = -EINVAL; > switch (mask) { > case IIO_CHAN_INFO_RAW: > case IIO_CHAN_INFO_PROCESSED: > @@ -405,6 +444,18 @@ static int isl29028_read_raw(struct iio_dev *indio_dev, > > mutex_unlock(&chip->lock); > > + if (ret < 0) > + return ret; > + > + /** > + * Preserve the ret variable if the call to > + * isl29028_set_pm_runtime_busy() is successful so the reading > + * (if applicable) is returned to user space. > + */ > + pm_ret = isl29028_set_pm_runtime_busy(chip, false); > + if (pm_ret < 0) > + return pm_ret; > + > return ret; > } > > @@ -445,17 +496,18 @@ static const struct iio_info isl29028_info = { > .write_raw = isl29028_write_raw, > }; > > -static int isl29028_chip_init_and_power_on(struct isl29028_chip *chip) > +static int isl29028_clear_configure_reg(struct isl29028_chip *chip) > { > struct device *dev = regmap_get_device(chip->regmap); > int ret; > > ret = regmap_write(chip->regmap, ISL29028_REG_CONFIGURE, 0x0); > - if (ret < 0) { > + if (ret < 0) > dev_err(dev, "%s(): Error %d clearing the CONFIGURE register\n", > __func__, ret); > - return ret; > - } > + > +
[PATCH] net: intel: e1000: use new api ethtool_{get|set}_link_ksettings
The ethtool api {get|set}_settings is deprecated. We move this driver to new api {get|set}_link_ksettings. As I don't have the hardware, I'd be very pleased if someone may test this patch. Signed-off-by: Philippe Reynes --- drivers/net/ethernet/intel/e1000/e1000_ethtool.c | 93 +++--- 1 files changed, 46 insertions(+), 47 deletions(-) diff --git a/drivers/net/ethernet/intel/e1000/e1000_ethtool.c b/drivers/net/ethernet/intel/e1000/e1000_ethtool.c index 975eeb8..024a4b5 100644 --- a/drivers/net/ethernet/intel/e1000/e1000_ethtool.c +++ b/drivers/net/ethernet/intel/e1000/e1000_ethtool.c @@ -103,104 +103,104 @@ struct e1000_stats { #define E1000_TEST_LEN ARRAY_SIZE(e1000_gstrings_test) -static int e1000_get_settings(struct net_device *netdev, - struct ethtool_cmd *ecmd) +static int e1000_get_link_ksettings(struct net_device *netdev, + struct ethtool_link_ksettings *cmd) { struct e1000_adapter *adapter = netdev_priv(netdev); struct e1000_hw *hw = &adapter->hw; + u32 supported, advertising; if (hw->media_type == e1000_media_type_copper) { - ecmd->supported = (SUPPORTED_10baseT_Half | + supported = (SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full | SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full | SUPPORTED_1000baseT_Full| SUPPORTED_Autoneg | SUPPORTED_TP); - ecmd->advertising = ADVERTISED_TP; + advertising = ADVERTISED_TP; if (hw->autoneg == 1) { - ecmd->advertising |= ADVERTISED_Autoneg; + advertising |= ADVERTISED_Autoneg; /* the e1000 autoneg seems to match ethtool nicely */ - ecmd->advertising |= hw->autoneg_advertised; + advertising |= hw->autoneg_advertised; } - ecmd->port = PORT_TP; - ecmd->phy_address = hw->phy_addr; - - if (hw->mac_type == e1000_82543) - ecmd->transceiver = XCVR_EXTERNAL; - else - ecmd->transceiver = XCVR_INTERNAL; - + cmd->base.port = PORT_TP; + cmd->base.phy_address = hw->phy_addr; } else { - ecmd->supported = (SUPPORTED_1000baseT_Full | + supported = (SUPPORTED_1000baseT_Full | SUPPORTED_FIBRE | SUPPORTED_Autoneg); - ecmd->advertising = (ADVERTISED_1000baseT_Full | + advertising = (ADVERTISED_1000baseT_Full | ADVERTISED_FIBRE | ADVERTISED_Autoneg); - ecmd->port = PORT_FIBRE; - - if (hw->mac_type >= e1000_82545) - ecmd->transceiver = XCVR_INTERNAL; - else - ecmd->transceiver = XCVR_EXTERNAL; + cmd->base.port = PORT_FIBRE; } if (er32(STATUS) & E1000_STATUS_LU) { e1000_get_speed_and_duplex(hw, &adapter->link_speed, &adapter->link_duplex); - ethtool_cmd_speed_set(ecmd, adapter->link_speed); + cmd->base.speed = adapter->link_speed; /* unfortunately FULL_DUPLEX != DUPLEX_FULL * and HALF_DUPLEX != DUPLEX_HALF */ if (adapter->link_duplex == FULL_DUPLEX) - ecmd->duplex = DUPLEX_FULL; + cmd->base.duplex = DUPLEX_FULL; else - ecmd->duplex = DUPLEX_HALF; + cmd->base.duplex = DUPLEX_HALF; } else { - ethtool_cmd_speed_set(ecmd, SPEED_UNKNOWN); - ecmd->duplex = DUPLEX_UNKNOWN; + cmd->base.speed = SPEED_UNKNOWN; + cmd->base.duplex = DUPLEX_UNKNOWN; } - ecmd->autoneg = ((hw->media_type == e1000_media_type_fiber) || + cmd->base.autoneg = ((hw->media_type == e1000_media_type_fiber) || hw->autoneg) ? AUTONEG_ENABLE : AUTONEG_DISABLE; /* MDI-X => 1; MDI => 0 */ if ((hw->media_type == e1000_media_type_copper) && netif_carrier_ok(netdev)) - ecmd->eth_tp_mdix = (!!adapter->phy_info.mdix_mode ? + cmd->base.eth_tp_mdix = (!!adapter->phy_info.mdix_mode ? ETH_TP_MDI_X : ETH_TP_MDI); else - ecmd->eth_tp_mdix = ETH_TP_MDI_INVALID; + cmd->base.eth_tp_mdix = ETH_TP_MDI_INVALID; if (hw->mdix == AUTO_ALL_MODES) - ecm
Re: [PATCH] timers: Reconcile the code and the comment for the 250HZ case
Sure, I believe that comments should always match the code. In this case, using either LVL_SIZE - 1 or LVL_SIZE is fine based on my understanding about 20 days ago. But I could be wrong and miss some subtle details. Anyway, my point is about readability. thanks, On Fri, Jan 20, 2017 at 5:41 PM, John Stultz wrote: > On Mon, Jan 2, 2017 at 1:14 PM, Zhihui Zhang wrote: >> Adjust the time start of each level to match the comments. Note that >> LVL_START(n) is never used for n = 0 case. Also, each level (except >> level 0) has more than enough room to accommodate all its timers. > > So instead of just covering what your patch does, can you explain in > some detail why this patch is useful? What net effect does it bring? > What sort of bugs would it solve? > > thanks > -john
Ihre letzte Lieferungsmeldung
MADRID OFFICE OFFIZIELLE MITTEILUNG VON SITZ DES PRASIDENTEN DIE EUROMILLION LOTTERY PROMOTION -GEWINNZUTEILUNG REFERENZ NUMMER:[ WNT/25456009/ES] http://loteria.rtve.es Verifikationsnummer 66513 Batch Number: 14/0017/MN OFFIZIELLE GEWINNBENACHRITIGUNG Wir sind erfreut ihnen mitteilen zu konnen, das die gewinnliste die EUROMILLION LOTTERY PROMOTION am 28 Nov. 2016 erschienen ist, vorbei Co-organisiert World Tourism Organization/Spanish Ministerio de Tourismo. Dir offizielle liste der gewinner erschien am 22 Dec. 2016 Ihr e-mail wurde auf dem los mit dir nummer: (721-524-27756) und mit der seriennummer:{52136/2013} zugelassen. Die Glucksnummer: 66513 Sie haben in der zweite (1) kategorie gewonnen. Sie sind damit Gewinner von 1,200,000.00 Euro (Eine Million Zweihunderttausend Euro), im Bargeld genehmigt worden, die wird gutgeschrieben REFRENZ NR: [ WNT/25456009/ES] Die summe ergibt sich aus einer Gewinnausschuttung von 24,000,000.00 (Vier Zwanzig Million Euro) Die summe wurde durch 20 gewinnern aus der glieichen kategorie geteilt. HERZLICHEN GLUCKWUNSCH!!! Dir gewinn ist bei einer sicherheitsfirma hinterlegt und in ihren namen versichert. um keine komplikationen bei der abwicklung der zahlung zu verursachen bitten wir sie diese offizielle mitteilung, diskret zu behandelnes ist ein teil unseres sicherheitsprotokolls und garantiet ihnen einen reibunglosen Ablauf. Alle gewinner werden per computer aus 45.000.00 namen und e-mails aus ganz Europa, Asien,Australien und Amerika als teil unserer Internationalen promotion programms ausgewahlt, Welches wir einmal im jahr veranstalten. AXA SEGUROS MADRID-SPANIEN AUSLAND ANSPRECH PARTNER: Name: DON ANGEL GOMEZ Kontakt-Telefon:+34-631 813 142 Kontakt Fax-Nummer: +34-901 666 523 Kontakt E-Mail-Adresse: donangelgo...@yandex.com oder gomezdonan...@spainmail.com Bitte denken sie daran jeder gewinnanspruch muss bis zum 03 Feb. 2017. Angemeldete sein. Jeder nicht angemeldet Gewinnanspruch verfallt und geht zuruck an das MINISTERIO DE ECONOMIA Y HACIENDA. Bitte denken sie auch daran das 10% ihres gewinnes an die sicherheitsfirma AXA SEGUROS S.A geht. Dir 10% sind erst nach erhalt des gewinnes fallig da der gewinn in ihren namen versichert ist. BITTE AUSFUILLEN DEIN DATAS AUS UNTEN. 1. Name: 2 Nach NamenPlz___ 3. Adresse___ 4. Nationalitat:_Beruf __ 5. Geburtsdatum: 6. Stat:___ 7. Telefon:__ 8. Mobil:Gewinn Summe___ 9. Fax:___ 10 Email: 11.Geschlecht:___ Mit freundlichen Grussen Maria Aznar Head, Online Lottery Department Alle Warenzeichen und eingetragenen Warenzeichen sind Eigentum der jeweiligen Inhaber. Copyright © 2016-2017. Alle Rechte vorbehalten.
Re: [PATCH 0/3] ti,ads7950 device tree bindings
On 15/01/17 23:44, David Lechner wrote: > On 01/15/2017 07:58 AM, Jonathan Cameron wrote: >> On 11/01/17 17:52, David Lechner wrote: >>> This series adds device tree bindings for the TI ADS7950 family of A/DC >>> chips. >>> The series includes the bindings documentation and some fixes to the iio >>> driver >>> to make it work with the device tree bindings. >>> >>> FYI, the ads7950 driver has not made it into mainline yet, so no worries >>> about >>> breaking anyone with these changes. >>> >> And here's the bit I failed to read! >> >> As an extra point, could you confirm what /sys/bus/iio/iio\:deviceX/name for >> this >> one reads? I have a feeling this is another case of what Lars has been >> pointing >> out in other drivers this morning. That name should be the device part >> number.. >> > > cat /sys/bus/iio/devices/iio\:device0/name > ads7957 > > This is the part number for the specific chip I am using. So, I am guessing > that it is correct unless it is supposed to be upper case or something like > that. > > Cool. Spot on. > >> Thanks, >> >> Jonathan >>> David Lechner (3): >>> DT/bindings: Add bindings for TI ADS7950 A/DC chips >>> iio: adc: ti-ads7950: Drop "ti-" prefix from module name >>> iio: adc: ti-ads7950: Change regulator matching string to "vref" >>> >>> .../devicetree/bindings/iio/adc/ti-ads7950.txt | 23 >>> drivers/iio/adc/ti-ads7950.c | 32 >>> +++--- >>> 2 files changed, 39 insertions(+), 16 deletions(-) >>> create mode 100644 Documentation/devicetree/bindings/iio/adc/ti-ads7950.txt >>> >> >
[PATCH v3 0/4] Update LZ4 compressor module
This patchset is for updating the LZ4 compression module to a version based on LZ4 v1.7.3 allowing to use the fast compression algorithm aka LZ4 fast which provides an "acceleration" parameter as a tradeoff between high compression ratio and high compression speed. We want to use LZ4 fast in order to support compression in lustre and (mostly, based on that) investigate data reduction techniques in behalf of storage systems. Also, it will be useful for other users of LZ4 compression, as with LZ4 fast it is possible to enable applications to use fast and/or high compression depending on the usecase. For instance, ZRAM is offering a LZ4 backend and could benefit from an updated LZ4 in the kernel. LZ4 homepage: http://www.lz4.org/ LZ4 source repository: https://github.com/lz4/lz4 Source version: 1.7.3 Benchmark (taken from [1], Core i5-4300U @1.9GHz): |--||-- Compressor | Compression | Decompression | Ratio |--||-- memcpy | 4200 MB/s | 4200 MB/s | 1.000 LZ4 fast 50 | 1080 MB/s | 2650 MB/s | 1.375 LZ4 fast 17 | 680 MB/s | 2220 MB/s | 1.607 LZ4 fast 5 | 475 MB/s | 1920 MB/s | 1.886 LZ4 default | 385 MB/s | 1850 MB/s | 2.101 [1] http://fastcompression.blogspot.de/2015/04/sampling-or-faster-lz4.html [PATCHv2 1/4] lib: Update LZ4 compressor module based on LZ4 v1.7.2 [PATCHv2 2/4] lib: Update decompress_unlz4 wrapper to work with new LZ4 module [PATCHv2 3/4] crypto: Change lz4 modules to work with new LZ4 module [PATCHv2 4/4] fs/pstore: fs/squashfs: Change LZ4 compressor functions to work with new LZ4 module v2: - Changed order of the patches since in the initial patchset the lz4.h was in the last patch but was referenced by the other ones - Split lib/decompress_unlz4.c in an own patch - Fixed errors reported by the buildbot - Further refactorings - Added more appropriate copyright note to include/linux/lz4.h v3: - Adjusted the code to satisfy kernel coding style (checkpatch.pl) - Made sure the changes to LZ4 in Kernel (overflow checks etc.) are included in the new module (they are) - Removed the second LZ4_compressBound function with related name but different return type - Corrected version number (was LZ4 1.7.3)
[PATCH 4/4] fs/pstore: fs/squashfs: Change usage of LZ4 to work with new LZ4 version
This patch updates fs/pstore and fs/squashfs to use the updated functions from the new LZ4 module. Signed-off-by: Sven Schmidt <4ssch...@informatik.uni-hamburg.de> --- fs/pstore/platform.c | 14 +++--- fs/squashfs/lz4_wrapper.c | 12 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c index 729677e..85c4c58 100644 --- a/fs/pstore/platform.c +++ b/fs/pstore/platform.c @@ -342,31 +342,31 @@ static int compress_lz4(const void *in, void *out, size_t inlen, size_t outlen) { int ret; - ret = lz4_compress(in, inlen, out, &outlen, workspace); - if (ret) { + ret = LZ4_compress_default(in, out, inlen, outlen, workspace); + if (!ret) { pr_err("lz4_compress error, ret = %d!\n", ret); return -EIO; } - return outlen; + return ret; } static int decompress_lz4(void *in, void *out, size_t inlen, size_t outlen) { int ret; - ret = lz4_decompress_unknownoutputsize(in, inlen, out, &outlen); - if (ret) { + ret = LZ4_decompress_safe(in, out, inlen, outlen); + if (ret < 0) { pr_err("lz4_decompress error, ret = %d!\n", ret); return -EIO; } - return outlen; + return ret; } static void allocate_lz4(void) { - big_oops_buf_sz = lz4_compressbound(psinfo->bufsize); + big_oops_buf_sz = LZ4_compressBound(psinfo->bufsize); big_oops_buf = kmalloc(big_oops_buf_sz, GFP_KERNEL); if (big_oops_buf) { workspace = kmalloc(LZ4_MEM_COMPRESS, GFP_KERNEL); diff --git a/fs/squashfs/lz4_wrapper.c b/fs/squashfs/lz4_wrapper.c index ff4468b..95da653 100644 --- a/fs/squashfs/lz4_wrapper.c +++ b/fs/squashfs/lz4_wrapper.c @@ -97,7 +97,6 @@ static int lz4_uncompress(struct squashfs_sb_info *msblk, void *strm, struct squashfs_lz4 *stream = strm; void *buff = stream->input, *data; int avail, i, bytes = length, res; - size_t dest_len = output->length; for (i = 0; i < b; i++) { avail = min(bytes, msblk->devblksize - offset); @@ -108,12 +107,13 @@ static int lz4_uncompress(struct squashfs_sb_info *msblk, void *strm, put_bh(bh[i]); } - res = lz4_decompress_unknownoutputsize(stream->input, length, - stream->output, &dest_len); - if (res) + res = LZ4_decompress_safe(stream->input, stream->output, + length, output->length); + + if (res < 0) return -EIO; - bytes = dest_len; + bytes = res; data = squashfs_first_page(output); buff = stream->output; while (data) { @@ -128,7 +128,7 @@ static int lz4_uncompress(struct squashfs_sb_info *msblk, void *strm, } squashfs_finish_page(output); - return dest_len; + return res; } const struct squashfs_decompressor squashfs_lz4_comp_ops = { -- 2.1.4
[PATCH 2/4] lib/decompress_unlz4: Change module to work with new LZ4 module version
This patch updates the unlz4 wrapper to work with the updated LZ4 kernel module version. Signed-off-by: Sven Schmidt <4ssch...@informatik.uni-hamburg.de> --- lib/decompress_unlz4.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/decompress_unlz4.c b/lib/decompress_unlz4.c index 036fc88..1b0baf3 100644 --- a/lib/decompress_unlz4.c +++ b/lib/decompress_unlz4.c @@ -72,7 +72,7 @@ STATIC inline int INIT unlz4(u8 *input, long in_len, error("NULL input pointer and missing fill function"); goto exit_1; } else { - inp = large_malloc(lz4_compressbound(uncomp_chunksize)); + inp = large_malloc(LZ4_compressBound(uncomp_chunksize)); if (!inp) { error("Could not allocate input buffer"); goto exit_1; @@ -136,7 +136,7 @@ STATIC inline int INIT unlz4(u8 *input, long in_len, inp += 4; size -= 4; } else { - if (chunksize > lz4_compressbound(uncomp_chunksize)) { + if (chunksize > LZ4_compressBound(uncomp_chunksize)) { error("chunk length is longer than allocated"); goto exit_2; } @@ -152,11 +152,14 @@ STATIC inline int INIT unlz4(u8 *input, long in_len, out_len -= dest_len; } else dest_len = out_len; - ret = lz4_decompress(inp, &chunksize, outp, dest_len); + + ret = LZ4_decompress_fast(inp, outp, dest_len); + chunksize = ret; #else dest_len = uncomp_chunksize; - ret = lz4_decompress_unknownoutputsize(inp, chunksize, outp, - &dest_len); + + ret = LZ4_decompress_safe(inp, outp, chunksize, dest_len); + dest_len = ret; #endif if (ret < 0) { error("Decoding failed"); -- 2.1.4
[PATCH 3/4] crypto: Change LZ4 modules to work with new LZ4 module version
This patch updates the crypto modules using LZ4 compression to work with the new LZ4 module version. Signed-off-by: Sven Schmidt <4ssch...@informatik.uni-hamburg.de> --- crypto/lz4.c | 21 - crypto/lz4hc.c | 21 - 2 files changed, 16 insertions(+), 26 deletions(-) diff --git a/crypto/lz4.c b/crypto/lz4.c index 99c1b2c..40fd2c2 100644 --- a/crypto/lz4.c +++ b/crypto/lz4.c @@ -66,15 +66,13 @@ static void lz4_exit(struct crypto_tfm *tfm) static int __lz4_compress_crypto(const u8 *src, unsigned int slen, u8 *dst, unsigned int *dlen, void *ctx) { - size_t tmp_len = *dlen; - int err; + int out_len = LZ4_compress_default(src, dst, + slen, (int)((size_t)dlen), ctx); - err = lz4_compress(src, slen, dst, &tmp_len, ctx); - - if (err < 0) + if (!out_len) return -EINVAL; - *dlen = tmp_len; + *dlen = out_len; return 0; } @@ -96,16 +94,13 @@ static int lz4_compress_crypto(struct crypto_tfm *tfm, const u8 *src, static int __lz4_decompress_crypto(const u8 *src, unsigned int slen, u8 *dst, unsigned int *dlen, void *ctx) { - int err; - size_t tmp_len = *dlen; - size_t __slen = slen; + int out_len = LZ4_decompress_safe(src, dst, slen, (int)((size_t)dlen)); - err = lz4_decompress_unknownoutputsize(src, __slen, dst, &tmp_len); - if (err < 0) + if (out_len < 0) return -EINVAL; - *dlen = tmp_len; - return err; + *dlen = out_len; + return out_len; } static int lz4_sdecompress(struct crypto_scomp *tfm, const u8 *src, diff --git a/crypto/lz4hc.c b/crypto/lz4hc.c index 75ffc4a..6f16f96 100644 --- a/crypto/lz4hc.c +++ b/crypto/lz4hc.c @@ -65,15 +65,13 @@ static void lz4hc_exit(struct crypto_tfm *tfm) static int __lz4hc_compress_crypto(const u8 *src, unsigned int slen, u8 *dst, unsigned int *dlen, void *ctx) { - size_t tmp_len = *dlen; - int err; + int out_len = LZ4_compress_HC(src, dst, slen, + (int)((size_t)dlen), LZ4HC_DEFAULT_CLEVEL, ctx); - err = lz4hc_compress(src, slen, dst, &tmp_len, ctx); - - if (err < 0) + if (out_len == 0) return -EINVAL; - *dlen = tmp_len; + *dlen = out_len; return 0; } @@ -97,16 +95,13 @@ static int lz4hc_compress_crypto(struct crypto_tfm *tfm, const u8 *src, static int __lz4hc_decompress_crypto(const u8 *src, unsigned int slen, u8 *dst, unsigned int *dlen, void *ctx) { - int err; - size_t tmp_len = *dlen; - size_t __slen = slen; + int out_len = LZ4_decompress_safe(src, dst, slen, (int)((size_t)dlen)); - err = lz4_decompress_unknownoutputsize(src, __slen, dst, &tmp_len); - if (err < 0) + if (out_len < 0) return -EINVAL; - *dlen = tmp_len; - return err; + *dlen = out_len; + return out_len; } static int lz4hc_sdecompress(struct crypto_scomp *tfm, const u8 *src, -- 2.1.4
[PATCH 1/4] lib: Update LZ4 compressor module
This patch updates LZ4 kernel module to LZ4 v1.7.3 by Yann Collet. The kernel module is inspired by the previous work by Chanho Min. The updated LZ4 module will not break existing code since there were alias methods added to ensure backwards compatibility. API changes: New method LZ4_compress_fast which differs from the variant available in kernel by the new acceleration parameter, allowing to trade compression ratio for more compression speed and vice versa. LZ4_decompress_fast is the respective decompression method, featuring a very fast decoder (multiple GB/s per core), able to reach RAM speed in multi-core systems. The decompressor allows to decompress data compressed with LZ4 fast as well as the LZ4 HC (high compression) algorithm. Also the useful functions LZ4_decompress_safe_partial LZ4_compress_destsize were added. The latter reverses the logic by trying to compress as much data as possible from source to dest while the former aims to decompress partial blocks of data. A bunch of streaming functions were also added which allow compressig/decompressing data in multiple steps (so called "streaming mode"). The methods lz4_compress and lz4_decompress_unknownoutputsize are now known as LZ4_compress_default respectivley LZ4_decompress_safe. The old methods are still available for providing backwards compatibility. Signed-off-by: Sven Schmidt <4ssch...@informatik.uni-hamburg.de> --- include/linux/lz4.h | 581 +--- lib/lz4/lz4_compress.c | 1103 -- lib/lz4/lz4_decompress.c | 694 ++--- lib/lz4/lz4defs.h| 320 -- lib/lz4/lz4hc_compress.c | 855 ++- 5 files changed, 2477 insertions(+), 1076 deletions(-) diff --git a/include/linux/lz4.h b/include/linux/lz4.h index 6b784c5..5bd21c1 100644 --- a/include/linux/lz4.h +++ b/include/linux/lz4.h @@ -1,87 +1,546 @@ -#ifndef __LZ4_H__ -#define __LZ4_H__ -/* - * LZ4 Kernel Interface +/* LZ4 Kernel Interface * * Copyright (C) 2013, LG Electronics, Kyungsik Lee + * Copyright (C) 2016, Sven Schmidt <4ssch...@informatik.uni-hamburg.de> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. + * + * This file is based on the original header file + * for LZ4 - Fast LZ compression algorithm. + * + * LZ4 - Fast LZ compression algorithm + * Copyright (C) 2011-2016, Yann Collet. + * BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * You can contact the author at : + * - LZ4 homepage : http://www.lz4.org + * - LZ4 source repository : https://github.com/lz4/lz4 + */ + +#ifndef __LZ4_H__ +#define __LZ4_H__ + +#include +#include/* memset, memcpy */ + +/*- + * CONSTANTS + **/ +/* + * LZ4_MEMORY_USAGE : + * Memory usage formula : N->2^N Bytes + * (examples : 10 -> 1KB; 12 -> 4KB ; 16 -> 64KB; 20 -> 1MB; etc.) + * Increasing memory usage improves compression ratio + * Reduced memory usage can improve speed, due to cache effect + * Default value is 14, for 16KB, which nicely fits into Intel x86 L1 cache + */ +#define LZ4_MEMORY_USAGE 10 + +#define LZ4_MAX_INPUT_SIZE 0x7E00 /* 2 113 929 216 bytes */ +#define LZ4_COMPRESSBOUND(isize) (\ + (unsigned int)(isize) > (unsigned int)LZ4_MAX_INPUT_SIZE \ + ? 0 \ + : (isize) + ((isize)/255) + 16) + +#define L
[PATCH] powerpc/mm: Return directly after a failed __copy_from_user() in sys_subpage_prot()
From: Markus Elfring Date: Sat, 21 Jan 2017 16:10:50 +0100 * Return directly after a call of the function "__copy_from_user" failed here. This issue was detected by using the Coccinelle software. * Delete the jump label "out2" which became unnecessary with this refactoring. Signed-off-by: Markus Elfring --- arch/powerpc/mm/subpage-prot.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/powerpc/mm/subpage-prot.c b/arch/powerpc/mm/subpage-prot.c index d5543514c1df..40309edd7cb7 100644 --- a/arch/powerpc/mm/subpage-prot.c +++ b/arch/powerpc/mm/subpage-prot.c @@ -248,9 +248,8 @@ long sys_subpage_prot(unsigned long addr, unsigned long len, u32 __user *map) nw = (next - addr) >> PAGE_SHIFT; up_write(&mm->mmap_sem); - err = -EFAULT; if (__copy_from_user(spp, map, nw * sizeof(u32))) - goto out2; + return -EFAULT; map += nw; down_write(&mm->mmap_sem); @@ -262,6 +261,5 @@ long sys_subpage_prot(unsigned long addr, unsigned long len, u32 __user *map) err = 0; out: up_write(&mm->mmap_sem); - out2: return err; } -- 2.11.0
Re: [PATCH 1/4] lib: Update LZ4 compressor module
Hi Sven, [auto build test ERROR on linus/master] [also build test ERROR on v4.10-rc4 next-20170120] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Sven-Schmidt/Update-LZ4-compressor-module/20170121-231418 config: i386-randconfig-r0-201703 (attached as .config) compiler: gcc-5 (Debian 5.4.1-2) 5.4.1 20160904 reproduce: # save the attached .config to linux build tree make ARCH=i386 Note: the linux-review/Sven-Schmidt/Update-LZ4-compressor-module/20170121-231418 HEAD 0472409e2a1c442b51502961aa6d83b866218953 builds fine. It only hurts bisectibility. All errors (new ones prefixed by >>): fs/pstore/platform.c: In function 'allocate_lz4': >> fs/pstore/platform.c:369:20: error: implicit declaration of function >> 'lz4_compressbound' [-Werror=implicit-function-declaration] big_oops_buf_sz = lz4_compressbound(psinfo->bufsize); ^ cc1: some warnings being treated as errors vim +/lz4_compressbound +369 fs/pstore/platform.c 8cfc8ddc Geliang Tang 2016-02-18 363 8cfc8ddc Geliang Tang 2016-02-18 364 return outlen; 8cfc8ddc Geliang Tang 2016-02-18 365 } 8cfc8ddc Geliang Tang 2016-02-18 366 8cfc8ddc Geliang Tang 2016-02-18 367 static void allocate_lz4(void) 8cfc8ddc Geliang Tang 2016-02-18 368 { 8cfc8ddc Geliang Tang 2016-02-18 @369 big_oops_buf_sz = lz4_compressbound(psinfo->bufsize); 8cfc8ddc Geliang Tang 2016-02-18 370 big_oops_buf = kmalloc(big_oops_buf_sz, GFP_KERNEL); 8cfc8ddc Geliang Tang 2016-02-18 371 if (big_oops_buf) { 8cfc8ddc Geliang Tang 2016-02-18 372 workspace = kmalloc(LZ4_MEM_COMPRESS, GFP_KERNEL); :: The code at line 369 was first introduced by commit :: 8cfc8ddc99df9509a46043b14af81f5c6a223eab pstore: add lzo/lz4 compression support :: TO: Geliang Tang :: CC: Kees Cook --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip
Re: [PATCH 1/2] i2c: mux: pca954x: Export OF device ID table as module aliases
On 2017-01-16 14:54, Javier Martinez Canillas wrote: > The I2C core always reports a MODALIAS of the form i2c: even if the > device was registered via OF, this means that exporting the OF device ID > table device aliases in the module is not needed. But in order to change > how the core reports modaliases to user-space, it's better to export it. > > Signed-off-by: Javier Martinez Canillas Acked-by: Peter Rosin > --- > > drivers/i2c/muxes/i2c-mux-pca954x.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/i2c/muxes/i2c-mux-pca954x.c > b/drivers/i2c/muxes/i2c-mux-pca954x.c > index dd18b9ccb1f4..a0232e079545 100644 > --- a/drivers/i2c/muxes/i2c-mux-pca954x.c > +++ b/drivers/i2c/muxes/i2c-mux-pca954x.c > @@ -148,6 +148,7 @@ static const struct of_device_id pca954x_of_match[] = { > { .compatible = "nxp,pca9548", .data = &chips[pca_9548] }, > {} > }; > +MODULE_DEVICE_TABLE(of, pca954x_of_match); > #endif > > /* Write to mux register. Don't use i2c_transfer()/i2c_smbus_xfer() >
[PATCH] KVM: s390: Move two error code assignments in kvm_vm_ioctl_get_dirty_log()
From: Markus Elfring Date: Sat, 21 Jan 2017 16:52:23 +0100 A local variable was set to an error code in two cases before a concrete error situation was detected. Thus move the corresponding assignments into if branches to indicate a software failure there. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- arch/s390/kvm/kvm-s390.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index 4f74511015b8..bc875d08b838 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c @@ -443,16 +443,17 @@ int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm, int is_dirty = 0; mutex_lock(&kvm->slots_lock); - - r = -EINVAL; - if (log->slot >= KVM_USER_MEM_SLOTS) + if (log->slot >= KVM_USER_MEM_SLOTS) { + r = -EINVAL; goto out; + } slots = kvm_memslots(kvm); memslot = id_to_memslot(slots, log->slot); - r = -ENOENT; - if (!memslot->dirty_bitmap) + if (!memslot->dirty_bitmap) { + r = -ENOENT; goto out; + } kvm_s390_sync_dirty_log(kvm, memslot); r = kvm_get_dirty_log(kvm, log, &is_dirty); -- 2.11.0
[PATCH] regulator: axp20x: AXP806: Fix dcdcb being set instead of dcdce
A typo or copy-paste bug means that the register access intended for regulator dcdce goes to dcdcb instead. This patch corrects it. Signed-off-by: Rask Ingemann Lambertsen Fixes: 2ca342d391e3 (regulator: axp20x: Support AXP806 variant) --- I have a board where dcdcb powers the DRAM, which I found running at 2.05 V rather than 1.50 V. The bug was introduced nearly five months ago. Thanks must go to Samsung for making DRAM chips which tolerate that sort of abuse. drivers/regulator/axp20x-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c index e6a512e..a3ade9e 100644 --- a/drivers/regulator/axp20x-regulator.c +++ b/drivers/regulator/axp20x-regulator.c @@ -272,7 +272,7 @@ static const struct regulator_desc axp806_regulators[] = { 64, AXP806_DCDCD_V_CTRL, 0x3f, AXP806_PWR_OUT_CTRL1, BIT(3)), AXP_DESC(AXP806, DCDCE, "dcdce", "vine", 1100, 3400, 100, -AXP806_DCDCB_V_CTRL, 0x1f, AXP806_PWR_OUT_CTRL1, BIT(4)), +AXP806_DCDCE_V_CTRL, 0x1f, AXP806_PWR_OUT_CTRL1, BIT(4)), AXP_DESC(AXP806, ALDO1, "aldo1", "aldoin", 700, 3300, 100, AXP806_ALDO1_V_CTRL, 0x1f, AXP806_PWR_OUT_CTRL1, BIT(5)), AXP_DESC(AXP806, ALDO2, "aldo2", "aldoin", 700, 3400, 100, -- 2.10.2 -- Rask Ingemann Lambertsen
Re: [PATCH 2/2] i2c: pca9541: Export OF device ID table as module aliases
On 2017-01-16 14:54, Javier Martinez Canillas wrote: > The I2C core always reports a MODALIAS of the form i2c: even if the > device was registered via OF, this means that exporting the OF device ID > table device aliases in the module is not needed. But in order to change > how the core reports modaliases to user-space, it's better to export it. > > Signed-off-by: Javier Martinez Canillas Acked-by: Peter Rosin > --- > > drivers/i2c/muxes/i2c-mux-pca9541.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/i2c/muxes/i2c-mux-pca9541.c > b/drivers/i2c/muxes/i2c-mux-pca9541.c > index 4ea7e691afc7..77840f7845a1 100644 > --- a/drivers/i2c/muxes/i2c-mux-pca9541.c > +++ b/drivers/i2c/muxes/i2c-mux-pca9541.c > @@ -90,6 +90,7 @@ static const struct of_device_id pca9541_of_match[] = { > { .compatible = "nxp,pca9541" }, > {} > }; > +MODULE_DEVICE_TABLE(of, pca9541_of_match); > #endif > > /* >
Re: [PATCH 1/4] lib: Update LZ4 compressor module
Hi Sven, [auto build test ERROR on linus/master] [also build test ERROR on v4.10-rc4 next-20170120] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Sven-Schmidt/Update-LZ4-compressor-module/20170121-231418 config: x86_64-lkp (attached as .config) compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce: # save the attached .config to linux build tree make ARCH=x86_64 Note: the linux-review/Sven-Schmidt/Update-LZ4-compressor-module/20170121-231418 HEAD 0472409e2a1c442b51502961aa6d83b866218953 builds fine. It only hurts bisectibility. All errors (new ones prefixed by >>): In file included from lib/decompress_unlz4.c:19:0: lib/decompress_unlz4.c: In function 'unlz4': >> lib/decompress_unlz4.c:75:22: error: implicit declaration of function >> 'lz4_compressbound' [-Werror=implicit-function-declaration] inp = large_malloc(lz4_compressbound(uncomp_chunksize)); ^ include/linux/decompress/mm.h:83:33: note: in definition of macro 'large_malloc' #define large_malloc(a) vmalloc(a) ^ cc1: some warnings being treated as errors vim +/lz4_compressbound +75 lib/decompress_unlz4.c e76e1fdf Kyungsik Lee 2013-07-08 13 #include "lz4/lz4_decompress.c" e76e1fdf Kyungsik Lee 2013-07-08 14 #else e76e1fdf Kyungsik Lee 2013-07-08 15 #include e76e1fdf Kyungsik Lee 2013-07-08 16 #endif e76e1fdf Kyungsik Lee 2013-07-08 17 #include e76e1fdf Kyungsik Lee 2013-07-08 18 #include e76e1fdf Kyungsik Lee 2013-07-08 @19 #include e76e1fdf Kyungsik Lee 2013-07-08 20 #include e76e1fdf Kyungsik Lee 2013-07-08 21 e76e1fdf Kyungsik Lee 2013-07-08 22 #include e76e1fdf Kyungsik Lee 2013-07-08 23 e76e1fdf Kyungsik Lee 2013-07-08 24 /* e76e1fdf Kyungsik Lee 2013-07-08 25 * Note: Uncompressed chunk size is used in the compressor side e76e1fdf Kyungsik Lee 2013-07-08 26 * (userspace side for compression). e76e1fdf Kyungsik Lee 2013-07-08 27 * It is hardcoded because there is not proper way to extract it e76e1fdf Kyungsik Lee 2013-07-08 28 * from the binary stream which is generated by the preliminary e76e1fdf Kyungsik Lee 2013-07-08 29 * version of LZ4 tool so far. e76e1fdf Kyungsik Lee 2013-07-08 30 */ e76e1fdf Kyungsik Lee 2013-07-08 31 #define LZ4_DEFAULT_UNCOMPRESSED_CHUNK_SIZE (8 << 20) e76e1fdf Kyungsik Lee 2013-07-08 32 #define ARCHIVE_MAGICNUMBER 0x184C2102 e76e1fdf Kyungsik Lee 2013-07-08 33 d97b07c5 Yinghai Lu 2014-08-08 34 STATIC inline int INIT unlz4(u8 *input, long in_len, d97b07c5 Yinghai Lu 2014-08-08 35long (*fill)(void *, unsigned long), d97b07c5 Yinghai Lu 2014-08-08 36long (*flush)(void *, unsigned long), d97b07c5 Yinghai Lu 2014-08-08 37u8 *output, long *posp, e76e1fdf Kyungsik Lee 2013-07-08 38void (*error) (char *x)) e76e1fdf Kyungsik Lee 2013-07-08 39 { e76e1fdf Kyungsik Lee 2013-07-08 40int ret = -1; e76e1fdf Kyungsik Lee 2013-07-08 41size_t chunksize = 0; e76e1fdf Kyungsik Lee 2013-07-08 42size_t uncomp_chunksize = LZ4_DEFAULT_UNCOMPRESSED_CHUNK_SIZE; e76e1fdf Kyungsik Lee 2013-07-08 43u8 *inp; e76e1fdf Kyungsik Lee 2013-07-08 44u8 *inp_start; e76e1fdf Kyungsik Lee 2013-07-08 45u8 *outp; d97b07c5 Yinghai Lu 2014-08-08 46long size = in_len; e76e1fdf Kyungsik Lee 2013-07-08 47 #ifdef PREBOOT e76e1fdf Kyungsik Lee 2013-07-08 48size_t out_len = get_unaligned_le32(input + in_len); e76e1fdf Kyungsik Lee 2013-07-08 49 #endif e76e1fdf Kyungsik Lee 2013-07-08 50size_t dest_len; e76e1fdf Kyungsik Lee 2013-07-08 51 e76e1fdf Kyungsik Lee 2013-07-08 52 e76e1fdf Kyungsik Lee 2013-07-08 53if (output) { e76e1fdf Kyungsik Lee 2013-07-08 54outp = output; e76e1fdf Kyungsik Lee 2013-07-08 55} else if (!flush) { e76e1fdf Kyungsik Lee 2013-07-08 56error("NULL output pointer and no flush function provided"); e76e1fdf Kyungsik Lee 2013-07-08 57goto exit_0; e76e1fdf Kyungsik Lee 2013-07-08 58} else { e76e1fdf Kyungsik Lee 2013-07-08 59outp = large_malloc(uncomp_chunksize); e76e1fdf Kyungsik Lee 2013-07-08 60if (!outp) { e76e1fdf Kyungsik Lee 2013-07-08 61error("Could not allocate output buffer"); e76e1fdf Kyungsik Lee 2013-07-08 62goto exit_0; e76e1fdf Kyungsik Lee 2013-07-08 63} e76e1fdf Kyungsik Lee 2013-07-08 64} e76e1fdf Kyungsik Lee 2013-07-08 65 e76e1fdf Kyungsik Lee 2013-07-08 66if (input && fill) { e76e1fdf Kyungsik Lee 2013-07-08 67error("Both input pointer and fill function provided,"); e76e1fdf Kyungsik Lee 2013-
[PATCH] uapi glibc compat: fix build if libc defines IFF_ECHO
musl 1.1.15 defines IFF_ECHO and the other net_device_flags options. When a user application includes linux/if.h and net/if.h the compile will fail. Activate __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO only when it is needed. This should also make this work in case glibc will add these defines. Signed-off-by: Hauke Mehrtens --- include/uapi/linux/libc-compat.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h index 44b8a6bd5fe1..dbf16a3de4d2 100644 --- a/include/uapi/linux/libc-compat.h +++ b/include/uapi/linux/libc-compat.h @@ -64,9 +64,11 @@ /* Everything up to IFF_DYNAMIC, matches net/if.h until glibc 2.23 */ #define __UAPI_DEF_IF_NET_DEVICE_FLAGS 0 /* For the future if glibc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */ +#ifndef IFF_ECHO #ifndef __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO #define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1 #endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO */ +#endif /* IFF_ECHO */ #else /* _NET_IF_H */ -- 2.11.0
Re: [alsa-devel] [PATCH v7 2/5] clk: x86: Add Atom PMC platform clocks
Thanks for the review Stephen. On 1/20/17 5:58 PM, Stephen Boyd wrote: On 01/17, Pierre-Louis Bossart wrote: diff --git a/drivers/clk/x86/clk-pmc-atom.c b/drivers/clk/x86/clk-pmc-atom.c new file mode 100644 index 000..312d4e9 --- /dev/null +++ b/drivers/clk/x86/clk-pmc-atom.c [...] + +static void plt_clk_reg_update(struct clk_plt *clk, u32 mask, u32 val) +{ + u32 tmp; + unsigned long flags; + + spin_lock_irqsave(&clk->lock, flags); + + tmp = clk_readl(clk->reg); Do you need to use clk_readl? I'd prefer we deleted that function/macro because it's just confusing. Please don't use it unless you need it for some reason. I just followed Andy's recommendation and will revert to readl/writel, as well as fix the nitpicks below + tmp = (tmp & ~mask) | (val & mask); + clk_writel(tmp, clk->reg); + + spin_unlock_irqrestore(&clk->lock, flags); +} + [..] + +static void plt_clk_unregister_parents(struct clk_plt_data *data) +{ + plt_clk_unregister_fixed_rate_loop(data, data->nparents); +} + + Nitpick: Single newline please ok +static struct platform_driver plt_clk_driver = { + .driver = { + .name = PLT_CLK_DRIVER_NAME, Nitpick: Just put the string here ok
RE: [PATCH 00/13] dax, pmem: move cpu cache maintenance to libnvdimm
From: Dan Williams [mailto:dan.j.willi...@intel.com] > A couple weeks back, in the course of reviewing the memcpy_nocache() > proposal from Brian, Linus subtly suggested that the pmem specific > memcpy_to_pmem() routine be moved to be implemented at the driver > level [1]: Of course, there may not be a backing device either! That will depend on the filesystem. I see two possible routes here: 1. Add a new address_space_operation: const struct dax_operations *(*get_dax_ops)(struct address_space *); 2. Add two of the dax_operations to address_space_operations: size_t (*copy_from_iter)(struct address_space *, void *, size_t, struct iov_iter *); void (*flush)(struct address_space *, void *, size_t); (we won't need ->direct_access as an address_space op because that'll be handled a different way in the brave new world that supports non-bdev-based filesystems) Obviously in either case we'd have generic bdev versions for ext4, xfs and other block based filesystems, but filesystems with a character device or a network protocol behind them would do whatever it is they need to do. I kind of prefer the second option, but does anyone else have a preference?
[PATCH v2 16/26] drm/rockchip: dw-mipi-dsi: configure bias and bandgap before enable
We should configure these functions before enabling them. Signed-off-by: John Keeping --- Unchanged in v2 --- drivers/gpu/drm/rockchip/dw-mipi-dsi.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c index 5b3068e9e8db..ce1e6f9a2041 100644 --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c @@ -420,6 +420,11 @@ static int dw_mipi_dsi_phy_init(struct dw_mipi_dsi *dsi) dw_mipi_dsi_phy_write(dsi, 0x18, LOOP_DIV_HIGH_SEL(dsi->feedback_div) | HIGH_PROGRAM_EN); + dw_mipi_dsi_phy_write(dsi, 0x22, LOW_PROGRAM_EN | +BIASEXTR_SEL(BIASEXTR_127_7)); + dw_mipi_dsi_phy_write(dsi, 0x22, HIGH_PROGRAM_EN | +BANDGAP_SEL(BANDGAP_96_10)); + dw_mipi_dsi_phy_write(dsi, 0x20, POWER_CONTROL | INTERNAL_REG_CURRENT | BIAS_BLOCK_ON | BANDGAP_ON); @@ -429,10 +434,6 @@ static int dw_mipi_dsi_phy_init(struct dw_mipi_dsi *dsi) SETRD_MAX | POWER_MANAGE | TER_RESISTORS_ON); - dw_mipi_dsi_phy_write(dsi, 0x22, LOW_PROGRAM_EN | -BIASEXTR_SEL(BIASEXTR_127_7)); - dw_mipi_dsi_phy_write(dsi, 0x22, HIGH_PROGRAM_EN | -BANDGAP_SEL(BANDGAP_96_10)); dw_mipi_dsi_phy_write(dsi, 0x70, TLP_PROGRAM_EN | 0xf); dw_mipi_dsi_phy_write(dsi, 0x71, THS_PRE_PROGRAM_EN | 0x55); -- 2.11.0.197.gb556de5.dirty
[PATCH v2 13/26] drm/rockchip: dw-mipi-dsi: allow commands in panel_disable
Panel drivers may want to sent commands during the disable function, for example MIPI_DCS_SET_DISPLAY_OFF before the video signal ends. In order to send commands we need to write to registers, so pclk must be enabled. While changing this, remove the unnecessary code after the panel unprepare call which seems to be a workaround for a specific panel and thus belongs in the panel driver. Signed-off-by: John Keeping --- Unchanged in v2 --- drivers/gpu/drm/rockchip/dw-mipi-dsi.c | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c index 7ada6d8ed143..290282e86d16 100644 --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c @@ -846,24 +846,16 @@ static void dw_mipi_dsi_encoder_disable(struct drm_encoder *encoder) { struct dw_mipi_dsi *dsi = encoder_to_dsi(encoder); - drm_panel_disable(dsi->panel); - if (clk_prepare_enable(dsi->pclk)) { dev_err(dsi->dev, "%s: Failed to enable pclk\n", __func__); return; } + drm_panel_disable(dsi->panel); + dw_mipi_dsi_set_mode(dsi, DW_MIPI_DSI_CMD_MODE); drm_panel_unprepare(dsi->panel); - dw_mipi_dsi_set_mode(dsi, DW_MIPI_DSI_VID_MODE); - /* -* This is necessary to make sure the peripheral will be driven -* normally when the display is enabled again later. -*/ - msleep(120); - - dw_mipi_dsi_set_mode(dsi, DW_MIPI_DSI_CMD_MODE); dw_mipi_dsi_disable(dsi); clk_disable_unprepare(dsi->pclk); } -- 2.11.0.197.gb556de5.dirty
[PATCH v2 22/26] drm/rockchip: vop: test for P{H,V}SYNC
When connected to the MIPI DSI output, we need to use N{H,V}SYNC for the internal connection but these flags are meaningless for DSI panels. Switch the test so that we do not set the P{H,V}SYNC bits unless the mode requires it. Signed-off-by: John Keeping --- Unchanged in v2 --- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index c7eba305c488..67aefc6d4e9a 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -933,8 +933,8 @@ static void vop_crtc_enable(struct drm_crtc *crtc) } pin_pol = 0x8; - pin_pol |= (adjusted_mode->flags & DRM_MODE_FLAG_NHSYNC) ? 0 : 1; - pin_pol |= (adjusted_mode->flags & DRM_MODE_FLAG_NVSYNC) ? 0 : (1 << 1); + pin_pol |= (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC) ? 1 : 0; + pin_pol |= (adjusted_mode->flags & DRM_MODE_FLAG_PVSYNC) ? (1 << 1) : 0; VOP_CTRL_SET(vop, pin_pol, pin_pol); switch (s->output_type) { -- 2.11.0.197.gb556de5.dirty
[PATCH v2 17/26] drm/rockchip: dw-mipi-dsi: don't enable PHY PLL until it's configured
Signed-off-by: John Keeping --- Unchanged in v2 --- drivers/gpu/drm/rockchip/dw-mipi-dsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c index ce1e6f9a2041..cfe7e4ba305c 100644 --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c @@ -413,12 +413,12 @@ static int dw_mipi_dsi_phy_init(struct dw_mipi_dsi *dsi) dw_mipi_dsi_phy_write(dsi, 0x44, HSFREQRANGE_SEL(testdin)); - dw_mipi_dsi_phy_write(dsi, 0x19, PLL_LOOP_DIV_EN | PLL_INPUT_DIV_EN); dw_mipi_dsi_phy_write(dsi, 0x17, INPUT_DIVIDER(dsi->input_div)); dw_mipi_dsi_phy_write(dsi, 0x18, LOOP_DIV_LOW_SEL(dsi->feedback_div) | LOW_PROGRAM_EN); dw_mipi_dsi_phy_write(dsi, 0x18, LOOP_DIV_HIGH_SEL(dsi->feedback_div) | HIGH_PROGRAM_EN); + dw_mipi_dsi_phy_write(dsi, 0x19, PLL_LOOP_DIV_EN | PLL_INPUT_DIV_EN); dw_mipi_dsi_phy_write(dsi, 0x22, LOW_PROGRAM_EN | BIASEXTR_SEL(BIASEXTR_127_7)); -- 2.11.0.197.gb556de5.dirty
[PATCH v2 11/26] drm/rockchip: dw-mipi-dsi: don't assume buffer is aligned
By dereferencing the MIPI command buffer as a u32* we rely on it being correctly aligned on ARM, but this may not be the case. Copy it into a stack variable that will be correctly aligned. Signed-off-by: John Keeping --- Unchanged in v2 --- drivers/gpu/drm/rockchip/dw-mipi-dsi.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c index 03fc096fe1bd..ddbc037e7ced 100644 --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c @@ -607,10 +607,10 @@ static int dw_mipi_dsi_dcs_short_write(struct dw_mipi_dsi *dsi, static int dw_mipi_dsi_dcs_long_write(struct dw_mipi_dsi *dsi, const struct mipi_dsi_msg *msg) { - const u32 *tx_buf = msg->tx_buf; - int len = msg->tx_len, pld_data_bytes = sizeof(*tx_buf), ret; + const u8 *tx_buf = msg->tx_buf; + int len = msg->tx_len, pld_data_bytes = sizeof(u32), ret; u32 hdr_val = GEN_HDATA(msg->tx_len) | GEN_HTYPE(msg->type); - u32 remainder = 0; + u32 remainder; u32 val; if (msg->tx_len < 3) { @@ -621,12 +621,14 @@ static int dw_mipi_dsi_dcs_long_write(struct dw_mipi_dsi *dsi, while (DIV_ROUND_UP(len, pld_data_bytes)) { if (len < pld_data_bytes) { + remainder = 0; memcpy(&remainder, tx_buf, len); dsi_write(dsi, DSI_GEN_PLD_DATA, remainder); len = 0; } else { - dsi_write(dsi, DSI_GEN_PLD_DATA, *tx_buf); - tx_buf++; + memcpy(&remainder, tx_buf, pld_data_bytes); + dsi_write(dsi, DSI_GEN_PLD_DATA, remainder); + tx_buf += pld_data_bytes; len -= pld_data_bytes; } -- 2.11.0.197.gb556de5.dirty
[PATCH v2 25/26] drm/rockchip: dw-mipi-dsi: add reset control
In order to fully reset the state of the MIPI controller we must assert this reset. This is slightly more complicated than it could be in order to maintain compatibility with device trees that do not specify the reset property. Signed-off-by: John Keeping --- Unchanged in v2 --- drivers/gpu/drm/rockchip/dw-mipi-dsi.c | 30 ++ 1 file changed, 30 insertions(+) diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c index 881bb0c62ca5..f780401e8b5e 100644 --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -1121,6 +1122,7 @@ static int dw_mipi_dsi_bind(struct device *dev, struct device *master, of_match_device(dw_mipi_dsi_dt_ids, dev); const struct dw_mipi_dsi_plat_data *pdata = of_id->data; struct platform_device *pdev = to_platform_device(dev); + struct reset_control *apb_rst; struct drm_device *drm = data; struct dw_mipi_dsi *dsi; struct resource *res; @@ -1159,6 +1161,34 @@ static int dw_mipi_dsi_bind(struct device *dev, struct device *master, return ret; } + /* +* Note that the reset was not defined in the initial device tree, so +* we have to be prepared for it not being found. +*/ + apb_rst = devm_reset_control_get(dev, "apb"); + if (IS_ERR(apb_rst)) { + if (PTR_ERR(apb_rst) == -ENODEV) { + apb_rst = NULL; + } else { + dev_err(dev, "Unable to get reset control: %d\n", ret); + return PTR_ERR(apb_rst); + } + } + + if (apb_rst) { + ret = clk_prepare_enable(dsi->pclk); + if (ret) { + dev_err(dev, "%s: Failed to enable pclk\n", __func__); + return ret; + } + + reset_control_assert(apb_rst); + usleep_range(10, 20); + reset_control_deassert(apb_rst); + + clk_disable_unprepare(dsi->pclk); + } + ret = clk_prepare_enable(dsi->pllref_clk); if (ret) { dev_err(dev, "%s: Failed to enable pllref_clk\n", __func__); -- 2.11.0.197.gb556de5.dirty
[PATCH v2 20/26] drm/rockchip: dw-mipi-dsi: use specific poll helper
As the documentation for readx_poll_timeout says, we want to use the specialized macro for readl rather than using the generic version directly. Signed-off-by: John Keeping --- Unchanged in v2 --- drivers/gpu/drm/rockchip/dw-mipi-dsi.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c index f2320cf1366c..3e19693ae59b 100644 --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c @@ -471,14 +471,14 @@ static int dw_mipi_dsi_phy_init(struct dw_mipi_dsi *dsi) PHY_UNRSTZ | PHY_UNSHUTDOWNZ); - ret = readx_poll_timeout(readl, dsi->base + DSI_PHY_STATUS, + ret = readl_poll_timeout(dsi->base + DSI_PHY_STATUS, val, val & LOCK, 1000, PHY_STATUS_TIMEOUT_US); if (ret < 0) { dev_err(dsi->dev, "failed to wait for phy lock state\n"); return ret; } - ret = readx_poll_timeout(readl, dsi->base + DSI_PHY_STATUS, + ret = readl_poll_timeout(dsi->base + DSI_PHY_STATUS, val, val & STOP_STATE_CLK_LANE, 1000, PHY_STATUS_TIMEOUT_US); if (ret < 0) { @@ -594,7 +594,7 @@ static int dw_mipi_dsi_gen_pkt_hdr_write(struct dw_mipi_dsi *dsi, u32 hdr_val) int ret; u32 val, mask; - ret = readx_poll_timeout(readl, dsi->base + DSI_CMD_PKT_STATUS, + ret = readl_poll_timeout(dsi->base + DSI_CMD_PKT_STATUS, val, !(val & GEN_CMD_FULL), 1000, CMD_PKT_STATUS_TIMEOUT_US); if (ret < 0) { @@ -605,7 +605,7 @@ static int dw_mipi_dsi_gen_pkt_hdr_write(struct dw_mipi_dsi *dsi, u32 hdr_val) dsi_write(dsi, DSI_GEN_HDR, hdr_val); mask = GEN_CMD_EMPTY | GEN_PLD_W_EMPTY; - ret = readx_poll_timeout(readl, dsi->base + DSI_CMD_PKT_STATUS, + ret = readl_poll_timeout(dsi->base + DSI_CMD_PKT_STATUS, val, (val & mask) == mask, 1000, CMD_PKT_STATUS_TIMEOUT_US); if (ret < 0) { @@ -664,7 +664,7 @@ static int dw_mipi_dsi_dcs_long_write(struct dw_mipi_dsi *dsi, len -= pld_data_bytes; } - ret = readx_poll_timeout(readl, dsi->base + DSI_CMD_PKT_STATUS, + ret = readl_poll_timeout(dsi->base + DSI_CMD_PKT_STATUS, val, !(val & GEN_PLD_W_FULL), 1000, CMD_PKT_STATUS_TIMEOUT_US); if (ret < 0) { -- 2.11.0.197.gb556de5.dirty