Bug 238138 - [PATCH] acpi_dock(4): Notify devd(8) on dock status change
Summary: [PATCH] acpi_dock(4): Notify devd(8) on dock status change
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Mark Johnston
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2019-05-26 12:09 UTC by Muhammad Kaisar Arkhan
Modified: 2019-06-17 15:16 UTC (History)
3 users (show)

See Also:


Attachments
acpi_dock(4): Notify devd(8) on dock status change patch (2.19 KB, patch)
2019-05-26 12:09 UTC, Muhammad Kaisar Arkhan
no flags Details | Diff
devd.conf(5): Document the Dock subsystem patch (646 bytes, patch)
2019-05-26 16:18 UTC, Muhammad Kaisar Arkhan
no flags Details | Diff
acpi_dock(4): Notify devd(8) on dock status change (2.40 KB, patch)
2019-05-31 11:14 UTC, Muhammad Kaisar Arkhan
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Muhammad Kaisar Arkhan 2019-05-26 12:09:17 UTC
Created attachment 204618 [details]
acpi_dock(4): Notify devd(8) on dock status change patch

If devd(8) is running, it notifies devd(8) when the computer is docked and
undocked.

Original patch taken from:
https://people.freebsd.org/~iwasaki/acpi/acpi_dock_devd-20080204.diff

Tested personally on my Thinkpad X220 with Ultrabase Docking station.

Are there any other changes required?

Thanks.
Comment 1 Conrad Meyer freebsd_committer freebsd_triage 2019-05-26 15:47:58 UTC
Looks unobjectionable to me.
Comment 2 Mark Johnston freebsd_committer freebsd_triage 2019-05-26 15:54:07 UTC
It would be nice to document this in devd.conf(5).
Comment 3 Muhammad Kaisar Arkhan 2019-05-26 16:18:17 UTC
Created attachment 204619 [details]
devd.conf(5): Document the Dock subsystem patch

Hi, I've added another patch to document it in devd.conf(5). Thanks.
Comment 4 Mark Johnston freebsd_committer freebsd_triage 2019-05-27 18:57:17 UTC
(In reply to Muhammad Kaisar Arkhan from comment #3)
Thanks.  I applied the patches to my tree.  A couple more comments:
- Please use tabs for indentation next time.  The style(9) man page documents the kernel coding style.  Admittedly, some of the ACPI code does not follow it very well.
- Why do you check for a running devd?  Other ACPI subsystems don't bother.  The event message is non-blocking and we will simply free the message if devd isn't running.  We save some unnecessary work by checking first, but I'd rather be consistent with the rest of the kernel unless there's a good reason here.
Comment 5 Muhammad Kaisar Arkhan 2019-05-31 11:14:47 UTC
Created attachment 204738 [details]
acpi_dock(4): Notify devd(8) on dock status change

I've merged both patches into one and applied your suggestions. Thanks :)
Comment 6 commit-hook freebsd_committer freebsd_triage 2019-05-31 15:45:33 UTC
A commit references this bug:

Author: markj
Date: Fri May 31 15:44:34 UTC 2019
New revision: 348459
URL: https://svnweb.freebsd.org/changeset/base/348459

Log:
  acpi_dock(4): Notify devd(8) on dock status change.

  PR:		238138
  Submitted by:	Muhammad Kaisar Arkhan <hi@yukiisbo.red>
  MFC after:	2 weeks

Changes:
  head/sbin/devd/devd.conf.5
  head/sys/dev/acpica/acpi_dock.c
Comment 7 commit-hook freebsd_committer freebsd_triage 2019-06-17 15:12:36 UTC
A commit references this bug:

Author: markj
Date: Mon Jun 17 15:11:55 UTC 2019
New revision: 349140
URL: https://svnweb.freebsd.org/changeset/base/349140

Log:
  MFC r348459:
  acpi_dock(4): Notify devd(8) on dock status change.

  PR:	238138

Changes:
_U  stable/12/
  stable/12/sbin/devd/devd.conf.5
  stable/12/sys/dev/acpica/acpi_dock.c
Comment 8 Mark Johnston freebsd_committer freebsd_triage 2019-06-17 15:16:25 UTC
Thanks for the patch.