Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2232811imm; Fri, 7 Sep 2018 12:57:37 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY9yM4z1j7Bx+6qJkji3cVkxcCa2V9mMdm0MahpKfGyKWsUSkm39uGi50xuhBc+IMzZTY8r X-Received: by 2002:a17:902:59ce:: with SMTP id d14-v6mr9730445plj.42.1536350257113; Fri, 07 Sep 2018 12:57:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536350257; cv=none; d=google.com; s=arc-20160816; b=LyFva5n9oz2l1TarD7zo8R18T8S2Iogvi3l3gsFjlG2+1KsnRmeGXQeCvSwyI/YE06 /XldhFurjgOEIJBJG3j1VNEI0UBql0J8/28IYnIX3JG9Wd8tHC0M/D34meBjr1ZDBemP apjTp+g37fy8cDPZJRujF2lIqkp83E1oIRVVKCTbDSDYyBAdkpWfkPqYlx51WYHU1BNF kO5xOZGjIV+vSYjOCtToBHUlXzIM4sPNZYom/mjNvCmTORBYKr3InodqRoJpNt9ZScrP lH453EK16lbn06LkCQsFcex2XBvLnxio0xU8hOt94lESdG7/VFxlhxcSJEPkBqoZ621j Rq8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=qfYiLrSG1vooqMREq/0OM4vQWIoCCkQTprKcLZPtets=; b=ZNevuVW8HE7gTTdZeRQQQwWLS71eAMmsOBo1xeysH+mBIKrjwOCLiMKyG8NX5KO5PM sODzlDjOtTkFzDGJoByDafovtPEAQYLuLDIhLgYATODBNeE3Qe+tScuW4YaG70XM7veL RDBoWVAUA7Crs5H+1qLGWmWxy8dxcGHDbmboVcRJEF1G7hJdflcf0UpUl09Tfqze4gQA M6GTF5qBYuNQywMmlm231fpc6/7g9eAgawQISudskzv0BX/DniT3QLiajPtag9y+aSef 02M/V0Qjjcwdm8Gse/IOp9rZF7VDNrSwJIW9pxzZB/ap1GTwXw81vtAmmIfXjQhPi8Yf ruJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="F/VWom2j"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t64-v6si9662225pgc.516.2018.09.07.12.57.22; Fri, 07 Sep 2018 12:57:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="F/VWom2j"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726444AbeIHAik (ORCPT + 99 others); Fri, 7 Sep 2018 20:38:40 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:40025 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725987AbeIHAik (ORCPT ); Fri, 7 Sep 2018 20:38:40 -0400 Received: by mail-pl1-f194.google.com with SMTP id s17-v6so7033974plp.7; Fri, 07 Sep 2018 12:56:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=qfYiLrSG1vooqMREq/0OM4vQWIoCCkQTprKcLZPtets=; b=F/VWom2jN0DV7byhXmW/lo2CajkuqdOo3/w2c7lmLyBi2xYBEnqh5v4ZTjoyUIc8Rv Kt5GCr0kxEUW4yid07WuTOJyBgTKQdAsiTMVzfPFo9S+joWONmIyzMKwplgmYlxTu/AR 0bH6Uplb8d7uVp+paXCO0Yp6ODntqx2jnCGdK0tRCTL/WRfC9WOb8dXRAiCJNlHCp4eX TP3eyidzOy1A/8eLPHqrjAU+XFqpY0C/LR3WH2QiZnFEXm7n660cd2RqRBlA8wL2jK/X QywpfmBrUg0s0BtCGxY57IBh/Plaq0oiTucrbHQDIpyITV8+OYLE7YG4SCAmI21Nkga0 8lbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=qfYiLrSG1vooqMREq/0OM4vQWIoCCkQTprKcLZPtets=; b=CV953g1JpURaSPNgJQFxgAznL4LZine05l+yGTgrAe4b84taBCTTRBzOJ6x6eZir8p M72PgiGoEOd6EggNWo+BIEGOvnR17GtoZPPmUv9coG1+QzvmnEYXzB20UGZvrmvap1yF 5XPaYTVIk5DTW07Bgvb6k058SUDdtARafRrEEdFEJ8VEe+HCz9Oq0cxtGdnKkGCukFaa 4gpX5Z2HpW5k8qFYIRYoOHxC0NGdNVRYE8qwKzpZ7yp9UQGNYx706+W2Ib1KAshGxlRI R8p6rEuqDFvqVzFz6DZyNNS6g9xy2fdkVlQopeGUxyK1YLzA7srlm6YPf8eD1GNKsTkc PiBw== X-Gm-Message-State: APzg51D//qOJXFWcVvVwV53tdWlIEdfQjNsf2TzrNKmRqONZKPSOARCj hcoWL9A1dJN1xTXAfNoWXfo= X-Received: by 2002:a17:902:583:: with SMTP id f3-v6mr9725294plf.115.1536350171062; Fri, 07 Sep 2018 12:56:11 -0700 (PDT) Received: from [192.168.1.70] (c-24-6-192-50.hsd1.ca.comcast.net. [24.6.192.50]) by smtp.gmail.com with ESMTPSA id t141-v6sm12931647pgb.27.2018.09.07.12.56.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Sep 2018 12:56:10 -0700 (PDT) Subject: Re: [PATCH] of: Split up name & type in modalias generation To: Rob Herring , Thierry Reding Cc: devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" References: <20180907142247.2931-1-thierry.reding@gmail.com> From: Frank Rowand Message-ID: <32ff0b7e-a710-2c23-75ad-8c527d3453c7@gmail.com> Date: Fri, 7 Sep 2018 12:56:09 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/07/18 11:49, Rob Herring wrote: > On Fri, Sep 7, 2018 at 9:22 AM Thierry Reding wrote: >> >> From: Thierry Reding >> >> The kernel's vsnprintf() implementation discards all alpha-numeric >> characters following a %p conversion specifier. This is done in order to >> generically skip any of the various modifiers that the kernel supports. >> Unfortunately, the OF modalias is generated with a format string that >> violates the assumption made by vsnprintf(): >> >> of:N%pOFnT%s >> >> While processing the above format string, vsnprintf() will eat the 'T' >> character, assuming that it belongs to the preceeding %p specifier. This >> results in a modalias with an incompatible format, which in turn causes >> the automatic loading of drivers based on modalias to no longer work. >> >> To fix this, split up the generation of the name & type fields into two >> separate snprintf() calls to avoid confusing the parser. >> >> Fixes: 73813f8483b1 ("of: Convert to using %pOFn instead of device_node.name") >> Signed-off-by: Thierry Reding >> --- >> Note that a more elegant fix would be to make the %p format specifier >> parser report back the exact number of characters consumed. I briefly >> tried to implement it, but quickly ran into numerous special cases >> that make this solution rather involved. >> >> I can spend some more time to improve this in general if that's what we >> ultimately want, but I think this patch is a better short-term fix to >> workaround the issue. > > See my reply on the original patch. I've updated the patch in my > dt/next branch with the fix to use %c. > > Rob > Agreed, your updated patch is more compact and looks cleaner. -Frank