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=-2.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED, USER_AGENT_MUTT autolearn=ham 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 86ECCC43381 for ; Wed, 13 Mar 2019 14:26:25 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (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 35EE02077B for ; Wed, 13 Mar 2019 14:26:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=kroah.com header.i=@kroah.com header.b="ssUdgo0I"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="vDNaiYxT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 35EE02077B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kroah.com Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=kernelnewbies-bounces@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.91) (envelope-from ) id 1h44p4-00057D-DD; Wed, 13 Mar 2019 10:25:34 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1h44p2-000576-FP for kernelnewbies@kernelnewbies.org; Wed, 13 Mar 2019 10:25:32 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 3E8F8259E3; Wed, 13 Mar 2019 10:25:31 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 13 Mar 2019 10:25:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kroah.com; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=51mC4n/b1kxrQ64wQNY0jOzXX+n lU7yzv27Ed1LhhAY=; b=ssUdgo0IANCVAO2z/6hpywHfSMxp/KnyDvwvkkoepiz IvpYTWipIrNbc4nSWxAJwwc/pbdcMDVvK0Bo6VP7DOmme4fgrRpScsuMW1mKXbET s1zghVM5XCmNecZoQJA0IgO6UVa/McdK8P/KsEuQg18pzK5Rp6r/FQL5FWZj5VTK 8DmpIXgXf6CKKmOUb7rk8weWiD/Zx2SEmK3A5/3WP8a1urg9o+fjIxMTsYs/3NEX 8ZIATtS6TrnlMSgXEZex5e0Yim8B4E8u3mjl/6vG23mPTY1yZ0E/GoCi2nfJcCj3 83+4kDmLTJOttjfxAcD/bUSFxFRfABGVW0tXPppAOnw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=51mC4n /b1kxrQ64wQNY0jOzXX+nlU7yzv27Ed1LhhAY=; b=vDNaiYxTTT1l2P5BOZEb0a OVaeci+NP5vlZ/u9NKpcgwx51/As1s6/3tK0rnXK26my7GvDIRqbnw/ikEntqZug fW5fiS0WPvH25bvUACewVNCnjkGccXciZTQdr1Gp/a25wvqZ8FLqiq1cT878/Bbc 2HyVKFgiYmFYTu0CdtIxIHyrB/tZTMRb0hX15olQUfWQbjYo14lZykcaWQgFLkxU wSNAEN75C27NOHRZflotTg5dskEuW9tVT6IrbmJr0B40g0sPG5XStcxi8kbx1szo 97/iqDjYkOPQbnpicot6O8LvdFImz2YNy2ylbpzFEud4EHV46H1LDZaq1xGG1PMw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrhedtgdeifecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujggfsehttdertddtredvnecuhfhrohhmpefirhgvghcu mffjuceoghhrvghgsehkrhhorghhrdgtohhmqeenucfkphepuddvrddvjedrieehrddvvd dunecurfgrrhgrmhepmhgrihhlfhhrohhmpehgrhgvgheskhhrohgrhhdrtghomhenucev lhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from localhost (unknown [12.27.65.221]) by mail.messagingengine.com (Postfix) with ESMTPA id 66A81E4360; Wed, 13 Mar 2019 10:25:30 -0400 (EDT) Date: Wed, 13 Mar 2019 07:25:29 -0700 From: Greg KH To: Jay Aurabind Subject: Re: Using binary attributes for configuration sysfs entries Message-ID: <20190313142529.GA5715@kroah.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) Cc: kernelnewbies X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org On Wed, Mar 13, 2019 at 12:02:02PM +0530, Jay Aurabind wrote: > Hi, > > Before I send this patch to actual mailing list, I'd appreciate if > someone could tell me if this is a bad idea! > > The driver in staging for pi433 (a wireless transceiver) uses IOCTLs > at the moment. I wish to add a sysfs interface to it that control the > various transmission and reception parameters. In the ioctl interface, > it uses two structs that have about 40 parameters in total. > > For the corresponding sysfs interface, since there are a lot of > parameters, would it be justified to use the same binary format though > sysfs_create_binary_file() ? The rationale is that it would be easier > to simply pack all the config options in the struct and send it in > once rather than individually write 40 files. This is what the > attached patch follows. Interface is added only for reception > parameters as of now. binary sysfs files are only allowed for "pass through" data, where the kernel does not touch the information at all and only passes it from the hardware, to userspace directly (or the other way around). It can not be used for data that the kernel actually knows about and modifies / acts on. An example of valid binary sysfs files are USB and PCI device configuration information (read directly from the hardware), or firmware files that are send from userspace directly to the hardware without the kernel knowing what the data is. You can't use a binary sysfs file for ioctl-like data, that's not allowed, just use an ioctl for that. Or better yet, use a common api interface for it, to match the other types of devices. hope this helps, greg k-h _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies