Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp177407imd; Wed, 31 Oct 2018 16:52:44 -0700 (PDT) X-Google-Smtp-Source: AJdET5ctjSwekapX3/a0ezM5u/bVwTNO/VeNURfWahnKAV7YaWmdgJZ0emyXSABV0JIjfTL2WyDQ X-Received: by 2002:a17:902:3e3:: with SMTP id d90-v6mr5354782pld.118.1541029964416; Wed, 31 Oct 2018 16:52:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541029964; cv=none; d=google.com; s=arc-20160816; b=mltEmmLcsaLjOjJ8j+UrIVGb8DGYeCOB5iM9VkL4aYDKBOy85svHs5Lq99N77ecZhy 8BHee2d//jYoF3TSwPvsppVnnHs665M5LgYd0gAYsJMuXnHRI15EuLTR2Z/y5dl3OLDT E4TzkJk4lZxe79EEjq2rheocobm0EDit2lbNpFwUlVYtic/fDnYvIPN+QtV4y8MSPhoC PqoK08U5HwD7L3RlfyNqXJhW4HetPmVL/uEJEJWugxBDZNsbsVMnM78d9bVDYV0+px87 oiew2TEy3CKAMTyG4gGVqxpNnGGoFJv9G/4jCRTPTEhfbk19Dqekv0e3IMQzLSrJRmAK NDTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=YEvXqUH/WESH9EFsw0g2HuwDlqgYgTKP4YI1OkKwxrs=; b=ucJlAr0lWPcaCOxur+5Qkc7/T3YDyDrcbJeSBhvT8pfKYClIDKtO4JCFNowjEZiICo rhLEgV0lB8RVgs+ksc7NGqvbmkFRa7dPvUnEvWoIP5KZmW72xuV0R653tMTkwlndn3XW J2xWW7wrCq4USy1vUNfQ5vJLCSE8CrorAhUzTWCdnM1Qvpwlk6bMTqvUf8TR6Uh309oh JqpUZfLPt0JCC2SCS2PHjqT+vmatxKMSd75Bl4EZVbmo1iTldO8SiIILPNvt0ZpF4GPb UNGCF+yjqXTIOOF05gmdr57l1TJk2WqqesXFX3lN9a/v1oVX2iHHAzZPosvKk3jJqLK2 1hDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SIWF5p3O; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e21-v6si29679942pgl.305.2018.10.31.16.52.29; Wed, 31 Oct 2018 16:52:44 -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; dkim=pass header.i=@kernel.org header.s=default header.b=SIWF5p3O; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727972AbeKAIGZ (ORCPT + 99 others); Thu, 1 Nov 2018 04:06:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:53188 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727784AbeKAIGU (ORCPT ); Thu, 1 Nov 2018 04:06:20 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2AB032082E; Wed, 31 Oct 2018 23:06:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541027170; bh=KPiJvz4He0AwSZ0ySKEL1Gu0R0Z7OVpxUWh1vKcO0so=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SIWF5p3OCYz98e4VS0b9mDyajC2JIWieMcvYiXYbJm/JIYNySOhh5M8fVsyYkrjVV lXEa1u76yP8zLAdjSrB9E43MCz1/gxbaEf80hPZZZ1q8QP/hZc9CFV9S+qwRc4oYIi 1ZaEppCbQrhuUVe97trrPbaTCuAEF1lZxS22SvFc= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Lubomir Rintel , Borislav Petkov , "H. Peter Anvin" , Ingo Molnar , x86-ml , Sasha Levin Subject: [PATCH AUTOSEL 4.19 030/146] x86/olpc: Indicate that legacy PC XO-1 platform should not register RTC Date: Wed, 31 Oct 2018 19:03:45 -0400 Message-Id: <20181031230541.28822-30-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181031230541.28822-1-sashal@kernel.org> References: <20181031230541.28822-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lubomir Rintel [ Upstream commit d92116b800fb79a72ad26121f5011f6aa3ad94c2 ] On OLPC XO-1, the RTC is discovered via device tree from the arch initcall. Don't let the PC platform register another one from its device initcall, it's not going to work: sysfs: cannot create duplicate filename '/devices/platform/rtc_cmos' CPU: 0 PID: 1 Comm: swapper Not tainted 4.19.0-rc6 #12 Hardware name: OLPC XO/XO, BIOS OLPC Ver 1.00.01 06/11/2014 Call Trace: dump_stack+0x16/0x18 sysfs_warn_dup+0x46/0x58 sysfs_create_dir_ns+0x76/0x9b kobject_add_internal+0xed/0x209 ? __schedule+0x3fa/0x447 kobject_add+0x5b/0x66 device_add+0x298/0x535 ? insert_resource_conflict+0x2a/0x3e platform_device_add+0x14d/0x192 ? io_delay_init+0x19/0x19 platform_device_register+0x1c/0x1f add_rtc_cmos+0x16/0x31 do_one_initcall+0x78/0x14a ? do_early_param+0x75/0x75 kernel_init_freeable+0x152/0x1e0 ? rest_init+0xa2/0xa2 kernel_init+0x8/0xd5 ret_from_fork+0x2e/0x38 kobject_add_internal failed for rtc_cmos with -EEXIST, don't try to register things with the same name in the same directory. platform rtc_cmos: registered platform RTC device (no PNP device found) Signed-off-by: Lubomir Rintel Signed-off-by: Borislav Petkov Acked-by: Thomas Gleixner CC: "H. Peter Anvin" CC: Ingo Molnar CC: x86-ml Link: http://lkml.kernel.org/r/20181004160808.307738-1-lkundrak@v3.sk Signed-off-by: Sasha Levin --- arch/x86/platform/olpc/olpc-xo1-rtc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/platform/olpc/olpc-xo1-rtc.c b/arch/x86/platform/olpc/olpc-xo1-rtc.c index a2b4efddd61a..8e7ddd7e313a 100644 --- a/arch/x86/platform/olpc/olpc-xo1-rtc.c +++ b/arch/x86/platform/olpc/olpc-xo1-rtc.c @@ -16,6 +16,7 @@ #include #include +#include static void rtc_wake_on(struct device *dev) { @@ -75,6 +76,8 @@ static int __init xo1_rtc_init(void) if (r) return r; + x86_platform.legacy.rtc = 0; + device_init_wakeup(&xo1_rtc_device.dev, 1); return 0; } -- 2.17.1