Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp4068094rwi; Wed, 2 Nov 2022 06:32:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5rKew8pt2+aVFxbUC15TJ0vmL4w/KamohUTUtK2gJB/G5GxhWzIzIa7DJ99qFC/cEEoig0 X-Received: by 2002:aa7:c14f:0:b0:460:e1cc:2c29 with SMTP id r15-20020aa7c14f000000b00460e1cc2c29mr25021583edp.423.1667395975222; Wed, 02 Nov 2022 06:32:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667395975; cv=none; d=google.com; s=arc-20160816; b=WiYBkNsSsHVxVVnQSsLlxLGA0u1Obv9Yb58qvzZ0HgOTShROEDQ1t/+kiLTRKWZ9fU elPdvw4eevLAMr9GZ7nj8HL2bJ51USs68Tja/Bhp6oT8t8RK6dSqurOF+cHTpAguNLku U+ftrcu5TGJuRf5iL01IcgPSIbtHeXE8r5Q68hKwTDwPoTSOwCOHFweKgeh4nCmALOdk Db6sw/GEVxWm6JWHVzz9NXqRKet9PnZT4S6l+2fE7G5kItLk0mWFIK3Q5gUpPGOizqBM Vu6yIEVRqQnRT98nIF2xhHHkMg5rdlKKYE42A6M607r6sOise2KI7vlUSdnO6ssk0pp8 bNAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=h4Qt4+7BCtKcn4LLoSu0RRkNEJEJ/wzm8INNJC+mbcM=; b=Hs1ln6GcEdFkdgVSycBGCx0bC80QF6K9C4cTFMWR59piQZvQC/VpXvA01nERxEsZ7Z DGYjvXAPiXFXx07glK8EjWcqlsH21vXKnf+esTu+4IFKtKpRt7QUQsOzIQluwJ5BmF3Y EbvGYH+xaWMIrlNvEkcBUe4mXIVT84ECk0ji3lwhLHIzQ1jFC408XXbnS8IalpPOzAUH Ps35EZ9/2Kh7VCwtGub/KiZpkx6o7WFjeTA7lqzjvOJYOuGpSsadCBtjDKiObmlO0T4V O7TA1DWP3M68feu8KASUdPHZM3/wCRXS1Gx/xxmmzyHLYYCVIwyygbkBgpAsnSInnkL7 kM6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TAHjqFBW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nb15-20020a1709071c8f00b00780805b99ccsi18737179ejc.648.2022.11.02.06.32.21; Wed, 02 Nov 2022 06:32:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TAHjqFBW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231295AbiKBNOp (ORCPT + 99 others); Wed, 2 Nov 2022 09:14:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231340AbiKBNOh (ORCPT ); Wed, 2 Nov 2022 09:14:37 -0400 Received: from mail-yw1-x112c.google.com (mail-yw1-x112c.google.com [IPv6:2607:f8b0:4864:20::112c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01B192AC61; Wed, 2 Nov 2022 06:14:36 -0700 (PDT) Received: by mail-yw1-x112c.google.com with SMTP id 00721157ae682-3691e040abaso165718017b3.9; Wed, 02 Nov 2022 06:14:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=h4Qt4+7BCtKcn4LLoSu0RRkNEJEJ/wzm8INNJC+mbcM=; b=TAHjqFBWfeOX0IQXjYQCEXWx9G6UWa4lAB+NgrEPgjS2Y9Gex05iuxYzLfsooQV3vU WMausD7iXUy85YoOK8v3QLs5BxH2hFRpLQrcCEXfFvbsyXxvF33yrx3CYuT9NWXK4w0x gPeeA8NTjn+4cIVlxPIxLo6nnqkzbHvfgpdBtJv23pnMfz3quqNiPPEkFx9j5zAHUDAN TYLa0CwL7OAg229kNs0IHhMqugKjKHD+qT+elblhLn5qa48zDjX4PatcdKjER5Rx0qKZ pdxA5a+V7V4gN6SPZWsyY2aDcd7u9Dr2Tf5ytxToa7G1yNyA8KHoVyewcqqw4RHckE+j 1oLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=h4Qt4+7BCtKcn4LLoSu0RRkNEJEJ/wzm8INNJC+mbcM=; b=NjjHgj+0+/Brpa42JNhz80dYnV5HTipTCZ0s1LlWoVJELvTQ8wpaXiRO2JZuEhT8bJ Q0Mfwcy1qjcMpUw+BGsS2TNaNCmHx3cCA7LKjGSRTncMLYoE9MYp6LE0mgzb0Kl1of57 Vg8CejfyO3nzvWrUVUS50P8WSri0gZWpqHJMlXrVjOV7DM/s22LVRg65dXU/uuKWK3aU DiJ+phtO0G1m65IxCOBq1tq53ZP/XZFyKXVThSf78QQ1RJWdH45htGM194nT0u2viWD3 6EPzjDu6ChyFTF1riwiTVwu9vHQQHDOU9Dxmo6mzanXBVqfPH4W5hU83pwWbD5jsy+Wa RE7g== X-Gm-Message-State: ACrzQf1M1rUNBPDTRg3+KuFeB9jb2RuHLeDHzOKUJM1R1BcVtjGjP7Yf rtRSF0TwzUvt90xCuKhDt5s7YmDOw+pvV4by4Eg81mQfHq0= X-Received: by 2002:a81:6208:0:b0:367:f222:df0d with SMTP id w8-20020a816208000000b00367f222df0dmr24153950ywb.422.1667394875814; Wed, 02 Nov 2022 06:14:35 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Guillermo Rodriguez Garcia Date: Wed, 2 Nov 2022 14:14:24 +0100 Message-ID: Subject: fs: layered device driver to write to evdev To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: Christoph Hellwig , Al Viro , Linus Torvalds , Luis Chamberlain , Matthew Wilcox , Kees Cook , Iurii Zaikin Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, I have a number of embedded boards that integrate a pwm-based buzzer device, and use the pwm-beeper device driver in order to control this. However the pwm-beeper device driver only supports simple (play / stop) ioctls, so I had implemented a "layered" device driver that would talk to the pwm-beeper device (through evdev), and provide additional ioctls to userspace so that an application could say e.g. "beep for 50ms", and the driver would take care of the timing. This layered device driver used set_fs + vfs_write to talk to the underlying device. However, since [1] this no longer works. I understand that device drivers should implement ->write_iter if they need to be written from kernel space, but evdev does not support this. What is the recommended way to have a layered device driver that can talk to evdev ? Thanks in advance, (If possible, please CC me in any replies) [1]: https://lore.kernel.org/lkml/20200626075836.1998185-9-hch@lst.de/ -- Guillermo Rodriguez Garcia guille.rodriguez@gmail.com