Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2158433rdb; Mon, 9 Oct 2023 15:00:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEThUWcFdZurRUB5ayMmbbqM6Guayi2mqKcYPZYaBeBigyhTC/1Fzu2Gt4VceWR2FuHmyIg X-Received: by 2002:a05:6808:138b:b0:3af:9fc4:26c6 with SMTP id c11-20020a056808138b00b003af9fc426c6mr20006440oiw.20.1696888833634; Mon, 09 Oct 2023 15:00:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696888833; cv=none; d=google.com; s=arc-20160816; b=fbwlFjSfiNN/38+dxrjZcbfx3utoDQCDhj4ehGy3go/EKJbkPm9SfUEWzOiTaWiiAB K9uzJwFvTIF03BBoRjzYS6ANftBc7oAbjM8xWlhUq3FZlzouH9wteQa2LwnB1gJwdTea jznpsGoMYXPvEXPSiHFVrfP2QJz2ORLy4q81JmFFUP+VF2qfHNqgJIcNu43SPw28Tjap z+O2w0vOkg4P3u5ByQD1JHcQTH/Nv70dwucNjlnfDRXikF2tnoNND4sOpOqLCKa2zspt fjKXv4jW1r+qsLJQ4yF3EZQk0bj0jGockvRmAXb8xqZy3uAhHLnPub5bY53n0affW8wb tA8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=hmf/kzB+2aw/kt0IWABgG/NdeS+iXHJx8qCtuTlAbR8=; fh=8TboBWl6DxAK3KEWOpWaoqVD0IFbj1CnrDf4jGdynng=; b=bcOOjfCH4ypZDatfQaXDjNj+dHl5Cr2ASd2XTLrIJG9Nbrupx47t9Vj2FyTomK02cZ iKlHtWmKha2Mje0p0/5Q5H11RpXYGAw1raEnQ+xluyItVfhwLKmc835ZLBBOC9eagXQb fz2sZ8twjyLe73ZQ/FWBjdbmaXGXIYuYlKD51knMHd9fY5jmd8K86nwOjYJAwamo01xZ YeLqSPUfyZ/2fGpuq12o5zzuyz7hQyYEKrp9mZoqanCzih1GnyYeEVdY5pLLgZW8g9XL qa4Uj3lP6kLBLvVF4hEcX+ThYE0O9FSD5G8CDLEYCEaxLyvW8I7zW4EPpjgwC/p5EduY mSWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=lycAmvKR; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id z21-20020a637e15000000b005859d46ced7si9955346pgc.273.2023.10.09.15.00.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 15:00:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=lycAmvKR; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 4B02F809B9C9; Mon, 9 Oct 2023 15:00:30 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378734AbjJIWAR (ORCPT + 99 others); Mon, 9 Oct 2023 18:00:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378370AbjJIWAQ (ORCPT ); Mon, 9 Oct 2023 18:00:16 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B15CB9F; Mon, 9 Oct 2023 15:00:14 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1696888812; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=hmf/kzB+2aw/kt0IWABgG/NdeS+iXHJx8qCtuTlAbR8=; b=lycAmvKRMnB+ZpfWdOSV6rb9MSTwmhBF6tEYVR7ht2LhrRc6P/NUhhw1n2Qk35iPNU0JUP neNHtr/1YjYS1jn8CYlpE1D2hlB/kc9bxUZCaHmlKlRt2dVU/uz1MQkNa/369nA1b62Prf AzHx7Uxiq4j2MhEmqyfMXSECAJErukcp4+u7lv+9zIizFb2tc3VUL+AtFH1hxA+Q1rt2sZ +FBlDNnDqtCo70KJ3WI7L8145qUL2F6dAUPFh3uFdkVhcHLjrx0lh9+Q8F36+Ld3mqcMuA Z8i7b/i5MJ+3E+/vuua4kMJfsKALekdJtoH6rDU41++BOE2otjOjKjooNkzK4A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1696888812; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=hmf/kzB+2aw/kt0IWABgG/NdeS+iXHJx8qCtuTlAbR8=; b=cy6tX36HTqjQxVe+C9e5sS0YK58Clw+HjT/rvGI6c3c1cT4p8GlFyblgIXi4SNjNV5t3a8 KTWdcE7sYex30uAg== To: Biju Das , Alessandro Zummo , Alexandre Belloni Cc: John Stultz , Stephen Boyd , Douglas Anderson , Geert Uytterhoeven , Biju Das , "linux-rtc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-renesas-soc@vger.kernel.org" Subject: RE: [PATCH v2] alarmtimer: Fix rebind failure In-Reply-To: References: <20230922081208.26334-1-biju.das.jz@bp.renesas.com> <87il7fq1al.ffs@tglx> <87fs2jpznr.ffs@tglx> Date: Tue, 10 Oct 2023 00:00:12 +0200 Message-ID: <87bkd7pic3.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 09 Oct 2023 15:00:30 -0700 (PDT) X-Spam-Level: ** On Mon, Oct 09 2023 at 17:02, Biju Das wrote: >> On Mon, Oct 09 2023 at 15:30, Biju Das wrote: >> > You mean we should update[1] (charger-manager driver)as it is the one >> > using alarmtimer_get_rtcdev()?? >> >> # git grep -c alarmtimer_get_rtcdev >> drivers/power/supply/charger-manager.c:1 >> include/linux/alarmtimer.h:2 >> kernel/time/alarmtimer.c:10 > > kernel/time/alarmtimer.c has alarmtimer_get_rtcdev()check everywhere, > that is missing in charger-manager.c. I will add the same, is it ok? The code does in the init function: if (alarmtimer_get_rtcdev()) { .... } IOW, charger-manager.c expects that alarm is working when alarmtimer_get_rtcdev() returns non NULL at init. So ripping the RTC device out under it is going to result in a disfunctional driver. I'm not convinced that you can fix this by sprinkling a ton of checks around the code. But that's not the worst of it. The alarmtimer infrastructure is generally not designed for device/module removal. Why? The posix timer interface is fundamentally expecting that an armed alarm timer is actually functional. The fact that the class interface does not have a remove_dev callback is not an oversight and holding a reference on the module and a reference on the device is intended to ensure that the device cannot vanish. The changelog lacks any form of explanation why this is required and how removal of the registered RTC device is actually possible. Neither does it provide any analysis why this cannot result in malfunction. Thanks, tglx