Re: [PATCH] applesmc: Re-work SMC comms v2

2020-11-08 Thread Henrik Rydberg
Hi Brad, G'day Henrik, Which kernel was this based on? It won't apply to my 5.9 tree. I was being lazy and applied the diff to linus/master on top of my current stable branch. More importantly, I sent the mail out from an email client that may not format the patch properly; I'll fix that.

Re: [PATCH] applesmc: Re-work SMC comms v2

2020-11-07 Thread Brad Campbell
On 8/11/20 5:31 am, Henrik Rydberg wrote: > On 2020-11-06 21:02, Henrik Rydberg wrote: >>> So as it stands, it does not work at all. I will continue to check another >>> machine, and see if I can get something working. >> >> On the MacBookAir3,1 the situation is somewhat better. >> >> The first

Re: [PATCH] applesmc: Re-work SMC comms v2

2020-11-07 Thread Henrik Rydberg
On 2020-11-06 21:02, Henrik Rydberg wrote: So as it stands, it does not work at all. I will continue to check another machine, and see if I can get something working. On the MacBookAir3,1 the situation is somewhat better. The first three tree positions result in zero failures and 10 reads per

Re: [PATCH] applesmc: Re-work SMC comms v2

2020-11-06 Thread Brad Campbell
On 7/11/20 3:26 am, Henrik Rydberg wrote: >>> I can't guarantee it won't break older machines which is why I've asked for >>> help testing it. I only have a MacbookPro 11,1 and an iMac 12,2. It fixes >>> both of those. >>> >>> Help testing would be much appreciated. >> >> I see, this makes much

Re: [PATCH] applesmc: Re-work SMC comms v2

2020-11-06 Thread Henrik Rydberg
So as it stands, it does not work at all. I will continue to check another machine, and see if I can get something working. On the MacBookAir3,1 the situation is somewhat better. The first three tree positions result in zero failures and 10 reads per second. The fourth yields zero failues and

Re: [PATCH] applesmc: Re-work SMC comms v2

2020-11-06 Thread Henrik Rydberg
I can't guarantee it won't break older machines which is why I've asked for help testing it. I only have a MacbookPro 11,1 and an iMac 12,2. It fixes both of those. Help testing would be much appreciated. I see, this makes much more sense. I may be able to run some tests tonight. Meanwhile,

Re: [PATCH] applesmc: Re-work SMC comms v2

2020-11-05 Thread Guenter Roeck
On 11/5/20 4:02 PM, Brad Campbell wrote: [ ... ] >>> +/* Apple SMC status bits */ >>> +#define SMC_STATUS_AWAITING_DATA BIT(0) /* SMC has data waiting */ >>> +#define SMC_STATUS_IB_CLOSED BIT(1) /* Will ignore any input */ >>> +#define SMC_STATUS_BUSY BIT(2) /* Command in progress

Re: [PATCH] applesmc: Re-work SMC comms v2

2020-11-05 Thread Brad Campbell
On 6/11/20 3:12 am, Guenter Roeck wrote: > On 11/4/20 11:26 PM, Brad Campbell wrote: >> Commit fff2d0f701e6 ("hwmon: (applesmc) avoid overlong udelay()") introduced >> an issue whereby communication with the SMC became unreliable with write >> errors like : >> >> [ 120.378614] applesmc:

Re: [PATCH] applesmc: Re-work SMC comms v2

2020-11-05 Thread Guenter Roeck
On 11/4/20 11:26 PM, Brad Campbell wrote: > Commit fff2d0f701e6 ("hwmon: (applesmc) avoid overlong udelay()") introduced > an issue whereby communication with the SMC became unreliable with write > errors like : > > [ 120.378614] applesmc: send_byte(0x00, 0x0300) fail: 0x40 > [ 120.378621]

Re: [PATCH] applesmc: Re-work SMC comms v2

2020-11-05 Thread Henrik Rydberg
On 2020-11-05 09:30, Brad Campbell wrote: On 5/11/20 6:56 pm, Henrik Rydberg wrote: Hi Brad, Great to see this effort, it is certainly an area which could be improved. After having seen several generations of Macbooks while modifying much of that code, it became clear that the SMC

Re: [PATCH] applesmc: Re-work SMC comms v2

2020-11-05 Thread Brad Campbell
On 5/11/20 6:56 pm, Henrik Rydberg wrote: > Hi Brad, > > Great to see this effort, it is certainly an area which could be improved. > After having seen several generations of Macbooks while modifying much of > that code, it became clear that the SMC communication got refreshed a few > times

Re: [PATCH] applesmc: Re-work SMC comms v2

2020-11-05 Thread Andreas Kemnade
On Thu, 5 Nov 2020 08:56:04 +0100 Henrik Rydberg wrote: > Hi Brad, > > Great to see this effort, it is certainly an area which could be > improved. After having seen several generations of Macbooks while > modifying much of that code, it became clear that the SMC communication > got

Re: [PATCH] applesmc: Re-work SMC comms v2

2020-11-05 Thread Andreas Kemnade
On Thu, 5 Nov 2020 18:26:24 +1100 Brad Campbell wrote: > Commit fff2d0f701e6 ("hwmon: (applesmc) avoid overlong udelay()") introduced > an issue whereby communication with the SMC became unreliable with write > errors like : > > [ 120.378614] applesmc: send_byte(0x00, 0x0300) fail: 0x40 > [

Re: [PATCH] applesmc: Re-work SMC comms v2

2020-11-05 Thread Henrik Rydberg
Hi Brad, Great to see this effort, it is certainly an area which could be improved. After having seen several generations of Macbooks while modifying much of that code, it became clear that the SMC communication got refreshed a few times over the years. Every tiny change had to be tested on

[PATCH] applesmc: Re-work SMC comms v2

2020-11-04 Thread Brad Campbell
Commit fff2d0f701e6 ("hwmon: (applesmc) avoid overlong udelay()") introduced an issue whereby communication with the SMC became unreliable with write errors like : [ 120.378614] applesmc: send_byte(0x00, 0x0300) fail: 0x40 [ 120.378621] applesmc: LKSB: write data fail [ 120.512782] applesmc: