History log of /linux-master/drivers/usb/host/ohci-sm501.c
Revision Date Author Comments
# 3ddde5aa 09-Aug-2023 Yang Yingliang <yangyingliang@huawei.com>

USB: ohci-sm501: remove unnecessary check of mem

The resource is checked in probe function, so there is
no need do this check in remove function.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/20230809085348.2761782-1-yangyingliang@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 982366fc 17-May-2023 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

usb: ohci-sm501: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart from
emitting a warning) and this typically results in resource leaks. To improve
here there is a quest to make the remove callback return void. In the first
step of this quest all drivers are converted to .remove_new() which already
returns void. Eventually after all drivers are converted, .remove_new() is
renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20230517230239.187727-74-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 7d34b071 20-Jun-2022 Xiang wangx <wangxiang@cdjrlc.com>

USB: ohci-sm501: Fix typo in comment

Delete the redundant word 'the'.

Signed-off-by: Xiang wangx <wangxiang@cdjrlc.com>
Link: https://lore.kernel.org/r/20220620101556.2290-1-wangxiang@cdjrlc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 07c112fb 09-Jun-2020 Chuhong Yuan <hslester96@gmail.com>

USB: ohci-sm501: Add missed iounmap() in remove

This driver misses calling iounmap() in remove to undo the ioremap()
called in probe.
Add the missed call to fix it.

Fixes: f54aab6ebcec ("usb: ohci-sm501 driver")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/20200610024844.3628408-1-hslester96@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# b919e077 06-May-2020 Wei Yongjun <weiyongjun1@huawei.com>

USB: ohci-sm501: fix error return code in ohci_hcd_sm501_drv_probe()

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: 7d9e6f5aebe8 ("usb: host: ohci-sm501: init genalloc for local memory")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/20200506135625.106910-1-weiyongjun1@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# a1747eb4 03-Sep-2019 Christoph Hellwig <hch@lst.de>

usb/ohci-sm501: remove the HCD_DMA flag

This driver doesn't support normal DMA, only direct access to its
local memory. Remove the HCD_DMA flag to properly express that fact.

Fixes: 7b81cb6bddd2 ("usb: add a HCD_DMA flag instead of guestimating DMA capabilities")
Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20190903084615.19161-2-hch@lst.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 7b81cb6b 16-Aug-2019 Christoph Hellwig <hch@lst.de>

usb: add a HCD_DMA flag instead of guestimating DMA capabilities

The usb core is the only major place in the kernel that checks for
a non-NULL device dma_mask to see if a device is DMA capable. This
is generally a bad idea, as all major busses always set up a DMA mask,
even if the device is not DMA capable - in fact bus layers like PCI
can't even know if a device is DMA capable at enumeration time. This
leads to lots of workaround in HCD drivers, and also prevented us from
setting up a DMA mask for platform devices by default last time we
tried.

Replace this guess with an explicit HCD_DMA that is set by drivers that
appear to have DMA support.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20190816062435.881-4-hch@lst.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 2d7a3dc3 29-May-2019 Laurentiu Tudor <laurentiu.tudor@nxp.com>

USB: drop HCD_LOCAL_MEM flag

With the addition of the local memory allocator, the HCD_LOCAL_MEM
flag can be dropped and the checks against it replaced with a check
for the localmem_pool ptr being initialized.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Tested-by: Fredrik Noring <noring@nocrew.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>


# 7d9e6f5a 29-May-2019 Laurentiu Tudor <laurentiu.tudor@nxp.com>

usb: host: ohci-sm501: init genalloc for local memory

In preparation for dropping the existing "coherent" dma mem declaration
APIs, replace the current dma_declare_coherent_memory() based mechanism
with the creation of a genalloc pool that will be used in the OHCI
subsystem as replacement for the DMA APIs.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>


# 82c5de0a 25-Dec-2018 Christoph Hellwig <hch@lst.de>

dma-mapping: remove the DMA_MEMORY_EXCLUSIVE flag

All users of dma_declare_coherent want their allocations to be
exclusive, so default to exclusive allocations.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5fd54ace 03-Nov-2017 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: add SPDX identifiers to all remaining files in drivers/usb/

It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.

Update the drivers/usb/ and include/linux/usb* files with the correct
SPDX license identifier based on the license text in the file itself.
The SPDX identifier is a legally binding shorthand, which can be used
instead of the full boiler plate text.

This work is based on a script and data from Thomas Gleixner, Philippe
Ombredanne, and Kate Stewart.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Kate Stewart <kstewart@linuxfoundation.org>
Cc: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Acked-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 2436bdcd 25-Aug-2017 Christoph Hellwig <hch@lst.de>

dma-coherent: remove the DMA_MEMORY_MAP and DMA_MEMORY_IO flags

