Re: [PATCH v05 06/72] include/uapi/linux/hsi/cs-protocol.h: include linux/time.h
On Mon, Aug 22, 2016 at 10:52:20PM +0200, Sebastian Reichel wrote: > Hi, > > On Mon, Aug 22, 2016 at 08:32:23PM +0200, Mikko Rapeli wrote: > > Fixes userspace compilation errors due to missing timespec definition. > > > > Signed-off-by: Mikko Rapeli > > --- > > include/uapi/linux/hsi/cs-protocol.h | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/include/uapi/linux/hsi/cs-protocol.h > > b/include/uapi/linux/hsi/cs-protocol.h > > index f153d6e..c8d9f08 100644 > > --- a/include/uapi/linux/hsi/cs-protocol.h > > +++ b/include/uapi/linux/hsi/cs-protocol.h > > @@ -26,6 +26,7 @@ > > > > #include > > #include > > +#include > > > > /* chardev parameters */ > > #define CS_DEV_FILE_NAME "/dev/cmt_speech" > > As far as I can see there header file does not use timespec since > I removed it roughly a year ago. Yes, your patch 5023a5ca8e144846ec0646554336000abb11e04f fixes also uapi compilation errors. This patch from me is not needed and even wrong for the API. -Mikko
[PATCH v2] fix:iio:common:st_sensors:st_sensors_trigger:mark symbols static where possible
We get 2 warnings when biuld kernel with W=1: drivers/iio/common/st_sensors/st_sensors_trigger.c:69:13: warning: no previous prototype for 'st_sensors_irq_handler' [-Wmissing-prototypes] drivers/iio/common/st_sensors/st_sensors_trigger.c:85:13: warning: no previous prototype for 'st_sensors_irq_thread' [-Wmissing-prototypes] In fact, these functions are only used in the file in which they are declared and don't need a declaration, but can be made static. so this patch marks these functions with 'static'. Signed-off-by: Baoyou Xie Reviewed-by: Linus Walleij --- drivers/iio/common/st_sensors/st_sensors_trigger.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/common/st_sensors/st_sensors_trigger.c b/drivers/iio/common/st_sensors/st_sensors_trigger.c index e66f12e..fa73e67 100644 --- a/drivers/iio/common/st_sensors/st_sensors_trigger.c +++ b/drivers/iio/common/st_sensors/st_sensors_trigger.c @@ -66,7 +66,7 @@ static int st_sensors_new_samples_available(struct iio_dev *indio_dev, * @irq: irq number * @p: private handler data */ -irqreturn_t st_sensors_irq_handler(int irq, void *p) +static irqreturn_t st_sensors_irq_handler(int irq, void *p) { struct iio_trigger *trig = p; struct iio_dev *indio_dev = iio_trigger_get_drvdata(trig); @@ -82,7 +82,7 @@ irqreturn_t st_sensors_irq_handler(int irq, void *p) * @irq: irq number * @p: private handler data */ -irqreturn_t st_sensors_irq_thread(int irq, void *p) +static irqreturn_t st_sensors_irq_thread(int irq, void *p) { struct iio_trigger *trig = p; struct iio_dev *indio_dev = iio_trigger_get_drvdata(trig); -- 2.7.4
Re: [PATCH] arch: all: include: asm: bitops: Use bool instead of int for all bit test functions
Hi Chen, [auto build test ERROR on linus/master] [also build test ERROR on v4.8-rc3 next-20160825] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] [Suggest to use git(>=2.9.0) format-patch --base= (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on] [Check https://git-scm.com/docs/git-format-patch for more information] url: https://github.com/0day-ci/linux/commits/chengang-emindsoft-com-cn/arch-all-include-asm-bitops-Use-bool-instead-of-int-for-all-bit-test-functions/20160828-134633 config: m68k-sun3_defconfig (attached as .config) compiler: m68k-linux-gcc (GCC) 4.9.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=m68k All errors (new ones prefixed by >>): In file included from include/linux/bitops.h:36:0, from include/linux/jhash.h:26, from net/ipv6/ila/ila_xlat.c:1: >> arch/m68k/include/asm/bitops.h:151:15: error: unknown type name 'bool' static inline bool test_bit(int nr, const unsigned long *vaddr) ^ arch/m68k/include/asm/bitops.h:157:15: error: unknown type name 'bool' static inline bool bset_reg_test_and_set_bit(int nr, ^ arch/m68k/include/asm/bitops.h:170:15: error: unknown type name 'bool' static inline bool bset_mem_test_and_set_bit(int nr, ^ arch/m68k/include/asm/bitops.h:182:15: error: unknown type name 'bool' static inline bool bfset_mem_test_and_set_bit(int nr, ^ arch/m68k/include/asm/bitops.h:207:15: error: unknown type name 'bool' static inline bool bclr_reg_test_and_clear_bit(int nr, ^ arch/m68k/include/asm/bitops.h:220:15: error: unknown type name 'bool' static inline bool bclr_mem_test_and_clear_bit(int nr, ^ arch/m68k/include/asm/bitops.h:232:15: error: unknown type name 'bool' static inline bool bfclr_mem_test_and_clear_bit(int nr, ^ arch/m68k/include/asm/bitops.h:257:15: error: unknown type name 'bool' static inline bool bchg_reg_test_and_change_bit(int nr, ^ arch/m68k/include/asm/bitops.h:270:15: error: unknown type name 'bool' static inline bool bchg_mem_test_and_change_bit(int nr, ^ arch/m68k/include/asm/bitops.h:282:15: error: unknown type name 'bool' static inline bool bfchg_mem_test_and_change_bit(int nr, ^ vim +/bool +151 arch/m68k/include/asm/bitops.h 145 bfchg_mem_change_bit(nr, vaddr)) 146 #endif 147 148 #define __change_bit(nr, vaddr) change_bit(nr, vaddr) 149 150 > 151 static inline bool test_bit(int nr, const unsigned long *vaddr) 152 { 153 return (vaddr[nr >> 5] & (1UL << (nr & 31))) != 0; 154 } --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: Binary data
Re: [PATCH] arch: all: include: asm: bitops: Use bool instead of int for all bit test functions
Hi Chen, [auto build test WARNING on linus/master] [also build test WARNING on v4.8-rc3 next-20160825] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] [Suggest to use git(>=2.9.0) format-patch --base= (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on] [Check https://git-scm.com/docs/git-format-patch for more information] url: https://github.com/0day-ci/linux/commits/chengang-emindsoft-com-cn/arch-all-include-asm-bitops-Use-bool-instead-of-int-for-all-bit-test-functions/20160828-134633 config: arm-at91_dt_defconfig (attached as .config) compiler: arm-linux-gnueabi-gcc (Debian 5.4.0-6) 5.4.0 20160609 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=arm All warnings (new ones prefixed by >>): In file included from include/linux/bitops.h:36:0, from include/linux/kernel.h:10, from include/linux/list.h:8, from include/linux/module.h:9, from net/sunrpc/clnt.c:21: include/linux/sunrpc/xprt.h: In function 'xprt_set_bound': >> arch/arm/include/asm/bitops.h:180:55: warning: value computed is not used >> [-Wunused-value] (__builtin_constant_p(nr) ? atomic_##name(nr, p) : _##name(nr,p)) ^ >> arch/arm/include/asm/bitops.h:191:33: note: in expansion of macro >> 'ATOMIC_BITOP' #define test_and_set_bit(nr,p) ATOMIC_BITOP(test_and_set_bit,nr,p) ^ include/linux/sunrpc/xprt.h:433:2: note: in expansion of macro 'test_and_set_bit' test_and_set_bit(XPRT_BOUND, &xprt->state); ^ vim +180 arch/arm/include/asm/bitops.h ^1da177e include/asm-arm/bitops.h Linus Torvalds 2005-04-16 174 e7ec0293 include/asm-arm/bitops.h Russell King 2005-07-28 175 #ifndef CONFIG_SMP ^1da177e include/asm-arm/bitops.h Linus Torvalds 2005-04-16 176 /* ^1da177e include/asm-arm/bitops.h Linus Torvalds 2005-04-16 177 * The __* form of bitops are non-atomic and may be reordered. ^1da177e include/asm-arm/bitops.h Linus Torvalds 2005-04-16 178 */ 6323f0cc arch/arm/include/asm/bitops.h Russell King 2011-01-16 179 #define ATOMIC_BITOP(name,nr,p) \ 6323f0cc arch/arm/include/asm/bitops.h Russell King 2011-01-16 @180 (__builtin_constant_p(nr) ? atomic_##name(nr, p) : _##name(nr,p)) e7ec0293 include/asm-arm/bitops.h Russell King 2005-07-28 181 #else 6323f0cc arch/arm/include/asm/bitops.h Russell King 2011-01-16 182 #define ATOMIC_BITOP(name,nr,p) _##name(nr,p) e7ec0293 include/asm-arm/bitops.h Russell King 2005-07-28 183 #endif ^1da177e include/asm-arm/bitops.h Linus Torvalds 2005-04-16 184 6323f0cc arch/arm/include/asm/bitops.h Russell King 2011-01-16 185 /* 6323f0cc arch/arm/include/asm/bitops.h Russell King 2011-01-16 186 * Native endian atomic definitions. 6323f0cc arch/arm/include/asm/bitops.h Russell King 2011-01-16 187 */ 6323f0cc arch/arm/include/asm/bitops.h Russell King 2011-01-16 188 #define set_bit(nr,p)ATOMIC_BITOP(set_bit,nr,p) 6323f0cc arch/arm/include/asm/bitops.h Russell King 2011-01-16 189 #define clear_bit(nr,p) ATOMIC_BITOP(clear_bit,nr,p) 6323f0cc arch/arm/include/asm/bitops.h Russell King 2011-01-16 190 #define change_bit(nr,p) ATOMIC_BITOP(change_bit,nr,p) 6323f0cc arch/arm/include/asm/bitops.h Russell King 2011-01-16 @191 #define test_and_set_bit(nr,p) ATOMIC_BITOP(test_and_set_bit,nr,p) 6323f0cc arch/arm/include/asm/bitops.h Russell King 2011-01-16 192 #define test_and_clear_bit(nr,p) ATOMIC_BITOP(test_and_clear_bit,nr,p) 6323f0cc arch/arm/include/asm/bitops.h Russell King 2011-01-16 193 #define test_and_change_bit(nr,p)ATOMIC_BITOP(test_and_change_bit,nr,p) ^1da177e include/asm-arm/bitops.h Linus Torvalds 2005-04-16 194 :: The code at line 180 was first introduced by commit :: 6323f0ccedf756dfe5f46549cec69a2d6d97937b ARM: bitops: switch set/clear/change bitops to use ldrex/strex :: TO: Russell King :: CC: Russell King --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: Binary data
[PATCH] fix:nv10_fence: mark symbols static where possible
We get 1 warning about global functions without a declaration in the nouveau nv10_fence driver when building with W=1: drivers/gpu/drm/nouveau/nv10_fence.c:70:1: warning: no previous prototype for 'nv10_fence_context_new' [-Wmissing-prototypes] In fact, this function is only used in the file in which it is declared and don't need a declaration, but can be made static. so this patch marks it 'static'. Signed-off-by: Baoyou Xie --- drivers/gpu/drm/nouveau/nv10_fence.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nv10_fence.c b/drivers/gpu/drm/nouveau/nv10_fence.c index 4e3de34..619f79d 100644 --- a/drivers/gpu/drm/nouveau/nv10_fence.c +++ b/drivers/gpu/drm/nouveau/nv10_fence.c @@ -66,7 +66,7 @@ nv10_fence_context_del(struct nouveau_channel *chan) nouveau_fence_context_free(&fctx->base); } -int +static int nv10_fence_context_new(struct nouveau_channel *chan) { struct nv10_fence_chan *fctx; -- 2.7.4
Re: [PATCH 8/8] cris-cryptocop: Apply another recommendation from "checkpatch.pl"
>> @@ -2276,7 +2277,10 @@ static int cryptocop_job_setup(struct >> cryptocop_prio_job **pj, struct cryptocop_ >> (*pj)->iop->ctx_in.saved_data = operation->list_op.inlist; >> (*pj)->iop->ctx_in.saved_data_buf = >> operation->list_op.in_data_buf; >> } else { >> -if ((err = cryptocop_setup_dma_list(operation, &(*pj)->iop, >> alloc_flag))) { >> +err = cryptocop_setup_dma_list(operation, >> + &(*pj)->iop, >> + alloc_flag); > > Checkpatch didn't say to put every argument on a different line, I agree to this information. > and that wasn't done before, so why do it now? I tend to give each function parameter its own text line in such an use case (for the known length limitation). > There is plenty of room for at least &(*pj)->iop on the line before. This is true. - Do you prefer an other indentation approach here? Regards, Markus
Re: [PATCH 5/8] cris-cryptocop: Move an assignment for the variable "nooutpages" in cryptocop_ioctl_process()
>> +++ b/arch/cris/arch-v32/drivers/cryptocop.c >> @@ -2469,7 +2469,7 @@ static int cryptocop_ioctl_process(struct inode >> *inode, struct file *filp, unsig >> struct page **inpages = NULL; >> struct page **outpages = NULL; >> int noinpages = 0; >> -int nooutpages = 0; >> +int nooutpages; >> >> struct cryptocop_desc descs[5]; /* Max 5 descriptors are >> needed, there are three transforms that >> * can get >> connected/disconnected on different places in the indata. */ >> @@ -2695,6 +2695,8 @@ static int cryptocop_ioctl_process(struct inode >> *inode, struct file *filp, unsig >> err = -ENOMEM; >> goto free_inpages; >> } >> +} else { >> +nooutpages = 0; > > Why is it better? 4 characters have becomes 2 lines. I suggest to express in a more precise way where this variable is needed actually. * It would also be an update candidate for the refactoring "Reduce the scope of a variable", wouldn't it? * Or would the refactoring "Split the implementation of a function into further functions" more appropriate here? Regards, Markus
[PATCH] fix:nouveau_display: mark symbols static where possible
We get 1 warning about global functions without a declaration in the nouveau nouveau_display driver when building with W=1: drivers/gpu/drm/nouveau/nouveau_display.c:96:1: warning: no previous prototype for 'nouveau_display_scanoutpos_head' [-Wmissing-prototypes] In fact, this function is only used in the file in which it is declared and don't need a declaration, but can be made static. so this patch marks it 'static'. Signed-off-by: Baoyou Xie --- drivers/gpu/drm/nouveau/nouveau_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c index afbf557..b60ee21 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.c +++ b/drivers/gpu/drm/nouveau/nouveau_display.c @@ -92,7 +92,7 @@ calc(int blanks, int blanke, int total, int line) return line; } -int +static int nouveau_display_scanoutpos_head(struct drm_crtc *crtc, int *vpos, int *hpos, ktime_t *stime, ktime_t *etime) { -- 2.7.4
Re: IA64-IRQ: Use kmalloc_array() in sn_irq_lh_init()
> While elimination of code duplication should be good, > what it means it you should avoid making changes that > are merely mechanical and strive to make changes that > improve code execution speed or reduce overall object > size while not impacting overall execution speed. Do other contributors spot any further improvement opportunities with a higher value in the source files for this software module? Regards, Markus
Re: [PATCH 1/2] mm/nobootmem.c: make CONFIG_NO_BOOTMEM depend on CONFIG_HAVE_MEMBLOCK
Hi zijun_hu, [auto build test ERROR on mmotm/master] [also build test ERROR on v4.8-rc3 next-20160825] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] [Suggest to use git(>=2.9.0) format-patch --base= (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on] [Check https://git-scm.com/docs/git-format-patch for more information] url: https://github.com/0day-ci/linux/commits/zijun_hu/mm-nobootmem-c-make-CONFIG_NO_BOOTMEM-depend-on-CONFIG_HAVE_MEMBLOCK/20160827-233707 base: git://git.cmpxchg.org/linux-mmotm.git master config: mips-allmodconfig (attached as .config) compiler: mips-linux-gnu-gcc (Debian 5.4.0-6) 5.4.0 20160609 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=mips All errors (new ones prefixed by >>): arch/mips/built-in.o: In function `setup_arch': >> (.init.text+0x1ff4): undefined reference to `init_bootmem_node' arch/mips/built-in.o: In function `setup_arch': >> (.init.text+0x2144): undefined reference to `reserve_bootmem' arch/mips/built-in.o: In function `setup_arch': (.init.text+0x21a8): undefined reference to `reserve_bootmem' arch/mips/built-in.o: In function `setup_arch': (.init.text+0x2220): undefined reference to `reserve_bootmem' arch/mips/built-in.o: In function `setup_arch': (.init.text+0x22a4): undefined reference to `reserve_bootmem' arch/mips/built-in.o: In function `setup_arch': (.init.text+0x22d8): undefined reference to `reserve_bootmem' --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: Binary data
Re: [Ksummit-discuss] checkkpatch (in)sanity ?
On Sat, Aug 27, 2016 at 09:06:13PM -0400, Levin, Alexander via Ksummit-discuss wrote: > 3. This one is somewhat subjective: scripts/checkpatch.pl is a massive blob of > perl code that a fair amount of people don't know how to deal with. In 4.8 > it's > 6142 lines, making it the 124th largest source file in the kernel, well within > the top 1% of source files in the kernel. > > This combination of size/language pushes people away from being involved in > what is supposed to be a central tool and gives them a reason to never use > it again after they see results they don't agree with (rather than fixing it). It is a textbook example of what's wrong with Perl. Instead of parsing C code like compilers do, the script is one big pile of regexes. It mostly works ("doing its job" in perlspeak) because people mostly follow the coding style. Regarding individual warnings: some are good (RETURN_VOID, DATE_TIME, USE_NEGATIVE_ERRNO), some are OK given kernel style of allocating memory but the rationale is bogus (UNNECESSARY_CASTS, linking to userspace example of malloc() returning "int"!). And then there is ALLOC_SIZEOF_STRUCT which advocates "kmalloc(sizeof(*p))". The problem is that c-h.pl generates noise in the commit history and makes git-blame less useful than it can be. I for one given up on it more or less since its introduction.
[PATCH] scsi: ufs: add missing declaration in ufshcd.h
We get 1 warning about global functions without a declaration in the scsi ufshcd driver when building with W=1: drivers/scsi/ufs/ufshcd.c:1991:5: warning: no previous prototype for 'ufshcd_query_descriptor_retry' [-Wmissing-prototypes] in fact, this function is implemented in ufshcd.c and exported but need to be declared in header file. Signed-off-by: Baoyou Xie --- drivers/scsi/ufs/ufshcd.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h index 430bef1..2f696ea 100644 --- a/drivers/scsi/ufs/ufshcd.h +++ b/drivers/scsi/ufs/ufshcd.h @@ -713,6 +713,9 @@ int ufshcd_read_string_desc(struct ufs_hba *hba, int desc_index, u8 *buf, /* Expose Query-Request API */ int ufshcd_query_flag(struct ufs_hba *hba, enum query_opcode opcode, enum flag_idn idn, bool *flag_res); +int ufshcd_query_descriptor_retry(struct ufs_hba *hba, + enum query_opcode opcode, enum desc_idn idn, u8 index, + u8 selector, u8 *desc_buf, int *buf_len); int ufshcd_hold(struct ufs_hba *hba, bool async); void ufshcd_release(struct ufs_hba *hba); u32 ufshcd_get_local_unipro_ver(struct ufs_hba *hba); -- 2.7.4
Re: [PATCH 1/3] documentation/scsi: Remove nodisconnect parameter
On Sat, Aug 27, 2016 at 4:29 AM, Finn Thain wrote: > The driver that used the 'nodisconnect' parameter was removed in > commit 565bae6a4a8f ("[SCSI] 53c7xx: kill driver"). Related documentation > was cleaned up in commit f37a7238d379 ("[SCSI] 53c7xx: fix removal > fallout"), except for the remaining two mentions that are removed here. > > Signed-off-by: Finn Thain Reviewed-by: Geert Uytterhoeven Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Re: [PATCH 2/3] scsi/ncr5380: Avoid a compiler warning
On Sat, Aug 27, 2016 at 4:30 AM, Finn Thain wrote: > With commit 3a0f64bfa907 ("mac_scsi: Fix pseudo DMA implementation") > some versions of gcc now warn: > > In file included from drivers/scsi/mac_scsi.c:335: > drivers/scsi/NCR5380.h:295: warning: `NCR5380_poll_politely' declared inline > after being called > drivers/scsi/NCR5380.h:295: warning: previous declaration of > `NCR5380_poll_politely' was here > > Avoid this by defining NCR5380_poll_politely() in NCR5380.h. > > Suggested-by: Geert Uytterhoeven > Signed-off-by: Finn Thain Tested-by: Geert Uytterhoeven Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Re: [PATCH 3/3] scsi/ncr5380: Improve interrupt latency during PIO tranfers
Hi Finn, On Sat, Aug 27, 2016 at 4:30 AM, Finn Thain wrote: > Large PIO transfers are broken up into chunks to try to avoid disabling > local IRQs for long periods. But IRQs are still disabled for too long > and this causes SCC FIFO overruns during serial port transfers. This > patch fixes the problem by halving the PIO chunk size. > > Testing with mac_scsi shows that the extra NCR5380_main() loop iterations > have negligible performance impact on SCSI transfers (about 1% slower). > On a faster system (using the dmx3191d module) transfers showed no > measurable change. > > Signed-off-by: Finn Thain > > --- > drivers/scsi/NCR5380.c |6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > Index: linux/drivers/scsi/NCR5380.c > === > --- linux.orig/drivers/scsi/NCR5380.c 2016-08-27 12:29:57.0 +1000 > +++ linux/drivers/scsi/NCR5380.c2016-08-27 12:29:58.0 +1000 > @@ -1847,11 +1847,11 @@ static void NCR5380_information_transfer > /* XXX - need to source or > sink data here, as appropriate */ > } > } else { > - /* Break up transfer into 3 ms chunks, > -* presuming 6 accesses per handshake. > + /* Transfer a small chunk so that the > +* irq mode lock is not held too long. > */ > transfersize = min((unsigned > long)cmd->SCp.this_residual, > - > hostdata->accesses_per_ms / 2); > + > hostdata->accesses_per_ms >> 2); I think it's easier to read if you use "/ 4". Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Re: [PATCH RFC UGLY] x86,mm,sched: make lazy TLB mode even lazier
On Aug 25, 2016 9:06 PM, "Rik van Riel" wrote: > > Subject: x86,mm,sched: make lazy TLB mode even lazier > > Lazy TLB mode can result in an idle CPU being woken up for a TLB > flush, when all it really needed to do was flush %cr3 before the > next context switch. > > This is mostly fine on bare metal, though sub-optimal from a power > saving point of view, and deeper C states could make TLB flushes > take a little longer than desired. > > On virtual machines, the pain can be much worse, especially if a > currently non-running VCPU is woken up for a TLB invalidation > IPI, on a CPU that is busy running another task. It could take > a while before that IPI is handled, leading to performance issues. > > This patch is still ugly, and the sched.h include needs to be cleaned > up a lot (how would the scheduler people like to see the context switch > blocking abstracted?) > > This patch deals with the issue by introducing a third tlb state, > TLBSTATE_FLUSH, which causes %cr3 to be flushed at the next > context switch. A CPU is transitioned from TLBSTATE_LAZY to > TLBSTATE_FLUSH with the rq lock held, to prevent context switches. > > Nothing is done for a CPU that is already in TLBSTATE_FLUH mode. > > This patch is totally untested, because I am at a conference right > now, and Benjamin has the test case :) > I haven't had a chance to seriously read the code yet, but what happens when the mm is deleted outright? Or is the idea that a reference is held until all the lazy users are gone, too? On PCID systems (still need to get that code upstream...), I wonder if we could go the other way and stop being lazy, as cr3 writes can be much faster. --Andy
Re: [RFC v2 09/10] landlock: Handle cgroups (performance)
On Aug 27, 2016 11:14 PM, "Mickaël Salaün" wrote: > > > On 27/08/2016 22:43, Alexei Starovoitov wrote: > > On Sat, Aug 27, 2016 at 09:35:14PM +0200, Mickaël Salaün wrote: > >> On 27/08/2016 20:06, Alexei Starovoitov wrote: > >>> On Sat, Aug 27, 2016 at 04:06:38PM +0200, Mickaël Salaün wrote: > As said above, Landlock will not run an eBPF programs when not strictly > needed. Attaching to a cgroup will have the same performance impact as > attaching to a process hierarchy. > >>> > >>> Having a prog per cgroup per lsm_hook is the only scalable way I > >>> could come up with. If you see another way, please propose. > >>> current->seccomp.landlock_prog is not the answer. > >> > >> Hum, I don't see the difference from a performance point of view between > >> a cgroup-based or a process hierarchy-based system. > >> > >> Maybe a better option should be to use an array of pointers with N > >> entries, one for each supported hook, instead of a unique pointer list? > > > > yes, clearly array dereference is faster than link list walk. > > Now the question is where to keep this prog_array[num_lsm_hooks] ? > > Since we cannot keep it inside task_struct, we have to allocate it. > > Every time the task is creted then. What to do on the fork? That > > will require changes all over. Then the obvious optimization would be > > to share this allocated array of prog pointers across multiple tasks... > > and little by little this new facility will look like cgroup. > > Hence the suggestion to put this array into cgroup from the start. > > I see your point :) > > > > >> Anyway, being able to attach an LSM hook program to a cgroup thanks to > >> the new BPF_PROG_ATTACH seems a good idea (while keeping the possibility > >> to use a process hierarchy). The downside will be to handle an LSM hook > >> program which is not triggered by a seccomp-filter, but this should be > >> needed anyway to handle interruptions. > > > > what do you mean 'not triggered by seccomp' ? > > You're not suggesting that this lsm has to enable seccomp to be functional? > > imo that's non starter due to overhead. > > Yes, for now, it is triggered by a new seccomp filter return value > RET_LANDLOCK, which can take a 16-bit value called cookie. This must not > be needed but could be useful to bind a seccomp filter security policy > with a Landlock one. Waiting for Kees's point of view… > I'm not Kees, but I'd be okay with that. I still think that doing this by process hierarchy a la seccomp will be easier to use and to understand (which is quite important for this kind of work) than doing it by cgroup. A feature I've wanted to add for a while is to have an fd that represents a seccomp layer, the idea being that you would set up your seccomp layer (with syscall filter, landlock hooks, etc) and then you would have a syscall to install that layer. Then an unprivileged sandbox manager could set up its layer and still be able to inject new processes into it later on, no cgroups needed. --Andy
Re: [RFC v2 09/10] landlock: Handle cgroups
On Aug 27, 2016 8:12 PM, "Alexei Starovoitov" wrote: > > On Sat, Aug 27, 2016 at 12:30:36AM -0700, Andy Lutomirski wrote: > > > cgroup is the common way to group multiple tasks. > > > Without cgroup only parent<->child relationship will be possible, > > > which will limit usability of such lsm to a master task that controls > > > its children. Such api restriction would have been ok, if we could > > > extend it in the future, but unfortunately task-centric won't allow it > > > without creating a parallel lsm that is cgroup based. > > > Therefore I think we have to go with cgroup-centric api and your > > > application has to use cgroups from the start though only parent-child > > > would have been enough. > > > Also I don't think the kernel can afford two bpf based lsm. One task > > > based and another cgroup based, so we have to find common ground > > > that suits both use cases. > > > Having unprivliged access is a subset. There is no strong reason why > > > cgroup+lsm+bpf should be limited to root only always. > > > When we can guarantee no pointer leaks, we can allow unpriv. > > > > I don't really understand what you mean. In the context of landlock, > > which is a *sandbox*, can one of you explain a use case that > > materially benefits from this type of cgroup usage? I haven't thought > > of one. > > In case of seccomp-like sandbox where parent controls child processes > cgroup is not needed. It's needed when container management software > needs to control a set of applications. If we can have one bpf-based lsm > that works via cgroup and without, I'd be fine with it. Right now > I haven't seen a plausible proposal to do that. Therefore cgroup based > api is a common api that works for sandbox as well, though requiring > parent to create a cgroup just to control a single child is cumbersome. > I don't believe that a common API can work to accomplish your goal. For privileged container management, the manager is trusted. For unprivileged sandboxing, the manager is emphatically not trusted, which means you need special rules like NO_NEW_PRIVS, and, unless you want to start restricting setuid and such in some cgroups, you really do need a different interface for joining the sandbox than whatever the container manager is using. What could make sense is to have one BPF-based LSM that supports both a seccomp-like unprivileged interface and a cgroup-based privileged interface. Most of the code for it is the BPF part anyway -- all that the cgroup or seccomp part needs to do is to figure out which BPF program(s) to call. Also, for container management software, you don't really need everything tied to cgroup -- you just need a way to cleanly add new processes to the same security context.
Re: [PATCH][RFC v4] timekeeping: ignore the bogus sleep time if pm_trace is enabled
On Sat, Aug 27, 2016 at 03:08:56PM +0800, Xunlei Pang wrote: > On 2016/08/18 at 18:43, Chen Yu wrote: > > Previously we encountered some memory overflow issues due to > > the bogus sleep time brought by inconsistent rtc, which is > > triggered when pm_trace is enabled, please refer to: > > https://patchwork.kernel.org/patch/9286365/ > > It's improper in the first place to call __timekeeping_inject_sleeptime() > > in case that pm_trace is enabled simply because that "hash" time value > > will wreckage the timekeeping subsystem. > > > > So this patch ignores the sleep time if pm_trace is enabled in > > the following situation: > > 1. rtc is used as persist clock to compensate for sleep time, > >(because system does not have a nonstop clocksource) or > > 2. rtc is used to calculate the sleep time in rtc_resume. > > > > Cc: Rafael J. Wysocki > > Cc: John Stultz > > Cc: Thomas Gleixner > > Cc: Xunlei Pang > > Cc: Zhang Rui > > Cc: linux-kernel@vger.kernel.org > > Cc: linux...@vger.kernel.org > > Suggested-by: Rafael J. Wysocki > > Reported-by: Janek Kozicki > > Signed-off-by: Chen Yu > > --- > I suddenly think of a way to avoid adding this ugly __weak auxiliary function. > > Add a special treatment for read_persistent_clock() in arch/x86/kernel/rtc.c > as follows, > void read_persistent_clock(struct timespec *ts) > { > x86_platform.get_wallclock(ts); > > /* Make rtc-based persistent clock unusable if pm_trace is enabled. */ > if (pm_trace_is_enabled() && > x86_platform.get_wallclock == mach_get_cmos_time) { > ts->tv_sec = 0; > ts->tv_nsec = 0; > > In this way, we can avoid the touch of timekeeping core, after all ptrace is > currently x86-specific. > > What do you think? > OK, I have another question, if we do like this, as read_persistent_clock64 is invoked in timekeeping_suspend/timekeeping_resume/timekeeping_init, then for timekeeping_init case, if pm_trace is enabled by command line, we will never use rtc even if we do not suspend?
undefined reference to `dib3000mc_pid_parse'
Hi Joe, It's probably a bug fix that unveils the link errors. tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: af56ff27eba54fceee5f5643e79bf6531f2e1739 commit: cb984d101b30eb7478d32df56a0023e4603cba7f compiler-gcc: integrate the various compiler-gcc[345].h files date: 1 year, 2 months ago config: x86_64-randconfig-n0-08281459 (attached as .config) compiler: gcc-6 (Debian 6.1.1-9) 6.1.1 20160705 reproduce: git checkout cb984d101b30eb7478d32df56a0023e4603cba7f # save the attached .config to linux build tree make ARCH=x86_64 All errors (new ones prefixed by >>): drivers/built-in.o: In function `dibusb_dib3000mc_frontend_attach': >> (.text+0x19298d): undefined reference to `dib3000mc_pid_parse' drivers/built-in.o: In function `dibusb_dib3000mc_frontend_attach': >> (.text+0x192995): undefined reference to `dib3000mc_pid_control' drivers/built-in.o: In function `dibusb_dib3000mc_tuner_attach': >> (.text+0x192bd7): undefined reference to `dib3000mc_set_config' --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: Binary data
Re: [PATCH v2] ARM: dts: sun8i: enable UART1 for iNet D978 Rev2 board
On Sun, Aug 28, 2016 at 08:55:21AM +0800, Icenowy Zheng wrote: > + uart1_pins_cts_rts_a: uart1_cts_rts@0 { > + allwinner,pins = "PG8", "PG9"; > + allwinner,function = "uart1"; > + allwinner,drive = ; > + allwinner,pull = ; > + }; Node names should not contain underscores. Use hyphens instead. https://www.mail-archive.com/linux-kernel%40vger.kernel.org/msg1122967.html https://www.mail-archive.com/linux-kernel%40vger.kernel.org/msg1145633.html -- Rask Ingemann Lambertsen
Re: [PATCH 3/5] rxrpc: fix last_call processing
This is fixed by: commit 2266ffdef5737fdfa96005204fc5606dbd559956 subject: rxrpc: Fix conn-based retransmit which is in net-next. David
Re: [PATCH 1/5] IA64-IRQ: Use kmalloc_array() in sn_irq_lh_init()
On Sat, 27 Aug 2016, Joe Perches wrote: > On Sat, 2016-08-27 at 09:02 +0200, SF Markus Elfring wrote: > > > If you _really wanted to clear up this code and make it more > > > robust/better, it'd probably be nicer to convert the > > > struct list_head **sn_irq_lh to a single struct list_head * > > > That would be less data space overall given the alignment > > > waste of the individual allocs. > > Does this suggestion mean that I should drop my proposal > > around the software components "IRQ" and "TLB" for the system > > architecture "IA64" in such a questionable patch series? > > While elimination of code duplication should be good, > what it means it you should avoid making changes that > are merely mechanical and strive to make changes that > improve code execution speed or reduce overall object > size while not impacting overall execution speed. I do think that there is some value in doing similar things in a uniform way, using meaningful names, even if in a particular case it doesn't help performance or reduce code size. Even duplicating code could be OK if it is not in a critical path and it makes the code overall easier to understand. But if the maintainer prefers the code not to be duplicated, then of course it should not be duplicated. julia
psmouse_disconnect lockdep splat
Hi, just saw this while booting rc3+tip/master. Thought I should report it in case it hasn't been caught and fixed yet. --- ... [6.257924] snd_hda_codec_realtek hdaudioC0D0: Internal Mic=0x12 [6.280232] iTCO_vendor_support: vendor-support=0 [6.282063] snd_hda_intel :00:1b.0: bound :00:02.0 (ops i915_audio_component_bind_ops) [6.285810] psmouse serio2: Failed to deactivate mouse on synaptics-pt/serio0 [6.286331] iTCO_wdt: Intel TCO WatchDog Timer Driver v1.11 [6.286392] iTCO_wdt: Found a Panther Point TCO device (Version=2, TCOBASE=0x0460) [6.290473] input: HDA Digital PCBeep as /devices/pci:00/:00:1b.0/sound/card0/input10 [6.293635] input: HDA Intel PCH Mic as /devices/pci:00/:00:1b.0/sound/card0/input11 [6.298520] input: HDA Intel PCH Dock Mic as /devices/pci:00/:00:1b.0/sound/card0/input12 [6.300605] iTCO_wdt: initialized. heartbeat=30 sec (nowayout=0) [6.303861] input: HDA Intel PCH Headphone as /devices/pci:00/:00:1b.0/sound/card0/input13 [6.307117] input: HDA Intel PCH Dock Headphone as /devices/pci:00/:00:1b.0/sound/card0/input14 [6.310045] input: HDA Intel PCH HDMI/DP,pcm=3 as /devices/pci:00/:00:1b.0/sound/card0/input15 [6.311645] input: HDA Intel PCH HDMI/DP,pcm=7 as /devices/pci:00/:00:1b.0/sound/card0/input16 [6.312865] input: HDA Intel PCH HDMI/DP,pcm=8 as /devices/pci:00/:00:1b.0/sound/card0/input17 [6.346990] usb 1-1: New USB device found, idVendor=8087, idProduct=0024 [6.348316] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0 [6.350870] hub 1-1:1.0: USB hub found [6.352530] hub 1-1:1.0: 6 ports detected [6.390558] usb 2-1: New USB device found, idVendor=8087, idProduct=0024 [6.391706] usb 2-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0 [6.393209] hub 2-1:1.0: USB hub found [6.394534] hub 2-1:1.0: 8 ports detected [6.415139] random: crng init done [6.590812] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready [6.749939] psmouse serio2: Failed to enable mouse on synaptics-pt/serio0 [7.000430] == [7.001447] [ INFO: possible circular locking dependency detected ] [7.002453] 4.8.0-rc3+ #1 Not tainted [7.003420] --- [7.004366] kworker/0:1/45 is trying to acquire lock: [7.005291] (s_active#41){.+}, at: [] kernfs_remove_by_name_ns+0x45/0xa0 [7.006243] but task is already holding lock: [7.008074] (psmouse_mutex){+.+.+.}, at: [] psmouse_disconnect+0x6c/0x150 [7.009011] which lock already depends on the new lock. [7.011753] the existing dependency chain (in reverse order) is: [7.013576] -> #1 (psmouse_mutex){+.+.+.}: [7.015456][] lock_acquire+0xb2/0x200 [7.016400][] mutex_lock_interruptible_nested+0x64/0x440 [7.017340][] psmouse_attr_set_helper+0x31/0x110 [7.018292][] dev_attr_store+0x18/0x30 [7.019214][] sysfs_kf_write+0x45/0x60 [7.020125][] kernfs_fop_write+0x135/0x1c0 [7.021023][] __vfs_write+0x28/0x120 [7.021917][] vfs_write+0xb8/0x1b0 [7.022793][] SyS_write+0x49/0xa0 [7.023650][] entry_SYSCALL_64_fastpath+0x1c/0xac [7.024500] -> #0 (s_active#41){.+}: [7.026151][] __lock_acquire+0x1249/0x1480 [7.026995][] lock_acquire+0xb2/0x200 [7.027845][] __kernfs_remove+0x225/0x2f0 [7.028681][] kernfs_remove_by_name_ns+0x45/0xa0 [7.029517][] remove_files.isra.1+0x36/0x70 [7.030349][] sysfs_remove_group+0x44/0x90 [7.031185][] trackpoint_disconnect+0x24/0x40 [7.032014][] psmouse_disconnect+0x9a/0x150 [7.032843][] serio_disconnect_driver+0x32/0x40 [7.033664][] serio_driver_remove+0x15/0x20 [7.034490][] __device_release_driver+0xa1/0x160 [7.035316][] device_release_driver+0x25/0x40 [7.036139][] serio_disconnect_port+0x7a/0xb0 [7.036955][] serio_reconnect_subtree+0x51/0xb0 [7.037762][] serio_handle_event+0x192/0x210 [7.038568][] process_one_work+0x1e8/0x740 [7.039350][] worker_thread+0x48/0x4e0 [7.040111][] kthread+0xf3/0x110 [7.040863][] ret_from_fork+0x1f/0x40 [7.041610] other info that might help us debug this: [7.043777] Possible unsafe locking scenario: [7.045191]CPU0CPU1 [7.045883] [7.046549] lock(psmouse_mutex); [7.047216]lock(s_active#41); [7.047881]lock(psmouse_mutex); [7.048526] lock(s_active#41); [7.049165]
Re: constification and cocci / kernel build test robot ?
On Sat, 27 Aug 2016, Joe Perches wrote: > On Sat, 2016-08-27 at 20:59 +0200, Julia Lawall wrote: > > Make sure (of/i2c/platform)_device_id tables are NULL terminated > > Generated by: scripts/coccinelle/misc/of_table.cocci > > Along the same lines, I submitted a manually generated > patch to add const to some of these structs. > > https://lkml.org/lkml/2016/8/26/494 > > Could cocci and/or the kbuild test robot check for structs > that could or should be const? Possibly. I have sent a lot of patches to constify things, but I used gcc to verify that the constification was OK. I could also just send you a list of the structures that I have constified, or better yet a list of the structures that are currently always const in the kernel, and you could perhaps just add them all to checkpatch. Many of them are not used very often. If it would be better to only check for structures that are eg referenced at least some number of times, or in some number of files, or in more than one leaf subdirectory, all of that would be possible. There are also now the "read only after init" annotations that we could be encouraging people to add. Kees Cook talked about this at the security summit last week. There is thus a need to be sure that things are annotated as __init that should be as well. julia > > > > Please take the patch only if it's a positive warning. Thanks! > [] > > +++ b/drivers/thermal/intel_bxt_pmic_thermal.c > > @@ -281,6 +281,7 @@ static struct platform_device_id pmic_th > > .name = "bxt_wcove_thermal", > > .driver_data = (kernel_ulong_t)&bxtwc_thermal_data, > > }, > > + {}, > > }; > > > > static struct platform_driver pmic_thermal_driver = { >
Re: [RFC v2 09/10] landlock: Handle cgroups (performance)
On 28/08/2016 10:13, Andy Lutomirski wrote: > On Aug 27, 2016 11:14 PM, "Mickaël Salaün" wrote: >> >> >> On 27/08/2016 22:43, Alexei Starovoitov wrote: >>> On Sat, Aug 27, 2016 at 09:35:14PM +0200, Mickaël Salaün wrote: On 27/08/2016 20:06, Alexei Starovoitov wrote: > On Sat, Aug 27, 2016 at 04:06:38PM +0200, Mickaël Salaün wrote: >> As said above, Landlock will not run an eBPF programs when not strictly >> needed. Attaching to a cgroup will have the same performance impact as >> attaching to a process hierarchy. > > Having a prog per cgroup per lsm_hook is the only scalable way I > could come up with. If you see another way, please propose. > current->seccomp.landlock_prog is not the answer. Hum, I don't see the difference from a performance point of view between a cgroup-based or a process hierarchy-based system. Maybe a better option should be to use an array of pointers with N entries, one for each supported hook, instead of a unique pointer list? >>> >>> yes, clearly array dereference is faster than link list walk. >>> Now the question is where to keep this prog_array[num_lsm_hooks] ? >>> Since we cannot keep it inside task_struct, we have to allocate it. >>> Every time the task is creted then. What to do on the fork? That >>> will require changes all over. Then the obvious optimization would be >>> to share this allocated array of prog pointers across multiple tasks... >>> and little by little this new facility will look like cgroup. >>> Hence the suggestion to put this array into cgroup from the start. >> >> I see your point :) >> >>> Anyway, being able to attach an LSM hook program to a cgroup thanks to the new BPF_PROG_ATTACH seems a good idea (while keeping the possibility to use a process hierarchy). The downside will be to handle an LSM hook program which is not triggered by a seccomp-filter, but this should be needed anyway to handle interruptions. >>> >>> what do you mean 'not triggered by seccomp' ? >>> You're not suggesting that this lsm has to enable seccomp to be functional? >>> imo that's non starter due to overhead. >> >> Yes, for now, it is triggered by a new seccomp filter return value >> RET_LANDLOCK, which can take a 16-bit value called cookie. This must not >> be needed but could be useful to bind a seccomp filter security policy >> with a Landlock one. Waiting for Kees's point of view… >> > > I'm not Kees, but I'd be okay with that. I still think that doing > this by process hierarchy a la seccomp will be easier to use and to > understand (which is quite important for this kind of work) than doing > it by cgroup. > > A feature I've wanted to add for a while is to have an fd that > represents a seccomp layer, the idea being that you would set up your > seccomp layer (with syscall filter, landlock hooks, etc) and then you > would have a syscall to install that layer. Then an unprivileged > sandbox manager could set up its layer and still be able to inject new > processes into it later on, no cgroups needed. A nice thing I didn't highlight about Landlock is that a process can prepare a layer of rules (arraymap of handles + Landlock programs) and pass the file descriptors of the Landlock programs to another process. This process could then apply this programs to get sandboxed. However, for now, because a Landlock program is only triggered by a seccomp filter (which do not follow the Landlock programs as a FD), they will be useless. The FD referring to an arraymap of handles can also be used to update a map and change the behavior of a Landlock program. A master process can then add or remove restrictions to another process hierarchy on the fly. However, I think it would make more sense to use cgroups if we want to move an existing (unwilling) unsandoxed process into a sandboxed environment. Of course, some more no_new_privs checks would be needed. signature.asc Description: OpenPGP digital signature
[PATCH] PA-RISC-inventory: Use kmalloc_array() in add_system_map_addresses()
From: Markus Elfring Date: Sun, 28 Aug 2016 11:40:53 +0200 * A multiplication for the size determination of a memory allocation indicated that an array data structure should be processed. Thus use the corresponding function "kmalloc_array". This issue was detected by using the Coccinelle software. * Replace the specification of a data type by a pointer dereference to make the corresponding size determination a bit safer according to the Linux coding style convention. Signed-off-by: Markus Elfring --- arch/parisc/kernel/inventory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/parisc/kernel/inventory.c b/arch/parisc/kernel/inventory.c index f0b6722..545f9d2 100644 --- a/arch/parisc/kernel/inventory.c +++ b/arch/parisc/kernel/inventory.c @@ -506,7 +506,7 @@ add_system_map_addresses(struct parisc_device *dev, int num_addrs, long status; struct pdc_system_map_addr_info addr_result; - dev->addr = kmalloc(num_addrs * sizeof(unsigned long), GFP_KERNEL); + dev->addr = kmalloc_array(num_addrs, sizeof(*dev->addr), GFP_KERNEL); if(!dev->addr) { printk(KERN_ERR "%s %s(): memory allocation failure\n", __FILE__, __func__); -- 2.9.3
Re: [lkp] [mm, page_alloc] e6cbd7f2ef: pixz.throughput -5.1% regression
Lo! On 08.08.2016 10:29, kernel test robot wrote: > > FYI, we noticed a -5.1% regression of pixz.throughput due to commit: > > commit e6cbd7f2efb433d717af72aa8510a9db6f7a7e05 ("mm, page_alloc: remove fair > zone allocation policy") > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master > > in testcase: pixz > on test machine: 48 threads Ivytown Ivy Bridge-EP with 64G memory > with following parameters: > > nr_threads: 100% > cpufreq_governor: performance Mel, this report made it to the regression list for 4.8, but it seems nothing happened after the initial report. Was it discussed (and maybe even fixed?) elsewhere? Or was it deemed not important enough? Should I drop it for the regression list? Side note: During 4.7 we already already had a performance regression in the same test (and maybe the same test machine) that in the end wasn't fixed. For details see the thread "795ae7a0de: pixz.throughput -9.1% regression" (http://lkml.iu.edu/hypermail/linux/kernel/1606.0/01156.html ). Ciao, Thorsten
Re: [Ksummit-discuss] checkkpatch (in)sanity ?
On Sun, 28 Aug 2016, Alexey Dobriyan wrote: > On Sat, Aug 27, 2016 at 09:06:13PM -0400, Levin, Alexander via > Ksummit-discuss wrote: > > 3. This one is somewhat subjective: scripts/checkpatch.pl is a massive blob > > of > > perl code that a fair amount of people don't know how to deal with. In 4.8 > > it's > > 6142 lines, making it the 124th largest source file in the kernel, well > > within > > the top 1% of source files in the kernel. > > > > This combination of size/language pushes people away from being involved in > > what is supposed to be a central tool and gives them a reason to never use > > it again after they see results they don't agree with (rather than fixing > > it). > > It is a textbook example of what's wrong with Perl. Instead of parsing > C code like compilers do, the script is one big pile of regexes. > It mostly works ("doing its job" in perlspeak) because people mostly > follow the coding style. Parsing is slow. Perfect parsing is impossible due to configuration options. There is definitely a place for regexps in checking code. Perhaps there is a better way to express the regexps, or to provide regexps for integration into the checkpatch infrastructure. > Regarding individual warnings: some are good (RETURN_VOID, DATE_TIME, > USE_NEGATIVE_ERRNO), some are OK given kernel style of allocating memory > but the rationale is bogus (UNNECESSARY_CASTS, linking to userspace > example of malloc() returning "int"!). > > And then there is ALLOC_SIZEOF_STRUCT which advocates "kmalloc(sizeof(*p))". > > The problem is that c-h.pl generates noise in the commit history and > makes git-blame less useful than it can be. Could it be that this is a problem with git blame, rather than with checkpatch? Last year there was a discussion on this list about how there is an option to git blame that will cause it to step through the history, and not show only the most recent patch that has modified a given line. julia > > I for one given up on it more or less since its introduction. > ___ > Ksummit-discuss mailing list > ksummit-disc...@lists.linuxfoundation.org > https://lists.linuxfoundation.org/mailman/listinfo/ksummit-discuss >
kcm: use-after-free in fput of kcm socket
Hello, The following program triggers use-after-free: // autogenerated by syzkaller (http://github.com/google/syzkaller) #include #include int main() { int fd = syscall(SYS_socket, 0x29ul, 0x5ul, 0x0ul, 0, 0, 0); syscall(SYS_ioctl, fd, 0x89e2ul, 0x20a98000ul, 0, 0, 0); return 0; } [ 367.240184] == [ 367.240784] BUG: KASAN: use-after-free in __fput+0x65a/0x780 at addr 880069bc4b30 [ 367.241034] Read of size 2 by task a.out/4045 [ 367.241034] CPU: 3 PID: 4045 Comm: a.out Not tainted 4.8.0-rc3+ #34 [ 367.241034] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 [ 367.241034] 884b8280 880038fb7bc0 82d1b1d9 00622e00 [ 367.241034] fbfff1097050 88003e198900 880069bc4b00 880069bc4ec0 [ 367.241034] 880069bc4b30 859e90a0 880038fb7be8 817da1fc [ 367.241034] Call Trace: [ 367.241034] [] dump_stack+0x12e/0x185 [ 367.241034] [] ? sock_release+0x1d0/0x1d0 [ 367.241034] [] kasan_object_err+0x1c/0x70 [ 367.241034] [] kasan_report_error+0x1ae/0x490 [ 367.241034] [] ? sock_release+0x1d0/0x1d0 [ 367.241034] [] __asan_report_load2_noabort+0x3e/0x40 [ 367.241034] [] ? __fput+0x65a/0x780 [ 367.241034] [] __fput+0x65a/0x780 [ 367.241034] [] fput+0x15/0x20 [ 367.241034] [] task_work_run+0xf3/0x170 [ 367.241034] [] do_exit+0x868/0x2c10 [ 367.241034] [] ? sock_ioctl+0x1db/0x3d0 [ 367.241034] [] ? sock_do_ioctl+0xb0/0xb0 [ 367.241034] [] ? do_vfs_ioctl+0x430/0x1080 [ 367.241034] [] ? mm_update_next_owner+0x640/0x640 [ 367.241034] [] ? ioctl_preallocate+0x210/0x210 [ 367.241034] [] ? bad_area+0x69/0x80 [ 367.241034] [] ? exit_to_usermode_loop+0x3e/0x210 [ 367.241034] [] ? entry_SYSCALL_64_fastpath+0x5/0xc1 [ 367.241034] [] do_group_exit+0x108/0x330 [ 367.241034] [] SyS_exit_group+0x1d/0x20 [ 367.241034] [] entry_SYSCALL_64_fastpath+0x23/0xc1 [ 367.241034] Object at 880069bc4b00, in cache sock_inode_cache size: 960 [ 367.241034] Allocated: [ 367.241034] PID = 4045 [ 367.241034] [] save_stack_trace+0x26/0x50 [ 367.241034] [] save_stack+0x46/0xd0 [ 367.241034] [] kasan_kmalloc+0xad/0xe0 [ 367.241034] [] kasan_slab_alloc+0x12/0x20 [ 367.241034] [] kmem_cache_alloc+0x12b/0x710 [ 367.241034] [] sock_alloc_inode+0x1d/0x250 [ 367.241034] [] alloc_inode+0x61/0x180 [ 367.241034] [] new_inode_pseudo+0x17/0xe0 [ 367.241034] [] sock_alloc+0x41/0x280 [ 367.241034] [] kcm_ioctl+0x9b3/0x13e0 [ 367.241034] [] sock_do_ioctl+0x65/0xb0 [ 367.241034] [] sock_ioctl+0x2d2/0x3d0 [ 367.241034] [] do_vfs_ioctl+0x18c/0x1080 [ 367.241034] [] SyS_ioctl+0x8f/0xc0 [ 367.241034] [] entry_SYSCALL_64_fastpath+0x23/0xc1 [ 367.241034] Freed: [ 367.241034] PID = 4045 [ 367.241034] [] save_stack_trace+0x26/0x50 [ 367.241034] [] save_stack+0x46/0xd0 [ 367.241034] [] kasan_slab_free+0x72/0xc0 [ 367.241034] [] kmem_cache_free+0x76/0x300 [ 367.241034] [] sock_destroy_inode+0x56/0x70 [ 367.241034] [] destroy_inode+0xc7/0x130 [ 367.241034] [] evict+0x329/0x500 [ 367.241034] [] iput+0x495/0x930 [ 367.241034] [] sock_release+0x164/0x1d0 [ 367.241034] [] sock_close+0x16/0x20 [ 367.241034] [] __fput+0x236/0x780 [ 367.241034] [] fput+0x15/0x20 [ 367.241034] [] task_work_run+0xf3/0x170 [ 367.241034] [] do_exit+0x868/0x2c10 [ 367.241034] [] do_group_exit+0x108/0x330 [ 367.241034] [] SyS_exit_group+0x1d/0x20 [ 367.241034] [] entry_SYSCALL_64_fastpath+0x23/0xc1 [ 367.241034] Memory state around the buggy address: [ 367.241034] 880069bc4a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 367.241034] 880069bc4a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 367.241034] >880069bc4b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 367.241034] ^ [ 367.241034] 880069bc4b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 367.241034] 880069bc4c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 367.241034] == It is then followed by a bunch of other bugs, full log is here: https://gist.githubusercontent.com/dvyukov/b9884388bee40b792ae7900928358484/raw/ace2fa242468d584fa61bf753a5891faa71b0932/gistfile1.txt On commit 61c04572de404e52a655a36752e696bbcb483cf5 (Aug 25).
Re: imx-drm: Possible regression after update to atomic
Lo! Dave, below report made it to the list of regression for 4.8, but afaics nothing happened after the initial report. Was it discussed (and maybe even fixed?) elsewhere? Or is there some reason why it shouldn't be on the list of regressions at all? Ciao, Thorsten On 13.08.2016 14:37, Peter Senna Tschudin wrote: > > d7868cb7ac58640e9c0383205ba31bd6a985cc6f is the last commit that works for > me. I'm experiencing black screen after Weston starts in two different i.MX > based devices: > > - i.MX6 -> arch/arm/boot/dts/imx6q-b850v3.dts > - i.MX53 based device > > Weston starts, but nothing is shown on screen. fb works fine. Disabling fb on > Kconfig or simply commenting out drm_fbdev_cma_init() solves the black screen > issue. > > The tests that are causing the black screen: > > diff --git a/drivers/gpu/drm/imx/ipuv3-plane.c > b/drivers/gpu/drm/imx/ipuv3-plane.c > index 4ad67d0..52dc1b7 100644 > --- a/drivers/gpu/drm/imx/ipuv3-plane.c > +++ b/drivers/gpu/drm/imx/ipuv3-plane.c > @@ -325,7 +325,7 @@ static int ipu_plane_atomic_check(struct drm_plane *plane, > if (old_fb && (state->src_w != old_state->src_w || > state->src_h != old_state->src_h || > fb->pixel_format != old_fb->pixel_format)) > - return -EINVAL; > > eba = drm_plane_state_to_eba(state); > > @@ -336,7 +336,7 @@ static int ipu_plane_atomic_check(struct drm_plane *plane, > return -EINVAL; > > if (old_fb && fb->pitches[0] != old_fb->pitches[0]) > - return -EINVAL; > > switch (fb->pixel_format) { > case DRM_FORMAT_YUV420: > @@ -372,7 +372,7 @@ static int ipu_plane_atomic_check(struct drm_plane *plane, > return -EINVAL; > > if (old_fb && old_fb->pitches[1] != fb->pitches[1]) > - return -EINVAL; > } > > I tried to replace the return -EINVAL by crtc_state->mode_changed = true with > no positive results. > > I'm trying to understand what is the difference with and without fb, but I > have no conclusions yet. > > Hints on what could be the cause here? > > Thank you, > > Peter > > P.S. This is what I get after replacing the return -EINVAL(the mode is > correct): https://goo.gl/photos/1eRdcco9GpszgvzM8
Re: [PATCH 5/8] cris-cryptocop: Move an assignment for the variable "nooutpages" in cryptocop_ioctl_process()
On Sun, 28 Aug 2016, SF Markus Elfring wrote: > >> +++ b/arch/cris/arch-v32/drivers/cryptocop.c > >> @@ -2469,7 +2469,7 @@ static int cryptocop_ioctl_process(struct inode > >> *inode, struct file *filp, unsig > >>struct page **inpages = NULL; > >>struct page **outpages = NULL; > >>int noinpages = 0; > >> - int nooutpages = 0; > >> + int nooutpages; > >> > >>struct cryptocop_desc descs[5]; /* Max 5 descriptors are > >> needed, there are three transforms that > >> * can get > >> connected/disconnected on different places in the indata. */ > >> @@ -2695,6 +2695,8 @@ static int cryptocop_ioctl_process(struct inode > >> *inode, struct file *filp, unsig > >>err = -ENOMEM; > >>goto free_inpages; > >>} > >> + } else { > >> + nooutpages = 0; > > > > Why is it better? 4 characters have becomes 2 lines. > > I suggest to express in a more precise way where this variable is needed > actually. The variable is used in the cleanup code at the end of the function. Thus it conceptually has global scope, and it is completely reasonable to initialize it at the beginning of its function, along with noinpages. This code is horrible in so many ways: no space before {, lots of 0 initializations instead of kzalloc, random use of local cleanup code and a label at the end of the function, the use of DEBUG, the use of printk, the use of the very long function name in strings instead of __func__, constants on the left of a != test, etc. On the other hand there are also very few commits on this code, and even fewer that are specific to this code, so perhaps no one cares about it. julia > > * It would also be an update candidate for the refactoring "Reduce the scope > of a variable", wouldn't it? > > * Or would the refactoring "Split the implementation of a function into > further functions" more appropriate here? > > Regards, > Markus > -- > To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >
Re: [PATCH 8/8] cris-cryptocop: Apply another recommendation from "checkpatch.pl"
On Sun, 28 Aug 2016, SF Markus Elfring wrote: > >> @@ -2276,7 +2277,10 @@ static int cryptocop_job_setup(struct > >> cryptocop_prio_job **pj, struct cryptocop_ > >>(*pj)->iop->ctx_in.saved_data = operation->list_op.inlist; > >>(*pj)->iop->ctx_in.saved_data_buf = > >> operation->list_op.in_data_buf; > >>} else { > >> - if ((err = cryptocop_setup_dma_list(operation, &(*pj)->iop, > >> alloc_flag))) { > >> + err = cryptocop_setup_dma_list(operation, > >> + &(*pj)->iop, > >> + alloc_flag); > > > > Checkpatch didn't say to put every argument on a different line, > > I agree to this information. > > > > and that wasn't done before, so why do it now? > > I tend to give each function parameter its own text line in such an use case > (for the known length limitation). > > > > There is plenty of room for at least &(*pj)->iop on the line before. > > This is true. - Do you prefer an other indentation approach here? Very much. Most of the kernel code puts as much information on a line as possible, unless there is a reason to do otherwise. Then more of the code will fit on the screen at one time. julia
Re: [BISECTED REGRESSION] v4.8-rc: DT/OCTEON driver probing broken
Lo! Kefeng, below report made it to the list of regression for 4.8, but afaics nothing happened after the initial report. Is there maybe some reason why it shouldn't be on the list of regressions at all? Or was the problem discussed elsewhere? Or is it even fixed already? I noticed https://git.kernel.org/torvalds/c/fc520f8b4f (of/platform: disable the of_platform_default_populate_init() for all the ppc board), but that change is PPC specific. Ciao, Thorsten On 16.08.2016 17:00, Aaro Koskinen wrote: > Hi, > > Commit 44a7185c2ae6 ("of/platform: Add common method to populate default > bus") added new arch_initcall of_platform_default_populate_init() that > will be called before device_initcall octeon_publish_devices(). Now the > of_platform_bus_probe() called in octeon_publish_devices() is apparently > doing nothing: > > [ 52.331353] calling octeon_publish_devices+0x0/0x14 @ 1 > [ 52.331358] OF: of_platform_bus_probe() > [ 52.331362] OF: starting at: / > [ 52.331378] OF: of_platform_bus_create() - skipping /soc@0, already > populated > [ 52.331394] initcall octeon_publish_devices+0x0/0x14 returned 0 after 29 > usecs > > This also means that USB etc. won't get probed. > > Any ideas what would be the proper fix for this? Changing > octeon_publish_devices() to arch_initcall seems to work but that may be > a bit hackish... Also, there might be also other MIPS boards affected > (arch/mips/netlogic/xlp/dt.c, arch/mips/mti-malta/malta-dt.c). > > A. > > http://news.gmane.org/find-root.php?message_id=20160816150056.GD18731%40ak-desktop.emea.nsn-net.net > > http://mid.gmane.org/20160816150056.GD18731%40ak-desktop.emea.nsn-net.net >
[PATCH] wan/fsl_ucc_hdlc: fix spelling mistake "prameter" -> "parameter"
From: Colin Ian King Trivial fix to spelling mistake in dev_err message. Signed-off-by: Colin Ian King --- drivers/net/wan/fsl_ucc_hdlc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wan/fsl_ucc_hdlc.c b/drivers/net/wan/fsl_ucc_hdlc.c index 6f04445..5fbf83d 100644 --- a/drivers/net/wan/fsl_ucc_hdlc.c +++ b/drivers/net/wan/fsl_ucc_hdlc.c @@ -162,7 +162,7 @@ static int uhdlc_init(struct ucc_hdlc_private *priv) ALIGNMENT_OF_UCC_HDLC_PRAM); if (priv->ucc_pram_offset < 0) { - dev_err(priv->dev, "Can not allocate MURAM for hdlc prameter.\n"); + dev_err(priv->dev, "Can not allocate MURAM for hdlc parameter.\n"); ret = -ENOMEM; goto free_tx_bd; } -- 2.9.3
mm: use-after-free in collapse_huge_page
Hello, I've git the following use-after-free in collapse_huge_page while running syzkaller fuzzer. It is in khugepaged, so not reproducible. On commit 61c04572de404e52a655a36752e696bbcb483cf5 (Aug 25). == BUG: KASAN: use-after-free in collapse_huge_page+0x28b1/0x3500 at addr 88006c731388 Read of size 8 by task khugepaged/1327 CPU: 0 PID: 1327 Comm: khugepaged Not tainted 4.8.0-rc3+ #33 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 884b8280 88003c207920 82d1b239 89ec1520 fbfff1097050 88003e94c700 88006c731300 88006c7313c0 88003c207b88 88003c207948 817da1fc Call Trace: [] __asan_report_load8_noabort+0x3e/0x40 mm/kasan/report.c:322 [] collapse_huge_page+0x28b1/0x3500 mm/khugepaged.c:1004 [< inline >] khugepaged_scan_pmd mm/khugepaged.c:1205 [< inline >] khugepaged_scan_mm_slot mm/khugepaged.c:1718 [< inline >] khugepaged_do_scan mm/khugepaged.c:1799 [] khugepaged+0x1dcb/0x2b30 mm/khugepaged.c:1844 [] kthread+0x23f/0x2d0 drivers/block/aoe/aoecmd.c:1303 [] ret_from_fork+0x1f/0x40 arch/x86/entry/entry_64.S:393 Object at 88006c731300, in cache vm_area_struct size: 192 Allocated: PID = 23069 [] save_stack_trace+0x26/0x50 arch/x86/kernel/stacktrace.c:67 [] save_stack+0x46/0xd0 mm/kasan/kasan.c:479 [< inline >] set_track mm/kasan/kasan.c:491 [] kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:582 [] kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:521 [] kmem_cache_alloc+0x12b/0x710 mm/slab.c:3573 [< inline >] kmem_cache_zalloc ./include/linux/slab.h:626 [] mmap_region+0x63d/0xfe0 mm/mmap.c:1486 [] do_mmap+0x99d/0xbf0 mm/mmap.c:1297 [< inline >] do_mmap_pgoff ./include/linux/mm.h:2044 [] vm_mmap_pgoff+0x156/0x1a0 mm/util.c:302 [< inline >] SYSC_mmap_pgoff mm/mmap.c:1347 [] SyS_mmap_pgoff+0x208/0x580 mm/mmap.c:1305 [< inline >] SYSC_mmap arch/x86/kernel/sys_x86_64.c:95 [] SyS_mmap+0x16/0x20 arch/x86/kernel/sys_x86_64.c:86 [] entry_SYSCALL_64_fastpath+0x23/0xc1 arch/x86/entry/entry_64.S:207 Freed: PID = 23069 [] save_stack_trace+0x26/0x50 arch/x86/kernel/stacktrace.c:67 [] save_stack+0x46/0xd0 mm/kasan/kasan.c:479 [< inline >] set_track mm/kasan/kasan.c:491 [] kasan_slab_free+0x72/0xc0 mm/kasan/kasan.c:555 [< inline >] __cache_free mm/slab.c:3515 [] kmem_cache_free+0x76/0x300 mm/slab.c:3775 [] remove_vma+0x162/0x1b0 mm/mmap.c:168 [< inline >] remove_vma_list mm/mmap.c:2286 [] do_munmap+0x7c7/0xf00 mm/mmap.c:2509 [] mmap_region+0x152/0xfe0 mm/mmap.c:1459 [] do_mmap+0x99d/0xbf0 mm/mmap.c:1297 [< inline >] do_mmap_pgoff ./include/linux/mm.h:2044 [] vm_mmap_pgoff+0x156/0x1a0 mm/util.c:302 [< inline >] SYSC_mmap_pgoff mm/mmap.c:1347 [] SyS_mmap_pgoff+0x208/0x580 mm/mmap.c:1305 [< inline >] SYSC_mmap arch/x86/kernel/sys_x86_64.c:95 [] SyS_mmap+0x16/0x20 arch/x86/kernel/sys_x86_64.c:86 [] entry_SYSCALL_64_fastpath+0x23/0xc1 arch/x86/entry/entry_64.S:207 Memory state around the buggy address: 88006c731280: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc 88006c731300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >88006c731380: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ 88006c731400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb 88006c731480: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc == Disabling lock debugging due to kernel taint == BUG: KASAN: use-after-free in pmdp_collapse_flush+0x146/0x160 at addr 88006c731350 Read of size 8 by task khugepaged/1327 CPU: 0 PID: 1327 Comm: khugepaged Tainted: GB 4.8.0-rc3+ #33 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 884b8280 88003c2078e0 82d1b239 fbfff1097050 88003e94c700 88006c731300 88006c7313c0 2000 88003c207b88 88003c207908 817da1fc Call Trace: [< inline >] __dump_stack lib/dump_stack.c:15 [] dump_stack+0x12e/0x185 lib/dump_stack.c:51 [] kasan_object_err+0x1c/0x70 mm/kasan/report.c:154 [< inline >] print_address_description mm/kasan/report.c:192 [] kasan_report_error+0x1ae/0x490 mm/kasan/report.c:281 [< inline >] kasan_report mm/kasan/report.c:301 [] __asan_report_load8_noabort+0x3e/0x40 mm/kasan/report.c:322 [] pmdp_collapse_flush+0x146/0x160 mm/pgtable-generic.c:186 [] collapse_huge_page+0x10d9/0x3500 mm/khugepaged.c:1019 [< inline >] khugepaged_scan_pmd mm/khugepaged.c:1205 [< inline >] khugepaged_scan_mm_slot mm/khugepaged.c:1718 [< inline >] khugepaged_do_scan mm/khugepaged.c:1799 [] khugepaged+0x1dcb/0x2b30 mm/khugepaged.c:1844 [] kthread+0x23f/0x2d0 drivers/block/aoe/aoecmd.c
[PATCH] selftests/x86: fix spelling mistake "preseve" -> "preserve"
From: Colin Ian King Trivial fix to spelling mistakes in printf messages. Signed-off-by: Colin Ian King --- tools/testing/selftests/x86/ptrace_syscall.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/x86/ptrace_syscall.c b/tools/testing/selftests/x86/ptrace_syscall.c index 4214567..b037ce9c 100644 --- a/tools/testing/selftests/x86/ptrace_syscall.c +++ b/tools/testing/selftests/x86/ptrace_syscall.c @@ -147,7 +147,7 @@ static void test_sys32_regs(void (*do_syscall)(struct syscall_args32 *)) if (args.nr != getpid() || args.arg0 != 10 || args.arg1 != 11 || args.arg2 != 12 || args.arg3 != 13 || args.arg4 != 14 || args.arg5 != 15) { - printf("[FAIL]\tgetpid() failed to preseve regs\n"); + printf("[FAIL]\tgetpid() failed to preserve regs\n"); nerrs++; } else { printf("[OK]\tgetpid() preserves regs\n"); @@ -162,7 +162,7 @@ static void test_sys32_regs(void (*do_syscall)(struct syscall_args32 *)) if (args.nr != 0 || args.arg0 != getpid() || args.arg1 != SIGUSR1 || args.arg2 != 12 || args.arg3 != 13 || args.arg4 != 14 || args.arg5 != 15) { - printf("[FAIL]\tkill(getpid(), SIGUSR1) failed to preseve regs\n"); + printf("[FAIL]\tkill(getpid(), SIGUSR1) failed to preserve regs\n"); nerrs++; } else { printf("[OK]\tkill(getpid(), SIGUSR1) preserves regs\n"); -- 2.9.3
[PATCH] net: ucc_geth: fix spelling mistake "propperty" -> "property"
From: Colin Ian King Trivial fix to spelling mistake in dev_warn message. Signed-off-by: Colin Ian King --- drivers/net/ethernet/freescale/ucc_geth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c index 5bf1ade..186ef8f 100644 --- a/drivers/net/ethernet/freescale/ucc_geth.c +++ b/drivers/net/ethernet/freescale/ucc_geth.c @@ -3756,7 +3756,7 @@ static int ucc_geth_probe(struct platform_device* ofdev) return -EINVAL; } if ((*prop < QE_CLK_NONE) || (*prop > QE_CLK24)) { - pr_err("invalid rx-clock propperty\n"); + pr_err("invalid rx-clock property\n"); return -EINVAL; } ug_info->uf_info.rx_clock = *prop; -- 2.9.3
[PATCH] f2fs: fix to do security initialization of encrypted inode with original filename
From: Chao Yu When creating new inode, security_inode_init_security will be called for initializing security info related to the inode, and filename is passed to security module, it helps security module such as SElinux to know which rule or label could be applied for the inode with specified name. Previously, if new inode is created as an encrypted one, f2fs will transfer encrypted filename to security module which may fail the check of security policy belong to the inode. So in order to this issue, alter to transfer original unencrypted filename instead. Signed-off-by: Chao Yu --- fs/f2fs/dir.c| 21 + fs/f2fs/f2fs.h | 8 fs/f2fs/inline.c | 17 + 3 files changed, 26 insertions(+), 20 deletions(-) diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c index 2941759..fbc8ede 100644 --- a/fs/f2fs/dir.c +++ b/fs/f2fs/dir.c @@ -378,7 +378,8 @@ static int make_empty_dir(struct inode *inode, } struct page *init_inode_metadata(struct inode *inode, struct inode *dir, - const struct qstr *name, struct page *dpage) + const struct qstr *new_name, const struct qstr *orig_name, + struct page *dpage) { struct page *page; int err; @@ -403,7 +404,7 @@ struct page *init_inode_metadata(struct inode *inode, struct inode *dir, if (err) goto put_error; - err = f2fs_init_security(inode, dir, name, page); + err = f2fs_init_security(inode, dir, orig_name, page); if (err) goto put_error; @@ -420,8 +421,8 @@ struct page *init_inode_metadata(struct inode *inode, struct inode *dir, set_cold_node(inode, page); } - if (name) - init_dent_inode(name, page); + if (new_name) + init_dent_inode(new_name, page); /* * This file should be checkpointed during fsync. @@ -507,6 +508,7 @@ void f2fs_update_dentry(nid_t ino, umode_t mode, struct f2fs_dentry_ptr *d, } int f2fs_add_regular_entry(struct inode *dir, const struct qstr *new_name, + const struct qstr *orig_name, struct inode *inode, nid_t ino, umode_t mode) { unsigned int bit_pos; @@ -572,7 +574,8 @@ add_dentry: if (inode) { down_write(&F2FS_I(inode)->i_sem); - page = init_inode_metadata(inode, dir, new_name, NULL); + page = init_inode_metadata(inode, dir, new_name, + orig_name, NULL); if (IS_ERR(page)) { err = PTR_ERR(page); goto fail; @@ -622,9 +625,11 @@ int __f2fs_add_link(struct inode *dir, const struct qstr *name, err = -EAGAIN; if (f2fs_has_inline_dentry(dir)) - err = f2fs_add_inline_entry(dir, &new_name, inode, ino, mode); + err = f2fs_add_inline_entry(dir, &new_name, fname.usr_fname, + inode, ino, mode); if (err == -EAGAIN) - err = f2fs_add_regular_entry(dir, &new_name, inode, ino, mode); + err = f2fs_add_regular_entry(dir, &new_name, fname.usr_fname, + inode, ino, mode); fscrypt_free_filename(&fname); f2fs_update_time(F2FS_I_SB(dir), REQ_TIME); @@ -637,7 +642,7 @@ int f2fs_do_tmpfile(struct inode *inode, struct inode *dir) int err = 0; down_write(&F2FS_I(inode)->i_sem); - page = init_inode_metadata(inode, dir, NULL, NULL); + page = init_inode_metadata(inode, dir, NULL, NULL, NULL); if (IS_ERR(page)) { err = PTR_ERR(page); goto fail; diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 5d0c34a..dcdf87d 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -1946,7 +1946,7 @@ bool f2fs_fill_dentries(struct dir_context *, struct f2fs_dentry_ptr *, void do_make_empty_dir(struct inode *, struct inode *, struct f2fs_dentry_ptr *); struct page *init_inode_metadata(struct inode *, struct inode *, - const struct qstr *, struct page *); + const struct qstr *, const struct qstr *, struct page *); void update_parent_metadata(struct inode *, struct inode *, unsigned int); int room_for_filename(const void *, int, int); void f2fs_drop_nlink(struct inode *, struct inode *); @@ -1960,7 +1960,7 @@ int update_dent_inode(struct inode *, struct inode *, const struct qstr *); void f2fs_update_dentry(nid_t ino, umode_t mode, struct f2fs_dentry_ptr *, const struct qstr *, f2fs_hash_t , unsigned int); int f2fs_add_regular_entry(struct inode *, const struct qstr *, - struct inode *, nid_t, umode_t); + const struct qs
[PATCH] cxgb4/cxgb4vf: fix spelling mistake "provissioned" -> "provisioned"
From: Colin Ian King Trivial fix to spelling mistake in dev_warn message. Signed-off-by: Colin Ian King --- drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c index f2951bf..100b2cc 100644 --- a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c +++ b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c @@ -2378,7 +2378,7 @@ static void size_nports_qsets(struct adapter *adapter) */ pmask_nports = hweight32(adapter->params.vfres.pmask); if (pmask_nports < adapter->params.nports) { - dev_warn(adapter->pdev_dev, "only using %d of %d provissioned" + dev_warn(adapter->pdev_dev, "only using %d of %d provisioned" " virtual interfaces; limited by Port Access Rights" " mask %#x\n", pmask_nports, adapter->params.nports, adapter->params.vfres.pmask); -- 2.9.3
arch/mips/vdso/elf.S:1:0: error: '-march=r3900' requires '-mfp32'
Hi Alex, FYI, the error/warning still remains. tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: af56ff27eba54fceee5f5643e79bf6531f2e1739 commit: ebb5e78cc63417a35254a791de66e1cc84f963cc MIPS: Initial implementation of a VDSO date: 10 months ago config: mips-jmr3927_defconfig (attached as .config) compiler: mips-linux-gnu-gcc (Debian 5.4.0-6) 5.4.0 20160609 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 git checkout ebb5e78cc63417a35254a791de66e1cc84f963cc # save the attached .config to linux build tree make.cross ARCH=mips All errors (new ones prefixed by >>): >> arch/mips/vdso/elf.S:1:0: error: '-march=r3900' requires '-mfp32' /* ^ -- >> arch/mips/vdso/sigreturn.S:1:0: error: '-march=r3900' requires '-mfp32' /* ^ vim +1 arch/mips/vdso/elf.S > 1 /* 2 * Copyright (C) 2015 Imagination Technologies 3 * Author: Alex Smith 4 * --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: Binary data
[PATCH] powerpc/ps3: fix spelling mistake in function name
From: Colin Ian King Trivial fix to spelling mistake in dev_warn message and remove extraneous trailing whitespace at end of the message. Signed-off-by: Colin Ian King --- arch/powerpc/platforms/ps3/device-init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/ps3/device-init.c b/arch/powerpc/platforms/ps3/device-init.c index 57caaf1..d3eabd1 100644 --- a/arch/powerpc/platforms/ps3/device-init.c +++ b/arch/powerpc/platforms/ps3/device-init.c @@ -62,7 +62,7 @@ static int __init ps3_register_lpm_devices(void) &dev->lpm.rights); if (result) { - pr_debug("%s:%d: ps3_repository_read_lpm_privleges failed \n", + pr_debug("%s:%d: ps3_repository_read_lpm_privileges failed\n", __func__, __LINE__); goto fail_read_repo; } -- 2.9.3
[PATCH] usb: phy: ab8500-usb: fix spelling mistake "regester" -> "register"
From: Colin Ian King Trivial fix to spelling mistakes in dev_err messages. Signed-off-by: Colin Ian King --- drivers/usb/phy/phy-ab8500-usb.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/usb/phy/phy-ab8500-usb.c b/drivers/usb/phy/phy-ab8500-usb.c index 0c912d3..a03caf4 100644 --- a/drivers/usb/phy/phy-ab8500-usb.c +++ b/drivers/usb/phy/phy-ab8500-usb.c @@ -1248,7 +1248,7 @@ static void ab8500_usb_set_ab8500_tuning_values(struct ab8500_usb *ab) err = abx500_set_register_interruptible(ab->dev, AB8500_DEBUG, AB8500_USB_PHY_TUNE3, 0x78); if (err < 0) - dev_err(ab->dev, "Failed to set PHY_TUNE3 regester err=%d\n", + dev_err(ab->dev, "Failed to set PHY_TUNE3 register err=%d\n", err); /* Switch to normal mode/disable Bank 0x12 access */ @@ -1290,7 +1290,7 @@ static void ab8500_usb_set_ab8505_tuning_values(struct ab8500_usb *ab) 0xFC, 0x80); if (err < 0) - dev_err(ab->dev, "Failed to set PHY_TUNE3 regester err=%d\n", + dev_err(ab->dev, "Failed to set PHY_TUNE3 register err=%d\n", err); /* Switch to normal mode/disable Bank 0x12 access */ @@ -1321,7 +1321,7 @@ static void ab8500_usb_set_ab8540_tuning_values(struct ab8500_usb *ab) err = abx500_set_register_interruptible(ab->dev, AB8540_DEBUG, AB8500_USB_PHY_TUNE3, 0x90); if (err < 0) - dev_err(ab->dev, "Failed to set PHY_TUNE3 regester ret=%d\n", + dev_err(ab->dev, "Failed to set PHY_TUNE3 register ret=%d\n", err); } @@ -1351,7 +1351,7 @@ static void ab8500_usb_set_ab9540_tuning_values(struct ab8500_usb *ab) err = abx500_set_register_interruptible(ab->dev, AB8500_DEBUG, AB8500_USB_PHY_TUNE3, 0x80); if (err < 0) - dev_err(ab->dev, "Failed to set PHY_TUNE3 regester err=%d\n", + dev_err(ab->dev, "Failed to set PHY_TUNE3 register err=%d\n", err); /* Switch to normal mode/disable Bank 0x12 access */ -- 2.9.3
[PATCH 1/4] ARM: dts: Add TOPEET itop core board SCP package version
The TOPEET itop is a samsung exnynos 4412 core board, which have two package versions. This patch add the support for SCP version. Currently supported are USB3503A HSIC, USB OTG, eMMC, rtc and PMIC. The future features are in the based board. Also MFC and watchdog have been enabled. Signed-off-by: Randy Li --- arch/arm/boot/dts/exynos4412-itop-scp-core.dtsi | 489 1 file changed, 489 insertions(+) create mode 100644 arch/arm/boot/dts/exynos4412-itop-scp-core.dtsi diff --git a/arch/arm/boot/dts/exynos4412-itop-scp-core.dtsi b/arch/arm/boot/dts/exynos4412-itop-scp-core.dtsi new file mode 100644 index 000..ce5076c --- /dev/null +++ b/arch/arm/boot/dts/exynos4412-itop-scp-core.dtsi @@ -0,0 +1,489 @@ +/* + * TOPEET's Exynos4412 based itop board device tree source + * + * Copyright (c) 2016 SUMOMO Computer Association + * https://www.sumomo.mobi + * Randy Li + * + * Device tree source file for TOPEET iTop Exynos 4412 SCP package core + * board which is based on Samsung's Exynos4412 SoC. + * + * 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. +*/ + +#include "exynos4412.dtsi" +#include "exynos4412-ppmu-common.dtsi" +#include "exynos-mfc-reserved-memory.dtsi" +#include +#include + +/ { + memory { + reg = <0x4000 0x4000>; + }; + + firmware@0203F000 { + compatible = "samsung,secure-firmware"; + reg = <0x0203F000 0x1000>; + }; + + fixed-rate-clocks { + xxti { + compatible = "samsung,clock-xxti"; + clock-frequency = <0>; + }; + + xusbxti { + compatible = "samsung,clock-xusbxti"; + clock-frequency = <2400>; + }; + + /* Clock from S5M8767A AP32K */ + ap32k: xrtcxti { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <32768000>; + }; + }; + + thermal-zones { + cpu_thermal: cpu-thermal { + cooling-maps { + map0 { +/* Corresponds to 800MHz at freq_table */ +cooling-device = <&cpu0 7 7>; + }; + map1 { +/* Corresponds to 200MHz at freq_table */ +cooling-device = <&cpu0 13 13>; + }; + }; + }; + }; + + usb-hub { + compatible = "smsc,usb3503a"; + reset-gpios = <&gpm2 4 GPIO_ACTIVE_LOW>; + connect-gpios = <&gpm3 3 GPIO_ACTIVE_HIGH>; + intn-gpios = <&gpx2 3 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&hsic_reset>; + }; +}; + +&bus_dmc { + devfreq-events = <&ppmu_dmc0_3>, <&ppmu_dmc1_3>; + vdd-supply = <&buck1_reg>; + status = "okay"; +}; + +&bus_acp { +devfreq = <&bus_dmc>; +status = "okay"; +}; + +&bus_c2c { +devfreq = <&bus_dmc>; +status = "okay"; +}; + +&bus_leftbus { +devfreq-events = <&ppmu_leftbus_3>, <&ppmu_rightbus_3>; +vdd-supply = <&buck3_reg>; +status = "okay"; +}; + +&bus_rightbus { +devfreq = <&bus_leftbus>; +status = "okay"; +}; + +&bus_fsys { +devfreq = <&bus_leftbus>; +status = "okay"; +}; + +&bus_peri { +devfreq = <&bus_leftbus>; +status = "okay"; +}; + +&bus_mfc { +devfreq = <&bus_leftbus>; +status = "okay"; +}; + +&cpu0 { + cpu0-supply = <&buck2_reg>; +}; + +&i2c_1 { + #address-cells = <1>; + #size-cells = <0>; + samsung,i2c-sda-delay = <100>; + samsung,i2c-max-bus-freq = <40>; + pinctrl-0 = <&i2c1_bus>; + pinctrl-names = "default"; + status = "okay"; + + s5m8767: s5m8767_pmic@66 { + compatible = "samsung,s5m8767-pmic"; + reg = <0x66>; + + s5m8767,pmic-buck-default-dvs-idx = <3>; + + s5m8767,pmic-buck-dvs-gpios = <&gpb 5 GPIO_ACTIVE_HIGH>, +<&gpb 6 GPIO_ACTIVE_HIGH>, +<&gpb 7 GPIO_ACTIVE_HIGH>; + + s5m8767,pmic-buck-ds-gpios = <&gpm3 5 GPIO_ACTIVE_HIGH>, + <&gpm3 6 GPIO_ACTIVE_HIGH>, + <&gpm3 7 GPIO_ACTIVE_HIGH>; + + /* VDD_ARM */ + s5m8767,pmic-buck2-dvs-voltage = <1356250>, <130>, +
[PATCH 0/4 v3] Add a new board TOPEET iTOP for exynos 4412
The added the audio codec seems work now, but the audio sounds still a little different to the original. But I didn't hear the sound in the Android, I don't know whether it is qualified. Also it lacks of full pinctrl for the sleep state. Changelog: - v3: - fixing the rtc clock, using clock source from PMIC - enable the tmu - enable the fimc for elite board - suuport the audio codec at elite board - fixing minor bugs in the last commit - v2: - removing rtc node the clock source driver is not done yet. - adding exynos-bus - fixing the MFC Randy Li (4): ARM: dts: Add TOPEET itop core board SCP package version ARM: dts: add TOPEET itop elite based board ARM: dts: add fimc support in exynos4412 TOPEET iTop Elite board ARM: dts: samsung: add analog audio codec on TOPEET iTop 4412 Elite .../bindings/arm/samsung/samsung-boards.txt| 3 + arch/arm/boot/dts/Makefile | 1 + arch/arm/boot/dts/exynos4412-itop-elite.dts| 241 ++ arch/arm/boot/dts/exynos4412-itop-scp-core.dtsi| 489 + 4 files changed, 734 insertions(+) create mode 100644 arch/arm/boot/dts/exynos4412-itop-elite.dts create mode 100644 arch/arm/boot/dts/exynos4412-itop-scp-core.dtsi -- 2.7.4
[PATCH 4/4] ARM: dts: samsung: add analog audio codec on TOPEET iTop 4412 Elite
Enable the WM8960 analog audio codec on TOPEET iTop 4412 Elite board. Signed-off-by: Randy Li --- arch/arm/boot/dts/exynos4412-itop-elite.dts | 77 + 1 file changed, 77 insertions(+) diff --git a/arch/arm/boot/dts/exynos4412-itop-elite.dts b/arch/arm/boot/dts/exynos4412-itop-elite.dts index 2d11b9a..e1cda54 100644 --- a/arch/arm/boot/dts/exynos4412-itop-elite.dts +++ b/arch/arm/boot/dts/exynos4412-itop-elite.dts @@ -15,6 +15,7 @@ /dts-v1/; #include "exynos4412-itop-scp-core.dtsi" +#include / { model = "TOPEET iTop 4412 Elite board based on Exynos4412"; @@ -75,6 +76,54 @@ gpios = <&gpx2 0 GPIO_ACTIVE_LOW>; }; }; + + sound { + compatible = "simple-audio-card"; + simple-audio-card,name = "wm-sound"; + + assigned-clocks = <&clock_audss EXYNOS_MOUT_AUDSS>, + <&clock_audss EXYNOS_MOUT_I2S>, + <&clock_audss EXYNOS_DOUT_SRP>, + <&clock_audss EXYNOS_DOUT_AUD_BUS>; + assigned-clock-parents = <&clock CLK_FOUT_EPLL>, + <&clock_audss EXYNOS_MOUT_AUDSS>; + assigned-clock-rates = <0>, + <0>, + <112896000>, + <11289600>; + + simple-audio-card,format = "i2s"; + simple-audio-card,bitclock-master = <&link0_codec>; + simple-audio-card,frame-master = <&link0_codec>; + + simple-audio-card,widgets = + "Microphone", "Mic Jack", + "Line", "Line In", + "Line", "Line Out", + "Speaker", "Speaker", + "Headphone", "Headphone Jack"; + simple-audio-card,routing = + "Headphone Jack", "HP_L", + "Headphone Jack", "HP_R", + "Speaker", "SPK_LP", + "Speaker", "SPK_LN", + "Speaker", "SPK_RP", + "Speaker", "SPK_RN", + "LINPUT1", "Mic Jack", + "LINPUT3", "Mic Jack", + "RINPUT1", "Mic Jack", + "RINPUT2", "Mic Jack"; + + simple-audio-card,cpu { + sound-dai = <&i2s0 0>; + }; + + link0_codec: simple-audio-card,codec { + sound-dai = <&codec>; + clocks = <&i2s0 CLK_I2S_CDCLK>; + system-clock-frequency = <11289600>; + }; + }; beep { compatible = "pwm-beeper"; @@ -143,6 +192,34 @@ status = "okay"; }; +&i2c_4 { + samsung,i2c-sda-delay = <100>; + samsung,i2c-slave-addr = <0x10>; + samsung,i2c-max-bus-freq = <10>; + pinctrl-0 = <&i2c4_bus>; + pinctrl-names = "default"; + status = "okay"; + + codec: wm8960@1a { + compatible = "wlf,wm8960"; + reg = <0x1a>; + clocks = <&pmu_system_controller 0>; + clock-names = "MCLK1"; + wlf,shared-lrclk; + #sound-dai-cells = <0>; + }; +}; + +&i2s0 { + pinctrl-0 = <&i2s0_bus>; + pinctrl-names = "default"; + status = "okay"; + clocks = <&clock_audss EXYNOS_I2S_BUS>, +<&clock_audss EXYNOS_DOUT_AUD_BUS>, +<&clock_audss EXYNOS_SCLK_I2S>; + clock-names = "iis", "i2s_opclk0", "i2s_opclk1"; +}; + &pwm { pinctrl-0 = <&pwm1_out>; pinctrl-names = "default"; -- 2.7.4
[PATCH 2/4] ARM: dts: add TOPEET itop elite based board
The TOPEET itop exynos 4412 have three versions base board. The Elite version is the cheap one without too much peripheral devices on it. Currently supported are serial console, wired networking(USB), USB OTG in peripheral mode, USB host, SD storage, GPIO buttons, PWM beeper, ADC and LEDs. Signed-off-by: Randy Li --- .../bindings/arm/samsung/samsung-boards.txt| 3 + arch/arm/boot/dts/Makefile | 1 + arch/arm/boot/dts/exynos4412-itop-elite.dts| 148 + 3 files changed, 152 insertions(+) create mode 100644 arch/arm/boot/dts/exynos4412-itop-elite.dts diff --git a/Documentation/devicetree/bindings/arm/samsung/samsung-boards.txt b/Documentation/devicetree/bindings/arm/samsung/samsung-boards.txt index 0ea7f14..c7159ac 100644 --- a/Documentation/devicetree/bindings/arm/samsung/samsung-boards.txt +++ b/Documentation/devicetree/bindings/arm/samsung/samsung-boards.txt @@ -22,6 +22,9 @@ Required root node properties: * FriendlyARM - "friendlyarm,tiny4412" - for Exynos4412-based FriendlyARM TINY4412 board. + * TOPEET + - "topeet,itop4412-elite" - for Exynos4412-based TOPEET +Elite base board. * Google - "google,pi" - for Exynos5800-based Google Peach Pi diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index 48e1d4e..8f47aa0 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -135,6 +135,7 @@ dtb-$(CONFIG_ARCH_EXYNOS4) += \ exynos4412-origen.dtb \ exynos4412-smdk4412.dtb \ exynos4412-tiny4412.dtb \ + exynos4412-itop-elite.dtb \ exynos4412-trats2.dtb dtb-$(CONFIG_ARCH_EXYNOS5) += \ exynos5250-arndale.dtb \ diff --git a/arch/arm/boot/dts/exynos4412-itop-elite.dts b/arch/arm/boot/dts/exynos4412-itop-elite.dts new file mode 100644 index 000..5688589 --- /dev/null +++ b/arch/arm/boot/dts/exynos4412-itop-elite.dts @@ -0,0 +1,148 @@ +/* + * TOPEET's Exynos4412 based itop board device tree source + * + * Copyright (c) 2016 SUMOMO Computer Association + * https://www.sumomo.mobi + * Randy Li + * + * Device tree source file for TOPEET iTop Exynos 4412 core board + * which is based on Samsung's Exynos4412 SoC. + * + * 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. +*/ + +/dts-v1/; +#include "exynos4412-itop-scp-core.dtsi" + +/ { + model = "TOPEET iTop 4412 Elite board based on Exynos4412"; + compatible = "topeet,itop4412-elite", "samsung,exynos4412", "samsung,exynos4"; + + chosen { + bootargs ="console=ttySAC2,115200 root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait"; + stdout-path = &serial_2; + }; + + leds { + compatible = "gpio-leds"; + + led2 { + label = "red:system"; + gpios = <&gpx1 0 GPIO_ACTIVE_HIGH>; + default-state = "off"; + linux,default-trigger = "heartbeat"; + }; + + led3 { + label = "red:user"; + gpios = <&gpk1 1 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + }; + + gpio-keys { + compatible = "gpio-keys"; + + home { + label = "GPIO Key Home"; + linux,code = ; + gpios = <&gpx1 1 GPIO_ACTIVE_LOW>; + }; + + back { + label = "GPIO Key Back"; + linux,code = ; + gpios = <&gpx1 2 GPIO_ACTIVE_LOW>; + }; + + sleep { + label = "GPIO Key Sleep"; + linux,code = ; + gpios = <&gpx3 3 GPIO_ACTIVE_LOW>; + }; + + vol_up { + label = "GPIO Key Vol+"; + linux,code = ; + gpios = <&gpx2 1 GPIO_ACTIVE_LOW>; + }; + + vol_down { + label = "GPIO Key Vol-"; + linux,code = ; + gpios = <&gpx2 0 GPIO_ACTIVE_LOW>; + }; + }; + + beep { + compatible = "pwm-beeper"; + pwms = <&pwm>; + pinctrl-0 = <&pwm0_out>; + pinctrl-names = "default"; + }; +}; + +&pinctrl_1 { + ether-reset { + samsung,pins = "gpc0-1"; + samsung,pin-function = <1>; + samsung,pin-pud = <0>; + samsung,pin-drv = <0>; + }; +}; + +&s
[PATCH 3/4] ARM: dts: add fimc support in exynos4412 TOPEET iTop Elite board
The is not used for camera, I enabled it just for a colorspace convertor. Signed-off-by: Randy Li --- arch/arm/boot/dts/exynos4412-itop-elite.dts | 16 1 file changed, 16 insertions(+) diff --git a/arch/arm/boot/dts/exynos4412-itop-elite.dts b/arch/arm/boot/dts/exynos4412-itop-elite.dts index 5688589..2d11b9a 100644 --- a/arch/arm/boot/dts/exynos4412-itop-elite.dts +++ b/arch/arm/boot/dts/exynos4412-itop-elite.dts @@ -82,6 +82,14 @@ pinctrl-0 = <&pwm0_out>; pinctrl-names = "default"; }; + + camera: camera { + pinctrl-0 = <&cam_port_a_clk_active>; + pinctrl-names = "default"; + status = "okay"; + assigned-clocks = <&clock CLK_MOUT_CAM0>; + assigned-clock-parents = <&clock CLK_XUSBXTI>; + }; }; &pinctrl_1 { @@ -146,3 +154,11 @@ vdd-supply = <&ldo3_reg>; status = "okay"; }; + +&fimc_0 { + status = "okay"; + assigned-clocks = <&clock CLK_MOUT_FIMC0>, + <&clock CLK_SCLK_FIMC0>; + assigned-clock-parents = <&clock CLK_MOUT_MPLL_USER_T>; + assigned-clock-rates = <0>, <17600>; +}; -- 2.7.4
[PATCH] staging: wilc1000: fix spelling mistake: "retyring" -> "retrying"
From: Colin Ian King trivial fix to spelling mistake in dev_err message Signed-off-by: Colin Ian King --- drivers/staging/wilc1000/wilc_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/wilc_spi.c b/drivers/staging/wilc1000/wilc_spi.c index 22cf4b7..0f8d625 100644 --- a/drivers/staging/wilc1000/wilc_spi.c +++ b/drivers/staging/wilc1000/wilc_spi.c @@ -871,7 +871,7 @@ static int wilc_spi_init(struct wilc *wilc, bool resume) /* Read failed. Try with CRC off. This might happen when module * is removed but chip isn't reset*/ g_spi.crc_off = 1; - dev_err(&spi->dev, "Failed internal read protocol with CRC on, retyring with CRC off...\n"); + dev_err(&spi->dev, "Failed internal read protocol with CRC on, retrying with CRC off...\n"); if (!spi_internal_read(wilc, WILC_SPI_PROTOCOL_OFFSET, ®)) { /* Reaad failed with both CRC on and off, something went bad */ dev_err(&spi->dev, -- 2.9.3
drm: WARNING in drm_irq_by_busid
Hello, I've got the following WARNING while running syzkaller fuzzer: [ cut here ] WARNING: CPU: 1 PID: 16092 at drivers/gpu/drm/drm_pci.c:182 drm_irq_by_busid+0x3c0/0x4a0 Kernel panic - not syncing: panic_on_warn set ... CPU: 1 PID: 16092 Comm: syz-executor Not tainted 4.8.0-rc3+ #33 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 884b8280 880032c07b00 82d1b239 0178 fbfff1097050 86e8eec0 880032c07bd8 873a2c00 dc00 0009 880032c07bc8 816ab4e3 Call Trace: [] warn_slowpath_null+0x2c/0x40 kernel/panic.c:552 [] drm_irq_by_busid+0x3c0/0x4a0 drivers/gpu/drm/drm_pci.c:182 [] drm_ioctl+0x7bc/0xc60 drivers/gpu/drm/drm_ioctl.c:724 [< inline >] vfs_ioctl fs/ioctl.c:43 [] do_vfs_ioctl+0x18c/0x1080 fs/ioctl.c:675 [< inline >] SYSC_ioctl fs/ioctl.c:690 [] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:681 [] entry_SYSCALL_64_fastpath+0x23/0xc1 arch/x86/entry/entry_64.S:207 Unfortunately it's not reproducible. Probably fuzzer can't guess the right bus id (there is no simple way to extract correct bus id). But it happens regularly. On commit 61c04572de404e52a655a36752e696bbcb483cf5 (Auh 25).
arch/mips/vdso/gettimeofday.c:1:0: error: '-march=r3900' requires '-mfp32'
Hi Guenter, First bad commit (maybe != root cause): tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: af56ff27eba54fceee5f5643e79bf6531f2e1739 commit: 398c7500a1f5f74e207bd2edca1b1721b3cc1f1e MIPS: VDSO: Fix build error with binutils 2.24 and earlier date: 8 months ago config: mips-jmr3927_defconfig (attached as .config) compiler: mips-linux-gnu-gcc (Debian 5.4.0-6) 5.4.0 20160609 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 git checkout 398c7500a1f5f74e207bd2edca1b1721b3cc1f1e # save the attached .config to linux build tree make.cross ARCH=mips All errors (new ones prefixed by >>): >> arch/mips/vdso/gettimeofday.c:1:0: error: '-march=r3900' requires '-mfp32' /* ^ vim +1 arch/mips/vdso/gettimeofday.c a7f4df4e Alex Smith 2015-10-21 @1 /* a7f4df4e Alex Smith 2015-10-21 2 * Copyright (C) 2015 Imagination Technologies a7f4df4e Alex Smith 2015-10-21 3 * Author: Alex Smith a7f4df4e Alex Smith 2015-10-21 4 * a7f4df4e Alex Smith 2015-10-21 5 * This program is free software; you can redistribute it and/or modify it a7f4df4e Alex Smith 2015-10-21 6 * under the terms of the GNU General Public License as published by the a7f4df4e Alex Smith 2015-10-21 7 * Free Software Foundation; either version 2 of the License, or (at your a7f4df4e Alex Smith 2015-10-21 8 * option) any later version. a7f4df4e Alex Smith 2015-10-21 9 */ :: The code at line 1 was first introduced by commit :: a7f4df4e21dd8a8dab96e88acd2c9c5017b83fc6 MIPS: VDSO: Add implementations of gettimeofday() and clock_gettime() :: TO: Alex Smith :: CC: Ralf Baechle --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: Binary data
[PATCH] qla2xxx: fix spelling mistake "retyring" -> "retrying"
From: Colin Ian King Trivial fix to spelling mistakes in ql_dbg messages. Signed-off-by: Colin Ian King --- drivers/scsi/qla2xxx/qla_os.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 1dd8650..ace65db 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -4694,7 +4694,7 @@ retry_unlock: qla83xx_wait_logic(); retry++; ql_dbg(ql_dbg_p3p, base_vha, 0xb064, - "Failed to release IDC lock, retyring=%d\n", retry); + "Failed to release IDC lock, retrying=%d\n", retry); goto retry_unlock; } } else if (retry < 10) { @@ -4702,7 +4702,7 @@ retry_unlock: qla83xx_wait_logic(); retry++; ql_dbg(ql_dbg_p3p, base_vha, 0xb065, - "Failed to read drv-lockid, retyring=%d\n", retry); + "Failed to read drv-lockid, retrying=%d\n", retry); goto retry_unlock; } @@ -4718,7 +4718,7 @@ retry_unlock2: qla83xx_wait_logic(); retry++; ql_dbg(ql_dbg_p3p, base_vha, 0xb066, - "Failed to release IDC lock, retyring=%d\n", retry); + "Failed to release IDC lock, retrying=%d\n", retry); goto retry_unlock2; } } -- 2.9.3
[PATCH 0/4] Clarify/standardize memory barriers for lock/unlock
Hi, as discussed before: If a high-scalability locking scheme is built with multiple spinlocks, then often additional memory barriers are required. The documentation was not as clear as possible, and memory barriers were missing / superfluous in the implementation. Patch 1: Documentation, define one standard barrier, update ipc/sem.c Patch 2: Update rcutree Patch 3: Update nf_conntrack Patch 4: Update for qspinlock: smp_mb__after_spin_lock is free. Patch 3 is larger than required, it rewrites the conntrack logic with the code from ipc/sem.c. I think the new code is simpler and more realtime-friendly. Please review! @Andrew: The patches are relative to mmots. Could you include them in your tree, with the target of including in linux-next? -- Manfred
[PATCH 4/4] qspinlock for x86: smp_mb__after_spin_lock() is free
For x86 qspinlocks, no additional memory barrier is required in smp_mb__after_spin_lock: Theoretically, for qspinlock we could define two barriers: - smp_mb__after_spin_lock: Free for x86, not free for powerpc - smp_mb__between_spin_lock_and_spin_unlock_wait(): Free for all archs, see queued_spin_unlock_wait for details. As smp_mb__between_spin_lock_and_spin_unlock_wait() is not used in any hotpaths, the patch does not create that define yet. Signed-off-by: Manfred Spraul --- arch/x86/include/asm/qspinlock.h | 11 +++ 1 file changed, 11 insertions(+) diff --git a/arch/x86/include/asm/qspinlock.h b/arch/x86/include/asm/qspinlock.h index eaba080..da06433 100644 --- a/arch/x86/include/asm/qspinlock.h +++ b/arch/x86/include/asm/qspinlock.h @@ -61,6 +61,17 @@ static inline bool virt_spin_lock(struct qspinlock *lock) } #endif /* CONFIG_PARAVIRT */ +#ifndef smp_mb__after_spin_lock +/** + * smp_mb__after_spin_lock() - Provide smp_mb() after spin_lock + * + * queued_spin_lock() provides full memory barriers semantics, + * thus no further memory barrier is required. See + * queued_spin_unlock_wait() for further details. + */ +#define smp_mb__after_spin_lock() barrier() +#endif + #include #endif /* _ASM_X86_QSPINLOCK_H */ -- 2.5.5
[PATCH 1/4] spinlock: Document memory barrier rules
Right now, the spinlock machinery tries to guarantee barriers even for unorthodox locking cases, which ends up as a constant stream of updates as the architectures try to support new unorthodox ideas. The patch proposes to reverse that: spin_lock is ACQUIRE, spin_unlock is RELEASE. spin_unlock_wait is also ACQUIRE. Code that needs further guarantees must use appropriate explicit barriers. Architectures that can implement some barriers for free can define the barriers as NOPs. As the initial step, the patch converts ipc/sem.c to the new defines: - no more smp_rmb() after spin_unlock_wait(), that is part of spin_unlock_wait() - smp_mb__after_spin_lock() instead of a direct smp_mb(). Signed-off-by: Manfred Spraul --- Documentation/locking/spinlocks.txt | 5 + include/linux/spinlock.h| 12 ipc/sem.c | 16 +--- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/Documentation/locking/spinlocks.txt b/Documentation/locking/spinlocks.txt index ff35e40..fc37beb 100644 --- a/Documentation/locking/spinlocks.txt +++ b/Documentation/locking/spinlocks.txt @@ -40,6 +40,11 @@ example, internal driver data structures that nobody else ever touches). touches a shared variable has to agree about the spinlock they want to use. + NOTE! Code that needs stricter memory barriers than ACQUIRE during + LOCK and RELEASE during UNLOCK must use appropriate memory barriers + such as smp_mb__after_spin_lock(). + spin_unlock_wait() has ACQUIRE semantics. + Lesson 2: reader-writer spinlocks. diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index 47dd0ce..d79000e 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h @@ -130,6 +130,18 @@ do { \ #define smp_mb__before_spinlock() smp_wmb() #endif +#ifndef smp_mb__after_spin_lock +/** + * smp_mb__after_spin_lock() - Provide smp_mb() after spin_lock + * + * spin_lock() provides ACQUIRE semantics regarding reading the lock. + * There are no guarantees that the lock write is visible before any read + * or write operation within the protected area is performed. + * If the lock write must happen first, this function is required. + */ +#define smp_mb__after_spin_lock() smp_mb() +#endif + /** * raw_spin_unlock_wait - wait until the spinlock gets unlocked * @lock: the spinlock in question. diff --git a/ipc/sem.c b/ipc/sem.c index 5e318c5..ac15ab2 100644 --- a/ipc/sem.c +++ b/ipc/sem.c @@ -290,14 +290,6 @@ static void complexmode_enter(struct sem_array *sma) sem = sma->sem_base + i; spin_unlock_wait(&sem->lock); } - /* -* spin_unlock_wait() is not a memory barriers, it is only a -* control barrier. The code must pair with spin_unlock(&sem->lock), -* thus just the control barrier is insufficient. -* -* smp_rmb() is sufficient, as writes cannot pass the control barrier. -*/ - smp_rmb(); } /* @@ -363,13 +355,7 @@ static inline int sem_lock(struct sem_array *sma, struct sembuf *sops, */ spin_lock(&sem->lock); - /* -* See 51d7d5205d33 -* ("powerpc: Add smp_mb() to arch_spin_is_locked()"): -* A full barrier is required: the write of sem->lock -* must be visible before the read is executed -*/ - smp_mb(); + smp_mb__after_spin_lock(); if (!smp_load_acquire(&sma->complex_mode)) { /* fast path successful! */ -- 2.5.5
[PATCH 3/4] net/netfilter/nf_conntrack_core: update memory barriers.
Change the locking for nf_conntrack_lock and nf_conntract_lock_all() to the approach used by ipc/sem.c: - use smp_store_mb() instead of a raw smp_mb() - use smp_mb__after_spin_lock(). - for nf_conntrack_lock, use spin_lock(&global_lock) instead of spin_unlock_wait(&global_lock) and loop backward. The last change avoids that nf_conntrack_lock() could loop multiple times. Signed-off-by: Manfred Spraul --- net/netfilter/nf_conntrack_core.c | 36 ++-- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c index dd2c43a..ded1adc 100644 --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c @@ -80,20 +80,29 @@ static __read_mostly bool nf_conntrack_locks_all; void nf_conntrack_lock(spinlock_t *lock) __acquires(lock) { + /* Step 1: Acquire the lock */ spin_lock(lock); - while (unlikely(nf_conntrack_locks_all)) { - spin_unlock(lock); - /* -* Order the 'nf_conntrack_locks_all' load vs. the -* spin_unlock_wait() loads below, to ensure -* that 'nf_conntrack_locks_all_lock' is indeed held: -*/ - smp_rmb(); /* spin_lock(&nf_conntrack_locks_all_lock) */ - spin_unlock_wait(&nf_conntrack_locks_all_lock); - spin_lock(lock); - } + /* Step 2: make it visible to all CPUs that we hold the lock */ + smp_mb__after_spin_lock(); + + /* Step 3: read locks_all, with ACQUIRE semantics */ + if (likely(smp_load_acquire(&nf_conntrack_locks_all) == false)) + return; + + /* slow path: unlock */ + spin_unlock(lock); + + /* Slow path, step 1: get global lock */ + spin_lock(&nf_conntrack_locks_all_lock); + + /* Slow path, step 2: get the lock we want */ + spin_lock(lock); + + /* Slow path, step 3: release the global lock */ + spin_unlock(&nf_conntrack_locks_all_lock); } + EXPORT_SYMBOL_GPL(nf_conntrack_lock); static void nf_conntrack_double_unlock(unsigned int h1, unsigned int h2) @@ -133,15 +142,14 @@ static void nf_conntrack_all_lock(void) int i; spin_lock(&nf_conntrack_locks_all_lock); - nf_conntrack_locks_all = true; /* -* Order the above store of 'nf_conntrack_locks_all' against +* Order the store of 'nf_conntrack_locks_all' against * the spin_unlock_wait() loads below, such that if * nf_conntrack_lock() observes 'nf_conntrack_locks_all' * we must observe nf_conntrack_locks[] held: */ - smp_mb(); /* spin_lock(&nf_conntrack_locks_all_lock) */ + smp_store_mb(nf_conntrack_locks_all, true); for (i = 0; i < CONNTRACK_LOCKS; i++) { spin_unlock_wait(&nf_conntrack_locks[i]); -- 2.5.5
[PATCH 2/4] barrier.h: Move smp_mb__after_unlock_lock to barrier.h
spin_unlock() + spin_lock() together do not form a full memory barrier: a=1; spin_unlock(&b); spin_lock(&c); + smp_mb__after_unlock_lock(); d=1; Without the smp_mb__after_unlock_lock(), other CPUs can observe the write to d without seeing the write to a. Signed-off-by: Manfred Spraul --- include/asm-generic/barrier.h | 16 kernel/rcu/tree.h | 12 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/include/asm-generic/barrier.h b/include/asm-generic/barrier.h index fe297b5..9b4d28f 100644 --- a/include/asm-generic/barrier.h +++ b/include/asm-generic/barrier.h @@ -244,6 +244,22 @@ do { \ smp_acquire__after_ctrl_dep(); \ VAL;\ }) + +#ifndef smp_mb__after_unlock_lock +/* + * Place this after a lock-acquisition primitive to guarantee that + * an UNLOCK+LOCK pair act as a full barrier. This guarantee applies + * if the UNLOCK and LOCK are executed by the same CPU or if the + * UNLOCK and LOCK operate on the same lock variable. + */ +#ifdef CONFIG_PPC +#define smp_mb__after_unlock_lock()smp_mb() /* Full ordering for lock. */ +#else /* #ifdef CONFIG_PPC */ +#define smp_mb__after_unlock_lock()do { } while (0) +#endif /* #else #ifdef CONFIG_PPC */ + +#endif + #endif #endif /* !__ASSEMBLY__ */ diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h index e99a523..a0cd9ab 100644 --- a/kernel/rcu/tree.h +++ b/kernel/rcu/tree.h @@ -687,18 +687,6 @@ static inline void rcu_nocb_q_lengths(struct rcu_data *rdp, long *ql, long *qll) #endif /* #ifdef CONFIG_RCU_TRACE */ /* - * Place this after a lock-acquisition primitive to guarantee that - * an UNLOCK+LOCK pair act as a full barrier. This guarantee applies - * if the UNLOCK and LOCK are executed by the same CPU or if the - * UNLOCK and LOCK operate on the same lock variable. - */ -#ifdef CONFIG_PPC -#define smp_mb__after_unlock_lock()smp_mb() /* Full ordering for lock. */ -#else /* #ifdef CONFIG_PPC */ -#define smp_mb__after_unlock_lock()do { } while (0) -#endif /* #else #ifdef CONFIG_PPC */ - -/* * Wrappers for the rcu_node::lock acquire and release. * * Because the rcu_nodes form a tree, the tree traversal locking will observe -- 2.5.5
[GIT pull] timer fixes for 4.8
Linus, please pull the latest timers-urgent-for-linus git tree from: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers-urgent-for-linus A few updates for timers & co. - Prevent a livelock in the timekeeping code when debugging is enabled - Prevent out of bounds access in the timekeeping debug code - Various fixes in clocksource drivers - A new maintainers entry Thanks, tglx --> Alexandre Belloni (1): clocksource/drivers/timer-atmel-pit: Enable mck clock Baoyou Xie (1): clocksource/drivers/pxa: Fix include files for compilation Chen-Yu Tsai (1): clocksource/drivers/sun4i: Clear interrupts after stopping timer in probe function John Stultz (2): timekeeping: Avoid taking lock in NMI path with CONFIG_DEBUG_TIMEKEEPING timekeeping: Cap array access in timekeeping_debug Marcin Nowakowski (1): drivers/clocksource/pistachio: Fix memory corruption in init Mark Rutland (1): MAINTAINERS: Add ARM ARCHITECTED TIMER entry MAINTAINERS | 9 + drivers/clocksource/pxa_timer.c | 2 ++ drivers/clocksource/sun4i_timer.c | 9 - drivers/clocksource/time-pistachio.c | 8 drivers/clocksource/timer-atmel-pit.c | 6 ++ kernel/time/timekeeping.c | 5 - kernel/time/timekeeping_debug.c | 9 +++-- 7 files changed, 40 insertions(+), 8 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 0bbe4b105c34..4705c94f6a37 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -881,6 +881,15 @@ S: Supported F: drivers/gpu/drm/arc/ F: Documentation/devicetree/bindings/display/snps,arcpgu.txt +ARM ARCHITECTED TIMER DRIVER +M: Mark Rutland +M: Marc Zyngier +L: linux-arm-ker...@lists.infradead.org (moderated for non-subscribers) +S: Maintained +F: arch/arm/include/asm/arch_timer.h +F: arch/arm64/include/asm/arch_timer.h +F: drivers/clocksource/arm_arch_timer.c + ARM HDLCD DRM DRIVER M: Liviu Dudau S: Supported diff --git a/drivers/clocksource/pxa_timer.c b/drivers/clocksource/pxa_timer.c index 937e10b84d58..3e1cb512f3ce 100644 --- a/drivers/clocksource/pxa_timer.c +++ b/drivers/clocksource/pxa_timer.c @@ -21,6 +21,8 @@ #include #include +#include + #include #define OSMR0 0x00/* OS Timer 0 Match Register */ diff --git a/drivers/clocksource/sun4i_timer.c b/drivers/clocksource/sun4i_timer.c index 97669ee4df2a..c83452cacb41 100644 --- a/drivers/clocksource/sun4i_timer.c +++ b/drivers/clocksource/sun4i_timer.c @@ -123,12 +123,16 @@ static struct clock_event_device sun4i_clockevent = { .set_next_event = sun4i_clkevt_next_event, }; +static void sun4i_timer_clear_interrupt(void) +{ + writel(TIMER_IRQ_EN(0), timer_base + TIMER_IRQ_ST_REG); +} static irqreturn_t sun4i_timer_interrupt(int irq, void *dev_id) { struct clock_event_device *evt = (struct clock_event_device *)dev_id; - writel(0x1, timer_base + TIMER_IRQ_ST_REG); + sun4i_timer_clear_interrupt(); evt->event_handler(evt); return IRQ_HANDLED; @@ -208,6 +212,9 @@ static int __init sun4i_timer_init(struct device_node *node) /* Make sure timer is stopped before playing with interrupts */ sun4i_clkevt_time_stop(0); + /* clear timer0 interrupt */ + sun4i_timer_clear_interrupt(); + sun4i_clockevent.cpumask = cpu_possible_mask; sun4i_clockevent.irq = irq; diff --git a/drivers/clocksource/time-pistachio.c b/drivers/clocksource/time-pistachio.c index a7d9a08e4b0e..a8e6c7df853d 100644 --- a/drivers/clocksource/time-pistachio.c +++ b/drivers/clocksource/time-pistachio.c @@ -202,10 +202,10 @@ static int __init pistachio_clksrc_of_init(struct device_node *node) rate = clk_get_rate(fast_clk); /* Disable irq's for clocksource usage */ - gpt_writel(&pcs_gpt.base, 0, TIMER_IRQ_MASK, 0); - gpt_writel(&pcs_gpt.base, 0, TIMER_IRQ_MASK, 1); - gpt_writel(&pcs_gpt.base, 0, TIMER_IRQ_MASK, 2); - gpt_writel(&pcs_gpt.base, 0, TIMER_IRQ_MASK, 3); + gpt_writel(pcs_gpt.base, 0, TIMER_IRQ_MASK, 0); + gpt_writel(pcs_gpt.base, 0, TIMER_IRQ_MASK, 1); + gpt_writel(pcs_gpt.base, 0, TIMER_IRQ_MASK, 2); + gpt_writel(pcs_gpt.base, 0, TIMER_IRQ_MASK, 3); /* Enable timer block */ writel(TIMER_ME_GLOBAL, pcs_gpt.base); diff --git a/drivers/clocksource/timer-atmel-pit.c b/drivers/clocksource/timer-atmel-pit.c index 1ffac0cb0cb7..3494bc5a21d5 100644 --- a/drivers/clocksource/timer-atmel-pit.c +++ b/drivers/clocksource/timer-atmel-pit.c @@ -261,6 +261,12 @@ static int __init at91sam926x_pit_dt_init(struct device_node *node) return PTR_ERR(data->mck); } + ret = clk_prepare_enable(data->mck); + if (ret) { + pr_err("Unable to enable mck\n"); + return ret; + } + /* Get the interrupts property */ data->ir
[GIT pull] irq fixes for 4.8
Linus, please pull the latest irq-urgent-for-linus git tree from: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq-urgent-for-linus This lot provides: - Plug a hotplug race in the new affinity infrastructure - A fix for the trigger type of chained interrupts - Plug a potential memory leak in the core code - A few fixes for ARM and MIPS GICs Thanks, tglx --> Christoph Hellwig (1): genirq/affinity: Use get/put_online_cpus around cpumask operations David Daney (1): irqchip/gicv3-its: Disable the ITS before initializing it Marc Zyngier (2): genirq: Correctly configure the trigger on chained interrupts irqchip/gic: Allow self-SGIs for SMP on UP configurations Paul Burton (2): irqchip/mips-gic: Cleanup chip and handler setup irqchip/mips-gic: Implement activate op for device domain Shawn Lin (1): genirq: Fix potential memleak when failing to get irq pm Sudeep Holla (1): irqchip/gicv3: Remove disabling redistributor and group1 non-secure interrupts drivers/irqchip/irq-gic-v3-its.c | 7 ++- drivers/irqchip/irq-gic-v3.c | 11 +-- drivers/irqchip/irq-gic.c| 7 +++ drivers/irqchip/irq-mips-gic.c | 18 ++ kernel/irq/affinity.c| 2 ++ kernel/irq/chip.c| 11 +++ kernel/irq/manage.c | 8 ++-- 7 files changed, 55 insertions(+), 9 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index 7ceaba81efb4..36b9c28a5c91 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -1545,7 +1545,12 @@ static int its_force_quiescent(void __iomem *base) u32 val; val = readl_relaxed(base + GITS_CTLR); - if (val & GITS_CTLR_QUIESCENT) + /* +* GIC architecture specification requires the ITS to be both +* disabled and quiescent for writes to GITS_BASER or +* GITS_CBASER to not have UNPREDICTABLE results. +*/ + if ((val & GITS_CTLR_QUIESCENT) && !(val & GITS_CTLR_ENABLE)) return 0; /* Disable the generation of all interrupts to this ITS */ diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 6fc56c3466b0..ede5672ab34d 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -667,13 +667,20 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val, #endif #ifdef CONFIG_CPU_PM +/* Check whether it's single security state view */ +static bool gic_dist_security_disabled(void) +{ + return readl_relaxed(gic_data.dist_base + GICD_CTLR) & GICD_CTLR_DS; +} + static int gic_cpu_pm_notifier(struct notifier_block *self, unsigned long cmd, void *v) { if (cmd == CPU_PM_EXIT) { - gic_enable_redist(true); + if (gic_dist_security_disabled()) + gic_enable_redist(true); gic_cpu_sys_reg_init(); - } else if (cmd == CPU_PM_ENTER) { + } else if (cmd == CPU_PM_ENTER && gic_dist_security_disabled()) { gic_write_grpen1(0); gic_enable_redist(false); } diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c index c2cab572c511..390fac59c6bc 100644 --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c @@ -769,6 +769,13 @@ static void gic_raise_softirq(const struct cpumask *mask, unsigned int irq) int cpu; unsigned long flags, map = 0; + if (unlikely(nr_cpu_ids == 1)) { + /* Only one CPU? let's do a self-IPI... */ + writel_relaxed(2 << 24 | irq, + gic_data_dist_base(&gic_data[0]) + GIC_DIST_SOFTINT); + return; + } + raw_spin_lock_irqsave(&irq_controller_lock, flags); /* Convert our logical CPU mask into a physical one. */ diff --git a/drivers/irqchip/irq-mips-gic.c b/drivers/irqchip/irq-mips-gic.c index c5f33c3bd228..83f498393a7f 100644 --- a/drivers/irqchip/irq-mips-gic.c +++ b/drivers/irqchip/irq-mips-gic.c @@ -713,9 +713,6 @@ static int gic_shared_irq_domain_map(struct irq_domain *d, unsigned int virq, unsigned long flags; int i; - irq_set_chip_and_handler(virq, &gic_level_irq_controller, -handle_level_irq); - spin_lock_irqsave(&gic_lock, flags); gic_map_to_pin(intr, gic_cpu_pin); gic_map_to_vpe(intr, mips_cm_vp_id(vpe)); @@ -732,6 +729,10 @@ static int gic_irq_domain_map(struct irq_domain *d, unsigned int virq, { if (GIC_HWIRQ_TO_LOCAL(hw) < GIC_NUM_LOCAL_INTRS) return gic_local_irq_domain_map(d, virq, hw); + + irq_set_chip_and_handler(virq, &gic_level_irq_controller, +handle_level_irq); + return gic_shared_irq_domain_map(d, virq, hw, 0); } @@ -771,11 +772,13 @@ st
Re: [BISECTED REGRESSION] v4.8-rc: DT/OCTEON driver probing broken
Hi, On Sun, Aug 28, 2016 at 12:34:06PM +0200, Thorsten Leemhuis wrote: > Lo! Kefeng, below report made it to the list of regression for 4.8, but > afaics nothing happened after the initial report. Is there maybe some > reason why it shouldn't be on the list of regressions at all? Or was the > problem discussed elsewhere? Or is it even fixed already? I noticed > https://git.kernel.org/torvalds/c/fc520f8b4f (of/platform: disable the > of_platform_default_populate_init() for all the ppc board), but that > change is PPC specific. There is a fix proposal here: https://patchwork.linux-mips.org/patch/14041/ There is still few other boards remaining that use of_platform_bus_probe() from device_initcall, but who knows, maybe they are not affected. arch/microblaze/kernel/platform.c arch/mips/mti-malta/malta-dt.c arch/mips/netlogic/xlp/dt.c arch/x86/platform/olpc/olpc_dt.c A. > On 16.08.2016 17:00, Aaro Koskinen wrote: > > Hi, > > > > Commit 44a7185c2ae6 ("of/platform: Add common method to populate default > > bus") added new arch_initcall of_platform_default_populate_init() that > > will be called before device_initcall octeon_publish_devices(). Now the > > of_platform_bus_probe() called in octeon_publish_devices() is apparently > > doing nothing: > > > > [ 52.331353] calling octeon_publish_devices+0x0/0x14 @ 1 > > [ 52.331358] OF: of_platform_bus_probe() > > [ 52.331362] OF: starting at: / > > [ 52.331378] OF: of_platform_bus_create() - skipping /soc@0, already > > populated > > [ 52.331394] initcall octeon_publish_devices+0x0/0x14 returned 0 after 29 > > usecs > > > > This also means that USB etc. won't get probed. > > > > Any ideas what would be the proper fix for this? Changing > > octeon_publish_devices() to arch_initcall seems to work but that may be > > a bit hackish... Also, there might be also other MIPS boards affected > > (arch/mips/netlogic/xlp/dt.c, arch/mips/mti-malta/malta-dt.c). > > > > A. > > > > http://news.gmane.org/find-root.php?message_id=20160816150056.GD18731%40ak-desktop.emea.nsn-net.net > > > > http://mid.gmane.org/20160816150056.GD18731%40ak-desktop.emea.nsn-net.net > > >
[GIT pull] x86 fixes for 4.8
Linus, please pull the latest x86-urgent-for-linus git tree from: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-urgent-for-linus A single bugfix to prevent irq remapping when the ioapic is disabled. Thanks, tglx --> Wanpeng Li (1): x86/apic: Do not init irq remapping if ioapic is disabled arch/x86/kernel/apic/apic.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index cea4fc19e844..50c95af0f017 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -1623,6 +1623,9 @@ void __init enable_IR_x2apic(void) unsigned long flags; int ret, ir_stat; + if (skip_ioapic_setup) + return; + ir_stat = irq_remapping_prepare(); if (ir_stat < 0 && !x2apic_supported()) return;
[GIT pull] perf fixes for 4.8
Linus, please pull the latest perf-urgent-for-linus git tree from: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git perf-urgent-for-linus A few fixes from the perf departement - Prevent a imbalanced preemption disable in the events teardown code - Prevent out of bound acces in perf userspace - Make perf tools compile with UCLIBC again - A fix for the userspace unwinder utility Thanks, tglx --> Arnaldo Carvalho de Melo (1): perf evsel: Do not access outside hw cache name arrays Milian Wolff (1): perf unwind: Use addr_location::addr instead of ip for entries Vineet Gupta (1): tools lib: Reinstate strlcpy() header guard with __UCLIBC__ Will Deacon (1): perf/core: Use this_cpu_ptr() when stopping AUX events kernel/events/core.c | 2 +- tools/include/linux/string.h | 6 +- tools/perf/util/evsel.c | 6 +++--- tools/perf/util/unwind-libdw.c | 2 +- tools/perf/util/unwind-libunwind-local.c | 2 +- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/kernel/events/core.c b/kernel/events/core.c index 5650f5317e0c..3cfabdf7b942 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -6166,7 +6166,7 @@ static int __perf_pmu_output_stop(void *info) { struct perf_event *event = info; struct pmu *pmu = event->pmu; - struct perf_cpu_context *cpuctx = get_cpu_ptr(pmu->pmu_cpu_context); + struct perf_cpu_context *cpuctx = this_cpu_ptr(pmu->pmu_cpu_context); struct remote_output ro = { .rb = event->rb, }; diff --git a/tools/include/linux/string.h b/tools/include/linux/string.h index b96879477311..f436d2420a18 100644 --- a/tools/include/linux/string.h +++ b/tools/include/linux/string.h @@ -8,7 +8,11 @@ void *memdup(const void *src, size_t len); int strtobool(const char *s, bool *res); -#ifdef __GLIBC__ +/* + * glibc based builds needs the extern while uClibc doesn't. + * However uClibc headers also define __GLIBC__ hence the hack below + */ +#if defined(__GLIBC__) && !defined(__UCLIBC__) extern size_t strlcpy(char *dest, const char *src, size_t size); #endif diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index d9b80ef881cd..21fd573106ed 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -507,17 +507,17 @@ static int __perf_evsel__hw_cache_name(u64 config, char *bf, size_t size) u8 op, result, type = (config >> 0) & 0xff; const char *err = "unknown-ext-hardware-cache-type"; - if (type > PERF_COUNT_HW_CACHE_MAX) + if (type >= PERF_COUNT_HW_CACHE_MAX) goto out_err; op = (config >> 8) & 0xff; err = "unknown-ext-hardware-cache-op"; - if (op > PERF_COUNT_HW_CACHE_OP_MAX) + if (op >= PERF_COUNT_HW_CACHE_OP_MAX) goto out_err; result = (config >> 16) & 0xff; err = "unknown-ext-hardware-cache-result"; - if (result > PERF_COUNT_HW_CACHE_RESULT_MAX) + if (result >= PERF_COUNT_HW_CACHE_RESULT_MAX) goto out_err; err = "invalid-cache"; diff --git a/tools/perf/util/unwind-libdw.c b/tools/perf/util/unwind-libdw.c index cf5e250bc78e..783a53fb7a4e 100644 --- a/tools/perf/util/unwind-libdw.c +++ b/tools/perf/util/unwind-libdw.c @@ -66,7 +66,7 @@ static int entry(u64 ip, struct unwind_info *ui) if (__report_module(&al, ip, ui)) return -1; - e->ip = ip; + e->ip = al.addr; e->map = al.map; e->sym = al.sym; diff --git a/tools/perf/util/unwind-libunwind-local.c b/tools/perf/util/unwind-libunwind-local.c index 97c0f8fc5561..20c2e5743903 100644 --- a/tools/perf/util/unwind-libunwind-local.c +++ b/tools/perf/util/unwind-libunwind-local.c @@ -542,7 +542,7 @@ static int entry(u64 ip, struct thread *thread, thread__find_addr_location(thread, PERF_RECORD_MISC_USER, MAP__FUNCTION, ip, &al); - e.ip = ip; + e.ip = al.addr; e.map = al.map; e.sym = al.sym;
Re: [PATCH 3/6] rtl8188eu: declare internal function as static
On Sat, 2016-08-27 at 14:40 +0200, Luca Ceresoli wrote: Put here few words _why_ you are doing this. Perhaps, add output of sparse static analyzer. > Signed-off-by: Luca Ceresoli > Cc: Greg Kroah-Hartman > Cc: Bhaktipriya Shridhar > Cc: Andy Shevchenko > Cc: Geliang Tang > Cc: Jakub Sitnicki > Cc: Ivan Safonov > Cc: Kyle Kuffermann > Cc: linux-kernel@vger.kernel.org > --- > drivers/staging/rtl8188eu/core/rtw_recv.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c > b/drivers/staging/rtl8188eu/core/rtw_recv.c > index 977bb2532c3e..1063617b0ce4 100644 > --- a/drivers/staging/rtl8188eu/core/rtw_recv.c > +++ b/drivers/staging/rtl8188eu/core/rtw_recv.c > @@ -39,7 +39,7 @@ static u8 rtw_rfc1042_header[] = { > 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 > }; > > -void rtw_signal_stat_timer_hdl(unsigned long data); > +static void rtw_signal_stat_timer_hdl(unsigned long data); > > void _rtw_init_sta_recv_priv(struct sta_recv_priv *psta_recvpriv) > { > @@ -2088,7 +2088,7 @@ _recv_entry_drop: > return ret; > } > > -void rtw_signal_stat_timer_hdl(unsigned long data) > +static void rtw_signal_stat_timer_hdl(unsigned long data) > { > struct adapter *adapter = (struct adapter *)data; > struct recv_priv *recvpriv = &adapter->recvpriv; -- Andy Shevchenko Intel Finland Oy
Re: [PATCH v1] i2c: designware: save the preset value of DW_IC_SDA_HOLD
On Sat, 2016-08-27 at 15:39 +0800, Zhuo-hao Lee wrote: > There are several ways to set the SDA hold time for i2c controller, > including: Device Tree, built-in device properties and ACPI. However, > if the SDA hold time is not specified by above method, we should > read the value, where it is preset by firmware, and save it to > sda_hold_time. This is needed because when i2c controller enters > runtime suspend, the DW_IC_SDA_HOLD value will be reset to chipset > default value. And during runtime resume, i2c_dw_init will be called > to reconfigure i2c controller. If sda_hold_time is zero, the chipset > default hold time will be used, that will be too short for some > platforms. Therefore, to have a better tolerance, the DW_IC_SDA_HOLD > value should be kept by sda_hold_time. Looks good to me. Reviewed-by: Andy Shevchenko > > Signed-off-by: Zhuo-hao Lee > --- > drivers/i2c/busses/i2c-designware-core.c | 16 ++-- > 1 file changed, 10 insertions(+), 6 deletions(-) > > diff --git a/drivers/i2c/busses/i2c-designware-core.c > b/drivers/i2c/busses/i2c-designware-core.c > index c6922b8..fcd973d 100644 > --- a/drivers/i2c/busses/i2c-designware-core.c > +++ b/drivers/i2c/busses/i2c-designware-core.c > @@ -367,13 +367,17 @@ int i2c_dw_init(struct dw_i2c_dev *dev) > dev_dbg(dev->dev, "Fast-mode HCNT:LCNT = %d:%d\n", hcnt, > lcnt); > > /* Configure SDA Hold Time if required */ > - if (dev->sda_hold_time) { > - reg = dw_readl(dev, DW_IC_COMP_VERSION); > - if (reg >= DW_IC_SDA_HOLD_MIN_VERS) > + reg = dw_readl(dev, DW_IC_COMP_VERSION); > + if (reg >= DW_IC_SDA_HOLD_MIN_VERS) { > + if (dev->sda_hold_time) { > dw_writel(dev, dev->sda_hold_time, > DW_IC_SDA_HOLD); > - else > - dev_warn(dev->dev, > - "Hardware too old to adjust SDA hold > time."); > + } else { > + /* Keep previous hold time setting if no one > set it */ > + dev->sda_hold_time = dw_readl(dev, > DW_IC_SDA_HOLD); > + } > + } else { > + dev_warn(dev->dev, > + "Hardware too old to adjust SDA hold > time.\n"); > } > > /* Configure Tx/Rx FIFO threshold levels */ -- Andy Shevchenko Intel Finland Oy
Re: [PATCH v05 69/72] uapi rose.h: glibc netrose/rose.h header file compatibility fixes
Am 28.08.2016 07:59, schrieb Mikko Rapeli: > On Fri, Aug 26, 2016 at 05:38:00PM +0200, walter harms wrote: >> perhaps this not tested snipped would make sure that >> you have included linux/rose.h ? >> >> #ifndef ROSE_KERNEL_H >> #include >> #endif >> >> #include > > Sorry, I did not quite get this. > > has conflicting definitions with glibc . > The patches fixes the uapi headers so that it hides > definitions if from glibc was already included. > > -Mikko no problem, so far i understand the conflict arise because you need to include linux/rose.h before netrose/rose.h My suggestion was to add a check for linux/rose.h (ROSE_KERNEL_H) and include it if not already done. (basicly this should work out of the box but it seems a problem here). I have no idea if you need to cover other cases but in my understanding userspace programms should not include kernel headers. re, wh
Re: [PATCH][v6] PM / hibernate: Print the possible panic reason when resuming with inconsistent e820 map
On Sun 2016-08-28 10:07:10, Chen Yu wrote: > Hi, > On Fri, Aug 26, 2016 at 09:56:54PM +0200, Pavel Machek wrote: > > Hi! > > > > > > > > What's the progress of this patch? Looks already have experts > > > > > > review it. > > > > > > Why this patch didn't accept? > > > > > This patch is a little overkilled, and I have saved another simpler > > > > > version to only check the md5 hash (as people suggested) for it. I > > > > > can post it later. > > > > > > > > > > > > > I am happy to test and review it. > > > > > > > Here it is. As Rafael is on travel, it would be grateful > > > if you can give some advance on this, thanks! > > > > Better than last one. > > > > > + return -ENOMEM; > > > + > > > + req = ahash_request_alloc(tfm, GFP_ATOMIC); > > > > what context is this called from? GFP_ATOMIC allocations like to fail... > > > It is in normal process context, OK, I'll change it to GFP_KERNEL. > > > +static int hibernation_e820_check(void *buf) > > > +{ > > > + int ret; > > > + char result[MD5_HASH_SIZE] = {0}; > > > + > > > + ret = get_e820_md5(&e820_saved, result); > > > + if (ret) > > > + return ret; > > > + > > > + if (memcmp(result, buf, MD5_HASH_SIZE)) > > > + e820_conflict = true; > > > > Passing return value using global variable is ugly. Can you just print > > the warning and kill the box here? > Do you mean get rid of the panic hooker and just print the warning > here? Yep, I'd do that... (And you probably want to rise the severity). Thanks, Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Re: [PATCH v2] fix:infiniband:hw:cxgb4:qp:mark symbols static where possible
Except the fact that we have a little bit different format for title ==> "IB/cxgb4: Mark symbols static for _free_qp" Looks ok, Reviewed-by: Leon Romanovsky signature.asc Description: PGP signature
core.c:undefined reference to `fpu_save'
Hi Andrew, It's probably a bug fix that unveils the link errors. tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: af56ff27eba54fceee5f5643e79bf6531f2e1739 commit: c60f169202c7643991a8b4bfeea60e06843d5b5a arch/mn10300/kernel/fpu-nofpu.c: needs asm/elf.h date: 5 months ago config: mn10300-allnoconfig (attached as .config) compiler: am33_2.0-linux-gcc (GCC) 4.9.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 git checkout c60f169202c7643991a8b4bfeea60e06843d5b5a # save the attached .config to linux build tree make.cross ARCH=mn10300 All errors (new ones prefixed by >>): kernel/built-in.o: In function `.L412': >> core.c:(.sched.text+0x257): undefined reference to `fpu_save' --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: Binary data
Linux 3.10.103
Linux 3.10.103 was just released. The patch and changelog will appear soon at the following locations: https://www.kernel.org/pub/linux/kernel/v3.x/ https://www.kernel.org/pub/linux/kernel/v3.x/patch-3.10.103.xz https://www.kernel.org/pub/linux/kernel/v3.x/patch-3.10.103.gz https://www.kernel.org/pub/linux/kernel/v3.x/ChangeLog-3.10.103 The updated 3.10.y git tree can be found at: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-3.10.y http://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-3.10.y The tree can be browsed on the git web interface: http://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/log/?h=linux-3.10.y Thanks to all participants. Willy - Documentation/scsi/scsi_eh.txt| 8 +- Documentation/sysctl/fs.txt | 23 ++ Makefile | 2 +- arch/arc/kernel/stacktrace.c | 2 +- arch/arc/mm/tlbex.S | 4 +- arch/arm/kernel/ptrace.c | 2 +- arch/arm/kernel/sys_oabi-compat.c | 8 +- arch/metag/include/asm/cmpxchg_lnkget.h | 2 +- arch/mips/ath79/early_printk.c| 6 +- arch/mips/include/asm/kvm_host.h | 1 + arch/mips/include/asm/processor.h | 2 +- arch/mips/include/uapi/asm/siginfo.h | 18 +- arch/mips/kernel/scall64-n32.S| 2 +- arch/mips/kernel/scall64-o32.S| 2 +- arch/mips/kvm/kvm_locore.S| 1 + arch/mips/kvm/kvm_mips.c | 11 +- arch/mips/kvm/kvm_mips_emul.c | 33 ++- arch/mips/kvm/kvm_mips_int.h | 2 + arch/mips/kvm/kvm_tlb.c | 61 +++-- arch/mips/math-emu/cp1emu.c | 8 +- arch/parisc/kernel/unaligned.c| 10 +- arch/powerpc/include/asm/reg.h| 6 +- arch/powerpc/kernel/exceptions-64s.S | 16 +- arch/powerpc/kernel/process.c | 10 + arch/powerpc/platforms/pseries/eeh_pseries.c | 51 ++-- arch/powerpc/platforms/pseries/iommu.c| 24 +- arch/s390/include/asm/syscall.h | 2 +- arch/x86/boot/Makefile| 3 + arch/x86/include/asm/mmu_context.h| 33 ++- arch/x86/kernel/amd_nb.c | 4 +- arch/x86/kernel/apm_32.c | 2 +- arch/x86/kernel/cpu/perf_event_intel.c| 11 +- arch/x86/kernel/kprobes/core.c| 12 + arch/x86/kvm/x86.c| 5 + arch/x86/mm/tlb.c | 24 +- block/genhd.c | 1 + crypto/gcm.c | 4 +- crypto/scatterwalk.c | 3 +- drivers/acpi/pci_root.c | 67 ++--- drivers/ata/libata-eh.c | 2 +- drivers/base/module.c | 8 +- drivers/crypto/ux500/hash/hash_core.c | 4 +- drivers/gpio/gpio-pca953x.c | 2 +- drivers/gpu/drm/drm_fb_helper.c | 5 +- drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c | 2 +- drivers/gpu/drm/radeon/radeon_atombios.c | 4 +- drivers/gpu/drm/radeon/radeon_atpx_handler.c | 5 + drivers/gpu/drm/radeon/radeon_connectors.c| 15 +- drivers/gpu/drm/radeon/radeon_device.c| 21 ++ drivers/hid/hid-input.c | 2 +- drivers/hid/usbhid/hiddev.c | 10 +- drivers/iio/accel/kxsd9.c | 4 +- drivers/iio/adc/ad7266.c | 6 +- drivers/iio/industrialio-trigger.c| 23 +- drivers/infiniband/core/ucm.c | 4 + drivers/infiniband/core/ucma.c| 4 + drivers/infiniband/core/uverbs_main.c | 5 + drivers/infiniband/hw/mlx4/ah.c | 2 +- drivers/infiniband/hw/mlx4/qp.c | 2 +- drivers/infiniband/hw/qib/qib_file_ops.c | 5 + drivers/infiniband/ulp/ipoib/ipoib_main.c | 4 +- drivers/input/joystick/xpad.c | 3 + drivers/input/misc/uinput.c | 6 + drivers/input/touchscreen/wacom_w8001.c | 2 +- drivers/isdn/hardware/mISDN/hfcpci.c | 4 +- drivers/md/dm-flakey.c| 23 +- drivers/media/dvb-frontends/stb6100.c | 2 +- drivers/media/platform/s5p-mfc/s5p_mfc.c | 11 + drivers/mmc/card/block.c | 12 +- drivers/mtd/ubi/build.c | 5 +- drivers/mtd/ubi/vmt.c | 25 +- drivers/net/can/at91_can.c| 5 +- drivers/net/can/dev.c | 6 + drivers/net/ethernet/atheros/alx/main.c | 7 +- drivers/net/ethernet/marvell/mvneta.c | 2 +- drivers/net/usb/cdc_ncm.c |
RE: [PATCH][v6] PM / hibernate: Print the possible panic reason when resuming with inconsistent e820 map
> -Original Message- > From: Pavel Machek [mailto:pa...@ucw.cz] > Sent: Sunday, August 28, 2016 8:48 PM > To: Chen, Yu C > Cc: joeyli; Rafael J. Wysocki; linux...@vger.kernel.org; linux- > ker...@vger.kernel.org > Subject: Re: [PATCH][v6] PM / hibernate: Print the possible panic reason when > resuming with inconsistent e820 map > > On Sun 2016-08-28 10:07:10, Chen Yu wrote: > > Hi, > > On Fri, Aug 26, 2016 at 09:56:54PM +0200, Pavel Machek wrote: > > > Hi! > > > > > > > > > > What's the progress of this patch? Looks already have experts > review it. > > > > > > > Why this patch didn't accept? > > > > > > This patch is a little overkilled, and I have saved another > > > > > > simpler version to only check the md5 hash (as people suggested) for > it. I can post it later. > > > > > > > > > > > > > > > > I am happy to test and review it. > > > > > > > > > Here it is. As Rafael is on travel, it would be grateful if you > > > > can give some advance on this, thanks! > > > > > > Better than last one. > > > > > > > + return -ENOMEM; > > > > + > > > > + req = ahash_request_alloc(tfm, GFP_ATOMIC); > > > > > > what context is this called from? GFP_ATOMIC allocations like to fail... > > > > > It is in normal process context, OK, I'll change it to GFP_KERNEL. > > > > +static int hibernation_e820_check(void *buf) { > > > > + int ret; > > > > + char result[MD5_HASH_SIZE] = {0}; > > > > + > > > > + ret = get_e820_md5(&e820_saved, result); > > > > + if (ret) > > > > + return ret; > > > > + > > > > + if (memcmp(result, buf, MD5_HASH_SIZE)) > > > > + e820_conflict = true; > > > > > > Passing return value using global variable is ugly. Can you just > > > print the warning and kill the box here? > > Do you mean get rid of the panic hooker and just print the warning > > here? > > Yep, I'd do that... (And you probably want to rise the severity). Sometime the users might not be able to see the warning during resume(too fast) and got a system panic later, so I was thinking if it might help user to see the warning in panic too, how about this: if (memcmp(result, buf, MD5_DIGEST_SIZE)) { pr_err("PM: e820 map conflict detected!\n"); register_die_notifier(&hibernation_die_notifier); } So we can print warning in hibernation_die_notifier without introducing a global variable? Thanks, Yu
Hello Beautiful,
Good day dear, i hope this mail meets you well? my name is Jack, from the U.S. I know this may seem inappropriate so i ask for your forgiveness but i wish to get to know you better, if I may be so bold. I consider myself an easy-going man, adventurous, honest and fun loving person but I am currently looking for a relationship in which I will feel loved. I promise to answer any question that you may want to ask me...all i need is just your attention and the chance to know you more. Please tell me more about yourself, if you do not mind. Hope to hear back from you soon. Jack.
Re: constification and cocci / kernel build test robot ?
[Adding Kees, in case it's of interest] Below is the list of types of top-level initialized structures and the number that are const. For quicker reading, here are some that are sometimes const (numerator), but not always (denominator): file_operations: 2221/2233 attribute_group: 447/919 irq_chip: 1/518 net_device_ops: 488/498 regmap_config: 407/447 dev_pm_ops: 398/415 clk_ops: 314/386 resource: 6/385 seq_operations: 327/328 snd_pcm_ops: 9/288 and here are the most used ones that are never const at all: platform_driver: 2943 platform_device: 2226 clk_branch: 1131 i2c_driver: 786 pci_driver: 781 omap_hwmod_ocp_if: 670 omap_hwmod: 582 notifier_block: 556 clk: 473 clk_rcg2: 384 julia --- All const machine_desc: 286 inode_operations: 211 v4l2_ctrl_ops: 209 sysfs_ops: 105 sirfsoc_padmux: 97 address_space_operations: 93 nvkm_device_chip: 74 iwl_cfg: 68 block_device_operations: 63 regmap_access_table: 62 driver_info: 62 tty_operations: 60 mlxsw_reg_info: 60 ide_port_ops: 60 sd_desc: 56 common_glue_ctx: 50 panel_desc: 47 rpc_call_ops: 43 mtd_ooblayout_ops: 41 drm_crtc_helper_funcs: 41 drm_crtc_funcs: 41 bpf_func_proto: 41 v4l2_subdev_internal_ops: 39 nvkm_object_func: 39 tty_port_operations: 36 nft_expr_ops: 36 intel_device_info: 35 iio_trigger_ops: 35 snd_ac97_build_ops: 33 iio_buffer_setup_ops: 33 user_regset_view: 32 can_bittiming_const: 32 ivtv_card: 31 amdgpu_irq_src_funcs: 31 amd_ip_funcs: 30 option_blacklist_info: 28 nv50_disp_dmac_oclass: 27 afs_call_type: 27 export_operations: 26 xfs_buf_ops: 24 nv50_disp_mthd_list: 24 sh_pfc_soc_info: 23 nvkm_fb_func: 23 v4l2_subdev_tuner_ops: 22 sdhci_pci_fixes: 22 devs_id: 22 clockgen_muxinfo: 22 imxuart_platform_data: 21 v4l2_subdev_audio_ops: 20 ide_dma_ops: 20 radeon_asic_ring: 19 nvkm_gr_func: 19 media_entity_operations: 19 intel_limit: 19 factors_data: 19 dvb_pll_desc: 19 component_master_ops: 19 Qdisc_class_ops: 19 qcom_cc_desc: 18 omap_dss_features: 18 nvkm_engine_func: 18 si_dte_data: 17 qcom_rpm_reg: 17 ieee80211_regdomain: 17 action_chain: 17 voltage_map_desc: 16 sunxi_pinctrl_desc: 16 nvkm_falcon_func: 16 iio_enum: 16 idle_cpu: 16 clk_factors_config: 16 bnx2x_phy: 16 pcr_ops: 15 ide_tp_ops: 15 gf100_grctx_func: 15 gf100_gr_func: 15 dpll_data: 15 clk_hw_omap_ops: 15 snd_dmaengine_pcm_config: 14 snd_bebob_spec: 14 lpss_device_desc: 14 keyspan_device_details: 14 e1000_info: 14 dss_features: 14 nvkm_fifo_chan_oclass: 13 nvkm_disp_oclass: 13 nvkm_devinit_func: 13 nv50_disp_chan_mthd: 13 net_offload: 13 ipu_rgb: 13 hv_ops: 13 amdgpu_ring_funcs: 13 wiimod_ops: 12 tpm_class_ops: 12 tegra_tsensor_group: 12 spi_imx_master: 12 phm_master_table_header: 12 nvkm_mc_func: 12 nv50_disp_root_func: 12 nv50_disp_func: 12 intel_watermark_params: 12 intel_uncore_init_fun: 12 imxi2c_platform_data: 12 dss_pll_hw: 12 dcbnl_rtnl_ops: 12 cphy_ops: 12 color_conversion: 12 xt_table: 11 usb_protocol_ops: 11 nvkm_clk_func: 11 niu_phy_template: 11 niu_phy_ops: 11 mtk_gate_regs: 11 l2c_init_data: 11 iwl_base_params: 11 intel_pinctrl_soc_data: 11 iio_event_spec: 11 hpt_info: 11 fw_address_region: 11 font_desc: 11 edac_device_prv_data: 11 coresight_ops: 11 coreclk_soc_desc: 11 xfrm_type: 10 vmw_res_func: 10 v4l2_dv_timings_cap: 10 usbhs_pkt_handle: 10 squashfs_decompressor: 10 samsung_pin_bank_type: 10 raid6_calls: 10 pvr2_device_desc: 10 nvkm_pci_func: 10 nvkm_i2c_pad_func: 10 nvkm_event_func: 10 nv50_disp_pioc_oclass: 10 nf_chain_type: 10 mxc_nand_platform_data: 10 msm_pinctrl_soc_data: 10 ixgb_option: 10 iwl_dvm_cfg: 10 iproc_pll_ctrl: 10 intel_lpss_platform_info: 10 i915_power_well_ops: 10 go7007_usb_board: 10 dispc_features: 10 cx18_card: 10 crypto_type: 10 ci_pt_defaults: 10 ad7877_platform_data: 10 vsp1_entity_operations: 9 tegra_xusb_pad_soc: 9 tegra_xusb_pad_ops: 9 tegra_xusb_lane_ops: 9 rtl818x_rf_ops: 9 rockchip_cpuclk_reg_data: 9 pipe_buf_operations: 9 nvkm_ram_func: 9 nvbios_source: 9 nfs_pageio_ops: 9 nf_nat_l4proto: 9 mtk_ddp_comp_funcs: 9 macb_config: 9 ixgbevf_info: 9 iwl_ht_params: 9 intel_early_ops: 9 icst_params: 9 hdmi_timings: 9 gfs2_glock_operations: 9 berlin_pinctrl_desc: 9 adv7180_chip_info: 9 snd_bebob_meter_spec: 8 sensor_template_group: 8 sccnxp_chip: 8 rt2x00lib_ops: 8 rt2x00_ops: 8 rpm_reg_parts: 8 rpc_program: 8 radio_isa_ops: 8 ppp_channel_ops: 8 pci_raw_ops: 8 pch_gbe_option: 8 omap_vfsm_instance: 8 ohci_driver_overrides: 8 nvkm_pmu_func: 8 nvkm_i2c_func: 8 nvkm_fifo_func: 8 netdev_event_work_cmd: 8 net_user_info: 8 net_kern_info: 8 neigh_ops: 8 mxr_format: 8 m88ds3103_config: 8 lg4ff_compat_mode_switch: 8 intel_gtt_driver: 8 gk104_fifo_func: 8 fb_bitfield: 8 exynos_adc_data: 8 drm_panel_funcs: 8 cpu_dev: 8 consw: 8 ci_hdrc_imx_platform_flag: 8 chan_ops: 8 brcms_c_rateset: 8 bpf_map_ops: 8 ath9k_percal_data: 8 at91_ebi_caps: 8 adis_data: 8 action_ops: 8 acpi_gpio_params: 8 usbmisc_ops: 7 usb_clk_data: 7 ti_bandgap_data: 7 tegra_xusb_port_ops: 7 sun4i_usb_phy_cfg: 7 st_pctl_data: 7 snd_soc_pcm_stream: 7 snd_bebob_rate_spec: 7 snd_bebob_
Re: [PATCH][v6] PM / hibernate: Print the possible panic reason when resuming with inconsistent e820 map
On Sun 2016-08-28 13:08:02, Chen, Yu C wrote: > > -Original Message- > > From: Pavel Machek [mailto:pa...@ucw.cz] > > Sent: Sunday, August 28, 2016 8:48 PM > > To: Chen, Yu C > > Cc: joeyli; Rafael J. Wysocki; linux...@vger.kernel.org; linux- > > ker...@vger.kernel.org > > Subject: Re: [PATCH][v6] PM / hibernate: Print the possible panic reason > > when > > resuming with inconsistent e820 map > > > > On Sun 2016-08-28 10:07:10, Chen Yu wrote: > > > Hi, > > > On Fri, Aug 26, 2016 at 09:56:54PM +0200, Pavel Machek wrote: > > > > Hi! > > > > > > > > > > > > What's the progress of this patch? Looks already have experts > > review it. > > > > > > > > Why this patch didn't accept? > > > > > > > This patch is a little overkilled, and I have saved another > > > > > > > simpler version to only check the md5 hash (as people suggested) > > > > > > > for > > it. I can post it later. > > > > > > > > > > > > > > > > > > > I am happy to test and review it. > > > > > > > > > > > Here it is. As Rafael is on travel, it would be grateful if you > > > > > can give some advance on this, thanks! > > > > > > > > Better than last one. > > > > > > > > > + return -ENOMEM; > > > > > + > > > > > + req = ahash_request_alloc(tfm, GFP_ATOMIC); > > > > > > > > what context is this called from? GFP_ATOMIC allocations like to fail... > > > > > > > It is in normal process context, OK, I'll change it to GFP_KERNEL. > > > > > +static int hibernation_e820_check(void *buf) { > > > > > + int ret; > > > > > + char result[MD5_HASH_SIZE] = {0}; > > > > > + > > > > > + ret = get_e820_md5(&e820_saved, result); > > > > > + if (ret) > > > > > + return ret; > > > > > + > > > > > + if (memcmp(result, buf, MD5_HASH_SIZE)) > > > > > + e820_conflict = true; > > > > > > > > Passing return value using global variable is ugly. Can you just > > > > print the warning and kill the box here? > > > Do you mean get rid of the panic hooker and just print the warning > > > here? > > > > Yep, I'd do that... (And you probably want to rise the severity). > Sometime the users might not be able to see the warning during resume(too > fast) > and got a system panic later, so I was thinking if it might help user to see > the warning > in panic too, how about this: > > if (memcmp(result, buf, MD5_DIGEST_SIZE)) { > pr_err("PM: e820 map conflict detected!\n"); > register_die_notifier(&hibernation_die_notifier); > } > So we can print warning in hibernation_die_notifier without introducing a > global variable? > Actually, I'd kill the machine right away. if (memcmp(result, buf, MD5_DIGEST_SIZE)) { pr_err("PM: e820 map conflict detected!\n"); panic("BIOS is playing funny tricks with us.\n"); } Best regards, Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
[PATCH v2] f2fs: fix to set superblock dirty correctly
From: Chao Yu tests/generic/251 of fstest suit complains us with below message: [ cut here ] invalid opcode: [#1] PREEMPT SMP CPU: 2 PID: 7698 Comm: fstrim Tainted: G O4.7.0+ #21 task: e9f4e000 task.stack: e7262000 EIP: 0060:[] EFLAGS: 00010202 CPU: 2 EIP is at write_checkpoint+0xfde/0x1020 [f2fs] EAX: f33eb300 EBX: eecac310 ECX: 0001 EDX: 0001 ESI: eecac000 EDI: eecac5f0 EBP: e7263dec ESP: e7263d18 DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068 CR0: 80050033 CR2: b76ab01c CR3: 2eb89de0 CR4: 000406f0 Stack: 0001 a220fb7b e9f4e000 0002 419ff2d3 b3a05151 0002 e9f4e5d8 e9f4e000 419ff2d3 b3a05151 eecac310 c10b8154 b3a05151 419ff2d3 c10b78bd e9f4e000 e9f4e000 e9f4e5d8 0001 e9f4e000 ec409000 eecac2cc eecac288 Call Trace: [] ? __lock_acquire+0x3c4/0x760 [] ? mark_held_locks+0x5d/0x80 [] f2fs_trim_fs+0x1c2/0x2e0 [f2fs] [] f2fs_ioctl+0x6b6/0x10b0 [f2fs] [] ? __this_cpu_preempt_check+0xf/0x20 [] ? trace_hardirqs_off_caller+0x91/0x120 [] ? __exchange_data_block+0xd30/0xd30 [f2fs] [] do_vfs_ioctl+0x81/0x7f0 [] ? kmem_cache_free+0x245/0x2e0 [] ? get_unused_fd_flags+0x40/0x40 [] ? putname+0x4c/0x50 [] ? do_sys_open+0x16e/0x1d0 [] ? do_fast_syscall_32+0x30/0x1c0 [] ? __this_cpu_preempt_check+0xf/0x20 [] SyS_ioctl+0x58/0x80 [] do_fast_syscall_32+0xa1/0x1c0 [] sysenter_past_esp+0x45/0x74 EIP: [] write_checkpoint+0xfde/0x1020 [f2fs] SS:ESP 0068:e7263d18 ---[ end trace 4de95d7e6b3aa7c6 ]--- The reason is: with below call stack, we will encounter BUG_ON during doing fstrim. Thread AThread B - write_checkpoint - do_checkpoint - f2fs_write_inode - update_inode_page - update_inode - set_page_dirty - f2fs_set_node_page_dirty - inc_page_count - percpu_counter_inc - set_sbi_flag(SBI_IS_DIRTY) - clear_sbi_flag(SBI_IS_DIRTY) Thread CThread D - f2fs_write_node_page - set_node_addr - __set_nat_cache_dirty - nm_i->dirty_nat_cnt++ - do_vfs_ioctl - f2fs_ioctl - f2fs_trim_fs - write_checkpoint - f2fs_bug_on(nm_i->dirty_nat_cnt) Fix it by setting superblock dirty correctly in do_checkpoint and f2fs_write_node_page. Signed-off-by: Chao Yu --- fs/f2fs/checkpoint.c | 8 fs/f2fs/node.c | 1 + 2 files changed, 9 insertions(+) diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index cd0443d..1864078 100644 --- a/fs/f2fs/checkpoint.c +++ b/fs/f2fs/checkpoint.c @@ -1153,6 +1153,14 @@ static int do_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc) clear_prefree_segments(sbi, cpc); clear_sbi_flag(sbi, SBI_IS_DIRTY); + /* +* redirty superblock if metadata like node page or inode cache is +* updated during writting checkpoint. +*/ + if (get_pages(sbi, F2FS_DIRTY_NODES) || + get_pages(sbi, F2FS_DIRTY_IMETA)) + set_sbi_flag(sbi, SBI_IS_DIRTY); + return 0; } diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 8a28800..365c6ff 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -1597,6 +1597,7 @@ static int f2fs_write_node_page(struct page *page, fio.old_blkaddr = ni.blk_addr; write_node_page(nid, &fio); set_node_addr(sbi, &ni, fio.new_blkaddr, is_fsync_dnode(page)); + set_sbi_flag(sbi, SBI_IS_DIRTY); dec_page_count(sbi, F2FS_DIRTY_NODES); up_read(&sbi->node_write); -- 2.7.2
Re: cris-cryptocop: Apply another recommendation from "checkpatch.pl"
>>> There is plenty of room for at least &(*pj)->iop on the line before. >> >> This is true. - Do you prefer an other indentation approach here? > > Very much. Most of the kernel code puts as much information on a line as > possible, unless there is a reason to do otherwise. Then more of the code > will fit on the screen at one time. How do you think about to clarify such an implementation detail also in a document like "CodingStyle"? Regards, Markus
[PATCH] lib/rbtree.c: fix typo in comment of ____rb_erase_color
From: cee1 In Case 3 of `sibling == parent->rb_right': Right rotation will not change color of sl and S in the diagram (i.e. should not change "sl" to "Sl", "S" to "s") In Case 3 of `sibling == parent->rb_left': (p) (p) / \ / \ S N--> sr N / \ / Sl srS / Sl This is actually left rotation at "S", not right rotation. In Case 4 of `sibling == parent->rb_left': (p) (s) / \ / \ S N --> Sl P / \ / \ sl (sr)(sr) N This is actually right rotation at "(p)" + color flips, not left rotation + color flips. Signed-off-by: Jie Chen --- lib/rbtree.c | 23 +++ 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/lib/rbtree.c b/lib/rbtree.c index eb8a19f..1f8b112 100644 --- a/lib/rbtree.c +++ b/lib/rbtree.c @@ -296,11 +296,26 @@ rb_erase_color(struct rb_node *parent, struct rb_root *root, * * (p) (p) * / \ / \ -* N S--> N Sl +* N S--> N sl * / \ \ -*sl Srs +*sl SrS * \ *Sr +* +* Note: p might be red, and then both +* p and sl are red after rotation(which +* breaks property 4). This is fixed in +* Case 4 (in __rb_rotate_set_parents() +* which set sl the color of p +* and set p RB_BLACK) +* +* (p)(sl) +* / \/ \ +* N sl --> PS +* \/ \ +*S NSr +* \ +* Sr */ tmp1 = tmp2->rb_right; WRITE_ONCE(sibling->rb_left, tmp1); @@ -365,7 +380,7 @@ rb_erase_color(struct rb_node *parent, struct rb_root *root, } break; } - /* Case 3 - right rotate at sibling */ + /* Case 3 - left rotate at sibling */ tmp1 = tmp2->rb_left; WRITE_ONCE(sibling->rb_right, tmp1); WRITE_ONCE(tmp2->rb_left, sibling); @@ -377,7 +392,7 @@ rb_erase_color(struct rb_node *parent, struct rb_root *root, tmp1 = sibling; sibling = tmp2; } - /* Case 4 - left rotate at parent + color flips */ + /* Case 4 - right rotate at parent + color flips */ tmp2 = sibling->rb_right; WRITE_ONCE(parent->rb_left, tmp2); WRITE_ONCE(sibling->rb_right, parent); -- 2.3.2 (Apple Git-55)
RE: [PATCH][v6] PM / hibernate: Print the possible panic reason when resuming with inconsistent e820 map
> -Original Message- > From: Pavel Machek [mailto:pa...@ucw.cz] > Sent: Sunday, August 28, 2016 9:15 PM > To: Chen, Yu C > Cc: joeyli; Rafael J. Wysocki; linux...@vger.kernel.org; linux- > ker...@vger.kernel.org > Subject: Re: [PATCH][v6] PM / hibernate: Print the possible panic reason when > resuming with inconsistent e820 map > > On Sun 2016-08-28 13:08:02, Chen, Yu C wrote: > > > -Original Message- > > > From: Pavel Machek [mailto:pa...@ucw.cz] > > > Sent: Sunday, August 28, 2016 8:48 PM > > > To: Chen, Yu C > > > Cc: joeyli; Rafael J. Wysocki; linux...@vger.kernel.org; linux- > > > ker...@vger.kernel.org > > > Subject: Re: [PATCH][v6] PM / hibernate: Print the possible panic > > > reason when resuming with inconsistent e820 map > > > > > > On Sun 2016-08-28 10:07:10, Chen Yu wrote: > > > > Hi, > > > > On Fri, Aug 26, 2016 at 09:56:54PM +0200, Pavel Machek wrote: > > > > > Hi! > > > > > > > > > > > > > > What's the progress of this patch? Looks already have > > > > > > > > > experts > > > review it. > > > > > > > > > Why this patch didn't accept? > > > > > > > > This patch is a little overkilled, and I have saved > > > > > > > > another simpler version to only check the md5 hash (as > > > > > > > > people suggested) for > > > it. I can post it later. > > > > > > > > > > > > > > > > > > > > > > I am happy to test and review it. > > > > > > > > > > > > > Here it is. As Rafael is on travel, it would be grateful if > > > > > > you can give some advance on this, thanks! > > > > > > > > > > Better than last one. > > > > > > > > > > > + return -ENOMEM; > > > > > > + > > > > > > + req = ahash_request_alloc(tfm, GFP_ATOMIC); > > > > > > > > > > what context is this called from? GFP_ATOMIC allocations like to > > > > > fail... > > > > > > > > > It is in normal process context, OK, I'll change it to GFP_KERNEL. > > > > > > +static int hibernation_e820_check(void *buf) { > > > > > > + int ret; > > > > > > + char result[MD5_HASH_SIZE] = {0}; > > > > > > + > > > > > > + ret = get_e820_md5(&e820_saved, result); > > > > > > + if (ret) > > > > > > + return ret; > > > > > > + > > > > > > + if (memcmp(result, buf, MD5_HASH_SIZE)) > > > > > > + e820_conflict = true; > > > > > > > > > > Passing return value using global variable is ugly. Can you just > > > > > print the warning and kill the box here? > > > > Do you mean get rid of the panic hooker and just print the warning > > > > here? > > > > > > Yep, I'd do that... (And you probably want to rise the severity). > > Sometime the users might not be able to see the warning during > > resume(too fast) and got a system panic later, so I was thinking if it > > might help user to see the warning in panic too, how about this: > > > > if (memcmp(result, buf, MD5_DIGEST_SIZE)) { > > pr_err("PM: e820 map conflict detected!\n"); > > register_die_notifier(&hibernation_die_notifier); > > } > > So we can print warning in hibernation_die_notifier without introducing a > global variable? > > > > Actually, I'd kill the machine right away. > > if (memcmp(result, buf, MD5_DIGEST_SIZE)) { > pr_err("PM: e820 map conflict detected!\n"); > panic("BIOS is playing funny tricks with us.\n"); > } > OK, this is more reasonable, will take this one. Thanks, Yu
Re: [PATCH 2/4] barrier.h: Move smp_mb__after_unlock_lock to barrier.h
On Sun, Aug 28, 2016 at 01:56:14PM +0200, Manfred Spraul wrote: > spin_unlock() + spin_lock() together do not form a full memory barrier: > > a=1; > spin_unlock(&b); > spin_lock(&c); > + smp_mb__after_unlock_lock(); > d=1; Better would be s/d=1/r1=d/ above. Then another process doing this: d=1 smp_mb() r2=a might have the after-the-dust-settles outcome of r1==0&&r2==0. The advantage of this scenario is that it can happen on real hardware. > > Without the smp_mb__after_unlock_lock(), other CPUs can observe the > write to d without seeing the write to a. > > Signed-off-by: Manfred Spraul With the upgraded commit log, I am OK with the patch below. However, others will probably want to see at least one use of smp_mb__after_unlock_lock() outside of RCU. Thanx, Paul > --- > include/asm-generic/barrier.h | 16 > kernel/rcu/tree.h | 12 > 2 files changed, 16 insertions(+), 12 deletions(-) > > diff --git a/include/asm-generic/barrier.h b/include/asm-generic/barrier.h > index fe297b5..9b4d28f 100644 > --- a/include/asm-generic/barrier.h > +++ b/include/asm-generic/barrier.h > @@ -244,6 +244,22 @@ do { > \ > smp_acquire__after_ctrl_dep(); \ > VAL;\ > }) > + > +#ifndef smp_mb__after_unlock_lock > +/* > + * Place this after a lock-acquisition primitive to guarantee that > + * an UNLOCK+LOCK pair act as a full barrier. This guarantee applies > + * if the UNLOCK and LOCK are executed by the same CPU or if the > + * UNLOCK and LOCK operate on the same lock variable. > + */ > +#ifdef CONFIG_PPC > +#define smp_mb__after_unlock_lock() smp_mb() /* Full ordering for lock. */ > +#else /* #ifdef CONFIG_PPC */ > +#define smp_mb__after_unlock_lock() do { } while (0) > +#endif /* #else #ifdef CONFIG_PPC */ > + > +#endif > + > #endif > > #endif /* !__ASSEMBLY__ */ > diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h > index e99a523..a0cd9ab 100644 > --- a/kernel/rcu/tree.h > +++ b/kernel/rcu/tree.h > @@ -687,18 +687,6 @@ static inline void rcu_nocb_q_lengths(struct rcu_data > *rdp, long *ql, long *qll) > #endif /* #ifdef CONFIG_RCU_TRACE */ > > /* > - * Place this after a lock-acquisition primitive to guarantee that > - * an UNLOCK+LOCK pair act as a full barrier. This guarantee applies > - * if the UNLOCK and LOCK are executed by the same CPU or if the > - * UNLOCK and LOCK operate on the same lock variable. > - */ > -#ifdef CONFIG_PPC > -#define smp_mb__after_unlock_lock() smp_mb() /* Full ordering for lock. */ > -#else /* #ifdef CONFIG_PPC */ > -#define smp_mb__after_unlock_lock() do { } while (0) > -#endif /* #else #ifdef CONFIG_PPC */ > - > -/* > * Wrappers for the rcu_node::lock acquire and release. > * > * Because the rcu_nodes form a tree, the tree traversal locking will observe > -- > 2.5.5 >
[PATCH] f2fs crypto: avoid unneeded memory allocation in ->readdir
From: Chao Yu When decrypting dirents in ->readdir, fscrypt_fname_disk_to_usr won't change content of original encrypted dirent, we don't need to allocate additional buffer for storing mirror of it, so get rid of it. Signed-off-by: Chao Yu --- fs/f2fs/dir.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c index 3522f6f..fbc8ede 100644 --- a/fs/f2fs/dir.c +++ b/fs/f2fs/dir.c @@ -796,16 +796,9 @@ bool f2fs_fill_dentries(struct dir_context *ctx, struct f2fs_dentry_ptr *d, int save_len = fstr->len; int ret; - de_name.name = f2fs_kmalloc(de_name.len, GFP_NOFS); - if (!de_name.name) - return false; - - memcpy(de_name.name, d->filename[bit_pos], de_name.len); - ret = fscrypt_fname_disk_to_usr(d->inode, (u32)de->hash_code, 0, &de_name, fstr); - kfree(de_name.name); if (ret < 0) return true; -- 2.7.2
Re: [PATCH V6 5/5] perf tools: adding sink configuration for cs_etm PMU
On Thu, Aug 25, 2016 at 02:20:45PM -0600, Mathieu Poirier wrote: SNIP > return NULL; > } > + > +static FILE *cs_device__open_file(const char *name) > +{ > + struct stat st; > + char path[PATH_MAX]; > + const char *sysfs; > + > + sysfs = sysfs__mountpoint(); > + if (!sysfs) > + return NULL; > + > + snprintf(path, PATH_MAX, > + "%s" CS_BUS_DEVICE_PATH "%s", sysfs, name); > + > + printf("path: %s\n", path); should this be pr_info ? jirka
Re: [PATCH V6 1/5] perf tools: making coresight PMU listable
On Thu, Aug 25, 2016 at 02:20:41PM -0600, Mathieu Poirier wrote: SNIP > ARM/CORGI MACHINE SUPPORT > M: Richard Purdie > diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config > index 24803c58049a..72edf83d76b7 100644 > --- a/tools/perf/Makefile.config > +++ b/tools/perf/Makefile.config > @@ -746,10 +746,13 @@ ifdef LIBBABELTRACE > endif > > ifndef NO_AUXTRACE > - ifeq ($(feature-get_cpuid), 0) > -msg := $(warning Your gcc lacks the __get_cpuid() builtin, disables > support for auxtrace/Intel PT, please install a newer gcc); > -NO_AUXTRACE := 1 > - else > + ifeq ($(ARCH),x86) > +ifeq ($(feature-get_cpuid), 0) > + msg := $(warning Your gcc lacks the __get_cpuid() builtin, disables > support for auxtrace/Intel PT, please install a newer gcc); > + NO_AUXTRACE := 1 > +endif > + endif > + ifndef NO_AUXTRACE hum, how's this hunk connected to the issue described in changelog? thanks, jirka > $(call detected,CONFIG_AUXTRACE) > CFLAGS += -DHAVE_AUXTRACE_SUPPORT >endif SNIP
Re: [PATCH V6 0/5] perf: Driver specific configuration for PMU
On Thu, Aug 25, 2016 at 02:20:40PM -0600, Mathieu Poirier wrote: SNIP > perf record -e some_event/@cfg1,@cfg2=config/ ... > > The above are all valid configuration and will see the strings 'cfg1' > and 'cfg2=config' sent to the PMU driver for parsing and interpretation > using the existing ioctl() mechanism. > > The primary customers for this feature are the CoreSight drivers where > the selection of a sink (where trace data is accumulated) needs to be > done in a previous, and separated step, from the launching of the perf > command. > > As such something that used to be a two-step process: > > # echo 1 > /sys/bus/coresight/devices/2007.etr/enable_sink > # perf record -e cs_etm//u --per-thread uname > > is integrated in a single command: > > # perf record -e cs_etm/@2007.etr/u --per-thread uname > > Thanks, > Mathieu > > Changes for V6: > - Using sysFS rather than an ioctl() to communicate command line > parameters to the CoreSight PMU. apart from few nits it looks good.. but can't say for patch 2/5 ;-) Acked-by: Jiri Olsa thanks, jirka
dri: WARNING in idr_remove
Hello, The following program causes a WARNING in idr_remove: [ cut here ] WARNING: CPU: 3 PID: 26766 at lib/idr.c:505 idr_remove called for id=1 which is not allocated. CPU: 3 PID: 26766 Comm: syz-executor Not tainted 4.8.0-rc3+ #33 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 884b8280 8800634878d8 82d1b239 01fc fbfff1097050 86e8eec0 8800634879b0 8723b400 dc00 0009 8800634879a0 816ab4e3 Call Trace: [] warn_slowpath_fmt+0xac/0xd0 kernel/panic.c:532 [< inline >] idr_remove_warning lib/idr.c:505 [] idr_remove+0x617/0x830 lib/idr.c:559 [] drm_legacy_ctxbitmap_free+0x9d/0xd0 drivers/gpu/drm/drm_context.c:61 [] drm_legacy_rmctx+0x30e/0x410 drivers/gpu/drm/drm_context.c:496 [] drm_ioctl+0x7bc/0xc60 drivers/gpu/drm/drm_ioctl.c:724 [< inline >] vfs_ioctl fs/ioctl.c:43 [] do_vfs_ioctl+0x18c/0x1080 fs/ioctl.c:675 [< inline >] SYSC_ioctl fs/ioctl.c:690 [] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:681 [] do_syscall_64+0x1df/0x640 arch/x86/entry/common.c:288 [] entry_SYSCALL64_slow_path+0x25/0x25 arch/x86/entry/entry_64.S:248 // autogenerated by syzkaller (http://github.com/google/syzkaller) #include #include #include #include int main() { syscall(__NR_mmap, 0x2000ul, 0xc000ul, 0x3ul, 0x32ul, -1, 0x0ul, 0, 0, 0); int fd = open("/dev/dri/card0", 0x101102ul, 0); *(uint32_t*)0x2000b000 = (uint32_t)0x2; *(uint64_t*)0x2000b008 = (uint64_t)0x2000b000; syscall(__NR_ioctl, fd, 0xc0106426ul, 0x2000b000ul); int res = *(uint32_t*)0x2000b000; *(uint32_t*)0x2000bff8 = res; *(uint32_t*)0x2000bffc = (uint32_t)0x2; syscall(__NR_ioctl, fd, 0xc0086421ul, 0x2000bff8ul); return 0; } On commit 61c04572de404e52a655a36752e696bbcb483cf5 (Aug 25).
[PATCH 1/3] userfaultfd: selftest: introduce userfaultfd_open
Signed-off-by: Mike Rapoport --- tools/testing/selftests/vm/userfaultfd.c | 41 +++- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/tools/testing/selftests/vm/userfaultfd.c b/tools/testing/selftests/vm/userfaultfd.c index a5e5808..75540e7 100644 --- a/tools/testing/selftests/vm/userfaultfd.c +++ b/tools/testing/selftests/vm/userfaultfd.c @@ -81,7 +81,7 @@ static int huge_fd; static char *huge_fd_off0; #endif static unsigned long long *count_verify; -static int uffd, finished, *pipefd; +static int uffd, uffd_flags, finished, *pipefd; static char *area_src, *area_dst; static char *zeropage; pthread_attr_t attr; @@ -512,23 +512,9 @@ static int stress(unsigned long *userfaults) return 0; } -static int userfaultfd_stress(void) +static int userfaultfd_open(void) { - void *area; - char *tmp_area; - unsigned long nr; - struct uffdio_register uffdio_register; struct uffdio_api uffdio_api; - unsigned long cpu; - int uffd_flags, err; - unsigned long userfaults[nr_cpus]; - - allocate_area((void **)&area_src); - if (!area_src) - return 1; - allocate_area((void **)&area_dst); - if (!area_dst) - return 1; uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK); if (uffd < 0) { @@ -549,6 +535,29 @@ static int userfaultfd_stress(void) return 1; } + return 0; +} + +static int userfaultfd_stress(void) +{ + void *area; + char *tmp_area; + unsigned long nr; + struct uffdio_register uffdio_register; + unsigned long cpu; + int err; + unsigned long userfaults[nr_cpus]; + + allocate_area((void **)&area_src); + if (!area_src) + return 1; + allocate_area((void **)&area_dst); + if (!area_dst) + return 1; + + if (userfaultfd_open() < 0) + return 1; + count_verify = malloc(nr_pages * sizeof(unsigned long long)); if (!count_verify) { perror("count_verify"); -- 1.9.1
[PATCH 0/3] userfaultfd: selftest: add event tests
Hi, These patches add tests for userfaultfd events used in non-cooperative scenario. The tests verify that fork(), mremap() and madvise(MADV_DONTNEED) can be properly handled when the process that monitors userfaultfd is not the process that causes the pagefaults. Mike Rapoport (3): userfaultfd: selftest: introduce userfaultfd_open userfaultfd: selftest: add ufd parameter to copy_page userfaultfd: selftest: add test for FORK, MADVDONTNEED and REMAP events tools/testing/selftests/vm/userfaultfd.c | 219 ++- 1 file changed, 189 insertions(+), 30 deletions(-) -- 1.9.1
[PATCH 2/3] userfaultfd: selftest: add ufd parameter to copy_page
With future addition of event tests, copy_page will be called with different userfault file descriptors Signed-off-by: Mike Rapoport --- tools/testing/selftests/vm/userfaultfd.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/vm/userfaultfd.c b/tools/testing/selftests/vm/userfaultfd.c index 75540e7..c79c372 100644 --- a/tools/testing/selftests/vm/userfaultfd.c +++ b/tools/testing/selftests/vm/userfaultfd.c @@ -317,7 +317,7 @@ static void *locking_thread(void *arg) return NULL; } -static int copy_page(unsigned long offset) +static int copy_page(int ufd, unsigned long offset) { struct uffdio_copy uffdio_copy; @@ -329,7 +329,7 @@ static int copy_page(unsigned long offset) uffdio_copy.len = page_size; uffdio_copy.mode = 0; uffdio_copy.copy = 0; - if (ioctl(uffd, UFFDIO_COPY, &uffdio_copy)) { + if (ioctl(ufd, UFFDIO_COPY, &uffdio_copy)) { /* real retval in ufdio_copy.copy */ if (uffdio_copy.copy != -EEXIST) fprintf(stderr, "UFFDIO_COPY error %Ld\n", @@ -386,7 +386,7 @@ static void *uffd_poll_thread(void *arg) offset = (char *)(unsigned long)msg.arg.pagefault.address - area_dst; offset &= ~(page_size-1); - if (copy_page(offset)) + if (copy_page(uffd, offset)) userfaults++; } return (void *)userfaults; @@ -424,7 +424,7 @@ static void *uffd_read_thread(void *arg) offset = (char *)(unsigned long)msg.arg.pagefault.address - area_dst; offset &= ~(page_size-1); - if (copy_page(offset)) + if (copy_page(uffd, offset)) (*this_cpu_userfaults)++; } return (void *)NULL; @@ -438,7 +438,7 @@ static void *background_thread(void *arg) for (page_nr = cpu * nr_pages_per_cpu; page_nr < (cpu+1) * nr_pages_per_cpu; page_nr++) - copy_page(page_nr * page_size); + copy_page(uffd, page_nr * page_size); return NULL; } -- 1.9.1
[PATCH 3/3] userfaultfd: selftest: add test for FORK, MADVDONTNEED and REMAP events
Add test for userfaultfd events used in non-cooperative scenario when the process that monitors the userfaultfd and handles user faults is not the same process that causes the page faults. Signed-off-by: Mike Rapoport --- tools/testing/selftests/vm/userfaultfd.c | 174 --- 1 file changed, 162 insertions(+), 12 deletions(-) diff --git a/tools/testing/selftests/vm/userfaultfd.c b/tools/testing/selftests/vm/userfaultfd.c index c79c372..fed2119 100644 --- a/tools/testing/selftests/vm/userfaultfd.c +++ b/tools/testing/selftests/vm/userfaultfd.c @@ -63,6 +63,7 @@ #include #include #include +#include #include #include @@ -347,6 +348,7 @@ static void *uffd_poll_thread(void *arg) unsigned long cpu = (unsigned long) arg; struct pollfd pollfd[2]; struct uffd_msg msg; + struct uffdio_register uffd_reg; int ret; unsigned long offset; char tmp_chr; @@ -378,16 +380,35 @@ static void *uffd_poll_thread(void *arg) continue; perror("nonblocking read error"), exit(1); } - if (msg.event != UFFD_EVENT_PAGEFAULT) + switch (msg.event) { + default: fprintf(stderr, "unexpected msg event %u\n", msg.event), exit(1); - if (msg.arg.pagefault.flags & UFFD_PAGEFAULT_FLAG_WRITE) - fprintf(stderr, "unexpected write fault\n"), exit(1); - offset = (char *)(unsigned long)msg.arg.pagefault.address - -area_dst; - offset &= ~(page_size-1); - if (copy_page(uffd, offset)) - userfaults++; + break; + case UFFD_EVENT_PAGEFAULT: + if (msg.arg.pagefault.flags & UFFD_PAGEFAULT_FLAG_WRITE) + fprintf(stderr, "unexpected write fault\n"), exit(1); + offset = (char *)(unsigned long)msg.arg.pagefault.address - + area_dst; + offset &= ~(page_size-1); + if (copy_page(uffd, offset)) + userfaults++; + break; + case UFFD_EVENT_FORK: + uffd = msg.arg.fork.ufd; + pollfd[0].fd = uffd; + break; + case UFFD_EVENT_MADVDONTNEED: + uffd_reg.range.start = msg.arg.madv_dn.start; + uffd_reg.range.len = msg.arg.madv_dn.end - + msg.arg.madv_dn.start; + if (ioctl(uffd, UFFDIO_UNREGISTER, &uffd_reg.range)) + fprintf(stderr, "madv_dn failure\n"), exit(1); + break; + case UFFD_EVENT_REMAP: + area_dst = (char *)(unsigned long)msg.arg.remap.to; + break; + } } return (void *)userfaults; } @@ -512,7 +533,7 @@ static int stress(unsigned long *userfaults) return 0; } -static int userfaultfd_open(void) +static int userfaultfd_open(int features) { struct uffdio_api uffdio_api; @@ -525,7 +546,7 @@ static int userfaultfd_open(void) uffd_flags = fcntl(uffd, F_GETFD, NULL); uffdio_api.api = UFFD_API; - uffdio_api.features = 0; + uffdio_api.features = features; if (ioctl(uffd, UFFDIO_API, &uffdio_api)) { fprintf(stderr, "UFFDIO_API\n"); return 1; @@ -538,6 +559,131 @@ static int userfaultfd_open(void) return 0; } +/* + * For non-cooperative userfaultfd test we fork() a process that will + * generate pagefaults, will mremap the area monitored by the + * userfaultfd and at last this process will release the monitored + * area. + * For the anonymous and shared memory the area is divided into two + * parts, the first part is accessed before mremap, and the second + * part is accessed after mremap. Since hugetlbfs does not support + * mremap, the entire monitored area is accessed in a single pass for + * HUGETLB_TEST. + * The release of the pages currently generates event only for + * anonymous memory (UFFD_EVENT_MADVDONTNEED), hence it is not checked + * for hugetlb and shmem. + */ +static int faulting_process(void) +{ + unsigned long nr; + unsigned long long count; + +#ifndef HUGETLB_TEST + unsigned long split_nr_pages = (nr_pages + 1) / 2; +#else + unsigned long split_nr_pages = nr_pages; +#endif + + for (nr = 0; nr < split_nr_pages; nr++) { + count = *area_count(area_dst, nr); + if (count != count_verify[nr]) { + fprintf(stderr, + "nr %lu memory corruption %Lu %Lu\n", + nr, count, +
Re: [PATCH 2/4] barrier.h: Move smp_mb__after_unlock_lock to barrier.h
Hi Manfred, [auto build test ERROR on next-20160825] [cannot apply to tip/locking/core linus/master linux/master v4.8-rc3 v4.8-rc2 v4.8-rc1 v4.8-rc3] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] [Suggest to use git(>=2.9.0) format-patch --base= (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on] [Check https://git-scm.com/docs/git-format-patch for more information] url: https://github.com/0day-ci/linux/commits/Manfred-Spraul/spinlock-Document-memory-barrier-rules/20160828-200220 config: arm64-defconfig (attached as .config) compiler: aarch64-linux-gnu-gcc (Debian 5.4.0-6) 5.4.0 20160609 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=arm64 All errors (new ones prefixed by >>): In file included from kernel/rcu/tree.c:59:0: kernel/rcu/tree.h: In function 'raw_spin_lock_rcu_node': >> kernel/rcu/tree.h:706:2: error: implicit declaration of function >> 'smp_mb__after_unlock_lock' [-Werror=implicit-function-declaration] smp_mb__after_unlock_lock(); ^ cc1: some warnings being treated as errors vim +/smp_mb__after_unlock_lock +706 kernel/rcu/tree.h 67c583a7 Boqun Feng 2015-12-29 700 * As ->lock of struct rcu_node is a __private field, therefore one should use 67c583a7 Boqun Feng 2015-12-29 701 * these wrappers rather than directly call raw_spin_{lock,unlock}* on ->lock. 2a67e741 Peter Zijlstra 2015-10-08 702 */ 2a67e741 Peter Zijlstra 2015-10-08 703 static inline void raw_spin_lock_rcu_node(struct rcu_node *rnp) 2a67e741 Peter Zijlstra 2015-10-08 704 { 67c583a7 Boqun Feng 2015-12-29 705 raw_spin_lock(&ACCESS_PRIVATE(rnp, lock)); 2a67e741 Peter Zijlstra 2015-10-08 @706 smp_mb__after_unlock_lock(); 2a67e741 Peter Zijlstra 2015-10-08 707 } 2a67e741 Peter Zijlstra 2015-10-08 708 67c583a7 Boqun Feng 2015-12-29 709 static inline void raw_spin_unlock_rcu_node(struct rcu_node *rnp) :: The code at line 706 was first introduced by commit :: 2a67e741bbbc022e0fadf8c6dbc3a76019ecd0cf rcu: Create transitive rnp->lock acquisition functions :: TO: Peter Zijlstra :: CC: Paul E. McKenney --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: Binary data
[patch 1/2] i2c: add master driver for mellanox systems
From: Vadim Pasternak Device driver for Mellanox I2C controller logic, implemented in Lattice CPLD device. Device supports: - Master mode - One physical bus - Polling mode The Kconfig currently controlling compilation of this code is: drivers/i2c/busses/Kconfig:config I2C_MLXCPLD Signed-off-by: Michael Shych Signed-off-by: Vadim Pasternak Reviewed-by: Jiri Pirko --- Documentation/i2c/busses/i2c-mlxcpld | 47 +++ MAINTAINERS | 9 + drivers/i2c/busses/Kconfig | 12 + drivers/i2c/busses/Makefile | 1 + drivers/i2c/busses/i2c-mlxcpld.c | 625 +++ 5 files changed, 694 insertions(+) create mode 100644 Documentation/i2c/busses/i2c-mlxcpld create mode 100644 drivers/i2c/busses/i2c-mlxcpld.c diff --git a/Documentation/i2c/busses/i2c-mlxcpld b/Documentation/i2c/busses/i2c-mlxcpld new file mode 100644 index 000..0f8678a --- /dev/null +++ b/Documentation/i2c/busses/i2c-mlxcpld @@ -0,0 +1,47 @@ +Driver i2c-mlxcpld + +Author: Michael Shych + +This is a for Mellanox I2C controller logic, implemented in Lattice CPLD +device. +Device supports: + - Master mode. + - One physical bus. + - Polling mode. + +This controller is equipped within the next Mellanox systems: +"msx6710", "msx6720", "msb7700", "msn2700", "msx1410", "msn2410", "msb7800", +"msn2740", "msn2100". + +The next transaction types are supported: + - Receive Byte/Block. + - Send Byte/Block. + - Read Byte/Block. + - Write Byte/Block. + +Registers: +CTRL 0x1 - control reg. + Resets all the registers. +HALF_CYC 0x4 - cycle reg. + Configure the width of I2C SCL half clock cycle (in 4 LPC_CLK + units). +I2C_HOLD 0x5 - hold reg. + OE (output enable) is delayed by value set to this register + (in LPC_CLK units) +CMD0x6 - command reg. + Bit 7(lsb), 0 = write, 1 = read. + Bits [6:0] - the 7bit Address of the I2C device. + It should be written last as it triggers an I2C transaction. +NUM_DATA 0x7 - data size reg. + Number of address bytes to write in read transaction +NUM_ADDR 0x8 - address reg. + Number of address bytes to write in read transaction. +STATUS 0x9 - status reg. + Bit 0 - transaction is completed. + Bit 4 - ACK/NACK. +DATAx 0xa - 0x54 - 68 bytes data buffer regs. + For write transaction address is specified in four first bytes + (DATA1 - DATA4), data starting from DATA4. + For read transactions address is send in separate transaction and + specified in four first bytes (DATA0 - DATA3). Data is reading + starting from DATA0. diff --git a/MAINTAINERS b/MAINTAINERS index 0bbe4b1..8b3f8d7 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -7655,6 +7655,15 @@ W: http://www.mellanox.com Q: http://patchwork.ozlabs.org/project/netdev/list/ F: drivers/net/ethernet/mellanox/mlxsw/ +MELLANOX MLXCPLD I2C DRIVER +M: Vadim Pasternak +M: Michael Shych +L: linux-kernel@vger.kernel.org +S: Supported +W: http://www.mellanox.com +F: drivers/i2c/busses/i2c-mlxcpld.c +F: Documentation/i2c/busses/i2c-mlxcpld + SOFT-ROCE DRIVER (rxe) M: Moni Shoua L: linux-r...@vger.kernel.org diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig index 5c3993b..1126142a 100644 --- a/drivers/i2c/busses/Kconfig +++ b/drivers/i2c/busses/Kconfig @@ -1203,4 +1203,16 @@ config I2C_OPAL This driver can also be built as a module. If so, the module will be called as i2c-opal. +config I2C_MLXCPLD +tristate "Mellanox I2C driver" +depends on X86_64 +default y +help + This exposes the Mellanox platform I2C busses to the linux I2C layer + for X86 based systems. + Controller is implemented as CPLD logic. + + This driver can also be built as a module. If so, the module will be + called as i2c-mlxcpld. + endmenu diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile index 37f2819..4df3578 100644 --- a/drivers/i2c/busses/Makefile +++ b/drivers/i2c/busses/Makefile @@ -118,5 +118,6 @@ obj-$(CONFIG_I2C_PCA_ISA) += i2c-pca-isa.o obj-$(CONFIG_I2C_SIBYTE) += i2c-sibyte.o obj-$(CONFIG_I2C_XGENE_SLIMPRO) += i2c-xgene-slimpro.o obj-$(CONFIG_SCx200_ACB) += scx200_acb.o +obj-$(CONFIG_I2C_MLXCPLD) += i2c-mlxcpld.o ccflags-$(CONFIG_I2C_DEBUG_BUS) := -DDEBUG diff --git a/drivers/i2c/busses/i2c-mlxcpld.c b/drivers/i2c/busses/i2c-mlxcpld.c new file mode 100644 index 000..1ea40fa --- /dev/null +++ b/drivers/i2c/busses/i2c-mlxcpld.c @@ -0,0 +1,625 @@ +/* + * drivers/i2c/busses/i2c
Re: [PATCH] arch: all: include: asm: bitops: Use bool instead of int for all bit test functions
Hello all: I have tried m68k and aarch64, they need include linux/types.h just like another archs have done (e.g. arc). And then they can pass building for the default config. For alpha, it can pass building with my alpha cross compiler (gcc 5.0), but for safety reason, we'd better let it include linux/types.h, too. For openrisc, after check the code, I guess, it is the same reason. And excuse me, I lost my openrisc cross compiler which I originally built, so I do not give a test now, I can generate it, but really need time. Thanks. On 8/28/16 15:10, kbuild test robot wrote: > Hi Chen, > > [auto build test ERROR on linus/master] > [also build test ERROR on v4.8-rc3 next-20160825] > [if your patch is applied to the wrong git tree, please drop us a note to > help improve the system] > [Suggest to use git(>=2.9.0) format-patch --base= (or --base=auto for > convenience) to record what (public, well-known) commit your patch series was > built on] > [Check https://git-scm.com/docs/git-format-patch for more information] > > url: > https://github.com/0day-ci/linux/commits/chengang-emindsoft-com-cn/arch-all-include-asm-bitops-Use-bool-instead-of-int-for-all-bit-test-functions/20160828-134633 > config: m68k-sun3_defconfig (attached as .config) > compiler: m68k-linux-gcc (GCC) 4.9.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=m68k > > All errors (new ones prefixed by >>): > >In file included from include/linux/bitops.h:36:0, > from include/linux/jhash.h:26, > from net/ipv6/ila/ila_xlat.c:1: >>> arch/m68k/include/asm/bitops.h:151:15: error: unknown type name 'bool' > static inline bool test_bit(int nr, const unsigned long *vaddr) > ^ >arch/m68k/include/asm/bitops.h:157:15: error: unknown type name 'bool' > static inline bool bset_reg_test_and_set_bit(int nr, > ^ >arch/m68k/include/asm/bitops.h:170:15: error: unknown type name 'bool' > static inline bool bset_mem_test_and_set_bit(int nr, > ^ >arch/m68k/include/asm/bitops.h:182:15: error: unknown type name 'bool' > static inline bool bfset_mem_test_and_set_bit(int nr, > ^ >arch/m68k/include/asm/bitops.h:207:15: error: unknown type name 'bool' > static inline bool bclr_reg_test_and_clear_bit(int nr, > ^ >arch/m68k/include/asm/bitops.h:220:15: error: unknown type name 'bool' > static inline bool bclr_mem_test_and_clear_bit(int nr, > ^ >arch/m68k/include/asm/bitops.h:232:15: error: unknown type name 'bool' > static inline bool bfclr_mem_test_and_clear_bit(int nr, > ^ >arch/m68k/include/asm/bitops.h:257:15: error: unknown type name 'bool' > static inline bool bchg_reg_test_and_change_bit(int nr, > ^ >arch/m68k/include/asm/bitops.h:270:15: error: unknown type name 'bool' > static inline bool bchg_mem_test_and_change_bit(int nr, > ^ >arch/m68k/include/asm/bitops.h:282:15: error: unknown type name 'bool' > static inline bool bfchg_mem_test_and_change_bit(int nr, > ^ > > vim +/bool +151 arch/m68k/include/asm/bitops.h > >145bfchg_mem_change_bit(nr, vaddr)) >146#endif >147 >148#define __change_bit(nr, vaddr) change_bit(nr, vaddr) >149 >150 > > 151static inline bool test_bit(int nr, const unsigned long *vaddr) >152{ >153return (vaddr[nr >> 5] & (1UL << (nr & 31))) != 0; >154} > > --- > 0-DAY kernel test infrastructureOpen Source Technology Center > https://lists.01.org/pipermail/kbuild-all Intel Corporation > -- Chen Gang (陈刚) Managing Natural Environments is the Duty of Human Beings.
[patch 2/2] i2c: mux: mellanox: add driver
From: Vadim Pasternak This driver allows I2C routing controlled through CPLD select registers on wide range of Mellanox systems (CPLD Lattice device). MUX selection is provided by digital and analog HW. Analog part is not under SW control. Digital part is under CPLD control (channel selection/de-selection). Connectivity schema. i2c-mlxcpld Digital Analog driver ** * -> mux1 (virt bus2) -> mux ->| | I2CLPC | i2c physical* -> mux2 (virt bus3) -> mux ->| | bridge | bus 1 *-* | | logic |-> * mux reg * | | in CPLD| *-* | ** i2c-mux-mlxpcld ^* -> muxn (virt busn) -> mux ->| |driver | | |*---*| Devices |* CPLD (LPC bus)* select | |* registers for ** |* mux selection * deselect |*---* | | <> <---> i2c cntrl Board cntrl reg reg space space (mux select, | IO, LED, WD, info) | | *-* *-* *- LPC bus --| PCH |---| CPU | *-* *-* i2c-mux-mlxpcld does not necessary required i2c-mlxcpld. It can be use along with another bus driver, and still control i2c routing through CPLD mux selection, in case the system is equipped with CPLD capable of mux selection control. The Kconfig currently controlling compilation of this code is: drivers/i2c/muxes/Kconfig:config I2C_MUX_MLXCPLD Signed-off-by: Michael Shych Signed-off-by: Vadim Pasternak Reviewed-by: Jiri Pirko --- MAINTAINERS | 8 + drivers/i2c/muxes/Kconfig | 11 ++ drivers/i2c/muxes/Makefile | 1 + drivers/i2c/muxes/i2c-mux-mlxcpld.c | 326 include/linux/i2c/mlxcpld.h | 57 +++ 5 files changed, 403 insertions(+) create mode 100644 drivers/i2c/muxes/i2c-mux-mlxcpld.c create mode 100644 include/linux/i2c/mlxcpld.h diff --git a/MAINTAINERS b/MAINTAINERS index 8b3f8d7..a994455 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -7664,6 +7664,14 @@ W: http://www.mellanox.com F: drivers/i2c/busses/i2c-mlxcpld.c F: Documentation/i2c/busses/i2c-mlxcpld +MELLANOX MLXCPLD I2C MUX DRIVER +M: Vadim Pasternak +M: Michael Shych +L: linux-kernel@vger.kernel.org +S: Supported +W: http://www.mellanox.com +F: drivers/i2c/muxes/i2c-mux-mlxcpld.c + SOFT-ROCE DRIVER (rxe) M: Moni Shoua L: linux-r...@vger.kernel.org diff --git a/drivers/i2c/muxes/Kconfig b/drivers/i2c/muxes/Kconfig index e280c8e..b7ab144 100644 --- a/drivers/i2c/muxes/Kconfig +++ b/drivers/i2c/muxes/Kconfig @@ -81,4 +81,15 @@ config I2C_DEMUX_PINCTRL demultiplexer that uses the pinctrl subsystem. This is useful if you want to change the I2C master at run-time depending on features. +config I2C_MUX_MLXCPLD +tristate "Mellanox CPLD based I2C multiplexer" +help + If you say yes to this option, support will be included for a + CPLD based I2C multiplexer. This driver provides access to + I2C busses connected through a MUX, which is controlled + by a CPLD registers. + + This driver can also be built as a module. If so, the module + will be called i2c-mux-mlxcpld. + endmenu diff --git a/drivers/i2c/muxes/Makefile b/drivers/i2c/muxes/Makefile index 7c267c2..e5c990e 100644 --- a/drivers/i2c/muxes/Makefile +++ b/drivers/i2c/muxes/Makefile @@ -10,5 +10,6 @@ obj-$(CONFIG_I2C_MUX_PCA9541) += i2c-mux-pca9541.o obj-$(CONFIG_I2C_MUX_PCA954x) += i2c-mux-pca954x.o obj-$(CONFIG_I2C_MUX_PINCTRL) += i2c-mux-pinctrl.o obj-$(CONFIG_I2C_MUX_REG) += i2c-mux-reg.o +obj-$(CONFIG_I2C_MUX_MLXCPLD) += i2c-mux-mlxcpld.o ccflags-$(CONFIG_I2C_DEBUG_BUS) := -DDEBUG diff --git a/drivers/i2c/muxes/i2c-mux-mlxcpld.c b/drivers/i2c/muxes/i2c-mux-mlxcpld.c new file mode 100644 index 000..9624613 --- /dev/null +++ b/drivers/i2c/muxes/i2c-mux-mlxcpld.c @@ -0,0 +1,326 @@ +/* + * drivers/i2c/muxes/i2c-mux-mlxcpld.c + * Copyright (c) 2016 Mellanox Technologies. All rights reserved. + * Copyright (c) 2016 Michael Shych + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer
[PATCH v3] IB/cxgb4: Mark symbols static for _free_qp
We get 1 warning when build kernel with W=1: drivers/infiniband/hw/cxgb4/qp.c:686:6: warning: no previous prototype for '_free_qp' [-Wmissing-prototypes] In fact, this function is only used in the file in which it is declared and don't need a declaration, but can be made static. so this patch marks it 'static'. Signed-off-by: Baoyou Xie Reviewed-by: Yuval Shaia Reviewed-by: Leon Romanovsky --- drivers/infiniband/hw/cxgb4/qp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c index edb1172..6904352 100644 --- a/drivers/infiniband/hw/cxgb4/qp.c +++ b/drivers/infiniband/hw/cxgb4/qp.c @@ -683,7 +683,7 @@ static int build_inv_stag(union t4_wr *wqe, struct ib_send_wr *wr, return 0; } -void _free_qp(struct kref *kref) +static void _free_qp(struct kref *kref) { struct c4iw_qp *qhp; -- 2.7.4
[PATCH v2] arch: all: include: asm: bitops: Use bool instead of int for all bit test functions
From: Chen Gang Also use the same changing to asm-generic, and also use bool variable instead of int variable for mips, mn10300, parisc and tile related functions, and also avoid checkpatch.pl to report ERROR. Include linux/types.h for alpha, arm, arm64, m68k, and openrisc to pass building. Originally, except powerpc and xtensa, all another architectures intend to return 0 or 1. After this patch, also let powerpc and xtensa return 0 or 1. Signed-off-by: Chen Gang --- arch/alpha/include/asm/bitops.h | 17 + arch/arc/include/asm/bitops.h | 10 +- arch/arm/include/asm/bitops.h | 13 +++-- arch/arm64/include/asm/bitops.h | 7 --- arch/avr32/include/asm/bitops.h | 6 +++--- arch/blackfin/include/asm/bitops.h | 16 arch/frv/include/asm/bitops.h | 16 arch/h8300/include/asm/bitops.h | 4 ++-- arch/hexagon/include/asm/bitops.h | 14 +++--- arch/ia64/include/asm/bitops.h | 14 +++--- arch/m32r/include/asm/bitops.h | 6 +++--- arch/m68k/include/asm/bitops.h | 21 +++-- arch/metag/include/asm/bitops.h | 6 +++--- arch/mips/include/asm/bitops.h | 16 arch/mips/lib/bitops.c | 16 arch/mn10300/include/asm/bitops.h | 7 --- arch/openrisc/include/asm/bitops.h | 1 + arch/parisc/include/asm/bitops.h| 16 arch/powerpc/include/asm/bitops.h | 10 +- arch/s390/include/asm/bitops.h | 18 +- arch/sh/include/asm/bitops-cas.h| 6 +++--- arch/sh/include/asm/bitops-grb.h| 6 +++--- arch/sh/include/asm/bitops-llsc.h | 6 +++--- arch/sh/include/asm/bitops-op32.h | 8 arch/sparc/include/asm/bitops_32.h | 6 +++--- arch/sparc/include/asm/bitops_64.h | 6 +++--- arch/tile/include/asm/bitops_32.h | 6 +++--- arch/tile/include/asm/bitops_64.h | 10 +- arch/xtensa/include/asm/bitops.h| 6 +++--- include/asm-generic/bitops/atomic.h | 6 +++--- include/asm-generic/bitops/le.h | 10 +- include/asm-generic/bitops/non-atomic.h | 8 32 files changed, 162 insertions(+), 156 deletions(-) diff --git a/arch/alpha/include/asm/bitops.h b/arch/alpha/include/asm/bitops.h index 4bdfbd4..789b2bb 100644 --- a/arch/alpha/include/asm/bitops.h +++ b/arch/alpha/include/asm/bitops.h @@ -6,6 +6,7 @@ #endif #include +#include #include /* @@ -125,7 +126,7 @@ __change_bit(unsigned long nr, volatile void * addr) *m ^= 1 << (nr & 31); } -static inline int +static inline bool test_and_set_bit(unsigned long nr, volatile void *addr) { unsigned long oldbit; @@ -155,7 +156,7 @@ test_and_set_bit(unsigned long nr, volatile void *addr) return oldbit != 0; } -static inline int +static inline bool test_and_set_bit_lock(unsigned long nr, volatile void *addr) { unsigned long oldbit; @@ -185,7 +186,7 @@ test_and_set_bit_lock(unsigned long nr, volatile void *addr) /* * WARNING: non atomic version. */ -static inline int +static inline bool __test_and_set_bit(unsigned long nr, volatile void * addr) { unsigned long mask = 1 << (nr & 0x1f); @@ -196,7 +197,7 @@ __test_and_set_bit(unsigned long nr, volatile void * addr) return (old & mask) != 0; } -static inline int +static inline bool test_and_clear_bit(unsigned long nr, volatile void * addr) { unsigned long oldbit; @@ -229,7 +230,7 @@ test_and_clear_bit(unsigned long nr, volatile void * addr) /* * WARNING: non atomic version. */ -static inline int +static inline bool __test_and_clear_bit(unsigned long nr, volatile void * addr) { unsigned long mask = 1 << (nr & 0x1f); @@ -240,7 +241,7 @@ __test_and_clear_bit(unsigned long nr, volatile void * addr) return (old & mask) != 0; } -static inline int +static inline bool test_and_change_bit(unsigned long nr, volatile void * addr) { unsigned long oldbit; @@ -271,7 +272,7 @@ test_and_change_bit(unsigned long nr, volatile void * addr) /* * WARNING: non atomic version. */ -static __inline__ int +static __inline__ bool __test_and_change_bit(unsigned long nr, volatile void * addr) { unsigned long mask = 1 << (nr & 0x1f); @@ -282,7 +283,7 @@ __test_and_change_bit(unsigned long nr, volatile void * addr) return (old & mask) != 0; } -static inline int +static inline bool test_bit(int nr, const volatile void * addr) { return (1UL & (((const int *) addr)[nr >> 5] >> (nr & 31))) != 0UL; diff --git a/arch/arc/include/asm/bitops.h b/arch/arc/include/asm/bitops.h index 8da87fee..e1976ab 100644 --- a/arch/arc/include/asm/bitops.h +++ b/arch/arc/include/asm/bitops.h @@ -60,7 +60,7 @@ static inline void op##_bit(unsigned long nr, volatile unsigned long *m)\ * and the old value of bi
Re: [PATCH 3/6] rtl8188eu: declare internal function as static
Dear Andy, thanks for your review. On 28/08/2016 14:28, Andy Shevchenko wrote: > On Sat, 2016-08-27 at 14:40 +0200, Luca Ceresoli wrote: > > Put here few words _why_ you are doing this. I'm doing it because this function is only used inside rtw_recv.c. Which is quite logical, since it's a timer callback: it is passed as the _fn argument to setup_timer(). Sorry for not having explained this in my original commit. I suppose now the best thing is to wait for a few days for more comments, then resubmit with these changes. Do you think it is? > Perhaps, add output of sparse static analyzer. sparse does not detect this issue, and I don't think it could. I found it by code inspection while working on other patches of this series. -- Luca
Re: [RFC PATCH] clk: rockchip: rk3399: support pll setting automatically
Hi Xing, Elaine, Am Dienstag, 2. August 2016, 21:34:12 schrieb Xing Zheng: > From: Elaine Zhang > > The goal is that we can configure the most suitable pll params > automatically. > > If setting freq is not supported in rockchip_pll_rate_table > rk3399_pll_rates[], we can set pll params automatically. > > Signed-off-by: Elaine Zhang > Signed-off-by: Xing Zheng first off, I really like that idea of calculating the generic pll frequencies instead of duplicating these entries in every soc clock driver. Please also provide a follow up patch, removing the then unneeded frequencies from the rate tables. I still have some comments inline below: > --- > > drivers/clk/rockchip/clk-pll.c | 213 > +--- 1 file changed, 200 insertions(+), > 13 deletions(-) > > diff --git a/drivers/clk/rockchip/clk-pll.c b/drivers/clk/rockchip/clk-pll.c > index 35994e8..08979f9 100644 > --- a/drivers/clk/rockchip/clk-pll.c > +++ b/drivers/clk/rockchip/clk-pll.c > @@ -23,6 +23,7 @@ > #include > #include > #include > +#include > #include "clk.h" > > #define PLL_MODE_MASK0x3 > @@ -54,6 +55,200 @@ struct rockchip_clk_pll { > #define to_rockchip_clk_pll_nb(nb) \ > container_of(nb, struct rockchip_clk_pll, clk_nb) > > +#define MHZ (1000UL * 1000UL) > +#define KHZ (1000UL) > + > +/* CLK_PLL_TYPE_RK3066_AUTO type ops */ wouldn't that better be /* rk3066 pll frequency ranges */ > +#define PLL_FREF_MIN (269 * KHZ) > +#define PLL_FREF_MAX (2200 * MHZ) > + > +#define PLL_FVCO_MIN (440 * MHZ) > +#define PLL_FVCO_MAX (2200 * MHZ) > + > +#define PLL_FOUT_MIN (27500 * KHZ) > +#define PLL_FOUT_MAX (2200 * MHZ) > + > +#define PLL_NF_MAX (4096) > +#define PLL_NR_MAX (64) > +#define PLL_NO_MAX (16) instead of using a comment, please prefix these constants accordingly, like RK3066_PLL_FVCO_MIN etc, especially as some of those contstraints actually _are different_ between implementations. See rk3188 vs. rk3288 for example. With the current static rate table we just have matching values already, so never had to care about that. Another idea might be to have the constraints as table in the soc clock- drivers, similar to how we transfer we handle the rate tables right now. > + > +/* CLK_PLL_TYPE_RK3036/3366/3399_AUTO type ops */ > +#define MIN_FOUTVCO_FREQ (800 * MHZ) > +#define MAX_FOUTVCO_FREQ (2000 * MHZ) same here, RK3036_PLL_FOUTVCO_MIN etc. > + > +static struct rockchip_pll_rate_table auto_table; > + > +static struct rockchip_pll_rate_table *rk_pll_rate_table_get(void) > +{ > + return &auto_table; > +} > + > +static int rockchip_pll_clk_set_postdiv(unsigned long fout_hz, the rk3036, rk3366, rk3399 pll type won't be the last one Rockchip will use, so please add a prefix. Same for everything else below :-) . > + u32 *postdiv1, > + u32 *postdiv2, > + u32 *foutvco) > +{ > + unsigned long freq; > + > + if (fout_hz < MIN_FOUTVCO_FREQ) { > + for (*postdiv1 = 1; *postdiv1 <= 7; (*postdiv1)++) { > + for (*postdiv2 = 1; *postdiv2 <= 7; (*postdiv2)++) { > + freq = fout_hz * (*postdiv1) * (*postdiv2); > + if (freq >= MIN_FOUTVCO_FREQ && > + freq <= MAX_FOUTVCO_FREQ) { > + *foutvco = freq; > + return 0; > + } > + } > + pr_err("CANNOT FIND postdiv1/2 to make fout in range > from 800M to > 2000M,fout = %lu\n", + fout_hz); > + } > + } else { > + *postdiv1 = 1; > + *postdiv2 = 1; > + } > + return 0; > +} > + > +static struct rockchip_pll_rate_table * > +rockchip_pll_clk_set_by_auto(struct rockchip_clk_pll *pll, > + unsigned long fin_hz, > + unsigned long fout_hz) > +{ > + struct rockchip_pll_rate_table *rate_table = rk_pll_rate_table_get(); > + /* FIXME set postdiv1/2 always 1*/ > + u32 foutvco = fout_hz; > + u64 fin_64, frac_64; > + u32 f_frac, postdiv1, postdiv2; > + unsigned long clk_gcd = 0; > + > + if (fin_hz == 0 || fout_hz == 0 || fout_hz == fin_hz) > + return NULL; > + > + rockchip_pll_clk_set_postdiv(fout_hz, &postdiv1, &postdiv2, &foutvco); > + rate_table->postdiv1 = postdiv1; > + rate_table->postdiv2 = postdiv2; > + rate_table->dsmpd = 1; > + > + if (fin_hz / MHZ * MHZ == fin_hz && fout_hz / MHZ * MHZ == fout_hz) { > + fin_hz /= MHZ; > + foutvco /= MHZ; > + clk_gcd = gcd(fin_hz, foutvco); > + rate_table->refdiv = fin
Linux 4.8: Reported regressions as of Sunday, 2016-08-28
Hi! Here is my second regression report for Linux 4.8. It lists 11 regressions. 5 of them are new; 5 mentioned in the last report two weeks ago got fixed. FWIW: A small detail: I did not include "Regression - SATA disks behind USB ones on v4.8-rc1, breaking boot. [Re: Who reordered my disks]" (http://www.spinics.net/lists/linux-usb/msg144871.html ) in below list report. The discussion mentions that device names like /dev/sd? are not considered stable as they might change depending on various factors -- like the order in which modules are loaded or other timing issues (like in this case). That is how it is afaik (even if it's not well known), and that's why I didn't include the issue; let me know if you think it should be on the list. OTOH I included "Commit cb4f71c429 deliberately changes order of network interfaces" (http://www.spinics.net/lists/kernel/msg2325600.html ) for now, as I think traditional network interface names (eth0, eth1, ...) might be considered stable -- but I'm not sure, that's why I raise it here. Anyway, you know the drill: Are you aware of any other regressions? Then please let me know. And tell me if there is anything in the report that shouldn't be there. Ciao, Thorsten P.S.: Thanks to all those that Aaro Koskinen, Hans de Goede, Pavel Machek for CCing me when reporting regressions. Much appreciated! Ohh, and thx to all those that replied when I asked them for status updates when things look stuck. P.P.S: Sorry, I did not manage to compile a report last weekend. I visited a FLOSS conference and there got hit by a flu that slowed be down all week :-/ That's why there won't be a regression report for 4.7. I'll be travelling again next weekend, so there won't be a regression report next Sunday :-/ == Current regressions == Desc: irqdomain: Don't set type when mapping an IRQ breaks nexus7 gpio buttons Repo: 2016-07-30 https://marc.info/?l=linux-kernel&m=146985356305280&w=2 Stat: 2016-08-12 https://marc.info/?l=linux-kernel&m=147093069326172&w=2 Note: fix found two weeks ago, not in mainline afaics; waiting for tglx to get back? Desc: genirq: Flags mismatch irq 8, 0088 (mmc0) vs. 0080 (rtc0). mmc0: Failed to request irq 8: -16 Repo: 2016-08-01 https://bugzilla.kernel.org/show_bug.cgi?id=150881 Stat: 2016-08-19 https://bugzilla.kernel.org/show_bug.cgi?id=150881#c34 Note: reporter is bisecting the bug that got introduced by the main gpio merge for 4.8 Desc: Intermittent crash on reboot (acpi_ex_system_reset_event) Repo: 2016-08-04 https://bugzilla.kernel.org/show_bug.cgi?id=151441 Stat: 2016-08-15 https://bugzilla.kernel.org/show_bug.cgi?id=151441#c7 Note: poked reporter, as nothing had happened after he was asked to test a revert Desc: [lkp] [mm, page_alloc] e6cbd7f2ef: pixz.throughput -5.1% regression due to mm, page_alloc: remove fair zone allocation policy Repo: 2016-08-08 https://marc.info/?l=linux-kernel&m=147064515210332&w=3 Stat: n/a Note: poked Mel, as nothing happened after the the report Desc: [lkp] [xfs] 68a9f5e700: aim7.jobs-per-min -13.6% regression Repo: 2016-08-09 http://www.spinics.net/lists/kernel/msg2317052.html Stat: 2016-08-20 http://www.spinics.net/lists/kernel/msg2325437.html Note: hmm, long discussion about potential issues, but no simple solution in sight and discussion ended about a week ago Desc: imx-drm: Possible regression after update to atomic: black screen after Weston starts Repo: 2016-08-13 http://www.spinics.net/lists/kernel/msg2320013.html Stat: n/a Note: poked Dave, as nothing happened after the the report Desc: DT/OCTEON driver probing broken Repo: 2016-08-16 http://www.spinics.net/lists/devicetree/msg138990.html Stat: 2016-08-28 Note: proposed fix: https://patchwork.linux-mips.org/patch/14041/ Desc: gpio-leds broken on OCTEON Repo: 2016-08-23 http://www.spinics.net/lists/devicetree/msg139863.html Stat: 2016-08-25 http://www.spinics.net/lists/devicetree/msg140179.html Note: wip Desc: Commit cb4f71c429 deliberately changes order of network interfaces Repo: 2016-08-21 http://www.spinics.net/lists/kernel/msg2325600.html Stat: n/a Note: long, ongoing discussion if this is considered a regression Desc: Bluetooth: Fix bt_sock_recvmsg when MSG_TRUNC is not set Repo: 2016-08-25 http://www.spinics.net/lists/linux-bluetooth/msg68012.html Stat: 2016-08-25 http://www.spinics.net/lists/linux-bluetooth/msg68049.html Note: patch in bluetooth-stable tree Desc: Skylake graphics regression: projector failure with 4.8-rc3 Repo: 2016-08-26 http://www.spinics.net/lists/intel-gfx/msg105478.html Stat: n/a Note: brand new, more details expected == Fixed since last report == Desc: Failed to create /dev/root: -14 after commit e6978e4bf1 (ARM: save and reset the address limit when entering an exception) Repo: 2016-08-02 https://lkml.org/lkml/2016/8/2/2085 Fix: https://git.kernel.org/torvalds/c/87eed3c74d7c65556f744230a90bf9556dd29146 Desc: wlcore: NULL pointer dereference in wlcore_op_get_expected_throughput Repo: 2016
Re: [PATCH v2] i2c: move locking operations to their own struct
On Thu, Aug 25, 2016 at 11:07:01PM +0200, Peter Rosin wrote: > This makes it trivial to constify them, so do that. > > Signed-off-by: Peter Rosin Acked-by: Daniel Vetter Feel free to merge through i2c tree. -Daniel > --- > drivers/gpu/drm/drm_dp_helper.c | 10 +++--- > drivers/i2c/i2c-core.c | 13 - > drivers/i2c/i2c-mux.c | 25 - > include/linux/i2c.h | 25 ++--- > 4 files changed, 49 insertions(+), 24 deletions(-) > > Changes since v1: > > - Also fix the user in drivers/gpu (only compile-tested, but > it's simple enough...) > > This takes care of the 0-day splat reported in: > http://marc.info/?l=linux-i2c&m=147215193023544&w=2 > > Cheers, > Peter > > diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c > index eae5ef963cb7..2bd064493ae7 100644 > --- a/drivers/gpu/drm/drm_dp_helper.c > +++ b/drivers/gpu/drm/drm_dp_helper.c > @@ -790,6 +790,12 @@ static void unlock_bus(struct i2c_adapter *i2c, unsigned > int flags) > mutex_unlock(&i2c_to_aux(i2c)->hw_mutex); > } > > +static const struct i2c_lock_operations drm_dp_i2c_lock_ops = { > + .lock_bus = lock_bus, > + .trylock_bus = trylock_bus, > + .unlock_bus = unlock_bus, > +}; > + > /** > * drm_dp_aux_init() - minimally initialise an aux channel > * @aux: DisplayPort AUX channel > @@ -807,9 +813,7 @@ void drm_dp_aux_init(struct drm_dp_aux *aux) > aux->ddc.algo_data = aux; > aux->ddc.retries = 3; > > - aux->ddc.lock_bus = lock_bus; > - aux->ddc.trylock_bus = trylock_bus; > - aux->ddc.unlock_bus = unlock_bus; > + aux->ddc.lock_ops = &drm_dp_i2c_lock_ops; > } > EXPORT_SYMBOL(drm_dp_aux_init); > > diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c > index 56e50ca905ba..0bdda24a10b2 100644 > --- a/drivers/i2c/i2c-core.c > +++ b/drivers/i2c/i2c-core.c > @@ -1691,6 +1691,12 @@ static int __process_new_adapter(struct device_driver > *d, void *data) > return i2c_do_add_adapter(to_i2c_driver(d), data); > } > > +static const struct i2c_lock_operations i2c_adapter_lock_ops = { > + .lock_bus =i2c_adapter_lock_bus, > + .trylock_bus = i2c_adapter_trylock_bus, > + .unlock_bus = i2c_adapter_unlock_bus, > +}; > + > static int i2c_register_adapter(struct i2c_adapter *adap) > { > int res = -EINVAL; > @@ -1710,11 +1716,8 @@ static int i2c_register_adapter(struct i2c_adapter > *adap) > goto out_list; > } > > - if (!adap->lock_bus) { > - adap->lock_bus = i2c_adapter_lock_bus; > - adap->trylock_bus = i2c_adapter_trylock_bus; > - adap->unlock_bus = i2c_adapter_unlock_bus; > - } > + if (!adap->lock_ops) > + adap->lock_ops = &i2c_adapter_lock_ops; > > rt_mutex_init(&adap->bus_lock); > rt_mutex_init(&adap->mux_lock); > diff --git a/drivers/i2c/i2c-mux.c b/drivers/i2c/i2c-mux.c > index 764f195795e4..14741ff31041 100644 > --- a/drivers/i2c/i2c-mux.c > +++ b/drivers/i2c/i2c-mux.c > @@ -263,6 +263,18 @@ struct i2c_mux_core *i2c_mux_alloc(struct i2c_adapter > *parent, > } > EXPORT_SYMBOL_GPL(i2c_mux_alloc); > > +static const struct i2c_lock_operations i2c_mux_lock_ops = { > + .lock_bus =i2c_mux_lock_bus, > + .trylock_bus = i2c_mux_trylock_bus, > + .unlock_bus = i2c_mux_unlock_bus, > +}; > + > +static const struct i2c_lock_operations i2c_parent_lock_ops = { > + .lock_bus =i2c_parent_lock_bus, > + .trylock_bus = i2c_parent_trylock_bus, > + .unlock_bus = i2c_parent_unlock_bus, > +}; > + > int i2c_mux_add_adapter(struct i2c_mux_core *muxc, > u32 force_nr, u32 chan_id, > unsigned int class) > @@ -312,15 +324,10 @@ int i2c_mux_add_adapter(struct i2c_mux_core *muxc, > priv->adap.retries = parent->retries; > priv->adap.timeout = parent->timeout; > priv->adap.quirks = parent->quirks; > - if (muxc->mux_locked) { > - priv->adap.lock_bus = i2c_mux_lock_bus; > - priv->adap.trylock_bus = i2c_mux_trylock_bus; > - priv->adap.unlock_bus = i2c_mux_unlock_bus; > - } else { > - priv->adap.lock_bus = i2c_parent_lock_bus; > - priv->adap.trylock_bus = i2c_parent_trylock_bus; > - priv->adap.unlock_bus = i2c_parent_unlock_bus; > - } > + if (muxc->mux_locked) > + priv->adap.lock_ops = &i2c_mux_lock_ops; > + else > + priv->adap.lock_ops = &i2c_parent_lock_ops; > > /* Sanity check on class */ > if (i2c_mux_parent_classes(parent) & class) > diff --git a/include/linux/i2c.h b/include/linux/i2c.h > index c1f60a345db7..616f67635734 100644 > --- a/include/linux/i2c.h > +++ b/include/linux/i2c.h > @@ -427,6 +427,20 @@ struct i2c_algorithm { > }; > > /** > + * struct i2c_lock_operations - represent I2C locking operations > + * @lock_bus: Get exclusive access to an I2C
Re: [PATCH v06] uapi dm-log-userspace.h: use __u32, __s32, __u64 and __s64 from linux/types.h
On 08/27/16 23:43, Mikko Rapeli wrote: > Fixes userspace compilation errors like: > > linux/dm-log-userspace.h:416:2: error: unknown type name ‘uint64_t’ Reviewed-by: Bart Van Assche
[PATCH -next] staging: fsl-mc: convert to use ATTRIBUTE_GROUPS macro
From: Wei Yongjun Use ATTRIBUTE_GROUPS macro to reduce the number of lines of code. Generated by Coccinelle semantic patch. Signed-off-by: Wei Yongjun --- drivers/staging/fsl-mc/bus/mc-bus.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/staging/fsl-mc/bus/mc-bus.c b/drivers/staging/fsl-mc/bus/mc-bus.c index fe20c5d..cfe3ecb 100644 --- a/drivers/staging/fsl-mc/bus/mc-bus.c +++ b/drivers/staging/fsl-mc/bus/mc-bus.c @@ -101,14 +101,8 @@ static struct attribute *fsl_mc_dev_attrs[] = { NULL, }; -static const struct attribute_group fsl_mc_dev_group = { - .attrs = fsl_mc_dev_attrs, -}; +ATTRIBUTE_GROUPS(fsl_mc_dev); -static const struct attribute_group *fsl_mc_dev_groups[] = { - &fsl_mc_dev_group, - NULL, -}; struct bus_type fsl_mc_bus_type = { .name = "fsl-mc",
[PATCH][v8] PM / hibernate: Verify the consistent of e820 memory map by md5 value
On some platforms, there is occasional panic triggered when trying to resume from hibernation, a typical panic looks like: "BUG: unable to handle kernel paging request at 880085894000 IP: [] load_image_lzo+0x8c2/0xe70" This is because e820 map has been changed by BIOS across hibernation, and one of the page frames from first kernel is right located in second kernel's unmapped region, so panic comes out when accessing unmapped kernel address. In order to expose this issue earlier, the md5 hash of e820 map is passed from suspend kernel to resume kernel, and the system will trigger panic once it finds the md5 value of previous kernel is not the same as current resume kernel. Note: 1. Without this patch applied, it is possible that BIOS has provided an inconsistent memory map, but the resume kernel is still able to restore the image anyway(e.g., E820_RAM region is the subset of the previous one), although the system might be unstable. So this patch tries to treat any inconsistent e820 as illegal. 2. Another case is, this patch replies on comparing the e820_saved, but currently the e820_save might not be strictly the same across hibernation, even if BIOS has provided consistent e820 map - In theory mptable might modify the BIOS-provided e820_saved dynamically in early_reserve_e820_mpc_new, which would allocate a buffer from E820_RAM, and marks it from E820_RAM to E820_RESERVED). This is a potential and rare case we need to deal with in OS in the future. Suggested-by: Pavel Machek Suggested-by: Rafael J. Wysocki Cc: Lee, Chun-Yi Cc: Borislav Petkov Signed-off-by: Chen Yu --- v8: - Panic the system once the e820 is found to be inconsistent during resume. Fix the md5 hash len from 128 bytes to 16 bytes. v7: - Use md5 hash to compare the e820 map. v6: - Fix some compiling errors reported by 0day/LKP, adjust Kconfig/variable namings. v5: - Rewrite this patch to just warn user of the broken BIOS when panic. v4: - Add __attribute__ ((unused)) for swsusp_page_is_valid, to eliminate the warnning of: 'swsusp_page_is_valid' defined but not used on non-x86 platforms. v3: - Adjust the logic to exclude the end_pfn boundary in pfn_mapped when invoking mark_valid_pages, because the end_pfn is not a mapped page frame, we should not regard it as a valid page. Move the sanity check of valid pages to a early stage in resuming process(moved to mark_unsafe_pages), in this way, we can avoid unnecessarily accessing these invalid pages in later stage(yes, move to the original position Joey once introduced in: Commit 84c91b7ae07c ("PM / hibernate: avoid unsafe pages in e820 reserved regions") With v3 patch applied, I did 30 cycles on my problematic platform, no panic triggered anymore(50% reproducible before patched, by plugging/unplugging memory peripheral during hibernation), and it just warns of invalid pages. v2: - According to Ingo's suggestion, rewrite this patch. New version just checks each page frame according to pfn_mapped array. So that we do not need to touch existing code related to E820_RESERVED_KERN. And this method can naturely guarantee that the system before/after hibernation do not need to be of the same memory size on x86_64. --- arch/x86/power/hibernate_64.c | 98 +++ kernel/power/Kconfig | 9 2 files changed, 107 insertions(+) diff --git a/arch/x86/power/hibernate_64.c b/arch/x86/power/hibernate_64.c index 9634557..7eb27afd 100644 --- a/arch/x86/power/hibernate_64.c +++ b/arch/x86/power/hibernate_64.c @@ -11,6 +11,10 @@ #include #include #include +#include +#include + +#include #include #include @@ -177,15 +181,100 @@ int pfn_is_nosave(unsigned long pfn) return (pfn >= nosave_begin_pfn) && (pfn < nosave_end_pfn); } +#define MD5_DIGEST_SIZE 16 + struct restore_data_record { unsigned long jump_address; unsigned long jump_address_phys; unsigned long cr3; unsigned long magic; + u8 e820_digest[MD5_DIGEST_SIZE]; }; #define RESTORE_MAGIC 0x123456789ABCDEF0UL +#ifdef CONFIG_HIBERNATION_CHECK_E820 + +/** + * get_e820_md5 - calculate md5 according to e820 map + * + * @map: the e820 map to be calculated + * @buf: the md5 result to be stored to + */ +static int get_e820_md5(struct e820map *map, void *buf) +{ + struct scatterlist sg; + struct crypto_ahash *tfm; + struct ahash_request *req; + int ret = 0; + + tfm = crypto_alloc_ahash("md5", 0, CRYPTO_ALG_ASYNC); + if (IS_ERR(tfm)) + return -ENOMEM; + + req = ahash_request_alloc(tfm, GFP_KERNEL); + if (!req) { + ret = -ENOMEM; + goto free_ahash; + } + + sg_init_one(&sg, (u8 *)map, sizeof(struct e820map)); + ahash_request_set_callback(req, 0, NULL, NULL); + ahash_request_set_crypt(req, &sg, buf, si