Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756116AbYHXR4A (ORCPT ); Sun, 24 Aug 2008 13:56:00 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752431AbYHXRzw (ORCPT ); Sun, 24 Aug 2008 13:55:52 -0400 Received: from nn7.de ([85.214.94.156]:42528 "EHLO nn7.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752062AbYHXRzv (ORCPT ); Sun, 24 Aug 2008 13:55:51 -0400 Subject: converting appletouch to usb autosuspend again... From: Soeren Sonnenburg To: Linux Kernel Cc: Oliver Neukum , Alan Stern , Jiri Kosina Content-Type: multipart/mixed; boundary="=-9ho4vgFXwXKm74UnqsP0" Date: Sat, 23 Aug 2008 21:00:18 +0000 Message-Id: <1219525218.8221.31.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 6724 Lines: 113 --=-9ho4vgFXwXKm74UnqsP0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Dear all, I wonder whether anyone else tried to get appletouch usb autosuspend to work. I've seen Oliver's patch but as it kept oopsing on me and I couldn't parse the usb_mark_last_busy logic I came up with the attached patch against (current git; at least didn't oops for me over the last several days and suspend/resume cycles). However things I don't understand, a) is autosuspend on the appletouch driver used at all (how can I find out) b) do I need dev->intf->needs_remote_wakeup = 1; ? c) is line 33 in the patch safe to do ? And while we are at it I am still seeing these X falls back to hid mouse mode, only switching to console and back resolves this (looks like this only worked in previous kernels as resume from s2ram took a lot longer due to the IDE driver doing a couple of resets) - is there anything one could do about it? Soeren --=-9ho4vgFXwXKm74UnqsP0 Content-Disposition: attachment; filename=appletouch_autosuspend.diff Content-Type: text/x-patch; name=appletouch_autosuspend.diff; charset=ISO-8859-15 Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2RyaXZlcnMvaW5wdXQvbW91c2UvYXB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XV0ZXgpOw0KKw0KKwlyZXR1 cm4gZXJyb3I7DQogfQ0KIA0KIHN0YXRpYyBpbnQgYXRwX3Jlc2V0X3Jlc3VtZShzdHJ1Y3QgdXNi X2ludGVyZmFjZSAqaWZhY2UpDQogew0KIAlzdHJ1Y3QgYXRwICpkZXYgPSB1c2JfZ2V0X2ludGZk YXRhKGlmYWNlKTsNCisJaW50IGVycm9yID0gMDsNCiANCi0JcmV0dXJuIGF0cF9yZWNvdmVyKGRl dik7DQorCW11dGV4X2xvY2soJmRldi0+cG1fbXV0ZXgpOw0KKwllcnJvciA9IGF0cF9yZWNvdmVy KGRldik7DQorCW11dGV4X3VubG9jaygmZGV2LT5wbV9tdXRleCk7DQorDQorCXJldHVybiBlcnJv cjsNCiB9DQogDQogc3RhdGljIHN0cnVjdCB1c2JfZHJpdmVyIGF0cF9kcml2ZXIgPSB7DQpAQCAt NzgxLDYgKzgyMiw3IEBAIHN0YXRpYyBzdHJ1Y3QgdXNiX2RyaXZlciBhdHBfZHJpdmVyID0gew0K IAkucmVzdW1lCQk9IGF0cF9yZXN1bWUsDQogCS5yZXNldF9yZXN1bWUJPSBhdHBfcmVzZXRfcmVz dW1lLA0KIAkuaWRfdGFibGUJPSBhdHBfdGFibGUsDQorCS5zdXBwb3J0c19hdXRvc3VzcGVuZAk9 IDEsDQogfTsNCiANCiBzdGF0aWMgaW50IF9faW5pdCBhdHBfaW5pdCh2b2lkKQ0KQEAgLTc5NSwz ICs4MzcsNCBAQCBzdGF0aWMgdm9pZCBfX2V4aXQgYXRwX2V4aXQodm9pZCkNCiANCiBtb2R1bGVf aW5pdChhdHBfaW5pdCk7DQogbW9kdWxlX2V4aXQoYXRwX2V4aXQpOw0KKw0K --=-9ho4vgFXwXKm74UnqsP0-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/