Add Apple M1 support to PASemi i2c driver

18 messages, 6 authors, 2021-10-09 · open the first message on its own page

Add Apple M1 support to PASemi i2c driver

From: Christian Zigotzky <hidden>
Date: 2021-09-26 14:57:02

Hi Sven,

Thanks a lot for your nice explanation of the history of the PASemi i2c 
driver.

We are using Nemo boards with 64-bit dual-core PWRficient PA6T-1682M 
CPUs (A-EON AmigaOne X1000). [1]

The RC2 of kernel 5.15 works without any problems on our Nemo boards. [2]

Could you please post all your patches merged in one patch? It's easier 
for me to apply one patch.

Thanks,
Christian

[1] https://en.wikipedia.org/wiki/AmigaOne_X1000
[2] https://forum.hyperion-entertainment.com/viewtopic.php?p=54056#p54056

Re: Add Apple M1 support to PASemi i2c driver

From: Christian Zigotzky <hidden>
Date: 2021-09-26 20:28:41

Hi Sven,

I can't apply your patch 5 (i2c: pasemi: Split pci driver to its own 
file). [1]

Error message:

patching file b/drivers/i2c/busses/i2c-pasemi-core.c (renamed from 
a/drivers/i2c/busses/i2c-pasemi.c)
Hunk #3 FAILED at 344.
1 out of 3 hunks FAILED -- saving rejects to file 
b/drivers/i2c/busses/i2c-pasemi-core.c.rej
patching file b/drivers/i2c/busses/i2c-pasemi-core.h
patching file b/drivers/i2c/busses/i2c-pasemi-pci.c

Please post one patch with all your modifications.

Thanks,
Christian

[1] 
https://lists.ozlabs.org/pipermail/linuxppc-dev/2021-September/234636.html


On 26 September 2021 at 04:55 pm, Christian Zigotzky wrote:
Hi Sven,

Thanks a lot for your nice explanation of the history of the PASemi 
i2c driver.

We are using Nemo boards with 64-bit dual-core PWRficient PA6T-1682M 
CPUs (A-EON AmigaOne X1000). [1]

The RC2 of kernel 5.15 works without any problems on our Nemo boards. [2]

Could you please post all your patches merged in one patch? It's 
easier for me to apply one patch.

Thanks,
Christian

[1] https://en.wikipedia.org/wiki/AmigaOne_X1000
[2] https://forum.hyperion-entertainment.com/viewtopic.php?p=54056#p54056

Re: Add Apple M1 support to PASemi i2c driver

From: Sven Peter <hidden>
Date: 2021-09-27 05:40:09

Hi Christian,

Thanks already for volunteering to test this!

On Sun, Sep 26, 2021, at 22:27, Christian Zigotzky wrote:
Hi Sven,

I can't apply your patch 5 (i2c: pasemi: Split pci driver to its own 
file). [1]
That's strange because it should apply cleanly. I'll double check
after to work today to see if I messed up while sending this.
Error message:

patching file b/drivers/i2c/busses/i2c-pasemi-core.c (renamed from 
a/drivers/i2c/busses/i2c-pasemi.c)
Hunk #3 FAILED at 344.
1 out of 3 hunks FAILED -- saving rejects to file 
b/drivers/i2c/busses/i2c-pasemi-core.c.rej
patching file b/drivers/i2c/busses/i2c-pasemi-core.h
patching file b/drivers/i2c/busses/i2c-pasemi-pci.c

Please post one patch with all your modifications.
Sure, will do that later as well!


Best,


Sven

Re: Add Apple M1 support to PASemi i2c driver

From: Wolfram Sang <wsa@kernel.org>
Date: 2021-09-27 07:07:40

Sure, will do that later as well!
But please do it privately. For upstreaming, the patch series you sent
is way better than a single patch.

Re: Add Apple M1 support to PASemi i2c driver

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2021-09-27 08:03:57

Wolfram Sang [off-list ref] writes:
quoted
Sure, will do that later as well!
But please do it privately. For upstreaming, the patch series you sent
is way better than a single patch.
Christian, the whole series is downloadable as a single mbox here:

https://patchwork.ozlabs.org/series/264134/mbox/

Save that to a file and apply with `git am`.

eg:

 $ wget -O mbox https://patchwork.ozlabs.org/series/264134/mbox/
 $ git am mbox

It applies cleanly on v5.15-rc3.

cheers

Re: Add Apple M1 support to PASemi i2c driver

From: Christian Zigotzky <hidden>
Date: 2021-09-27 14:47:48

On 27 September 2021 at 09:58 am, Michael Ellerman wrote:
Wolfram Sang [off-list ref] writes:
quoted
quoted
Sure, will do that later as well!
But please do it privately. For upstreaming, the patch series you sent
is way better than a single patch.
Christian, the whole series is downloadable as a single mbox here:

https://patchwork.ozlabs.org/series/264134/mbox/

Save that to a file and apply with `git am`.

eg:

  $ wget -O mbox https://patchwork.ozlabs.org/series/264134/mbox/
  $ git am mbox

It applies cleanly on v5.15-rc3.

cheers
I was able to patch it with the instructions above. Thanks! I will 
compile and test the RC3 as soon as possible.

-- Christian

Re: Add Apple M1 support to PASemi i2c driver

From: Christian Zigotzky <hidden>
Date: 2021-10-01 04:48:34

On 27 September 2021 at 07:39 am, Sven Peter wrote:
 > Hi Christian,
 >
 > Thanks already for volunteering to test this!
 >
Hello Sven,

Damian (Hypex) has successfully tested the RC3 of kernel 5.15 with your 
modified i2c driver on his Nemo board yesterday. [1]

@Darren
Could you also please check Sven's i2c modifications? He has also 
modified your source code a little bit. [2]

@Olof
Are these i2c modifications OK? Do these work on your P.A. Semi board?

Thanks,
Christian

[1] https://forum.hyperion-entertainment.com/viewtopic.php?p=54098#p54098
[2] https://lists.ozlabs.org/pipermail/linuxppc-dev/2017-January/153195.html
[3] Further information about the Nemo board: 
https://en.wikipedia.org/wiki/AmigaOne_X1000
[4] Kernel patches for the Nemo board: 
https://lists.ozlabs.org/pipermail/linuxppc-dev/2018-January/167288.html

Re: Add Apple M1 support to PASemi i2c driver

From: Christian Zigotzky <hidden>
Date: 2021-10-01 05:50:36

Typo: Damian

Correct: Damien

On 01 October 2021 at 06:47 am, Christian Zigotzky wrote:
On 27 September 2021 at 07:39 am, Sven Peter wrote:
quoted
Hi Christian,

Thanks already for volunteering to test this!
Hello Sven,

Damian (Hypex) has successfully tested the RC3 of kernel 5.15 with 
your modified i2c driver on his Nemo board yesterday. [1]

@Darren
Could you also please check Sven's i2c modifications? He has also 
modified your source code a little bit. [2]

@Olof
Are these i2c modifications OK? Do these work on your P.A. Semi board?

Thanks,
Christian

[1] https://forum.hyperion-entertainment.com/viewtopic.php?p=54098#p54098
[2] 
https://lists.ozlabs.org/pipermail/linuxppc-dev/2017-January/153195.html
[3] Further information about the Nemo board: 
https://en.wikipedia.org/wiki/AmigaOne_X1000
[4] Kernel patches for the Nemo board: 
https://lists.ozlabs.org/pipermail/linuxppc-dev/2018-January/167288.html

Re: Add Apple M1 support to PASemi i2c driver

From: Sven Peter <hidden>
Date: 2021-10-03 14:36:54

Hi,


On Fri, Oct 1, 2021, at 06:47, Christian Zigotzky wrote:
On 27 September 2021 at 07:39 am, Sven Peter wrote:
 > Hi Christian,
 >
 > Thanks already for volunteering to test this!
 >
Hello Sven,

Damian (Hypex) has successfully tested the RC3 of kernel 5.15 with your 
modified i2c driver on his Nemo board yesterday. [1]
Thanks a lot, that's great to hear!
If he wants to I can credit him with a Tested-by tag in the commit message,
see e.g. https://www.kernel.org/doc/html/latest/process/submitting-patches.html#using-reported-by-tested-by-reviewed-by-suggested-by-and-fixes.


Best,


Sven

Re: Add Apple M1 support to PASemi i2c driver

From: Christian Zigotzky <hidden>
Date: 2021-10-03 15:48:23

