Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp595427imn; Thu, 28 Jul 2022 09:56:58 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u82KtrJh5ciedwQkUYSOdgLPccdi8nHI0WITI4JE9HBIHOXOJyrXA8P21BL6Oe3flZYOk0 X-Received: by 2002:a63:2a03:0:b0:412:518c:49d6 with SMTP id q3-20020a632a03000000b00412518c49d6mr23332148pgq.564.1659027417890; Thu, 28 Jul 2022 09:56:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659027417; cv=none; d=google.com; s=arc-20160816; b=SSx8iEu3ErQMK6ZQ3MBeGtpZL+1VMgPIliDEHOknLll9s2oZA8JDXRbrISlQr4RbCX QO12Terfh3nUtwz6hR1qXqa3ErCaLkHRlnZGoGbSmEloP0Dn7jJnVS8Rd3Gf2auPTI3p 9HPJFGkcRbLX2CSwEY+1WMCVIMaqeVCCDpgm9gubMlFcgpS0NaDZe3tjaTRNuDc4nSqu EprS83s+Y6Aj5ufdp/Lgj4B7LeWsHzbExKgiWMLE8isrEOyQLqQhOV21w5K1f4NjNs6G uP0jPIB+GMKphUov+4PyGn2ID3V2LUw8oLcxYrXByIDqSn7SqiwPuy3L0hHJobJl4kwO AFmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=cdZPrRW6gHtsuwBSOh9FUgQbh8p54rvHHUS0HM4l1jY=; b=Mgb3dl88KsgV0dwBqrTrgyMpu0uB1At7IePwEIGO8uDkOQTMWepD/dKvXDIiEvPlDJ G4TC45MKEYaht7Wj2zcIS2XMTiGaXPhyqZqeKiFufGCF4y2lNt3u7jXqEyWBjRG1l+Gy D2wk0b/7x/z6oZ7Fca1qZVzbzYjK0Wr6WGXlygYwF/e7ELfu3WSnux420YGWOVyZANwA oyXcJywvT2xjV0GpcEZG9B4rXgTaH0d41c8vin4SmY5OK8UsWWShEubzbnU73ADEkB9w ajIPoPp1kVhNOoFYNxhC7nGKNZQTOc5H2ZFoIm2+duP/SYEuxHdPGOz9wqE90bGZRfGi 8kVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=g2QGw4Vg; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n13-20020a65488d000000b0041212cbc60bsi1565413pgs.373.2022.07.28.09.56.42; Thu, 28 Jul 2022 09:56:57 -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=@intel.com header.s=Intel header.b=g2QGw4Vg; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230330AbiG1Qxi (ORCPT + 99 others); Thu, 28 Jul 2022 12:53:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229498AbiG1Qxh (ORCPT ); Thu, 28 Jul 2022 12:53:37 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4942371BDC for ; Thu, 28 Jul 2022 09:53:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1659027216; x=1690563216; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=daeOdoRNV6EtJvAH4DKhhNq1uuHrMofKvOUMeqjcUYo=; b=g2QGw4Vg8ZrNf050vyCM4docI5eypRhzoDDcaaUPkLJzMLiFJPNbR0oS qNX4mk36jWbOx7QNQceYmyGWCXd5KoKuWt1W/sdfROmBXjJCJQsII8+1Z plLNhyUPAXagPwQuPKYAVAyDI4BgKDH7fNvVk4Lkqf5aDBDw7k02uplQE uMygtEBqAOHjgzDAY739tlDyinIapcrde0lRbadt0Ts3pl86hkLTPM1OY tWhjPJ9ml0lwtUNZ0fovsZHuOpnKCbUJ2zW8hgScZCj6J26CSCHCdNAH+ luyQbsfiUcsvAO/MOI7BMeZetn74jlpjRL2eI/JVdsMXuprvdGkxAGEVq g==; X-IronPort-AV: E=McAfee;i="6400,9594,10422"; a="268945131" X-IronPort-AV: E=Sophos;i="5.93,198,1654585200"; d="scan'208";a="268945131" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jul 2022 09:53:36 -0700 X-IronPort-AV: E=Sophos;i="5.93,198,1654585200"; d="scan'208";a="633773817" Received: from tesmoryn-mobl.amr.corp.intel.com (HELO [10.212.62.40]) ([10.212.62.40]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jul 2022 09:53:34 -0700 Message-ID: <7686403c-7252-ef7a-70fc-040c5ab8cb79@linux.intel.com> Date: Thu, 28 Jul 2022 11:53:33 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.11.0 Subject: Re: [PATCH v2 1/3] drivers: misc: intel_sysid: Add sysid from arch to drivers Content-Language: en-US To: Greg KH 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 References: <20220721123017.416438-1-kah.jing.lee@intel.com> <20220721123149.416618-1-kah.jing.lee@intel.com> From: Pierre-Louis Bossart In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE 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 7/28/22 10:59, Greg KH wrote: > 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. did you mean dev_groups? I am not following the idea, for SoundWire all the attributes are really device-specific or described by ACPI and cannot be hard-coded in the driver structure.