Re: [PATCH printk v2 2/5] printk: remove safe buffers

2021-04-01 Thread Sergey Senozhatsky
On (21/04/01 16:17), Petr Mladek wrote: > > For the long term, we should introduce a printk-context API that allows > > callers to perfectly pack their multi-line output into a single > > entry. We discussed [0][1] this back in August 2020. > > We need a "short" term solution. There are currently

Re: [PATCH printk v2 1/5] printk: track/limit recursion

2021-04-01 Thread Sergey Senozhatsky
eparation for removal of the safe buffers, provide an alternate > > explicit recursion protection. Recursion is limited to 3 levels > > per-CPU and per-context. > > > > Signed-off-by: John Ogness > > Reviewed-by: Petr Mladek Reviewed-by: Sergey Senozhatsky

Re: [PATCHv3 3/6] media: v4l UAPI: add ROI auto-controls flags

2021-03-24 Thread Sergey Senozhatsky
On (21/03/24 08:28), Ricardo Ribalda wrote: [..] > > > > > > Are you sure that you do not want to start with 1<<3, there might be > > > some hardware that support LE/SE > > > > How the hardware's going to support this? There is simply no way to > > pass these flags to the firmware, the values

Re: [PATCHv3 5/6] media: uvcvideo: add UVC 1.5 ROI control

2021-03-23 Thread Sergey Senozhatsky
On (21/03/24 12:05), Sergey Senozhatsky wrote: > > > For ROI user-space also must provide valid auto-controls value, which > > > normally requires GET_MIN/GET_MAX discovery. > > > > > > v4l2 selection API mentions only rectangle adjustments and er

Re: [PATCHv3 5/6] media: uvcvideo: add UVC 1.5 ROI control

