Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp927536yba; Mon, 1 Apr 2019 21:28:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqw7ntKNAWLxUMCz0vrHg3hD6EXQBkqP1A32xKJSztRcpxddslylJnPbKcBQ7NKBt7ODgxJE X-Received: by 2002:a62:6444:: with SMTP id y65mr58411446pfb.56.1554179331502; Mon, 01 Apr 2019 21:28:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554179331; cv=none; d=google.com; s=arc-20160816; b=M16w6oUFYqHgpEQWFrGPe839iWnZH9BMyBLyjmtPs1sgpLhcup2zV+DKdvn4WA2AoK 5/K7W/HRN7cqF4O9cGKDQIpcVE1/pg+y/ykheREOGCgy84g9+5Vn1pu+u+hB3tiSE/TB NuyNDz1e1VfW4YtgZS/tbVKDpd9T7MYSe4kcpNu9PYbwDtZq9puJq6/MjTagg6M69/e7 lRmfnWNdXctAaN0aXfdAAGqk0CmHRWfKHuR+n4zXwjlLyzIXmoY3+3ogomzIYkBv6E4l 3fGxHsCZT+fNzrg/1oDYfFBvWDguaQGFrYpx1a1RrfenjDzXGSw1SBITEnnMBoE5f7YL IJ7A== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=EPI53J0JAqeqETyrZ2vCuICWZoGPQcC2zSW0b6FwG7I=; b=v+eQKIS8Kkc5CiNPMTH7cDqMfsNIse8Jjg52pFth5jVGXaJ/xNzPbDgw3qE3EB+mU4 aIm1W03JxgfKiNM6gop7BVHsPzP8Pg8kjHTgulTv3IkVz1XRNxb9NUfd29S7omv3shXk x+ErvTw/iH5q0Usqit01P2i39n/NsI8wQGcVdoJ9BjjxTB0hbCnaucrTX20rG+Ac0Vo3 L1o46D8/PrGcKaMUKKbU/uBbyv3G8f4MXdTe6wIq4WDHpYSpApJBCi5JABVs6k81hQmz OOSP5MF6tmXoCPTGkRb7fSsi2/1iFSFSWgThbq4k+EYHutqRQUjeTOyNSq+zsh+KZen3 TfYQ== 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 cm17si11211830plb.139.2019.04.01.21.28.35; Mon, 01 Apr 2019 21:28:51 -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 S1728483AbfDBEWm (ORCPT + 99 others); Tue, 2 Apr 2019 00:22:42 -0400 Received: from mga09.intel.com ([134.134.136.24]:64466 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726097AbfDBEWm (ORCPT ); Tue, 2 Apr 2019 00:22:42 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Apr 2019 21:22:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,298,1549958400"; d="scan'208";a="219697975" Received: from rajeev-desktop.iind.intel.com (HELO intel.com) ([10.223.84.39]) by orsmga001.jf.intel.com with ESMTP; 01 Apr 2019 21:22:38 -0700 Date: Tue, 2 Apr 2019 09:52:32 +0530 From: Rushikesh S Kadam To: Nick Crews Cc: Joe Perches , Srinivas Pandruvada , benjamin.tissoires@redhat.com, jikos@kernel.org, jettrink@chromium.org, Gwendal Grignou , linux-kernel , linux-input@vger.kernel.org Subject: Re: [PATCH v3] HID: intel-ish-hid: ISH firmware loader client driver Message-ID: <20190402042232.GA2736@intel.com> References: <1553889813-17677-1-git-send-email-rushikesh.s.kadam@intel.com> <20190330102230.GB19202@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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 Nick, Joe thanks for your comments Regards Rushikesh On Mon, Apr 01, 2019 at 03:17:13PM -0600, Nick Crews wrote: > I tried to send the last message from my phone, and surprise it wasn't > formatted correctly, so it may have been marked as spam. repeating > myself again... > > Ah, I guess I was wrong about logging OOM. I hadn’t hear about the > recommendations against it, but they make sense. Thanks for the > clarifications! > > On Sat, Mar 30, 2019 at 10:27 AM Joe Perches wrote: > > > > On Sat, 2019-03-30 at 15:52 +0530, Rushikesh S Kadam wrote: > > > On Fri, Mar 29, 2019 at 04:30:18PM -0700, Nick Crews wrote: > > > > On Fri, Mar 29, 2019 at 1:03 PM Rushikesh S Kadam > > > > wrote: > > > > > + ldr_xfer_ipc_frag = kzalloc(LOADER_SHIM_IPC_BUF_SIZE, GFP_KERNEL); > > > > > + if (!ldr_xfer_ipc_frag) { > > > > Log error here. > > > The error code is logged in calling function > > > load_fw_from_host(). Is that good enough? > > > > > > I believe the checkpatch script too, would > > > recommend against adding debug print for ENOMEM > > > error. > > > > The generic kernel allocation functions already do > > a dump_stack() on OOM conditions when called without > > __GFP_NOWARN so any additional OOM message isn't > > particularly useful. > > > > > Again, I thought it was against practise to log > > > "out of memory" debug prints in probe() > > > > Or anywhere else given the generic OOM stack dump. > > > > > But will add if you tell me this is the right way. > > > > > > > > + return -ENOMEM; > > > > > + > > > > > + loader_ishtp_cl = ishtp_cl_allocate(cl_device); > > > > > + if (!loader_ishtp_cl) > > > > > > > > log error here > > > > The ishtp_cl_allocate function just calls kmalloc then > > initializes the struct so an additional OOM message > > isn't useful here either. > > > > --