Page 5 of 7 FirstFirst ... 34567 LastLast
Results 41 to 50 of 65

Thread: MBA 11" 2012 with 12.04

  1. #41
    Join Date
    Jul 2012
    Beans
    14

    Re: MBA 11" 2012 with 12.04

    On closer inspection it seems i can break it with MIN_WAIT = 0x0010.

    wrote a script to constantly read and print a bunch of temperatures:

    ran one instance for 5mins without errors,

    ran 2 instances and after a minute or so the read fails.

    I separated the error checking for cmd and arg, so i can tell its the command failing

    Code:
    Jul 15 22:32:17 adam-MacBookPro kernel: [  428.307688] applesmc: TB2T: read cmd fail
    Jul 15 22:32:17 adam-MacBookPro kernel: [  428.340194] applesmc: TC0J: read cmd fail
    Jul 15 22:32:17 adam-MacBookPro kernel: [  428.372731] applesmc: TC0E: read cmd fail
    Jul 15 22:32:17 adam-MacBookPro kernel: [  428.405269] applesmc: TG1D: read cmd fail
    Jul 15 22:32:17 adam-MacBookPro kernel: [  428.437784] applesmc: TC0F: read cmd fail
    ...
    the status read is always 0x0E.

    after this the module fails to load until i reboot.


    I tried using a different MIN_WAIT for the wait_status() and the send_command(), using 0x0080 for the send_command() and 0x0010 for the wait_status()

    Code:
    #define APPLESMC_MIN_WAIT    0x0010
    #define APPLESMC_MIN_WAIT_CMD    0x0080
    this "seems" to improve it, have run 3 instances of the script for ~15mins without a fail yet...

  2. #42
    Join Date
    Nov 2006
    Location
    Sweden
    Beans
    32
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: MBA 11" 2012 with 12.04

    I noticed some problems with gnome settings that might not be machine specific. I cannot turn off dim-screen or enable lock-screen. I've tried both gui-settings and using gsettings.
    Code:
    gsettings set org.gnome.settings-daemon.plugins.power idle-dim-ac false
    gsettings set org.gnome.desktop.screensaver lock-enabled true
    The desktop also doesn't save my brightness backlighting settings for screen and keyboard but are always on max after reboot or cold start.

  3. #43
    Join Date
    Nov 2006
    Location
    Sweden
    Beans
    32
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: MBA 11" 2012 with 12.04

    I have the same problem with the applesmc failing after some time. This cause the fan control to stop working and machine gets hotter than with fan control working. Only reboot solves the problem.

    Quote Originally Posted by adamski99 View Post
    Code:
    #define APPLESMC_MIN_WAIT    0x0010
    #define APPLESMC_MIN_WAIT_CMD    0x0080
    this "seems" to improve it, have run 3 instances of the script for ~15mins without a fail yet...
    Did you see any improvement on the stability of the module? Did it solve the problem?

  4. #44
    Join Date
    Jul 2012
    Beans
    3

    Re: MBA 11" 2012 with 12.04

    Hi all,

    I have a Macbook Pro 9,2 (13'') with Ubuntu 12.04. I also had problem with the SMC stopping working after 15-30 minutes (same problem in 12.10, by the way). What helped a lot was the following change (which is, as the module's maintainer Henrik Rydberg pointed out, more or less going back to what the code did before problems with post-2009-models):

    In send_command(), move the outb(cmd, APPLESMC_CMD_PORT); out and in front of the for-loop, so the port is not written to on every iteration but only once.

    This is not a final solution to the problem since I still get some errors of the type applesmc: FS! : write arg fail, maybe five per hour, but my SMC hasn't crashed for six hours now with macfanctld constantly accessing it, so it's at least an improvement.

    Best,
    Hubert

  5. #45
    Join Date
    Jul 2012
    Beans
    14

    Re: MBA 11" 2012 with 12.04

    Hi,
    Quote Originally Posted by myselph View Post
    In send_command(), move the outb(cmd, APPLESMC_CMD_PORT); out and in front of the for-loop, so the port is not written to on every iteration but only once.
    great, this indeed stops the driver from locking up, I am getting a lot of single fails though.

    had a look at what status returned and when a cmd "resend" is needed.

    This is what happens on my machine with the outb(cmd, APPLESMC_CMD_PORT); outside the for loop.

    On a successful send_command() the status is:

    Code:
    initial status=0x04
    
    then we send cmd: outb(cmd, APPLESMC_CMD_PORT);
    
    status=0x0A
    
    for a few ms then
    
    status=0x0C and we exit the loop.

    sometimes it fails:

    Code:
    initial status= 0x04
    
    then we send cmd: outb(cmd, APPLESMC_CMD_PORT);
    
    status=0x08
    
    and it times out with status at this value
    I have no idea what any of the status values mean, but we can reduce the number of times the cmd is sent, as this seems problematic, by only re-sending if the status == 0x08

    this is what my send_command() looks like:

    Code:
    static int send_command(u8 cmd)
    {
        int us;
        
        outb(cmd, APPLESMC_CMD_PORT);
        for (us = APPLESMC_MIN_WAIT; us < APPLESMC_MAX_WAIT; us <<= 1) {
           
            udelay(us);
            if ((inb(APPLESMC_CMD_PORT) & APPLESMC_STATUS_MASK) == 0x0c) {
                return 0;
            }
            else if ((inb(APPLESMC_CMD_PORT) & APPLESMC_STATUS_MASK) == 0x08) {
                /* resend the cmd as SMC is unhappy */  
                outb(cmd, APPLESMC_CMD_PORT);
            }
        }
    
        return -EIO;
    }
    havent tested much but it seems to be running stable at the moment.

    cheers

    ads

  6. #46
    Join Date
    Jul 2012
    Beans
    2

    Re: MBA 11" 2012 with 12.04 / USB ports

    Even with new kernel 3.5, USB ports are not working for me.

    However, I did stumble on this thread and solution, for those interested: http://www.spinics.net/lists/linux-usb/msg67003.html

    I haven't tested yet.

    Edit: I've found the culprit so I'm sharing it here in case it can help someone. I was booting with option 'nolapic', once removed, leaving the only 'noapic' parameter to the kernel, the USB controller was successfully recognized, ports working properly.
    Last edited by beniz; July 29th, 2012 at 04:23 PM.

  7. #47
    Join Date
    Dec 2007
    Beans
    3

    Unhappy Re: MBA 11" 2012 with 12.04

    One thing I'm running into is that quite often, booting into Linux from rEFIt into Grub doesn't restore screen brightness, so it'll boot into Grub and then into Ubuntu with a completely darkened screen. I know that it's fully booting because I can see the screen contents if I shine a flashlight on it. I'm not quite sure what the cause of this is.

  8. #48
    Join Date
    May 2008
    Beans
    745

    Re: MBA 11" 2012 with 12.04

    Hi adamski,

    I think you are on to something here. It would be great to find out the minimum number of return codes which choke on a command resend. If it is just one or two, this approach might also work on older machines. So, this patch might be useful:

    Code:
    diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c
    index 4d937a1..4e01ef7 100644
    --- a/drivers/hwmon/applesmc.c
    +++ b/drivers/hwmon/applesmc.c
    @@ -189,11 +189,28 @@ static int __wait_status(u8 val)
     static int send_command(u8 cmd)
     {
     	int us;
    +	outb(cmd, APPLESMC_CMD_PORT);
     	for (us = APPLESMC_MIN_WAIT; us < APPLESMC_MAX_WAIT; us <<= 1) {
    -		outb(cmd, APPLESMC_CMD_PORT);
     		udelay(us);
    -		if ((inb(APPLESMC_CMD_PORT) & APPLESMC_STATUS_MASK) == 0x0c)
    +		switch (inb(APPLESMC_CMD_PORT) & APPLESMC_STATUS_MASK) {
    +		case 0x08: /* resend */
    +			outb(cmd, APPLESMC_CMD_PORT);
    +			break;
    +		case 0x0a: /* wait */
    +			break;
    +		case 0x0c: /* success */
     			return 0;
    +		case 0x0e: /* error */
    +			outb(cmd, APPLESMC_CMD_PORT);
    +			break;
    +		case 0x0f: /* unknown */
    +			outb(cmd, APPLESMC_CMD_PORT);
    +			break;
    +		default:
    +			pr_warn("send %d: unknown status: %d\n",
    +				cmd, inb(APPLESMC_CMD_PORT));
    +			break;
    +		}
     	}
     	return -EIO;
     }
    Here, only 0x0a skips the resend. If that works for you, I will test it on some older machines as well. So far, I know this works fine on an MBA3,1.

    It could well be that the different status codes should have different wait times as well...

    Thanks!

  9. #49
    Join Date
    Jul 2012
    Beans
    14

    Re: MBA 11" 2012 with 12.04

    Hi,
    Quote Originally Posted by kosumi68 View Post
    Here, only 0x0a skips the resend. If that works for you, I will test it on some older machines as well. So far, I know this works fine on an MBA3,1.

    It could well be that the different status codes should have different wait times as well...

    Thanks!
    This seems to work for me as well, a couple of things i noticed:

    1. With both this and the code from my last post i get quite a high error status 0x0e returned in send cmd, but seems to recover fairly quickly without a resend, the send_command() does not fail here for me.

    2. I get quite a high fail rate in the send_argument() routine. A fail every 5-10seconds when doing lots of reads. This rate falls drastically (no errors in 10mins) if i increase the min wait used in the send_command() routine to 0x0100 (separate min waits for arg and cmd). The high error status rate in send_command() goes away as well.

    Cheers

    ads

  10. #50
    Join Date
    Jul 2010
    Beans
    1

    Re: MBA 11" 2012 with 12.04

    Hi all,
    I'm running 12.04 on a 13" MBA 5,2 (Mid 2012) with 3.2.0 stock kernel and latest applesmc from PPA. I am booting with noapic parameter.
    Everything looks fine, I turned keyboard backlight on manually as desribed by @adamski99.
    I just want to report my temperatures after 1 hour uptime, are those values safe?
    http://paste.ubuntu.com/1109202/
    I'm not using manual fan control, should I?

    Best regards.
    Last edited by mschinca; July 25th, 2012 at 12:51 AM.

Page 5 of 7 FirstFirst ... 34567 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •