Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1012515imm; Wed, 25 Jul 2018 09:57:41 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfdBIQ4vIpeX9Mr3TOVEAjfeQFKYtJAqU6OCUBtHUgB3e9lFayPgkAAP8CZE6feV48ZR4q7 X-Received: by 2002:a17:902:27a8:: with SMTP id d37-v6mr14380235plb.290.1532537861906; Wed, 25 Jul 2018 09:57:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532537861; cv=none; d=google.com; s=arc-20160816; b=bMFfMpYBBX1+d5ifgZoQAw1whTpVAztvmz9yp1+/dQS1p+wvzYQD97/jvR9bWHV06F PUTN8Tb+rFY0JpUrMFnit1T5sdU7o2a4WrPGNpsqypZqtoTMVcdfCLzKInnTpYd9hk1K +Rf0N191/kDNneRE0acH0xQkJPWFUcJ4LwX8EYqYs4FWqxRTDDCTgisO8mdnJq1k8Bs9 CtU2BHHCXOGUpEJzucQoxXvV5HlB66FLn9MHRvikKJgMnlykUtVUQ0aiRg0Ka+WcDDYY rRmP9x4kVBRgfzlzHAEACRKHlY/alK8FwxhaUo2WHq+BSicPXa44A9mWi8bnefBZGlZH kVaw== 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:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:arc-authentication-results; bh=qrbahrooGYdwtkT7VaZyxsvS5yUXMzjuLcAEmUC8hz0=; b=u6GAKZZpear1cKtdX6b6HF7i4dJPZH2Ng0vLfSVDCWZ4B8YGm1lH8JpP4ITgItIMr4 aATAbmRApfNnObot2i/C/ZCegTP9yc4zpunKh5pgG9ISDvale7cdSJ2qq25QRU4aFzHy KpeTGVHIgYi49dNT7zc/slp49Y2FypYfTkVBD5FZyQmBKwN86Hz5J4gS60/GClowqtzq 5l/xKia8Dtp0nXtvMR7Hh96Q0h5IWZUoDnro8/7WGahKMgStXXgFmqYc74ZQa3+1gR2W x+vWpy7wRGrAq/J7T1HOYrlpY6MRp0UEDQiXiALeYw2N2XSPWVqY6mY2UkOqJf//gmTI zMLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=V9kqLEcN; 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 v21-v6si1890111plo.397.2018.07.25.09.57.26; Wed, 25 Jul 2018 09:57:41 -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=V9kqLEcN; 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 S1729160AbeGYSJJ (ORCPT + 99 others); Wed, 25 Jul 2018 14:09:09 -0400 Received: from mail-ua0-f193.google.com ([209.85.217.193]:35902 "EHLO mail-ua0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728644AbeGYSJI (ORCPT ); Wed, 25 Jul 2018 14:09:08 -0400 Received: by mail-ua0-f193.google.com with SMTP id c12-v6so5121766uan.3; Wed, 25 Jul 2018 09:56:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=qrbahrooGYdwtkT7VaZyxsvS5yUXMzjuLcAEmUC8hz0=; b=V9kqLEcNexlsJgRjORLQMxugJRIjMBxnCRnHu3WX2XwxC7wF6yHs+NqPFw7Dgn4BI1 Ok7itKY1sBM5YFJMFCWNHP74JPKIyYibNL5LNwQ4Z4X/aHFITIJa1aM84LvQfLWvBgmT aGlFZ82eDzAAyMnO6tlLsX3TkQuF2cMeESJz0JibKHL6g29OKltMX9ag1y/ddkSdhH3l miPkvg36ga1QgpuIfou2quJv4DCt6qpD4sBciFJgM7eVHNrSFjGvQgvSXBvQ0wJFjI5v 8RINpcrylJuMajCMMv6n6t829k8Cxbi+k2AzBPrHrEBlLgAKUF0DV/02nVT7vdVEs72c 4hmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=qrbahrooGYdwtkT7VaZyxsvS5yUXMzjuLcAEmUC8hz0=; b=LgauvyERB+onv6AtpO+HCQcS6MbvuzcrffH4D1pICzjOMrKg531kM7GMlZSP1cOeny poDztUmR3FdMXb+TNJZ+gAWzIGiW/QkVuQgzTpt0EBOuPuM4hXG7Z/QUOhRavJLNhp0k N2HmqQUlFYiTTOtFPDUSemUJ5o3JFTc3XLv00o1uOaXvnI+ARR+PI6gZOn25DOO0j8GC aojDNcgOfhk8skjmC8jMldPUD3mR4djvCPVE1ouN+kCoDT8ITYTonfEkiU36BrufTPeB 0eu2eN8n0pdM3rLte1REYsMtPdI8BA3Q9REvz04qd6LXTK1Izvfut1edMJBrvWTIBRtB D6Ig== X-Gm-Message-State: AOUpUlEP9LQqnXbcQPSArngVbrLmQ6HwDstLFXB/vOAhuA9zgOqKp+7s 8d1GN9EpLNNmxYuA2NhKsYNwFSyn69hePF/lY7k= X-Received: by 2002:a9f:2187:: with SMTP id 7-v6mr16295363uac.49.1532537796550; Wed, 25 Jul 2018 09:56:36 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a67:2149:0:0:0:0:0 with HTTP; Wed, 25 Jul 2018 09:56:35 -0700 (PDT) In-Reply-To: <9fdfaf4e-5a20-af81-82ef-0d9e327f9133@synopsys.com> References: <1532120272-17157-1-git-send-email-soares@synopsys.com> <1532120272-17157-2-git-send-email-soares@synopsys.com> <9fdfaf4e-5a20-af81-82ef-0d9e327f9133@synopsys.com> From: Andy Shevchenko Date: Wed, 25 Jul 2018 19:56:35 +0300 Message-ID: Subject: Re: [PATCH 1/3] i3c: master: Add driver for Synopsys DesignWare IP To: Vitor Soares Cc: Boris Brezillon , Wolfram Sang , linux-i2c , Jonathan Corbet , Linux Documentation List , Greg Kroah-Hartman , Arnd Bergmann , Przemyslaw Sroka , Arkadiusz Golec , Alan Douglas , Bartosz Folta , Damian Kos , Alicja Jurasik-Urbaniak , Cyprian Wronka , Suresh Punnoose , Rafal Ciepiela , Thomas Petazzoni , Nishanth Menon , Rob Herring , Pawel Moll , Mark Rutland , "ijc+devicetree" , Kumar Gala , devicetree , Linux Kernel Mailing List , Geert Uytterhoeven , Linus Walleij , Xiang Lin , "open list:GPIO SUBSYSTEM" , Sekhar Nori , Przemyslaw Gaj , Peter Rosin , Joao Pinto Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 25, 2018 at 11:43 AM, Vitor Soares wrote: > On Fri, Jul 20, 2018 at 11:57 PM, Vitor soares > wrote: > Thanks for answers, my comments below. > This patch add driver for Synopsys DesignWare IP on top of > I3C subsystem patchset proposal V6 ... > +#include > Reset API. > > All of them required? Why? Thanks, got it. > There is some header files that are already included by others header fil= es. > Should I add them too? it there any rule for that? No need. Usually we drop some "wired" headers (when we sure that one will always include the other one, like module.h vs. init.h) > + writel(cmd->cmd_hi, master->regs + COMMAND_QUEUE_PORT); > + writel(cmd->cmd_lo, master->regs + COMMAND_QUEUE_PORT); > > hmm... writesl()? > Is there any advantage here? Here maybe not. Just a material to think about. If you can refactor code to utilize them, good. > + info->pid =3D (u64)readl(master->regs + SLV_PID_VALUE); > > Why explicit casting? > info->pid is u64 size. In C standard there is an integer promotion which allows you not to use explicit casting in such cases. > + u32 r; > + > + > + core_rate =3D clk_get_rate(master->core_clk); > > Too many blank lines in between. > > > For me in that way it's better to filter code parts. Do you think that is > not readable? The point is it's useless. On the other hand, you have a lot of inconsistency with that style. > + p =3D (ret >> 6) ^ (ret >> 5) ^ (ret >> 4) ^ (ret >> 3) ^ > + (ret >> 2) ^ (ret >> 1) ^ ret ^ 1; > + p =3D p & 1; > > Is it parity calculus? Do we have something implemented in kernel already= ? > > Btw, > https://urldefense.proofpoint.com/v2/url?u=3Dhttps-3A__graphics.stanford.= edu_-7Eseander_bithacks.html-23ParityNaive&d=3DDwIBaQ&c=3DDPL6_X_6JkXFx7AXW= qB0tg&r=3DqVuU64u9x77Y0Kd0PhDK_lpxFgg6PK9PateHwjb_DY0&m=3D5FpGHBbT8tYA6PB4R= T_9O6PJk3v-wYcy1MV59xoqK4I&s=3DFSJ3EcuoxPtRJWmsk9Yt4s_UH9kxFBam01Xvas2ZFdo&= e=3D > offered this > > v ^=3D v >> 4; > v &=3D 0xf; > v =3D (0x6996 >> v) & 1; > > > I search into the kernel and I didn't find any function for that. In your > opinion what shoud I use? If license of the piece above is okay to use in kernel, then definitely it would be better (even we might create a helper out of it). --=20 With Best Regards, Andy Shevchenko