Re: [trivial PATCH] treewide: Convert switch/case fallthrough; to break;

2020-09-10 Thread Felipe Balbi
Hi,

Joe Perches  writes:
>  drivers/usb/dwc3/core.c   |  2 +-
>  drivers/usb/gadget/legacy/inode.c |  2 +-
>  drivers/usb/gadget/udc/pxa25x_udc.c   |  4 ++--
>  drivers/usb/phy/phy-fsl-usb.c |  2 +-

for the drivers above:

Acked-by: Felipe Balbi 

-- 
balbi


signature.asc
Description: PGP signature
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH 12/18] fotg210-udc: remove a bogus dma_sync_single_for_device call

2019-02-11 Thread Felipe Balbi

Hi,

Christoph Hellwig  writes:
> On Fri, Feb 01, 2019 at 05:10:26PM +0100, Christoph Hellwig wrote:
>> On Fri, Feb 01, 2019 at 03:19:41PM +0200, Felipe Balbi wrote:
>> > Christoph Hellwig  writes:
>> > 
>> > > dma_map_single already transfers ownership to the device.
>> > >
>> > > Signed-off-by: Christoph Hellwig 
>> > 
>> > Do you want me to take the USB bits or will you take the entire series?
>> > In case you're taking the entire series:
>> 
>> If you want to take the USB feel free.  I just want most of this in
>> this merge window if possible.
>
> I didn't see in the USB tree yet, so please let me know if you want to
> take it.

sorry for the delay, just took it to my tree.

-- 
balbi


signature.asc
Description: PGP signature
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH 13/18] fotg210-udc: pass struct device to DMA API functions

2019-02-01 Thread Felipe Balbi
Christoph Hellwig  writes:

> The DMA API generally relies on a struct device to work properly, and
> only barely works without one for legacy reasons.  Pass the easily
> available struct device from the platform_device to remedy this.
>
> Signed-off-by: Christoph Hellwig 

In case you're taking the entire series:

Acked-by: Felipe Balbi 

-- 
balbi


signature.asc
Description: PGP signature
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH/RFC 6/6] Treewide: Remove depends on HAS_DMA in case of platform dependency

2018-02-15 Thread Felipe Balbi
Geert Uytterhoeven <ge...@linux-m68k.org> writes:

> Remove dependencies on HAS_DMA where a Kconfig symbol depends on another
> symbol that implies HAS_DMA, and, optionally, on "|| COMPILE_TEST".
> In most cases this other symbol is an architecture or platform specific
> symbol, or PCI.
>
> Generic symbols and drivers without platform dependencies keep their
> dependencies on HAS_DMA, to prevent compiling subsystems or drivers that
> cannot work anyway.
>
> This simplifies the dependencies, and allows to improve compile-testing.
>
> Notes:
>   - FSL_FMAN keeps its dependency on HAS_DMA, as it calls set_dma_ops(),
> which does not exist if HAS_DMA=n (Do we need a dummy? The use of
> set_dma_ops() in this driver is questionable),
>   - SND_SOC_LPASS_IPQ806X and SND_SOC_LPASS_PLATFORM loose their
> dependency on HAS_DMA, as they are selected from
> SND_SOC_APQ8016_SBC.
>
> Signed-off-by: Geert Uytterhoeven <ge...@linux-m68k.org>

for drivers/usb/gadget/:

Acked-by: Felipe Balbi <felipe.ba...@linux.intel.com>

-- 
balbi


signature.asc
Description: PGP signature
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH/RFC 3/6] usb: gadget: Add NO_DMA dummies for DMA mapping API

2018-02-15 Thread Felipe Balbi

Hi,

Geert Uytterhoeven <ge...@linux-m68k.org> writes:
> Add dummies for usb_gadget_{,un}map_request{,_by_dev}(), to allow
> compile-testing if NO_DMA=y.
>
> This prevents the following from showing up later:
>
> ERROR: "usb_gadget_unmap_request_by_dev" 
> [drivers/usb/renesas_usbhs/renesas_usbhs.ko] undefined!
> ERROR: "usb_gadget_map_request_by_dev" 
> [drivers/usb/renesas_usbhs/renesas_usbhs.ko] undefined!
> ERROR: "usb_gadget_map_request" [drivers/usb/mtu3/mtu3.ko] undefined!
> ERROR: "usb_gadget_unmap_request" [drivers/usb/mtu3/mtu3.ko] undefined!
> ERROR: "usb_gadget_map_request" [drivers/usb/gadget/udc/renesas_usb3.ko] 
> undefined!
> ERROR: "usb_gadget_unmap_request" 
> [drivers/usb/gadget/udc/renesas_usb3.ko] undefined!
>
> Signed-off-by: Geert Uytterhoeven <ge...@linux-m68k.org>

Should I take this or is it going with the rest of the series? If you
wanna take it through Trivial or something like that:

