From patchwork Tue Jun 19 07:44:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jean-Baptiste Maneyrol X-Patchwork-Id: 10473597 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7C116603B5 for ; Tue, 19 Jun 2018 07:45:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8528E28B16 for ; Tue, 19 Jun 2018 07:45:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7985B28B26; Tue, 19 Jun 2018 07:45:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 572FA28B22 for ; Tue, 19 Jun 2018 07:45:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S937236AbeFSHpF (ORCPT ); Tue, 19 Jun 2018 03:45:05 -0400 Received: from mail-cys01nam02on0086.outbound.protection.outlook.com ([104.47.37.86]:2699 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S937215AbeFSHpE (ORCPT ); Tue, 19 Jun 2018 03:45:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=invensense.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pMRxm++PBEB40E+jrB+MP6J+55Tn75tGktonkkgBcgQ=; b=Ids1SSauk4aEz3sUijDFdSKlD6Q+gUcgxx5YZEf8ilrPOLIJ38bf9Asx992eRJ0P1pvisEkNmNDq2LZc2vMDxHHsVHbR8RiVDnqM0umTuHwxiEdIcZY7It6MYP3lTIyQBkymSgE5Hq9IVhYbmYyz6tzoK4L4YmqoO3ywscZUOyU= Received: from SN1PR12MB2525.namprd12.prod.outlook.com (52.132.196.156) by SN1PR12MB2397.namprd12.prod.outlook.com (52.132.195.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.863.20; Tue, 19 Jun 2018 07:44:58 +0000 Received: from SN1PR12MB2525.namprd12.prod.outlook.com ([fe80::edf5:6f5:9835:8d89]) by SN1PR12MB2525.namprd12.prod.outlook.com ([fe80::edf5:6f5:9835:8d89%3]) with mapi id 15.20.0863.016; Tue, 19 Jun 2018 07:44:58 +0000 From: Jean-Baptiste Maneyrol To: Hans de Goede , Jonathan Cameron CC: Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , "linux-iio@vger.kernel.org" , Martin Kelly Subject: Re: [PATCH 4.18 REGRESSION fix] iio: imu: inv_mpu6050: Fix probe() failure on older ACPI based machines Thread-Topic: [PATCH 4.18 REGRESSION fix] iio: imu: inv_mpu6050: Fix probe() failure on older ACPI based machines Thread-Index: AQHUBx7DLWtAwr5ky0Kt9MhXFYVc1KRnNAqy Date: Tue, 19 Jun 2018 07:44:58 +0000 Message-ID: References: <20180618160936.6471-1-hdegoede@redhat.com> In-Reply-To: <20180618160936.6471-1-hdegoede@redhat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=JManeyrol@invensense.com; x-originating-ip: [77.157.193.39] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; SN1PR12MB2397; 7:dsdJJDjM+NqXGPJrgiC0Qn12h+ivjSiz8iSLI6ZQm+IO0K5siD2yuWEBFrK0HsNG7D+5PNpK7verfpzFihGOYNtkvWMqSvP19O0gk4qBvpMunSKEX+aVkffai6b1OOTKKdj1kOjetcaHWW2qcRBt2Y1STyLqRcBvZIT77vYz8BWOYvCjXFj1VbDJ4aEHiFoo8fNcumkc+jbXDKy2YBjb94/I/fEaNSZR5VTu+E6WphdxQ2OyLz1xd2OKzNZ0/h3X; 20:LYHqnz0SbrOX0W2wwJ+mS2+DbT+PPSAw909GzGWqPGf2a3deNzcYunSV5dR6aZr/qt6ICPjvt+4tNBDdptjZI4hK7Iru22fpUrXMJFsa5xqmLDz/W7v0jC65rgR546c4Dt/C8Vvqq0YI33opiYS6KPp9ViGp4aZOnL1Tg0avoDA= x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: f137932f-f6e0-4289-27b0-08d5d5b88ebf x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(711020)(2017052603328)(7153060)(7193020); SRVR:SN1PR12MB2397; x-ms-traffictypediagnostic: SN1PR12MB2397: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(9452136761055)(257004950022427); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(3231254)(944501410)(52105095)(149027)(150027)(6041310)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:SN1PR12MB2397; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB2397; x-forefront-prvs: 07083FF734 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(346002)(376002)(39380400002)(396003)(39850400004)(189003)(199004)(81166006)(81156014)(4326008)(26005)(476003)(316002)(110136005)(106356001)(105586002)(8676002)(53546011)(6246003)(6506007)(68736007)(25786009)(9686003)(72206003)(3280700002)(54906003)(59450400001)(14454004)(3660700001)(53936002)(8666007)(55016002)(33656002)(6436002)(478600001)(86362001)(99286004)(486006)(5890100001)(2906002)(5250100002)(446003)(11346002)(186003)(3846002)(229853002)(5660300001)(6116002)(8936002)(102836004)(2900100001)(7736002)(76176011)(74316002)(7696005)(97736004)(305945005)(80792005)(66066001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB2397; H:SN1PR12MB2525.namprd12.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: invensense.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: KDOygp+vLrl7/z33YkhcH4ZpX++q7RQ7b6rwnBTvwkyRkU4ZaVNPgIRZ2d+DNtuWSlJBD28satui1ZkBgvqg2srt6d4DBPrefsTqyOeZ7Uyfxflc+3L5poadpHpUC5fQc5PWep6zLNKak94ufJmb2NmR6UekoGK1ly8fOWmwtEekK0MklMYpdo12ySyKuvzESZ1RgqgRjiZvZRNJ/1IMZtLLomIv5E4gvtXLoquxrdHreD5F55VkpM8CDS1AJ228lbIXAeCikXFviRwqq2rqZoRUXRc3kY73BGwtvDXYpWUfBuWKsMZHzhW2mj25CnUQsMZFm3zGszlpccfsNq1K1A== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: invensense.com X-MS-Exchange-CrossTenant-Network-Message-Id: f137932f-f6e0-4289-27b0-08d5d5b88ebf X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Jun 2018 07:44:58.5872 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 462b3b3b-e42b-47ea-801a-f1581aac892d X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB2397 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hans de Goede Sent: Monday, June 18, 2018 18:09 To: Jonathan Cameron Cc: Hans de Goede; Hartmut Knaack; Lars-Peter Clausen; Peter Meerwald-Stadler; linux-iio@vger.kernel.org; Martin Kelly; Jean-Baptiste Maneyrol Subject: [PATCH 4.18 REGRESSION fix] iio: imu: inv_mpu6050: Fix probe() failure on older ACPI based machines   CAUTION: This email originated from outside of the organization. Please make sure the sender is who they say they are and do not click links or open attachments unless you recognize the sender and know the content is safe. Commit 5ec6486daa98 ("iio:imu: inv_mpu6050: support more interrupt types") causes inv_mpu_core_probe() to fail if the IRQ does not have a trigger-type setup. This happens on machines where the mpu6050 is enumerated through ACPI and an older Interrupt type ACPI resource is used for the interrupt, rather then a GpioInt type type, causing the mpu6050 driver to no longer work there. This happens on e.g. the Asus T100TA. This commits makes the mpu6050 fallback to the old IRQF_TRIGGER_RISING default if the irq-type is not setup, fixing this. Fixes: 5ec6486daa98 ("iio:imu: inv_mpu6050: support more interrupt types") Cc: Martin Kelly Cc: Jean-Baptiste Maneyrol Signed-off-by: Hans de Goede ---  drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 2 ++  1 file changed, 2 insertions(+) -- 2.17.1 Good catch indeed, thanks for testing and verifying. Reviewed-by: Jean-Baptiste Maneyrol -- To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c index f9c0624505a2..42618fe4f83e 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c @@ -959,6 +959,8 @@ int inv_mpu_core_probe(struct regmap *regmap, int irq, const char *name,         }         irq_type = irqd_get_trigger_type(desc); +       if (!irq_type) +               irq_type = IRQF_TRIGGER_RISING;         if (irq_type == IRQF_TRIGGER_RISING)                 st->irq_mask = INV_MPU6050_ACTIVE_HIGH;         else if (irq_type == IRQF_TRIGGER_FALLING)