Received: by 10.213.65.68 with SMTP id h4csp249064imn; Fri, 23 Mar 2018 03:55:01 -0700 (PDT) X-Google-Smtp-Source: AG47ELshzoExtCSYiejklmQwk4paHjmKBDJPoYyjhj/2c9xv2HmUBjFOhhDv+M3GncFw9Fg1QxGJ X-Received: by 2002:a17:902:6c0d:: with SMTP id q13-v6mr23998410plk.350.1521802501597; Fri, 23 Mar 2018 03:55:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521802501; cv=none; d=google.com; s=arc-20160816; b=QZ3ADzt6yog/hVu1Vy4QVxZAYEqSn4Z0D0QvgxNa/x6rHInfvDbHPNRIIR65YGSnzO Qp8/t4Domv1WgRSUD76rbhVuihNS92GeQD9X8Vo7sLa69l+HBdPT4a40t3kdw1H3tlcf 51QNqbHuDkiKDzDHxjmFTgDt+lT5YRzdUxSCQ5wrAPijTmbdtVYVBHPnZKbc2fS4yN51 sBdAimqTyyBYVxIZjuoG9e3anP7t+32GySIvzEZkD+9L8G6YSJt4iDjjY117WbV+44pf ZeR5s9iYtearUOdZIZ6WKPnoTaJqAFmMb8l/2EmEJn9bsHRyHHBOJhBDy7sKhTg6P+SH J7mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=6T4m/h0QvtoRVsZ+nXPtJFenMNWcAEQnl8B15+pu3wU=; b=cTepDaGnZZROmG/DHCuBbL9CknnSPF9nl6Ug2PFXIs647MLCcCVf+SpW4y+LahinTw UaIlEQpVzU1bcSi42MLXnIqOhAgu/ruk3JJuekR7XbNK7dj0aUGraEkIg67X6hjR5RVd J+k2L3tuHU55WcVT9AVH+pvJs/m7ERgvdnq+MMONODu/UOFB1h0UT5OVBxsRpldM2gd+ JitQoDwlrG9Lwo8VAnuLZztG/PXCXImYVhzMahteH7JgFh0SXk8DvpJBZR800rUnjHoO ER08itbC2dML1UIWof733mdNsfzS3H0LIb//QAwfv79sv60kTasCMI5PPvmTzDrpqoyI UWRA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n3si6565078pfi.302.2018.03.23.03.54.47; Fri, 23 Mar 2018 03:55:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755153AbeCWKx7 (ORCPT + 99 others); Fri, 23 Mar 2018 06:53:59 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:44902 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755860AbeCWKNj (ORCPT ); Fri, 23 Mar 2018 06:13:39 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id D757D119C; Fri, 23 Mar 2018 10:13:38 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans de Goede , Alexandre Belloni , Sasha Levin Subject: [PATCH 4.4 09/97] rtc: cmos: Do not assume irq 8 for rtc when there are no legacy irqs Date: Fri, 23 Mar 2018 10:53:56 +0100 Message-Id: <20180323094158.028433526@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180323094157.535925724@linuxfoundation.org> References: <20180323094157.535925724@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Hans de Goede [ Upstream commit a1e23a42f1bdc00e32fc4869caef12e4e6272f26 ] On some systems (e.g. Intel Bay Trail systems) the legacy PIC is not used, in this case virq 8 will be a random irq, rather then hw_irq 8 from the PIC. Requesting virq 8 in this case will not help us to get alarm irqs and may cause problems for other drivers which actually do need virq 8, for example on an Asus Transformer T100TA this leads to: [ 28.745155] genirq: Flags mismatch irq 8. 00000088 (mmc0) vs. 00000080 (rtc0) [ 28.753700] mmc0: Failed to request IRQ 8: -16 [ 28.975934] sdhci-acpi: probe of 80860F14:01 failed with error -16 This commit fixes this by making the rtc-cmos driver continue without using an irq rather then claiming irq 8 when no irq is specified in the pnp-info and there are no legacy-irqs. Signed-off-by: Hans de Goede Signed-off-by: Alexandre Belloni Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/rtc/rtc-cmos.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) --- a/drivers/rtc/rtc-cmos.c +++ b/drivers/rtc/rtc-cmos.c @@ -41,6 +41,9 @@ #include #include #include +#ifdef CONFIG_X86 +#include +#endif /* this is for "generic access to PC-style RTC" using CMOS_READ/CMOS_WRITE */ #include @@ -1058,17 +1061,23 @@ static int cmos_pnp_probe(struct pnp_dev { cmos_wake_setup(&pnp->dev); - if (pnp_port_start(pnp, 0) == 0x70 && !pnp_irq_valid(pnp, 0)) + if (pnp_port_start(pnp, 0) == 0x70 && !pnp_irq_valid(pnp, 0)) { + unsigned int irq = 0; +#ifdef CONFIG_X86 /* Some machines contain a PNP entry for the RTC, but * don't define the IRQ. It should always be safe to - * hardcode it in these cases + * hardcode it on systems with a legacy PIC. */ + if (nr_legacy_irqs()) + irq = 8; +#endif return cmos_do_probe(&pnp->dev, - pnp_get_resource(pnp, IORESOURCE_IO, 0), 8); - else + pnp_get_resource(pnp, IORESOURCE_IO, 0), irq); + } else { return cmos_do_probe(&pnp->dev, pnp_get_resource(pnp, IORESOURCE_IO, 0), pnp_irq(pnp, 0)); + } } static void __exit cmos_pnp_remove(struct pnp_dev *pnp)