Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1268792pxp; Thu, 10 Mar 2022 02:03:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJyDFubM3iBKuof1pR9a7e08A/YNb0Y3b2rUOojLcugEaPVI4wEQB9KVbBo5a3Yc13wFY4nL X-Received: by 2002:a17:906:3583:b0:6d1:c07:fac0 with SMTP id o3-20020a170906358300b006d10c07fac0mr3385708ejb.749.1646906631236; Thu, 10 Mar 2022 02:03:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646906631; cv=none; d=google.com; s=arc-20160816; b=qSQRvo9KHeJ3K8DehrD3uxQY8Qt4pYZptoIy7KcnA/5BCZbfNBaPu7UdKP+YITVMRA 8vsrYTNVUEa7hItN+T1/AAhLwBzaQaJ8jspmFQPZ1vPKbKUPhRQ/gIRFAj6sLBBt26g9 yCgyruFZnF+3qCLhufFAe/vp17rR0fKnv/b+D8teuOhQc7fOQhQISgYT0b+UQZdtgCG7 obZYppHcJUXOYqyafof5x7O5ZH2pmG9+3ZMddbq/8GBjKhIA1elM+yL/7lVReq43mHlN VSIw0jazl3jluy4tIS+WH6Ngt8GOeXMzMSM6VZwnCRyt/BBfeoDuye0P5jmsjZTOmXft vESg== 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=WRZFEX7pYGRR7e/xmBzGCmppivvysGvYSgswSqDMt5s=; b=wL98ljVdlLRmVWoOGaQpUwWDveWhKFnXuBINUHvofVA0jeUsbkLiJDYdCBwFESuwem RSsPDMND1M+wlBLWgvfQOMald/vk/Ewz7b/DSzxhwGDFjQjmqhF0z5mD4QbfH5vWuHUz K+R2/4m8FV/2NGW/H5Ac0VfYhZxiGLGr2RP/sScIjwiHqCZYIMjRtNdTf7F1bka623XC oVFZvbNUIWm9cmmxdK+T/HPHklc9y996eZzShXo8VPRFSAcAxbcXu6w0EGDTyV3nykdp 50mNSUSjh+GyX7J3mO39Vw0PXC9MncGi4jLW21N0NknncFga7axuw+HgfvNoQ7U4PI5S uWOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rM7Dczat; 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 ss23-20020a170907c01700b006ce04d5158asi2184375ejc.194.2022.03.10.02.03.25; Thu, 10 Mar 2022 02:03:51 -0800 (PST) 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=rM7Dczat; 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 S238874AbiCIXbC (ORCPT + 99 others); Wed, 9 Mar 2022 18:31:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238870AbiCIXbB (ORCPT ); Wed, 9 Mar 2022 18:31:01 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA282117C98 for ; Wed, 9 Mar 2022 15:30:01 -0800 (PST) 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 922B761CE2 for ; Wed, 9 Mar 2022 23:30:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 64B21C340EE; Wed, 9 Mar 2022 23:30:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646868601; bh=HRZre433HPB4VoPyEcnIsBwwBfmflRQBMcNjT1al0f4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rM7Dczat29WwsOWxoL8bmQ8FHPO1f8WMCgrRU9NUsxagOwoXi87afRjQ/gl3usl+L tfhNO7XkyhRuVN8mnJdn3rNKn763jV4bRTtL14LX5Cx4h5guRWiikICQzuP2ksbToo I21ocOUIAH27jOTaWzZpcugmWOJdA+6iQ7U5iZWs= Date: Thu, 10 Mar 2022 00:29:56 +0100 From: Greg Kroah-Hartman To: Won Chung Cc: Heikki Krogerus , "Rafael J . Wysocki" , Benson Leung , Prashant Malani , linux-kernel@vger.kernel.org Subject: Re: [PATCH v4] driver core: Add sysfs support for physical location of a device Message-ID: References: <20220309230607.2005304-1-wonchung@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220309230607.2005304-1-wonchung@google.com> 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,T_SCC_BODY_TEXT_LINE 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 Wed, Mar 09, 2022 at 11:06:07PM +0000, Won Chung wrote: > When ACPI table includes _PLD fields for a device, create a new > directory (physical_location) in sysfs to share _PLD fields. > > Currently without PLD information, when there are multiple of same > devices, it is hard to distinguish which device corresponds to which > physical device at which location. For example, when there are two Type > C connectors, it is hard to find out which connector corresponds to the > Type C port on the left panel versus the Type C port on the right panel. > With PLD information provided, we can determine which specific device at > which location is doing what. > > _PLD output includes much more fields, but only generic fields are added > and exposed to sysfs, so that non-ACPI devices can also support it in > the future. The minimal generic fields needed for locating a device are > the following. > - panel > - vertical_position > - horizontal_position > - dock > - lid > > Signed-off-by: Won Chung > --- > > Changes from v3 > - Move dev_add_physical_location() and dev_attr_physical_location_group > to driver/base/physical_location.h. > - Use pointer and reorder physical_location in struct device to pack its > bytes. (checked using pahole) You forgot to test your code and see what happens when you remove a device :(