Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp568350imn; Thu, 28 Jul 2022 09:07:49 -0700 (PDT) X-Google-Smtp-Source: AGRyM1stz567bJxBHNHjD2YeX3hCWsgrmah/QmHhV/XxXQVZujZjAMEU8iUF4x1rS3WZ4GgTcpFj X-Received: by 2002:a05:6402:331d:b0:43b:ee33:8a5e with SMTP id e29-20020a056402331d00b0043bee338a5emr21894249eda.49.1659024469353; Thu, 28 Jul 2022 09:07:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659024469; cv=none; d=google.com; s=arc-20160816; b=QVlFuKGbkPyCu22pV3P4+KDPVWQPu/dTYmCXy+wPVl8b1Fvwtq1Q4ywAbIHxT9DztH 3gJpku1Ys17QbLYGScJJiIkzyxLfzCUXWK7gcazSHZTlwAo/RYnHeVxts/eq5UvMwOPN C3v1P77bO6gb2SxXhfCDCCpuioPhiydnav2gGHBMgBsM2pK4eXMf1gXNc7w4fpEo41uK m8FowUUWqcpCRbyxyiGA9LyTba+AaBNOnegoDtChvC1nJ6m/AR+kt4amgRRZok/OeNay aSdVvP25PTh6EOYPm7lDB/cLQScOZKH4rnd9i283wbrryofYuxfgehkMbP1ZZK+LLxsB ZZwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Fp2RkB1pCrYBEWrmr7WWGm5IdX5zHS06x/S78zH3tQc=; b=jVlNLKY/GOrZcLi0k77IH8AW4bWxxvplSN752lc/QXpBF8eG8hqoTfm4EtDokCLg5t Bvv+BMeRX2bT3wzdv35vwa6XrSaZtFEknPMn60bZSCyI0ELb5mGOF2LmtYgWDgXkcJOX nWlwY6hmmWiTZN/FuUNL6CAfOPR4F6wPSzkRR5ZbV07vBNHsR2paegNDlrGMTEo8VVie Bf7dT8yumzWmsWcR2ClpNCuEUir4wspYNIrFzqLO1and7rCaEz3sowbZgXnjRsRBS3Tq vhNb8hnlEQ1z9+ZnQc9v1MpR5Ldt6iSxRE27TZ+V6/CPQKjDtgcJ8X8bGdHthhETF5zN +oBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BIdV8669; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a6-20020a1709063a4600b0072af54e038fsi818206ejf.286.2022.07.28.09.07.23; Thu, 28 Jul 2022 09:07:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BIdV8669; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230332AbiG1P7P (ORCPT + 99 others); Thu, 28 Jul 2022 11:59:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229842AbiG1P7N (ORCPT ); Thu, 28 Jul 2022 11:59:13 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1E8C6BD44 for ; Thu, 28 Jul 2022 08:59:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6E12E61C4E for ; Thu, 28 Jul 2022 15:59:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48F34C433D6; Thu, 28 Jul 2022 15:59:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1659023951; bh=UumqePG1sWgAECeyEvk1HAPaaYMXIQnD1SpC1qAihEg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BIdV8669AKDBtqjl/Owj6EVbIRjmd4o9WrbxlNeiGnhQ2O0+owDXJttVu7bWHvZzi S4GuDNfOTXRlSvInx/4YaSw/XxKXJ7AEBW6tMrJNYSid/NAsd1JS4k9gMkVjaBNQNS INjS9SNJdxkeYpWxh5HtwpubV2t2e1wo+sRv9b9s= Date: Thu, 28 Jul 2022 17:59:08 +0200 From: Greg KH To: Pierre-Louis Bossart Cc: kah.jing.lee@intel.com, linux-kernel@vger.kernel.org, arnd@arndb.de, rafael.j.wysocki@intel.com, tien.sung.ang@intel.com, dinh.nguyen@intel.com, Zhou@kroah.com, Furong , Vinod Koul , Bard Liao Subject: Re: [PATCH v2 1/3] drivers: misc: intel_sysid: Add sysid from arch to drivers Message-ID: References: <20220721123017.416438-1-kah.jing.lee@intel.com> <20220721123149.416618-1-kah.jing.lee@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 28, 2022 at 10:37:37AM -0500, Pierre-Louis Bossart wrote: > Thanks for the review Greg, > > >> +static int intel_sysid_probe(struct platform_device *pdev) > >> +{ > >> + struct intel_sysid *sysid; > >> + struct resource *regs; > >> + > >> + sysid = devm_kzalloc(&pdev->dev, sizeof(struct intel_sysid), > >> + GFP_KERNEL); > >> + if (!sysid) > >> + return -ENOMEM; > >> + > >> + regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); > >> + if (!regs) > >> + return -ENXIO; > >> + > >> + sysid->regs = devm_ioremap_resource(&pdev->dev, regs); > >> + if (IS_ERR(sysid->regs)) > >> + return PTR_ERR(sysid->regs); > >> + > >> + platform_set_drvdata(pdev, sysid); > >> + > >> + return devm_device_add_group(&pdev->dev, &intel_sysid_attr_group); > > > > You just raced with userspace and lost. Please use the default group > > for the platform device. > > > > I need to go remove this function, it should not be used at all as it is > > broken. > > Can you elaborate on the issue and suggested replacement? > > We used this function for the SoundWire sysfs based on your review > comments (2 years ago?) that we should not muck with kobj, and that > function devm_device_add_group() is also used in a probe function. Use the default_groups pointer in the driver structure. thanks, greg k-h