From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0BF84C7618E for ; Fri, 21 Apr 2023 07:55:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-ID:In-Reply-To: References:Message-ID:Date:Subject:CC:To:From:Reply-To:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7MDUO9CEA20oIG/UZFlY6qAn5yrXvFtI4cObvFjknUo=; b=oaBx3GuLEXoF5Y qdxuEEmS6asGpTuRwrXr4ULDE/SkNIhLtZVHAdZd67ahLnhSydSJ9FyYlFvpqBlacihHmMGSyirtQ VjxK+fiWpXRODQ20cQV1MKpWmk9ogZnOF/VRAuFq3jgnlEI+4/VCfne7SOmQWwDdgDFRlCn2wkLQ+ NWVn6B1mKq6YrwP4t3Yj2us8aV5S3Ds3pRhKcN0oxlHrvO2x93xPKQDmoY1hjAZzlQzI2sFTAQOLo YZpmStYqPJrjBnyETDzd+HAA1GYhnPu0B1snEdc5Sr0b9Gq3eJZnNpHmEZBCcY3EDdR9rRzcUK6Am uUA5tf5Ymq0sJDB9Vz+Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pplay-00A1sV-29; Fri, 21 Apr 2023 07:54:16 +0000 Received: from mx0b-0039f301.pphosted.com ([148.163.137.242]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pplav-00A1rX-07 for linux-arm-kernel@lists.infradead.org; Fri, 21 Apr 2023 07:54:15 +0000 Received: from pps.filterd (m0174680.ppops.net [127.0.0.1]) by mx0b-0039f301.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33KLHYZi023441; Fri, 21 Apr 2023 07:54:06 GMT Received: from eur04-he1-obe.outbound.protection.outlook.com (mail-he1eur04lp2055.outbound.protection.outlook.com [104.47.13.55]) by mx0b-0039f301.pphosted.com (PPS) with ESMTPS id 3q3d6as90j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Apr 2023 07:54:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TLJykm05DAOOH8Ktr3LEOHMR4Q9MGfgr79XN/BSqc4111fTW//A+WH7nveAeLuN3FQ+w8hTA37x0bEkpr/f/1jijNSgb0XlgItpr6gd3CY07e2HCLjVckyVsNRcE5nDIgcljetSl8n5AO0uWc7yXniWB2cQIsbdg0ez+tRTiEvKqSkR0hBDPjkMPmAizbmGVXY6QEU9y8LjpAVQH3/7Ze/GHicV5YD1GyIBpbUR0l2mEPu4HMNdbMJr5FUxWO9x32IF02nIFmenkPtHJKCj284TPfnSRAyYOpCfhZEdcjnaDGcc/4oiCtZf/iHevMiMSI0BNQxqhwMRD6mf6P7X9WA== 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=iVEQNFC1jPHwjp7bP+IxvgS8pIKVaq1JO3a8IeHuouA=; b=ZcP/ogGyg3BvJDsz601XF5qcs0M25UZ1jv3Y+kHKfvK9nph0+GARXXt0cP3z5tJcIAzh0EQbPhqz5ncbbHnTw1S65WQjIg2gBC8bdshN8Ofj/7lIFr7twFyKjdgbGf3VbqYGIZEFxQifTz0t7LeWAWVLYImstKoSTI0QZbkPFm8W38thpipiJ9/nhE0sibKukzmTiiKuSmAVo5kmEt4Gd/o7+lYcMUpWJtoSpAy05jSuZc7BK/V7WrjO0LuSPTX6B1QTqgphsrSspMh8kYGChYxhuojpJJ9KpSMr1Dyrih8hPXUPIVflM8NZ6u2o9GIfIAt5LbVsKDC8C0APKoh4UQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iVEQNFC1jPHwjp7bP+IxvgS8pIKVaq1JO3a8IeHuouA=; b=JWhudaT4oW0a4K2UPJUO6PNBzFK+rfnjib9nrWQM4WCJ/OwKsDzz7HXdZSEhuAiZzNBuYDHIjWJSSwsdkSvedpYbUPkt4hI10iaeGu3yKFRTDS7FcfaR9HhVNX1oqnFmMFwK2C9KO9wKUV9vQ/fXtKkG/Wuo0bsKfbAR3HjfUVJnMnIN9eW1qfj7OeKTWMgJgPSFIeE2tPEHV87PBMjDR9DKgPrdMSdN/FuGf+XSYStMUiRefo2fWxR0stoWLYHMOGeubuYBHxLxh5iaAvEeDjcJxfbnzdCD/VbqkFPbfIYwCS1fB1Bh1tlaYyamRQoMM6zhFEUZQbEfxSChYWM2pA== Received: from PA4PR03MB7136.eurprd03.prod.outlook.com (2603:10a6:102:ea::23) by AM0PR03MB6228.eurprd03.prod.outlook.com (2603:10a6:20b:15d::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.45; Fri, 21 Apr 2023 07:54:03 +0000 Received: from PA4PR03MB7136.eurprd03.prod.outlook.com ([fe80::bcf5:cd14:fd35:1300]) by PA4PR03MB7136.eurprd03.prod.outlook.com ([fe80::bcf5:cd14:fd35:1300%9]) with mapi id 15.20.6298.045; Fri, 21 Apr 2023 07:54:03 +0000 From: Oleksii Moisieiev To: Cristian Marussi CC: "sudeep.holla@arm.com" , Linus Walleij , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-gpio@vger.kernel.org" , "michal.simek@amd.com" , "vincent.guittot@linaro.org" , "souvik.chakravarty@arm.com" Subject: Re: [RFC v1 1/2] scmi: Introduce pinctrl SCMI protocol driver Thread-Topic: [RFC v1 1/2] scmi: Introduce pinctrl SCMI protocol driver Thread-Index: AQHZaTpLwL07BD9460y7/F64OnMs/q8oQvCAgAw/L4CAAATzAIAAF4AAgADb2IA= Date: Fri, 21 Apr 2023 07:54:03 +0000 Message-ID: References: <54119b2cb43e29f69c5858a5320d3a58f23fed21.1680793130.git.oleksii_moisieiev@epam.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PA4PR03MB7136:EE_|AM0PR03MB6228:EE_ x-ms-office365-filtering-correlation-id: 2d414f10-0e80-402c-7343-08db423d932c x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 9+RKZY1NnxPOgKBMiDDqhWEV70KH5O6PusDyWgVntAMthRNm/U9jZ1LGDT0h3xaoZuSxubwyLQEr42ekK/rjtFmDxh8yjPOrlLfQ188eakRvpqwCE2wmXuLweTFZ2qJSJxGrFJzCQulZWzcXHaerZYvO0J3dumDFSeTTXqGYFE9eGpw78Fx1+WfHI0rDenfEjPIjILn7pIP26TJttlB3KcqAlXCM5ll2gi3U3PuVkdOX/ndk4ifeLj6D+nQt9OR1hV2KWiRAcoboUYacxSUizFoaOL4Xg1qzCIWfP3AeAk5CtAUYrwEB6X+JMoJVGdcDToyMgqPZZaILRRHPaMzKwf4o8yIZeO1+6w7Ad5of2eHiHpFU1O90ARlVTrHPpueb9KhbWb/GCf8LNRbXmXBiqVD4jQVfW36EIxbhuTtRCYgWiHhvrQz/D1/vUVJD1m8eKmsBBgQyYPBDVe0Mhr3HXIh+/McDQmxfneFl3oaYeP3KKrLUV/TQR4Y8IhECXgwtk55Q9u1mRwRSDPGC3ZzVKM9GpvEGfMy1eVJOmVbASrEMS1nkT8MZaPHTfTKM5LU1B5eLd0kTqgd1+UuH//mNz1wH7PhZiRd9bZhFtSpsbFT1LFLbPT8xFjJubO96pL6DSjXZbptkdtOd0972+MfVmA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PA4PR03MB7136.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(396003)(366004)(346002)(136003)(39860400002)(451199021)(122000001)(31686004)(316002)(4326008)(54906003)(6916009)(66446008)(66556008)(66946007)(64756008)(76116006)(66476007)(966005)(91956017)(186003)(6512007)(6506007)(26005)(53546011)(2616005)(83380400001)(38100700002)(5660300002)(8676002)(41300700001)(8936002)(478600001)(71200400001)(6486002)(36756003)(31696002)(38070700005)(86362001)(2906002)(45980500001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?bVF3c21aZ3VQRnpYK3FyOE9WSWRiNEVISXNRRlFaeFhZbVA1K09BRVF5YnEv?= =?utf-8?B?MnpxcUZja0RZZkFtSm9XT0Z0MjMzTXFGQzlmMU05azVGV05JVWIxWWhEVFRn?= =?utf-8?B?eVd6TzU4MEVlTGN0d1poUzBZVllndlVUdWlESWxxNXFaOFNLWjZ1MTllcGJj?= =?utf-8?B?TWt3ZTdVeE9jWk5xc1BQTjRTRW5yaEM0N1FwSVhIaUtVWktoUjRCbGdpbERH?= =?utf-8?B?MGpOeG93a1J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ZjZySG5J?= =?utf-8?B?VVAxVHc3NGZPTHJiMFdwWW1aZ1k4a2ViemNRRWxsTGV1YXVrMmZTellnU1Vk?= =?utf-8?B?K3F0QmN0UnlJVmxkcVJvSWFOS3hSUStZRmdReEtGdlljK01ZcWZCL3NPTUdy?= =?utf-8?B?Smc9PQ==?= Content-ID: <6F91A23F6275684CA1D7F4030BB04FC7@eurprd03.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PA4PR03MB7136.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2d414f10-0e80-402c-7343-08db423d932c X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Apr 2023 07:54:03.2253 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: FtzAp+K5OJOVA7KZCKS8kUQuAJruPuslLadDAJC20FTeGRBJvP7IeIeXcbYz1EOUhfgLSSRanTueOnHXnn4pcy0s1mG53TxtcjKEOdjDH0w= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR03MB6228 X-Proofpoint-ORIG-GUID: jJ0B8EPSCUX-w0JbkJdniU-BPMlZoAg4 X-Proofpoint-GUID: jJ0B8EPSCUX-w0JbkJdniU-BPMlZoAg4 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-21_02,2023-04-20_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 impostorscore=0 malwarescore=0 phishscore=0 adultscore=0 mlxscore=0 bulkscore=0 mlxlogscore=822 suspectscore=0 clxscore=1015 spamscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304210068 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230421_005413_363171_A7CE12BE X-CRM114-Status: GOOD ( 25.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Cristian, On 20.04.23 21:47, Cristian Marussi wrote: > On Thu, Apr 20, 2023 at 05:23:05PM +0000, Oleksii Moisieiev wrote: >> Hi Cristian, >> > Hi, > >> On 20.04.23 20:05, Cristian Marussi wrote: >>> On Wed, Apr 12, 2023 at 11:04:05PM +0100, Cristian Marussi wrote: >>>> On Fri, Apr 07, 2023 at 10:18:27AM +0000, Oleksii Moisieiev wrote: >>>>> Implementation of the SCMI client driver, which implements >>>>> PINCTRL_PROTOCOL. This protocol has ID 19 and is described >>>>> in the latest DEN0056 document. >>>> Hi, >>>> >>> Hi Oleksii, >>> >>> one more thing that I missed in my previous review down below. >>> >>>>> This protocol is part of the feature that was designed to >>>>> separate the pinctrl subsystem from the SCP firmware. >>>>> The idea is to separate communication of the pin control >>>>> subsystem with the hardware to SCP firmware >>>>> (or a similar system, such as ATF), which provides an interface >>>>> to give the OS ability to control the hardware through SCMI protocol. >>>>> This is a generic driver that implements SCMI protocol, >>>>> independent of the platform type. >>>>> >>>>> DEN0056 document: >>>>> https://urldefense.com/v3/__https://developer.arm.com/documentation/den0056/latest__;!!GF_29dbcQIUBPA!0kMLQ5c3tKsMfWCqTKHp6eolY3sTZlyKmAD7B7pbiSESABUUoBzmhgrYdDgWGC_g0vgLE4zwrS4ppeTOD8KizP9fIeJkpg$ [developer[.]arm[.]com] >>>>> >>> [snip] >>> >>>>> +static int scmi_pinctrl_request_config(const struct scmi_handle *handle, >>>>> + u32 selector, >>>>> + enum scmi_pinctrl_selector_type type, >>>>> + u32 *config) >>>>> +{ >>>>> + struct scmi_xfer *t; >>>>> + struct scmi_conf_tx *tx; >>>>> + __le32 *packed_config; >>>>> + u32 attributes = 0; >>>>> + int ret; >>>>> + >>>>> + if (!handle || !config || type == FUNCTION_TYPE) >>>>> + return -EINVAL; >>>>> + >>>>> + ret = scmi_pinctrl_validate_id(handle, selector, type); >>>>> + if (ret) >>>>> + return ret; >>>>> + >>>>> + ret = scmi_xfer_get_init(handle, PINCTRL_CONFIG_GET, >>>>> + SCMI_PROTOCOL_PINCTRL, >>>>> + sizeof(*tx), sizeof(*packed_config), &t); >>>>> + if (ret) >>>>> + return ret; >>>>> + >>>>> + tx = t->tx.buf; >>>>> + packed_config = t->rx.buf; >>>>> + tx->identifier = cpu_to_le32(selector); >>>>> + attributes = SET_TYPE_BITS(attributes, type); >>>>> + attributes = SET_CONFIG(attributes, *config); >>>>> + >>> Looking at scmi_conf_tx and these pinctrl get/set functions, you do not >>> seem to consider the ConfigType field in the SCMI related messages, so >>> basically using always the Default 0 Type, and as a consequence you dont >>> either expose any way to choose a Different type in the related SCMI >>> protocol ops; I imagine this is because the pinctrl driver currently using >>> this protocol, at the end, does not need any of the other available types >>> (as in Table 23 of the spec). >>> >> I'm not sure I've understood your point. Pinctrl subsystem pass config >> in so-called Packed format. So this means that config is both input and >> output parameter. Packed format means that u32 config has both config id >> and config value packed inside. >> > Sorry I was meant to make the above comment on the PINCTRL_SET path but > I messed up and commented on the GET path....my bad. > > Anyway even considering the packed format and looking at the PINCTRL_SET > function scmi_pinctrl_apply_config I dont understand how this works. > >> So I receive packed config with both id and value on config_set call and >> then just send it over SCMI, expecting error from server if config is > This is where I dont understand: you receive a packed 32bit config from > pinctrl subsystem via ops->set_config together with the pin_id and in turn > this calls down into this apply_config where you build the packet: > > >> + ret = scmi_pinctrl_validate_id(handle, selector, type); >> + if (ret) >> + return ret; >> + >> + ret = scmi_xfer_get_init(handle, PINCTRL_CONFIG_SET, >> + SCMI_PROTOCOL_PINCTRL, >> + sizeof(*tx), 0, &t); >> + if (ret) >> + return ret; >> + >> + tx = t->tx.buf; >> + tx->identifier = cpu_to_le32(selector); > you set the pin number > >> + attributes = SET_TYPE_BITS(attributes, type); > then set the Selector type as PIN_TYPE in the attributes bits 9:8 > > >> + attributes = SET_CONFIG(attributes, config); > And here you set the PackedFormat received from pinctrl into the > bits 7:0 of attributes...(...BUT you then assign back to attributes > which is 32 bit so I think this is another bug because this way you > clear any bit just set above with SET_TYPE_BITS...but this is not the > point now...lets ignore this... ad you should anyway use bitfield.h in V2) > > ...so this attributes now, as you explained me, include both the selector > type (PIN vs GROUP) in bits 9:8 (bugs apart) and then, as a packed format > the ConfigType and the Value to set, both packed into the bits 7:0 > >> + tx->attributes = cpu_to_le32(attributes); >> + > You convert to proper endianity and > >> + ret = scmi_do_xfer(handle, t); >> + > send straight to the SCMI server as a payload for PINCTRL_SET....so you > send basically the pin identifier in this case (u32) AND the u32 with > the attributes which includes the Selector PIN vs GROUP and the > ConfigType ..this last as a packed thing including also the value... > (so this could contain....looking at Table23 as an example: > Bias-pull-up (4) + a value in Ohms) > > ....BUT from the spec v3.2-BETA regarding PINCTRL_SET (4.11.2.7), you are > supposed to send one more u32 field "config_value" as the payload of > PINCTRL_SET (page 172) wth such field beaing the effectively carried > value to set....field which is instead now NOT considered at all and > so just sent as zero all of the time ... am I missing something ? > > ...so my understanding is that, being the expected format by the spec as > in 4.11.2.7, you should instead pick the PackedFormat your received as a 32bit > config, UNPACK it and split it into the attributes and config_value field.... > > from the v3.2 BETA spec I have I cannot see where the 32 bit attributes > payload is supposed to carry straight away the packedformat value... > > ...as it is implemented now, it is out of spec (at least the latest > v3.2-BETA public that I can see)... and if it works for you, it just means > your backend server is equally out-of-spec....which is probably a way of being > compliant BUT not the way we need to here :P > > I cannot see any other way I can interpret this to make it > work...apologies if I am missing something, in such a case please explain... > > Thanks, > Cristian Thank you very much for the tip. This is definitely an issue that should be addressed. I'll fix that and provide with v2 which I'm currently prepare. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel