All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/2] ALSA: Add driver for big Scarlett 4th Gen interfaces
@ 2025-01-04 17:11 Geoffrey D. Bennett
  2025-01-04 17:12 ` [PATCH v4 1/2] ALSA: FCP: Add Focusrite Control Protocol driver Geoffrey D. Bennett
  2025-01-04 17:13 ` [PATCH v4 2/2] ALSA: scarlett2: Add device_setup option to use FCP driver Geoffrey D. Bennett
  0 siblings, 2 replies; 4+ messages in thread
From: Geoffrey D. Bennett @ 2025-01-04 17:11 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: Takashi Iwai, linux-sound

Hi Takashi,

Thanks again for your feedback. Requested changes made.

> Now, considering this implementation again, a fundamental question is
> whether we really should go to this direction or not.
> 
> Usually the driver implements an ioctl per certain limited task
> (except for some debugging purpose).  But we open all doors fully.
> This gives the most flexibility, of course.  OTOH, it has a
> significant risk that every program may screw up your device easily by
> sending some malicious ioctls.

That is a good point. To eliminate that risk and prevent malicious use
entirely, I added a requirement in v4 of having CAP_SYS_RAWIO to use
the hwdep interface. In addition, I have added validation of the flash
commands to prevent the App_Gold flash segment from being accidentally
erased or written to (this segment contains the backup firmware used
when the App_Upgrade segment does not contain a valid firmware image).
I think this way we can have both flexibility and safety.

Regards,
Geoffrey.

---
Changes in v4:
- Use variable-length data arrays in ioctl structs instead of pointers
- Add CAP_SYS_RAWIO requirement to hwdep interface
- Add validation of flash commands to prevent accidental bricking due
  to erasing/writing the App_Gold segment
- Refactor URB cleanup

---
Changes in v3:
- Update ioctl structs and add ioctl_compat op to work with 32-bit
  userspace on 64-bit kernels
- Update driver to do all init steps so it can re-init after
  suspend/resume
- Add version field to init ioctl for future compatibility
- Improve error messages when unexpected response data is received

---
Changes in v2 as per Takashi's feedback:
- Use fixed-size data arrays instead of pointers in ioctl structs
- Define notify struct outside of struct fcp_dev
- Use u8/u16 types without __ prefix
- Use cleanup.h for code simplification
- Add init flag to ensure FCP_IOCTL_INIT is called before
  FCP_IOCTL_CMD and FCP_IOCTL_SET_METER_MAP
- Do not destroy/recreate the meter control (the number of channels is
  now fixed when it is created)

Geoffrey D. Bennett (2):
  ALSA: FCP: Add Focusrite Control Protocol driver
  ALSA: scarlett2: Add device_setup option to use FCP driver

 MAINTAINERS                 |   10 +-
 include/uapi/sound/fcp.h    |   71 +++
 sound/usb/Makefile          |    1 +
 sound/usb/fcp.c             | 1018 +++++++++++++++++++++++++++++++++++
 sound/usb/fcp.h             |    7 +
 sound/usb/mixer_quirks.c    |    7 +
 sound/usb/mixer_scarlett2.c |    8 +
 7 files changed, 1118 insertions(+), 4 deletions(-)
 create mode 100644 include/uapi/sound/fcp.h
 create mode 100644 sound/usb/fcp.c
 create mode 100644 sound/usb/fcp.h

-- 
2.45.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-01-10 17:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-04 17:11 [PATCH v4 0/2] ALSA: Add driver for big Scarlett 4th Gen interfaces Geoffrey D. Bennett
2025-01-04 17:12 ` [PATCH v4 1/2] ALSA: FCP: Add Focusrite Control Protocol driver Geoffrey D. Bennett
2025-01-10 17:03   ` Takashi Iwai
2025-01-04 17:13 ` [PATCH v4 2/2] ALSA: scarlett2: Add device_setup option to use FCP driver Geoffrey D. Bennett

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.