Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp468039imu; Fri, 7 Dec 2018 04:07:51 -0800 (PST) X-Google-Smtp-Source: AFSGD/Xn+sRmHa1U1420p43KAJv2hDeZjeMxfycF7YiRMi1rY9DVUYm1/C4OLe8rlqxS72MwL87L X-Received: by 2002:a17:902:3283:: with SMTP id z3mr1928210plb.76.1544184471536; Fri, 07 Dec 2018 04:07:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544184471; cv=none; d=google.com; s=arc-20160816; b=vrMh6DJVipguuvNfPM3GlwhDftHtuGHBCiwQDPJPLeeUfTZUve5Mx8l4ypTzi+NVee Jm/3T0ehrZOqSQ6RWfLP1fh7QsaTWs/PN7bmmiZsXVBI1CZgAdojYC7iWq9sN1RdoSrT gK6/h0/kDJefz+ZtBQqt7J88f+xMGiPZ1xhkJu04htjSSdxAzsMvhmlCT+mK+QKmucPd QaXaGJH8Sw1NmY2AOiSV4Y90GIn8Oz9QEqnX+FmwTOreVyGFSk/vf5f/gXo/1XUXBYJ2 8q53S72uUTRBkPYvHBv+gaaVFGy58cGsHzA5ax5dqzLnvZ4+2RK4QaDP5otsZaD7idu+ yFtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=gn5yqExkx8LVvnPewt7HQgCoJFwOisj7gpd88seTwT0=; b=GCJQm+BuiCsjBFLc3XHCUTncvEQAE0FqVn2lpXSYZUSnAjPbVHbC2D5UCfmpMuLMuk 18W9iyeJQs43OIDA1l2QGwu4+rFp9aRYpz4wx/QULAaQ/dpT6R+RjXnNFxooKv6f21YH IhSYjD5ZJUAH6P+u3rWtYUvu/cEbuLLb/GbVryIfaZpy3q77xp1wiWoydefrovHL4u0r WzjhO/OmmEOys/bIYglvfV8dO36CVa76+WBkfTWWLIvUj71wnO6IdmWgAkcTcUhv49WB kJVG8+TiW4a98ETw9lxWxYKGQOBSin7W3TL7+nrHGE5WKoe9h1npzUK8HkVrtvalcYN0 rgmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZBPIwkPe; 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 a11si2903659pla.20.2018.12.07.04.07.32; Fri, 07 Dec 2018 04:07:51 -0800 (PST) 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=ZBPIwkPe; 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 S1726103AbeLGMFf (ORCPT + 99 others); Fri, 7 Dec 2018 07:05:35 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:35699 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725992AbeLGMFf (ORCPT ); Fri, 7 Dec 2018 07:05:35 -0500 Received: by mail-wm1-f67.google.com with SMTP id c126so4283532wmh.0; Fri, 07 Dec 2018 04:05:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=gn5yqExkx8LVvnPewt7HQgCoJFwOisj7gpd88seTwT0=; b=ZBPIwkPeGAFDY7r8g/YJ4qtcJU+DtzWz55YJlO3Kb2cFhj3Yq43xEpXjidkLVWpoXx URyC+r1FWFEQz6R3GzNCKHbC9IARrKjHhGnHfhcwjlYoQXH0WDQMWdgpphG8SNaUHXan YT6JB4328oMIHyJOyFL0gFHX513T1aczEE5PEVv6U66pHYHF8wsb/qRt9B4Vbatbz1ea IZdM8foe7M7EW+ceCObJWWAd8Q+xPFiBakfU96BI5ya7tfSRH9+kXXuuS0AnjHyQvBa6 OzEoNjFrV2FTfkfNumIzkrIgthcdwIg4FAYZblDRqTlVgUXbUy2P4hi2sDC9EtN2FSCM LIwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=gn5yqExkx8LVvnPewt7HQgCoJFwOisj7gpd88seTwT0=; b=MI6zopIHKUwhl7Le9vusTpLWv3Z6OFuAbz/MgMdrwLanqQBcE7lYZAUIgJmhGB76F7 aqt2Opsof0EcdlnIUkpFSd3Bx/zc8iUHAXOCUOQqHdubNmX99KkuVdOqyOThYH49JuHJ 4cVrritWzbOD5qmuBuWqN8l5D0v68j2Bzuz9NoqdHbcBeFGhvUYAWqrE3dnrZbwpPyEg nliY/nnClP4fqPGX9gMOdVbUGX1u01qySLoVqZaUQxO7gHBWw476uIH2hjfJN1fgweW1 vwMHBYfgvnthSg7ua/R/UwzsiGzg9j/qUhrUGa+284fES4LGrtWHICjMfOYJ8HwAaSRf MTig== X-Gm-Message-State: AA+aEWbDbdtuiyGC4+agpWlIbHzFBevm26UsLmFrMNAdtF0x0dGd6Fkg DEq10+h0y5KsyeNEc+emleD/Qsiq X-Received: by 2002:a1c:2457:: with SMTP id k84mr1978795wmk.139.1544184331386; Fri, 07 Dec 2018 04:05:31 -0800 (PST) Received: from [192.168.1.4] (ip-86-49-110-70.net.upcbroadband.cz. [86.49.110.70]) by smtp.gmail.com with ESMTPSA id r64sm4295136wmg.5.2018.12.07.04.05.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Dec 2018 04:05:30 -0800 (PST) Subject: Re: [PATCH v2 1/2] spi: Add Renesas R-Car Gen3 RPC SPI controller driver To: masonccyang@mxic.com.tw Cc: boris.brezillon@bootlin.com, broonie@kernel.org, Geert Uytterhoeven , Simon Horman , juliensu@mxic.com.tw, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-spi@vger.kernel.org, zhengxunli@mxic.com.tw References: <1543828720-18345-1-git-send-email-masonccyang@mxic.com.tw> <1543828720-18345-2-git-send-email-masonccyang@mxic.com.tw> <84e3c55b-687e-28f6-0a7c-1c48c822ef05@gmail.com> <93bb36af-8bdb-c90e-3777-62fe1a48f76a@gmail.com> From: Marek Vasut Message-ID: <8517f472-4981-db32-f5d8-056b70584e86@gmail.com> Date: Fri, 7 Dec 2018 13:01:24 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/07/2018 08:24 AM, masonccyang@mxic.com.tw wrote: > > Hi Marek, Hi, >> >> >> > + >> >> >> > + ? ? ? ? regmap_write(rpc->regmap, RPC_SMWDR0, >> >> >> > + ? ? ? ? ? ? ? ? *(u32 *)(tx_buf + pos)); >> >> >> >> >> >> *(u32 *) cast is probably not needed , fix casts globally. >> >> > >> >> > It must have it! >> >> >> >> Why ? >> > >> > Get a compiler warning due to tx_bug is void *, as Geert replied. >> >> The compiler warning is usually an indication that this is something to >> check, not silence with a type cast. >> >> > Using get_unaligned(), patched code would be >> > ----------------------------------------------------- >> > regmap_write(rpc->regmap, RPC_SMWDR0, >> > ? ? ? ? ? ? ? ? ?get_unaligned((u32 *)(tx_buf + pos))); ? ? ? ? ? ? ? ? >> > ---------------------------------------------------- >> >> Do you need the cast if you use get_unaligned() ? > > yes! Why ? (you can drop one iteration here by explaining why right away, since I'll ask for that explanation for sure) >> >> >> > + >> >> >> > +static const struct regmap_range rpc_spi_volatile_ranges[] = { >> >> >> > + ? regmap_reg_range(RPC_SMRDR0, RPC_SMRDR0), >> >> >> > + ? regmap_reg_range(RPC_SMWDR0, RPC_SMWDR0), >> >> >> >> >> >> Why is SMWDR volatile ? >> >> > >> >> > No matter is write-back or write-through. >> >> >> >> Oh, do you want to assure the SMWDR value is always written directly to >> >> the hardware ? >> > >> > yes, >> > >> >> >> >> btw. I think SMRDR should be precious ? >> > >> > so, you think I should drop >> > regmap_reg_range(RPC_SMWDR0, RPC_SMWDR0) >> >> No, I am asking whether SMRDR should be marked precious or not. >> > > I don't think so, > precious_reg: the register should not be read outside of > call from driver, i.e,. a clear on read interrupt status register. If you read the reg outside of the call from driver, it will mess up the internal FIFO and the whole driver will get into undefined state, right? Maybe Mark can chime in ? >> [...] >> >> > CONFIDENTIALITY NOTE: >> > >> > This e-mail and any attachments may contain confidential information >> > and/or personal data, which is protected by applicable laws. Please be >> > reminded that duplication, disclosure, distribution, or use of this >> > e-mail (and/or its attachments) or any part thereof is prohibited. If >> > you receive this e-mail in error, please notify us immediately and >> > delete this mail as well as its attachment(s) from your system. In >> > addition, please be informed that collection, processing, and/or use of >> > personal data is prohibited unless expressly permitted by personal data >> > protection laws. Thank you for your attention and cooperation. >> > >> > Macronix International Co., Ltd. >> >> Can you do something about this ^ please ? >> > > I submit the patch file is by another remote git-server, which > supports git-format patch, git send-mail and so on. > But it can't receive email. > > I get/send email are by office PC w/ Notes system and > this "CONFx NOTE:" is appended automatically by Notes mail-server. > > Please just never mind it. I am concerned MXIC can sue everyone on the CC list of this email based solely on your suggestion to ignore this paragraph. That's not a good position to be in. -- Best regards, Marek Vasut