From patchwork Thu Jul 7 06:17:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 9217837 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 DCEE66048B for ; Thu, 7 Jul 2016 06:18:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C42A52872F for ; Thu, 7 Jul 2016 06:18:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B72DC28731; Thu, 7 Jul 2016 06:18:49 +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=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 616412872F for ; Thu, 7 Jul 2016 06:18:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751284AbcGGGSl (ORCPT ); Thu, 7 Jul 2016 02:18:41 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:33656 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751208AbcGGGSk (ORCPT ); Thu, 7 Jul 2016 02:18:40 -0400 Received: by mail-wm0-f67.google.com with SMTP id n127so532788wme.0 for ; Wed, 06 Jul 2016 23:17:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:subject:to:cc:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=Zf/5gFHkPq8abZXHtkncQIwPzm/va9j9fLeqrj2GX+4=; b=UmtgiVodf2hV+mILMaIhXAfLY5PKxzho2DOPkgMzUQOh4og+44cq86tz1Cw7g5NdgM r8gXO0D+JMt6qVchQAO5Go1hnmRtk8FMxpRpXLIt2nSS8gjY5FTQK3b1BB4rR3YrYdvX Rtu3NTpJg0GTXBZEYMH6owfZ6HWL7v69CqnC56oJ8oFTKcclRofbzb4y2bjWjrx247Kf QfY7RG6MB8o2uJYJHj8tL+F+Ui3vyU4kmqFjgW/1+XLE0AkA46C2gbEPQ9sH8aWwHtMs ufraz3a+aPNXRHeIHYB7MlOF+l6eaFfDFTUnbf1ugymMf7I4+thIl3hglse2Nlkm7Yxh I3JA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:cc:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=Zf/5gFHkPq8abZXHtkncQIwPzm/va9j9fLeqrj2GX+4=; b=jikox3+ZFkMu5izsX7lnoXiWXk190Gj03qRkUlG35G+c/ehW1xCv9CBXw1QUK0UeyW 77YoVfHn4lUkMm/Mjx+HJqyhqoj0kC4x0eBDEXFWq/+SrmmmyTRqIhLTXvHWJJcCC9wG WuQdgx2e4IvTqT2Umg+kTXmGQBzR+I6+7YoYfOkIiecxl+odOpwj+OESmgUpn9b47z2U HJxoJRzvp6TbeUbEWCfLzomlumA2PPABBsRF6XEpA8XGX86kWwYJOA5K3lD7F4ETZKqe YfpQ6j3D7RUo+OoPYNwg56CyAmxdwON6KFwrs53XUEHs+Qfy7doJLvFMg8wA/5fJlp3a /VHQ== X-Gm-Message-State: ALyK8tIOxj+7NGpithyXD8nJWbj1u7Any2rKE/Iy7BQ+QzTle3dGmQi72OvJhW9WZLnwLQ== X-Received: by 10.28.48.3 with SMTP id w3mr25242131wmw.28.1467872272829; Wed, 06 Jul 2016 23:17:52 -0700 (PDT) Received: from ?IPv6:2003:62:5f01:4400:ec5e:1655:bc06:4fad? (p200300625F014400EC5E1655BC064FAD.dip0.t-ipconnect.de. [2003:62:5f01:4400:ec5e:1655:bc06:4fad]) by smtp.googlemail.com with ESMTPSA id w184sm5742265wmd.11.2016.07.06.23.17.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Jul 2016 23:17:52 -0700 (PDT) From: Heiner Kallweit Subject: [PATCH] rc: nuvoton: fix hang if chip is configured for alternative EFM IO address To: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, =?UTF-8?B?QW50dGkgU2VwcMOkbMOk?= Message-ID: <8333c965-61a1-f991-5a72-1cf993b9443b@gmail.com> Date: Thu, 7 Jul 2016 08:17:39 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If a system configures the Nuvoton chip to use the alternative EFM IO address (CR_EFIR2) then after probing the primary EFM IO address (CR_EFIR) this region is not released. If a driver for another function of the Nuvoton Super I/O chip uses the same probing mechanism then it will hang if loaded after the nuvoton-cir driver. This was reported for the nct6775 hwmon driver. Fix this by properly releasing the region after probing CR_EFIR. This regression was introduced with kernel 4.6 so cc it to stable. Reported-by: Antti Seppälä Signed-off-by: Heiner Kallweit Tested-by: Antti Seppälä Cc: # 4.6.x- --- drivers/media/rc/nuvoton-cir.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c index 99b303b..e8ceb0e 100644 --- a/drivers/media/rc/nuvoton-cir.c +++ b/drivers/media/rc/nuvoton-cir.c @@ -401,6 +401,7 @@ static int nvt_hw_detect(struct nvt_dev *nvt) /* Check if we're wired for the alternate EFER setup */ nvt->chip_major = nvt_cr_read(nvt, CR_CHIP_ID_HI); if (nvt->chip_major == 0xff) { + nvt_efm_disable(nvt); nvt->cr_efir = CR_EFIR2; nvt->cr_efdr = CR_EFDR2; nvt_efm_enable(nvt);