From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.66]) (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 B870B33FE33 for ; Mon, 16 Mar 2026 18:06:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.67.36.66 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773684397; cv=none; b=lKLq0GGsrLAzDf0xitML7aFmpPl3yWkdJYkMdZeMAJXxTmFmI2CdTvQHNcgAJh33cxosPMZHJPP/m+bMM/McPNewoj1A0M2vssSVEYTFoZdIBrt2TPr1SVzCZF08EDe8yN4V3RyI3pf9WH3E+JFligTyUTLHgNh8Fy+jLOZ/vc0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773684397; c=relaxed/simple; bh=vsCerXvNI66p0WQN4f2HWtkZDjbz/hrQ/GAa3UbU95M=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=WUZHcZbGJnEUVCY98MRATOOS/9uOgPqLF9DCe+1dG3J8KAEyCUGAD6/v4h+8MEza2FZ793C49bh28QXVh/jpNxXQZdz0RelJXvfeze4dlAQ2WxM9Ek8VA2UvYNJoburyqfOCBi5iIHfInE6GY6mv7ojDDB7sbAo+fOg8lbCsX5c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=posteo.de; spf=pass smtp.mailfrom=posteo.de; dkim=pass (2048-bit key) header.d=posteo.de header.i=@posteo.de header.b=qO6Lk7rT; arc=none smtp.client-ip=185.67.36.66 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=posteo.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=posteo.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=posteo.de header.i=@posteo.de header.b="qO6Lk7rT" Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 29CA8240105 for ; Mon, 16 Mar 2026 19:06:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=posteo.de; s=2017; t=1773684385; bh=w4aMMeXH0b7JgTSQ3j7crI/pRlF2UNUuOM0hPyY2020=; h=Message-ID:Subject:From:To:Cc:Date:Autocrypt:Content-Type: MIME-Version:OpenPGP:From; b=qO6Lk7rTUW3H0fPPJfL0YGhRHR1XTS90SrfRDYE8pBk9gt5ZhKNsQAfy69KXzCiao pjGRF3NZJtST7bhPpXSAMH/DrAAvN1ENGG+ZNaaGay7YhOoKiODycXsj6QWCqG2yRa dSkp3WxoDzxayQaYAEe362SdqM2jxkoD5sxPxIKzlD9QwZtGB6XxK/3yQz0o7OS975 r2fFLZ1DvGEli+vPgFyP/m+GQwIBDjYIWpY+p8Z6G3IKZTJaxBq+AIoWoNzua6OdDc blIqYZ7il8b7kff3JP3SQ5CH8dNeALlsb4bUa7Xt+AniyB/FVn66MRVd3HE5JMBA0g miEXkT04RIr6Q== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4fZNM142Ltz9rxF; Mon, 16 Mar 2026 19:06:21 +0100 (CET) Message-ID: <3ca65f7d0b00c93c91563bc29198f18d5a30eeae.camel@posteo.de> Subject: Re: [PATCH v3 7/7] leds: add synology microp led driver From: Markus Probst To: Greg Kroah-Hartman Cc: Danilo Krummrich , Markus Probst via B4 Relay , Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Miguel Ojeda , Boqun Feng , Gary Guo , =?ISO-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , "Rafael J. Wysocki" , Igor Korotin , Daniel Almeida , Bjorn Helgaas , Krzysztof =?UTF-8?Q?Wilczy=C5=84ski?= , Pavel Machek , Len Brown , Robert Moore , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, driver-core@lists.linux.dev, linux-pci@vger.kernel.org, linux-leds@vger.kernel.org, linux-acpi@vger.kernel.org, acpica-devel@lists.linux.dev Date: Mon, 16 Mar 2026 18:06:23 +0000 In-Reply-To: <2026031602-drove-timothy-1bb1@gregkh> References: <20260313-synology_microp_initial-v3-0-ad6ac463a201@posteo.de> <20260313-synology_microp_initial-v3-7-ad6ac463a201@posteo.de> <39f1c9bb0dbde9f1b60785f8e838289c888ffdb0.camel@posteo.de> <2026031645-unplowed-purist-9c4b@gregkh> <2026031602-drove-timothy-1bb1@gregkh> Autocrypt: addr=markus.probst@posteo.de; prefer-encrypt=mutual; keydata=mQINBGiDvXgBEADAXUceKafpl46S35UmDh2wRvvx+UfZbcTjeQOlSwKP7YVJ4JOZrVs93 qReNLkOWguIqPBxR9blQ4nyYrqSCV+MMw/3ifyXIm6Pw2YRUDg+WTEOjTixRCoWDgUj1nOsvJ9tVA m76Ww+/pAnepVRafMID0rqEfD9oGv1YrfpeFJhyE2zUw3SyyNLIKWD6QeLRhKQRbSnsXhGLFBXCqt 9k5JARhgQof9zvztcCVlT5KVvuyfC4H+HzeGmu9201BVyihJwKdcKPq+n/aY5FUVxNTgtI9f8wIbm fAjaoT1pjXSp+dszakA98fhONM98pOq723o/1ZGMZukyXFfsDGtA3BB79HoopHKujLGWAGskzClwT jRQxBqxh/U/lL1pc+0xPWikTNCmtziCOvv0KA0arDOMQlyFvImzX6oGVgE4ksKQYbMZ3Ikw6L1Rv1 J+FvN0aNwOKgL2ztBRYscUGcQvA0Zo1fGCAn/BLEJvQYShWKeKqjyncVGoXFsz2AcuFKe1pwETSsN 6OZncjy32e4ktgs07cWBfx0v62b8md36jau+B6RVnnodaA8++oXl3FRwiEW8XfXWIjy4umIv93tb8 8ekYsfOfWkTSewZYXGoqe4RtK80ulMHb/dh2FZQIFyRdN4HOmB4FYO5sEYF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Pag12pltrtFbA/r2phDGN2si8PooDT99bSTJjaM45 MTAAHbHKJfvgfK41bNFD5mMtpWpL195XRtS0Nrxdg3PaYBxN5gtTG0RyZfpYRlkdEhm+jj/8RxuSG i/qdhRdbiI7K2IELWeQVHSNDi9JabR/UzlR4NSnhfAjRIVlRM+eFbUl8XwxwVrAkojF5IraH2qRvg VCmuFsHUW07FUlrDrzpjXsD73cKppoFGDCdDR0BHJepXbFLS9+AqkT+guRJlnCTg2p+TQtnbwPgKp Vj98JixovCl99zRYTsL2bRNU5+q8iET65VMJ1ydyNanvLd5vI/NqDkXhlXLsGmdaDTtu4R21PkToX dQNGrZ91M9nlIBKw8Y7c7xZ4098qX2b8JX/CxD+gC1r4C8vuA3GkhFLx+KlkON7LyiJPkrePp6Qky jfGillcaQOqFZ3WwVqyzG1BUfTow== Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-akERDsl+g92JaDyAMR+U" Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 OpenPGP: url=https://posteo.de/keys/markus.probst@posteo.de.asc; preference=encrypt --=-akERDsl+g92JaDyAMR+U Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 2026-03-16 at 14:58 +0100, Greg Kroah-Hartman wrote: > On Mon, Mar 16, 2026 at 01:43:44PM +0000, Markus Probst wrote: > > On Mon, 2026-03-16 at 07:33 +0100, Greg Kroah-Hartman wrote: > > > On Sun, Mar 15, 2026 at 08:41:06PM +0100, Danilo Krummrich wrote: > > > > I.e. if we can't (easily) use mfd cells and would need a custom API= , then why > > > > even split it up at all, given that splitting it up would probably = the most > > > > complicated part of the whole driver. > > > >=20 > > > > Greg, what do you think? > > >=20 > > > I think this has yet to be proven to be a kernel driver at all at thi= s > > > point, and not just a userspace daemon that listens to the serial por= t > > > and then does what is needed from there :) > > >=20 > > > Or, if someone can prove that the operations on this serial data stre= am > > > actually do require it to be in the kernel (which I have yet to see a > > > list of what this connection does, did I miss it?) then a single driv= er, > > > under the drivers/platform section of the kernel tree makes sense. > > The sysoff component is strictly necessary for poweroff and reboot. > >=20 > > On ARM64 Synology NAS devices it is needed so the device actually > > powers off after calling > > `syscall(SYS_reboot, LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, > > LINUX_REBOOT_CMD_POWER_OFF, NULL);` > > . Otherwise it would stay on. > > Same applies to reboot. >=20 > So that means a write of a set of bytes to the serial port will cause > the machine to reboot or shutdown? Yes. >=20 > > On x86 it isn't clearly documented what sending the poweroff and reboot > > command to the microp device exactly does, so this is based on > > observations. It should be sent before issuing a poweroff or reboot via > > ACPI Sleep. On reboot it resets various device states, so fan speeds go > > to default, leds turn off etc., so it behaves like a coldboot. > > On poweroff it will mark it as graceful shutdown (i. e. the device > > won't turn automatically on, because it thinks a power-loss happend). > >=20 > > For the other components: > > - leds > > - hwmon > > - input >=20 > For "input" what exactly does the input device show up as? A power > button? Something else? Well there are a few other things besides a power button: - beeper (short and long variant) - factory reset button - "USB Copy" button. Not present on all devices (including not present on my testing device). It is meant for copying data from or to a usb stick. Both of these buttons don't have a keycode in include/uapi/linux/input- event-codes.h, which is suprising given how many devices have a factory reset button. So I am not sure if I can handle them in this driver. =46rom what I can tell, there isn't actually a input device type I could specify on registering a input device. But it would be considered a misc input device. >=20 > For hwmon, that makes sense to have a kernel driver. >=20 > For leds, that depends on what you want to do with the led, as in the > end you are just controlling it from userspace anyway :) >=20 > > It could theoratically be implemented in userspace. A userspace daemon > > could theoratically control the fan speeds directly, issue a systemd > > shutdown on power button press, control the leds directly etc. > >=20 > > But honestly, I don't understand why this is an argument. > > With that argument drivers/leds, drivers/hwmon and drivers/input would > > not even exist, because everything could be implemented in userspace > > via > > - I2C: /dev/i2c-* (drivers/i2c/i2c-dev.c) > > - MMIO: /dev/ioport and /dev/mem (drivers/char/mem.c) > > - GPIO: /sys/class/gpio (drivers/gpio/gpiolib-sysfs.c) > > - SPI: /dev/spidev* (drivers/spi/spidev.c) > > - PCI: /sys/class/pci_bus/ (drivers/pci/pci-sysfs.c) > > - Serial: /dev/ttyS* > > and likely almost any other bus device too. > >=20 > > Generally speaking, the kernel and its drivers is the layer between > > hardware and software. It provides the hardware abstractions as > > userspace interfaces. So any software on the same cpu architecture can > > work with any hardware, as long as there is a kernel driver. >=20 > Yes, I kind of know what drivers and classes do and why they are needed, > that's not the point here. :) >=20 > > In the case of this driver, it means > > - *any* led daemon can control the leds > > - *any* fan control daemon can control the fan speed and frequency > > - *any* monitoring software can view the provided sensors > > - *any* init system can react to the power button > > - *any* process can request a reboot or shutdown > > . > > I think this is the expected behaviour. >=20 > Ok great, then make a single driver that handles all of this, like other > drivers/platform/ drivers do today, and all should be fine. Great, I will. Thanks - Markus Probst >=20 > thanks, >=20 > greg k-h --=-akERDsl+g92JaDyAMR+U Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iQJPBAABCAA5FiEEgnQYxPSsWOdyMMRzNHYf+OetQ9IFAmm4RoobFIAAAAAABAAO bWFudTIsMi41KzEuMTEsMiwyAAoJEDR2H/jnrUPSsUIQAJeCzIeF7FxfVLPKwAJv sYO9ZXh6FWfGwq+zzAzAXqlhJQWtoptqBFhmWtrGiAEUYFDMlEG2jO9t4zE9cQiR O+QVCX1qWxERY0X4gbrT0GEcHuZpB7eqDRpHqQ1edsZrrbjD0LJl2GwrR+juH3p+ J0H6qYNP0BP5I2Ox7pt3Wjw942RE8yV99ReJX15i7IseMtToK170J0yfLhV9EYdD ti/CzYvzqLndEhHRCVDrJhqRkUY7ffDrb/xir2FRqRmEnMw8Tyyy05eBccafoX4K bhb+cld/DtCZYR2BL2wyj6PVV6EYOjInchNDRa9T1txQ/yAd/s0yx2znesXtj2Kt xGn4A82oT4q84JtGyz4SCTvhAFMtle+23zmYHGgsJGjWLV2rAFLrTplZErqZWtCo UYNRzDvzksVnGSp05DeVmM1qZp8PZtfG/UlIfEYCbkkQVT8LZVb6/2BAzGdbmjMk LBI9lI95d17uCyxp9+1Pb1fls+XD25b0v1Qv6U5/YJPAwbyGAW3JtGsVhb0vhpdI hxTeJKlM1qq9voRoRWSDq+CSYGbNtQCvpjderejTY5otR9Ip1h+HAhTa8326QFmp OxOfwBf0ZcvmnxG4bIHDiySMdXLMSNzgAyGlZfcfI0rhEWazQktxJncKWn7D7VWP ojdLA9L7y+sXPTSIujFHYCZA =q1ya -----END PGP SIGNATURE----- --=-akERDsl+g92JaDyAMR+U--