Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1311843rdb; Wed, 24 Jan 2024 10:59:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IHd505XyYRckuaFOLaeBvnck5BiVa5hmnf2OfaF6rU6wfAGv7lXh6uEKaE+29PfndQkGyX0 X-Received: by 2002:ad4:4ea2:0:b0:681:9f8:8051 with SMTP id ed2-20020ad44ea2000000b0068109f88051mr3602884qvb.79.1706122796542; Wed, 24 Jan 2024 10:59:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706122796; cv=pass; d=google.com; s=arc-20160816; b=Qahcn8eHzzVvWWSBOOnkevworpeO4Twtdc+gn/xGUOI5OgPUk7JQXu4rPpzNGb+YoH eUkO2n6BpBE6N75cj0HlT6xxDhjO9azuQOIyOPmuViFhCoq85t4O12WyaNqwA0RaiAFx R8k7LeRx0DPcIGsuRgPNME1nsH6TA0ryRi6FyQ+41f/g77+XGYCYHyi4Mkc0zkbz493f gQ+jqaHBFmOxnuvrB4vtjaSbelZXIqwZKaBe3bFOaAwmdNpYmeffP3y5E8IN7gC+Jmz+ iyW+UGwDNjtpeHhlGvpTCtoAZaNWO6qtKR+PoWRKY4RGi4GSPEfM/9gyK5NaHb5/mXnJ 3AOg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=y6PL8UnNoNRmqQyb82Ctczzo51piu7gV+xPgMEYy95g=; fh=1u1/Td2dvleXlQrVTl1h7vWl/89IyyXNwKOmEAd/0r0=; b=F/B31cBlDEnA2w8PP+k3d8gY4RQX5r0TEZ/6nXwP4b+Sw0u2pYBuQkR94gSFUJTR8v NSxor1sljAX/tBUqsyDgEe78z8n1Y8MWOukl8SzbMN0Pq9hi0+TqtjlLqWBmC0Ya+i9g idan5fJKkSSxk8pUEvLSiV3bzP2tZiSq6sqR0MbT5vHV9GDEIDS3lqNeuKHAq+4Fr1da nBkcPsbLbJ9JZ27GOEsyMXEPoOuFFfTSNPn5Y1ZqrW7LloQ/NsXW4TcRYpRvnb6PYbWR MuhrfgUG6F6/Nv9TORNAvposSPafOHf+VX7YI6tSlmj24QeTJowX30MoezpvsaxDimEF gQpw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=aoVUMSOA; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-37562-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-37562-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id c12-20020a0ca9cc000000b00686afe7238fsi1718043qvb.519.2024.01.24.10.59.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 10:59:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-37562-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=aoVUMSOA; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-37562-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-37562-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 225A81C2425B for ; Wed, 24 Jan 2024 18:59:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6D14E131E42; Wed, 24 Jan 2024 18:59:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="aoVUMSOA" Received: from mail-yb1-f171.google.com (mail-yb1-f171.google.com [209.85.219.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 124947CF1B for ; Wed, 24 Jan 2024 18:59:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706122782; cv=none; b=j08C7tbP3IbGLWPNi6CxqVc5hWZPwekUQrTuD+U69DmO/eO39mjCqI3r0zdkG/SU8fZ6Hqf5C+mPmdHitV4NO2yIXaylFsrFShVYNekX35h7FtoNO95jlWGiG/MWJVPTt4Yq5QRGCE3ISahhofHJmkoYXUsue05X6u6a5cSDOc0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706122782; c=relaxed/simple; bh=Yl6yynRwqlzywAWtFeFQqDvgiT8QYAC0mcPkalJ8b2c=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=KYCVO+fglcfuIHYf0sprj/I3bjkxJ2hF9sJpUmm/t/Qmv8t01Bjnatqz8rQhgUqnvRDJVnRTItTkkY7bxK8yL+TSV1un11AkeHoGxzTSAwZGkJnmGt8yGTRJjdt7X6Qe4r6iYQE3XqnRYOtZ+rQUoq6+Mt2sgCW+8EharqFkesk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=aoVUMSOA; arc=none smtp.client-ip=209.85.219.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-yb1-f171.google.com with SMTP id 3f1490d57ef6-dc2308fe275so4990206276.1 for ; Wed, 24 Jan 2024 10:59:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1706122780; x=1706727580; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=y6PL8UnNoNRmqQyb82Ctczzo51piu7gV+xPgMEYy95g=; b=aoVUMSOA4QF5kBpCwGdc97wd9Od7X/0D8z9MgFxFqazFrF4I1T5tNk4sKesXpMwxU5 SATFctCLXjMPOR8riEDyKeaa2TeT9eR0dTSetg03rJK9mGWrtSbj382fYomz9b73sDoG 9Yay194Tt26nWzxjwAsqYP+O/jpWEpRoOv8cQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706122780; x=1706727580; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=y6PL8UnNoNRmqQyb82Ctczzo51piu7gV+xPgMEYy95g=; b=HvMCrPvB+L84G38vKHVr7WEagyu4PD4eIWrLj4HFjGlSxhkiRSG39Pq7g0ZcQzs64f jCzIS4/9umTPj1xsynBcQOukgM+02UCzo8tO0khs346kELmUF8Or0AV7fm72iVP2GhWp BL6RYAqB/VMHeNMlrySzxMUdg5fMr3vqdnMR9gFq1r7qIbG1jaTvHthd2f08ccuacKZ7 citZhmrPhwslREclvKPz54n6StB068dsoVPHwOv+LMIDfaqLhy9Onbqb+3ugUtL2+oG9 jgfxGXJuazTIufadCppdwJjPIed+mh+xmdugFvdLSpBpjM1pNQGeFwb0VlskCe7Dem9e AKIg== X-Gm-Message-State: AOJu0YwsjgDlCCpJCTRiKTL+F6GLEJPsdOwg9ulk87V2t7156bhbx7Lk A9HbD++cmnzFrBLelUFfdHZTMyR4Fd2lvI4hDrhKnqAg0YCc/O5p9dlJyzJY5dbu9fBLueHAVkz Pb2jl7CBrH1V9Fh1EE4w1U4ghoct0tznW+rPs X-Received: by 2002:a25:9c03:0:b0:dbe:a209:3305 with SMTP id c3-20020a259c03000000b00dbea2093305mr927061ybo.98.1706122779981; Wed, 24 Jan 2024 10:59:39 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240123223039.1471557-1-abhishekpandit@google.com> <20240123143026.v1.1.Iacf5570a66b82b73ef03daa6557e2fc0db10266a@changeid> <2024012405-stung-freckles-e196@gregkh> In-Reply-To: <2024012405-stung-freckles-e196@gregkh> From: Abhishek Pandit-Subedi Date: Wed, 24 Jan 2024 10:59:28 -0800 Message-ID: Subject: Re: [PATCH v1 1/3] usb: typec: ucsi: Limit read size on v1.2 To: Greg Kroah-Hartman Cc: Heikki Krogerus , Prashant Malani , Abhishek Pandit-Subedi , linux-usb@vger.kernel.org, jthies@google.com, Bjorn Andersson , Dmitry Baryshkov , Fabrice Gasnier , Hans de Goede , Neil Armstrong , Saranya Gopal , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Ack. Will make dev_dbg on the next iteration. This seems like a good addition to the style guide too: https://www.kernel.org/doc/html/v6.7/process/coding-style.html#printing-ker= nel-messages. "When drivers are working properly, they are quiet. Prefer to use DEBUG messages unless something is wrong." What do you think Greg? On Wed, Jan 24, 2024 at 6:17=E2=80=AFAM Greg Kroah-Hartman wrote: > > On Wed, Jan 24, 2024 at 03:51:58PM +0200, Heikki Krogerus wrote: > > On Wed, Jan 24, 2024 at 12:12:26AM -0800, Prashant Malani wrote: > > > Hi Abhishek, > > > > > > On Tue, Jan 23, 2024 at 2:30=E2=80=AFPM Abhishek Pandit-Subedi > > > wrote: > > > > > > > > From: Abhishek Pandit-Subedi > > > > > > > > Between UCSI 1.2 and UCSI 2.0, the size of the MESSAGE_IN region wa= s > > > > increased from 16 to 256. In order to avoid overflowing reads for o= lder > > > > systems, add a mechanism to use the read UCSI version to truncate r= ead > > > > sizes on UCSI v1.2. > > > > > > > > Signed-off-by: Abhishek Pandit-Subedi > > > I have one nit (mentioned in side-band but reproducing here for consi= stency), > > > but will defer to the maintainer on that. > > > > > > The above notwithstanding, FWIW: > > > Reviewed-by: Prashant Malani > > > > > > > @@ -1556,6 +1569,15 @@ int ucsi_register(struct ucsi *ucsi) > > > > if (!ucsi->version) > > > > return -ENODEV; > > > > > > > > + /* > > > > + * Version format is JJ.M.N (JJ =3D Major version, M =3D Mi= nor version, > > > > + * N =3D sub-minor version). > > > > + */ > > > > + dev_info(ucsi->dev, "Registered UCSI interface with version= %x.%x.%x", > > > > + UCSI_BCD_GET_MAJOR(ucsi->version), > > > > + UCSI_BCD_GET_MINOR(ucsi->version), > > > > + UCSI_BCD_GET_SUBMINOR(ucsi->version)); > > > > > > nit: I think this doesn't need to be dev_info() and can be just > > > dev_dbg(), but will > > > defer to the maintainer. > > > > I think that's okay. > > > > Reviewewd-by: Heikki Krogerus > > No, when drivers are working properly they are quiet, this needs to be > dev_dbg(). > > thanks, > > greg k-h >