Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752834AbdGSHPy (ORCPT ); Wed, 19 Jul 2017 03:15:54 -0400 Received: from mail-eopbgr40133.outbound.protection.outlook.com ([40.107.4.133]:63760 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751376AbdGSHPu (ORCPT ); Wed, 19 Jul 2017 03:15:50 -0400 Authentication-Results: pengutronix.de; dkim=none (message not signed) header.d=none;pengutronix.de; dmarc=none action=none header.from=axentia.se; Subject: Re: [PATCH v2 1/3] mux: Add mux_control_get_optional() API To: Stephen Boyd Cc: linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Rob Herring , Rob Clark , Peter Chen , Andy Gross , Jonathan Cameron , Philipp Zabel References: <20170714214005.14967-1-stephen.boyd@linaro.org> <20170714214005.14967-2-stephen.boyd@linaro.org> <150043011983.23422.10872793103087420242@sboyd-linaro> From: Peter Rosin Organization: Axentia Technologies AB Message-ID: <1c20e9bf-9b87-a021-bb4b-8add6c468c87@axentia.se> Date: Wed, 19 Jul 2017 09:15:38 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <150043011983.23422.10872793103087420242@sboyd-linaro> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [81.224.168.30] X-ClientProxiedBy: VI1PR0802CA0010.eurprd08.prod.outlook.com (2603:10a6:800:aa::20) To HE1PR0202MB2553.eurprd02.prod.outlook.com (2603:10a6:3:8f::23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 02ccd4dc-3faa-41c2-da1b-08d4ce75f96f X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(201703131423075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:HE1PR0202MB2553; X-Microsoft-Exchange-Diagnostics: 1;HE1PR0202MB2553;3:eoaMjSW+Jhe1m0Y7jiv1slTBZ5fn7aYb6ZqnA7rcERxnWIp35TJjT+qJYvpSsCJbCTYa50rX82rM0oY2qaex1tWXIiAJppgYJx1ffYt5qibocQ/fhZsq5w45Kk2AbVvK5Cp9KjsrYL8RRQGccmbB08qF5not+7XrgpshXLkKnV0Ap0EWKbM6rNwyNy/zPM7yKQZ3e5u+uG7XiWcpEXRFjelLdatKHVtJdz4aGE7OE8yXxHfRK5B4HbhBFGoYxh8o2cmvqyffRlXDTNiq6W5+HfUYp9nm2O64KvCRkDgGLa4iWQ/pnhECr98YdSw6yBtz54JLSNKWhUPa51QaSkdKcShIL87m/PVCNK60Ws4P+17UzgGu8HXHHgbYwpjmlG7R8BpFjsBh6xrEBJzHMF/Hvlm/IL4Kf972Cllx1BtXWl3wCBJi7a0yJTrtxAvYgJrTLkYosOaHa0fvXZUJkW3xgoGZjtyx1PhOJT9elC0H2pP6WetrnUtlXgMIz3UMmZsOGihQJqTxxsTZyKY5AUNbSMJ7+4hHTQ3VNWAXouiV/rXDsa4vnljd2c8AlsOrAS7tNHLUh9qqEcyWFuQiWeNXTYmyR2q5CG9yRkmvyLtdn2DYS/mtpJHuE5lpggoVsbN+F6C0F37xQLoiGwX9xFZPtZxuyzqwoDcvqgxOMaP/osbMneu3jN1VxXWYrgacC8wnTSFrjJDA6KGVxUOtvHi+4g== X-MS-TrafficTypeDiagnostic: HE1PR0202MB2553: X-Microsoft-Exchange-Diagnostics: 1;HE1PR0202MB2553;25:JxBM9RnjzsTFI+rhm3+3JQqbix5a85gO4w7CuYELqo29KjW4f9rcOCmD6FRH+h389mlWpR/MsA+8/GD4ObKZh6HO4VDk99JY63/TN008UNVK+B2TcEM99pRaokRin+h76Hn5ZTJw/X+bw3QazPFJ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MA0DmfdzHV8AS9quZVMwgAXUKMG6Qa1ZDUfjDhoSM/FOdAMtx/FEsiVsCfrkDmbuR9LbZXIxWPe5kTvVny0KPKoAEymH2BB1le/YtItTrY3uDQ/VGv6nFpHkvhq70ed1lLIAF/YL1EoF4AOzAhjA3YPKr/p1SV9v64mDNzXtcJuaJ/s1zcO3UsaAExQJZn6BpQvqL2jvyCEjj3A1lqsRbhRBngwQc9gBfA6zS+1WcXm7CBTi+DiBRxGRgngKPcV6fL4CL29SvanvaTO0eJ+bNQDy5T1yNAOX5i/XCCuVa7KApvOgnLEWlMfRTfhbVR2zIl3YeTO3Dt+8twwBtXWbaN1MsYlZkpf8hxQPE6m5UiuSY8PNIe4i5OURD2TObDRnK3kYg9MoOsxGvFyu1vr3hpAB169jzqpl55oLuE+lKw0iZtUl92UXAhyKfhivictPsDHuD5hlB6OOsKQ== X-Exchange-Antispam-Report-Test: UriScan:(236129657087228)(247924648384137); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(2017060910075)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(3002001)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(2016111802025)(20161123562025)(20161123555025)(20161123558100)(20161123560025)(6072148)(6043046)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:HE1PR0202MB2553;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:HE1PR0202MB2553; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtIRTFQUjAyMDJNQjI1NTM7NDpWcHZOcmRtTWg0cHVudG8xRzZrNGdqUzdy?= =?utf-8?B?ODFHT3FIZzdMSTZaQmEwRFBiSEp4K1hBY3JqbHV3Y0FuREgybDZ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VHFyZi9obk84RmRMRVJE?= =?utf-8?B?UzFLN2JhcUxXdUJ5U1Y3NWMxR1NWelhiZVRzTFNOU0JIMzhONXRENGNqcEoy?= =?utf-8?B?bWpoWml6aVdBVFNjektHbTJxNlI3Rm9odngzVnR3ajNidXNIa1IzUlB4Zll0?= =?utf-8?B?WkdSSTdpQUlxNG9zb3ZNVU1tZ0ttbGI0R3E4TG9CMnpqOStXSU9LU3d1azJY?= =?utf-8?B?WlJVVk5mc3FzTjFTcWhrbkR1elZTTHltQ09YVStYK0psOXZ5STE3eVY0STRy?= =?utf-8?B?cWZGMFNZYWgyWFB4SDlyMkxwYVdoZDc5T1lYeWNicC80aGMyV2laK3doSG1J?= =?utf-8?B?TVpod2NwdTdJWDBSakNTOXR2TG5FaGk2enVxVWUxRTVXdjc2cUNKM0F6Rkc0?= =?utf-8?B?QkNTaDVzRllNUThQOHUrZUo4dlBubHE3c205eVhZelFZa0xHRmJkNjE3T0RV?= =?utf-8?B?WjNYcEJOV2xlTUkyYzhPR1d6QkZDTVA0YWtZS09GM1JpeDZSUSthTTFyUERB?= =?utf-8?B?a2FmWmpSa3hadDQ0dUducWtoM2RGQmdBa2ZGVmR0T3IwZWVicVRkTDJvcGJI?= =?utf-8?B?c0F5UUlTUGVqUklYTFJmcnFNdys1NktSYXNiSlpZT0RuOXp6ZC96d1l2eXBV?= =?utf-8?B?R1ZYZlFickpEL2M5eFdWM3lxVm0xa0dBZit2Vm1YRVRmSGlnRGVMRDZvRXZz?= =?utf-8?B?WWRRaWwrUlQzVVd1NFpxZnlQdDduc0lmVDZ1TUJNdTNKajB4QmJUTE80RHZJ?= =?utf-8?Q?0H5Oq3WnBbjWseeXV0KpAqBf7U7RVewn0pkcQc=3D?= X-Forefront-PRVS: 0373D94D15 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(7370300001)(4630300001)(6009001)(6049001)(39830400002)(39410400002)(39450400003)(39400400002)(24454002)(377424004)(31696002)(6116002)(230700001)(64126003)(3846002)(53936002)(36756003)(74482002)(50986999)(54356999)(189998001)(76176999)(7736002)(7350300001)(229853002)(2906002)(5660300001)(6916009)(4326008)(83506001)(25786009)(2950100002)(65826007)(33646002)(8656003)(3260700006)(6666003)(86362001)(575784001)(117156002)(23676002)(478600001)(8676002)(7416002)(31686004)(81166006)(42186005)(47776003)(65806001)(38730400002)(6486002)(77096006)(53546010)(93886004)(50466002)(305945005)(54906002)(66066001)(6246003)(4001350100001)(110136004)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:HE1PR0202MB2553;H:[192.168.13.3];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtIRTFQUjAyMDJNQjI1NTM7MjM6NWlmdDc4b0QzZXJXbUR6N2NQazZURzVR?= =?utf-8?B?bDZQZGUrZjgzTTB4c2hWd2loWjk2Ymt6b3VGMlExaEdkZjVZZEM3WUxUNmtC?= =?utf-8?B?WXF4a0xKaXpCL0hvaEFiaU80M01QL0o3aVNibUFWaUNWcXlHQzV3aDZSNVZL?= =?utf-8?B?aGpJc3AvQWhnZWp1Y1duYXZxMFJvUWFhRUpKMWxlU3ZncTJWa2Z0NlZMdXJu?= =?utf-8?B?SGFtQU5PcWJXa1JJM1U4Um0zd3JmUHVNYi9uWWNpVXFaZmpXdXNrUXFDWHgz?= =?utf-8?B?ZzdxY3d3Yk9MRWhmN2Q5YUpWeDlhMDFnOVBiM2tIdUdGQXBKY1Bmcm84cFdu?= =?utf-8?B?a05mUWdoTVdMZlhZU0laWkFCL09BMEpYY0xnajA3T3dCZXJCQVk5Unl5WW9K?= =?utf-8?B?L0RsaUNYUGVFU3VLd1k2OWNtcEhIbUlvcVFCTGpvdEVUZ2xWUi9WT1A1ZUtE?= =?utf-8?B?RXBYSTdvZEVvWUduSE42c0Y0MXBUcTN3OU9CREUyRzdTUEZxYzBOL1FYTFBo?= =?utf-8?B?OWVndWFENjUyeG1KQ2xLc01MZEpCQ09iMkVpaWhjTnB3dUV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KMWVJSHczUzduVFBSNlFVNERUdXFrdk1W?= =?utf-8?B?VHduSU15bmJwRGgzek0yaks5RTNyNzV3VjA3M3hKNFg4amUyTzFmY0piY2dD?= =?utf-8?B?d2o0eTBhUHgwazlzS0FGbE5XSnNBWlFOQmk2UmZsU0NkYW85cnhMTVpkbUxO?= =?utf-8?Q?MIZJTdPF3jN5PJYE1aToBlDwRBvt6XWp4=3D?= X-Microsoft-Exchange-Diagnostics: 1;HE1PR0202MB2553;5:1X73Zihk7HxXeqqaH1iI5yBdHdYjIqQSMprBkLbRzonZ2GDR3oJWaXQ2GrKQODu3xVZDc8fbQves1R5DZKbUtszsFNjvMK+xrhSOEFkZjKxxl0tVD5bVXTaJ2MOb0L/RaZ1o7JJ9vhI4ziv7MNSfAt1IWtz7SfYnLkw45VjUztcT62MhHa+pkA9LhRqSyBECPnpu1e7qOkSlbq1htHsrTXjWIZ8t2vxuKRHHW+B7U/GFXMwNdFFmYjYGpht2LT6mwFX29s9XjgDstO8HnYs1xLakKpkb0gwDxBAHN/tApN27R7gaJpwRXHix/UP9hr8UWL+B10WrVi8nLbA1XGG7aiKegz9cFRsHybYaxRMdEMAYY20Cf/3MTp8TD+Dsx0CkStDztegOC6C2QKCuxUx7afcuDGZtkrEAs2bGKkqwvm1vm5NcUdjagYv0hpN5CegV9NIs8AiJwNQL3Za/VO6K4RbEQUA3NOfKlgpppLwq6Gp9h1tS6CKzU/yYT47S8yTn;24:9WVZjp4oBtcODHLotB95nSao110t6djE9pytk/C52odpB+bCd3hkpgVET7MWXwg8BmokvAAsI53OTDcYWuArPbCWnu3e3KyTtIXnMUYxAk0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;HE1PR0202MB2553;7:SetSVkdY3o8Nz6juTuvQNAzuB2/mEFeDFgR1XoPITszgSP6cHSJIJgoSKYnmATmzGjONBG3EqYPzm+R5RHHsRG31bEUjvdggM/e/7am9TQtiqG8OjKuKxCNrBXp8pCaO6pgJKHj6v9uCnaQ+bHv17lclrc362Iux/dLEYV7CcWsyUnnT7zz7CH1tgZWCKMTrgYVGnlF46tmwjN1ywFISdHW/316EpC5ym3ndSAvwNs6HTuihOK3coGyC9e1xOSeD6RG3XS7iSNfzlb6OLw3GN/rZGqGe4v7/sy2Kr6JumjlJtCUGVyAV3LKQgOSQNo9XiD8SdbghipjEmrqpZuk1pVwZgh8zTJbxOX17wBcnTmk/j1CfnBCHfjxTdUKkoEjSBFOfPH9P3fwxysIKpVeDWJjTRfH1eX9uWs+gU+vembwIXdRxHleutkZ6/yzDCiWbDkXOU/O9ounlSOzBzlhZ+pz1yviAuzkY9ClaSzbGUUFgZimmLf/Y8brJbfeZFuIAbMbSK6cAwcUgKCRUO/o3p/apuNl9VGyR9LWLQhiLW0rKhNc4sGKtmxoNsK/vnwkk1MJML9lzdrWTP7P5ytNs4M6YTtjoo+UOE6Jus8U6WpUnVEt/cDCBT7GD4UEVVtgsbz0qp0qd0j+5+VYZ4MPTWTFIu7+5Cqix3ccpiJ8QVUs4PH0hWycAlnnGqVra6N1Y2Z37FPjHTPO7nVo3AgrQqcDiU+maX2hOaVACPaLM9zRp8tdlwHsF+JFOa0Cx1MN5VP/d/HwJbNXUIi4yeXeEbbmjkpxq798WFUjqv5XqRGE= X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2017 07:15:43.3216 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0202MB2553 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5900 Lines: 146 On 2017-07-19 04:08, Stephen Boyd wrote: > Quoting Peter Rosin (2017-07-17 01:20:14) >> On 2017-07-14 23:40, Stephen Boyd wrote: >>> diff --git a/drivers/mux/mux-core.c b/drivers/mux/mux-core.c >>> index 90b8995f07cb..a0e5bf16f02f 100644 >>> --- a/drivers/mux/mux-core.c >>> +++ b/drivers/mux/mux-core.c >>> @@ -289,6 +289,9 @@ EXPORT_SYMBOL_GPL(devm_mux_chip_register); >>> */ >>> unsigned int mux_control_states(struct mux_control *mux) >>> { >>> + if (!mux) >>> + return 0; >>> + >> >> I don't think this is appropriate. For this function, it might be ok, >> but... >> >>> return mux->states; >>> } >>> EXPORT_SYMBOL_GPL(mux_control_states); >>> @@ -338,6 +341,9 @@ int mux_control_select(struct mux_control *mux, unsigned int state) >>> { >>> int ret; >>> >>> + if (!mux) >>> + return 0; >>> + >> >> ...here and for other cases below it's very odd to return "ok", when >> -EINVAL or something seems much more appropriate. And if -EINVAL is >> returned here, the benefit of returning fake values for anything >> pretty much falls apart. >> >> I simply don't like it, and prefer if the consumer code is arranged >> to not call the mux functions when the optional get() does not find >> the mux. > > Do you want the callers of the mux APIs to know that an optional mux > isn't there, and then have checks at all callsites on optional muxes to > make sure consumers don't call the mux functions? Won't that duplicate > lots of checks in drivers for something the core could treat as a don't > care case? Sorry, I don't understand why the consumer cares that it was > there or not when it is optional. Ok, I had a look around to figure out how others handle this, and e.g. gpio has (ugly) macros (VALIDATE_DESC) to handle this. I guess you are right and I'm wrong. So, please keep all the if (!mux) checks. Thanks for insisting! >> >>> ret = down_killable(&mux->lock); >>> if (ret < 0) >>> return ret; >>> @@ -370,6 +376,9 @@ int mux_control_try_select(struct mux_control *mux, unsigned int state) >>> { >>> int ret; >>> >>> + if (!mux) >>> + return 0; >>> + >>> if (down_trylock(&mux->lock)) >>> return -EBUSY; >>> >>> @@ -398,6 +407,9 @@ int mux_control_deselect(struct mux_control *mux) >>> { >>> int ret = 0; >>> >>> + if (!mux) >>> + return 0; >>> + >>> if (mux->idle_state != MUX_IDLE_AS_IS && >>> mux->idle_state != mux->cached_state) >>> ret = mux_control_set(mux, mux->idle_state); >>> @@ -422,14 +434,8 @@ static struct mux_chip *of_find_mux_chip_by_node(struct device_node *np) >>> return dev ? to_mux_chip(dev) : NULL; >>> } >>> >>> -/** >>> - * mux_control_get() - Get the mux-control for a device. >>> - * @dev: The device that needs a mux-control. >>> - * @mux_name: The name identifying the mux-control. >>> - * >>> - * Return: A pointer to the mux-control, or an ERR_PTR with a negative errno. >>> - */ >>> -struct mux_control *mux_control_get(struct device *dev, const char *mux_name) >>> +struct mux_control * >>> +__mux_control_get(struct device *dev, const char *mux_name, bool optional) >>> { >>> struct device_node *np = dev->of_node; >>> struct of_phandle_args args; >>> @@ -441,6 +447,8 @@ struct mux_control *mux_control_get(struct device *dev, const char *mux_name) >>> if (mux_name) { >>> index = of_property_match_string(np, "mux-control-names", >>> mux_name); >>> + if (index == -EINVAL && optional) >>> + return NULL; >> >> What about -ENODATA? > > At this point in the code we're finding the index of a mux-control-names > property so I was trying to handle the case where there isn't a > mux-control-names property at all Yes, you indeed need to check for -EINVAL to catch that. No argument about that. > but we're looking for something > optional anyway. If there is a property, then we would see some other > error if something went wrong and then pass the error up. There is a > hole where there isn't a mux-control-names property and we're looking > for something that's optional, but there is a mux-control property. Do > we care though? The DT seems broken then. I was thinking about the case where mux-control-names names *other* muxes but not the one asked for in this call. That's not broken and should be handled. The way I read it, you get -ENODATA in that case? >> And if an optional mux is found here, but lookup >> fails later in e.g. the of_parse_phandle_with_args call, then I think >> an error should be returned. Because that seems like an indication that >> DT specifies that there *should* be a mux, but then there isn't one. > > of_parse_phandle_with_args() would return ENOENT when there isn't a > mux-control property in DT. So I've trapped that case and returned an > "optional mux" pointer of NULL. I think we handle the case you mention, > where some index is found but it returns an error, because that would > return some error besides -ENOENT. > > Sorry, I'm not really following what you're suggesting. Maybe it got > mixed up with the NULL vs. non-NULL return value from mux_control_get(). What I mean is that if you have passed a mux_name and the index of that name was indeed found in the of_property_match_string call, then any failure from of_parse_phandle_with_args indicates a bad DT and should IMO result in an error. I.e., when evaluating the result from of_parse_phandle_with_args, you should account for the optional param if and only if mux_name is NULL. You can do that by e.g. setting optional to false after looking up the mux_name index (because at that point the mux is no longer considered optional). E.g. as the last statement in the if (!mux_name) block. Cheers, peda