Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp2977164rdb; Tue, 12 Sep 2023 19:49:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHc/j9KFWZOUFt4RE10VvB03GBWJ0xv0inkD2+Wfa+qlhZ/ceKV6LSqAneEhOIa27S/4wqk X-Received: by 2002:a05:6a00:15ce:b0:68e:23c9:b306 with SMTP id o14-20020a056a0015ce00b0068e23c9b306mr1740935pfu.30.1694573378398; Tue, 12 Sep 2023 19:49:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694573378; cv=none; d=google.com; s=arc-20160816; b=bzya/JrMqsgJJZ2mOOdo9GfG8CivpYRDA3q7+HO0zpQqtKo6AvMhUHp+Drsbwq3vyF prjMhRI88XQL1zV4NEzHCaDzzYgxabhL5MFMvaMoxxMVM9pZ1jY3zlSGjlaQMZl53KuI 8YHN8EXXmxlAdRk5UfhzF68bj+G1nKJqS7LiRjU2L6RtJOrh/ztsPLnWMOE4M1gvIwW7 loXyqbi4TQC5VCqNgk9qv8hnXMdi0T0/DjYMr38RgpLM9gWohhGQJaEsN4+kL1/JBi1D IBfEMtFfgy40ej+IHXKRDvwdiGeR6nuPG1AgfetKG6SQwLBrrkEVFFVMeQzEYoboNA5t 79aw== 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=i91BS05TRPwWMcAnvpOckS6Is1mL2aOud8CYBYNDXIU=; fh=9AEOr0li2JaGGZ8GrLy4PDxyCdJTgwX+YE1VTs0mVmY=; b=bqj3yjFHjNqgvwMZB7yEgf61VjgALnMZ2jyk9IxG48smd0gjxy2MKdX+uZ2uHj7PCi dul9DJ/O75DYNzdfF5adTqyPwss3XLDwXDEPBdRpfEdLs66EW8K/mDHVFBjevOMQUy6T g3a1PqN9mimlVbKZD2i99o0rNpcJsbhJAyp+hgWX5DOk2LzLbVNCxQ3nc+yDR7yQC0PQ gAv0pqd0cUjqLBDH94Rj4hyDzHZLnVoMfChBtsBLWOzzjbfYue/VQggtOuq5w7KEMX7x 7R2M4K3skQcysoSZUDgCuCiv+zma9amouovDQsonJFzLSQETo3p3FIPWyMFk8fXkd+aw EgLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XgtUWf9J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id k25-20020a6568d9000000b00569466198c3si8999491pgt.751.2023.09.12.19.49.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 19:49:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XgtUWf9J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 0E85A83AC0DE; Mon, 11 Sep 2023 22:02:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.8 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230390AbjILFCZ (ORCPT + 99 others); Tue, 12 Sep 2023 01:02:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232070AbjILFBy (ORCPT ); Tue, 12 Sep 2023 01:01:54 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40CA8E6C; Mon, 11 Sep 2023 22:01:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1694494910; x=1726030910; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=CvDsWCO+be1IG+Rmf778MqHKB3/nXOhC4fYb3fHGuY4=; b=XgtUWf9JuJYSLHOcvoMyUo+yg8/gr2Q4+JzFdZNyMQyCntPz4HVIV8OO 2826yQId916whkzBaU2CiM7XqoGGMf4Br1nzblrvgufwWa4sfWDtCoqqv aCBvJHZVf2usGF6ax/ovWd16l64cf3/+fLzlkfMSTwrPY3VarPsyk5BbW sF7BlQpyWAKVy6PcEkVcAMIoMcm1fwascu6Vh+3FJrkPQyuqMeF27k0AN Ij01Egmuk3zeJySki79yKnROk0Z+e/ljbjHouOtI9sDpyIsNlCv3mgaHi NNK69Y83QsF566ZaI4I5IM5e9NlU1CbiezW4Csov2ze4a7UCcnsnilQfV Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10830"; a="375605517" X-IronPort-AV: E=Sophos;i="6.02,245,1688454000"; d="scan'208";a="375605517" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Sep 2023 22:01:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10830"; a="693356452" X-IronPort-AV: E=Sophos;i="6.02,245,1688454000"; d="scan'208";a="693356452" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga003.jf.intel.com with ESMTP; 11 Sep 2023 22:01:46 -0700 Received: by black.fi.intel.com (Postfix, from userid 1001) id 5AEF4248; Tue, 12 Sep 2023 08:01:45 +0300 (EEST) Date: Tue, 12 Sep 2023 08:01:45 +0300 From: Mika Westerberg To: Stephen Boyd Cc: Hans de Goede , Mark Gross , linux-kernel@vger.kernel.org, patches@lists.linux.dev, platform-driver-x86@vger.kernel.org, Andy Shevchenko , Kuppuswamy Sathyanarayanan , Prashant Malani Subject: Re: [PATCH v3 4/4] platform/x86: intel_scu_ipc: Fail IPC send if still busy Message-ID: <20230912050145.GC1599918@black.fi.intel.com> References: <20230911193937.302552-1-swboyd@chromium.org> <20230911193937.302552-5-swboyd@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230911193937.302552-5-swboyd@chromium.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 11 Sep 2023 22:02:25 -0700 (PDT) On Mon, Sep 11, 2023 at 12:39:36PM -0700, Stephen Boyd wrote: > It's possible for interrupts to get significantly delayed to the point > that callers of intel_scu_ipc_dev_command() and friends can call the > function once, hit a timeout, and call it again while the interrupt > still hasn't been processed. This driver will get seriously confused if > the interrupt is finally processed after the second IPC has been sent > with ipc_command(). It won't know which IPC has been completed. This > could be quite disastrous if calling code assumes something has happened > upon return from intel_scu_ipc_dev_simple_command() when it actually > hasn't. > > Let's avoid this scenario by simply returning -EBUSY in this case. > Hopefully higher layers will know to back off or fail gracefully when > this happens. It's all highly unlikely anyway, but it's better to be > correct here as we have no way to know which IPC the status register is > telling us about if we send a second IPC while the previous IPC is still > processing. > > Cc: Prashant Malani > Cc: Kuppuswamy Sathyanarayanan Reviewed-by: Mika Westerberg