Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2166821imm; Fri, 7 Sep 2018 11:51:28 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZNWZeNolXXSq/49vAaSEoPIKKsIHAGt9D82g0uW+2P36A0a0WoaidGkPklYO+zLRw/sh3J X-Received: by 2002:a62:d2c4:: with SMTP id c187-v6mr10124717pfg.8.1536346288709; Fri, 07 Sep 2018 11:51:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536346288; cv=none; d=google.com; s=arc-20160816; b=NzDU4eZ3aQ6qubAbOGeX81x//yu34cR9u5Txe1oRwsYLRVLHZil+WNoz3fYtr3i84E yQBoMTA5WBfj2zACEixebkw/NaEnNF2QGZTNg9r/bXjova0JKZ54QqQNFwiRdo+HJuzI sYm4rMTMT6Mn5Jy4kS/eQ+w7LZGliaEzf4x4b0kdKADtn28f/KRsO6fGOqTktCoky3Sy xtbh1njBMiqXhnVnHzjDMC7i5lCtB+8KjGpbBPHmh9zemE4DG5NaRVz6oTIYP/821nIq 9eiGDQQGxxKHaMBQ4YWCaVvaCYSNK383F1+B23p581DV63XL3Zu7iYdKFMad42DGHDl6 /Osg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=kBAsNuS1ddFAHu/GXRg04QyUV3E6Vuug8DpsnZM3C6E=; b=QfASI15nGCIQ4b1U7X0D7gHCKddxWXlaMMqt81tpvNX6no52Y8hfyj6i6/yUSedlI3 JRfQCLSvR+7J1IYiwWMff3Y+28/PNhZDB8u6UXyRdQEEIypLy1lEXWW9nafE03uSC6sJ stCjJ9ZZTv3OH2ceyKMI4kJgkt2+L4gR+5oz56ba1BMpyAgnchFjZWkCWuBCUW0diCLA zVnQuiCGs7T+zQ/BOvvbA54WH5T+sOSczqUXs5KPjaW6IUwDakztlqemA7XALPS2bKnm /vzHpSM9INN/nhJ7qwFzCwbL/Uoc28w+OTf1A/+dyKe5RODMp4kCrF/mn46GM/nKUR67 HH3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rrdZ3cbK; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n11-v6si9704302pgr.467.2018.09.07.11.51.12; Fri, 07 Sep 2018 11:51:28 -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=@kernel.org header.s=default header.b=rrdZ3cbK; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727683AbeIGXbu (ORCPT + 99 others); Fri, 7 Sep 2018 19:31:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:36662 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727648AbeIGXbt (ORCPT ); Fri, 7 Sep 2018 19:31:49 -0400 Received: from mail-qt0-f174.google.com (mail-qt0-f174.google.com [209.85.216.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E787C2083D; Fri, 7 Sep 2018 18:49:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1536346175; bh=HiUZe+WPncley1Ll9aGqHIBYjQn1CeG7b+18OmU4jIQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=rrdZ3cbKZ2ILceSM57E9/NQ2vAQsOK4ML2wFIv/c2Z4D1FVEWoll0KInJf8RawyvJ o6yftrDXp7lWdYMVQB6EDWE7o8MIRbadMStHpfyN8E3hKbzPU6rOv+BdAuQtxgJYKz Olh8SK6be+lmZ74Xh32Jr7JU/XSz5Qt/gtSumQ0I= Received: by mail-qt0-f174.google.com with SMTP id r37-v6so17317200qtc.0; Fri, 07 Sep 2018 11:49:34 -0700 (PDT) X-Gm-Message-State: APzg51BFBjl3RVk9r7C27WA/ZmyMTC12mabF6e2qyce9I3zD3ifveS3D Ny2ZU64uVO2QqECjBY56EReL32wox++cSH3L5w== X-Received: by 2002:a0c:db87:: with SMTP id m7-v6mr6832443qvk.90.1536346174072; Fri, 07 Sep 2018 11:49:34 -0700 (PDT) MIME-Version: 1.0 References: <20180907142247.2931-1-thierry.reding@gmail.com> In-Reply-To: <20180907142247.2931-1-thierry.reding@gmail.com> From: Rob Herring Date: Fri, 7 Sep 2018 13:49:22 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] of: Split up name & type in modalias generation To: Thierry Reding Cc: Frank Rowand , devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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