On 03 October 2021 at 04:36 pm, Sven Peter wrote:
 > Hi,
 >
 >
 > On Fri, Oct 1, 2021, at 06:47, Christian Zigotzky wrote:
 >> On 27 September 2021 at 07:39 am, Sven Peter wrote:
 >>  > Hi Christian,
 >>  >
 >>  > Thanks already for volunteering to test this!
 >>  >
 >> Hello Sven,
 >>
 >> Damian (Hypex) has successfully tested the RC3 of kernel 5.15 with your
 >> modified i2c driver on his Nemo board yesterday. [1]
 >
 > Thanks a lot, that's great to hear!
 > If he wants to I can credit him with a Tested-by tag in the commit 
message,
 > see e.g. 
https://www.kernel.org/doc/html/latest/process/submitting-patches.html#using-reported-by-tested-by-reviewed-by-suggested-by-and-fixes.
 >
 >
 > Best,
 >
 >
 > Sven

Hello Sven,

We are still testing your i2c modifications. [1]
Please wait a litte bit till we finished our tests.

@Darren
Could you also please check Sven's i2c modifications? He has also 
modified your source code a little bit. [2]

@Olof
Are these i2c modifications OK? Do these work on your P.A. Semi board?

Thanks,
Christian

[1] https://forum.hyperion-entertainment.com/viewtopic.php?p=54138#p54138
[2] https://lists.ozlabs.org/pipermail/linuxppc-dev/2017-January/153195.html

Re: Add Apple M1 support to PASemi i2c driver

From: Christian Zigotzky <hidden>
Date: 2021-10-04 09:49:27

Hi Sven,

Unfortunately Damien has found an issue. [1]

Output of i2cdetect -l with the default RC3 of kernel 5.15 without your modifications:

2c-0	i2c       	Radeon i2c bit bus 0x90         	I2C adapter
i2c-1	i2c       	Radeon i2c bit bus 0x91         	I2C adapter
i2c-2	i2c       	Radeon i2c bit bus 0x92         	I2C adapter
i2c-3	i2c       	Radeon i2c bit bus 0x93         	I2C adapter
i2c-4	i2c       	Radeon i2c bit bus 0x94         	I2C adapter
i2c-5	i2c       	Radeon i2c bit bus 0x95         	I2C adapter
i2c-6	i2c       	Radeon i2c bit bus 0x96         	I2C adapter
i2c-7	i2c       	Radeon i2c bit bus 0x97         	I2C adapter
i2c-8	i2c       	PA Semi SMBus adapter at 0x800200	I2C adapter
i2c-9	i2c       	PA Semi SMBus adapter at 0x800240	I2C adapter
i2c-10	i2c       	PA Semi SMBus adapter at 0x800280	I2C adapter

Output of i2cdetect -l with your modifications:

i2c-0	i2c       	Radeon i2c bit bus 0x90         	I2C adapter
i2c-1	i2c       	Radeon i2c bit bus 0x91         	I2C adapter
i2c-2	i2c       	Radeon i2c bit bus 0x92         	I2C adapter
i2c-3	i2c       	Radeon i2c bit bus 0x93         	I2C adapter
i2c-4	i2c       	Radeon i2c bit bus 0x94         	I2C adapter
i2c-5	i2c       	Radeon i2c bit bus 0x95         	I2C adapter
i2c-6	i2c       	Radeon i2c bit bus 0x96         	I2C adapter
i2c-7	i2c       	Radeon i2c bit bus 0x97         	I2C adapter
i2c-8	i2c       	PA Semi SMBus adapter at 0x(____ptrval____)	I2C adapter
i2c-9	i2c       	PA Semi SMBus adapter at 0x(____ptrval____)	I2C adapter
i2c-10	i2c       	PA Semi SMBus adapter at 0x(____ptrval____)	I2C adapter

Please check the outputs.

Thanks,
Christian

[1] https://forum.hyperion-entertainment.com/viewtopic.php?p=54165#p54165

Re: Add Apple M1 support to PASemi i2c driver

From: Wolfram Sang <wsa@kernel.org>
Date: 2021-10-04 09:55:19

i2c-8	i2c       	PA Semi SMBus adapter at 0x(____ptrval____)	I2C adapter
i2c-9	i2c       	PA Semi SMBus adapter at 0x(____ptrval____)	I2C adapter
i2c-10	i2c       	PA Semi SMBus adapter at 0x(____ptrval____)	I2C adapter
As Sven correctly switched from %lx to %p, this is intended behaviour.
Run 'i2cdetect' as root to see the values again.