Acked-by: Felipe Balbi <felipe.ba...@linux.intel.com>

-- 
balbi


signature.asc
Description: PGP signature
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH v1] ACPI: Switch to use generic UUID API

2017-05-09 Thread Felipe Balbi

Hi,

Andy Shevchenko <andriy.shevche...@linux.intel.com> writes:
> acpi_evaluate_dsm() and friends take a pointer to a raw buffer of 16
> bytes. Instead we convert them to use uuid_le type. At the same time we
> convert current users.
>
> acpi_str_to_uuid() becomes useless after the conversion and it's safe to
> get rid of it.
>
> The conversion fixes a potential bug in int340x_thermal as well since
> we have to use memcmp() on binary data.
>
> Cc: Rafael J. Wysocki <r...@rjwysocki.net>
> Cc: Mika Westerberg <mika.westerb...@linux.intel.com>
> Cc: Borislav Petkov <b...@suse.de>
> Cc: Dan Williams <dan.j.willi...@intel.com>
> Cc: Amir Goldstein <amir7...@gmail.com>
> Cc: Jarkko Sakkinen <jarkko.sakki...@linux.intel.com>
> Cc: Jani Nikula <jani.nik...@linux.intel.com>
> Cc: Ben Skeggs <bske...@redhat.com>
> Cc: Benjamin Tissoires <benjamin.tissoi...@redhat.com>
> Cc: Joerg Roedel <j...@8bytes.org>
> Cc: Adrian Hunter <adrian.hun...@intel.com>
> Cc: Yisen Zhuang <yisen.zhu...@huawei.com>
> Cc: Bjorn Helgaas <bhelg...@google.com>
> Cc: Zhang Rui <rui.zh...@intel.com>
> Cc: Felipe Balbi <ba...@kernel.org>
> Cc: Mathias Nyman <mathias.ny...@intel.com>
> Cc: Heikki Krogerus <heikki.kroge...@linux.intel.com>
> Cc: Liam Girdwood <lgirdw...@gmail.com>
> Cc: Mark Brown <broo...@kernel.org>
> Signed-off-by: Andy Shevchenko <andriy.shevche...@linux.intel.com>
> diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c
> index a15ec71d0423..6b5284ec76df 100644
> --- a/drivers/usb/dwc3/dwc3-pci.c
> +++ b/drivers/usb/dwc3/dwc3-pci.c
> @@ -56,7 +56,7 @@ struct dwc3_pci {
>   struct platform_device *dwc3;
>   struct pci_dev *pci;
>  
> - u8 uuid[16];
> + uuid_le uuid;
>  
>   unsigned int has_dsm_for_pm:1;
>  };
> @@ -118,7 +118,7 @@ static int dwc3_pci_quirks(struct dwc3_pci *dwc)
>  
>   if (pdev->device == PCI_DEVICE_ID_INTEL_BXT ||
>   pdev->device == PCI_DEVICE_ID_INTEL_BXT_M) {
> - acpi_str_to_uuid(PCI_INTEL_BXT_DSM_UUID, dwc->uuid);
> + uuid_le_to_bin(PCI_INTEL_BXT_DSM_UUID, >uuid);
>   dwc->has_dsm_for_pm = true;
>   }
>  
> @@ -288,7 +288,7 @@ static int dwc3_pci_dsm(struct dwc3_pci *dwc, int param)
>   tmp.type = ACPI_TYPE_INTEGER;
>   tmp.integer.value = param;
>  
> - obj = acpi_evaluate_dsm(ACPI_HANDLE(>pci->dev), dwc->uuid,
> + obj = acpi_evaluate_dsm(ACPI_HANDLE(>pci->dev), >uuid,
>   1, PCI_INTEL_BXT_FUNC_PMU_PWR, );
>   if (!obj) {
>   dev_err(>pci->dev, "failed to evaluate _DSM\n");

Acked-by: Felipe Balbi <felipe.ba...@linux.intel.com>

-- 
balbi
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu


Re: [PATCH 2/2] iommu/tegra: smmu: Use __debugfs_create_dir

2012-08-08 Thread Felipe Balbi
Hi,

On Wed, Aug 08, 2012 at 06:11:29PM +0300, Felipe Balbi wrote:
 Hi,
 
 On Wed, Aug 08, 2012 at 09:24:33AM +0300, Hiroshi Doyu wrote:
  The commit c3b1a35 debugfs: make sure that debugfs_create_file() gets
  used only for regulars doesn't allow to use debugfs_create_file() for
  dir. Use the version with data, __debugfs_create_dir().
  
  Signed-off-by: Hiroshi Doyu hd...@nvidia.com
  Reported-by: Laxman Dewangan ldewan...@nvidia.com
  ---
   drivers/iommu/tegra-smmu.c |4 +---
   1 files changed, 1 insertions(+), 3 deletions(-)
  
  diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c
  index 5e51fb7..41aff7a 100644
  --- a/drivers/iommu/tegra-smmu.c
  +++ b/drivers/iommu/tegra-smmu.c
  @@ -1035,9 +1035,7 @@ static void smmu_debugfs_create(struct smmu_device 
  *smmu)
  int i;
  struct dentry *root;
   
  -   root = debugfs_create_file(dev_name(smmu-dev),
  -  S_IFDIR | S_IRWXU | S_IRUGO | S_IXUGO,
  -  NULL, smmu, NULL);
  +   root = __debugfs_create_dir(dev_name(smmu-dev), NULL, smmu);
 
 why would the directory need extra data ? Looking in mainline,
 tegra-smmu.c doesn't have any debugfs support, where can I see the
 patches adding debugfs to tegra-smmu ? It doesn't look correct that the
 directory will have a data field.

Looking at linux-next I found the commit which added it:

 @@ -892,6 +909,164 @@ static struct iommu_ops smmu_iommu_ops = {
   .pgsize_bitmap  = SMMU_IOMMU_PGSIZES,
  };
  
 +/* Should be in the order of enum */
 +static const char * const smmu_debugfs_mc[] = { mc, };
 +static const char * const smmu_debugfs_cache[] = {  tlb, ptc, };
 +
 +static ssize_t smmu_debugfs_stats_write(struct file *file,
 + const char __user *buffer,
 + size_t count, loff_t *pos)
 +{
 + struct smmu_device *smmu;
 + struct dentry *dent;
 + int i, cache, mc;
 + enum {
 + _OFF = 0,
 + _ON,
 + _RESET,
 + };
 + const char * const command[] = {
 + [_OFF]  = off,
 + [_ON]   = on,
 + [_RESET]= reset,
 + };
 + char str[] = reset;
 + u32 val;
 + size_t offs;
 +
 + count = min_t(size_t, count, sizeof(str));
 + if (copy_from_user(str, buffer, count))
 + return -EINVAL;
 +
 + for (i = 0; i  ARRAY_SIZE(command); i++)
 + if (strncmp(str, command[i],
 + strlen(command[i])) == 0)
 + break;
 +
 + if (i == ARRAY_SIZE(command))
 + return -EINVAL;
 +
 + dent = file-f_dentry;
 + cache = (int)dent-d_inode-i_private;

cache you can figure out by the filename. In fact, it would be much
better to have tlc and ptc directories with a status filename which
you write ON/OFF/RESET or enable/disable/reset to trigger what you need.

For that to work, you should probably hold tlb and ptc on an array of
some sort, and pass those as data to their respective status files as
the data field. If tlb and ptc are properly defined structures which can
point back to smmu, then you have everything you need.

I mean something like:

struct smmu;

struct mc {
const char *name;
void __iomem *regs;

struct smmu *smmu;
};

struct smmu {
struct mc mc[2]; /*what does mc stand for ? memory controller ? */

...
};

debugfs_create_dir(smmu);
debugfs_create_dir(mc);
debugfs_create_dir(smmu-mc[1].name);
debugfs_create_dir(smmu-mc[2].name);
debugfs_create_file(smmu-mc[1], status);
debugfs_create_file(smmu-mc[2], status);

or something similar. You will avoid all the trickery you did here to
achieve what you need.

 + mc = (int)dent-d_parent-d_inode-i_private;
 + smmu = dent-d_parent-d_parent-d_inode-i_private;
 +
 + offs = SMMU_CACHE_CONFIG(cache);
 + val = smmu_read(smmu, offs);
 + switch (i) {
 + case _OFF:
 + val = ~SMMU_CACHE_CONFIG_STATS_ENABLE;
 + val = ~SMMU_CACHE_CONFIG_STATS_TEST;
 + smmu_write(smmu, val, offs);
 + break;
 + case _ON:
 + val |= SMMU_CACHE_CONFIG_STATS_ENABLE;
 + val = ~SMMU_CACHE_CONFIG_STATS_TEST;
 + smmu_write(smmu, val, offs);
 + break;
 + case _RESET:
 + val |= SMMU_CACHE_CONFIG_STATS_TEST;
 + smmu_write(smmu, val, offs);
 + val = ~SMMU_CACHE_CONFIG_STATS_TEST;
 + smmu_write(smmu, val, offs);
 + break;
 + default:
 + BUG();
 + break;
 + }
 +
 + dev_dbg(smmu-dev, %s() %08x, %08x @%08x\n, __func__,
 + val, smmu_read(smmu, offs), offs);
 +
 + return count;
 +}
 +
 +static int smmu_debugfs_stats_show(struct seq_file *s, void *v)
 +{
 + struct smmu_device *smmu;
 + struct dentry *dent;
 + int i, cache, mc;
 + const char * const stats[] = { hit, miss