2021-03-23 Thread Sergey Senozhatsky
On (21/03/24 12:00), Tomasz Figa wrote: [..] > > I guess in our case we need to talk about rectangle,auto-controls tuple > > that we send to firmware > > > > rect { > > (0, 0), (INT_MAX, INT_MAX) > > } > > auto-controls { > > INT_MAX > >

Re: [PATCHv3 5/6] media: uvcvideo: add UVC 1.5 ROI control

2021-03-23 Thread Sergey Senozhatsky
On (21/03/24 11:34), Tomasz Figa wrote: > On Wed, Mar 24, 2021 at 11:31 AM Sergey Senozhatsky > wrote: [..] > > > Adjusting the rectangle to something supported by the hardware is > > > mentioned explicitly in the V4L2 API documentation and is what drivers > >

Re: [PATCHv3 5/6] media: uvcvideo: add UVC 1.5 ROI control

2021-03-23 Thread Sergey Senozhatsky
On (21/03/24 11:14), Tomasz Figa wrote: > > > > +static int uvc_ioctl_s_roi(struct file *file, void *fh, > > > > + struct v4l2_selection *sel) > > > > +{ > > > > + struct uvc_fh *handle = fh; > > > > + struct uvc_streaming *stream = handle->stream; > > > > +

Re: [PATCHv3 3/6] media: v4l UAPI: add ROI auto-controls flags

2021-03-23 Thread Sergey Senozhatsky
On (21/03/23 17:04), Ricardo Ribalda wrote: > On Fri, Mar 19, 2021 at 6:53 AM Sergey Senozhatsky > wrote: > > > > UVC 1.5 defines the following Region Of Interest auto controls: > > > > D0: Auto Exposure > > D1: Auto Iris > > D2: Auto White Balance &

Re: [PATCHv3 5/6] media: uvcvideo: add UVC 1.5 ROI control

2021-03-23 Thread Sergey Senozhatsky
On (21/03/23 17:16), Ricardo Ribalda wrote: [..] > > +static bool validate_roi_bounds(struct uvc_streaming *stream, > > + struct v4l2_selection *sel) > > +{ > > + if (sel->r.left > USHRT_MAX || > > + sel->r.top > USHRT_MAX || > > +

Re: [PATCH 3/5] cifsd: add file operations

2021-03-22 Thread Sergey Senozhatsky
On (21/03/22 17:09), Matthew Wilcox wrote: > On Mon, Mar 22, 2021 at 06:03:21PM +0900, Sergey Senozhatsky wrote: > > On (21/03/22 08:15), Matthew Wilcox wrote: > > > > > > What's the scenario for which your allocator performs better than slub > > > > &g

Re: [PATCH next v1 1/3] printk: track/limit recursion

2021-03-22 Thread Sergey Senozhatsky
On (21/03/22 11:53), John Ogness wrote: > On 2021-03-21, Sergey Senozhatsky wrote: > >> @@ -2055,6 +2122,9 @@ int vprintk_store(int facility, int level, > >> */ > >>ts_nsec = local_clock(); > >> > >> + if (!printk_enter_irqsave())

Re: [PATCH 2/5] cifsd: add server-side procedures for SMB3

2021-03-22 Thread Sergey Senozhatsky
On (21/03/22 08:34), Matthew Wilcox wrote: > > +++ b/fs/cifsd/mgmt/ksmbd_ida.c > > @@ -0,0 +1,69 @@ > > +// SPDX-License-Identifier: GPL-2.0-or-later > > +/* > > + * Copyright (C) 2018 Samsung Electronics Co., Ltd. > > + */ > > + > > +#include "ksmbd_ida.h" > > + > > +struct ksmbd_ida

Re: [PATCH 3/5] cifsd: add file operations

2021-03-22 Thread Sergey Senozhatsky
On (21/03/22 10:04), Dan Carpenter wrote: > > On Mon, Mar 22, 2021 at 02:13:42PM +0900, Namjae Jeon wrote: > > +void *ksmbd_alloc(size_t size) > > +{ > > + return kvmalloc(size, GFP_KERNEL | __GFP_ZERO); > > > This patch adds a bunch of wrappers around kvmalloc(). Don't do that. Agreed.

Re: [PATCH 3/5] cifsd: add file operations

2021-03-22 Thread Sergey Senozhatsky
On (21/03/22 07:02), Al Viro wrote: > On Mon, Mar 22, 2021 at 02:13:42PM +0900, Namjae Jeon wrote: > > +static struct ksmbd_file *__ksmbd_lookup_fd(struct ksmbd_file_table *ft, > > + unsigned int id) > > +{ > > + bool unclaimed = true; > > + struct

Re: [PATCH 3/5] cifsd: add file operations

2021-03-22 Thread Sergey Senozhatsky
On (21/03/22 08:15), Matthew Wilcox wrote: > > What's the scenario for which your allocator performs better than slub > IIRC request and reply buffers can be up to 4M in size. So this stuff just allocates a number of fat buffers and keeps them around so that it doesn't have to vmalloc(4M) for

Re: [PATCH next v1 1/3] printk: track/limit recursion

2021-03-20 Thread Sergey Senozhatsky
On (21/03/17 00:33), John Ogness wrote: [..] > static inline void printk_delay(void) > @@ -2040,11 +2105,13 @@ int vprintk_store(int facility, int level, > struct prb_reserved_entry e; > enum log_flags lflags = 0; > struct printk_record r; > + unsigned long irqflags; >

Re: [PATCH next v1 2/3] printk: remove safe buffers

2021-03-20 Thread Sergey Senozhatsky
On (21/03/17 00:33), John Ogness wrote: [..] > void printk_nmi_direct_enter(void) > { > @@ -324,27 +44,8 @@ void printk_nmi_direct_exit(void) > this_cpu_and(printk_context, ~PRINTK_NMI_DIRECT_CONTEXT_MASK); > } > > -#else > - > -static __printf(1, 0) int vprintk_nmi(const char *fmt,

Re: [PATCH v6 resend 0/3] mm, vsprintf: dump full information of page flags in pGp

2021-03-19 Thread Sergey Senozhatsky
as follows, > [68599.816764] test_printf: loaded. > [68599.819068] test_printf: all 388 tests passed > [68599.830367] test_printf: unloaded. > > This patchset also includes some code cleanup in mm/slub.c. The series looks good to me. FWIW, Reviewed-by: Sergey Senozhatsky

Re: [PATCH] MAINTAINERS: update Senozhatsky email address

2021-03-19 Thread Sergey Senozhatsky
On (21/03/19 11:43), Petr Mladek wrote: > > The patch is comitted in printk/linux.git, branch for-5.13. Thanks. > Now I have to remember using the new address, for example, when > calling git send-email from bash history ;-) :)

Re: [PATCHv3 6/6] MAINTAINERS: update Senozhatsky email address

2021-03-18 Thread Sergey Senozhatsky
On (21/03/19 14:53), Sergey Senozhatsky wrote: > > I don't check my @gmail.com addresses often enough these days. > Please ignore this one. It's a different story and does not belong to this series. -ss

[PATCHv3 6/6] MAINTAINERS: update Senozhatsky email address

2021-03-18 Thread Sergey Senozhatsky
I don't check my @gmail.com addresses often enough these days. Signed-off-by: Sergey Senozhatsky --- MAINTAINERS | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index b2baeb5e4a68..01b000cd5774 100644 --- a/MAINTAINERS +++ b/MAINTAINERS

[PATCHv3 5/6] media: uvcvideo: add UVC 1.5 ROI control

2021-03-18 Thread Sergey Senozhatsky
p = 0; roi.r.width= 42; roi.r.height = 42; roi.flags = V4L2_SEL_FLAG_ROI_AUTO_EXPOSURE; ioctl(fd, VIDIOC_S_SELECTION, ); Signed-off-by: Sergey Senozhatsky --- drivers/media/usb/uvc/uvc_v4l2.c | 147 ++- include/uapi/linux/usb/video.h | 1

[PATCHv3 2/6] media: v4l UAPI: document ROI selection targets

2021-03-18 Thread Sergey Senozhatsky
Document V4L2 selection targets that will be used to ROI implementation. Signed-off-by: Sergey Senozhatsky --- .../media/v4l/selection-api-configuration.rst | 22 +++ .../media/v4l/selection-api-examples.rst | 28 +++ .../media/v4l/v4l2-selection-targets.rst

[PATCHv3 4/6] media: v4l UAPI: document ROI auto-controls flags

2021-03-18 Thread Sergey Senozhatsky
Document ROI auto controls. Signed-off-by: Sergey Senozhatsky --- .../media/v4l/v4l2-selection-flags.rst| 40 +++ 1 file changed, 40 insertions(+) diff --git a/Documentation/userspace-api/media/v4l/v4l2-selection-flags.rst b/Documentation/userspace-api/media/v4l/v4l2

[PATCHv3 3/6] media: v4l UAPI: add ROI auto-controls flags

2021-03-18 Thread Sergey Senozhatsky
UVC 1.5 defines the following Region Of Interest auto controls: D0: Auto Exposure D1: Auto Iris D2: Auto White Balance D3: Auto Focus D4: Auto Face Detect D5: Auto Detect and Track D6: Image Stabilization D7: Higher Quality D8 – D15: Reserved, set to zero Signed-off-by: Sergey Senozhatsky

[PATCHv3 0/6] media: uvcvideo: implement UVC 1.5 ROI

2021-03-18 Thread Sergey Senozhatsky
Hello, This patch set implements UVC 1.5 ROI using v4l2_selection API. V3: - reimplemented ROI. We dont' use split controls anymore. - Ricardo's feedback Sergey Senozhatsky (6): media: v4l UAPI: add ROI selection targets media: v4l UAPI: document ROI selection targets media: v4l

[PATCHv3 1/6] media: v4l UAPI: add ROI selection targets

2021-03-18 Thread Sergey Senozhatsky
UVC 1.5 requires Region Of Interest control to implement GET_CUR, GET_DEF, GET_MIN and GET_MAX requests. This patch adds new V4L2 selection API targets that will implement those ROI requests. Signed-off-by: Sergey Senozhatsky --- include/uapi/linux/v4l2-common.h | 8 1 file changed, 8

[PATCH] MAINTAINERS: update Senozhatsky email address

2021-03-18 Thread Sergey Senozhatsky
I don't check my @gmail.com addresses often enough these days. Signed-off-by: Sergey Senozhatsky --- MAINTAINERS | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index b2baeb5e4a68..01b000cd5774 100644 --- a/MAINTAINERS +++ b/MAINTAINERS

Re: [PATCHv2 3/3] media: uvcvideo: add UVC 1.5 ROI control

2021-03-18 Thread Sergey Senozhatsky
On (21/03/18 22:19), Ricardo Ribalda wrote: > > > > May I please ask for more opinions on this? > > Could you try setting the roi in a loop in your device and verify that > it accepts all the values with no modification. If so we can implement > the set/get as a quirk for other devices. Tested

Re: [PATCH] cifsd: fix a precedence bug in parse_dacl()

2021-03-18 Thread Sergey Senozhatsky
On (21/03/18 16:10), Dan Carpenter wrote: > > The shift has higher precedence than mask so this doesn't work as > intended. > > Fixes: ef24dca82789 ("cifsd: add support for ACLs") > Signed-off-by: Dan Carpenter Thanks. Reviewed-by: Sergey Senozhatsky -ss

Re: [PATCH RESEND] cifsd: fix a IS_ERR() vs NULL bug

2021-03-18 Thread Sergey Senozhatsky
arpenter Thanks. Reviewed-by: Sergey Senozhatsky -ss

Re: [PATCH] cifsd: Fix a use after free on error path

2021-03-18 Thread Sergey Senozhatsky
On (21/03/18 16:12), Dan Carpenter wrote: > The ksmbd_free_work_struct() frees "work" so we need to swap the order > of these two function calls to avoid a use after free. > > Fixes: cabcebc31de4 ("cifsd: introduce SMB3 kernel server") > Signed-off-by: Dan Carpe

Re: [PATCHv2 3/3] media: uvcvideo: add UVC 1.5 ROI control

2021-03-17 Thread Sergey Senozhatsky
On (21/03/17 08:58), Ricardo Ribalda Delgado wrote: [..] > > > > GET_CUR? > yep > > > > > > https://www.kernel.org/doc/html/v4.13/media/uapi/v4l/vidioc-g-selection.html?highlight=vidioc_s_selection > > > On success the struct v4l2_rect r field contains the adjusted > > > rectangle. > > > > What

Re: [PATCHv2 2/3] media: uvcvideo: add ROI auto controls

2021-03-17 Thread Sergey Senozhatsky
On (21/03/17 18:18), Sergey Senozhatsky wrote: > On (21/02/08 14:17), Sergey Senozhatsky wrote: > > This patch adds support for Region of Interest bmAutoControls. > > > > ROI control is a compound data type: > > Control Selector CT_REGION_OF_INTEREST_CONTR

Re: [PATCHv2 2/3] media: uvcvideo: add ROI auto controls

2021-03-17 Thread Sergey Senozhatsky
On (21/02/08 14:17), Sergey Senozhatsky wrote: > This patch adds support for Region of Interest bmAutoControls. > > ROI control is a compound data type: > Control Selector CT_REGION_OF_INTEREST_CONTROL > Mandatory Requests SET_CUR, GET_CUR, GET_MIN, GET_MAX, GET_DEF

Re: [PATCHv2 2/3] media: uvcvideo: add ROI auto controls

2021-03-17 Thread Sergey Senozhatsky
Fixed Tomasz's email On (21/03/17 09:08), Ricardo Ribalda Delgado wrote: [..] > > > > + .id = V4L2_CID_REGION_OF_INTEREST_AUTO, > > > > + .name = "Region of Interest (auto)", > > > > + .entity = UVC_GUID_UVC_CAMERA, > > > > +

Re: [PATCHv2 1/3] media: v4l UAPI docs: document ROI selection targets

2021-03-17 Thread Sergey Senozhatsky
On (21/03/17 09:04), Ricardo Ribalda Delgado wrote: > On Wed, Mar 17, 2021 at 2:31 AM Sergey Senozhatsky > wrote: > > > > On (21/03/16 19:19), Ricardo Ribalda Delgado wrote: > > > > +Configurat

Re: linux-next: build failure after merge of the cifsd tree

2021-03-17 Thread Sergey Senozhatsky
On (21/03/17 18:53), Stephen Rothwell wrote: > Hi all, > > After merging the cifsd tree, today's linux-next build (powerpc > allyesconfig) failed like this: > > ld: fs/cifsd/misc.o:(.opd+0xc0): multiple definition of `extract_sharename'; > fs/cifs/unc.o:(.opd+0x18): first defined here > ld:

Re: [PATCHv2 3/3] media: uvcvideo: add UVC 1.5 ROI control

2021-03-16 Thread Sergey Senozhatsky
On (21/03/16 19:46), Ricardo Ribalda Delgado wrote: > > -static int uvc_ioctl_g_selection(struct file *file, void *fh, > > -struct v4l2_selection *sel) > > +/* UVC 1.5 ROI rectangle is half the size of v4l2_rect */ > > +struct uvc_roi_rect { > > + __u16

Re: [PATCHv2 2/3] media: uvcvideo: add ROI auto controls

2021-03-16 Thread Sergey Senozhatsky
On (21/03/16 19:29), Ricardo Ribalda Delgado wrote: > > ROI control is a compound data type: > > Control Selector CT_REGION_OF_INTEREST_CONTROL > > Mandatory Requests SET_CUR, GET_CUR, GET_MIN, GET_MAX, GET_DEF > > wLength 10 > > Offset FieldSize > > 0wROI_Top

Re: [PATCHv2 1/3] media: v4l UAPI docs: document ROI selection targets

2021-03-16 Thread Sergey Senozhatsky
On (21/03/16 19:19), Ricardo Ribalda Delgado wrote: > > +Configuration of Region of Interest (ROI) > > += > > + > > +The range of coordinates of the top left corner, width and height of > > +areas that can be ROI is given by the ``V4L2_SEL_TGT_ROI_BOUNDS``

Re: [PATCHv2 0/3] Add UVC 1.5 Region Of Interest control to uvcvideo

2021-03-15 Thread Sergey Senozhatsky
On (21/02/08 14:17), Sergey Senozhatsky wrote: > Hello, > > RFC Hi Laurent, Gentle ping. -ss

Re: [PATCH] media: videobuf2: Fix integer overrun in allocation

2021-03-09 Thread Sergey Senozhatsky
deobuf2: fix the length check for > mmap") > Signed-off-by: Ricardo Ribalda Reviewed-by: Sergey Senozhatsky

Re: [PATCH] media: videobuf2: Fix integer overrun in vb2_mmap

2021-03-09 Thread Sergey Senozhatsky
On (21/03/10 08:40), Ricardo Ribalda wrote: > > The plane_length is an unsigned integer. So, if we have a size of > 0x bytes we incorrectly allocate 0 bytes instead of 1 << 32. > > Suggested-by: Sergey Senozhatsky > Cc: sta...@vger.kernel.org > Fixes: 7

Re: [PATCH] media: videobuf2: Fix integer overrun in allocation

2021-03-09 Thread Sergey Senozhatsky
On (21/03/10 00:43), Ricardo Ribalda wrote: > The plane_length is an unsigned integer. So, if we have a size of > 0x bytes we incorrectly allocate 0 bytes instead of 1 << 32. Hi Ricardo, > @@ -223,8 +223,10 @@ static int __vb2_buf_mem_alloc(struct vb2_buffer *vb) >* NOTE: mmapped

[PATCH] v4l-compliance: re-introduce NON_COHERENT and cache hints tests

2021-03-01 Thread Sergey Senozhatsky
This returns back non-coherent (previously known as NON_COHERENT) memory flag and buffer cache management hints testing (for VB2_MEMORY_MMAP buffers). Signed-off-by: Sergey Senozhatsky --- utils/common/cv4l-helpers.h | 8 +-- utils/common/v4l-helpers.h | 8

Re: [PATCH] v4l-compliance: re-introduce NON_COHERENT and cache hints tests

2021-03-01 Thread Sergey Senozhatsky
On (21/03/02 09:49), Sergey Senozhatsky wrote: > This returns back non-coherent (previously known as NON_COHERENT) ^^^ NON_CONSISTENT... > memory flag and buffer cache management

[PATCH 8/8] videobuf2: handle non-contiguous DMA allocations

2021-03-01 Thread Sergey Senozhatsky
This adds support for new noncontiguous DMA API, which requires allocators to have two execution branches: one for the current API, and one for the new one. Signed-off-by: Sergey Senozhatsky [hch: untested conversion to the ne API] Signed-off-by: Christoph Hellwig --- .../common/videobuf2

[PATCH 7/8] videobuf2: handle V4L2_FLAG_MEMORY_NON_COHERENT flag

2021-03-01 Thread Sergey Senozhatsky
lags. Unlike v4l2_create_buffers, struct v4l2_requestbuffers does not have enough reserved room. Therefore for backward compatibility ->reserved and ->flags were put into anonymous union. Signed-off-by: Sergey Senozhatsky --- .../media/v4l/vidioc-create-bufs.rst | 7 ++- ..

[PATCH 6/8] videobuf2: add queue memory coherency parameter

2021-03-01 Thread Sergey Senozhatsky
del will fail. Signed-off-by: Sergey Senozhatsky --- .../media/common/videobuf2/videobuf2-core.c | 40 --- .../media/common/videobuf2/videobuf2-v4l2.c | 5 ++- drivers/media/dvb-core/dvb_vb2.c | 2 +- include/media/videobuf2-core.h| 8 +++- 4 fi

[PATCH 4/8] videobuf2: move cache_hints handling to allocators

2021-03-01 Thread Sergey Senozhatsky
cache sync logic to one common place. Signed-off-by: Sergey Senozhatsky --- drivers/media/common/videobuf2/videobuf2-core.c | 6 -- drivers/media/common/videobuf2/videobuf2-dma-contig.c | 6 ++ drivers/media/common/videobuf2/videobuf2-dma-sg.c | 6 ++ 3 files changed, 12

[PATCH 5/8] videobuf2: add V4L2_FLAG_MEMORY_NON_COHERENT flag

2021-03-01 Thread Sergey Senozhatsky
V4L2_BUF_CAP_SUPPORTS_MMAP_CACHE_HINTS when queue supports user-space cache management hints. Signed-off-by: Sergey Senozhatsky --- .../userspace-api/media/v4l/buffer.rst| 40 ++- .../media/v4l/vidioc-reqbufs.rst | 5 ++- include/uapi/linux/videodev2.h| 2

[PATCH 3/8] videobuf2: split buffer cache_hints initialisation

2021-03-01 Thread Sergey Senozhatsky
V4L2 is not the perfect place to manage vb2 buffer cache hints. It works for V4L2 users, but there are backends that use vb2 core and don't use V4L2. Factor buffer cache hints init and call it when we allocate vb2 buffer. Signed-off-by: Sergey Senozhatsky --- .../media/common/videobuf2

[PATCH 2/8] videobuf2: inverse buffer cache_hints flags

2021-03-01 Thread Sergey Senozhatsky
It would be less error prone if the default cache hints value (we kzalloc() structs, so it's zeroed out by default) would be to "always sync/flush" caches. Inverse and rename cache hints flags. Signed-off-by: Sergey Senozhatsky --- .../media/common/videobuf2/videobuf2-cor

[PATCH 1/8] videobuf2: rework vb2_mem_ops API

2021-03-01 Thread Sergey Senozhatsky
from videobuf2 core to the allocators. Fix this by changing call_ptr_memop() macro to pass vb2 pointer to corresponding op callbacks. Signed-off-by: Sergey Senozhatsky --- .../media/common/videobuf2/videobuf2-core.c | 42 +++ .../common/videobuf2/videobuf2-dma-contig.c | 36

[PATCH 0/8] videobuf2: support new noncontiguous DMA API

2021-03-01 Thread Sergey Senozhatsky
refactroings along the way. A corresponding v4l2-compliance patch will be posted shortly. [0] https://lore.kernel.org/lkml/20210301085236.947011-2-...@lst.de/ Sergey Senozhatsky (8): videobuf2: rework vb2_mem_ops API videobuf2: inverse buffer cache_hints flags videobuf2: split buffer cache_hints

Re: [PATCH 6/7] dma-iommu: implement ->alloc_noncontiguous

2021-03-01 Thread Sergey Senozhatsky
On (21/03/01 08:21), Christoph Hellwig wrote: > On Mon, Mar 01, 2021 at 04:17:42PM +0900, Sergey Senozhatsky wrote: > > > > Do you think we could add the attrs parameter to the > > > > dma_alloc_noncontiguous() API? > > > > > > Yes, we could probably

Re: [PATCH 6/7] dma-iommu: implement ->alloc_noncontiguous

2021-02-28 Thread Sergey Senozhatsky
On (21/02/16 09:49), Christoph Hellwig wrote: > > When working on the videobuf2 integration with Sergey I noticed that > > we always pass 0 as DMA attrs here, which removes the ability for > > drivers to use DMA_ATTR_ALLOC_SINGLE_PAGES. > > > > It's quite important from a system stability point

Re: [PATCH] lib: vsprintf: check for NULL device_node name in device_node_string()

2021-02-17 Thread Sergey Senozhatsky
On (21/02/17 13:15), Enrico Weigelt, metux IT consult wrote: > Under rare circumstances it may happen that a device node's name is NULL > (most likely kernel bug in some other place). In such situations anything > but helpful, if the debug printout crashes, and nobody knows what actually >

Re: [PATCH v2] printk: avoid prb_first_valid_seq() where possible

2021-02-12 Thread Sergey Senozhatsky
On (21/02/12 10:47), Petr Mladek wrote: > > Fixes: 896fbe20b4e2333fb55 ("printk: use the lockless ringbuffer") > > Reported-by: kernel test robot > > Reported-by: J. Avila > > Signed-off-by: John Ogness > > Reviewed-by: Petr Mladek > > I am going to push the patch later today. I would prefer

Re: [PATCH v3] printk: fix deadlock when kernel panic

2021-02-09 Thread Sergey Senozhatsky
fer. > > Fixes: cf9b1106c81c ("printk/nmi: flush NMI messages on the system panic") > Signed-off-by: Muchun Song > Reviewed-by: Petr Mladek > Cc: Acked-by: Sergey Senozhatsky -ss

Re: [PATCH v2] printk: fix deadlock when kernel panic

2021-02-09 Thread Sergey Senozhatsky
On (21/02/09 10:19), Petr Mladek wrote: > On Sat 2021-02-06 13:41:24, Muchun Song wrote: [..] > What about the following commit message? It uses imperative language > and explains that the patch just prevents the deadlock. It removes > some details. The diagram is better than many words. > > >

Re: [External] Re: [PATCH v2] printk: fix deadlock when kernel panic

2021-02-09 Thread Sergey Senozhatsky
On (21/02/09 09:39), Petr Mladek wrote: > > > So then this never re-inits the safe_read_lock? > > Yes, but it will also not cause the deadlock. Right. > I prefer this approach. It is straightforward because it handles > read_lock the same way as logbuf_lock. I'm fine with that approach, but

Re: [PATCH v2 2/2] thermal: Move therm_throt there from x86/mce

2021-02-08 Thread Sergey Senozhatsky
Hi, Seems that the patch triggers some WARNs on my laptop. For every CPU: [0.003751] WARNING: CPU: 4 PID: 0 at arch/x86/kernel/irq.c:390 thermal_set_handler+0x12/0x25 [0.003751] Modules linked in: [0.003751] CPU: 4 PID: 0 Comm: swapper/4 Tainted: GW

Re: [PATCH] printk: avoid prb_first_valid_seq() where possible

2021-02-08 Thread Sergey Senozhatsky
uffer") > Reported-by: kernel test robot > Reported-by: J. Avila > Signed-off-by: John Ogness Acked-by: Sergey Senozhatsky > diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c > index 5a95c688621f..035aae771ea1 100644 > --- a/kernel/printk/printk.c > +++ b

Re: [External] Re: [PATCH v2] printk: fix deadlock when kernel panic

2021-02-08 Thread Sergey Senozhatsky
On (21/02/08 16:49), Muchun Song wrote: > On Mon, Feb 8, 2021 at 2:38 PM Sergey Senozhatsky > wrote: > > > > On (21/02/06 13:41), Muchun Song wrote: > > > We found a deadlock bug on our server when the kernel panic. It can be > > > described in the

Re: [PATCH] printk: avoid prb_first_valid_seq() where possible

2021-02-07 Thread Sergey Senozhatsky
On (21/02/05 15:23), John Ogness wrote: > If message sizes average larger than expected (more than 32 > characters), the data_ring will wrap before the desc_ring. Once the > data_ring wraps, it will start invalidating descriptors. These > invalid descriptors hang around until they are eventually

Re: [PATCH v2] printk: fix deadlock when kernel panic

2021-02-07 Thread Sergey Senozhatsky
On (21/02/06 13:41), Muchun Song wrote: > We found a deadlock bug on our server when the kernel panic. It can be > described in the following diagram. > > CPU0: CPU1: > panic rcu_dump_cpu_stacks >

[PATCHv2 2/3] media: uvcvideo: add ROI auto controls

2021-02-07 Thread Sergey Senozhatsky
From: Sergey Senozhatsky This patch adds support for Region of Interest bmAutoControls. ROI control is a compound data type: Control Selector CT_REGION_OF_INTEREST_CONTROL Mandatory Requests SET_CUR, GET_CUR, GET_MIN, GET_MAX, GET_DEF wLength 10 Offset FieldSize 0

[PATCHv2 1/3] media: v4l UAPI docs: document ROI selection targets

2021-02-07 Thread Sergey Senozhatsky
From: Sergey Senozhatsky Document new v4l2-selection target which will be used for the Region of Interest v4l2 control. Signed-off-by: Sergey Senozhatsky --- .../media/v4l/selection-api-configuration.rst | 23 +++ .../media/v4l/v4l2-selection-targets.rst | 21

[PATCHv2 0/3] Add UVC 1.5 Region Of Interest control to uvcvideo

2021-02-07 Thread Sergey Senozhatsky
Hello, RFC This patch set adds UVC 1.5 Region of Interest support. v1->v2: - Address Laurent's comments Sergey Senozhatsky (3): media: v4l UAPI docs: document ROI selection targets media: uvcvideo: add ROI auto controls media: uvcvideo: add UVC 1.5 ROI control .../me

[PATCHv2 3/3] media: uvcvideo: add UVC 1.5 ROI control

2021-02-07 Thread Sergey Senozhatsky
From: Sergey Senozhatsky This patch implements parts of UVC 1.5 Region of Interest (ROI) control, using the uvcvideo selection API. There are several things to mention here. First, UVC 1.5 defines CT_DIGITAL_WINDOW_CONTROL; and ROI rectangle coordinates "must be within the current Di

Re: [PATCH][RESEND] lib/vsprintf: make-printk-non-secret printks all addresses as unhashed

2021-02-02 Thread Sergey Senozhatsky
; because unhashed addresses, while useful for debugging, exposes > kernel addresses which can be a security risk. > > Signed-off-by: Timur Tabi Looks good to me. Acked-by: Sergey Senozhatsky -ss

Re: [PATCH 1/3] printk: use CONFIG_CONSOLE_LOGLEVEL_* directly

2021-02-02 Thread Sergey Senozhatsky
On (21/02/02 16:02), Masahiro Yamada wrote: > > CONSOLE_LOGLEVEL_DEFAULT is nothing more than a shorthand of > CONFIG_CONSOLE_LOGLEVEL_DEFAULT. > > When you change CONFIG_CONSOLE_LOGLEVEL_DEFAULT from Kconfig, almost > all objects are rebuilt because CONFIG_CONSOLE_LOGLEVEL_DEFAULT is > used in

Re: [PATCH 3/3] printk: move CONSOLE_EXT_LOG_MAX to kernel/printk/printk.c

2021-02-02 Thread Sergey Senozhatsky
On (21/02/02 09:50), John Ogness wrote: > > The only consequences could be out-of-tree modules breaking, > but do we care about that? Yeah, I don't think anyone does. So we are fine here. -ss

Re: [PATCH 2/3] printk: hard-code CONSOLE_LOGLEVEL_MIN in printk.c

2021-02-02 Thread Sergey Senozhatsky
On (21/02/02 16:02), Masahiro Yamada wrote: > include/linux/printk.h | 1 - > kernel/printk/printk.c | 2 +- > 2 files changed, 1 insertion(+), 2 deletions(-) > > diff --git a/include/linux/printk.h b/include/linux/printk.h > index fd34b3aa2f90..ceaf0486c01c 100644 > --- a/include/linux/printk.h

[PATCH] media: uvcvideo: initial UVC 1.5 region of interest support

2021-01-31 Thread Sergey Senozhatsky
handle ROI control requests, but it doesn't implement all of the requests. Namely, SEL_TGT_BOUNDS for ROI implements GET_MAX (that is maximal ROI rectangle area). GET_MIN is not implemented ( as of now) since it's not very clear if user space would need such information. Signed-off-by: Sergey Senozhatsky

Re: [printk] b031a684bf: INFO:rcu_tasks_detected_stalls_on_tasks

2021-01-28 Thread Sergey Senozhatsky
On (21/01/27 22:28), John Ogness wrote: > > # modprobe rcutorture onoff_interval=3 onoff_holdoff=30 torture_type=tasks > > (Those are the same modprobe parameters used by the lkp job.) > > After about a minute I see: > > [ 47.268292] tasks-torture: rcu_torture_read_exit: Start of episode > [

Re: [printk] b031a684bf: INFO:rcu_tasks_detected_stalls_on_tasks

2021-01-27 Thread Sergey Senozhatsky
On (21/01/22 17:21), Petr Mladek wrote: [..] > > [ 952.271861] ? firmware_map_remove > > (kbuild/src/consumer/kernel/sched/core.c:4411) > > [ 952.272870] ? ksys_write (kbuild/src/consumer/fs/read_write.c:661) > > [ 952.273709] schedule (kbuild/src/consumer/include/linux/thread_info.h:84 > >

Re: [PATCH 0/2] introduce DUMP_PREFIX_UNHASHED for hex dumps

2021-01-26 Thread Sergey Senozhatsky
On (21/01/26 20:29), John Ogness wrote: > > On 2021-01-26, Steven Rostedt wrote: > > And even if we make this a boot time option, perhaps we should still > > include that nasty dmesg notice, which will let people know that the > > kernel has unhashed values. > > +1 > > The notice would

Re: [PATCH 0/2] Fix BUG: Invalid wait context in hrtimer_interrupt()

2021-01-26 Thread Sergey Senozhatsky
On (21/01/23 23:37), Qais Yousef wrote: > > I hit a pr_warn() inside hrtimer_interrupt() which lead to a BUG: Invalid wait > context splat. > > The problem wasn't reproducible but I think the cause is obvious, printk can't > be called from interrupt context. > > AFAICU printk_deferred() is safe

Re: [PATCH 0/2] Fix BUG: Invalid wait context in hrtimer_interrupt()

2021-01-26 Thread Sergey Senozhatsky
On (21/01/26 14:59), Qais Yousef wrote: > On 01/26/21 13:46, Sergey Senozhatsky wrote: > > On (21/01/23 23:37), Qais Yousef wrote: [..] > I reported it here: > https://lore.kernel.org/lkml/20210114124512.mg3vexudfmoadef5@e107158-lin/ > > # [67628.388606] hrtimer: int

Re: [printk] b031a684bf: INFO:rcu_tasks_detected_stalls_on_tasks

2021-01-22 Thread Sergey Senozhatsky
On (21/01/22 16:13), kernel test robot wrote: [..] > > ++++ > || 6b916706f8 | b031a684bf | > ++++ > |

Re: [PATCH 0/2] introduce DUMP_PREFIX_UNHASHED for hex dumps

2021-01-19 Thread Sergey Senozhatsky
On (21/01/19 01:47), Matthew Wilcox wrote: [..] > > > So maybe DUMP_PREFIX_UNHASHED can do the unhashed dump only when > > CONFIG_DEBUG_KERNEL=y and fallback to DUMP_PREFIX_ADDRESS otherwise? > > Distros enable CONFIG_DEBUG_KERNEL. Oh, I see. > If you want to add CONFIG_DEBUG_LEAK_ADDRESSES,

Re: [PATCH] printk: fix buffer overflow potential for print_text()

2021-01-19 Thread Sergey Senozhatsky
On (21/01/19 10:00), John Ogness wrote: > On 2021-01-19, Sergey Senozhatsky wrote: > > John, how did you spot these problems? > > I am preparing my series to remove the logbuf_lock, which also refactors > and consolidates code from syslog_print_all() and > kmsg_dump_get_bu

Re: [PATCH 0/2] introduce DUMP_PREFIX_UNHASHED for hex dumps

2021-01-18 Thread Sergey Senozhatsky
On (21/01/18 13:03), Timur Tabi wrote: > On 1/18/21 12:26 PM, Matthew Wilcox wrote: > > Don't make it easy. And don't make it look like they're doing > > something innocent. DUMP_PREFIX_SECURITY_HOLE would be OK > > by me. DUMP_PREFIX_LEAK_INFORMATION would work fine too. > >

Re: [PATCH] printk: fix buffer overflow potential for print_text()

2021-01-18 Thread Sergey Senozhatsky
ze-1 bytes > > > for text data. Also, for paranoia sakes, add a terminator after > > > the text data. > > > > > > And finally, document this behavior so that it is clear that only > > > size-1 bytes are used and a terminator is added. > > >

Re: [PATCH] printk: ringbuffer: fix line counting

2021-01-14 Thread Sergey Senozhatsky
hat area. Since the extra area in the data > block was never initialized, the result is that extra newlines may > be seen and counted. > > Restrict newline searching to the text data length. > > Fixes: b6cf8b3f3312 ("printk: add lockless ringbuffer") > Signed-off-

Re: [PATCH] printk: fix kmsg_dump_get_buffer length calulations

2021-01-14 Thread Sergey Senozhatsky
e syslog prefix. > > Use @syslog when calculating the maximum number of records that can > fit into the buffer. > > Fixes: e2ae715d66bf ("kmsg - kmsg_dump() use iterator to receive log buffer > content") > Signed-off-by: John Ogness Acked-by: Sergey Senozhatsky -ss

Re: [PATCH] mm/zsmalloc.c: Convert to use kmem_cache_zalloc in cache_alloc_zspage()

2021-01-14 Thread Sergey Senozhatsky
On (21/01/14 07:00), Miaohe Lin wrote: > > We always memset the zspage allocated via cache_alloc_zspage. So it's more > convenient to use kmem_cache_zalloc in cache_alloc_zspage than caller do it > manually. > > Signed-off-by: Miaohe Lin Reviewed-by: Sergey Senozhatsky -ss

Re: madvise(MADV_REMOVE) deadlocks on shmem THP

2021-01-13 Thread Sergey Senozhatsky
On (21/01/13 20:31), Hugh Dickins wrote: > > We are running into lockups during the memory pressure tests on our > > boards, which essentially NMI panic them. In short the test case is > > > > - THP shmem > > echo advise > /sys/kernel/mm/transparent_hugepage/shmem_enabled > > > > - And a

madvise(MADV_REMOVE) deadlocks on shmem THP

2021-01-13 Thread Sergey Senozhatsky
Hi, We are running into lockups during the memory pressure tests on our boards, which essentially NMI panic them. In short the test case is - THP shmem echo advise > /sys/kernel/mm/transparent_hugepage/shmem_enabled - And a user-space process doing madvise(MADV_HUGEPAGE) on new mappings,

Re: [stable] ext4 fscrypt_get_encryption_info() circular locking dependency

2021-01-13 Thread Sergey Senozhatsky
Hello, Eric, sorry for the delay. On (20/12/11 10:03), Eric Biggers wrote: > > [..] > > > > [ 1598.658233] __rwsem_down_read_failed_common+0x186/0x201 > > [ 1598.658235] call_rwsem_down_read_failed+0x14/0x30 > > [ 1598.658238] down_read+0x2e/0x45 > > [ 1598.658240] rmap_walk_file+0x73/0x1ce

Re: ARC no console output (was Re: [PATCH 1/2] init/console: Use ttynull as a fallback when there is no console)

2021-01-07 Thread Sergey Senozhatsky
On (21/01/07 09:58), Vineet Gupta wrote: > On 1/7/21 9:04 AM, Petr Mladek wrote: > > On Thu 2021-01-07 08:43:16, Vineet Gupta wrote: > > > Hi John, > > > > > > On 1/7/21 1:02 AM, John Ogness wrote: > > > > Hi Vineet, > > > > > > > > On 2021-01-06, Vineet Gupta wrote: > > > > > This breaks ARC

Re: [PATCH 1/1] Revert "init/console: Use ttynull as a fallback when there is no console"

2021-01-07 Thread Sergey Senozhatsky
ordering of consoles is not well defined. And > any changes tend to break existing user settings. > > Do the revert at the least risky solution for now. > > Signed-off-by: Petr Mladek Acked-by: Sergey Senozhatsky -ss

Re: [PATCH] tty/serial/8250: make touch watchdog settable

2021-01-06 Thread Sergey Senozhatsky
On (21/01/06 17:28), chenzhen (R) wrote: > On 21/1/6 15:33, Sergey Senozhatsky wrote: > > On (21/01/06 14:46), chenzhen wrote: > >> Since 54f19b4a6(tty/serial/8250: Touch NMI watchdog in wait_for_xmitr), > >> serial8250 > >> will always touch watchdog

Re: [PATCH v1] panic: push panic() messages to the console even from the MCE nmi handler

2021-01-05 Thread Sergey Senozhatsky
On (21/01/04 16:15), “William Roche wrote: [..] > diff --git a/kernel/panic.c b/kernel/panic.c > index 332736a..eb90cc0 100644 > --- a/kernel/panic.c > +++ b/kernel/panic.c > @@ -166,6 +166,15 @@ static void panic_print_sys_info(void) > ftrace_dump(DUMP_ALL); > } > > +/* > + *

Re: [stable] ext4 fscrypt_get_encryption_info() circular locking dependency

2020-12-10 Thread Sergey Senozhatsky
On (20/12/11 13:08), Sergey Senozhatsky wrote: > > > > How interested are you in having this fixed? Did you encounter an actual > > deadlock or just the lockdep report? > Got one more. fscrypt_get_encryption_info() again, but from ext4_lookup(). [ 162.840909] kswapd0/80

Re: [stable] ext4 fscrypt_get_encryption_info() circular locking dependency

2020-12-10 Thread Sergey Senozhatsky
On (20/12/10 19:48), Eric Biggers wrote: > > > > [ 133.454836] Chain exists of: > > jbd2_handle --> fscrypt_init_mutex --> fs_reclaim > > > > [ 133.454840] Possible unsafe locking scenario: > > > > [ 133.454841]CPU0CPU1 > > [ 133.454843]

[stable] ext4 fscrypt_get_encryption_info() circular locking dependency

2020-12-10 Thread Sergey Senozhatsky
Hi, I got the following lockdep splat the other day, while running some tests on 4.19. I didn't test other stable kernels, but it seems that 5.4 should also have similar problem. As far as I can tell, ext4_dir_open() has been removed quite recently:

  1   2   3   4   5   6   7   8   9   10   >