Re: Add Apple M1 support to PASemi i2c driver

From: Arnd Bergmann <arnd@arndb.de>
Date: 2021-10-04 11:20:44

On Mon, Oct 4, 2021 at 11:55 AM Wolfram Sang [off-list ref] wrote:
quoted
i2c-8 i2c             PA Semi SMBus adapter at 0x(____ptrval____)     I2C adapter
i2c-9 i2c             PA Semi SMBus adapter at 0x(____ptrval____)     I2C adapter
i2c-10        i2c             PA Semi SMBus adapter at 0x(____ptrval____)     I2C adapter
As Sven correctly switched from %lx to %p, this is intended behaviour.
Run 'i2cdetect' as root to see the values again.
I think the address could just get removed here, as this is clearly not helpful.
port number, which is somewhat useful for identifying the device, now
it's either the pointless string, or the virtual address that the
device is mapped
to, which is not helpful either and potentially leaks information about kernel
internal structures.

       Arnd

Re: Add Apple M1 support to PASemi i2c driver

From: Sven Peter <hidden>
Date: 2021-10-04 11:22:45


On Mon, Oct 4, 2021, at 13:20, Arnd Bergmann wrote:
On Mon, Oct 4, 2021 at 11:55 AM Wolfram Sang [off-list ref] wrote:
quoted
quoted
i2c-8 i2c             PA Semi SMBus adapter at 0x(____ptrval____)     I2C adapter
i2c-9 i2c             PA Semi SMBus adapter at 0x(____ptrval____)     I2C adapter
i2c-10        i2c             PA Semi SMBus adapter at 0x(____ptrval____)     I2C adapter
As Sven correctly switched from %lx to %p, this is intended behaviour.
Run 'i2cdetect' as root to see the values again.
I think the address could just get removed here, as this is clearly not helpful.
port number, which is somewhat useful for identifying the device, now
it's either the pointless string, or the virtual address that the
device is mapped
to, which is not helpful either and potentially leaks information about kernel
internal structures.
Yeah, now that I'm looking at it again it doesn't make much sense to
include it there. Maybe just dev_name(smbus->dev) instead of the address?


Sven

Re: Add Apple M1 support to PASemi i2c driver

From: Christian Zigotzky <hidden>
Date: 2021-10-04 22:17:36

On 3. Oct 2021, at 16:36, Sven Peter [off-list ref] wrote:

Hi,

quoted
On Fri, Oct 1, 2021, at 06:47, Christian Zigotzky wrote:
quoted
On 27 September 2021 at 07:39 am, Sven Peter wrote:
Hi Christian,

Thanks already for volunteering to test this!
Hello Sven,

Damien (Hypex) has successfully tested the RC3 of kernel 5.15 with your 
modified i2c driver on his Nemo board yesterday. [1]
Thanks a lot, that's great to hear!
If he wants to I can credit him with a Tested-by tag in the commit message,
see e.g. https://www.kernel.org/doc/html/latest/process/submitting-patches.html#using-reported-by-tested-by-reviewed-by-suggested-by-and-fixes.


Best,


Sven
Hi Sven,

Unfortunately Damien has found an issue. [1]

Output of i2cdetect -l with the default RC3 of kernel 5.15 without your modifications:

2c-0	i2c       	Radeon i2c bit bus 0x90         	I2C adapter
i2c-1	i2c       	Radeon i2c bit bus 0x91         	I2C adapter
i2c-2	i2c       	Radeon i2c bit bus 0x92         	I2C adapter
i2c-3	i2c       	Radeon i2c bit bus 0x93         	I2C adapter
i2c-4	i2c       	Radeon i2c bit bus 0x94         	I2C adapter
i2c-5	i2c       	Radeon i2c bit bus 0x95         	I2C adapter
i2c-6	i2c       	Radeon i2c bit bus 0x96         	I2C adapter
i2c-7	i2c       	Radeon i2c bit bus 0x97         	I2C adapter
i2c-8	i2c       	PA Semi SMBus adapter at 0x800200	I2C adapter
i2c-9	i2c       	PA Semi SMBus adapter at 0x800240	I2C adapter
i2c-10	i2c       	PA Semi SMBus adapter at 0x800280	I2C adapter

