Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2081552yba; Wed, 3 Apr 2019 00:29:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqzChe9NAXFxmE6xKU3uJA4przOwU9lpzdcBM5YVWvTM2yJB/zvmQB4PTcQfaffXg4iMPuxp X-Received: by 2002:a17:902:7247:: with SMTP id c7mr56230091pll.255.1554276569275; Wed, 03 Apr 2019 00:29:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554276569; cv=none; d=google.com; s=arc-20160816; b=I0EOF5sfwGCPjKumH78J5x4nD4aAcGaNi3UnP37BzeWMZSt+F/o/7HsSaZ9H2ozXZ+ s3lnX+nFKhnHfLKxrVYyZ0+pjinbj1Nyu87W6tkh7IUpDVd2ZDBxJEwpRstABUS71tgJ 7PD8745mx38oxpLZyV7hQomiR7Lf07fed8zGVG0v+TKJ6HjCoeMA0pgl1tLfs+4FLd96 8JrwPYVw3yOg94SqQq3lCRyjmWqdy1a5JgoFT7yk8i6oCkpjiUU3FpZwmSt/AkWDZCfL fAhBzA0tpPwAzVGb2KhP8/8vJ0hOPFUBNk3RwQV6ixjQ4hjh0ZN11mniic0fo5WVBmXo Ltag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=EXFdBFpgEYNWHP1BkgB/ntgIrznXUZDSJWsSbceVAFA=; b=w0OFPeN7qvrnsmtH0TjSaYm5iyu8qCyvThdO+CkpFuQUS7HKwdn63iQzeN5JG9jNyR V36dRrxLdnMjI/35JYdyESUotlqMQcZ01yzi1mNfAHJRdeVQq8a7oL2DbIEAREkREQsX i7IOlfw/e2nVcSB9q5aJ/v5SzG6hKKnRlsZA9vDTC3rc7ngbzGcY66LPgOeHWKnloC7V Pf7IGUHHgBZk1zJjsG6kJeN8RJQld+9eJszVE79psxId6kXFNaqY41NValkFUr2BTPpn qubDqOPzuSbLpSj1Pfdpi73H1ZxjAecARRl8URdMrWYmM+kfRNlcEdghTDolV5LBxqUV pdBA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y18si14195584pfc.71.2019.04.03.00.29.12; Wed, 03 Apr 2019 00:29:29 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726792AbfDCH2X (ORCPT + 99 others); Wed, 3 Apr 2019 03:28:23 -0400 Received: from mga11.intel.com ([192.55.52.93]:22772 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725936AbfDCH2X (ORCPT ); Wed, 3 Apr 2019 03:28:23 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Apr 2019 00:28:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,303,1549958400"; d="scan'208";a="137159522" Received: from rajeev-desktop.iind.intel.com (HELO intel.com) ([10.223.84.39]) by fmsmga008.fm.intel.com with ESMTP; 03 Apr 2019 00:28:19 -0700 Date: Wed, 3 Apr 2019 12:58:18 +0530 From: Rushikesh S Kadam To: Jett Rink Cc: Srinivas Pandruvada , Benson Leung , Enric Balletbo i Serra , Guenter Roeck , Nick Crews , Gwendal Grignou , linux-kernel Subject: Re: [PATCH] platform: chrome: Add ChromeOS EC ISHTP driver Message-ID: <20190403072817.GA6944@intel.com> References: <1554060310-18078-1-git-send-email-rushikesh.s.kadam@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jett On Tue, Apr 02, 2019 at 09:48:12AM -0600, Jett Rink wrote: > On Sun, Mar 31, 2019 at 1:25 PM Rushikesh S Kadam > wrote: > > + > > +/* > > + * The Read-Write Semaphore is used to prevent message TX or RX while > > + * the ishtp client is being initialized or undergoing reset. > > + * > > + * The readers are the kernel function calls responsibile for IA->ISH > nit: s/responsibile/responsible Thanks > > +/** > > + * ish_send() - Send message from host to firmware > > + * @client_data: Client data instance > > + * @out_msg: Message buffer to be sent to firmware > > + * @out_size: Size of out going message > > + * @in_msg: Message buffer where the incoming data copied. > > + * This buffer is allocated by calling > > + * @in_size: Max size of incoming message > > + * > > + * Return: Number of bytes copied in the in_msg on success, negative > > + * error code on failure. > > + */ > > +static int ish_send(struct ishtp_cl_data *client_data, > > + u8 *out_msg, size_t out_size, > > + u8 *in_msg, size_t in_size) > > +{ > > + int rv; > > + struct header *out_hdr = (struct header *)out_msg; > > + struct ishtp_cl *cros_ish_cl = client_data->cros_ish_cl; > > + > > + dev_dbg(cl_data_to_dev(client_data), > > + "%s: channel=%02u status=%02u\n", > > + __func__, out_hdr->channel, out_hdr->status); > > + > > + /* Setup for in-coming response */ > nit:s/in-coming/incoming/ Thanks > > +/** > > + * ish_event_cb() - bus driver callback for incoming > > + * message > > + * @cl_device: ISHTP client device for which this message is > > + * targeted. > > + * > > + * Remove the packet from the list and process the message by calling > > + * process_recv. > > + */ > > +static void ish_event_cb(struct ishtp_cl_device *cl_device) > > +{ > > + struct ishtp_cl_rb *rb_in_proc; > > + struct ishtp_cl_data *client_data; > > + struct ishtp_cl *cros_ish_cl = ishtp_get_drvdata(cl_device); > > + > > + client_data = ishtp_get_client_data(cros_ish_cl); > > + > > + while ((rb_in_proc = ishtp_cl_rx_get_rb(cros_ish_cl)) != NULL) { > > + /* Decide what to do with received data */ > > + process_recv(cros_ish_cl, rb_in_proc); > > + } > > +} > > + > > +/** > > + * cros_ish_init() - Init function for ISHTP client > > + * @cros_ish_cl: ISHTP client instance > > + * @reset: true if called for init after reset > > + * > > + * This function complete the initializtion of the client. > > + * > > + * Return: 0 on success, non zero on error > > + */ > > +static int cros_ish_init(struct ishtp_cl *cros_ish_cl, int reset) > > +{ > > + int rv; > > + struct ishtp_device *dev; > > + struct ishtp_fw_client *fw_client; > > + struct ishtp_cl_data *client_data = > > + ishtp_get_client_data(cros_ish_cl); > > + > > + dev_dbg(cl_data_to_dev(client_data), "reset flag: %d\n", reset); > Why are we passing in the reset flag here, we are only using it for a > debug message; it > doesn't seem worth passing reset as a parameter. Yes, will drop the reset flag. > > > +late_initcall(cros_ec_ishtp_mod_init); > > +module_exit(cros_ec_ishtp_mod_exit); > > + > > +MODULE_DESCRIPTION("ChromeOS EC ISHTP Client Driver"); > > +MODULE_AUTHOR("Rushikesh S Kadam "); > > + > > +MODULE_LICENSE("GPL v2"); > > +MODULE_ALIAS("ishtp:*"); > > -- > > 1.9.1 > > > > Besides the minor comments, this looks good to me, and I will add > review and tested tags on subsequent patch. I'll send v2 shortly Regards Rushikesh --