* Re: Seeking advice on "monkey patching" a driver
@ 2021-07-01 20:03 ` Ian Pilcher
0 siblings, 0 replies; 16+ messages in thread
From: Ian Pilcher @ 2021-07-01 20:03 UTC (permalink / raw)
To: Greg KH; +Cc: linux-modules, kernelnewbies
On 7/1/21 12:59 PM, Greg KH wrote:
> Oh that's horrible, please no, do not do that :)
Indeed it is, but it works, and it meets my main objective, which is to
allow the use of distribution kernel packages and modules.
> How about a third option, the correct one:
> - submit your code changes upstream and they get merged into the
> main kernel tree and no monkeypatching is ever needed at all!
>
> Have you submitted your changes upstream to the existing drivers? What
> is preventing that from happening today?
There are a couple of reasons that I've never attempted to do this.
* Scope of work - Currently, there is simply no mechanism to call an LED
trigger from the ahci or libahci modules, presumably because this is
something that really ought to be done by the hardware. So I would
have to add some sort of generic framework to associate LED triggers
with AHCI ports.
I probably also don't really have the knowledge to do this. I am not
familiar with locking, memory management, etc. in the kernel. Just
because my "hack" works on a specific 2-core NAS doesn't mean that it
won't cause all sorts of breakage on a higher-performance system with
more parallelism.
* (Probable) lack of upstream interest - As I mentioned, disk activity
LEDs really ought to be handled by the hardware. I don't know of any
other system that suffers from this particular limitation. So this
is a very, very niche use case. (Most users of this hardware use the
manufacturer's "firmware".)
I did ask about this on the linux-ide mailing list long ago when I
first wrote the modules, but I don't think that I ever received a
response, which reinforces my belief that upstream isn't likely to be
receptive.
I've invested significant time in kernel patches in the past, only to
see them ultimately not be accepted, so I would need to know that
upstream was truly interested in such a feature before I would consider
making such a commitment.
--
========================================================================
In Soviet Russia, Google searches you!
========================================================================
^ permalink raw reply [flat|nested] 16+ messages in thread* Re: Seeking advice on "monkey patching" a driver
2021-07-01 20:03 ` Ian Pilcher
@ 2021-07-01 21:04 ` jim.cromie
-1 siblings, 0 replies; 16+ messages in thread
From: jim.cromie @ 2021-07-01 21:04 UTC (permalink / raw)
To: Ian Pilcher; +Cc: Greg KH, linux-modules, kernelnewbies
On Thu, Jul 1, 2021 at 2:03 PM Ian Pilcher <arequipeno@gmail.com> wrote:
>
> On 7/1/21 12:59 PM, Greg KH wrote:
> > Oh that's horrible, please no, do not do that :)
>
> Indeed it is, but it works, and it meets my main objective, which is to
> allow the use of distribution kernel packages and modules.
>
> > How about a third option, the correct one:
> > - submit your code changes upstream and they get merged into the
> > main kernel tree and no monkeypatching is ever needed at all!
> >
> > Have you submitted your changes upstream to the existing drivers? What
> > is preventing that from happening today?
>
> There are a couple of reasons that I've never attempted to do this.
>
> * Scope of work - Currently, there is simply no mechanism to call an LED
> * (Probable) lack of upstream interest - As I mentioned, disk activity
> LEDs really ought to be handled by the hardware.
Are LEDs really that important?
Unless theyre rigged intrinsically into the operation, it seems tertiary
I don't know of any
> other system that suffers from this particular limitation. So this
> is a very, very niche use case. (Most users of this hardware use the
> manufacturer's "firmware".)
>
> I did ask about this on the linux-ide mailing list long ago when I
> first wrote the modules, but I don't think that I ever received a
> response, which reinforces my belief that upstream isn't likely to be
> receptive.
>
theres a firehose of patches.
FWIW, now robots watch the list, and will grind your patches on lots
of configs. arches
> I've invested significant time in kernel patches in the past, only to
> see them ultimately not be accepted, so I would need to know that
> upstream was truly interested in such a feature before I would consider
> making such a commitment.
>
no guarantees, but there is staging. (here, more or less)
provisional home for code while quality develops
once youre in-tree, warts and all (to some extent, I dont know)
you may well get help (patches) improving it, surely lots of feedback.
elsewhere, nobody knows it exists.
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Seeking advice on "monkey patching" a driver
@ 2021-07-01 21:04 ` jim.cromie
0 siblings, 0 replies; 16+ messages in thread
From: jim.cromie @ 2021-07-01 21:04 UTC (permalink / raw)
To: Ian Pilcher; +Cc: Greg KH, linux-modules, kernelnewbies
On Thu, Jul 1, 2021 at 2:03 PM Ian Pilcher <arequipeno@gmail.com> wrote:
>
> On 7/1/21 12:59 PM, Greg KH wrote:
> > Oh that's horrible, please no, do not do that :)
>
> Indeed it is, but it works, and it meets my main objective, which is to
> allow the use of distribution kernel packages and modules.
>
> > How about a third option, the correct one:
> > - submit your code changes upstream and they get merged into the
> > main kernel tree and no monkeypatching is ever needed at all!
> >
> > Have you submitted your changes upstream to the existing drivers? What
> > is preventing that from happening today?
>
> There are a couple of reasons that I've never attempted to do this.
>
> * Scope of work - Currently, there is simply no mechanism to call an LED
> * (Probable) lack of upstream interest - As I mentioned, disk activity
> LEDs really ought to be handled by the hardware.
Are LEDs really that important?
Unless theyre rigged intrinsically into the operation, it seems tertiary
I don't know of any
> other system that suffers from this particular limitation. So this
> is a very, very niche use case. (Most users of this hardware use the
> manufacturer's "firmware".)
>
> I did ask about this on the linux-ide mailing list long ago when I
> first wrote the modules, but I don't think that I ever received a
> response, which reinforces my belief that upstream isn't likely to be
> receptive.
>
theres a firehose of patches.
FWIW, now robots watch the list, and will grind your patches on lots
of configs. arches
> I've invested significant time in kernel patches in the past, only to
> see them ultimately not be accepted, so I would need to know that
> upstream was truly interested in such a feature before I would consider
> making such a commitment.
>
no guarantees, but there is staging. (here, more or less)
provisional home for code while quality develops
once youre in-tree, warts and all (to some extent, I dont know)
you may well get help (patches) improving it, surely lots of feedback.
elsewhere, nobody knows it exists.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Seeking advice on "monkey patching" a driver
2021-07-01 20:03 ` Ian Pilcher
@ 2021-07-02 4:31 ` Greg KH
-1 siblings, 0 replies; 16+ messages in thread
From: Greg KH @ 2021-07-02 4:31 UTC (permalink / raw)
To: Ian Pilcher; +Cc: linux-modules, kernelnewbies
On Thu, Jul 01, 2021 at 03:03:12PM -0500, Ian Pilcher wrote:
> On 7/1/21 12:59 PM, Greg KH wrote:
> > Oh that's horrible, please no, do not do that :)
>
> Indeed it is, but it works, and it meets my main objective, which is to
> allow the use of distribution kernel packages and modules.
>
> > How about a third option, the correct one:
> > - submit your code changes upstream and they get merged into the
> > main kernel tree and no monkeypatching is ever needed at all!
> >
> > Have you submitted your changes upstream to the existing drivers? What
> > is preventing that from happening today?
>
> There are a couple of reasons that I've never attempted to do this.
>
> * Scope of work - Currently, there is simply no mechanism to call an LED
> trigger from the ahci or libahci modules, presumably because this is
> something that really ought to be done by the hardware. So I would
> have to add some sort of generic framework to associate LED triggers
> with AHCI ports.
>
> I probably also don't really have the knowledge to do this. I am not
> familiar with locking, memory management, etc. in the kernel. Just
> because my "hack" works on a specific 2-core NAS doesn't mean that it
> won't cause all sorts of breakage on a higher-performance system with
> more parallelism.
Why are ahci devices somehow "special" here? Just add a trigger to the
ahci core for LEDs and all should "just work". We've done that for many
subsystems already.
> * (Probable) lack of upstream interest - As I mentioned, disk activity
> LEDs really ought to be handled by the hardware. I don't know of any
> other system that suffers from this particular limitation. So this
> is a very, very niche use case. (Most users of this hardware use the
> manufacturer's "firmware".)
Are you sure we don't already have LED triggers for disk activity? Have
you tried the ledtrig-disk.c driver? It says it works on ATA devices,
no reason it can't also work for other device types.
> I did ask about this on the linux-ide mailing list long ago when I
> first wrote the modules, but I don't think that I ever received a
> response, which reinforces my belief that upstream isn't likely to be
> receptive.
>
> I've invested significant time in kernel patches in the past, only to
> see them ultimately not be accepted, so I would need to know that
> upstream was truly interested in such a feature before I would consider
> making such a commitment.
That's not fair, there is no way anyone can promise anyone that their
patches will be accepted, _before_ anyone sees them. What would _you_
do if you were in the kernel maintainer's position and read something
like this?
good luck!
greg k-h
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Seeking advice on "monkey patching" a driver
@ 2021-07-02 4:31 ` Greg KH
0 siblings, 0 replies; 16+ messages in thread
From: Greg KH @ 2021-07-02 4:31 UTC (permalink / raw)
To: Ian Pilcher; +Cc: linux-modules, kernelnewbies
On Thu, Jul 01, 2021 at 03:03:12PM -0500, Ian Pilcher wrote:
> On 7/1/21 12:59 PM, Greg KH wrote:
> > Oh that's horrible, please no, do not do that :)
>
> Indeed it is, but it works, and it meets my main objective, which is to
> allow the use of distribution kernel packages and modules.
>
> > How about a third option, the correct one:
> > - submit your code changes upstream and they get merged into the
> > main kernel tree and no monkeypatching is ever needed at all!
> >
> > Have you submitted your changes upstream to the existing drivers? What
> > is preventing that from happening today?
>
> There are a couple of reasons that I've never attempted to do this.
>
> * Scope of work - Currently, there is simply no mechanism to call an LED
> trigger from the ahci or libahci modules, presumably because this is
> something that really ought to be done by the hardware. So I would
> have to add some sort of generic framework to associate LED triggers
> with AHCI ports.
>
> I probably also don't really have the knowledge to do this. I am not
> familiar with locking, memory management, etc. in the kernel. Just
> because my "hack" works on a specific 2-core NAS doesn't mean that it
> won't cause all sorts of breakage on a higher-performance system with
> more parallelism.
Why are ahci devices somehow "special" here? Just add a trigger to the
ahci core for LEDs and all should "just work". We've done that for many
subsystems already.
> * (Probable) lack of upstream interest - As I mentioned, disk activity
> LEDs really ought to be handled by the hardware. I don't know of any
> other system that suffers from this particular limitation. So this
> is a very, very niche use case. (Most users of this hardware use the
> manufacturer's "firmware".)
Are you sure we don't already have LED triggers for disk activity? Have
you tried the ledtrig-disk.c driver? It says it works on ATA devices,
no reason it can't also work for other device types.
> I did ask about this on the linux-ide mailing list long ago when I
> first wrote the modules, but I don't think that I ever received a
> response, which reinforces my belief that upstream isn't likely to be
> receptive.
>
> I've invested significant time in kernel patches in the past, only to
> see them ultimately not be accepted, so I would need to know that
> upstream was truly interested in such a feature before I would consider
> making such a commitment.
That's not fair, there is no way anyone can promise anyone that their
patches will be accepted, _before_ anyone sees them. What would _you_
do if you were in the kernel maintainer's position and read something
like this?
good luck!
greg k-h
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Seeking advice on "monkey patching" a driver
2021-07-02 4:31 ` Greg KH
@ 2021-07-02 12:05 ` Ian Pilcher
-1 siblings, 0 replies; 16+ messages in thread
From: Ian Pilcher @ 2021-07-02 12:05 UTC (permalink / raw)
To: Greg KH; +Cc: linux-modules, kernelnewbies
On 7/1/21 11:31 PM, Greg KH wrote:
> Why are ahci devices somehow "special" here? Just add a trigger to the
> ahci core for LEDs and all should "just work". We've done that for many
> subsystems already.
It's more complicated than that, as it would need to be a separate
trigger for each drive (ATA port).
> Are you sure we don't already have LED triggers for disk activity? Have
> you tried the ledtrig-disk.c driver? It says it works on ATA devices,
> no reason it can't also work for other device types.
I stumbled on that file myself last night. I either wasn't aware of it
before, or I had forgotten its existence, possibly because it's disabled
(CONFIG_LEDS_TRIGGER_DISK=n). As mentioned above, I would be looking to
enable "per port" LEDs, so it doesn't work in its current form. It does
at least give me hope that enhancements might be accepted upstream.
>> I've invested significant time in kernel patches in the past, only to
>> see them ultimately not be accepted, so I would need to know that
>> upstream was truly interested in such a feature before I would consider
>> making such a commitment.
>
> That's not fair, there is no way anyone can promise anyone that their
> patches will be accepted, _before_ anyone sees them. What would _you_
> do if you were in the kernel maintainer's position and read something
> like this?
You're right, but that isn't what I intended to say. Basically, I can't
afford to invest the time in implementing something if the subsystem
maintainers have no interest in the *functionality*, regardless of the
state of the code. I.e., if the ATA/LED subsystem maintainers think
that software-controlled disk activity LEDs are stupid and have no
place in the kernel, then code quality is irrelevant, and anything I do
will be a waste of time.
> good luck!
Thanks!
--
========================================================================
In Soviet Russia, Google searches you!
========================================================================
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
^ permalink raw reply [flat|nested] 16+ messages in thread* Re: Seeking advice on "monkey patching" a driver
@ 2021-07-02 12:05 ` Ian Pilcher
0 siblings, 0 replies; 16+ messages in thread
From: Ian Pilcher @ 2021-07-02 12:05 UTC (permalink / raw)
To: Greg KH; +Cc: linux-modules, kernelnewbies
On 7/1/21 11:31 PM, Greg KH wrote:
> Why are ahci devices somehow "special" here? Just add a trigger to the
> ahci core for LEDs and all should "just work". We've done that for many
> subsystems already.
It's more complicated than that, as it would need to be a separate
trigger for each drive (ATA port).
> Are you sure we don't already have LED triggers for disk activity? Have
> you tried the ledtrig-disk.c driver? It says it works on ATA devices,
> no reason it can't also work for other device types.
I stumbled on that file myself last night. I either wasn't aware of it
before, or I had forgotten its existence, possibly because it's disabled
(CONFIG_LEDS_TRIGGER_DISK=n). As mentioned above, I would be looking to
enable "per port" LEDs, so it doesn't work in its current form. It does
at least give me hope that enhancements might be accepted upstream.
>> I've invested significant time in kernel patches in the past, only to
>> see them ultimately not be accepted, so I would need to know that
>> upstream was truly interested in such a feature before I would consider
>> making such a commitment.
>
> That's not fair, there is no way anyone can promise anyone that their
> patches will be accepted, _before_ anyone sees them. What would _you_
> do if you were in the kernel maintainer's position and read something
> like this?
You're right, but that isn't what I intended to say. Basically, I can't
afford to invest the time in implementing something if the subsystem
maintainers have no interest in the *functionality*, regardless of the
state of the code. I.e., if the ATA/LED subsystem maintainers think
that software-controlled disk activity LEDs are stupid and have no
place in the kernel, then code quality is irrelevant, and anything I do
will be a waste of time.
> good luck!
Thanks!
--
========================================================================
In Soviet Russia, Google searches you!
========================================================================
^ permalink raw reply [flat|nested] 16+ messages in thread* Re: Seeking advice on "monkey patching" a driver
2021-07-02 12:05 ` Ian Pilcher
@ 2021-07-02 12:20 ` Greg KH
-1 siblings, 0 replies; 16+ messages in thread
From: Greg KH @ 2021-07-02 12:20 UTC (permalink / raw)
To: Ian Pilcher; +Cc: linux-modules, kernelnewbies
On Fri, Jul 02, 2021 at 07:05:26AM -0500, Ian Pilcher wrote:
> > > I've invested significant time in kernel patches in the past, only to
> > > see them ultimately not be accepted, so I would need to know that
> > > upstream was truly interested in such a feature before I would consider
> > > making such a commitment.
> >
> > That's not fair, there is no way anyone can promise anyone that their
> > patches will be accepted, _before_ anyone sees them. What would _you_
> > do if you were in the kernel maintainer's position and read something
> > like this?
>
> You're right, but that isn't what I intended to say. Basically, I can't
> afford to invest the time in implementing something if the subsystem
> maintainers have no interest in the *functionality*, regardless of the
> state of the code. I.e., if the ATA/LED subsystem maintainers think
> that software-controlled disk activity LEDs are stupid and have no
> place in the kernel, then code quality is irrelevant, and anything I do
> will be a waste of time.
Again, without a real patch, no maintainer or developer will ever say if
they will, or will not, accept such a thing. That's just not how kernel
development works. Working patches are what is discussed as that proves
that at least, the idea works.
thanks,
greg k-h
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Seeking advice on "monkey patching" a driver
@ 2021-07-02 12:20 ` Greg KH
0 siblings, 0 replies; 16+ messages in thread
From: Greg KH @ 2021-07-02 12:20 UTC (permalink / raw)
To: Ian Pilcher; +Cc: linux-modules, kernelnewbies
On Fri, Jul 02, 2021 at 07:05:26AM -0500, Ian Pilcher wrote:
> > > I've invested significant time in kernel patches in the past, only to
> > > see them ultimately not be accepted, so I would need to know that
> > > upstream was truly interested in such a feature before I would consider
> > > making such a commitment.
> >
> > That's not fair, there is no way anyone can promise anyone that their
> > patches will be accepted, _before_ anyone sees them. What would _you_
> > do if you were in the kernel maintainer's position and read something
> > like this?
>
> You're right, but that isn't what I intended to say. Basically, I can't
> afford to invest the time in implementing something if the subsystem
> maintainers have no interest in the *functionality*, regardless of the
> state of the code. I.e., if the ATA/LED subsystem maintainers think
> that software-controlled disk activity LEDs are stupid and have no
> place in the kernel, then code quality is irrelevant, and anything I do
> will be a waste of time.
Again, without a real patch, no maintainer or developer will ever say if
they will, or will not, accept such a thing. That's just not how kernel
development works. Working patches are what is discussed as that proves
that at least, the idea works.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Seeking advice on "monkey patching" a driver
2021-07-02 12:20 ` Greg KH
@ 2021-07-02 15:16 ` Ian Pilcher
-1 siblings, 0 replies; 16+ messages in thread
From: Ian Pilcher @ 2021-07-02 15:16 UTC (permalink / raw)
To: Greg KH; +Cc: linux-modules, kernelnewbies
On 7/2/21 7:20 AM, Greg KH wrote:
> Again, without a real patch, no maintainer or developer will ever say if
> they will, or will not, accept such a thing. That's just not how kernel
> development works. Working patches are what is discussed as that proves
> that at least, the idea works.
And that's certainly their prerogative. You asked why I hadn't
attempted to submit changes upstream to address my issue, and I provided
my reasons for not doing so.
After several experiences where I've invested a significant (to me)
amount of time, only to ultimately be told that the functionality that I
implemented really wasn't desired, I'm very reluctant to repeat that
experience (and I honestly don't think that's particularly selfish or
unreasonable).
This doesn't mean that I absolutely won't make an attempt to do this.
As I mentioned in my previous note, the existence of ledtrig-disk.c
gives me some hope that changes might be accepted.
I'll just have to see ...
--
========================================================================
In Soviet Russia, Google searches you!
========================================================================
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
^ permalink raw reply [flat|nested] 16+ messages in thread* Re: Seeking advice on "monkey patching" a driver
@ 2021-07-02 15:16 ` Ian Pilcher
0 siblings, 0 replies; 16+ messages in thread
From: Ian Pilcher @ 2021-07-02 15:16 UTC (permalink / raw)
To: Greg KH; +Cc: linux-modules, kernelnewbies
On 7/2/21 7:20 AM, Greg KH wrote:
> Again, without a real patch, no maintainer or developer will ever say if
> they will, or will not, accept such a thing. That's just not how kernel
> development works. Working patches are what is discussed as that proves
> that at least, the idea works.
And that's certainly their prerogative. You asked why I hadn't
attempted to submit changes upstream to address my issue, and I provided
my reasons for not doing so.
After several experiences where I've invested a significant (to me)
amount of time, only to ultimately be told that the functionality that I
implemented really wasn't desired, I'm very reluctant to repeat that
experience (and I honestly don't think that's particularly selfish or
unreasonable).
This doesn't mean that I absolutely won't make an attempt to do this.
As I mentioned in my previous note, the existence of ledtrig-disk.c
gives me some hope that changes might be accepted.
I'll just have to see ...
--
========================================================================
In Soviet Russia, Google searches you!
========================================================================
^ permalink raw reply [flat|nested] 16+ messages in thread