From patchwork Wed Apr 6 13:55:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 8762491 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 761FB9F36E for ; Wed, 6 Apr 2016 13:55:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 93A9B201B4 for ; Wed, 6 Apr 2016 13:55:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EACD7200D6 for ; Wed, 6 Apr 2016 13:55:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751785AbcDFNz2 (ORCPT ); Wed, 6 Apr 2016 09:55:28 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:57373 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750792AbcDFNz2 (ORCPT ); Wed, 6 Apr 2016 09:55:28 -0400 Received: from [209.65.105.133] (helo=smtp.w2.samsung.com) by bombadil.infradead.org with esmtpsa (Exim 4.80.1 #2 (Red Hat Linux)) id 1annvb-0003YV-8I; Wed, 06 Apr 2016 13:55:27 +0000 Received: from mchehab by smtp.w2.samsung.com with local (Exim 4.86_2) (envelope-from ) id 1annva-00086t-Sv; Wed, 06 Apr 2016 06:55:26 -0700 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Linux Media Mailing List , Mauro Carvalho Chehab Subject: [PATCH 2/2] [media] media: Improve documentation for link_setup/link_modify Date: Wed, 6 Apr 2016 06:55:25 -0700 Message-Id: X-Mailer: git-send-email 2.5.5 In-Reply-To: References: In-Reply-To: References: To: unlisted-recipients:; (no To-header on input) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Those callbacks are called with the media_device.graph_mutex hold. Add a note about that, as the code called by those notifiers should not be touching in the mutex. Signed-off-by: Mauro Carvalho Chehab Acked-by: Sakari Ailus Acked-by: Hans Verkuil --- include/media/media-device.h | 3 ++- include/media/media-entity.h | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/media/media-device.h b/include/media/media-device.h index b21ef244ad3e..44563ec17d45 100644 --- a/include/media/media-device.h +++ b/include/media/media-device.h @@ -311,7 +311,8 @@ struct media_entity_notify { * @enable_source: Enable Source Handler function pointer * @disable_source: Disable Source Handler function pointer * - * @link_notify: Link state change notification callback + * @link_notify: Link state change notification callback. This callback is + * Called with the graph_mutex hold. * * This structure represents an abstract high-level media device. It allows easy * access to entities and provides basic media device-level support. The diff --git a/include/media/media-entity.h b/include/media/media-entity.h index 6dc9e4e8cbd4..0b16ebe36db7 100644 --- a/include/media/media-entity.h +++ b/include/media/media-entity.h @@ -179,6 +179,9 @@ struct media_pad { * @link_validate: Return whether a link is valid from the entity point of * view. The media_entity_pipeline_start() function * validates all links by calling this operation. Optional. + * + * Note: Those ioctls should not touch the struct media_device.@graph_mutex + * field, as they're called with it already hold. */ struct media_entity_operations { int (*link_setup)(struct media_entity *entity,