Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp248835rdb; Mon, 29 Jan 2024 00:27:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IEZlQfZEz4xNgAAhg1jT8hw6aheOrpNHso0T81KswdZUnG8am7P3X2RQr4LTDGUOqGmY99J X-Received: by 2002:a17:902:b20a:b0:1d7:84ee:c08 with SMTP id t10-20020a170902b20a00b001d784ee0c08mr5649288plr.5.1706516828566; Mon, 29 Jan 2024 00:27:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706516828; cv=pass; d=google.com; s=arc-20160816; b=MU4+BSgWjVOY8zxdNdafs2m9ZssI7n7uxO0PdXyIaEhfLE1mJkI6TZKx3ETQWlhvHy ILkV9L01pTPUF8r6ObZ9BwajcSaUO4b6tU5W04hBWXRmfM5eQ98cWdDGg29lc5NjHtaY 33FL4HJVhYwvgZw9RYG3IMfMdi//k54RqJDvuTC9ybhibsbhQmJIhUgNC9uPavRQ+tQN SyZVXj0wGlLHnzl0kjRaEIXerTLj9gjzDl6RQziPAPp9/xwVaY5hOJvl00lgqv9cCdV6 bD/a65rguVVh8AJCEyjogKeqOtApblCHkAHfFfPApielXli+uGA+kqux4fW+q1QEmmND /MGg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=mz9knOX83VMCB+IAYdNqj+5MJYSaDTooTlw1bIDq7OU=; fh=VL4Gwjhe8VdEeWNk9/SJLKq1TVeADJ8Gwizj1ENrI1A=; b=ZnQDwpJBk3HCYslDNv/ulSQ+SBBK5uX2Le2zidqD6t/kv7xKrlJ+YnjlbcO2/+s+sD xvAqVg1uc/0uNYKuxy/ZL8A2pJ2Nxa6Yv6MHSTznEsuXNa6e/q62CYAhIxe1KItUI7rG wmhrdU3TUPaKDKYBKmH+no/tFG8Qk028o6yc7C41VedBcURMIl3jbA5/WpYrXDzjnXJT OYod/XGV9lAWRJNhNTOpv+iavMS7CJ/OHnPXhDPMHDF5SyZLMtM2FdxRZkTYVAwG72WN gqkAu2NZ335u5nlV6T49Sp+Sv63oL93qka0jGO7mTH9Su9IVDnF4dlhueESn8L896bs0 6aHw== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-42348-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42348-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 75-20020a63014e000000b005d69d168dd6si5106298pgb.832.2024.01.29.00.27.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 00:27:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-42348-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-42348-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42348-linux.lists.archive=gmail.com@vger.kernel.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 6C96FB230D7 for ; Mon, 29 Jan 2024 08:26:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AAE0253802; Mon, 29 Jan 2024 08:26:27 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 51EA9537F8 for ; Mon, 29 Jan 2024 08:26:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706516787; cv=none; b=PvYTYW/GahXVO789SwLiMbxl8SylraEh5FNL4GiHLW7CVvEx4PsHFaL3Vzifg0DaemnufEou94ZJQDkHaaEpnaiWi9aZyqQUNluss/7zpawXvns4yif/cZmucKf5ehzSalckS6xcvQ7DEewU+/VSlDhiFXfN0jtM1WRDEkVfMeM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706516787; c=relaxed/simple; bh=n5mYzt6CIUKIXRBaJM3scUctqvjLnQUCO48pzYRK6PA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=m7t6KF4lmD4z3WYijfqr8oSC0kzWwqeveVpYX/lq5n7FhBT28zEP9HAuW5Qi1XAlTTAfNpmKVVdAsb6MTrWruXbtgRGJqaRpEb1xPYZ61GdivHo51WFwYX9GgYA5hofCbayOJXYzPw7GFXriYLPXzahSxEQIkiLxFxfYs5weIB4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rUMxz-00071K-Tv; Mon, 29 Jan 2024 09:26:07 +0100 Received: from [2a0a:edc0:0:b01:1d::7b] (helo=bjornoya.blackshift.org) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rUMxx-0037so-TF; Mon, 29 Jan 2024 09:26:05 +0100 Received: from pengutronix.de (unknown [172.20.34.65]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: mkl-all@blackshift.org) by smtp.blackshift.org (Postfix) with ESMTPSA id 72691280715; Mon, 29 Jan 2024 08:26:05 +0000 (UTC) Date: Mon, 29 Jan 2024 09:26:05 +0100 From: Marc Kleine-Budde To: William Qiu Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-can@vger.kernel.org, Emil Renner Berthing , Rob Herring , Wolfgang Grandegger , Philipp Zabel , Krzysztof Kozlowski , Conor Dooley , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Paul Walmsley , Palmer Dabbelt , Albert Ou Subject: Re: [PATCH v1 3/4] can: cast: add driver for CAST CAN controller Message-ID: <20240129-zone-defame-c5580e596f72-mkl@pengutronix.de> References: <20240129031239.17037-1-william.qiu@starfivetech.com> <20240129031239.17037-4-william.qiu@starfivetech.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="zggniggrx7ssk34l" Content-Disposition: inline In-Reply-To: <20240129031239.17037-4-william.qiu@starfivetech.com> X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: mkl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org --zggniggrx7ssk34l Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello William Qiu, thank you for your contribution. I've some quick notes about your driver. On 29.01.2024 11:12:38, William Qiu wrote: > Add driver for CAST CAN Controller. And add compatibility code which > based on StarFive JH7110 SoC. Please add yourself or someone else at starfivetech to the Maintainers file. Please use BIT() and/or GEN_MASK() to create the _MASK enums. Please use FIELD_GET(), FIELD_PREP. Please replace the ccan_ioread8() by a proper 32 bit read and use FIELD_GET to access any non 32 bit value. Instead of ccan_iowrite8() use FIELD_PREP and a proper 32 bit write. The enum ccan_reg_bitchange looks very strange, why do you have OFF and SET values? The ccan_reigister_set_bit() and ccan_reigister_off_bit() functions looks very strange, too. I suggest to use a 32 bit read, set, clear the bits followed by a 32 bit write. Having set_bit() clear_bit() functions may lead to more register accesses than needed, if not handled with care. If you think the driver absolutely needs bit set/clear functions, please follow the name and signature of the regmap_update_bits(), regmap_set_bits() and regmap_clear_bits(). Please use can_put_echo_skb(), can_get_echo_skb(). Please implement proper TX-flow control. Stop the TX queue, if you HW queue is full, start the TX queue once the HW queue has space again. Consider using the rx_offload helper You claim you IRQ handler works with shared interrupts, but you return an error if there are no interrupts by your IP core. Please enable the clocks during open() and disabled during close() Marc --=20 Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung N=C3=BCrnberg | Phone: +49-5121-206917-129 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 | --zggniggrx7ssk34l Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEDs2BvajyNKlf9TJQvlAcSiqKBOgFAmW3YRoACgkQvlAcSiqK BOgKmgf8CP4DHYvozr25yPE/15GRtr4yDQDy5doYFxV8tAO2r1Y1iiU0mIz3aCLp e3qWwbV9jcftKht75T5CgcurR8Ouc6P4O89HsGkpyRz0c4Pg4X/gswBJ29hTRFQw JyaxQCaelQ5mbSAq0i2ZFCNiqBEzk6KyegUcmUabqOHmQTlpcXRYiJWRgKlKMoHr xjkTF4HgTcViIXb/JislwP7q8C4F2/qEEtSLfqgOCzZjaPSRP6cTo8yy+YdITFhx ntGdaMLEktRyMJVCcMfk5TXzea45E7yCa6cLL/4+VNzm/dsB1YF7Si9CC/nTXP9U G5qmdcL6AIGzthY2poRxdC/oX7ppgw== =HX7Y -----END PGP SIGNATURE----- --zggniggrx7ssk34l--