Output of i2cdetect -l with your modifications:

i2c-0	i2c       	Radeon i2c bit bus 0x90         	I2C adapter
i2c-1	i2c       	Radeon i2c bit bus 0x91         	I2C adapter
i2c-2	i2c       	Radeon i2c bit bus 0x92         	I2C adapter
i2c-3	i2c       	Radeon i2c bit bus 0x93         	I2C adapter
i2c-4	i2c       	Radeon i2c bit bus 0x94         	I2C adapter
i2c-5	i2c       	Radeon i2c bit bus 0x95         	I2C adapter
i2c-6	i2c       	Radeon i2c bit bus 0x96         	I2C adapter
i2c-7	i2c       	Radeon i2c bit bus 0x97         	I2C adapter
i2c-8	i2c       	PA Semi SMBus adapter at 0x(____ptrval____)	I2C adapter
i2c-9	i2c       	PA Semi SMBus adapter at 0x(____ptrval____)	I2C adapter
i2c-10	i2c       	PA Semi SMBus adapter at 0x(____ptrval____)	I2C adapter

Please check the outputs.

Thanks,
Christian

[1] https://forum.hyperion-entertainment.com/viewtopic.php?p=54165#p54165

Re: Add Apple M1 support to PASemi i2c driver

From: Christian Zigotzky <hidden>
Date: 2021-10-08 20:21:31

Hi Michael,

Do you have a mbox link for the v2 changes?

I would like to test them on my AmigaOne X1000.

Thanks,
Christian

On 27. Sep 2021, at 09:58, Michael Ellerman [off-list ref] wrote:

Christian, the whole series is downloadable as a single mbox here:

https://patchwork.ozlabs.org/series/264134/mbox/

Save that to a file and apply with `git am`.

eg:

$ wget -O mbox https://patchwork.ozlabs.org/series/264134/mbox/
$ git am mbox

It applies cleanly on v5.15-rc3.

cheers

Re: Add Apple M1 support to PASemi i2c driver

From: Olof Johansson <hidden>
Date: 2021-10-08 20:47:52

Christian,

Self-service available on lore:
https://lore.kernel.org/all/20211008163532.75569-1-sven@svenpeter.dev/

There are links on there to download a whole thread as an mbox if needed.


-Olof

On Fri, Oct 8, 2021 at 1:20 PM Christian Zigotzky
[off-list ref] wrote:
Hi Michael,

Do you have a mbox link for the v2 changes?

I would like to test them on my AmigaOne X1000.

Thanks,
Christian

On 27. Sep 2021, at 09:58, Michael Ellerman [off-list ref] wrote:

Christian, the whole series is downloadable as a single mbox here:

https://patchwork.ozlabs.org/series/264134/mbox/

Save that to a file and apply with `git am`.

eg:

$ wget -O mbox https://patchwork.ozlabs.org/series/264134/mbox/
$ git am mbox

It applies cleanly on v5.15-rc3.

cheers

Re: Add Apple M1 support to PASemi i2c driver

From: Christian Zigotzky <hidden>
Date: 2021-10-09 06:12:13

Olof,

Thank you for the hint.

I think I have found them.

Link: https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=266104

Mbox: https://patchwork.ozlabs.org/series/266104/mbox/

$ wget -O mbox https://patchwork.ozlabs.org/series/266104/mbox/
$ git am mbox

Thanks,
Christian

On 8. Oct 2021, at 22:47, Olof Johansson [off-list ref] wrote:

Christian,

Self-service available on lore:
https://lore.kernel.org/all/20211008163532.75569-1-sven@svenpeter.dev/

There are links on there to download a whole thread as an mbox if needed.


-Olof

On Fri, Oct 8, 2021 at 1:20 PM Christian Zigotzky
[off-list ref] wrote:

Hi Michael,

Do you have a mbox link for the v2 changes?

I would like to test them on my AmigaOne X1000.

Thanks,
Christian

On 27. Sep 2021, at 09:58, Michael Ellerman [off-list ref] wrote:

Christian, the whole series is downloadable as a single mbox here:

https://patchwork.ozlabs.org/series/264134/mbox/

Save that to a file and apply with `git am`.

eg:

$ wget -O mbox https://patchwork.ozlabs.org/series/264134/mbox/
$ git am mbox

It applies cleanly on v5.15-rc3.

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help