Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755063AbdGLJOu (ORCPT ); Wed, 12 Jul 2017 05:14:50 -0400 Received: from mail-he1eur01on0104.outbound.protection.outlook.com ([104.47.0.104]:17741 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750741AbdGLJOp (ORCPT ); Wed, 12 Jul 2017 05:14:45 -0400 Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=axentia.se; Subject: Re: [PATCH v2 1/1] mux: mux-core: Add NULL check for dev->of_node To: sathyanarayanan.kuppuswamy@linux.intel.com, "Kuppuswamy, Sathyanarayanan" Cc: linux-kernel@vger.kernel.org References: <4a9a39dd-86b0-9485-46f1-76f4f8f5a809@gmail.com> <591290e2-5c63-52c2-b5a3-5417bc16dc27@axentia.se> <27cdacb6-b775-f678-9ff0-6a3f2ad11e17@gmail.com> <75e9c7b1-f9b7-e0e0-7917-1fab3e2ac6bb@linux.intel.com> From: Peter Rosin Organization: Axentia Technologies AB Message-ID: Date: Wed, 12 Jul 2017 11:14:36 +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: <75e9c7b1-f9b7-e0e0-7917-1fab3e2ac6bb@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [81.224.168.30] X-ClientProxiedBy: VI1PR09CA0069.eurprd09.prod.outlook.com (2603:10a6:802:29::13) To AM5PR0202MB2547.eurprd02.prod.outlook.com (2603:10a6:203:6d::8) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8ef6181c-ce87-4b73-365a-08d4c9066e29 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:AM5PR0202MB2547; X-Microsoft-Exchange-Diagnostics: 1;AM5PR0202MB2547;3:D40mSWeVnTR8Qiyi4QPhIe6dJ9wlD7YdA7RhDe1fh0kPskD0gl5S2JSeYAAtkEpQSVTJlOWayjoVJwrsUk0UlFJ4Y+OpWkZCdWEog8Frv1rBMHr9gPX+1XITq/57mqCAv4xJG+EFBDCR/IA7Y0TPyUC8AvbM1e4j8NOt5T86MzQBWiR44R9k1gich5iGDiV3jVzLeEt3l4VrD5eUQx1Z35C7eQTNB4f4Bg1VqiQC9hPskjFJLACRkTxys6IOWHBwBcQqT1mzPcQK7aXLwdxkfbIRJlDun4lEBnRI2MO/5OJTWB9YWdiSFqGT8ID+wH4c7kNSJU0dT38/Asbii0LzpwmtK3fS46okUji+pPJvem5+9F984VKF7Gwl1cL6Ho//z0O4HgKbBU6gDV+0+EcUEPWZ6HMgDbeLI+GWDPlGvUvVLRyC7K6oZBGPTDgqt1FCzVBaiOduvSgcv2WnO8i26XT6a76f5cl+kkCMKP9+0Q8Psbk00rj9PinLHwSJ3gnyZZJQm8olw3rstLBFv4uZLBoRBkivJc7iKqKlMbCDTyTf9ubgQOFpAmOaevNScjSeCoOoxSivWlk+wxNjuyTkSkbDhEBKVFe+XLCgpkvX1HBMBBA8PpWPEwqVFSITCG2mN2dmQu5/9YyFt2VeGh+WVJZhuOeONEraiLHv5dkPaeU2VDlhGXsApvRHBCPgo9W2Gr3UdeQ0JwsMzIduY5ddSg== X-MS-TrafficTypeDiagnostic: AM5PR0202MB2547: X-Microsoft-Exchange-Diagnostics: 1;AM5PR0202MB2547;25:nqWJ7dfBr6vb+J1lXM99AyNCVJ9N/NTvCophtNJFnbHAg9fgxQGBZ7HOset4blTomReqdTh6AhRiRM3M+8pP37zGU6uVp7tW8PkGfWdHqZpKW3yt2LKi7ZuL6CEUrzVjjbQRghdzv9SvIKNYb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VyYUcCea4/nQ4979XsinMPMyyJVjBqrcO8AgFgM+HJXo5Fw/Q05SUSHa4d3tV1g7BBr8aTqDAaIDunjWf9vaMfTWTvsLOctMo/VdMjRnDZMh+phBtCRRu8MHmjIvTFN5uprlQNKM7c3ZLpmk3TBLyVOeOoFe32s032ue8mqrK9T916nZEz6ribtiFC1bl8BsXRpzxMcgCltjVpBHdzz8DVlIsDpaswLjksPn+WYgg6EOxU7mLWVkPULGO55QFa8dTatkLl+l6nAtZ91GQS2EIeIr8+5KzZQxKU8TXDKvaihmOo+dAV+F2VkCCRfNPTHVIvi3PNYA/c2n/ink2crKhDAvANf/4DTL7rD0iR677B/BalY8vUgVhtfDnxQxA9LsLPdtFUzSdfI9dagQ95rgD0Zgp06NcUW0DcRyvczi58q/+98g/No8uD6k9I0VWDzXd0oWDxMO19hmB8ZKUIl1THFS/fcNorq2deYGCL+NZr7bkPBBJs= X-Exchange-Antispam-Report-Test: UriScan:(236129657087228)(48057245064654)(148574349560750)(228905959029699); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(2017060910075)(5005006)(8121501046)(10201501046)(3002001)(93006095)(93001095)(100000703101)(100105400095)(6041248)(20161123560025)(20161123564025)(2016111802025)(20161123555025)(20161123558100)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6043046)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:AM5PR0202MB2547;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:AM5PR0202MB2547; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtBTTVQUjAyMDJNQjI1NDc7NDp0b2t0UkY2Vktyc0R4dVJkdVNVU2dVemFq?= =?utf-8?B?ZW1PWjl1YWc1VXRU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ZjdReFRS?= =?utf-8?Q?bq9VkqX8kn5s=3D?= X-Forefront-PRVS: 036614DD9C X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(7370300001)(6009001)(6049001)(39400400002)(39830400002)(39410400002)(39450400003)(377454003)(377424004)(24454002)(64126003)(3846002)(65806001)(65956001)(50466002)(53546010)(25786009)(117156002)(36756003)(3260700006)(6116002)(31696002)(93886004)(77096006)(53936002)(42186005)(6486002)(230700001)(33646002)(86362001)(189998001)(74482002)(66066001)(7736002)(229853002)(2906002)(478600001)(305945005)(6666003)(2950100002)(23676002)(1411001)(110136004)(6246003)(38730400002)(47776003)(8676002)(81166006)(6916009)(50986999)(76176999)(7350300001)(5660300001)(4001350100001)(83506001)(4326008)(54356999)(65826007)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:AM5PR0202MB2547;H:[192.168.13.3];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtBTTVQUjAyMDJNQjI1NDc7MjM6Y1BvZFVJemt2dTZlNHdTbjJhUXhDZW9o?= =?utf-8?B?dlZWUUxjbDF1TGN4WGRXZHY5WDgwMTVxMXo0VjhGNmh2Q0EydGpvUXluSEZY?= =?utf-8?B?eEJhdXpZdUhZOWF6U1pKR2xhRjRKRFNXTzNtOGRsYWpmdEFoN0hjNUNrT3Bw?= =?utf-8?B?QVVoM0IrSE80a0NlekxqVEZYRW5mMjBObkxBZTQra3F3MElOQUpJeWJKUHlB?= =?utf-8?B?amVXVHI2eUYvVGxZbCtoZ3FOSi9RUGFzN3AvVHdxalY5UHp6OFpnTXRYcU1K?= =?utf-8?B?SUFHaGxhOFJGOG9aYU5zOU92aEFXTDVSRjJDODI3TmcvbWUzbWgxZnJEcVZt?= =?utf-8?B?bk1TTEpFT1JjaDBUeEwzNlFMODBhQXBERXV4N2Q4ai9JNWlBVldGcFRrQVNS?= =?utf-8?B?UUFaeDVUb0M0UTVubmlrYkhXYUZQTjE5eE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FNU5YTktIeEFxSlRSdW54cHB6SlVvb0t3dWM0WTNHUWd2?= =?utf-8?B?SE1DVWEwdS9xLzNwM1NraUkrUGlQRExuaVpSdjNLNG02eC9qelFXS3dBWU5k?= =?utf-8?B?Z3MwUWhaaVpxRERNaFd2bnJreGZoNk9LVXB5ZTRhTklGa3NHSHVrdVJtQVg0?= =?utf-8?B?eTdIRU5JZzhUbGcxbWFIZ3RoSVRYakRGc2VXcWdHcEJFNVRLT3JyRCtTSlZL?= =?utf-8?Q?gWhpVXC5dAawbBft243UrJEFqto9G2DBE=3D?= X-Microsoft-Exchange-Diagnostics: 1;AM5PR0202MB2547;5:hJPOswFy58ow8jzDYuGRYiPXvcW2atTPQFMfruzJITze82pSaUT48meggFz6osbvCbqOAJJyZTI6HQaSt+hN0bBUoN6wQKpvs8q7VFldbEJwZa/1b3+9OsepPQqsUvh1gNkmNDjfIxmMbV8FkORr7dfjbmenPka5uyxarG0atEz71XlHE7kapem4IK4WUQ8IK7ueK0n5f41ilJ0kscecASknVD4t1sKlHvU81wdmGPZT4m60h3t7ky2GkSeFx/XoKywx2N1bUHNTJcEJV1DXJOiogotWXQtGuW7nYadr3sJblbrRzyWKaAYsm8bZuvFszrtelbD1yxgupDBTCZfwZiRulXpDnC/pM0D6My96zB8xHLifAZLC4dmmovMoNpzf2U2Ff/+OJMyxcmgPml+nr9omL+xWBk+GCcjencnmlFNNYg+Gk0ZDkf9UaycpBu8Sp5EaLgXxCq9p0dCKt9urvlxpIt9zwRAAn9WnPj0CnXPbERZe/s5XB372Dk3lkRX3;24:ZoPZ0/Hf2skUMEMw4UOiYqKagtEgPq+3eYUYJDPuPX04TUoLfO7ED621e3/XSenNPU+XUzoXBwxQA0Vc6DUdEuDeiNsdOieAVVX8wKJbR/s= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;AM5PR0202MB2547;7:xNbzKbst0NIDob6m1uY08IljtnaNkSNmOyyD6PH/gePiNDacrfucAA0YpkgoQAjLcHpwDRS+Axfc5bkxm9vAqvVPPni7HrvDII7AtDW42xaFHXnd9oTBgBF6MEtN4Sqgbjy4kUWMRDtiFRGEcglacJClEfSkSkbDoFGQXO/m/vFokDV5cGV4mAsvvJ5W0Q2FEZOWCAuyB28ElRM3OCthQwBsax1gaxdX5eBzIEUc8KpJF9vCvud+vlJmWMiFNqLFJd3ZonEE/ww9oSzYO5oeHABkoXlY3BqUnX0tBSeHaA5Z+lWwUcoZekL4hShJrWuW7Iywy+jsNaqq6iC3IO4dILK2pWVKL7F645CioflXbmCr70JqYgYVImURFRD+z1clxelkvdjJ2c7UOxjFVqaX19K/zuY40WaOSjglsBTmYx5947lfLKVio/24D+shO52V+AOEyRm5GNXUsvBXkVVq3fBC6UdYBs2lrXBKm8Xm7CdhT8m6QaOdu+mJrUlqwKmUjQGzczIchFnwwJEX0a8nBK77rWhlGZHFuegy7RNMTzkcQgNS1eN+vqp1xKeKuQSlHXVAKH/bhMJVnWyr0DcHLi/4oz4V35bSlydSXYwrXFTgnZzf5d4ObEytQnwpkFfKUvx8zN1AvJSY/Z0411zU9AoxDD6rNhk1NyhrjHpoO4QjwTszKvBtqiYctBr5q75ErC9Y2sYS0SK8MKwGZR54d5MAqDx2hfUSEAYlC59tUQt7va2DP/y6OENrX7n9+lynkJBQZpFPsS0u2nmi/+UfA4j1HxRci7cQylTs53GqNJ0= X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2017 09:14:41.5108 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0202MB2547 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 6025 Lines: 153 On 2017-07-10 23:36, sathyanarayanan kuppuswamy wrote: > Hi, > > > On 07/10/2017 12:40 AM, Peter Rosin wrote: >> On 2017-07-09 09:35, Kuppuswamy, Sathyanarayanan wrote: >>> Hi, >>> >>> >>> On 7/9/2017 12:07 AM, Peter Rosin wrote: >>>> On 2017-07-09 01:12, Kuppuswamy, Sathyanarayanan wrote: >>>>> Hi Peter, >>>>> >>>>> >>>>> On 7/8/2017 2:00 PM, Peter Rosin wrote: >>>>>> On 2017-07-07 23:46, sathyanarayanan.kuppuswamy@linux.intel.com wrote: >>>>>>> From: Kuppuswamy Sathyanarayanan >>>>>>> >>>>>>> If dev->of_node is NULL, then calling mux_control_get() >>>>>>> function can lead to NULL pointer exception. So adding >>>>>>> a NULL check for dev->of_node. >>>>>>> >>>>>>> Signed-off-by: Kuppuswamy Sathyanarayanan >>>>>> Do you have a driver that might call mux_control_get and not have any >>>>>> of_node? >>>>> For non-device tree drivers, this case is valid. I hit this issue when I >>>>> was working on Intel USB MUX driver. >>>>>> If not, I don't see the point of this check. >>>>> Since this is an API for other consumers, I think its better to have >>>>> some sanity checks. >>>>> >>>>> If a non device tree driver call this API , I think its better to fail >>>>> with some error no instead of creating null pointer exception. >>>> Is it? When authoring a new driver, and you make some error like this, why >>>> is a "nice" error better than a big fat fail? If you get a null deref, >>>> you will presumably also get a call stack etc, which will help you find >>>> where you made the error, w/o adding a bunch of traces to find out exactly >>>> what you did wrong. >>> In this case, I think the error can happen even if there is any >>> configuration mismatch in device tree blob. So its not only >> No, it cannot happen for any of the existing consumers. And seeing crashes >> if the DT blob is faulty isn't unexpected. I'm sure the ways to provoke a >> crash in that situation are abundant. > If we can prevent the crash and fail with some meaning full message, I think > we should adapt to it. if you want to leave a strong message, my > suggestion is to > use BUG or WARN_ON. >> >>> about API usage in driver. If you think that you need to fail the system >>> if the API is used without proper dt node configuration, >>> then we should use something like BUG or WARN_ON to explicitly mention >>> this dependency. But I think its better to >> But this is something that *cannot* happen unless you add some new code >> somewhere else. Why check at all? > Its not just kernel code here, DT tables are also involved. No, DT is not involved. See, *all* callers (or both, as it stands) already check this before they make the call. So no, this *cannot* happen unless you add some new code somewhere else. >> >>> leave this decision to the MUX consumers because there use cases where >>> MUX control can be optional >> This is only future-proofing for consumers that does not exist, and does >> nothing for the existing code. And the future where this is needed might >> never happen. >> >> Still skeptic... > I agree with philosophy of not bloating the kernel by merging un-used > code. But I think this concept should be limited to adding new APIs or > drivers. But for bugs in existing code I am not sure whether we should > follow the same principle. There's no bug, and this patch is not a bug-fix. It's a belt-and-suspenders patch. In the future, it might turn into a bug-fix if someone has added a call from a driver that does not require DT for something else. But then the onus is on the author of that driver to test that it actually works without DT. So, the question is how that author would like this to not work when these tests are made. If the kernel crashes, it's bleeding obvious. If you add a WARN, the results are pretty much the same. Sure, the kernel continues, but the author simply cannot ship things in that state anyway, and has to come up with some sort of fix. And that fix is some mix of: - something like your patch, and falling back to something else on failure - making the mux_control_get call optional - adding some sort of implementation that provides some other way to look up the intended mux-control. (BTW, adding a BUG for this is not appropriate. And Linus hates those...) > I have checked some use cases of dev->of_node in kernel, and most of > them who uses it in > kernel APIs have some form of protection check for it. For example, take > a look at the > following functions. > > int platform_get_irq(struct platform_device *dev, unsigned int num) > bool device_dma_supported(struct device *dev) > struct pwm_device *pwm_get(struct device *dev, const char *con_id) > > These APIs have checks like, > > if (IS_ENABLED(CONFIG_OF) && dev->of_node) Those APIs are used a lot more, and have probably evolved from a time when DT was not the norm for non-discoverable systems. > If you are still skeptic, I am out of arguments -:) I just get the feeling that this is something that is never going to be needed. When a non-DT driver needs a mux, this will come naturally. Until then, who cares? Cheers, Peter >> Cheers, >> peda >> >>>> So, I'm skeptic... >>>> >>>> Cheers, >>>> peda >>>> >>>>>> Cheers, >>>>>> peda >>>>>> >>>>>>> --- >>>>>>> drivers/mux/mux-core.c | 3 +++ >>>>>>> 1 file changed, 3 insertions(+) >>>>>>> >>>>>>> Changes since v1: >>>>>>> * Removed dummy new line. >>>>>>> >>>>>>> diff --git a/drivers/mux/mux-core.c b/drivers/mux/mux-core.c >>>>>>> index 90b8995..924c983 100644 >>>>>>> --- a/drivers/mux/mux-core.c >>>>>>> +++ b/drivers/mux/mux-core.c >>>>>>> @@ -438,6 +438,9 @@ struct mux_control *mux_control_get(struct device *dev, const char *mux_name) >>>>>>> int index = 0; >>>>>>> int ret; >>>>>>> >>>>>>> + if (!np) >>>>>>> + return ERR_PTR(-ENODEV); >>>>>>> + >>>>>>> if (mux_name) { >>>>>>> index = of_property_match_string(np, "mux-control-names", >>>>>>> mux_name); >>>>>>> >> >