From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Vinod Koul <vkoul@kernel.org>
Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
tiwai@suse.de, broonie@kernel.org, gregkh@linuxfoundation.org,
jank@cadence.com, srinivas.kandagatla@linaro.org,
slawomir.blauciak@intel.com,
Bard liao <yung-chuan.liao@linux.intel.com>,
Rander Wang <rander.wang@linux.intel.com>,
Ranjani Sridharan <ranjani.sridharan@linux.intel.com>,
Hui Wang <hui.wang@canonical.com>,
Sanyog Kale <sanyog.r.kale@intel.com>
Subject: Re: [PATCH 4/7] soundwire: intel: add definitions for shim_mask
Date: Fri, 20 Mar 2020 09:13:03 -0500 [thread overview]
Message-ID: <deeb3af8-e950-651c-50d6-6223e75801e9@linux.intel.com> (raw)
In-Reply-To: <20200320134257.GD4885@vkoul-mobl>
>> diff --git a/drivers/soundwire/intel.h b/drivers/soundwire/intel.h
>> index 568c84a80d79..cfc83120b8f9 100644
>> --- a/drivers/soundwire/intel.h
>> +++ b/drivers/soundwire/intel.h
>> @@ -16,6 +16,7 @@
>> * @ops: Shim callback ops
>> * @dev: device implementing hw_params and free callbacks
>> * @shim_lock: mutex to handle access to shared SHIM registers
>> + * @shim_mask: global pointer to check SHIM register initialization
>> */
>> struct sdw_intel_link_res {
>> struct platform_device *pdev;
>> @@ -27,6 +28,7 @@ struct sdw_intel_link_res {
>> const struct sdw_intel_ops *ops;
>> struct device *dev;
>> struct mutex *shim_lock; /* protect shared registers */
>> + u32 *shim_mask;
>
> You have a pointer, okay where is it initialized
same answer as shim_lock, it's initialized at the higher level
https://github.com/thesofproject/linux/blob/9c7487b33072040ab755d32ca173b75151c0160c/drivers/soundwire/intel_init.c#L252
>> };
>>
>> #endif /* __SDW_INTEL_LOCAL_H */
>> diff --git a/include/linux/soundwire/sdw_intel.h b/include/linux/soundwire/sdw_intel.h
>> index 979b41b5dcb4..120ffddc03d2 100644
>> --- a/include/linux/soundwire/sdw_intel.h
>> +++ b/include/linux/soundwire/sdw_intel.h
>> @@ -115,6 +115,7 @@ struct sdw_intel_slave_id {
>> * links
>> * @link_list: list to handle interrupts across all links
>> * @shim_lock: mutex to handle concurrent rmw access to shared SHIM registers.
>> + * @shim_mask: flags to track initialization of SHIM shared registers
>> */
>> struct sdw_intel_ctx {
>> int count;
>> @@ -126,6 +127,7 @@ struct sdw_intel_ctx {
>> struct sdw_intel_slave_id *ids;
>> struct list_head link_list;
>> struct mutex shim_lock; /* lock for access to shared SHIM registers */
>> + u32 shim_mask;
>
> And a integer, question: why do you need pointer and integer, why not
> use only one..?
You may have missed that the structures are different.
the sdw_intel_ctx is global for all links, so that the shim_mask integer
value.
the sdw_intel_link_res is link-specific and use a pointer to the same
shim_mask value, protected by shim_lock.
next prev parent reply other threads:[~2020-03-20 18:18 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-11 22:10 [PATCH 0/7] SoundWire: intel: fix SHIM programming sequences Pierre-Louis Bossart
2020-03-11 22:10 ` [PATCH 1/7] soundwire: intel: add helpers for link power down and shim wake Pierre-Louis Bossart
2020-03-11 22:10 ` [PATCH 2/7] soundwire: intel: reuse code for wait loops to set/clear bits Pierre-Louis Bossart
2020-03-20 13:38 ` Vinod Koul
2020-03-11 22:10 ` [PATCH 3/7] soundwire: intel: add mutex to prevent concurrent access to SHIM registers Pierre-Louis Bossart
2020-03-20 13:41 ` Vinod Koul
2020-03-20 14:07 ` Pierre-Louis Bossart
2020-03-23 12:18 ` Vinod Koul
2020-03-11 22:10 ` [PATCH 4/7] soundwire: intel: add definitions for shim_mask Pierre-Louis Bossart
2020-03-20 13:42 ` Vinod Koul
2020-03-20 14:13 ` Pierre-Louis Bossart [this message]
2020-03-23 12:28 ` Vinod Koul
2020-03-11 22:10 ` [PATCH 5/7] soundwire: intel: follow documentation sequences for SHIM registers Pierre-Louis Bossart
2020-03-20 13:51 ` Vinod Koul
2020-03-20 14:20 ` Pierre-Louis Bossart
2020-03-23 12:31 ` Vinod Koul
2020-03-11 22:10 ` [PATCH 6/7] soundwire: intel: introduce a helper to arm link synchronization Pierre-Louis Bossart
2020-03-11 22:10 ` [PATCH 7/7] soundwire: intel: introduce helper for " Pierre-Louis Bossart
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=deeb3af8-e950-651c-50d6-6223e75801e9@linux.intel.com \
--to=pierre-louis.bossart@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=hui.wang@canonical.com \
--cc=jank@cadence.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rander.wang@linux.intel.com \
--cc=ranjani.sridharan@linux.intel.com \
--cc=sanyog.r.kale@intel.com \
--cc=slawomir.blauciak@intel.com \
--cc=srinivas.kandagatla@linaro.org \
--cc=tiwai@suse.de \
--cc=vkoul@kernel.org \
--cc=yung-chuan.liao@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox