Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2508253imm; Mon, 10 Sep 2018 02:10:18 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaqjDd1gwezjXsRaj8xUj9kWZv1XNsmI2c9etf0hfOyU1YC/OVkrO+VJYOCk9gkJhd9aEkp X-Received: by 2002:a17:902:7798:: with SMTP id o24-v6mr20683133pll.93.1536570618722; Mon, 10 Sep 2018 02:10:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536570618; cv=none; d=google.com; s=arc-20160816; b=TyxZVvh2hIYPRrFMUFtAdC7bkxAocOKUTYqD3TELqKwXWElzzp1vTTCmqrLS36AR/Y SGFZ5hSv68YlNqebTmXidBFhHa2hKe4bmO00AWXzsZrWOHvW+lAHHkKrmb5ln8yWzFgG h3mhcVP02zjckuQeWOOpGQeE7jnvncXJNSSTZBmeTpYPtG/NgH7J/DyKcG0vxYsHU5u0 fQa+oGhtBX53F56jBwEWks1QeQIMh15n91PgVi+9EdJzG0U/aOmYc855oUjJFCwkcwsc fbbxQ8xmCRjSpaTy5+DFAxxa5d2LkCscA+kBslvnc5+NHDqGFxQecSIpRYKJswPpkQXz cbhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=5SMEAmgtPH5r28FlBfQ79cJstxcEqCg6dugweJOELPU=; b=leQWpednw7RyvrKsSCQrfTKaHwhaH9JYx6bD/EUl6dbozQve5r4GNf4tl34Q9oVlYk KvixJCpQEjntOGucHiODR39cj3qudlPygpjI1Th2XVQ9CHQvK6x1RKTtxlUI1s1236gk /PFa4smWgEa0n4RCRT49oJyakwCxP1vzFRFvDiwGfVqq9D3V3HxpXDU0twAhcPo1Siui MhjI5NB0kOVdHnef0l3xvJB8q8qpuq8c6DEmE5ewU36kSShtGYOG6LyG91Q9AVj5ysUn qo7wGOqrL3hy4+Q6EULONijvmSIapo94ZHTUDwNkwyG/gR3OGAEUHEX5Wd16cjdvLXkO 4FOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gyg7EhY7; 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 u8-v6si15604295plz.481.2018.09.10.02.10.03; Mon, 10 Sep 2018 02:10:18 -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=gyg7EhY7; 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 S1727772AbeIJOB0 (ORCPT + 99 others); Mon, 10 Sep 2018 10:01:26 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:43132 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726892AbeIJOB0 (ORCPT ); Mon, 10 Sep 2018 10:01:26 -0400 Received: by mail-wr1-f66.google.com with SMTP id k5-v6so21028573wre.10; Mon, 10 Sep 2018 02:08:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=5SMEAmgtPH5r28FlBfQ79cJstxcEqCg6dugweJOELPU=; b=gyg7EhY7myVCyIPGAB/vnWV5LceSfQHGseo9AQF3ext4/KLF2Ru2V0Q14RsfUroIJ4 2mqx8vj3KNssVzh1X5ioEbqjr5OMWfLiJS4RUEcIR1N+Esjp+PDHrYMv3MnIV1mgSljC E/dETmvCvp3OlwOpAEuqznFGETG3tNOemJvqaTy1TS5/NfLbvel83+JFshKVE4m/GcAT Y8W7aAruynjCpwZDD1e3n1YqOIxj7LxXKQOExMcwK3U4xTQ9Mnv8R3GDsYgTfwhS+fQK RYXD+oTStj4vga9ZfO6gsBAz1S3mRjBvHtoo8+lmYD23oxiXFI8oRIYfK9W+09Iro+Es iD1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=5SMEAmgtPH5r28FlBfQ79cJstxcEqCg6dugweJOELPU=; b=RAqtrYZboCmF+KYrwAx2Rf7hPm4/fAr3hKzy/lz++s1fslSPV7sYFd0v8c7Z6Zacs7 UuGqC0G6hGS1A4of3sEv1DRtfPj2V3FKr93GeZXwFti4le20BV93UFfk0i3Q6+4u1/If n1uR/jM+FZSbisHIvp/s5lhZpJO8WWtYlAiJ3HQQS/uZHEUpySZr9W9OUtHWkW6azsVQ bSij1vNx7qHg6ra0Lf80WQ0kffqOBwfwoVdoObEfNN9/T9+nJ7Iiy4WMW/oxMRkoec5j zWofjuPXRliDWoPE5J2wF2PLLaiMjQRlpZNPcugl94yFVA9CRAlOHIS0ygIpFuMGSMLl KH0w== X-Gm-Message-State: APzg51AZ2ujrSQRHNFKb5YlXT1ZBy6WcJly3ypFroBIHqciaa6ZTNhbL RqhODfZmWKXEB/iUC+oFFIWzRb9q X-Received: by 2002:a5d:674d:: with SMTP id l13-v6mr13629644wrw.197.1536570502039; Mon, 10 Sep 2018 02:08:22 -0700 (PDT) Received: from localhost (p2E5BE549.dip0.t-ipconnect.de. [46.91.229.73]) by smtp.gmail.com with ESMTPSA id x16-v6sm17000968wrm.69.2018.09.10.02.08.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Sep 2018 02:08:21 -0700 (PDT) Date: Mon, 10 Sep 2018 11:08:20 +0200 From: Thierry Reding To: Frank Rowand Cc: Rob Herring , devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] of: Split up name & type in modalias generation Message-ID: <20180910090820.GB702@ulmo> References: <20180907142247.2931-1-thierry.reding@gmail.com> <32ff0b7e-a710-2c23-75ad-8c527d3453c7@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="+g7M9IMkV8truYOl" Content-Disposition: inline In-Reply-To: <32ff0b7e-a710-2c23-75ad-8c527d3453c7@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --+g7M9IMkV8truYOl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 07, 2018 at 12:56:09PM -0700, Frank Rowand wrote: > 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. Th= is > >> 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_nod= e.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. > >=20 > > See my reply on the original patch. I've updated the patch in my > > dt/next branch with the fix to use %c. > >=20 > > Rob > >=20 >=20 > Agreed, your updated patch is more compact and looks cleaner. Not sure about "cleaner", but yeah, that works as well. Thierry --+g7M9IMkV8truYOl Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAluWNIQACgkQ3SOs138+ s6FxtA/8CkU+Oilip3vkyQ8zmTV9Xx9m9Vu3e9+JcvWaGt2cY/xNd6ALpt7KsTm4 K10jW+Jam9u4KPN6IeIHQD6bFgOxU9BJewEFA4WmKE2cO2ttlsNIApgqBFuSrwOX xR/mUXUGrIX9vtw7Bg2vjiCzX6eSjJt7XsFMVOD/P7aMSeMyv5p8/Qwcmh7/t4rj iZ64lB194AdtcR/7gdBXiOtpu9R5NFWZSjcwIiln0cHpsW7vzzIhLfqMKwEJ0E0F Iolfc3FqnxWO+Iv43Fqhh9rtqjuYrJfECGN38fNkxa/8SblEUMrVi2+tWhBiie6J NGope74WcAulWExj4j2dDAFVxCEcMnqdg9rrUYZiNr5JhQhrxzM1Lbn0UQfaACli fn9VnlRaF1PvXxgUb/3J29GKsdI3OzS2YFuPRdFjFyXff+k2iJsjapOCUvC+p/M8 IDrs/ms1ouaZCRxPWSpazM3+28Eh20nUB9f8KuerdqMIwOsaKPgPVd7aiZURFvBV trRB1CDBeGA+s6cZxQzyHDeRkDjGLersietcfjBShEhhS4Wthahr2tYGwxdB81+y /rxQdxHTZnQy3AqDoEMRZSxnazpk6W7hxuEuUX/DKDOHW0nodvPlIJNnsdiEyIyp Fc2bLClevU0Ha5cS6HPfw5H2+IgnVkWGgQcreIQ/VLkBS8uMNOs= =03b9 -----END PGP SIGNATURE----- --+g7M9IMkV8truYOl--