From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 790653FC3 for ; Sat, 11 Sep 2021 11:56:11 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 42D0F611F0; Sat, 11 Sep 2021 11:56:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631361370; bh=lGmgTFSbG/Gs9rf2FxKe3GG+QgffwmnxvoctnWxBkSU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oB5WBiiNonBBZGsNVxgo4N7rahKgzeSZz+0DCcOUqo3s11ypdJS09AMk+uJh6Wh3L cbdHirmyPp/EbQoe8rbIT27/P6lHyzXSYLR4T+KdLgKwbh9zEVo2LZdWHDW69pSSs/ awBUsNUvYuqrj8knGWtm+RXO27LkmTULlhim1ruU= Date: Sat, 11 Sep 2021 13:56:08 +0200 From: Greg Kroah-Hartman To: Ojaswin Mujoo Cc: linux-staging@lists.linux.dev, Nicolas Saenz Julienne , Stefan Wahren , Arnd Bergmann , Dan Carpenter , Phil Elwell , bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] staging: vchiq: convert to use a miscdevice Message-ID: References: <20210907115045.2206083-1-gregkh@linuxfoundation.org> <20210910114004.GA23656@ojas> <20210911112911.GA17777@ojas> Precedence: bulk X-Mailing-List: linux-staging@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210911112911.GA17777@ojas> On Sat, Sep 11, 2021 at 04:59:11PM +0530, Ojaswin Mujoo wrote: > On Fri, Sep 10, 2021 at 02:05:19PM +0200, Greg Kroah-Hartman wrote: > > On Fri, Sep 10, 2021 at 05:10:04PM +0530, Ojaswin Mujoo wrote: > > > On Tue, Sep 07, 2021 at 01:50:45PM +0200, Greg Kroah-Hartman wrote: > > > > Using a struct class, a cdev, and another device just for a single minor > > > > device is total overkill. Just use a dynamic misc device instead, > > > > saving lots of logic and memory. > > > > > > Hello Greg, > > > > > > I got some time to test this out at my end. This seems to work correctly > > > however there's a small change in permissions applied to /dev/vchiq that > > > is causing tests to break. > > > > > > * Permissions before the patch * > > > $ ls -l /dev/vchiq > > > crw-rw---- 1 root video 235, 0 May 7 17:33 vchiq > > > > > > * Permissions after the patch * > > > $ ls -l /dev/vchiq > > > crw------- 1 root root 10, 125 May 7 17:30 vchiq > > > > > > As seen above, after the patch, the cdev is only accessible by root user, > > > which is causing the tests ($ vchiq_test -f 10) to fail when run as > > > non-root. > > > > Ah, that's not under the kernel's control, but as you point out, it's a > > udev issue. > > > > > I believe assigning the permission and "video" group to /dev/vchiq is > > > handled by udev, in the downstream pi OS, as seen in this line in > > > /lib/udev/rules.d/10-local-rpi.rules file: > > > > > > SUBSYSTEM=="vchiq", GROUP="video", MODE="0660" > > > > > > I'm not completely sure how the SUBSYSTEM part is passed to udev from > > > the kernel modules, however seems like the miscdevice is not notifying > > > udev correctly (?). > > > > No, the SUBSYSTEM for this device has changed from "vchiq" to "misc". > > > > Having a whole subsystem for just one character device is crazy, which > > is why I did the kernel change. > > > > Try changing the line in the udev file to: > > > > NAME=="vchiq", GROUP="video", MODE="0660" > > > > (SUBSYSTEM changes to NAME) and see if that works both on the newer > > kernel, and on the older ones as > > well. > Hello, thanks for the explanation and pointers. > > The "NAME==vchiq" change doesn't seem to work but I was able to get it > correctly working by using "KERNEL=vchiq" instead: > > KERNEL=="vchiq", GROUP="video", MODE="0660" > > I tested this with and without this patch and it works as expected. Ah, yes, you are right, I was just guessing, I should have read the udev documentation :) Any chance you can send a patch for this to whatever package that file comes from? thanks, greg k-h From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB976C433EF for ; Sat, 11 Sep 2021 11:58:06 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7D86F6109F for ; Sat, 11 Sep 2021 11:58:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7D86F6109F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ki4lj6lNHMC/i1G+Ebr3/lZggv+BowuM12Kd1T4CobA=; b=lS1YlVHJfUmGLl hF+04bp1hZDPWsrwSmvLXA8Cci1QCgEFNcir7sWsqXahCszDzjkhJkaSmZfMiejpDwdBYNeJHlA3y vc0D5TCuU+BsT2mPmBhB61xNrBY29Mqy9TR+QKCGLZTMxl7fWWVx1zvUoLZ7rIKrF3eJZOjwaOUUf +HqC6mMiGxpMnmNXMRxSDvEE9t19361pJDm4ExzC/gpaM6Y3K4hUOzKFEg2LXA9D64NlqbmF2Dd0g QIh0P8/qyocc/XY26M57dKECgsedGyex8KMSMWUmW+I86SKDenzoqVzeXy1G/hx7GOjpfPxUebiqV bDsBZ+rKyQNkXaNNyCJg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mP1cF-00EjP9-3w; Sat, 11 Sep 2021 11:56:15 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mP1cB-00EjOe-H7; Sat, 11 Sep 2021 11:56:12 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 42D0F611F0; Sat, 11 Sep 2021 11:56:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631361370; bh=lGmgTFSbG/Gs9rf2FxKe3GG+QgffwmnxvoctnWxBkSU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oB5WBiiNonBBZGsNVxgo4N7rahKgzeSZz+0DCcOUqo3s11ypdJS09AMk+uJh6Wh3L cbdHirmyPp/EbQoe8rbIT27/P6lHyzXSYLR4T+KdLgKwbh9zEVo2LZdWHDW69pSSs/ awBUsNUvYuqrj8knGWtm+RXO27LkmTULlhim1ruU= Date: Sat, 11 Sep 2021 13:56:08 +0200 From: Greg Kroah-Hartman To: Ojaswin Mujoo Cc: linux-staging@lists.linux.dev, Nicolas Saenz Julienne , Stefan Wahren , Arnd Bergmann , Dan Carpenter , Phil Elwell , bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] staging: vchiq: convert to use a miscdevice Message-ID: References: <20210907115045.2206083-1-gregkh@linuxfoundation.org> <20210910114004.GA23656@ojas> <20210911112911.GA17777@ojas> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210911112911.GA17777@ojas> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210911_045611_635552_59271271 X-CRM114-Status: GOOD ( 32.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sat, Sep 11, 2021 at 04:59:11PM +0530, Ojaswin Mujoo wrote: > On Fri, Sep 10, 2021 at 02:05:19PM +0200, Greg Kroah-Hartman wrote: > > On Fri, Sep 10, 2021 at 05:10:04PM +0530, Ojaswin Mujoo wrote: > > > On Tue, Sep 07, 2021 at 01:50:45PM +0200, Greg Kroah-Hartman wrote: > > > > Using a struct class, a cdev, and another device just for a single minor > > > > device is total overkill. Just use a dynamic misc device instead, > > > > saving lots of logic and memory. > > > > > > Hello Greg, > > > > > > I got some time to test this out at my end. This seems to work correctly > > > however there's a small change in permissions applied to /dev/vchiq that > > > is causing tests to break. > > > > > > * Permissions before the patch * > > > $ ls -l /dev/vchiq > > > crw-rw---- 1 root video 235, 0 May 7 17:33 vchiq > > > > > > * Permissions after the patch * > > > $ ls -l /dev/vchiq > > > crw------- 1 root root 10, 125 May 7 17:30 vchiq > > > > > > As seen above, after the patch, the cdev is only accessible by root user, > > > which is causing the tests ($ vchiq_test -f 10) to fail when run as > > > non-root. > > > > Ah, that's not under the kernel's control, but as you point out, it's a > > udev issue. > > > > > I believe assigning the permission and "video" group to /dev/vchiq is > > > handled by udev, in the downstream pi OS, as seen in this line in > > > /lib/udev/rules.d/10-local-rpi.rules file: > > > > > > SUBSYSTEM=="vchiq", GROUP="video", MODE="0660" > > > > > > I'm not completely sure how the SUBSYSTEM part is passed to udev from > > > the kernel modules, however seems like the miscdevice is not notifying > > > udev correctly (?). > > > > No, the SUBSYSTEM for this device has changed from "vchiq" to "misc". > > > > Having a whole subsystem for just one character device is crazy, which > > is why I did the kernel change. > > > > Try changing the line in the udev file to: > > > > NAME=="vchiq", GROUP="video", MODE="0660" > > > > (SUBSYSTEM changes to NAME) and see if that works both on the newer > > kernel, and on the older ones as > > well. > Hello, thanks for the explanation and pointers. > > The "NAME==vchiq" change doesn't seem to work but I was able to get it > correctly working by using "KERNEL=vchiq" instead: > > KERNEL=="vchiq", GROUP="video", MODE="0660" > > I tested this with and without this patch and it works as expected. Ah, yes, you are right, I was just guessing, I should have read the udev documentation :) Any chance you can send a patch for this to whatever package that file comes from? thanks, greg k-h _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel