Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1265441ybl; Fri, 23 Aug 2019 16:31:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqwb5IGh/Pwa+e5Wk3Nm+IE68yPs3pdgnjaiZK+yjdUdiineo6XrrTJquPzpYeIQJvUX6ii3 X-Received: by 2002:aa7:9a86:: with SMTP id w6mr7998501pfi.60.1566603068624; Fri, 23 Aug 2019 16:31:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566603068; cv=none; d=google.com; s=arc-20160816; b=U564ZbiBvIhVJDK9Dztr8GdgeARNFl6g1ZiWSKxBGX4lqHf1UfH5P4GHcCtwxC+oFk ElEjR7KIBgk1stMD4FQRFoxz67svh/BZRmJGa9CU9yjid+rVI9Sp0GgsQr3m+lv8/PO5 /BJ7gdywMGdKtNPyKlNOJvzl++2YpBOjpcBsxQPVrT0rMJqCjcEFG5d7Z29tsJxm6cEC IpWbqCmBrZtDmPliXRtuChh/MVh6SIwAYl96BwZzad3/ZAzhP+jvz9MUwccAK5Bc2/KZ eHT7f41c0VGgyzLTU7Fdg1fBxtt2mwmOJyA9UnGKesmdG7sy7v1oVGYWxxxVYZkSdNZL WhZg== 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=e6gbuFk04+ij6vjmtC7dZeomrE2Z6PDlZ2TY3DqrgL8=; b=in8pvzNotih0hzRGcUxYIKWMmOWzOCwcZFnGGJzpBlVATqD5VRESuX9RWUdH86bhmP OTkBQYPLlfXvdiZe9KbxJYVFcIzG/cy5dgcLTuJIfBiqRdIT31Md75tpL94lSPlbo+aI +drCr/WGZotyNVYR/izLyozaqiIGPe+qwju2w1zDLLolda8cuUVCJ/8dPl13sD4LNeLP iNEPFZ72Hld6M7msuakGP3lHU8nWpTLJLVLlAldj9vDDICuT8WzTmCBje1sEoFdODyKH 8Df/l92vuHdW+AlZDI8oRQe/ZN6Gu1L/75wsTaRnnD9MprLRBl4+5mjT2emQrsYxIEjT YGKw== 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c22si3783540plz.361.2019.08.23.16.30.53; Fri, 23 Aug 2019 16:31:08 -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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405909AbfHWPnE (ORCPT + 99 others); Fri, 23 Aug 2019 11:43:04 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:34683 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726465AbfHWPnE (ORCPT ); Fri, 23 Aug 2019 11:43:04 -0400 Received: by mail-pg1-f195.google.com with SMTP id n9so5997922pgc.1; Fri, 23 Aug 2019 08:43:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=e6gbuFk04+ij6vjmtC7dZeomrE2Z6PDlZ2TY3DqrgL8=; b=QLHgDm6HNsuMn1HGjbjWhkhHiVW/zxBjbUayNy5D+dcbxqiz9I+U1mH0tmY54MQv2q fU2IdPInVpjANNuMtJVE0F3wF8ZdZy/PR5tdM9aS+PEeifYpl9kceNglF7KQpCwcrUyX 7cwhbazJ9p1AIkyjlzQxmj18Lfvf+9eUoBEskXjaXiVyKrX7/Kj5hNbW77M0x7tH8gWN MSGRQhsYKO1ajzBVm9V3MRtbLc+sL18N1F8MZuXIe0emHEfe3zmd9hnNtvzyeFqt3UNY 7hbyD6pPzhri8EhIsEmC2gX6ZIyCdqDMGh7tik86ZilVPKXDmn34BE0XoUNIg1JTfmOW cntg== X-Gm-Message-State: APjAAAV9uZY2P/abchMRjCbAk7jsSUIvV1C8mclOqR4ptSjV9zXik8Za MOiHA+KP6+pCJJaFJfaXRWg= X-Received: by 2002:a62:2c93:: with SMTP id s141mr6060133pfs.114.1566574983158; Fri, 23 Aug 2019 08:43:03 -0700 (PDT) Received: from 42.do-not-panic.com (42.do-not-panic.com. [157.230.128.187]) by smtp.gmail.com with ESMTPSA id j10sm3060768pfn.188.2019.08.23.08.43.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Aug 2019 08:43:02 -0700 (PDT) Received: by 42.do-not-panic.com (Postfix, from userid 1000) id 50B72404D5; Fri, 23 Aug 2019 15:43:01 +0000 (UTC) Date: Fri, 23 Aug 2019 15:43:01 +0000 From: Luis Chamberlain To: Takashi Iwai Cc: Scott Branden , Greg Kroah-Hartman , Andy Gross , David Brown , Alexander Viro , Shuah Khan , bjorn.andersson@linaro.org, "Rafael J . Wysocki" , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-fsdevel@vger.kernel.org, BCM Kernel Feedback , Olof Johansson , Andrew Morton , Dan Carpenter , Colin Ian King , Kees Cook , linux-kselftest@vger.kernel.org Subject: Re: [PATCH 3/3] firmware: add mutex fw_lock_fallback for race condition Message-ID: <20190823154301.GT16384@42.do-not-panic.com> References: <20190816000945.29810-1-scott.branden@broadcom.com> <20190816000945.29810-4-scott.branden@broadcom.com> <20190819053937.GR16384@42.do-not-panic.com> <16823ee6-c52a-b3b5-caed-79c00772fa68@broadcom.com> <20190820012655.GU16384@42.do-not-panic.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 23, 2019 at 12:31:40PM +0200, Takashi Iwai wrote: > So, if any, we'd need put a mutex around the fallback loader code. > And, the mutex should be rather per device, not a global one. > > Or we may trick it by appending the second parallel caller into the > same wait queue, but the code will be more complex, so I don't think > worth for it. For now I'm thinking of a new API with a devname prefix to the driver. I'll have to test if that works, but not sure if I'll get to it today before my vacation starts (today). Luis