Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1061023imm; Wed, 8 Aug 2018 10:03:55 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyE4Wf49tnLu1IaHwjs/XpGdlqisPQAyFon/hqLAwQ+UATTfm3JnPGxPQx8BT1FPKmgyHVT X-Received: by 2002:a62:57dc:: with SMTP id i89-v6mr3799680pfj.65.1533747835050; Wed, 08 Aug 2018 10:03:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533747835; cv=none; d=google.com; s=arc-20160816; b=tEeGZ5ilPAwXlOET3IKewHGtDN2GGjlXSDKISR0wwkcl1lqyHezJyJfJ3ztL7sR5Pu Hl4oVOK3GE+yAdLoOrndzjGPIK7gSKRXiPJzaGlXg3vzaI8FBTUY9cmhSTlLQqVjsvDM +ON33uhC8kIlOUtZTB0e3GbApndiw3S1LazLXENRegVXw72r4JJk81n2IDeWPUnXq+SZ G3/l7kKFXZHzZpqF6sX0qj9hivOnOU805UpYufEG8nF2GEwX+Ctl/7HEYay7K7m2tH4H +I1hFvmiExvHZznadawSpf2aaxRL+tgtJHAiQDv9/EjgHVTVVOiFWHeDCUszx/4MjqwL jzrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=eJMSkoet10ONb7mKG2K5Bm7WBGerEwLedwQWQV2lQrI=; b=unqON6EuHEl4tL51zJIz4iSJsQHMbW1Cq9kkInt7UdLBwUJ3BWxYIjAdddH4S6qOkS ad2fj7WPX9+phPY3KaKTYUrdNy6fsjFYt8pnqSV6xjZsQ/AxrV7V9Ey0BOSeZ2RMC17D cDwByW+lYnk1UVPItTgHXOuZi7oIjmy0o0DcTkCANrsRO4SofC4Y/fSYaZU3+mku6POe Z8/0OZ82DXIcMzgwuvBT8hz2DgiKWOokht+Xqx0cbqTLQwdj9RICvJYSMlkhXr4haeJ0 wDXlG6iDcFl/POXz/dXEIJ2pnTHOIspOeSRqz7rKdqfKk0YqD3eOogUgsK+axwicgmHr GLmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=edcw6xr5; 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=NONE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p15-v6si4652967pgh.281.2018.08.08.10.03.39; Wed, 08 Aug 2018 10:03:55 -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=@synopsys.com header.s=mail header.b=edcw6xr5; 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=NONE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728711AbeHHTWg (ORCPT + 99 others); Wed, 8 Aug 2018 15:22:36 -0400 Received: from smtprelay2.synopsys.com ([198.182.60.111]:48123 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727412AbeHHTWf (ORCPT ); Wed, 8 Aug 2018 15:22:35 -0400 Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by smtprelay.synopsys.com (Postfix) with ESMTP id 0344710C0443; Wed, 8 Aug 2018 10:02:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1533747721; bh=B/EC3a255cb429Na0WNv1klMpKKEpZCEG6tpHdOzJ+w=; h=Subject:To:CC:References:From:Date:In-Reply-To:From; b=edcw6xr5PTuliaZiQHvOuMKEBKnmkeXt1+3+/rso4NyaW0A1T8Wg16HMDp5wU8KM4 3Rxjj5oJE7cBKbw+et+uS9Yo2opY57NtRx8t58cu5LOpCmHnhkfFUWuEtdJsFA4JEV LPZwQGd/id4eMGHGScwM5IrGertu8DdV+GvuOVNyxye+gXXBgSWmyi1UBSnMzajwxt pFY0BlyA79Tr6HaM/xyf7vHx54u0IYJeW2rbmnwAZ5yg0lJF+gKxOq97XIPmt8ai+D qAvpaonau5bbhFGlZKaxacMOFXdQMJHc1yYWs8DYkZG3y9tszD5DO/8AwTkC8ZK3Qs uuUyVjx0DWEyw== Received: from US01WEHTC3.internal.synopsys.com (us01wehtc3.internal.synopsys.com [10.15.84.232]) by mailhost.synopsys.com (Postfix) with ESMTP id A875F5529; Wed, 8 Aug 2018 10:02:00 -0700 (PDT) Received: from DE02WEHTCB.internal.synopsys.com (10.225.19.94) by US01WEHTC3.internal.synopsys.com (10.15.84.232) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 8 Aug 2018 10:02:00 -0700 Received: from DE02WEHTCA.internal.synopsys.com (10.225.19.92) by DE02WEHTCB.internal.synopsys.com (10.225.19.94) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 8 Aug 2018 19:01:58 +0200 Received: from [10.0.2.15] (10.107.25.93) by DE02WEHTCA.internal.synopsys.com (10.225.19.80) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 8 Aug 2018 19:01:58 +0200 Subject: Re: [PATCH 1/3] i3c: master: Add driver for Synopsys DesignWare IP To: Andy Shevchenko , 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 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: vitor Message-ID: Date: Wed, 8 Aug 2018 18:01:55 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [10.107.25.93] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andy, On 25-07-2018 17:56, Andy Shevchenko wrote: > 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 files. >> 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 = (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 = 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 = (ret >> 6) ^ (ret >> 5) ^ (ret >> 4) ^ (ret >> 3) ^ >> + (ret >> 2) ^ (ret >> 1) ^ ret ^ 1; >> + p = p & 1; >> >> Is it parity calculus? Do we have something implemented in kernel already? >> >> Btw, >> https://urldefense.proofpoint.com/v2/url?u=https-3A__graphics.stanford.edu_-7Eseander_bithacks.html-23ParityNaive&d=DwIBaQ&c=DPL6_X_6JkXFx7AXWqB0tg&r=qVuU64u9x77Y0Kd0PhDK_lpxFgg6PK9PateHwjb_DY0&m=5FpGHBbT8tYA6PB4RT_9O6PJk3v-wYcy1MV59xoqK4I&s=FSJ3EcuoxPtRJWmsk9Yt4s_UH9kxFBam01Xvas2ZFdo&e= >> offered this >> >> v ^= v >> 4; >> v &= 0xf; >> v = (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). > Thanks for your comments I will take them into account for the next version. Best regards, Vitor Soares