DMA_MEMORY_IO was never used in the tree, so remove it. That means there is
no need for the DMA_MEMORY_MAP flag either now, so remove it as well and
change dma_declare_coherent_memory to return a normal errno value.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Marek Szyprowski <m.szyprowski@samsung.com>


# 1d978691 21-Dec-2014 Wolfram Sang <wsa@kernel.org>

usb: host: drop owner assignment from platform_drivers

These platform_drivers do not need to set an owner, it will be populated by the
driver core.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 3c9740a1 04-Nov-2013 Peter Chen <peter.chen@freescale.com>

usb: hcd: move controller wakeup setting initialization to individual driver

Individual controller driver has different requirement for wakeup
setting, so move it from core to itself. In order to align with
current etting the default wakeup setting is enabled (except for
chipidea host).

Pass compile test with below commands:
make O=outout/all allmodconfig
make -j$CPU_NUM O=outout/all drivers/usb

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# f3c60599 03-Oct-2013 Manjunath Goudar <manjunath.goudar@linaro.org>

USB: OHCI: Properly handle ohci-sm501 suspend

Suspend scenario in case of ohci-sm501 glue was not
properly handled as it was not suspending generic part
of ohci controller. Alan Stern suggested, properly
handle ohci-sm501 suspend scenario.

Calling explicitly the ohci_suspend() routine in
ohci_sm501_suspend() will ensure proper handling of suspend
scenario.

Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8adfef76 06-May-2013 Jingoo Han <jg1.han@samsung.com>

USB: ohci-sm501: remove unnecessary platform_set_drvdata()

The driver core clears the driver data to NULL after device_release
or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d
(device-core: Ensure drvdata = NULL when no driver is bound).
Thus, it is not needed to manually clear the device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 068b054f 22-Oct-2012 Florian Fainelli <florian@openwrt.org>

USB: OHCI: sm501: fix build failure after ohci_finish_controller_resume removal

Commit cfa49b4b (USB: ohci: merge ohci_finish_controller_resume with
ohci_resume) merged ohci_finish_controller_resume with ohci_resume but forgot
to update the ohci-sm501 driver accordingly, thus causing the folllowing build
failure:

drivers/usb/host/ohci-sm501.c: In function 'ohci_sm501_resume':
drivers/usb/host/ohci-sm501.c:241:2: error: implicit declaration of function
'ohci_finish_controller_resume' [-Werror=implicit-function-declaration]

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Florian Fainelli <florian@openwrt.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# b7463c71 17-Nov-2011 Alan Stern <stern@rowland.harvard.edu>

OHCI: remove uses of hcd->state

This patch (as1500) removes all uses of the objectionable hcd->state
variable from the ohci-hcd family of drivers. It is replaced by a
private ohci->rh_state field, just as in uhci-hcd and ehci-hcd.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# b5dd18d8 07-Sep-2011 Yong Zhang <yong.zhang0@gmail.com>

USB: irq: Remove IRQF_DISABLED

This flag is a NOOP and can be removed now.

Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 28f65c11 09-Jun-2011 Joe Perches <joe@perches.com>

treewide: Convert uses of struct resource to resource_size(ptr)

Several fixes as well where the +1 was missing.

Done via coccinelle scripts like:

@@
struct resource *ptr;
@@

- ptr->end - ptr->start + 1
+ resource_size(ptr)

and some grep and typing.

Mostly uncompiled, no cross-compilers.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>


# 637ed74f 10-Sep-2010 Dan Carpenter <error27@gmail.com>

USB: ohci-sm501: add iounmap on error path

This ioremap() was leaked on an error path.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# b5fb454f 20-Aug-2008 Alan Stern <stern@rowland.harvard.edu>

USB: automatically enable RHSC interrupts

This patch (as1069c) changes the way OHCI root-hub status-change
interrupts are enabled. Currently a special HCD method,
hub_irq_enable(), is called when the hub driver is finished using a
root hub. This approach turns out to be subject to races, resulting
in unnecessary polling.

The patch does away with the method entirely. Instead, the driver
automatically enables the RHSC interrupt when no more status changes
are present. This scheme is safe with controllers using
level-triggered semantics for their interrupt flags.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 7071a3ce 01-May-2008 Kay Sievers <kay.sievers@vrfy.org>

USB: usb dev_name() instead of dev->bus_id

The bus_id field is going away, use the dev_name() function instead.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 09ca8adb 06-Jul-2008 Linus Torvalds <torvalds@linux-foundation.org>

Revert "USB: don't explicitly reenable root-hub status interrupts"

This reverts commit e872154921a6b5256a3c412dd69158ac0b135176.

Andrey Borzenkov reports that it resulted in a totally hung machine for
him when loading the OHCI driver. Extensive netconsole capture with
SysRq output shows that modprobe gets stuck in ohci_hub_status_data()
when probing and enabling the OHCI controller, see for example

http://lkml.org/lkml/2008/7/5/236

for an analysis.

The problem appears to be an interrupt flood triggered by the commit
that gets reverted, and Andrey confirmed that the revert makes things
work for him again.

Reported-and-tested-by: Andrey Borzenkov <arvidjaar@mail.ru>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: David Brownell <david-b@pacbell.net>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# af3d305c 30-Apr-2008 Harvey Harrison <harvey.harrison@gmail.com>

usb: fix integer as NULL pointer warnings found by sparse

drivers/usb/host/ohci-sm501.c:93:24: warning: Using plain integer as NULL pointer
drivers/usb/gadget/amd5536udc.c:3254:9: warning: Using plain integer as NULL pointer
drivers/usb/gadget/amd5536udc.c:3267:9: warning: Using plain integer as NULL pointer
drivers/usb/gadget/amd5536udc.c:3277:9: warning: Using plain integer as NULL pointer
drivers/usb/gadget/amd5536udc.c:3285:9: warning: Using plain integer as NULL pointer
drivers/usb/gadget/amd5536udc.c:3293:9: warning: Using plain integer as NULL pointer

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# e8721549 13-Apr-2008 Alan Stern <stern@rowland.harvard.edu>

USB: don't explicitly reenable root-hub status interrupts

This patch (as1069b) changes the way OHCI root-hub status-change
interrupts are enabled. Currently a special HCD method,
hub_irq_enable(), is called when the hub driver is finished using a
root hub. This approach turns out to be subject to races, resulting
in unnecessary polling.

The patch does away with the method entirely. Instead, the driver
automatically enables the RHSC interrupt when no more status changes
are present. This scheme is safe with controllers using
level-triggered semantics for their interrupt flags.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 43bbb7e0 03-Apr-2008 Alan Stern <stern@rowland.harvard.edu>

USB: OHCI: host-controller resumes leave root hub suspended

Drivers in the ohci-hcd family should perform certain tasks whenever
their controller device is resumed. These include checking for loss
of power during suspend, turning on port power, and enabling interrupt
requests.

Until now these jobs have been carried out when the root hub is
resumed, not when the controller is. Many drivers work around the
resulting awkwardness by automatically resuming their root hub
whenever the controller is resumed. But this is wasteful and
unnecessary.

To simplify the situation, this patch (as1066) adds a new core
routine, ohci_finish_controller_resume(), which can be used by all the
OHCI-variant drivers. They can call the new routine instead of
resuming their root hubs. And ohci-pci.c can call it instead of using
its own special-purpose handler.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 119fc8c9 21-Mar-2008 Jesper Juhl <jesper.juhl@gmail.com>

USB: test for NULL return from platform_get_resource() in ohci_hcd_sm501_drv_remove()

platform_get_resource() may return null, so although it seems it will never
do so here unless there's a bug elsewhere, it does no harm to be defensive
and test.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Magnus Damm <magnus.damm@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 70a1c9e0 06-Mar-2008 Alan Stern <stern@rowland.harvard.edu>

USB: remove dev->power.power_state

power.power_state is scheduled for removal. This patch (as1053)
removes all uses of that field from drivers/usb. Almost all of them
were write-only, the most significant exceptions being sl811-hcd.c and
u132-hcd.c.

Part of this patch was written by Pavel Machek.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: David Brownell <david-b@pacbell.net>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 1409e8e0 05-Feb-2008 Andrew Morton <akpm@linux-foundation.org>

USB: usb-ohci-sm501-driver: use the conventional convention for suspend and resume

Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# f4fce61d 10-Apr-2008 Kay Sievers <kay.sievers@vrfy.org>

usb host: fix platform driver hotplug/coldplug

Since 43cc71eed1250755986da4c0f9898f9a635cb3bf, the platform modalias is
prefixed with "platform:". Add MODULE_ALIAS() to the hotpluggable USB HCDs,
to allow re-enable auto loading.

[dbrownell@users.sourceforge.net: more drivers; registration fixes]
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# f54aab6e 22-Jan-2008 Magnus Damm <magnus.damm@gmail.com>

usb: ohci-sm501 driver

usb: ohci-sm501 driver V2

This patch adds sm501 ohci support. It's all very straightforward with the
exception of dma_declare_coherent_memory() and HCD_LOCAL_MEM. Together they
are used to ensure that usb data is allocated using dma_alloc_coherent(),
and that only valid dma memory is used to allocate from. This driver is
a platform device, and the mfd driver sm501.c is already creating one
usb host controller instance per sm501.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>