All of lore.kernel.org
 help / color / mirror / Atom feed
* How to Convert Legacy Kernel Modules for modern Kernels
@ 2022-01-20 10:10 Tianrui Wei
  2022-01-21  7:51 ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Tianrui Wei @ 2022-01-20 10:10 UTC (permalink / raw)
  To: kernelnewbies


[-- Attachment #1.1: Type: text/plain, Size: 591 bytes --]

Hi,

I was wondering if there're any tools/scripts in Linux that'd help me to convert legacy kernel modules for using on a modern Linux (Kernel > 5.0) system?

If there're not out of box solutions, is there a way I could view the API changes in every subsystem clearly? For example, this particular commit[^1] shows the second return argument is being removed from ki_complete, and it took a lot of fishing down the lkml to do. Perhaps there is a simpler way?

Best Regards,
Tianrui

[1]: https://github.com/tianrui-wei/dma_ip_drivers/commit/bc9207f9756d69a438ce03bfa6b97b6e0a5c5b3e

[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 866 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

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

* Re: How to Convert Legacy Kernel Modules for modern Kernels
  2022-01-20 10:10 How to Convert Legacy Kernel Modules for modern Kernels Tianrui Wei
@ 2022-01-21  7:51 ` Greg KH
  2022-01-21  8:21   ` Tianrui Wei
  0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2022-01-21  7:51 UTC (permalink / raw)
  To: Tianrui Wei; +Cc: kernelnewbies

On Thu, Jan 20, 2022 at 06:10:31PM +0800, Tianrui Wei wrote:
> Hi,
> 
> I was wondering if there're any tools/scripts in Linux that'd help me
> to convert legacy kernel modules for using on a modern Linux (Kernel >
> 5.0) system?

It depends on the driver you wish to convert.  For wireless drivers,
there was the "linux backport project" that provided scripts and tools
to do this type of work.  For other subsystems, I do not think anyone
ever did so as it's both not that hard, and also very specific to the
code that you are trying to convert.

> If there're not out of box solutions, is there a way I could view the
> API changes in every subsystem clearly? For example, this particular
> commit[^1] shows the second return argument is being removed from
> ki_complete, and it took a lot of fishing down the lkml to do. Perhaps
> there is a simpler way?

Use git itself to track the changes in apis.  You can see all changes to
a .h file by doing:
	git log -p path/to/file
and then see where the api got changed.

It usually isn't that difficult to forward port a driver, but it all
depends on the age of the code, and what it actually does.  Do you have
a link to the code you wish to drag forward?  You can also always add it
to the in-kernel drivers/staging/ area and have others help out with
this effort.

good luck!

greg k-h

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

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

* Re: How to Convert Legacy Kernel Modules for modern Kernels
  2022-01-21  7:51 ` Greg KH
@ 2022-01-21  8:21   ` Tianrui Wei
  2022-01-21  8:53     ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Tianrui Wei @ 2022-01-21  8:21 UTC (permalink / raw)
  To: Greg KH; +Cc: kernelnewbies


[-- Attachment #1.1: Type: text/plain, Size: 2297 bytes --]

Hi Greg,

On 21 Jan 2022, at 15:51, Greg KH wrote:

> On Thu, Jan 20, 2022 at 06:10:31PM +0800, Tianrui Wei wrote:
>> Hi,
>>
>> I was wondering if there're any tools/scripts in Linux that'd help me
>> to convert legacy kernel modules for using on a modern Linux (Kernel >
>> 5.0) system?
>
> It depends on the driver you wish to convert.  For wireless drivers,
> there was the "linux backport project" that provided scripts and tools
> to do this type of work.  For other subsystems, I do not think anyone
> ever did so as it's both not that hard, and also very specific to the
> code that you are trying to convert.

Thanks for telling me about the Linux back port project. It does seem very interesting.

>
>> If there're not out of box solutions, is there a way I could view the
>> API changes in every subsystem clearly? For example, this particular
>> commit[^1] shows the second return argument is being removed from
>> ki_complete, and it took a lot of fishing down the lkml to do. Perhaps
>> there is a simpler way?
>
> Use git itself to track the changes in apis.  You can see all changes to
> a .h file by doing:
>     git log -p path/to/file
> and then see where the api got changed.

This is a really good suggestion, and it's also the way I approach recent kernel modules. However some specifically ancient kernel modules is rather difficult to use this approach.

>
> It usually isn't that difficult to forward port a driver, but it all
> depends on the age of the code, and what it actually does.  Do you have
> a link to the code you wish to drag forward?

The specific driver I had in mind is a PCIE driver for a Xilinx IP block. It's under https://www.xilinx.com/products/boards-and-kits/ek-k7-kc705-g.html#resources in a zip folder called rdf0281-kc705-base-trd-2014-3.zip. Everyone with a xilinx account could download the folder. Unfortunately its header claims it contains confidential information from Xilinx, as such I'm a bit wary to post it online.

> You can also always add it to the in-kernel drivers/staging/ area and have others help out with this effort.

Thanks for giving me information about the drivers/staging area! I'll try to upstream my future work there.

>
> good luck!
>
> greg k-h

Best Regards,
Tianrui

[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 866 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

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

* Re: How to Convert Legacy Kernel Modules for modern Kernels
  2022-01-21  8:21   ` Tianrui Wei
@ 2022-01-21  8:53     ` Greg KH
  2022-01-21  9:32       ` Tianrui Wei
  0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2022-01-21  8:53 UTC (permalink / raw)
  To: Tianrui Wei; +Cc: kernelnewbies

On Fri, Jan 21, 2022 at 04:21:18PM +0800, Tianrui Wei wrote:
> >> If there're not out of box solutions, is there a way I could view the
> >> API changes in every subsystem clearly? For example, this particular
> >> commit[^1] shows the second return argument is being removed from
> >> ki_complete, and it took a lot of fishing down the lkml to do. Perhaps
> >> there is a simpler way?
> >
> > Use git itself to track the changes in apis.  You can see all changes to
> > a .h file by doing:
> >     git log -p path/to/file
> > and then see where the api got changed.
> 
> This is a really good suggestion, and it's also the way I approach
> recent kernel modules. However some specifically ancient kernel
> modules is rather difficult to use this approach.

We have git history going back to Linux 0.1 so this should work.  If
not, then do the normal 'does it build' test.  APIs are almost always
changed in ways that break the build.

> > It usually isn't that difficult to forward port a driver, but it all
> > depends on the age of the code, and what it actually does.  Do you have
> > a link to the code you wish to drag forward?
> 
> The specific driver I had in mind is a PCIE driver for a Xilinx IP
> block. It's under
> https://www.xilinx.com/products/boards-and-kits/ek-k7-kc705-g.html#resources
> in a zip folder called rdf0281-kc705-base-trd-2014-3.zip. Everyone
> with a xilinx account could download the folder. Unfortunately its
> header claims it contains confidential information from Xilinx, as
> such I'm a bit wary to post it online.

Please get support from xilix for stuff like this.  You are paying for
it from them, so please take advantage of it.  Especially if they claim
that their code is not GPLv2 compatible, you want them to take that
legal risk, not you :)

greg k-h

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

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

* Re: How to Convert Legacy Kernel Modules for modern Kernels
  2022-01-21  8:53     ` Greg KH
@ 2022-01-21  9:32       ` Tianrui Wei
  0 siblings, 0 replies; 5+ messages in thread
From: Tianrui Wei @ 2022-01-21  9:32 UTC (permalink / raw)
  To: Greg KH; +Cc: kernelnewbies

On 21 Jan 2022, at 16:53, Greg KH wrote:

> On Fri, Jan 21, 2022 at 04:21:18PM +0800, Tianrui Wei wrote:
>>>> If there're not out of box solutions, is there a way I could view the
>>>> API changes in every subsystem clearly? For example, this particular
>>>> commit[^1] shows the second return argument is being removed from
>>>> ki_complete, and it took a lot of fishing down the lkml to do. Perhaps
>>>> there is a simpler way?
>>>
>>> Use git itself to track the changes in apis.  You can see all changes to
>>> a .h file by doing:
>>>     git log -p path/to/file
>>> and then see where the api got changed.
>>
>> This is a really good suggestion, and it's also the way I approach
>> recent kernel modules. However some specifically ancient kernel
>> modules is rather difficult to use this approach.
>
> We have git history going back to Linux 0.1 so this should work.  If
> not, then do the normal 'does it build' test.  APIs are almost always
> changed in ways that break the build.

Thanks for the suggestion, I'll bear it in mind.

>
>>> It usually isn't that difficult to forward port a driver, but it all
>>> depends on the age of the code, and what it actually does.  Do you have
>>> a link to the code you wish to drag forward?
>>
>> The specific driver I had in mind is a PCIE driver for a Xilinx IP
>> block. It's under
>> https://www.xilinx.com/products/boards-and-kits/ek-k7-kc705-g.html#resources
>> in a zip folder called rdf0281-kc705-base-trd-2014-3.zip. Everyone
>> with a xilinx account could download the folder. Unfortunately its
>> header claims it contains confidential information from Xilinx, as
>> such I'm a bit wary to post it online.
>
> Please get support from xilix for stuff like this.  You are paying for
> it from them, so please take advantage of it.  Especially if they claim
> that their code is not GPLv2 compatible, you want them to take that
> legal risk, not you :)

Thanks! That makes a lot of sense.

>
> greg k-h

Best Regards,
Tianrui

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

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

end of thread, other threads:[~2022-01-21  9:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-20 10:10 How to Convert Legacy Kernel Modules for modern Kernels Tianrui Wei
2022-01-21  7:51 ` Greg KH
2022-01-21  8:21   ` Tianrui Wei
2022-01-21  8:53     ` Greg KH
2022-01-21  9:32       ` Tianrui Wei

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.