Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2124423pxb; Fri, 25 Mar 2022 11:30:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbQ4VtUle9VV8jb6ikD73QgKyu0dSBi8eWSSeQywyJAh4EPkRXwkoPcBEvgDZLLDDHzTIV X-Received: by 2002:a17:90b:17ca:b0:1c7:3010:5901 with SMTP id me10-20020a17090b17ca00b001c730105901mr26607824pjb.22.1648233056953; Fri, 25 Mar 2022 11:30:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1648233056; cv=pass; d=google.com; s=arc-20160816; b=mEVtO5neexfE5EFrtsghDH1xUII5EY0y8ERWqG/rPgRgwpNRoHEGsZjFxoMyVLm620 1WGDOZF2ujk1ub1wFsDT6NdF6slGW0WWdzkK6jx4cnRhhgZ8jZmtR3U45yZhukg7vDz5 WBdO6l1hhq6fsVisor72zo2czcYupMTAiA3pxvYUV7xdvgoS8IGKpB+BT1qwFPjgmH29 nr4GgWogZKKJ8+AbAUHVRn1e8JJaioRwOAo1ez4h8IEINw1rWn8o8cXFiIWfzEg7JAAB 7QCsNHwDGO0JxTLkLRKhurQmvcFyvk/wTm7RSkHD+qe9UEGpDPGZIilZTjgKNUHps93x z5UA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=N9+N1K229mRbayj/wys3v/AgMptJmcUQvpBhO5YaIcM=; b=QtoWI4BU23/fMtI/jGZxSVh5BiVSqzBrcBAEcpeeznGIvs5mJ5mBpTXvKkdDgrAqkO 7xk1Jr7S+GDbySs1K2Wpmc7/N8goacgxIWlCPEQTT1UnMgD4XGzmAFOmZTWOzYUIREyb rkwsyhX0T6/zrfULgODPFNhzPULKqOLuTYPD/Dy7IIyp2VWAxeYcis9+6gAeO2kV+mkD tlD/rbofA9t5k2jtvLH77raCK+iRaAJ+mElC2VSC9lqA9PaDq/3kffxoSrx7E0/syqDh RCNQztI6QbgZc8UWTKv+piTR2Z0VxgKuMMyMUWP2/DRxW1G88G98y/JkxfG68coA4bIh 7mug== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=tFY92wS9; arc=pass (i=1 spf=pass spfdomain=os.amperecomputing.com dkim=pass dkdomain=os.amperecomputing.com dmarc=pass fromdomain=os.amperecomputing.com); spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amperecomputing.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id e21-20020a17090ac21500b001c63c733bfasi6152230pjt.130.2022.03.25.11.30.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 11:30:56 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=tFY92wS9; arc=pass (i=1 spf=pass spfdomain=os.amperecomputing.com dkim=pass dkdomain=os.amperecomputing.com dmarc=pass fromdomain=os.amperecomputing.com); spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amperecomputing.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BB37718614B; Fri, 25 Mar 2022 10:52:37 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355505AbiCYHQQ (ORCPT + 99 others); Fri, 25 Mar 2022 03:16:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344936AbiCYHQO (ORCPT ); Fri, 25 Mar 2022 03:16:14 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2116.outbound.protection.outlook.com [40.107.223.116]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39B58C6EE4; Fri, 25 Mar 2022 00:14:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aG3MZof8SebsTrC6fjwEI3tvgUHG1EArcIwUF8yxP3uXkJQTY9LzWpG0oZbEgkMX8yw0cUbW+qG0sHalYAbChi7Akp25BvAVg6hgLOvHfVu2/GEpuSdxIX3xvcdOZqWz0aBlM89uvJ5+z3wva3f89vCLyTryZKbG+KRfZeUK+RzL8D7W+SzJ4+99O6grCyNxV5bV4O1ZEOLg8nAIs3VvNkhS14xOV1Qw3kYH8puqbIUbiEnQRytf6BFBLI/zwmpIrbPSxIcOdxphuDTu0bWRKCB3mK6fj3zshrMJCXH0uW2HpqrhKPDio8eDrmpjkqMLwTqsy2S4kWSLjvTZy464xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=N9+N1K229mRbayj/wys3v/AgMptJmcUQvpBhO5YaIcM=; b=M6Gh5lxS1Rz65ZCyYPmYXIP2ZU9fNsrAoc90XicGTMUjZtZjIRuGpKa9IMlDqnwTTldchOjAVtDx72fwOuE4lUzg3yUAgUZh45vjRUZS3P7AgPRiCwvXmrFyXRU8zZEbaBmcrTUIA/WtfJZPiKdytRWKJ6Xkcce+QgD8gSqE7Bg7uW75k/lNgnULGYuALU44TXNR7cy8bzv88PIfpoi5fq3NlTiicbAd15ftu6O4ytu5yJw67oZSP4OAnotCfrfN35+E485wihsxOCPOoUbWg2BII0II6H4JwaE2ddhxYUf+bKpa+4SOPQ9mYLjpJdhBDVAsmI5N3nMjwZAtYFCEpA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=N9+N1K229mRbayj/wys3v/AgMptJmcUQvpBhO5YaIcM=; b=tFY92wS9AH2lVSNrjhAJWTTxfPH/I0zT5BLb9GiKEMdN5h0hwjNSpalR6QAnjSGfNZZEswMlt7Fx2Fv19GcWFZNUGpiv6xGNR+Js825Sv7LGYG/VRFcOcDnNVemsLsTdbI9m/DNQwpyHkWEGuyQe0fFBgJr/eIwtMWUCVmKKuag= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from SJ0PR01MB7282.prod.exchangelabs.com (2603:10b6:a03:3f2::24) by MW2PR0102MB3465.prod.exchangelabs.com (2603:10b6:302:5::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.18; Fri, 25 Mar 2022 07:14:38 +0000 Received: from SJ0PR01MB7282.prod.exchangelabs.com ([fe80::cd24:39ed:7042:46d6]) by SJ0PR01MB7282.prod.exchangelabs.com ([fe80::cd24:39ed:7042:46d6%7]) with mapi id 15.20.5102.019; Fri, 25 Mar 2022 07:14:37 +0000 Message-ID: <0d8605f2-0556-3b83-998e-823b924b9a1a@os.amperecomputing.com> Date: Fri, 25 Mar 2022 14:14:24 +0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 Subject: Re: [PATCH v7 5/9] misc: smpro-misc: Add Ampere's Altra SMpro misc driver Content-Language: en-US To: Greg Kroah-Hartman Cc: Lee Jones , Rob Herring , Krzysztof Kozlowski , Jean Delvare , Guenter Roeck , Jonathan Corbet , Derek Kiernan , Dragan Cvetic , Arnd Bergmann , Thu Nguyen , Gustavo Pimentel , open list , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "open list:HARDWARE MONITORING" , "open list:DOCUMENTATION" , OpenBMC Maillist , Open Source Submission , Phong Vo , "Thang Q . Nguyen" References: <20220321081355.6802-1-quan@os.amperecomputing.com> <20220321081355.6802-6-quan@os.amperecomputing.com> From: Quan Nguyen In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SI2P153CA0023.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::6) To SJ0PR01MB7282.prod.exchangelabs.com (2603:10b6:a03:3f2::24) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 01dfc0bc-c229-4c92-8aef-08da0e2f1f01 X-MS-TrafficTypeDiagnostic: MW2PR0102MB3465:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PBxdOvT2EVMR5IBGa66eunnrRdmugOljVY8v/G7my8olN9b1KnE2ktqpU0npCgVn169FjxIrEBJPlL5OXLl7cvPgL8brtAOwObHcCWRj7YmfVk9U+n/5mW1X5ZrRrqtJOeOaL7m3oAvmMBwxnoF3nDPpYPynd9dTKP8iPsHbmnulV3GYixBklbFN2M984ejtENYJBHd4at0ACy2jmTYs4FHDVD91ZyZPjoSoXgdO2wLksQPv0WU5gWPmQmh4OVQiVdTclRACYTNrg+RdrvV++bpET+v60xRgmW0srB6LzmN4+lHqhNVCeL80XziMXRLBU0YjGRBXIl2UOU2qk3CHsVDApiFXVHP+9wrJobAhaBLfpuNsrkcfPU4pDO+61p/FcPTQkDCt99fzXEiDbWMMLLiyxvwfEc5g3P3HOqhvFQTvXf9PFGj2MAviDh6y7l5tWHE/UF3CGTZPbCj3ofP3Npb3yh+g23Q8U3qh7STwXXmggDf0M9Pw+63NmetfW3Kk7e7oZAMWR9bbIYpchozm7P50dUkOzs/MkX6QEIL82qZT/JLVAP15Hj/baDoKsnqMDBK7kbJYFn1Jbe3V4ZH9jQwSllotDEmOKCXmR/SasRBx3meBwwlibgBm9GxbEyL9lVN+1MDYZO8/4y6BZmhSUlqTvuCKy4ODeBaxRAr6JKYgp6xvyqblkbsqWru7FGRt+vy3EepOMHS9+Hl1/ETXBlgzkVjnjOAok8CdPI7qwEDw0R/H3YKJPkKKmdhZ2iai X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR01MB7282.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(31686004)(8676002)(38100700002)(83380400001)(2616005)(86362001)(31696002)(53546011)(6512007)(7416002)(5660300002)(6506007)(6666004)(8936002)(52116002)(6916009)(66556008)(2906002)(38350700002)(54906003)(316002)(508600001)(66476007)(66946007)(107886003)(186003)(26005)(6486002)(4326008)(43740500002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?QmVMYk1xeUZKSC9aQ2lCeG9FWEp3T2xJNHdsOGtzSUZ5OXlMdDBiV3hqb2g4?= =?utf-8?B?K2h2SlhYMUxoMzA1aWRPV1VpeDIwOSt6WGtJNFptZnpkbW5ENzVoc1grY080?= =?utf-8?B?d1psdk9vQTF3QVlSeG4zRmthYzF1S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?= =?utf-8?B?ZWJDckVlbDZhem9NNWpyUlFMcnlwWDUybUwzbWFyYVBGWFprU0JLYWJEMWkz?= =?utf-8?Q?biDwm/7z0aHrvYgoI4cjb9fSyX0VV8=3D?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 01dfc0bc-c229-4c92-8aef-08da0e2f1f01 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR01MB7282.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Mar 2022 07:14:37.6555 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 845t9BOadNgylpYl9b8UwTlaWA6hOsEAEvx8zESCe5C96XcCFBpTguDAUU6tXBmQ5WjqM7S2NtOb22vrxSfrtPoOnCsSZb9vaBUHm0nMbpY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR0102MB3465 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no 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 21/03/2022 17:02, Greg Kroah-Hartman wrote: > On Mon, Mar 21, 2022 at 04:46:50PM +0700, Quan Nguyen wrote: >> >> >> On 21/03/2022 15:21, Greg Kroah-Hartman wrote: >>> On Mon, Mar 21, 2022 at 03:13:51PM +0700, Quan Nguyen wrote: >>>> This commit adds driver support for accessing various information >>>> reported by Ampere's SMpro co-processor such as Boot Progress and >>>> other miscellaneous data. >>>> >>>> Signed-off-by: Quan Nguyen >>> >>> No Documentation/ABI/ entries for your sysfs file? >>> >> >> Thank you, Greg, for a very quick review. >> I have put this file in other patch. >> >>>> +static ssize_t boot_progress_show(struct device *dev, struct device_attribute *da, char *buf) >>>> +{ >>>> + struct smpro_misc *misc = dev_get_drvdata(dev); >>>> + u32 boot_progress; >>>> + u8 current_stage; >>>> + u8 boot_status; >>>> + u8 boot_stage; >>>> + u32 select; >>>> + u32 reg_lo; >>>> + u32 reg; >>>> + int ret; >>>> + >>>> + /* Read current boot stage */ >>>> + ret = regmap_read(misc->regmap, BOOTSTAGE_CUR_STAGE, ®); >>>> + if (ret) >>>> + return ret; >>>> + >>>> + current_stage = reg & 0xff; >>>> + >>>> + /* Read the boot progress */ >>>> + ret = regmap_read(misc->regmap, BOOTSTAGE_SELECT, &select); >>>> + if (ret) >>>> + return ret; >>>> + >>>> + boot_stage = (select >> 8) & 0xff; >>>> + boot_status = select & 0xff; >>>> + >>>> + if (boot_stage > current_stage) >>>> + return -EINVAL; >>>> + >>>> + ret = regmap_read(misc->regmap, BOOTSTAGE_STATUS_LO, ®_lo); >>>> + if (!ret) >>>> + ret = regmap_read(misc->regmap, BOOTSTAGE_STATUS_HI, ®); >>>> + if (ret) >>>> + return ret; >>>> + >>>> + boot_progress = swab16(reg) << 16 | swab16(reg_lo); >>>> + >>>> + /* Tell firmware to provide next boot stage next time */ >>>> + if (boot_stage < current_stage) { >>>> + ret = regmap_write(misc->regmap, BOOTSTAGE_SELECT, ((select & 0xff00) | 0x1)); >>>> + if (ret) >>>> + return ret; >>>> + } >>>> + >>>> + return snprintf(buf, PAGE_SIZE, "0x%02x 0x%02x 0x%08x\n", >>>> + boot_stage, boot_status, boot_progress); >>> >>> sysfs_emit() please. >>> >> Thanks, Greg. >> >> Will switch to sysfs_emit() in my next version. >> >>> Also, this is 3 different things, put all of these in different sysfs >>> files. >>> >>> thanks, >>> >>> greg k-h >> >> Actually, no. It is single value of boot stage. > > You are displaying 3 things in a single line, those are 3 different > things. > >> Let me explain: >> The boot progress consists of three things together: boot_stage, boot_status >> and boot_progress and they have no meaning if reported them as three >> separate values: >> + boot_stage is to indicate the boot stage >> + boot_status is to report the result of that boot_stage: started, complete >> or error. >> + boot_progress is to report more extra information for the stage other than >> the boot_stage/boot_status. > > Why are these just not 3 different files? They describe three different > things, please do not EVER force userspace to parse a sysfs file other > than a single value. > Thanks Greg for the comment. As there are multiple boot stages that occur even before the firmware is able to report, the firmware will stores all the stages and make them ready for later access. Later, on each access, ie: read to sysfs, the earliest boot stages will be read out and the next stage info is made ready for the next read by clearing the current reported stage. As these three piece of info only make sense when put together, we chose to providing a single file only so that when the sysfs is read, we can provide them as a single value and do the clearing so that the next read will return with the next stage. My intention for next version is to report a single 12-byte hex value for this sysfs. - Quan