Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1390338rwb; Mon, 7 Nov 2022 00:45:19 -0800 (PST) X-Google-Smtp-Source: AMsMyM6U9/FWxZC4xHtRLa8i1JXRUeHMcGPuVH78jnxWGOf89eLHQylIkBUsxqqWhD4XDw7ql62p X-Received: by 2002:a05:6402:c45:b0:442:c549:8e6b with SMTP id cs5-20020a0564020c4500b00442c5498e6bmr50109267edb.123.1667810719443; Mon, 07 Nov 2022 00:45:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667810719; cv=none; d=google.com; s=arc-20160816; b=rZ95JCDQB743O+Ws9ErKUBaQHqg7MaoKsCJkrv3Z7OCMUvq8QRRpDHolSdCw4SmXRK 7bjKl63OIV+tVd2UvBF0cxIU6oKXap/UcC0yYaqURRYlweoAhDjhkRFuxJZDnpc9c7Yj pelBIWezndzfGqQH4AxvbuFdrs4h+Z7wuT1JGXdQkiD92qJr8sHtUwJwUfUuGQ3Ecy8o ZH1EX+czKNRVEpSG3QnarRL+G9ItSMerm8y1nxuuzW7hEYCs5k+V/bFJC+B4Jb8/aBWN IZLLtoEoMOUCa93gE5eFcq8pRRKq86dnKhkBwDRvidKi2ZeTin2XnfAigOEeHLUfWy1K 6raQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=bQhPLIQHoABisqVr0HowwoJLGpv4ta8Q5LR/iCv16+s=; b=rGOcetKR/HL5GOp3z5vA76HWyYqQ6b9OyHBJGTvYEleNCXkRMs3YZqrIamnsIOl3bn bxwdlRtYx2iYwRBasc3Yzpi6mL1WlD6H6qzaVnmQ9tBY1Hq1QJ+mCpUFyog3hjZ44Pbu /Drl/1rdwviSyqt7R4ghlDkzSUhnvfZQBifGyGSZiFHU0ev3deecLoUZxfez7ryW8VU8 auD71BAYajxkGkVLaeqCMv3ddQs810U3rqFgmXa6MT2zP2E0vDG/xuKGxANVdHP8HctT 6qDj02dHjxUublsnR9a5zMWgTIxQyX0rqE8eueimR7mjDwJtN85vA8oII2/AOonXMlqb sL+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Po9jk6mq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hu8-20020a170907a08800b007ad9c8201e7si8216084ejc.93.2022.11.07.00.44.56; Mon, 07 Nov 2022 00:45:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Po9jk6mq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230364AbiKGIP5 (ORCPT + 95 others); Mon, 7 Nov 2022 03:15:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230404AbiKGIPz (ORCPT ); Mon, 7 Nov 2022 03:15:55 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AD6FB7FF for ; Mon, 7 Nov 2022 00:15:54 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A50B660EE7 for ; Mon, 7 Nov 2022 08:15:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F231C433D6; Mon, 7 Nov 2022 08:15:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1667808953; bh=sDAKw5K/VHEkLRudBsQgRtFT6FKfiF09ob6HSWj7wnA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Po9jk6mqeJ1qjonTmaUVqECLpxtNzj6fm43gE1EO9fTCiHhLzs7f3126ej3kiEET3 ngX91nBYTznrWwdN3d56m05OUj0ZZLjg9+blnRXsGSJjhSyQ7LY9mzFb0vMT5T9th1 A7SZFkoxQbQ5Hd8E2opoyDQGxHelBH/oJYNiJSiU= Date: Mon, 7 Nov 2022 09:15:49 +0100 From: Greg Kroah-Hartman To: Alexander Usyskin Cc: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie , Daniel Vetter , Tvrtko Ursulin , Tomas Winkler , Vitaly Lubart , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mei: add timeout to send Message-ID: References: <20221103155534.1966589-1-alexander.usyskin@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221103155534.1966589-1-alexander.usyskin@intel.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 03, 2022 at 05:55:34PM +0200, Alexander Usyskin wrote: > When driver wakes up the firmware from the low power stand, > it is sending a memory ready message. > The send is done via synchronous/blocking function to ensure > that firmware is in ready state. However firmware might be > in unstable state and send might be block forever. > To address this issue a timeout is added to blocking write command on > the internal bus. > > Signed-off-by: Alexander Usyskin > --- > drivers/misc/mei/bus-fixup.c | 19 +++++++++++-------- > drivers/misc/mei/bus.c | 9 +++++---- > drivers/misc/mei/client.c | 21 +++++++++++++++++---- > drivers/misc/mei/client.h | 2 +- > drivers/misc/mei/main.c | 2 +- > drivers/misc/mei/mei_dev.h | 2 +- > 6 files changed, 36 insertions(+), 19 deletions(-) > > diff --git a/drivers/misc/mei/bus-fixup.c b/drivers/misc/mei/bus-fixup.c > index 71fbf0bc8453..3174cad8a5cc 100644 > --- a/drivers/misc/mei/bus-fixup.c > +++ b/drivers/misc/mei/bus-fixup.c > @@ -128,7 +128,7 @@ static int mei_osver(struct mei_cl_device *cldev) > os_ver = (struct mei_os_ver *)fwcaps->data; > os_ver->os_type = OSTYPE_LINUX; > > - return __mei_cl_send(cldev->cl, buf, size, 0, mode); > + return __mei_cl_send(cldev->cl, buf, size, 0, mode, 0); Ick, adding another parameter to a function is not helpful here, what does 0 mean unless you look it up? > --- a/drivers/misc/mei/bus.c > +++ b/drivers/misc/mei/bus.c > @@ -29,11 +29,12 @@ > * @length: buffer length > * @vtag: virtual tag > * @mode: sending mode > + * @timeout: send timeout for blocking writes, 0 for infinite timeout What units are these in? Jiffies? seconds? hours? Don't make us guess :( Why not write a function that is mei_cl_send_timeout() that has the new option? That way it's obvious that the other ones are blocking, right? thanks, greg k-h