Received: by 2002:a4a:301c:0:0:0:0:0 with SMTP id q28-v6csp524305oof; Tue, 25 Sep 2018 00:47:49 -0700 (PDT) X-Google-Smtp-Source: ACcGV61fdG8eJ+3fdHzSAnFVOrqv+QTQpV1z6eOSWkfoC2grTWG/9T9ZfWCEcE8yT0tarItqukFR X-Received: by 2002:a65:65c6:: with SMTP id y6-v6mr2107384pgv.233.1537861669708; Tue, 25 Sep 2018 00:47:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537861669; cv=none; d=google.com; s=arc-20160816; b=s4l48UvjubXu7kaaM+pwnGq8R8497WJ6P20aiHwwuFQIbNzHDLo1jjwfjNHOP+XfU+ AG1atvdyKpm42VeOCHLVC37pedWK47JSjp/bNaqrBddujg6liXozPMffW0UpqSCPdzzP Tr0ySiGTPkPKl2Rt51MHwx8rFFLDJxKjgcnaJ9nfhqaIos/iO0CHnydCl1rik7Oq19r+ yAiNbZjJ/uCA1NHY5Tlfm4BhFLY+yeAwCLVygiLB94V/6MH0T/19Qt65/Q7iV9WaJJ49 fpJGSPJmWtZlIYMyhAlu1G3+UlkGM2hHfwDJdvU8v073ii5LChCNcl6BDIz81PmjMdkX lXMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=J+J1k/LBGde7JqT4x2V7MnZvkgRWRZ/Aj4VpCIYQA2k=; b=zOboW4U8LXOdgp53TdsR0FJa/PJo79FDFflmuGn00/fZeRTrWMp0U5L5dRjj79POXM EAUgC/HRbzpxPkVi2W0ObQ5BUv67cd54vVnyv4xrDUZvVdHNtfy9NBmPP9jitniBBXBo VJi3iwFeUJfcm5zyQhIaZ3zdIV+CQbLw2k46SLi9+9g3W1gPo+pmvTBYnYM9MPcjqTAJ /BTPH3T6LANJ5xZWhX+fZKXH1jocTUXVaY2gG8AiJW2a+kMPJfrXWTwbgbQo9hBx2dFy ES5yU74qfeouBP952HSCRmLWO6M6ja7Nd+bvxesscarWTTOtUpUrdyyRRwuhFJDNA4rm fM8g== 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 v129-v6si1604062pfv.278.2018.09.25.00.47.33; Tue, 25 Sep 2018 00:47:49 -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 S1728636AbeIYNxo (ORCPT + 99 others); Tue, 25 Sep 2018 09:53:44 -0400 Received: from mail.bootlin.com ([62.4.15.54]:60609 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727588AbeIYNxo (ORCPT ); Tue, 25 Sep 2018 09:53:44 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 7D78520731; Tue, 25 Sep 2018 09:47:24 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (242.171.71.37.rev.sfr.net [37.71.171.242]) by mail.bootlin.com (Postfix) with ESMTPSA id 4A0FD203DA; Tue, 25 Sep 2018 09:47:14 +0200 (CEST) Date: Tue, 25 Sep 2018 09:47:14 +0200 From: Alexandre Belloni To: Denis OSTERLAND Cc: "linux-kernel@vger.kernel.org" , "khoroshilov@ispras.ru" Subject: Re: rtc: isl1208: avoid possible sysfs race Message-ID: <20180925074714.GG13455@piout.net> References: <20180915114343.31935-1-alexandre.belloni@bootlin.com> <1537857983.4657.5.camel@diehl.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1537857983.4657.5.camel@diehl.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25/09/2018 06:46:24+0000, Denis OSTERLAND wrote: > Hi, > > just for clarification: > This changes user-space representation from > /sys/class/rtc/rtcN/device/{atrim,dtrim,usr} > to > /sys/class/rtc/rtcN/{atrim,dtrim,usr} > and fixes the "mistake made back in 2006" you mention in > https://patchwork.ozlabs.org/patch/881397/ > correct? > This is correct. At some point, it would also be great to move from atrim/dtrim to offset > Regards Denis > > Am Samstag, den 15.09.2018, 13:43 +0200 schrieb Alexandre Belloni: > > Use rtc_add_group to add the common sysfs group to avoid a possible race > > condition. > > > > Signed-off-by: Alexandre Belloni > > --- > > ?drivers/rtc/rtc-isl1208.c | 11 +---------- > > ?1 file changed, 1 insertion(+), 10 deletions(-) > > > > diff --git a/drivers/rtc/rtc-isl1208.c b/drivers/rtc/rtc-isl1208.c > > index ea18a8f4bce0..e1e9434c9972 100644 > > --- a/drivers/rtc/rtc-isl1208.c > > +++ b/drivers/rtc/rtc-isl1208.c > > @@ -804,7 +804,7 @@ isl1208_probe(struct i2c_client *client, const struct i2c_device_id *id) > > ? evdet_irq = of_irq_get_byname(np, "evdet"); > > ? } > > ? > > - rc = sysfs_create_group(&client->dev.kobj, &isl1208_rtc_sysfs_files); > > + rc = rtc_add_group(rtc, &isl1208_rtc_sysfs_files); > > ? if (rc) > > ? return rc; > > ? > > @@ -821,14 +821,6 @@ isl1208_probe(struct i2c_client *client, const struct i2c_device_id *id) > > ? return rtc_register_device(rtc); > > ?} > > ? > > -static int > > -isl1208_remove(struct i2c_client *client) > > -{ > > - sysfs_remove_group(&client->dev.kobj, &isl1208_rtc_sysfs_files); > > - > > - return 0; > > -} > > - > > ?static const struct i2c_device_id isl1208_id[] = { > > ? { "isl1208", TYPE_ISL1208 }, > > ? { "isl1218", TYPE_ISL1218 }, > > @@ -851,7 +843,6 @@ static struct i2c_driver isl1208_driver = { > > ? .of_match_table = of_match_ptr(isl1208_of_match), > > ? }, > > ? .probe = isl1208_probe, > > - .remove = isl1208_remove, > > ? .id_table = isl1208_id, > > ?}; > > ? > > Diehl Connectivity Solutions GmbH > Gesch?ftsf?hrung: Horst Leonberger > Sitz der Gesellschaft: N?rnberg - Registergericht: Amtsgericht > N?rnberg: HRB 32315 > ___________________________________________________________________________________________________ > > Der Inhalt der vorstehenden E-Mail ist nicht rechtlich bindend. Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen. > Informieren Sie uns bitte, wenn Sie diese E-Mail faelschlicherweise erhalten haben. Bitte loeschen Sie in diesem Fall die Nachricht. > Jede unerlaubte Form der Reproduktion, Bekanntgabe, Aenderung, Verteilung und/oder Publikation dieser E-Mail ist strengstens untersagt. > The contents of the above mentioned e-mail is not legally binding. This e-mail contains confidential and/or legally protected information. Please inform us if you have received this e-mail by > mistake and delete it in such a case. Each unauthorized reproduction, disclosure, alteration, distribution and/or publication of this e-mail is strictly prohibited. -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com