From: Dan Carpenter <error27@gmail.com>
To: Sumitra Sharma <sumitraartsy@gmail.com>
Cc: gregkh@linuxfoundation.org, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org, outreachy@lists.linux.dev
Subject: Re: [PATCH] Staging: pi433: Change bit_rate type from u16 to u32
Date: Sat, 11 Mar 2023 16:17:52 +0300 [thread overview]
Message-ID: <de7df101-6cbf-4e69-afcb-b80204bc1d5f@kili.mountain> (raw)
In-Reply-To: <20230311130023.GB14247@ubuntu>
On Sat, Mar 11, 2023 at 05:00:23AM -0800, Sumitra Sharma wrote:
> Hi Dan,
>
> The description in TODO is difficult to understand. I would appreciae if
> you could help me understand it more in a step-by-step simplified means.
>
> "This configuration needs to be moved to sysfs instead of being done through
> + IOCTL. Goind forward, we need to port userspace tools to use sysfs instead
> + of IOCTL and then we would delete IOCTL."
>
This driver comes with a user space program to control it. Your patch
breaks that program. Someone could find the program and change it to
use a u32 instead of a u16 but the old version would still be broken so
users would be confused.
Generally, in the kernel we try to avoid doing configuration through
ioctls these days but instead prefer to use sysfs.
Now the driver uses a pi433_tx_cfg struct which is the same for both
user space and kernel space. What we do is create a different one which
is private to the kernel. Then in pi433_ioctl() we copy the user space
struct and convert it to a kernel space struct (new format with a u32).
Change the kernel to use the new struct every where except the
pi433_ioctl.
Then add some new sysfs files so that the user can control the bitrate
without changing any of the rest of the struct. Update the user space
tool to use sysfs instead of the ioctl. Then after everyone upgrades to
the new version delete the ioctl.
regards,
dan carpenter
next prev parent reply other threads:[~2023-03-11 13:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-11 12:23 [PATCH] Staging: pi433: Change bit_rate type from u16 to u32 Sumitra Sharma
2023-03-11 12:31 ` Greg KH
2023-03-11 12:39 ` Dan Carpenter
2023-03-11 13:00 ` Sumitra Sharma
2023-03-11 13:17 ` Dan Carpenter [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-03-11 11:42 Sumitra Sharma
2023-03-11 11:50 ` Julia Lawall
2023-03-11 11:59 ` Sumitra Sharma
2023-03-11 12:12 ` Julia Lawall
2023-03-13 1:34 ` Ira Weiny
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=de7df101-6cbf-4e69-afcb-b80204bc1d5f@kili.mountain \
--to=error27@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=outreachy@lists.linux.dev \
--cc=sumitraartsy@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.