From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adrian Hunter Subject: Re: [PATCH V5 03/13] mmc: host: Add CQE interface Date: Thu, 24 Aug 2017 09:53:01 +0300 Message-ID: References: <1502366898-23691-1-git-send-email-adrian.hunter@intel.com> <1502366898-23691-4-git-send-email-adrian.hunter@intel.com> <732e8ebc-9b81-90c4-c719-eab1ca0ac220@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Return-path: Received: from mga05.intel.com ([192.55.52.43]:29374 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751124AbdHXG7e (ORCPT ); Thu, 24 Aug 2017 02:59:34 -0400 In-Reply-To: Content-Language: en-US Sender: linux-mmc-owner@vger.kernel.org List-Id: linux-mmc@vger.kernel.org To: Ulf Hansson Cc: linux-mmc , Bough Chen , Alex Lemberg , Mateusz Nowak , Yuliy Izrailov , Jaehoon Chung , Dong Aisheng , Das Asutosh , Zhangfei Gao , Sahitya Tummala , Harjani Ritesh , Venu Byravarasu , Linus Walleij , Shawn Lin On 23/08/17 15:48, Ulf Hansson wrote: > On 23 August 2017 at 08:54, Adrian Hunter wrote: >> On 22/08/17 14:13, Ulf Hansson wrote: >>> On 10 August 2017 at 14:08, Adrian Hunter wrote: >>>> + void (*cqe_recovery_notifier)(struct mmc_host *, >>>> + struct mmc_request *); >>> >>> Normally we don't put callbacks in the struct mmc_host that someone >>> else than the host driver should assign - so this feels a bit upside >>> down. >>> >>> Is there any reason to why you didn't want to add a new API? Something >>> like mmc_cqe_recover(), which the host driver could call. >> >> That would make the host driver dependent on the block driver. There needs >> to be a function pointer, even if we wrap it in an API. > > Okay, I see. I guess we could put such pointer somewhere closer to the > mmc request queue. Another possibility is to put in into struct mmc_request like the "done" callback. > > Anyway, I didn't find out how this pointer was being protected from > concurrent access or perhaps that is managed via > mmc_claim|release_host()? It is assumed CQE is only used by the card driver so the callback can be set / reset in the card driver's probe / remove. > Moreover, I could find it ever it being > reset to NULL. Yeah, doesn't look like it gets reset.