From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.47 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796035959; b=YkrYEjPQaNRo3EXwFXo3VxmuRT6jeeS5tlV6Gb3s27QBuN9YfqL5xUnBpoKSzCtyVqK6 fzqbfQOWFgAIA2AWEpsA4J+FrAZCdwdWS7kWjQCPDtFcNiwMqnUJuB8wTIR0d5T7NcnlC aaf7R8QhdP1i15WjOC4HaMm/nTEODJ5mMWC99/BL64ji1T+sDXmNB+oQITPNHGMbaN5am aUvf309x1KcQCYVht64xs4Q32aDcwnA/FGNYIns5aQIW9XTAFpis7v9mlk5tijbakTPwD /iW4BVBWlJqa59T70Qre3QaD5d/hR5gucu28MmcHObBweKQQNd82z+2fWKkZg+nhJdA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796035959; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References:X-Mailer: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=6QQ0DZYuIRw6EZBxd2mk/d5igN6l4XKLz7TJAL7X4f4=; b=HQFGf0lTrzfOwo3oWny61J6Xo+McHcxUGTjMjvTKXD4PEgtSiB5wE0k6te5RY3Aa1Sb3 ZFemN5el7wcP36w+Obs/jxpgb4CYLy4lcabMYmanjPeEATaBoCebMDJjKDDMW/1qKS4gb lGuKKGK0hXGJCao2hiGkhdsHvXTjzaGSu7kieCLlv2gQsJVWW/8ufNCpHDD+PwJyoD3mZ PSVrovAd570mUQ4VaXL6KE2XtOFM/O9BIYYRFngVwQeHD/2dFk+ekQ+omqCqoPoorhDA3 Zkzy3Emp2ylPV6ltn3xevF7/2TIQKZaC2MCso+YVwS+kRWa0yiea7DXqrQ+FTqa+FSA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=hsMv1Mel; arc=none smtp.remote-ip=209.85.128.47 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 10AFA606A320 for ; Mon, 30 Nov 2026 10:52:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 10AFA606A320 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=hsMv1Mel Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-4bba60271d7so44552115e9.2 for ; Mon, 30 Nov 2026 02:52:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796035957; x=1796640757; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=6QQ0DZYuIRw6EZBxd2mk/d5igN6l4XKLz7TJAL7X4f4=; b=hsMv1Mel2h25iZAriRhV+y06CVQF77qA84zKuKGTJ20964WJ4gkyR0sEytlDEB70nE zxG9FzB79NStwswDTiBviOq+oIBCbP/qzAucA69yGUpIx8TpZjRgt6Gl1Vd4ovL+qHTR J805rc6Uy582JZYDRXB8FWEUVNvZ3R8Pl303ZFNNJFvsvo6e28J1yYmqAUZeKMm3LQ62 EkbGfSPaZ7p/NLb2FT3g8zhthqOdJxxYdYR/99yNPj8Kw5KDWM+cFU3maK1Y32g3VIVJ cXcQX8QnK0/vXWmQLSHi3eWMnCfCuNp4Pl8kIX5AFbkwhlhoRPUW54KO4lUOr3RDzJmp tS3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796035957; x=1796640757; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=6QQ0DZYuIRw6EZBxd2mk/d5igN6l4XKLz7TJAL7X4f4=; b=Px0gnxW0wxArugVejjPPUbk4jb6ggkZzQXXUC+uDWRPDrtT00KVWkWcKJmiCOgiazh wssrvJllBXHRHzxnwVpBzeasrqDqcuKY+LOWnPWL3/of8bKVxU5Eb2MhstJmqtfIqI36 p7RSBzCIRMH+RZVWwBONcXnCTUqDxmfZ3+1bs4DYBmE19bqmMiGO/5MsktxIoxV7KHfH XryFuNQdMbrRg0SqE83qbSaiHRVxIO3qULpns2WrfvlU82nluD0cUM78X1Moq09XgLxi DTJON+wMhvpkbiFDf8b4684JptDps9NQp9fs/mxlUv3m8CYDTqG5aFw7x18UKZ4U5G1C f74A== X-Forwarded-Encrypted: i=1; AL+hErHccTroXfdBUb7SruaewKkq8wDOZlImGDPy+yLLf0WcRTzqoRpe3S2oFd0yDNI+nkEDHufOoOg=@vger.kernel.org X-Gm-Message-State: APuU4Z+r0swPpX430uCtQgjqZzm453P/K2pmJf764itRdOMYfXkFWmDH BnNs8GeCGg3JE9cYMRzeG9Xsa5FNI3VQ0TCUmSIoHL8sKvLkugd3uaAY X-Gm-Gg: AZFdTZfaDVlY8ABNQzVFm4XEJIVWROTTVEd0rFzqpfH91pDFb4FkX3qw+ZYxXNlg8w8 uEXP3woXqcD1e8IRde5EPYyAzRaUdtkrstvkrfflbHqWdcwNEqcb1FiPVer5Zyf8F9kV0/TiGkH WHYKo8HSHr187o40xg3+Dq8HKjo6AaApxbKOsBMKyVL7VVOKGqcY63dE1ksfxcY7xnsj4pZKJdx WLwOr0I4OwvLrtunH5NqHoTEeu8mX9rp1UG05Tw9fbtke5bcGiWUtbdt/zevJMxP2iPQrDETIwH yjhq8mxJVFfaZ4F+uT7J3od5jRSUZbQwlIumWXWTd/GDV+4yO+k8BqClDUx0Ndk591YSB8ibQwP bQJHDZOGfbx04oAyN6ZIyk54RJA+VnZmCvuM1+Y58qqzJL2qmKt5Nxg10PcJLajvPUWXu8bKmsV k0Gs2EDiRssW/eIaxWlluXek1K4ISnh/fPfj5rMAwD5xy4Vm9m3SyQq3R9SQySMPkfRGjTYFlUz nJ3D2q9TpAwqjMGO711QF+RxH1JJuluKLF+C3DWn/qV0omAcEJQjqgF7JP5shm/y141nrRdNpr1 aM6igAV79yz2mIsPT3VJDhZWo7VNVOacok1iSYSlQoBGQ79wwkZzOrVmnbTQFlT5BA== X-Received: by 2002:a05:600c:3555:b0:4a1:f377:5c68 with SMTP id 5b1f17b1804b1-4bb8881da76mr662871115e9.34.1796035957243; Mon, 30 Nov 2026 02:52:37 -0800 (PST) Received: from pumpkin (82-69-66-36.dsl.in-addr.zen.co.uk. [82.69.66.36]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bbab390cf5sm487627885e9.7.2026.11.30.02.52.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 02:52:36 -0800 (PST) Date: Mon, 30 Nov 2026 10:52:35 +0000 From: David Laight To: Jakub Kicinski Cc: kyle.switch@motor-comm.com, andrew@lunn.ch, olteanv@gmail.com, davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, mmyangfl@gmail.com, horms@kernel.org, linux@armlinux.org.uk, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, ming.xu@motor-comm.com, xiaolin.xu@motor-comm.com, jianmin.wang@motor-comm.com, wei.zhang@gl-inet.com, sijia.huang@gl-inet.com Subject: Re: [PATCH net-next v17 3/5] net: dsa: motorcomm: use fixed-width GENMASK_U*() helpers Message-ID: <20261130105235.1a1b4b4d@pumpkin> In-Reply-To: <20261110232652.2437155-1-kuba@kernel.org> References: <20261105031442.4164960-4-kyle.switch@motor-comm.com> <20261110232652.2437155-1-kuba@kernel.org> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; arm-unknown-linux-gnueabihf) X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 10 Nov 2026 15:26:52 -0800 Jakub Kicinski wrote: > This is an AI-generated review of your patch. The human sending this > email has considered the AI review valid, or at least plausible. > --- > net: dsa: motorcomm: use fixed-width GENMASK_U*() helpers > > This patch replaces two GENMASK() uses in the motorcomm DSA driver with > GENMASK_U32(). One is in yt921x_chip_setup_dsa() in chip.c and the other > is in yt921x_mbus_int_init() in mdio_bus.c. It is described as a type > cleanup with no functional change. > > > Some masks assigned to u16 and u32 fields are defined with > > GENMASK(),which is an unsigned long constant and wider than > > the field type on 64-bit builds. Convert the YT921X_MBUS_CTRL_* > > masks used by mdio_bus.c to fixed-width helpers. > > > > This is a type cleanup only, with no functional change. Other > > GENMASK() uses in the driver are intentionally left untouched. > > [Severity: Medium] > Does this description match the diff? The patch doesn't seem to touch > the YT921X_MBUS_CTRL_* masks at all. After this patch they are still > plain GENMASK() in drivers/net/dsa/motorcomm/mdio_bus.h: > > #define YT921X_MBUS_CTRL_PORT_M GENMASK(25, 21) > #define YT921X_MBUS_CTRL_REG_M GENMASK(20, 16) > #define YT921X_MBUS_CTRL_TYPE_M GENMASK(11, 8) /* wild guess */ > #define YT921X_MBUS_CTRL_OP_M GENMASK(3, 2) /* wild guess */ > > They still feed the u32 mask variables in yt921x_intif_read(), > yt921x_intif_write(), yt921x_extif_read() and yt921x_extif_write(), > for example: > > mask = YT921X_MBUS_CTRL_PORT_M | YT921X_MBUS_CTRL_REG_M | > YT921X_MBUS_CTRL_OP_M; > > No later patch in the series converts them either. > > The two lines the patch does change are not MBUS_CTRL masks. In > yt921x_chip_setup_dsa(), the mask written to YT921X_FILTER_UNK_UCAST > and YT921X_FILTER_UNK_MCAST is changed: > > ctrl = GENMASK_U32(10, 0); > > That seems to contradict "Other GENMASK() uses in the driver are > intentionally left untouched". > > The other change is the phy_mask calculation in yt921x_mbus_int_init(): > > mbus->phy_mask = ~GENMASK_U32(max_ports - 1, 0); > > Also, the message refers to "masks assigned to u16 and u32 fields", > but none of the changed lines involve a u16 field. The u16 variants are also pretty dubious. The result is always promoted to 'signed int' when used; which can have unforeseen consequences, eg ~(GENMASK_U16(15, 15) << 16). David > > Both changed lines give the same values as before, so runtime behaviour > does not change. Only the description is off. > > Could the message be reworded to describe the FILTER_UNK and phy_mask > changes, with the "left untouched" sentence dropped? The other option > is to convert the YT921X_MBUS_CTRL_* masks in mdio_bus.h as the > message says. >