lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 4 Jul 2022 11:13:10 +0530
From:   Vinod Koul <vkoul@...nel.org>
To:     Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
Cc:     Bard Liao <yung-chuan.liao@...ux.intel.com>,
        alsa-devel@...a-project.org, linux-kernel@...r.kernel.org,
        gregkh@...uxfoundation.org, srinivas.kandagatla@...aro.org,
        sanyog.r.kale@...el.com, bard.liao@...el.com
Subject: Re: [PATCH] soundwire: bus_type: fix remove and shutdown support

On 23-06-22, 09:54, Pierre-Louis Bossart wrote:
> 
> 
> On 6/23/22 02:55, Vinod Koul wrote:
> > On 10-06-22, 09:51, Bard Liao wrote:
> >> From: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
> >>
> >> The bus sdw_drv_remove() and sdw_drv_shutdown() helpers are used
> >> conditionally, if the driver provides these routines.
> >>
> >> These helpers already test if the driver provides a .remove or
> >> .shutdown callback, so there's no harm in invoking the
> >> sdw_drv_remove() and sdw_drv_shutdown() unconditionally.
> > 
> > Okay sounds good
> > 
> >> In addition, the current code is imbalanced with
> >> dev_pm_domain_attach() called from sdw_drv_probe(), but
> >> dev_pm_domain_detach() called from sdw_drv_remove() only if the driver
> >> provides a .remove callback.
> > 
> > Am not sure I follow what is imbalance, pm_domain_attach/detach?
> 
> Yes, the dev_pm_domain_detach() is done conditionally, depending on the
> presence of a driver .remove callback, that's not so good.

Sorry am bit confused now, this is what I have in sdw-next

static int sdw_drv_remove(struct device *dev)
{
        struct sdw_slave *slave = dev_to_sdw_dev(dev);
        struct sdw_driver *drv = drv_to_sdw_driver(dev->driver);
        int ret = 0;

        if (drv->remove)
                ret = drv->remove(slave);

        dev_pm_domain_detach(dev, false);

        return ret;
}

I see that dev_pm_domain_detach() is called unconditionally and not
dependent on remove method which seems right to me.

The code seems same since 9251345dca24b

-- 
~Vinod

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